@sixb/core 0.2.5 → 0.2.6
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 +36 -35
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/validation.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/execution.d.ts +17 -2
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/index.d.ts +2 -2
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +50 -44
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-routing.d.ts +5 -2
- package/dist/agents/model-routing.d.ts.map +1 -1
- package/dist/agents/request.d.ts +45 -4
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-events.d.ts +4 -0
- package/dist/agents/run-events.d.ts.map +1 -1
- package/dist/agents/run-session-children.d.ts.map +1 -1
- package/dist/agents/run-turn.d.ts +9 -1
- package/dist/agents/run-turn.d.ts.map +1 -1
- package/dist/agents/streams/index.d.ts +1 -1
- package/dist/agents/streams/index.d.ts.map +1 -1
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.d.ts +2 -1
- package/dist/agents/streams/internal.d.ts.map +1 -1
- package/dist/agents/streams/internal.js +22 -2
- package/dist/agents/streams/internal.js.map +1 -1
- package/dist/agents/streams/protocol.d.ts +37 -0
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/streams/steps.d.ts +24 -0
- package/dist/agents/streams/steps.d.ts.map +1 -0
- package/dist/agents/thread-access.d.ts +44 -2
- package/dist/agents/thread-access.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +19 -18
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/publish/index.js +18 -17
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +2 -1
- package/dist/artifacts/publish/merge.d.ts.map +1 -1
- package/dist/artifacts/run-query.d.ts.map +1 -1
- package/dist/auth/index.js +6 -6
- package/dist/authorization/index.js +2 -2
- package/dist/bootstrap/index.js +40 -38
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/calendar.d.ts +55 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +19 -0
- package/dist/calendar.js.map +9 -0
- package/dist/{chunk-5a4a52tq.js → chunk-0pmpwn3g.js} +18 -2
- package/dist/chunk-0pmpwn3g.js.map +10 -0
- package/dist/{chunk-xcrnrpfh.js → chunk-394zjzjs.js} +20 -10
- package/dist/{chunk-xcrnrpfh.js.map → chunk-394zjzjs.js.map} +5 -5
- package/dist/{chunk-stmxh0hv.js → chunk-3neam1y5.js} +2 -2
- package/dist/{chunk-zeykm8my.js → chunk-3qtk0070.js} +16 -42
- package/dist/chunk-3qtk0070.js.map +14 -0
- package/dist/{chunk-0mvjpgvm.js → chunk-425ydk65.js} +4 -4
- package/dist/{chunk-s5pj68fa.js → chunk-5sswe5ej.js} +2 -2
- package/dist/chunk-6hfbz4d0.js +98 -0
- package/dist/chunk-6hfbz4d0.js.map +10 -0
- package/dist/{chunk-3zagkr6w.js → chunk-7mhbs9yy.js} +4 -4
- package/dist/{chunk-3zagkr6w.js.map → chunk-7mhbs9yy.js.map} +1 -1
- package/dist/{chunk-fpf57gca.js → chunk-7r9mqpva.js} +273 -66
- package/dist/{chunk-fpf57gca.js.map → chunk-7r9mqpva.js.map} +5 -5
- package/dist/{chunk-ewqn51gr.js → chunk-88xeh6zx.js} +6 -4
- package/dist/{chunk-ewqn51gr.js.map → chunk-88xeh6zx.js.map} +4 -4
- package/dist/chunk-90nqenq8.js +386 -0
- package/dist/chunk-90nqenq8.js.map +14 -0
- package/dist/{chunk-gjhrz66x.js → chunk-9c9yknwt.js} +247 -20
- package/dist/{chunk-gjhrz66x.js.map → chunk-9c9yknwt.js.map} +6 -6
- package/dist/{chunk-q9nkpr8k.js → chunk-9tpmfh3n.js} +1 -1
- package/dist/chunk-9wr3yajk.js.map +2 -2
- package/dist/{chunk-z1njfqqs.js → chunk-ats8y3d9.js} +721 -156
- package/dist/{chunk-z1njfqqs.js.map → chunk-ats8y3d9.js.map} +13 -13
- package/dist/{chunk-68hm50qh.js → chunk-bcz9dxtf.js} +16 -46
- package/dist/chunk-bcz9dxtf.js.map +12 -0
- package/dist/{chunk-naxjka9v.js → chunk-brhp9d97.js} +2 -2
- package/dist/{chunk-8a8k38tz.js → chunk-brybqw5k.js} +1 -1
- package/dist/{chunk-s1mqyqmm.js → chunk-bs1sd0e0.js} +12 -8
- package/dist/chunk-bs1sd0e0.js.map +18 -0
- package/dist/{chunk-vehcr9eb.js → chunk-cg7cygfj.js} +1 -1
- package/dist/chunk-dq3t5sr3.js +114 -0
- package/dist/chunk-dq3t5sr3.js.map +11 -0
- package/dist/{chunk-r2psmn42.js → chunk-eg6xqef7.js} +1 -1
- package/dist/{chunk-zxhym8tr.js → chunk-f05994as.js} +1 -1
- package/dist/{chunk-5t9gm5tt.js → chunk-fmgf9h5e.js} +38 -14
- package/dist/chunk-fmgf9h5e.js.map +22 -0
- package/dist/{chunk-ey1p8w68.js → chunk-gaj8djsw.js} +80 -4
- package/dist/chunk-gaj8djsw.js.map +13 -0
- package/dist/{chunk-1yh6jgtz.js → chunk-grt2j5vp.js} +2 -2
- package/dist/{chunk-zft9bzbc.js → chunk-hkbks1xm.js} +2 -1
- package/dist/{chunk-zft9bzbc.js.map → chunk-hkbks1xm.js.map} +3 -3
- package/dist/{chunk-rtdrm592.js → chunk-htdzx40w.js} +2 -2
- package/dist/{chunk-bc3y6gff.js → chunk-jka26v8c.js} +1 -1
- package/dist/{chunk-m3qx2pns.js → chunk-jt012fxq.js} +28 -12
- package/dist/{chunk-m3qx2pns.js.map → chunk-jt012fxq.js.map} +5 -5
- package/dist/{chunk-k3jh8gsg.js → chunk-kft7mp7z.js} +20 -3
- package/dist/chunk-kft7mp7z.js.map +10 -0
- package/dist/{chunk-qavwr628.js → chunk-n1hbwc6y.js} +5 -6
- package/dist/chunk-n1hbwc6y.js.map +12 -0
- package/dist/chunk-nxysqbt0.js.map +2 -2
- package/dist/{chunk-pqvvqc65.js → chunk-pqj8vff9.js} +3 -3
- package/dist/{chunk-wqe9shx2.js → chunk-qbd282aa.js} +2 -2
- package/dist/{chunk-e91fmg6t.js → chunk-qsa7nw6f.js} +2 -1
- package/dist/{chunk-e91fmg6t.js.map → chunk-qsa7nw6f.js.map} +3 -3
- package/dist/{chunk-rg725hry.js → chunk-s8xxef60.js} +83 -33
- package/dist/{chunk-rg725hry.js.map → chunk-s8xxef60.js.map} +5 -5
- package/dist/{chunk-fzae1jpq.js → chunk-t19wjmnc.js} +5 -5
- package/dist/{chunk-paxabbqd.js → chunk-tapdssb5.js} +1 -1
- package/dist/{chunk-dhkc9b23.js → chunk-v8a1qjzp.js} +1 -1
- package/dist/{chunk-q8d9p0tb.js → chunk-wzcjhv54.js} +8 -1
- package/dist/{chunk-q8d9p0tb.js.map → chunk-wzcjhv54.js.map} +3 -3
- package/dist/{chunk-pc7kra3k.js → chunk-xavet0qs.js} +1 -1
- package/dist/{chunk-0hkdtwqk.js → chunk-xf76csps.js} +5 -5
- package/dist/{chunk-m9ketb51.js → chunk-ygvay56w.js} +1 -1
- package/dist/{chunk-b4escq4c.js → chunk-ykchk644.js} +6 -6
- package/dist/{chunk-k29n4176.js → chunk-ym1bqd98.js} +6 -6
- package/dist/connectors/connections/capability.d.ts +11 -0
- package/dist/connectors/connections/capability.d.ts.map +1 -1
- package/dist/connectors/connections/internal.d.ts +2 -1
- package/dist/connectors/connections/internal.d.ts.map +1 -1
- package/dist/connectors/connections/internal.js +8 -4
- package/dist/connectors/connections/internal.js.map +1 -1
- package/dist/connectors/connections/service.d.ts +9 -1
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/execution.d.ts +7 -1
- package/dist/connectors/execution.d.ts.map +1 -1
- package/dist/connectors/service.d.ts +5 -1
- package/dist/connectors/service.d.ts.map +1 -1
- package/dist/deploy/types.d.ts +4 -1
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/events/execution.d.ts +8 -1
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/types/syncs.d.ts +4 -0
- package/dist/events/types/syncs.d.ts.map +1 -1
- package/dist/execution/agent.js +37 -36
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +4 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/object-reader-ontology.d.ts +3 -0
- package/dist/execution/object-reader-ontology.d.ts.map +1 -1
- package/dist/execution/primitive.js +36 -35
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.d.ts +1 -1
- package/dist/execution/request.d.ts.map +1 -1
- package/dist/execution/request.js +33 -32
- package/dist/execution/request.js.map +3 -3
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -59
- package/dist/index.js.map +1 -1
- package/dist/maintenance/index.js +1 -1
- package/dist/materializer/index.js +22 -21
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/audio/runtime.d.ts.map +1 -1
- package/dist/models/audio/types.d.ts +19 -0
- package/dist/models/audio/types.d.ts.map +1 -1
- package/dist/models/execution/index.js +20 -19
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/objects/index.js +36 -35
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/executor.d.ts +3 -1
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/explain.d.ts +3 -1
- package/dist/objects/query/explain.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +1 -1
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +19 -18
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/link-query-clearance.d.ts +3 -0
- package/dist/objects/query/link-query-clearance.d.ts.map +1 -1
- package/dist/objects/query/links.d.ts +1 -1
- package/dist/objects/query/links.d.ts.map +1 -1
- package/dist/objects/query/validate.d.ts +17 -0
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
- package/dist/ontology/index.js +3 -3
- package/dist/ontology/internal.js +3 -3
- package/dist/pipelines/index.js +21 -20
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +20 -19
- package/dist/projections/internal.js.map +1 -1
- package/dist/queues/in-memory.d.ts +1 -1
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.js +24 -23
- package/dist/runtime/internal.js.map +2 -2
- package/dist/runtime/locale.d.ts +0 -2
- package/dist/runtime/locale.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/auth.d.ts +26 -4
- package/dist/sandboxes/auth.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +3 -1
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +5 -5
- package/dist/security/view-conditions.d.ts.map +1 -1
- package/dist/shares/internal.js +16 -15
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/in-memory.d.ts +18 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts +43 -9
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +18 -2
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +136 -3
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +3 -2
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +4 -3
- package/dist/storage/ai-cost/provider.js.map +1 -1
- package/dist/storage/ai-cost/types.d.ts +5 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
- package/dist/storage/artifacts/record.d.ts +3 -1
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +7 -0
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +7 -7
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +22 -21
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.js +8 -8
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +1 -1
- package/dist/storage/sync-runs/idempotency.d.ts.map +1 -1
- package/dist/storage/sync-runs/in-memory.d.ts +2 -1
- package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/sync-runs/index.d.ts +1 -1
- package/dist/storage/sync-runs/index.d.ts.map +1 -1
- package/dist/storage/sync-runs/types.d.ts +27 -2
- package/dist/storage/sync-runs/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +7 -7
- package/dist/syncs/accounts.d.ts +36 -0
- package/dist/syncs/accounts.d.ts.map +1 -0
- package/dist/syncs/builders.d.ts.map +1 -1
- package/dist/syncs/connections.d.ts +36 -0
- package/dist/syncs/connections.d.ts.map +1 -0
- package/dist/syncs/execution.d.ts +14 -4
- package/dist/syncs/execution.d.ts.map +1 -1
- package/dist/syncs/index.d.ts +2 -1
- package/dist/syncs/index.d.ts.map +1 -1
- package/dist/syncs/index.js +22 -21
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/request.d.ts +16 -2
- package/dist/syncs/request.d.ts.map +1 -1
- package/dist/syncs/run-dispatch.d.ts +14 -2
- package/dist/syncs/run-dispatch.d.ts.map +1 -1
- package/dist/testing/agent-approval-storage-contract.d.ts.map +1 -1
- package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +1051 -58
- package/dist/testing/index.js.map +8 -8
- package/dist/testing/run-claim-storage-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +17 -16
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +66 -13
- package/dist/workers/index.js.map +4 -4
- package/dist/workers/queue-worker.d.ts +5 -0
- package/dist/workers/queue-worker.d.ts.map +1 -1
- package/dist/workers/worker.d.ts +8 -0
- package/dist/workers/worker.d.ts.map +1 -1
- package/dist/workflows/index.js +42 -40
- package/dist/workflows/index.js.map +1 -1
- package/package.json +7 -1
- package/src/actions/validation.ts +3 -1
- package/src/agents/children.ts +6 -0
- package/src/agents/errors.ts +3 -0
- package/src/agents/execution.ts +170 -20
- package/src/agents/index.ts +4 -0
- package/src/agents/model-routing.ts +25 -9
- package/src/agents/request.ts +759 -40
- package/src/agents/run-events.ts +235 -38
- package/src/agents/run-session-children.ts +13 -2
- package/src/agents/run-turn.ts +140 -23
- package/src/agents/streams/index.ts +2 -0
- package/src/agents/streams/internal.ts +12 -0
- package/src/agents/streams/protocol.ts +69 -1
- package/src/agents/streams/steps.ts +131 -0
- package/src/agents/thread-access.ts +57 -2
- package/src/artifacts/publish/merge.ts +14 -3
- package/src/artifacts/run-query.ts +5 -2
- package/src/calendar.ts +195 -0
- package/src/connectors/connections/capability.ts +40 -0
- package/src/connectors/connections/internal.ts +3 -0
- package/src/connectors/connections/service.ts +74 -5
- package/src/connectors/execution.ts +5 -6
- package/src/connectors/service.ts +23 -0
- package/src/deploy/types.ts +4 -1
- package/src/events/execution.ts +42 -2
- package/src/events/types/syncs.ts +4 -0
- package/src/execution/authorized-object-reader.ts +33 -5
- package/src/execution/object-reader-ontology.ts +6 -0
- package/src/execution/request.ts +1 -0
- package/src/http/api-routes.ts +8 -0
- package/src/index.ts +18 -2
- package/src/models/audio/runtime.ts +57 -14
- package/src/models/audio/types.ts +20 -0
- package/src/models/index.ts +1 -0
- package/src/objects/query/executor.ts +4 -0
- package/src/objects/query/explain.ts +5 -0
- package/src/objects/query/index.ts +1 -0
- package/src/objects/query/link-query-clearance.ts +4 -1
- package/src/objects/query/links.ts +5 -1
- package/src/objects/query/validate.ts +33 -1
- package/src/objects/sdk/runtime-query-executor.ts +7 -3
- package/src/runtime/host.ts +13 -7
- package/src/runtime/locale.ts +0 -10
- package/src/runtime/sixb.ts +12 -2
- package/src/sandboxes/README.md +3 -1
- package/src/sandboxes/auth.ts +32 -4
- package/src/sandboxes/index.ts +15 -1
- package/src/security/view-conditions.ts +2 -1
- package/src/storage/agents/in-memory.ts +271 -6
- package/src/storage/agents/index.ts +10 -0
- package/src/storage/agents/provider.ts +170 -13
- package/src/storage/agents/types.ts +148 -3
- package/src/storage/ai-cost/analytics.ts +22 -43
- package/src/storage/ai-cost/types.ts +5 -1
- package/src/storage/artifacts/in-memory.ts +20 -5
- package/src/storage/artifacts/record.ts +8 -2
- package/src/storage/artifacts/types.ts +7 -0
- package/src/storage/index.ts +11 -0
- package/src/storage/operation-scope.ts +1 -0
- package/src/storage/sync-runs/idempotency.ts +1 -0
- package/src/storage/sync-runs/in-memory.ts +43 -1
- package/src/storage/sync-runs/index.ts +1 -0
- package/src/storage/sync-runs/types.ts +30 -1
- package/src/syncs/accounts.ts +85 -0
- package/src/syncs/builders.ts +18 -1
- package/src/syncs/connections.ts +123 -0
- package/src/syncs/execution.ts +64 -22
- package/src/syncs/index.ts +3 -0
- package/src/syncs/request.ts +81 -23
- package/src/syncs/run-dispatch.ts +69 -7
- package/src/testing/agent-approval-storage-contract.ts +123 -0
- package/src/testing/agent-inbox-storage-contract.ts +59 -0
- package/src/testing/agent-storage-contract.ts +767 -8
- package/src/testing/ai-cost-storage-contract.ts +80 -0
- package/src/testing/artifact-storage-contract.ts +129 -0
- package/src/testing/run-claim-storage-contract.ts +116 -0
- package/src/workers/README.md +4 -1
- package/src/workers/lost-runs.ts +1 -0
- package/src/workers/queue-worker.ts +16 -5
- package/src/workers/worker.ts +67 -7
- package/dist/chunk-5a4a52tq.js.map +0 -10
- package/dist/chunk-5t9gm5tt.js.map +0 -22
- package/dist/chunk-68hm50qh.js.map +0 -13
- package/dist/chunk-aw1z0gre.js +0 -234
- package/dist/chunk-aw1z0gre.js.map +0 -12
- package/dist/chunk-ey1p8w68.js.map +0 -13
- package/dist/chunk-k3jh8gsg.js.map +0 -10
- package/dist/chunk-qavwr628.js.map +0 -12
- package/dist/chunk-s1mqyqmm.js.map +0 -18
- package/dist/chunk-zeykm8my.js.map +0 -14
- /package/dist/{chunk-stmxh0hv.js.map → chunk-3neam1y5.js.map} +0 -0
- /package/dist/{chunk-0mvjpgvm.js.map → chunk-425ydk65.js.map} +0 -0
- /package/dist/{chunk-s5pj68fa.js.map → chunk-5sswe5ej.js.map} +0 -0
- /package/dist/{chunk-q9nkpr8k.js.map → chunk-9tpmfh3n.js.map} +0 -0
- /package/dist/{chunk-naxjka9v.js.map → chunk-brhp9d97.js.map} +0 -0
- /package/dist/{chunk-8a8k38tz.js.map → chunk-brybqw5k.js.map} +0 -0
- /package/dist/{chunk-vehcr9eb.js.map → chunk-cg7cygfj.js.map} +0 -0
- /package/dist/{chunk-r2psmn42.js.map → chunk-eg6xqef7.js.map} +0 -0
- /package/dist/{chunk-zxhym8tr.js.map → chunk-f05994as.js.map} +0 -0
- /package/dist/{chunk-1yh6jgtz.js.map → chunk-grt2j5vp.js.map} +0 -0
- /package/dist/{chunk-rtdrm592.js.map → chunk-htdzx40w.js.map} +0 -0
- /package/dist/{chunk-bc3y6gff.js.map → chunk-jka26v8c.js.map} +0 -0
- /package/dist/{chunk-pqvvqc65.js.map → chunk-pqj8vff9.js.map} +0 -0
- /package/dist/{chunk-wqe9shx2.js.map → chunk-qbd282aa.js.map} +0 -0
- /package/dist/{chunk-fzae1jpq.js.map → chunk-t19wjmnc.js.map} +0 -0
- /package/dist/{chunk-paxabbqd.js.map → chunk-tapdssb5.js.map} +0 -0
- /package/dist/{chunk-dhkc9b23.js.map → chunk-v8a1qjzp.js.map} +0 -0
- /package/dist/{chunk-pc7kra3k.js.map → chunk-xavet0qs.js.map} +0 -0
- /package/dist/{chunk-0hkdtwqk.js.map → chunk-xf76csps.js.map} +0 -0
- /package/dist/{chunk-m9ketb51.js.map → chunk-ygvay56w.js.map} +0 -0
- /package/dist/{chunk-b4escq4c.js.map → chunk-ykchk644.js.map} +0 -0
- /package/dist/{chunk-k29n4176.js.map → chunk-ym1bqd98.js.map} +0 -0
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
ConnectorClient,
|
|
24
24
|
ConnectorConnectionSelector,
|
|
25
25
|
ConnectorDefinition,
|
|
26
|
+
ConnectorTokenSource,
|
|
26
27
|
OAuthConnectorAdapter,
|
|
27
28
|
} from "../types"
|
|
28
29
|
import {
|
|
@@ -172,6 +173,68 @@ export class ConnectorConnectionService implements ConnectorConnectionProcess {
|
|
|
172
173
|
definition: ConnectorDefinition<string, TAdapter>,
|
|
173
174
|
selector: ConnectorConnectionSelector
|
|
174
175
|
): Promise<ConnectorClient<TAdapter>> {
|
|
176
|
+
const readable = await this.requireReadableConnection(definition, selector)
|
|
177
|
+
return this.connectExecutionConnection(definition, readable)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Live token source for one connected account, re-checking connection status and member
|
|
182
|
+
* suspension on each read while keeping revision invalidation across calls.
|
|
183
|
+
*/
|
|
184
|
+
createConnectionTokenSource<TAdapter extends OAuthConnectorAdapter>(
|
|
185
|
+
definition: ConnectorDefinition<string, TAdapter>,
|
|
186
|
+
selector: ConnectorConnectionSelector
|
|
187
|
+
): ConnectorTokenSource {
|
|
188
|
+
this.assertOAuthRegistered(definition)
|
|
189
|
+
assertConnectorConnectionSelector(selector)
|
|
190
|
+
let current:
|
|
191
|
+
| {
|
|
192
|
+
readonly authorizationId: string
|
|
193
|
+
readonly accountId: string
|
|
194
|
+
readonly source: ConnectorTokenSource
|
|
195
|
+
}
|
|
196
|
+
| undefined
|
|
197
|
+
|
|
198
|
+
return Object.freeze({
|
|
199
|
+
get: async () => {
|
|
200
|
+
const readable = await this.requireReadableConnection(definition, selector)
|
|
201
|
+
if (
|
|
202
|
+
readable.projectId !== this.projectId ||
|
|
203
|
+
readable.connectorId !== definition.id ||
|
|
204
|
+
readable.status !== "connected"
|
|
205
|
+
) {
|
|
206
|
+
throw createConnectorCodedError(
|
|
207
|
+
"connector.not_found",
|
|
208
|
+
`Connector '${definition.id}' connection '${readable.id}' is not active in this project.`
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
const authorization = await this.authorizations.requireStableActiveAuthorization(
|
|
212
|
+
definition,
|
|
213
|
+
readable.authorizationId
|
|
214
|
+
)
|
|
215
|
+
if (
|
|
216
|
+
current?.authorizationId !== authorization.id ||
|
|
217
|
+
current.accountId !== readable.account.id
|
|
218
|
+
) {
|
|
219
|
+
current = {
|
|
220
|
+
authorizationId: authorization.id,
|
|
221
|
+
accountId: readable.account.id,
|
|
222
|
+
source: this.authorizations.createTokenSource(
|
|
223
|
+
definition,
|
|
224
|
+
authorization.id,
|
|
225
|
+
readable.account
|
|
226
|
+
),
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return current.source.get()
|
|
230
|
+
},
|
|
231
|
+
})
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
private async requireReadableConnection<TAdapter extends OAuthConnectorAdapter>(
|
|
235
|
+
definition: ConnectorDefinition<string, TAdapter>,
|
|
236
|
+
selector: ConnectorConnectionSelector
|
|
237
|
+
): Promise<ConnectorConnectionRecord> {
|
|
175
238
|
this.assertOAuthRegistered(definition)
|
|
176
239
|
assertConnectorConnectionSelector(selector)
|
|
177
240
|
const connection = await withConnectorStorageBoundary(
|
|
@@ -199,13 +262,21 @@ export class ConnectorConnectionService implements ConnectorConnectionProcess {
|
|
|
199
262
|
`Connector '${definition.id}' does not open the connections of a suspended member.`
|
|
200
263
|
)
|
|
201
264
|
}
|
|
202
|
-
|
|
203
|
-
return this.connectExecutionConnection(definition, readable)
|
|
265
|
+
return readable
|
|
204
266
|
}
|
|
205
267
|
|
|
206
268
|
/** Snapshot the connected records that one trusted primitive execution may consume. */
|
|
207
269
|
async listExecutionConnections<TAdapter extends OAuthConnectorAdapter>(
|
|
208
270
|
definition: ConnectorDefinition<string, TAdapter>
|
|
271
|
+
): Promise<readonly ConnectorConnectionRecord[]> {
|
|
272
|
+
const connections = await this.listAllConnections(definition)
|
|
273
|
+
const connected = connections.filter((connection) => connection.status === "connected")
|
|
274
|
+
return this.withoutSuspendedOwners(connected)
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** Every connection of the connector, whatever its status: none is ever deleted. */
|
|
278
|
+
async listAllConnections<TAdapter extends OAuthConnectorAdapter>(
|
|
279
|
+
definition: ConnectorDefinition<string, TAdapter>
|
|
209
280
|
): Promise<readonly ConnectorConnectionRecord[]> {
|
|
210
281
|
this.assertOAuthRegistered(definition)
|
|
211
282
|
const connections = await withConnectorStorageBoundary(
|
|
@@ -216,9 +287,7 @@ export class ConnectorConnectionService implements ConnectorConnectionProcess {
|
|
|
216
287
|
connectorId: definition.id,
|
|
217
288
|
})
|
|
218
289
|
)
|
|
219
|
-
|
|
220
|
-
const readable = await this.withoutSuspendedOwners(connected)
|
|
221
|
-
return [...readable].sort((left, right) => left.id.localeCompare(right.id))
|
|
290
|
+
return [...connections].sort((left, right) => left.id.localeCompare(right.id))
|
|
222
291
|
}
|
|
223
292
|
|
|
224
293
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthorizationError, assertProviderAccess } from "../authorization"
|
|
2
|
-
import type { ExecutionContext } from "../execution"
|
|
2
|
+
import type { AuthorizablePrincipal, ExecutionContext } from "../execution"
|
|
3
3
|
import { resolveExecutionScopeAuthorization } from "../execution/authorization"
|
|
4
4
|
import type { SixbRuntimeContext } from "../runtime/types"
|
|
5
5
|
import { createConnectorConnections } from "./connection-handles"
|
|
@@ -65,7 +65,7 @@ export function createConnectorRuntime(
|
|
|
65
65
|
`[Sixb] Connector '${definition.id}' uses persistent connections and requires an explicit owner and slot.`
|
|
66
66
|
)
|
|
67
67
|
}
|
|
68
|
-
assertPersonalConnectionRequester(definition, execution, selector)
|
|
68
|
+
assertPersonalConnectionRequester(definition, execution.requestedBy, selector)
|
|
69
69
|
return service.connectConnection(definition, selector)
|
|
70
70
|
}
|
|
71
71
|
if (selector) {
|
|
@@ -178,13 +178,12 @@ export function getConnectorExecutionSourceResolver(
|
|
|
178
178
|
* person's account by calling an action, even with can.manage. A run no one requested, such as one
|
|
179
179
|
* an event or a schedule started, picks the owner from its data, as syncs and webhooks do.
|
|
180
180
|
*/
|
|
181
|
-
function assertPersonalConnectionRequester(
|
|
182
|
-
definition: ConnectorDefinition,
|
|
183
|
-
|
|
181
|
+
export function assertPersonalConnectionRequester(
|
|
182
|
+
definition: Pick<ConnectorDefinition, "id">,
|
|
183
|
+
requester: AuthorizablePrincipal | undefined,
|
|
184
184
|
selector: ConnectorConnectionSelector
|
|
185
185
|
): void {
|
|
186
186
|
const owner = selector.owner
|
|
187
|
-
const requester = execution.requestedBy
|
|
188
187
|
if (owner?.type !== "user" || requester === undefined) return
|
|
189
188
|
if (requester.type === "user" && requester.id === owner.id) return
|
|
190
189
|
throw new AuthorizationError(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SandboxOAuthConnector } from "../sandboxes/auth"
|
|
1
2
|
import type { ConnectorConnectionRecord } from "../storage"
|
|
2
3
|
import type { ConnectorConnectionProcess } from "./connections/contracts"
|
|
3
4
|
import {
|
|
@@ -10,6 +11,7 @@ import type {
|
|
|
10
11
|
ConnectorClient,
|
|
11
12
|
ConnectorConnectionSelector,
|
|
12
13
|
ConnectorDefinition,
|
|
14
|
+
ConnectorTokenSource,
|
|
13
15
|
OAuthConnectorAdapter,
|
|
14
16
|
} from "./types"
|
|
15
17
|
import { isOAuthConnectorDefinition } from "./types"
|
|
@@ -77,12 +79,33 @@ export class ConnectorService {
|
|
|
77
79
|
return this.requireConnections().connectConnection(definition, selector)
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
createConnectionTokenSource(
|
|
83
|
+
connector: SandboxOAuthConnector,
|
|
84
|
+
selector: ConnectorConnectionSelector
|
|
85
|
+
): ConnectorTokenSource {
|
|
86
|
+
const definition = connector as unknown as ConnectorDefinition
|
|
87
|
+
if (!isOAuthConnectorDefinition(definition)) {
|
|
88
|
+
throw createConnectorCodedError(
|
|
89
|
+
"connector.configuration_invalid",
|
|
90
|
+
`[Sixb] Connector '${connector.id}' does not use persistent OAuth connections.`
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
return this.requireConnections().createConnectionTokenSource(definition, selector)
|
|
94
|
+
}
|
|
95
|
+
|
|
80
96
|
listExecutionConnections<TAdapter extends OAuthConnectorAdapter>(
|
|
81
97
|
definition: ConnectorDefinition<string, TAdapter>
|
|
82
98
|
): Promise<readonly ConnectorConnectionRecord[]> {
|
|
83
99
|
return this.requireConnections().listExecutionConnections(definition)
|
|
84
100
|
}
|
|
85
101
|
|
|
102
|
+
/** Every connection of the connector, whatever its status: none is ever deleted. */
|
|
103
|
+
listAllConnections<TAdapter extends OAuthConnectorAdapter>(
|
|
104
|
+
definition: ConnectorDefinition<string, TAdapter>
|
|
105
|
+
): Promise<readonly ConnectorConnectionRecord[]> {
|
|
106
|
+
return this.requireConnections().listAllConnections(definition)
|
|
107
|
+
}
|
|
108
|
+
|
|
86
109
|
/** Revokes every connection one person owns. Nothing to do without OAuth connectors. */
|
|
87
110
|
async revokeUserConnections(userId: string): Promise<void> {
|
|
88
111
|
await this.connections?.revokeUserConnections(userId)
|
package/src/deploy/types.ts
CHANGED
|
@@ -244,7 +244,10 @@ export interface DeployRelease {
|
|
|
244
244
|
readonly env?: DeployCommand
|
|
245
245
|
/** Runs while the previous release still serves. */
|
|
246
246
|
readonly build: readonly DeployCommand[]
|
|
247
|
-
/**
|
|
247
|
+
/**
|
|
248
|
+
* Runs before the new release starts. The SSH target keeps the previous release serving
|
|
249
|
+
* meanwhile, unless storage migrations are pending: then the services stop first.
|
|
250
|
+
*/
|
|
248
251
|
readonly beforeStart: readonly DeployCommand[]
|
|
249
252
|
}
|
|
250
253
|
readonly services: readonly DeployReleaseService[]
|
package/src/events/execution.ts
CHANGED
|
@@ -48,7 +48,18 @@ export interface EventsRuntime {
|
|
|
48
48
|
): Promise<() => void>
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export
|
|
51
|
+
export interface EventsRuntimeAccess {
|
|
52
|
+
/**
|
|
53
|
+
* The connections whose sync runs the caller sees, among those these syncs read, as
|
|
54
|
+
* `syncs.runs` decides. Undefined when nothing is left out.
|
|
55
|
+
*/
|
|
56
|
+
visibleSyncConnectionIds(syncIds: readonly string[]): Promise<readonly string[] | undefined>
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function createEventsRuntime(
|
|
60
|
+
runtime: SixbRuntimeContext,
|
|
61
|
+
access: EventsRuntimeAccess
|
|
62
|
+
): EventsRuntime {
|
|
52
63
|
const authority = resolveRuntimeAuthorizationForProject(runtime)
|
|
53
64
|
|
|
54
65
|
// Objects an event names that the reader cannot read: storage tells which still exist, and the
|
|
@@ -86,7 +97,8 @@ export function createEventsRuntime(runtime: SixbRuntimeContext): EventsRuntime
|
|
|
86
97
|
case "unrestricted":
|
|
87
98
|
return events
|
|
88
99
|
case "principal": {
|
|
89
|
-
const
|
|
100
|
+
const granted = await visibleByGrants(authority.context, events)
|
|
101
|
+
const shown = await withoutHiddenSyncRuns(granted, access)
|
|
90
102
|
if (!events.some((event) => event.topic === "artifacts")) return shown
|
|
91
103
|
|
|
92
104
|
// Artifact events go to whoever reads the artifact, in the log's order with the others.
|
|
@@ -219,6 +231,34 @@ async function readableArtifactEvents(
|
|
|
219
231
|
return shown
|
|
220
232
|
}
|
|
221
233
|
|
|
234
|
+
/**
|
|
235
|
+
* The events left once the runs of connections the caller may not run are dropped, as
|
|
236
|
+
* `syncs.runs` drops them: a colleague's run, with its failure. A sync event that names no
|
|
237
|
+
* connection stays, and a batch without one costs no lookup.
|
|
238
|
+
*/
|
|
239
|
+
async function withoutHiddenSyncRuns(
|
|
240
|
+
events: readonly StoredDomainEvent[],
|
|
241
|
+
access: EventsRuntimeAccess
|
|
242
|
+
): Promise<readonly StoredDomainEvent[]> {
|
|
243
|
+
const connectionOf = (event: StoredDomainEvent) =>
|
|
244
|
+
event.topic === "syncs" ? event.payload.connectionId : undefined
|
|
245
|
+
const syncIds = new Set(
|
|
246
|
+
events.flatMap((event) =>
|
|
247
|
+
event.topic === "syncs" && connectionOf(event) !== undefined ? [event.payload.syncId] : []
|
|
248
|
+
)
|
|
249
|
+
)
|
|
250
|
+
if (syncIds.size === 0) return events
|
|
251
|
+
|
|
252
|
+
const visible = await access.visibleSyncConnectionIds([...syncIds])
|
|
253
|
+
if (visible === undefined) return events
|
|
254
|
+
|
|
255
|
+
const shown = new Set(visible)
|
|
256
|
+
return events.filter((event) => {
|
|
257
|
+
const connectionId = connectionOf(event)
|
|
258
|
+
return connectionId === undefined || shown.has(connectionId)
|
|
259
|
+
})
|
|
260
|
+
}
|
|
261
|
+
|
|
222
262
|
/**
|
|
223
263
|
* The clearance each event is redacted with, resolved once per kind of event for the whole batch.
|
|
224
264
|
* An event that holds only values the current markings describe uses the reader's clearance.
|
|
@@ -9,6 +9,8 @@ export interface SyncRunStartedEvent extends EventEnvelope {
|
|
|
9
9
|
payload: {
|
|
10
10
|
syncId: string
|
|
11
11
|
runId: string
|
|
12
|
+
/** The connection the run reads, on a sync of an OAuth connector. */
|
|
13
|
+
connectionId?: string
|
|
12
14
|
startedAt: string
|
|
13
15
|
}
|
|
14
16
|
}
|
|
@@ -20,6 +22,8 @@ export interface SyncRunFinishedEvent extends EventEnvelope {
|
|
|
20
22
|
payload: {
|
|
21
23
|
syncId: string
|
|
22
24
|
runId: string
|
|
25
|
+
/** The connection the run reads, on a sync of an OAuth connector. */
|
|
26
|
+
connectionId?: string
|
|
23
27
|
status: "succeeded" | "failed" | "cancelled"
|
|
24
28
|
datasetId?: string
|
|
25
29
|
versionId?: string
|
|
@@ -37,6 +37,7 @@ import { userExpansionPlan } from "../objects/query/user-expansions"
|
|
|
37
37
|
import {
|
|
38
38
|
type AdmittedObjectQuery,
|
|
39
39
|
composeObjectQueryAdmissions,
|
|
40
|
+
type ObjectQueryDiscovery,
|
|
40
41
|
type ObjectQuerySemanticAdmission,
|
|
41
42
|
validateObjectQuery,
|
|
42
43
|
validateObjectQueryWithAdmission,
|
|
@@ -195,6 +196,10 @@ class AuthorizedObjectReaderImpl {
|
|
|
195
196
|
return reader.#ontology.view()
|
|
196
197
|
}
|
|
197
198
|
|
|
199
|
+
static queryDiscovery(reader: AuthorizedObjectReaderImpl): ObjectQueryDiscovery {
|
|
200
|
+
return reader.#ontology.discovery
|
|
201
|
+
}
|
|
202
|
+
|
|
198
203
|
/** Project identity carried by this nominal reader capability. */
|
|
199
204
|
get projectId(): string {
|
|
200
205
|
return this.#security.runtime.projectId
|
|
@@ -445,11 +450,15 @@ class AuthorizedObjectReaderImpl {
|
|
|
445
450
|
if (admission) {
|
|
446
451
|
const preflight = preflightObjectQueryLinks(
|
|
447
452
|
{ query, ...request, projectId: this.#security.runtime.projectId },
|
|
448
|
-
{ ontology: this.#ontology.registry }
|
|
453
|
+
{ ontology: this.#ontology.registry, discovery: this.#ontology.discovery }
|
|
449
454
|
)
|
|
450
455
|
const admitted = validateObjectQueryWithAdmission(
|
|
451
456
|
preflight.validated.query,
|
|
452
|
-
{
|
|
457
|
+
{
|
|
458
|
+
ontology: this.#ontology.registry,
|
|
459
|
+
discovery: this.#ontology.discovery,
|
|
460
|
+
normalize: false,
|
|
461
|
+
},
|
|
453
462
|
admission
|
|
454
463
|
)
|
|
455
464
|
admission.assertIncidentEdgeSelected({
|
|
@@ -465,6 +474,7 @@ class AuthorizedObjectReaderImpl {
|
|
|
465
474
|
if (clearance) {
|
|
466
475
|
assertLinkQueryReadable({
|
|
467
476
|
ontology: this.#ontology.registry,
|
|
477
|
+
discovery: this.#ontology.discovery,
|
|
468
478
|
clearance,
|
|
469
479
|
query,
|
|
470
480
|
request: { ...request, projectId: this.#security.runtime.projectId },
|
|
@@ -537,13 +547,20 @@ class AuthorizedObjectReaderImpl {
|
|
|
537
547
|
if (admission) {
|
|
538
548
|
// Terminal arguments are ordinary validation errors, not an authorization oracle. Validate
|
|
539
549
|
// them against the canonical result shape before raising any delegated-scope denial.
|
|
540
|
-
const validated = validateObjectQuery(query, {
|
|
550
|
+
const validated = validateObjectQuery(query, {
|
|
551
|
+
ontology: this.#ontology.registry,
|
|
552
|
+
discovery: this.#ontology.discovery,
|
|
553
|
+
})
|
|
541
554
|
const normalizedFacets = validateObjectFacetRequests(facets, validated.result.objectTypeIds, {
|
|
542
555
|
ontology: this.#ontology.registry,
|
|
543
556
|
})
|
|
544
557
|
const admitted = validateObjectQueryWithAdmission(
|
|
545
558
|
validated.query,
|
|
546
|
-
{
|
|
559
|
+
{
|
|
560
|
+
ontology: this.#ontology.registry,
|
|
561
|
+
discovery: this.#ontology.discovery,
|
|
562
|
+
normalize: false,
|
|
563
|
+
},
|
|
547
564
|
admission
|
|
548
565
|
)
|
|
549
566
|
normalizedFacets.forEach((facet, index) => {
|
|
@@ -657,6 +674,7 @@ class AuthorizedObjectReaderImpl {
|
|
|
657
674
|
// forgeable bypass flag; neither is needed at this nominal boundary.
|
|
658
675
|
return {
|
|
659
676
|
ontology: this.#ontology.registry,
|
|
677
|
+
discovery: this.#ontology.discovery,
|
|
660
678
|
storage: this.#storage,
|
|
661
679
|
embeddingModels: this.#models.embedding,
|
|
662
680
|
rerankingModels: this.#models.reranking,
|
|
@@ -666,6 +684,7 @@ class AuthorizedObjectReaderImpl {
|
|
|
666
684
|
}
|
|
667
685
|
return {
|
|
668
686
|
ontology: this.#ontology.registry,
|
|
687
|
+
discovery: this.#ontology.discovery,
|
|
669
688
|
embeddingModels: this.#models.embedding,
|
|
670
689
|
rerankingModels: this.#models.reranking,
|
|
671
690
|
storage: this.#storage,
|
|
@@ -775,7 +794,11 @@ class AuthorizedObjectReaderImpl {
|
|
|
775
794
|
#admitDelegatedQuery(query: ObjectQuery): AdmittedObjectQuery | undefined {
|
|
776
795
|
const admission = this.#security.delegation?.queryAdmission
|
|
777
796
|
if (!admission) return undefined
|
|
778
|
-
return validateObjectQueryWithAdmission(
|
|
797
|
+
return validateObjectQueryWithAdmission(
|
|
798
|
+
query,
|
|
799
|
+
{ ontology: this.#ontology.registry, discovery: this.#ontology.discovery },
|
|
800
|
+
admission
|
|
801
|
+
)
|
|
779
802
|
}
|
|
780
803
|
|
|
781
804
|
#resolveListObjectTypes(
|
|
@@ -868,6 +891,11 @@ export function getAuthorizedOntologyView(reader: AuthorizedObjectReader): Autho
|
|
|
868
891
|
return AuthorizedObjectReaderImpl.ontologyView(reader)
|
|
869
892
|
}
|
|
870
893
|
|
|
894
|
+
/** The reader's view as query validation reads it, built only when an issue reads it. */
|
|
895
|
+
export function getQueryDiscovery(reader: AuthorizedObjectReader): ObjectQueryDiscovery {
|
|
896
|
+
return AuthorizedObjectReaderImpl.queryDiscovery(reader)
|
|
897
|
+
}
|
|
898
|
+
|
|
871
899
|
/**
|
|
872
900
|
* What a reader resolved for this authority cannot read now. Events redact with it: an event of an
|
|
873
901
|
* object type the reader cannot read is not delivered, and the others are redacted like rows.
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
type AuthorizedOntologyView,
|
|
4
4
|
createAuthorizedOntologyView,
|
|
5
5
|
} from "../objects/authorized-ontology-view"
|
|
6
|
+
import type { ObjectQueryDiscovery } from "../objects/query/validate"
|
|
6
7
|
import type { OntologyRegistry } from "../ontology"
|
|
7
8
|
import { assertObjectReadOutputWithinLimit } from "../storage"
|
|
8
9
|
import type { ObjectReaderSecurity } from "./object-reader-security"
|
|
@@ -10,11 +11,16 @@ import type { ObjectReaderSecurity } from "./object-reader-security"
|
|
|
10
11
|
/** The ontology a reader resolves against, and the part of it its authority may describe. */
|
|
11
12
|
export class ObjectReaderOntology {
|
|
12
13
|
readonly registry: OntologyRegistry
|
|
14
|
+
/** The view as query validation reads it, building the view only when an issue reads it. */
|
|
15
|
+
readonly discovery: ObjectQueryDiscovery
|
|
13
16
|
readonly #security: ObjectReaderSecurity
|
|
14
17
|
#view?: AuthorizedOntologyView
|
|
15
18
|
|
|
16
19
|
constructor(registry: OntologyRegistry, security: ObjectReaderSecurity) {
|
|
17
20
|
this.registry = registry
|
|
21
|
+
this.discovery = {
|
|
22
|
+
getObjectTypeById: (objectTypeId) => this.view().getObjectTypeById(objectTypeId),
|
|
23
|
+
}
|
|
18
24
|
this.#security = security
|
|
19
25
|
Object.freeze(this)
|
|
20
26
|
}
|
package/src/execution/request.ts
CHANGED
package/src/http/api-routes.ts
CHANGED
|
@@ -880,6 +880,14 @@ export const SIXB_API_ROUTES: readonly SixbApiRoute[] = [
|
|
|
880
880
|
accessToken: true,
|
|
881
881
|
agentApi: true,
|
|
882
882
|
},
|
|
883
|
+
// Account labels are people's sign-in names: for the dashboard and scripts, not the Agent.
|
|
884
|
+
{
|
|
885
|
+
operationId: "listConnectorAccounts",
|
|
886
|
+
method: "GET",
|
|
887
|
+
path: "/api/connectors/:connectorId/accounts",
|
|
888
|
+
accessToken: true,
|
|
889
|
+
agentApi: false,
|
|
890
|
+
},
|
|
883
891
|
{
|
|
884
892
|
operationId: "listSyncRuns",
|
|
885
893
|
method: "GET",
|
package/src/index.ts
CHANGED
|
@@ -646,6 +646,7 @@ export type {
|
|
|
646
646
|
ObjectExpansion,
|
|
647
647
|
ObjectQuery,
|
|
648
648
|
ObjectQueryDirection,
|
|
649
|
+
ObjectQueryDiscovery,
|
|
649
650
|
ObjectQueryExpand,
|
|
650
651
|
ObjectQueryFilter,
|
|
651
652
|
ObjectQueryLimit,
|
|
@@ -749,6 +750,8 @@ export type {
|
|
|
749
750
|
BatchSyncDefinitionConfig,
|
|
750
751
|
DatasetSyncTarget,
|
|
751
752
|
RequestSyncRunInput,
|
|
753
|
+
SyncAccount,
|
|
754
|
+
SyncAccountsRuntime,
|
|
752
755
|
SyncBuilder,
|
|
753
756
|
SyncConnectorConnection,
|
|
754
757
|
SyncDefinition,
|
|
@@ -759,6 +762,7 @@ export type {
|
|
|
759
762
|
SyncReadResult,
|
|
760
763
|
SyncRunRequestOptions,
|
|
761
764
|
SyncRunRequestResult,
|
|
765
|
+
SyncRunRequestResults,
|
|
762
766
|
SyncTargetBuilder,
|
|
763
767
|
} from "./syncs"
|
|
764
768
|
export { defineSync } from "./syncs"
|
|
@@ -984,7 +988,12 @@ export type {
|
|
|
984
988
|
SaveAgentMemoryRuntimeResult,
|
|
985
989
|
} from "./agents/memory-execution"
|
|
986
990
|
export type { AgentThreadParticipantInput } from "./agents/participants"
|
|
987
|
-
export type {
|
|
991
|
+
export type {
|
|
992
|
+
AgentThreadLastRunView,
|
|
993
|
+
AgentThreadParticipant,
|
|
994
|
+
AgentThreadReadView,
|
|
995
|
+
AgentThreadView,
|
|
996
|
+
} from "./agents/thread-access"
|
|
988
997
|
export type { ArtifactAccess } from "./artifacts/access"
|
|
989
998
|
export type { ArtifactCommentInput } from "./artifacts/comments"
|
|
990
999
|
export type { ArtifactRequestErrorCode } from "./artifacts/errors"
|
|
@@ -1267,6 +1276,7 @@ export type {
|
|
|
1267
1276
|
AgentToolTextContent,
|
|
1268
1277
|
AgentUsageReference,
|
|
1269
1278
|
AgentWebOptions,
|
|
1279
|
+
EditAgentMessageInput,
|
|
1270
1280
|
InferAgentToolInput,
|
|
1271
1281
|
InferAgentToolInputSchema,
|
|
1272
1282
|
InferAgentToolOutput,
|
|
@@ -1289,7 +1299,13 @@ export {
|
|
|
1289
1299
|
MAX_AGENT_APP_STATE_TOTAL_BYTES,
|
|
1290
1300
|
MAX_AGENT_CONTEXT_ENTRIES,
|
|
1291
1301
|
} from "./agents"
|
|
1292
|
-
export type {
|
|
1302
|
+
export type {
|
|
1303
|
+
SandboxConnectionTokenResolver,
|
|
1304
|
+
SandboxOAuthConnector,
|
|
1305
|
+
SandboxSourceAuth,
|
|
1306
|
+
SandboxSourceAuthInput,
|
|
1307
|
+
SandboxSourceCredentials,
|
|
1308
|
+
} from "./sandboxes/auth"
|
|
1293
1309
|
export type {
|
|
1294
1310
|
SandboxConfig,
|
|
1295
1311
|
SandboxDefinition,
|
|
@@ -18,6 +18,8 @@ import type {
|
|
|
18
18
|
TranscriptionModel,
|
|
19
19
|
TranscriptionModelResponseMetadata,
|
|
20
20
|
TranscriptionModelResult,
|
|
21
|
+
TranscriptionOutput,
|
|
22
|
+
TranscriptionWord,
|
|
21
23
|
} from "./types"
|
|
22
24
|
|
|
23
25
|
export function createAudioRuntime(
|
|
@@ -86,25 +88,66 @@ export function createAudioRuntime(
|
|
|
86
88
|
// A completed, billable reply must survive cancellation and transcript validation failures.
|
|
87
89
|
const event = await recordTranscription(accounting, model, callId, result ?? {})
|
|
88
90
|
signal.throwIfAborted()
|
|
89
|
-
|
|
90
|
-
throw new TranscriptionModelResponseError(
|
|
91
|
-
"[SixbModels] Invalid transcription response.",
|
|
92
|
-
model.providerId,
|
|
93
|
-
model.modelId,
|
|
94
|
-
result ?? {}
|
|
95
|
-
)
|
|
96
|
-
}
|
|
91
|
+
const output = transcriptOutput(result, model)
|
|
97
92
|
|
|
98
|
-
return {
|
|
99
|
-
output: { text: result.output.text },
|
|
100
|
-
usage: event.usage,
|
|
101
|
-
cost: event.cost,
|
|
102
|
-
callId,
|
|
103
|
-
}
|
|
93
|
+
return { output, usage: event.usage, cost: event.cost, callId }
|
|
104
94
|
},
|
|
105
95
|
}
|
|
106
96
|
}
|
|
107
97
|
|
|
98
|
+
/**
|
|
99
|
+
* The validated transcript. A word list a caller cannot trust is worse than none: a playhead
|
|
100
|
+
* would seek to a timestamp that is not there. Refuse the reply instead, as for a missing text;
|
|
101
|
+
* billing for it was recorded already.
|
|
102
|
+
*/
|
|
103
|
+
function transcriptOutput(
|
|
104
|
+
result: TranscriptionModelResult | undefined,
|
|
105
|
+
model: TranscriptionModel
|
|
106
|
+
): TranscriptionOutput {
|
|
107
|
+
const refuse = () =>
|
|
108
|
+
new TranscriptionModelResponseError(
|
|
109
|
+
"[SixbModels] Invalid transcription response.",
|
|
110
|
+
model.providerId,
|
|
111
|
+
model.modelId,
|
|
112
|
+
result ?? {}
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
const output = result?.output
|
|
116
|
+
if (typeof output?.text !== "string") throw refuse()
|
|
117
|
+
|
|
118
|
+
const words: readonly unknown[] | undefined = output.words
|
|
119
|
+
if (words === undefined) return { text: output.text }
|
|
120
|
+
if (!Array.isArray(words)) throw refuse()
|
|
121
|
+
|
|
122
|
+
const timed: TranscriptionWord[] = []
|
|
123
|
+
for (const word of words) {
|
|
124
|
+
const entry = word as Partial<TranscriptionWord> | null | undefined
|
|
125
|
+
if (
|
|
126
|
+
typeof entry?.text !== "string" ||
|
|
127
|
+
!entry.text ||
|
|
128
|
+
!isMillisecond(entry.startMs) ||
|
|
129
|
+
!isMillisecond(entry.endMs) ||
|
|
130
|
+
entry.endMs < entry.startMs ||
|
|
131
|
+
(entry.speaker !== undefined && (typeof entry.speaker !== "string" || !entry.speaker))
|
|
132
|
+
) {
|
|
133
|
+
throw refuse()
|
|
134
|
+
}
|
|
135
|
+
timed.push({
|
|
136
|
+
text: entry.text,
|
|
137
|
+
startMs: entry.startMs,
|
|
138
|
+
endMs: entry.endMs,
|
|
139
|
+
...(entry.speaker === undefined ? {} : { speaker: entry.speaker }),
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// An empty list says nothing; the absent field is the one way to say "no words".
|
|
144
|
+
return timed.length ? { text: output.text, words: timed } : { text: output.text }
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function isMillisecond(value: unknown): value is number {
|
|
148
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0
|
|
149
|
+
}
|
|
150
|
+
|
|
108
151
|
interface PreparedAudio {
|
|
109
152
|
readonly mediaType: string
|
|
110
153
|
readonly sizeBytes: number
|
|
@@ -18,8 +18,28 @@ export interface TranscriptionModelRequest {
|
|
|
18
18
|
readonly signal?: AbortSignal
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/** One word the provider timed, and who said it when the provider labels voices. */
|
|
22
|
+
export interface TranscriptionWord {
|
|
23
|
+
readonly text: string
|
|
24
|
+
/** Milliseconds from the start of the audio. */
|
|
25
|
+
readonly startMs: number
|
|
26
|
+
/** Milliseconds from the start of the audio; equal to `startMs` for a word it did not span. */
|
|
27
|
+
readonly endMs: number
|
|
28
|
+
/**
|
|
29
|
+
* The provider's label for who said it, such as `speaker_0`. It is stable within one
|
|
30
|
+
* transcript only: the same voice need not carry the same label in another.
|
|
31
|
+
*/
|
|
32
|
+
readonly speaker?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
21
35
|
export interface TranscriptionOutput {
|
|
22
36
|
readonly text: string
|
|
37
|
+
/**
|
|
38
|
+
* The words the provider timed, in spoken order. Text alone cannot say who was speaking at
|
|
39
|
+
* 12:04, or where to put the playhead. Absent when the provider returns none, which is what
|
|
40
|
+
* every provider that neither diarizes nor times words does.
|
|
41
|
+
*/
|
|
42
|
+
readonly words?: readonly TranscriptionWord[]
|
|
23
43
|
}
|
|
24
44
|
|
|
25
45
|
export interface TranscriptionModelResponseMetadata {
|
package/src/models/index.ts
CHANGED
|
@@ -44,6 +44,7 @@ import { sortTieDirection } from "./sort-ties"
|
|
|
44
44
|
import { withoutUserExpansions } from "./user-expansions"
|
|
45
45
|
import {
|
|
46
46
|
type AdmittedObjectQuery,
|
|
47
|
+
type ObjectQueryDiscovery,
|
|
47
48
|
type ObjectQuerySemanticAdmission,
|
|
48
49
|
type ObjectQueryValidationIssue,
|
|
49
50
|
resolveObjectQueryResultShape,
|
|
@@ -88,6 +89,8 @@ export interface QueryExecutorOptions
|
|
|
88
89
|
readableObjectTypes?: ReadableObjectTypes
|
|
89
90
|
/** Reader-specific admission applied after grants, such as marking clearances. */
|
|
90
91
|
admission?: ObjectQuerySemanticAdmission
|
|
92
|
+
/** What the reader discovers of the ontology, which an unknown-property issue lists from. */
|
|
93
|
+
discovery?: ObjectQueryDiscovery
|
|
91
94
|
/** The user `currentUser()` stands for; absent when the reader is not a user. */
|
|
92
95
|
requestingUser?: UserRef
|
|
93
96
|
}
|
|
@@ -450,6 +453,7 @@ function validateExecutableQuery(
|
|
|
450
453
|
maxRefs: options.maxRefs,
|
|
451
454
|
normalize: false,
|
|
452
455
|
resolveLinkEndpoints: true,
|
|
456
|
+
discovery: options.discovery,
|
|
453
457
|
}
|
|
454
458
|
const normalized = normalizeObjectQuery(input.query)
|
|
455
459
|
const validated = validateObjectQuery(normalized, validationOptions)
|