@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
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
toSixbFailure2
|
|
4
|
+
} from "./chunk-mvz89age.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveRuntimeAuthorizationForProject,
|
|
7
|
+
resolveExecutionScopeAuthorization,
|
|
8
|
+
assertAuthorized2,
|
|
9
|
+
isRuntimeAllowed2
|
|
10
|
+
} from "./chunk-tapdssb5.js";
|
|
11
|
+
import {
|
|
12
|
+
reportRunFailure2
|
|
13
|
+
} from "./chunk-czct88ht.js";
|
|
14
|
+
import {
|
|
15
|
+
SYNC_RUN_FAILURE_CODES2
|
|
16
|
+
} from "./chunk-9c9yknwt.js";
|
|
17
|
+
import {
|
|
18
|
+
SyncRunError2
|
|
19
|
+
} from "./chunk-jmfet9r4.js";
|
|
20
|
+
import {
|
|
21
|
+
ConnectorError2,
|
|
22
|
+
createConnectorCodedError
|
|
23
|
+
} from "./chunk-n1hbwc6y.js";
|
|
24
|
+
import {
|
|
25
|
+
dispatchQueuedRun,
|
|
26
|
+
hasAutomaticRunProvenance
|
|
27
|
+
} from "./chunk-y8fwm3z2.js";
|
|
28
|
+
import {
|
|
29
|
+
executionRecordInputFromRuntime,
|
|
30
|
+
ensureExecutionRecord2,
|
|
31
|
+
createPrimitiveExecutionRecord
|
|
32
|
+
} from "./chunk-xavet0qs.js";
|
|
33
|
+
import {
|
|
34
|
+
isOAuthConnectorAdapter,
|
|
35
|
+
isOAuthConnectorDefinition2
|
|
36
|
+
} from "./chunk-pvpq483h.js";
|
|
37
|
+
|
|
38
|
+
// src/connectors/builders.ts
|
|
39
|
+
function assertNonEmpty(value, field) {
|
|
40
|
+
if (!value.trim()) {
|
|
41
|
+
throw new ConnectorError2(`Connector ${field} must not be empty.`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function defineConnector2(id, adapter, options = {}) {
|
|
45
|
+
assertNonEmpty(id, "id");
|
|
46
|
+
assertNonEmpty(adapter.type, "type");
|
|
47
|
+
if (typeof adapter.connect !== "function") {
|
|
48
|
+
throw new ConnectorError2("Connector adapter connect must be a function.");
|
|
49
|
+
}
|
|
50
|
+
if (adapter.authentication !== undefined) {
|
|
51
|
+
if (!isOAuthConnectorAdapter(adapter) || typeof adapter.authentication.authorizationUrl !== "function" || typeof adapter.authentication.exchangeCode !== "function" || typeof adapter.authentication.refresh !== "function" || typeof adapter.discoverAccounts !== "function") {
|
|
52
|
+
throw createConnectorCodedError("connector.configuration_invalid", "OAuth connector adapters must define oauth2 authentication and implement authorizationUrl, exchangeCode, refresh, and discoverAccounts.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
kind: "connector",
|
|
57
|
+
id,
|
|
58
|
+
adapter,
|
|
59
|
+
...options.owners === undefined ? {} : { owners: connectorOwners(id, adapter, options.owners) }
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function connectorOwners(id, adapter, owners) {
|
|
63
|
+
if (!isOAuthConnectorAdapter(adapter)) {
|
|
64
|
+
throw new ConnectorError2(`Connector '${id}' has no OAuth connections to own; remove its owners option.`);
|
|
65
|
+
}
|
|
66
|
+
const valid = owners.filter((owner) => owner === "project" || owner === "user");
|
|
67
|
+
if (owners.length === 0 || valid.length !== owners.length || new Set(valid).size !== valid.length) {
|
|
68
|
+
throw new ConnectorError2(`Connector '${id}' owners must list "project", "user" or both, each once.`);
|
|
69
|
+
}
|
|
70
|
+
return Object.freeze([...valid]);
|
|
71
|
+
}
|
|
72
|
+
// src/syncs/connections.ts
|
|
73
|
+
var registered = new WeakMap;
|
|
74
|
+
function registerSyncConnections(host, connections) {
|
|
75
|
+
registered.set(host, connections);
|
|
76
|
+
}
|
|
77
|
+
function findSyncConnections(host) {
|
|
78
|
+
return registered.get(host);
|
|
79
|
+
}
|
|
80
|
+
function createSyncConnections(service) {
|
|
81
|
+
return {
|
|
82
|
+
async list(definition) {
|
|
83
|
+
return (await service.listExecutionConnections(definition)).map(toMetadata);
|
|
84
|
+
},
|
|
85
|
+
async listAll(definition) {
|
|
86
|
+
return (await service.listAllConnections(definition)).map(toMetadata);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function toMetadata({
|
|
91
|
+
id,
|
|
92
|
+
connectorId,
|
|
93
|
+
owner,
|
|
94
|
+
slot,
|
|
95
|
+
account
|
|
96
|
+
}) {
|
|
97
|
+
return { id, connectorId, owner, slot, account };
|
|
98
|
+
}
|
|
99
|
+
function mayRunConnection(runtime, execution, connection) {
|
|
100
|
+
return connection.owner.type === "project" || seesConnection(runtime, execution, connection);
|
|
101
|
+
}
|
|
102
|
+
async function visibleSyncConnectionIds(runtime, execution, syncs, connections) {
|
|
103
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
104
|
+
if (authority.type === "unrestricted" || execution.requestedBy === undefined)
|
|
105
|
+
return;
|
|
106
|
+
const connectors = new Map;
|
|
107
|
+
for (const sync of syncs) {
|
|
108
|
+
if (sync && isOAuthConnectorDefinition2(sync.connector)) {
|
|
109
|
+
connectors.set(sync.connector.id, sync.connector);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (!connections || connectors.size === 0)
|
|
113
|
+
return;
|
|
114
|
+
const all = await Promise.all([...connectors.values()].map((connector) => connections.listAll(connector)));
|
|
115
|
+
return all.flat().filter((connection) => mayRunConnection(runtime, execution, connection)).map(({ id }) => id);
|
|
116
|
+
}
|
|
117
|
+
function seesConnection(runtime, execution, connection) {
|
|
118
|
+
const { owner } = connection;
|
|
119
|
+
const requester = execution.requestedBy;
|
|
120
|
+
if (requester === undefined)
|
|
121
|
+
return true;
|
|
122
|
+
if (owner.type === "user" && requester.type === "user" && requester.id === owner.id)
|
|
123
|
+
return true;
|
|
124
|
+
return isRuntimeAllowed2(runtime, {
|
|
125
|
+
kind: "connector.manage",
|
|
126
|
+
connectorId: connection.connectorId
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/syncs/errors.ts
|
|
131
|
+
class SyncValidationError2 extends Error {
|
|
132
|
+
name = "SyncValidationError";
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/syncs/run-dispatch.ts
|
|
136
|
+
class SyncRunDispatcher2 {
|
|
137
|
+
dependencies;
|
|
138
|
+
constructor(dependencies) {
|
|
139
|
+
this.dependencies = dependencies;
|
|
140
|
+
}
|
|
141
|
+
async dispatch(input) {
|
|
142
|
+
assertAutomaticDispatchInput(input);
|
|
143
|
+
const sync = this.dependencies.definitions.syncs.getById(input.syncId);
|
|
144
|
+
if (!sync)
|
|
145
|
+
throw new SyncValidationError2(`[Sixb] Unknown sync '${input.syncId}'`);
|
|
146
|
+
if (!isOAuthConnectorDefinition2(sync.connector)) {
|
|
147
|
+
return [await this.dispatchRun(sync, input, input.runId)];
|
|
148
|
+
}
|
|
149
|
+
const connectionIds = input.connection?.connectorId === sync.connector.id ? [input.connection.id] : await listSyncConnectionIds(this.dependencies, sync);
|
|
150
|
+
const results = [];
|
|
151
|
+
for (const connectionId of connectionIds) {
|
|
152
|
+
results.push(await this.dispatchRun(sync, input, `${input.runId}:${connectionId}`, connectionId));
|
|
153
|
+
}
|
|
154
|
+
return results;
|
|
155
|
+
}
|
|
156
|
+
dispatchRun(sync, input, runId, connectionId) {
|
|
157
|
+
return dispatchSyncRun({
|
|
158
|
+
errorReporterHost: this.dependencies,
|
|
159
|
+
projectId: this.dependencies.id,
|
|
160
|
+
sync,
|
|
161
|
+
...connectionId === undefined ? {} : { connectionId },
|
|
162
|
+
storage: this.dependencies.storage,
|
|
163
|
+
queue: this.dependencies.queues.syncRuns,
|
|
164
|
+
runId,
|
|
165
|
+
expectedLatestVersionId: input.expectedLatestVersionId,
|
|
166
|
+
commitMessage: input.commitMessage,
|
|
167
|
+
metadata: input.metadata,
|
|
168
|
+
automatic: true,
|
|
169
|
+
validateExistingRun: (run, storage) => assertAutomaticExecutionIdentity(storage, this.dependencies.id, input, run),
|
|
170
|
+
joinQueuedRun: true,
|
|
171
|
+
createExecution: async (executionId, queuedRunId) => createPrimitiveExecutionRecord({
|
|
172
|
+
id: executionId,
|
|
173
|
+
primitive: { kind: "sync", id: sync.id, runId: queuedRunId },
|
|
174
|
+
origin: {
|
|
175
|
+
type: "automatic",
|
|
176
|
+
projectId: this.dependencies.id,
|
|
177
|
+
source: input.source,
|
|
178
|
+
correlationId: input.correlationId
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
async function dispatchSyncRun(input) {
|
|
185
|
+
return dispatchQueuedRun({
|
|
186
|
+
primitive: syncRunPrimitive(input),
|
|
187
|
+
projectId: input.projectId,
|
|
188
|
+
storage: input.storage,
|
|
189
|
+
runId: input.runId,
|
|
190
|
+
metadata: input.metadata,
|
|
191
|
+
createExecution: input.createExecution,
|
|
192
|
+
validateExistingRun: input.validateExistingRun,
|
|
193
|
+
automatic: input.automatic,
|
|
194
|
+
joinQueuedRun: input.joinQueuedRun
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function syncRunPrimitive(input) {
|
|
198
|
+
const { projectId } = input;
|
|
199
|
+
return {
|
|
200
|
+
label: "Sync",
|
|
201
|
+
failureDetails: (run) => ({ syncId: run.syncId }),
|
|
202
|
+
store: (storage) => syncRunStore(input, requireSyncRunStorage(storage)),
|
|
203
|
+
matches: (run) => runMatchesRequest(run, input),
|
|
204
|
+
async enqueue(job) {
|
|
205
|
+
const [enqueued] = await input.queue.enqueue({
|
|
206
|
+
projectId,
|
|
207
|
+
jobs: [
|
|
208
|
+
{
|
|
209
|
+
id: job.id,
|
|
210
|
+
type: "sync.run.requested",
|
|
211
|
+
payload: { runId: job.runId },
|
|
212
|
+
...job.metadata === undefined ? {} : { metadata: job.metadata }
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
});
|
|
216
|
+
return enqueued;
|
|
217
|
+
},
|
|
218
|
+
async failPublication(run, failure, cause, at) {
|
|
219
|
+
const syncFailure = toSixbFailure2(failure, { allowedCodes: SYNC_RUN_FAILURE_CODES2, at });
|
|
220
|
+
const failed = await requireSyncRunStorage(input.storage).finish({
|
|
221
|
+
projectId,
|
|
222
|
+
id: run.id,
|
|
223
|
+
status: "failed",
|
|
224
|
+
finishedAt: at,
|
|
225
|
+
error: syncFailure
|
|
226
|
+
});
|
|
227
|
+
reportRunFailure2(input.errorReporterHost, cause, {
|
|
228
|
+
projectId,
|
|
229
|
+
runKind: "sync",
|
|
230
|
+
run: { runId: failed.id, syncId: failed.syncId },
|
|
231
|
+
failure: syncFailure
|
|
232
|
+
});
|
|
233
|
+
},
|
|
234
|
+
result: toRequestResult,
|
|
235
|
+
RunError: SyncRunError2,
|
|
236
|
+
RequestError: SyncValidationError2
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function syncRunStore(input, runs) {
|
|
240
|
+
const { projectId, sync } = input;
|
|
241
|
+
return {
|
|
242
|
+
getById: (params) => runs.getById(params),
|
|
243
|
+
async oldestQueued() {
|
|
244
|
+
const { runs: queued } = await runs.list({
|
|
245
|
+
projectId,
|
|
246
|
+
syncId: sync.id,
|
|
247
|
+
connectionId: input.connectionId ?? null,
|
|
248
|
+
statuses: ["queued"],
|
|
249
|
+
order: "asc",
|
|
250
|
+
limit: 1
|
|
251
|
+
});
|
|
252
|
+
return queued[0];
|
|
253
|
+
},
|
|
254
|
+
queue: (run) => runs.queue({
|
|
255
|
+
projectId,
|
|
256
|
+
id: run.id,
|
|
257
|
+
executionId: run.executionId,
|
|
258
|
+
syncId: sync.id,
|
|
259
|
+
...input.connectionId === undefined ? {} : { connectionId: input.connectionId },
|
|
260
|
+
datasetId: sync.target.dataset.id,
|
|
261
|
+
mode: sync.config.mode,
|
|
262
|
+
queuedAt: run.queuedAt,
|
|
263
|
+
expectedLatestVersionId: input.expectedLatestVersionId,
|
|
264
|
+
commitMessage: input.commitMessage
|
|
265
|
+
}),
|
|
266
|
+
requeue: (run, queuedAt) => runs.queue({
|
|
267
|
+
projectId,
|
|
268
|
+
id: run.id,
|
|
269
|
+
executionId: run.executionId,
|
|
270
|
+
syncId: run.syncId,
|
|
271
|
+
...run.connectionId === undefined ? {} : { connectionId: run.connectionId },
|
|
272
|
+
datasetId: run.datasetId,
|
|
273
|
+
mode: run.mode,
|
|
274
|
+
queuedAt,
|
|
275
|
+
expectedLatestVersionId: run.expectedLatestVersionId,
|
|
276
|
+
commitMessage: run.commitMessage
|
|
277
|
+
})
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
function runMatchesRequest(existing, input) {
|
|
281
|
+
return existing.syncId === input.sync.id && existing.connectionId === input.connectionId && existing.datasetId === input.sync.target.dataset.id && existing.mode === input.sync.config.mode && existing.expectedLatestVersionId === input.expectedLatestVersionId && existing.commitMessage === input.commitMessage;
|
|
282
|
+
}
|
|
283
|
+
function toRequestResult(run, publication) {
|
|
284
|
+
return {
|
|
285
|
+
syncId: run.syncId,
|
|
286
|
+
runId: run.id,
|
|
287
|
+
...run.connectionId === undefined ? {} : { connectionId: run.connectionId },
|
|
288
|
+
queuedAt: (publication?.queuedAt ?? run.queuedAt).toISOString(),
|
|
289
|
+
...publication ? { jobId: publication.jobId } : {},
|
|
290
|
+
created: publication?.created ?? false
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
async function listSyncConnectionIds(host, sync) {
|
|
294
|
+
if (!isOAuthConnectorDefinition2(sync.connector))
|
|
295
|
+
return [];
|
|
296
|
+
const connections = findSyncConnections(host);
|
|
297
|
+
if (!connections) {
|
|
298
|
+
throw new SyncValidationError2(`[Sixb] Sync '${sync.id}' reads OAuth connector '${sync.connector.id}', whose connections this host cannot list.`);
|
|
299
|
+
}
|
|
300
|
+
return (await connections.list(sync.connector)).map((connection) => connection.id);
|
|
301
|
+
}
|
|
302
|
+
function requireSyncRunStorage(storage) {
|
|
303
|
+
if (!storage.syncRuns)
|
|
304
|
+
throw new SyncValidationError2("[Sixb] Sync run storage is not configured.");
|
|
305
|
+
return storage.syncRuns;
|
|
306
|
+
}
|
|
307
|
+
function assertAutomaticDispatchInput(input) {
|
|
308
|
+
assertNonBlank(input.syncId, "Sync id");
|
|
309
|
+
assertNonBlank(input.runId, "Sync run id");
|
|
310
|
+
assertNonBlank(input.source.eventId, "Sync source event id");
|
|
311
|
+
assertNonBlank(input.correlationId, "Sync correlation id");
|
|
312
|
+
}
|
|
313
|
+
async function assertAutomaticExecutionIdentity(storage, projectId, input, run) {
|
|
314
|
+
const execution = await storage.executions.getById({ projectId, id: run.executionId });
|
|
315
|
+
if (!hasAutomaticRunProvenance(execution, input)) {
|
|
316
|
+
throw new SyncValidationError2(`[Sixb] Sync run '${run.id}' already exists with different automatic provenance.`);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function assertNonBlank(value, label) {
|
|
320
|
+
if (!value.trim())
|
|
321
|
+
throw new SyncValidationError2(`[Sixb] ${label} must not be empty.`);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// src/syncs/request.ts
|
|
325
|
+
async function requestSyncRun2(runtime, execution, sync, options = {}, connections) {
|
|
326
|
+
resolveExecutionScopeAuthorization(runtime.projectId, {
|
|
327
|
+
execution,
|
|
328
|
+
authorization: runtime.runtimeAuthorization
|
|
329
|
+
});
|
|
330
|
+
assertAuthorized2(runtime, { kind: "sync.run", syncId: sync.id });
|
|
331
|
+
if (!runtime.storage.syncRuns) {
|
|
332
|
+
throw new SyncValidationError2("[Sixb] Sync run storage is not configured.");
|
|
333
|
+
}
|
|
334
|
+
const queue = runtime.queues.syncRuns;
|
|
335
|
+
if (!queue) {
|
|
336
|
+
throw new SyncValidationError2("[Sixb] Sync run queue is not configured.");
|
|
337
|
+
}
|
|
338
|
+
const { connectionId, ...request } = options;
|
|
339
|
+
const dispatch = (runId, connection) => dispatchSyncRun({
|
|
340
|
+
errorReporterHost: runtime,
|
|
341
|
+
projectId: runtime.projectId,
|
|
342
|
+
sync,
|
|
343
|
+
storage: runtime.storage,
|
|
344
|
+
queue,
|
|
345
|
+
...request,
|
|
346
|
+
...runId === undefined ? {} : { runId },
|
|
347
|
+
...connection === undefined ? {} : { connectionId: connection, joinQueuedRun: true },
|
|
348
|
+
createExecution: async (executionId, queuedRunId) => {
|
|
349
|
+
const caller = await ensureExecutionRecord2(runtime.storage.executions, executionRecordInputFromRuntime({
|
|
350
|
+
execution,
|
|
351
|
+
runtimeAuthorization: runtime.runtimeAuthorization
|
|
352
|
+
}));
|
|
353
|
+
return createPrimitiveExecutionRecord({
|
|
354
|
+
id: executionId,
|
|
355
|
+
primitive: { kind: "sync", id: sync.id, runId: queuedRunId },
|
|
356
|
+
origin: { type: "execution", parent: caller }
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
if (!isOAuthConnectorDefinition2(sync.connector)) {
|
|
361
|
+
if (connectionId !== undefined) {
|
|
362
|
+
throw new SyncValidationError2(`[Sixb] Sync '${sync.id}' reads static connector '${sync.connector.id}', which has no connections.`);
|
|
363
|
+
}
|
|
364
|
+
return { runs: [await dispatch(request.runId)] };
|
|
365
|
+
}
|
|
366
|
+
if (!connections) {
|
|
367
|
+
throw new SyncValidationError2(`[Sixb] Sync '${sync.id}' reads OAuth connector '${sync.connector.id}', whose connections this runtime cannot list.`);
|
|
368
|
+
}
|
|
369
|
+
const runnable = (await connections.list(sync.connector)).filter((connection) => mayRunConnection(runtime, execution, connection));
|
|
370
|
+
if (connectionId !== undefined) {
|
|
371
|
+
if (!runnable.some((connection) => connection.id === connectionId)) {
|
|
372
|
+
throw new SyncValidationError2(`[Sixb] Sync '${sync.id}' has no connection '${connectionId}' you can run.`);
|
|
373
|
+
}
|
|
374
|
+
return { runs: [await dispatch(request.runId, connectionId)] };
|
|
375
|
+
}
|
|
376
|
+
const runs = [];
|
|
377
|
+
for (const connection of runnable) {
|
|
378
|
+
const runId = request.runId === undefined ? undefined : `${request.runId}:${connection.id}`;
|
|
379
|
+
runs.push(await dispatch(runId, connection.id));
|
|
380
|
+
}
|
|
381
|
+
return { runs };
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export { defineConnector2, registerSyncConnections, createSyncConnections, mayRunConnection, visibleSyncConnectionIds, seesConnection, SyncValidationError2, SyncRunDispatcher2, requestSyncRun2 };
|
|
385
|
+
|
|
386
|
+
//# debugId=7295DA83EA8A8E3D64756E2164756E21
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/connectors/builders.ts", "../src/syncs/connections.ts", "../src/syncs/errors.ts", "../src/syncs/run-dispatch.ts", "../src/syncs/request.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { ConnectorError, createConnectorCodedError } from \"./errors\"\nimport type {\n AnyConnectorAdapter,\n ConnectorAdapter,\n ConnectorConnectionOwner,\n ConnectorDefinition,\n ConnectorDefinitionOptions,\n OAuthConnectorAdapter,\n} from \"./types\"\nimport { isOAuthConnectorAdapter } from \"./types\"\n\nfunction assertNonEmpty(value: string, field: string): void {\n if (!value.trim()) {\n throw new ConnectorError(`Connector ${field} must not be empty.`)\n }\n}\n\n/**\n * Define a connector instance for an external system.\n *\n * The returned definition is inert and can be exported from a project-level\n * `connectors/` module. Use `await sixb.connector(definition)` at runtime to\n * resolve it to a connected client.\n */\nexport function defineConnector<TId extends string, TAdapter extends OAuthConnectorAdapter>(\n id: TId,\n adapter: TAdapter,\n options?: ConnectorDefinitionOptions\n): ConnectorDefinition<TId, TAdapter>\nexport function defineConnector<TId extends string, TAdapter extends ConnectorAdapter>(\n id: TId,\n adapter: TAdapter\n): ConnectorDefinition<TId, TAdapter>\nexport function defineConnector<TId extends string, TAdapter extends AnyConnectorAdapter>(\n id: TId,\n adapter: TAdapter,\n options: ConnectorDefinitionOptions = {}\n): ConnectorDefinition<TId, TAdapter> {\n assertNonEmpty(id, \"id\")\n assertNonEmpty(adapter.type, \"type\")\n\n if (typeof adapter.connect !== \"function\") {\n throw new ConnectorError(\"Connector adapter connect must be a function.\")\n }\n\n if (adapter.authentication !== undefined) {\n if (\n !isOAuthConnectorAdapter(adapter) ||\n typeof adapter.authentication.authorizationUrl !== \"function\" ||\n typeof adapter.authentication.exchangeCode !== \"function\" ||\n typeof adapter.authentication.refresh !== \"function\" ||\n typeof adapter.discoverAccounts !== \"function\"\n ) {\n throw createConnectorCodedError(\n \"connector.configuration_invalid\",\n \"OAuth connector adapters must define oauth2 authentication and implement authorizationUrl, exchangeCode, refresh, and discoverAccounts.\"\n )\n }\n }\n\n return {\n kind: \"connector\",\n id,\n adapter,\n ...(options.owners === undefined\n ? {}\n : { owners: connectorOwners(id, adapter, options.owners) }),\n }\n}\n\nfunction connectorOwners(\n id: string,\n adapter: AnyConnectorAdapter,\n owners: readonly unknown[]\n): readonly ConnectorConnectionOwner[\"type\"][] {\n if (!isOAuthConnectorAdapter(adapter)) {\n throw new ConnectorError(\n `Connector '${id}' has no OAuth connections to own; remove its owners option.`\n )\n }\n const valid = owners.filter(\n (owner): owner is ConnectorConnectionOwner[\"type\"] => owner === \"project\" || owner === \"user\"\n )\n if (\n owners.length === 0 ||\n valid.length !== owners.length ||\n new Set(valid).size !== valid.length\n ) {\n throw new ConnectorError(\n `Connector '${id}' owners must list \"project\", \"user\" or both, each once.`\n )\n }\n return Object.freeze([...valid])\n}\n",
|
|
6
|
+
"import { isRuntimeAllowed } from \"../authorization\"\nimport {\n type ConnectorConnectionMetadata,\n type ConnectorDefinition,\n isOAuthConnectorDefinition,\n type OAuthConnectorAdapter,\n} from \"../connectors\"\nimport type { ConnectorService } from \"../connectors/service\"\nimport type { ExecutionContext } from \"../execution\"\nimport { resolveRuntimeAuthorizationForProject } from \"../execution/authorization\"\nimport type { SixbRuntimeContext } from \"../runtime/types\"\nimport type { SyncDefinition } from \"./types\"\n\n/**\n * The connections a sync of an OAuth connector runs for: every connected one whose owner isn't\n * suspended. Dispatch reads them without an execution, so a host registers them on itself.\n */\nexport interface SyncConnections {\n list(\n definition: ConnectorDefinition<string, OAuthConnectorAdapter>\n ): Promise<readonly ConnectorConnectionMetadata[]>\n /** Every connection of the connector, whatever its status: each one a run has read. */\n listAll(\n definition: ConnectorDefinition<string, OAuthConnectorAdapter>\n ): Promise<readonly ConnectorConnectionMetadata[]>\n}\n\nconst registered = new WeakMap<object, SyncConnections>()\n\nexport function registerSyncConnections(host: object, connections: SyncConnections): void {\n registered.set(host, connections)\n}\n\nexport function findSyncConnections(host: object): SyncConnections | undefined {\n return registered.get(host)\n}\n\nexport function createSyncConnections(\n service: Pick<ConnectorService, \"listExecutionConnections\" | \"listAllConnections\">\n): SyncConnections {\n return {\n async list(definition) {\n return (await service.listExecutionConnections(definition)).map(toMetadata)\n },\n async listAll(definition) {\n return (await service.listAllConnections(definition)).map(toMetadata)\n },\n }\n}\n\nfunction toMetadata({\n id,\n connectorId,\n owner,\n slot,\n account,\n}: ConnectorConnectionMetadata): ConnectorConnectionMetadata {\n return { id, connectorId, owner, slot, account }\n}\n\n/**\n * Whether a caller who may run a sync may run, and see, its runs of this connection. Anyone may\n * run the project's. A person's own connection is theirs, and the connector's managers may act on\n * anyone's: a sync reads into rows its owner owns, as the schedule would. A run no one requested\n * may act on them all.\n */\nexport function mayRunConnection(\n runtime: SixbRuntimeContext,\n execution: ExecutionContext,\n connection: ConnectorConnectionMetadata\n): boolean {\n return connection.owner.type === \"project\" || seesConnection(runtime, execution, connection)\n}\n\n/**\n * The connections whose runs of these syncs the caller sees, as `mayRunConnection` decides: one\n * listing per OAuth connector they read. Undefined when nothing is left out: no sync reads an\n * OAuth connector, or the caller sees every run.\n */\nexport async function visibleSyncConnectionIds(\n runtime: SixbRuntimeContext,\n execution: ExecutionContext,\n syncs: readonly (SyncDefinition | null)[],\n connections: SyncConnections | undefined\n): Promise<readonly string[] | undefined> {\n const authority = resolveRuntimeAuthorizationForProject(runtime)\n if (authority.type === \"unrestricted\" || execution.requestedBy === undefined) return undefined\n\n const connectors = new Map<string, ConnectorDefinition<string, OAuthConnectorAdapter>>()\n for (const sync of syncs) {\n if (sync && isOAuthConnectorDefinition(sync.connector)) {\n connectors.set(sync.connector.id, sync.connector)\n }\n }\n if (!connections || connectors.size === 0) return undefined\n\n const all = await Promise.all(\n [...connectors.values()].map((connector) => connections.listAll(connector))\n )\n return all\n .flat()\n .filter((connection) => mayRunConnection(runtime, execution, connection))\n .map(({ id }) => id)\n}\n\n/**\n * Whether the caller sees this connection itself, as the connector's connection views decide: the\n * owner of a personal connection, the connector's managers, and runs no one requested.\n */\nexport function seesConnection(\n runtime: SixbRuntimeContext,\n execution: ExecutionContext,\n connection: ConnectorConnectionMetadata\n): boolean {\n const { owner } = connection\n const requester = execution.requestedBy\n if (requester === undefined) return true\n if (owner.type === \"user\" && requester.type === \"user\" && requester.id === owner.id) return true\n return isRuntimeAllowed(runtime, {\n kind: \"connector.manage\",\n connectorId: connection.connectorId,\n })\n}\n",
|
|
7
|
+
"export class SyncValidationError extends Error {\n readonly name = \"SyncValidationError\"\n}\n",
|
|
8
|
+
"import { isOAuthConnectorDefinition } from \"../connectors\"\nimport { reportRunFailure } from \"../error-reporting/capability\"\nimport { toSixbFailure } from \"../errors/internal\"\nimport type { RunDispatcher } from \"../execution/dispatch\"\nimport { createPrimitiveExecutionRecord } from \"../execution/durable\"\nimport type { Queues } from \"../queues\"\nimport type { SixbDefinitions } from \"../runtime/definitions\"\nimport type { CreateExecutionInput, Storage, SyncRunRecord } from \"../storage\"\nimport { SYNC_RUN_FAILURE_CODES, SyncRunError } from \"../storage\"\nimport {\n dispatchQueuedRun,\n hasAutomaticRunProvenance,\n type QueuedRunPrimitive,\n type QueuedRunStore,\n type RunPublication,\n} from \"../workers/queued-run-dispatch\"\nimport { findSyncConnections } from \"./connections\"\nimport { SyncValidationError } from \"./errors\"\nimport type { SyncRunRequestOptions, SyncRunRequestResult } from \"./request\"\nimport type { SyncDefinition } from \"./types\"\n\nexport type AutomaticSyncExecutionSource =\n | { readonly type: \"schedule\"; readonly eventId: string }\n | { readonly type: \"event\"; readonly eventId: string }\n\nexport interface AutomaticSyncRunDispatchInput extends SyncRunRequestOptions {\n readonly syncId: string\n readonly runId: string\n readonly source: AutomaticSyncExecutionSource\n readonly correlationId: string\n readonly metadata?: Readonly<Record<string, string>>\n /**\n * The connection the triggering event is about. A sync of that connection's connector runs for\n * it alone; any other sync runs for every connection as usual.\n */\n readonly connection?: { readonly id: string; readonly connectorId: string }\n}\n\n/** A sync of a static connector queues one run; a sync of an OAuth connector one per connection. */\nexport type SyncRunDispatchPort = RunDispatcher<\n AutomaticSyncRunDispatchInput,\n readonly SyncRunRequestResult[]\n>\n\nexport interface SyncRunDispatcherDependencies {\n readonly id: string\n readonly definitions: Pick<SixbDefinitions, \"syncs\">\n readonly storage: Storage\n readonly queues: Pick<Queues, \"syncRuns\">\n}\n\ninterface DispatchSyncRunInput extends SyncRunRequestOptions {\n readonly errorReporterHost: object\n readonly projectId: string\n readonly sync: SyncDefinition\n /** The connection this run reads, on a sync of an OAuth connector. */\n readonly connectionId?: string\n readonly storage: Storage\n readonly queue: Queues[\"syncRuns\"]\n readonly metadata?: Readonly<Record<string, string>>\n readonly createExecution: (executionId: string, runId: string) => Promise<CreateExecutionInput>\n readonly validateExistingRun?: (run: SyncRunRecord, storage: Storage) => Promise<void>\n /** A trigger, not a caller (see `dispatchQueuedRun`). */\n readonly automatic?: boolean\n /** Return a matching run of this Sync that has not started yet instead of queueing another one. */\n readonly joinQueuedRun?: boolean\n}\n\n/** Core-owned durable dispatch boundary used by automatic Sync triggers. */\nexport class SyncRunDispatcher implements SyncRunDispatchPort {\n constructor(private readonly dependencies: SyncRunDispatcherDependencies) {}\n\n async dispatch(input: AutomaticSyncRunDispatchInput): Promise<readonly SyncRunRequestResult[]> {\n assertAutomaticDispatchInput(input)\n const sync = this.dependencies.definitions.syncs.getById(input.syncId)\n if (!sync) throw new SyncValidationError(`[Sixb] Unknown sync '${input.syncId}'`)\n\n if (!isOAuthConnectorDefinition(sync.connector)) {\n return [await this.dispatchRun(sync, input, input.runId)]\n }\n\n const connectionIds =\n input.connection?.connectorId === sync.connector.id\n ? [input.connection.id]\n : await listSyncConnectionIds(this.dependencies, sync)\n\n // Each run id comes from the trigger's and the connection's, so a redelivered trigger, or one\n // retried after some of its runs were queued, queues nothing twice.\n const results: SyncRunRequestResult[] = []\n for (const connectionId of connectionIds) {\n results.push(\n await this.dispatchRun(sync, input, `${input.runId}:${connectionId}`, connectionId)\n )\n }\n return results\n }\n\n private dispatchRun(\n sync: SyncDefinition,\n input: AutomaticSyncRunDispatchInput,\n runId: string,\n connectionId?: string\n ): Promise<SyncRunRequestResult> {\n return dispatchSyncRun({\n errorReporterHost: this.dependencies,\n projectId: this.dependencies.id,\n sync,\n ...(connectionId === undefined ? {} : { connectionId }),\n storage: this.dependencies.storage,\n queue: this.dependencies.queues.syncRuns,\n runId,\n expectedLatestVersionId: input.expectedLatestVersionId,\n commitMessage: input.commitMessage,\n metadata: input.metadata,\n automatic: true,\n validateExistingRun: (run, storage) =>\n assertAutomaticExecutionIdentity(storage, this.dependencies.id, input, run),\n joinQueuedRun: true,\n createExecution: async (executionId, queuedRunId) =>\n createPrimitiveExecutionRecord({\n id: executionId,\n primitive: { kind: \"sync\", id: sync.id, runId: queuedRunId },\n origin: {\n type: \"automatic\",\n projectId: this.dependencies.id,\n source: input.source,\n correlationId: input.correlationId,\n },\n }),\n })\n }\n}\n\n/** Persist a Sync execution and queued run before publishing its queue job. */\nexport async function dispatchSyncRun(input: DispatchSyncRunInput): Promise<SyncRunRequestResult> {\n return dispatchQueuedRun({\n primitive: syncRunPrimitive(input),\n projectId: input.projectId,\n storage: input.storage,\n runId: input.runId,\n metadata: input.metadata,\n createExecution: input.createExecution,\n validateExistingRun: input.validateExistingRun,\n automatic: input.automatic,\n joinQueuedRun: input.joinQueuedRun,\n })\n}\n\nfunction syncRunPrimitive(\n input: DispatchSyncRunInput\n): QueuedRunPrimitive<SyncRunRecord, SyncRunRequestResult> {\n const { projectId } = input\n\n return {\n label: \"Sync\",\n failureDetails: (run) => ({ syncId: run.syncId }),\n\n store: (storage) => syncRunStore(input, requireSyncRunStorage(storage)),\n matches: (run) => runMatchesRequest(run, input),\n\n async enqueue(job) {\n const [enqueued] = await input.queue.enqueue({\n projectId,\n jobs: [\n {\n id: job.id,\n type: \"sync.run.requested\",\n payload: { runId: job.runId },\n ...(job.metadata === undefined ? {} : { metadata: job.metadata }),\n },\n ],\n })\n return enqueued\n },\n\n async failPublication(run, failure, cause, at) {\n const syncFailure = toSixbFailure(failure, { allowedCodes: SYNC_RUN_FAILURE_CODES, at })\n const failed = await requireSyncRunStorage(input.storage).finish({\n projectId,\n id: run.id,\n status: \"failed\",\n finishedAt: at,\n error: syncFailure,\n })\n reportRunFailure(input.errorReporterHost, cause, {\n projectId,\n runKind: \"sync\",\n run: { runId: failed.id, syncId: failed.syncId },\n failure: syncFailure,\n })\n },\n\n result: toRequestResult,\n\n RunError: SyncRunError,\n RequestError: SyncValidationError,\n }\n}\n\nfunction syncRunStore(\n input: DispatchSyncRunInput,\n runs: NonNullable<Storage[\"syncRuns\"]>\n): QueuedRunStore<SyncRunRecord> {\n const { projectId, sync } = input\n\n return {\n getById: (params) => runs.getById(params),\n\n async oldestQueued() {\n const { runs: queued } = await runs.list({\n projectId,\n syncId: sync.id,\n connectionId: input.connectionId ?? null,\n statuses: [\"queued\"],\n order: \"asc\",\n limit: 1,\n })\n\n return queued[0]\n },\n\n queue: (run) =>\n runs.queue({\n projectId,\n id: run.id,\n executionId: run.executionId,\n syncId: sync.id,\n ...(input.connectionId === undefined ? {} : { connectionId: input.connectionId }),\n datasetId: sync.target.dataset.id,\n mode: sync.config.mode,\n queuedAt: run.queuedAt,\n expectedLatestVersionId: input.expectedLatestVersionId,\n commitMessage: input.commitMessage,\n }),\n\n requeue: (run, queuedAt) =>\n runs.queue({\n projectId,\n id: run.id,\n executionId: run.executionId,\n syncId: run.syncId,\n ...(run.connectionId === undefined ? {} : { connectionId: run.connectionId }),\n datasetId: run.datasetId,\n mode: run.mode,\n queuedAt,\n expectedLatestVersionId: run.expectedLatestVersionId,\n commitMessage: run.commitMessage,\n }),\n }\n}\n\n/**\n * A run that has not started reads its source when it starts, so it already covers a trigger that\n * arrives now. One queued for another connection, or with another request payload, is not joined.\n */\nfunction runMatchesRequest(\n existing: SyncRunRecord,\n input: Pick<\n DispatchSyncRunInput,\n \"sync\" | \"connectionId\" | \"expectedLatestVersionId\" | \"commitMessage\"\n >\n): boolean {\n return (\n existing.syncId === input.sync.id &&\n existing.connectionId === input.connectionId &&\n existing.datasetId === input.sync.target.dataset.id &&\n existing.mode === input.sync.config.mode &&\n existing.expectedLatestVersionId === input.expectedLatestVersionId &&\n existing.commitMessage === input.commitMessage\n )\n}\n\nfunction toRequestResult(run: SyncRunRecord, publication?: RunPublication): SyncRunRequestResult {\n return {\n syncId: run.syncId,\n runId: run.id,\n ...(run.connectionId === undefined ? {} : { connectionId: run.connectionId }),\n queuedAt: (publication?.queuedAt ?? run.queuedAt).toISOString(),\n ...(publication ? { jobId: publication.jobId } : {}),\n created: publication?.created ?? false,\n }\n}\n\nasync function listSyncConnectionIds(\n host: object,\n sync: SyncDefinition\n): Promise<readonly string[]> {\n if (!isOAuthConnectorDefinition(sync.connector)) return []\n const connections = findSyncConnections(host)\n if (!connections) {\n throw new SyncValidationError(\n `[Sixb] Sync '${sync.id}' reads OAuth connector '${sync.connector.id}', whose connections this host cannot list.`\n )\n }\n return (await connections.list(sync.connector)).map((connection) => connection.id)\n}\n\nfunction requireSyncRunStorage(storage: Storage): NonNullable<Storage[\"syncRuns\"]> {\n if (!storage.syncRuns) throw new SyncValidationError(\"[Sixb] Sync run storage is not configured.\")\n return storage.syncRuns\n}\n\nfunction assertAutomaticDispatchInput(input: AutomaticSyncRunDispatchInput): void {\n assertNonBlank(input.syncId, \"Sync id\")\n assertNonBlank(input.runId, \"Sync run id\")\n assertNonBlank(input.source.eventId, \"Sync source event id\")\n assertNonBlank(input.correlationId, \"Sync correlation id\")\n}\n\nasync function assertAutomaticExecutionIdentity(\n storage: Storage,\n projectId: string,\n input: AutomaticSyncRunDispatchInput,\n run: SyncRunRecord\n): Promise<void> {\n const execution = await storage.executions.getById({ projectId, id: run.executionId })\n if (!hasAutomaticRunProvenance(execution, input)) {\n throw new SyncValidationError(\n `[Sixb] Sync run '${run.id}' already exists with different automatic provenance.`\n )\n }\n}\n\nfunction assertNonBlank(value: string, label: string): void {\n if (!value.trim()) throw new SyncValidationError(`[Sixb] ${label} must not be empty.`)\n}\n",
|
|
9
|
+
"import { assertAuthorized } from \"../authorization\"\nimport { isOAuthConnectorDefinition } from \"../connectors\"\nimport { resolveExecutionScopeAuthorization } from \"../execution/authorization\"\nimport {\n createPrimitiveExecutionRecord,\n ensureExecutionRecord,\n executionRecordInputFromRuntime,\n} from \"../execution/durable\"\nimport type { ExecutionContext } from \"../execution/types\"\nimport type { SixbRuntimeContext } from \"../runtime/types\"\nimport { mayRunConnection, type SyncConnections } from \"./connections\"\nimport { SyncValidationError } from \"./errors\"\nimport { dispatchSyncRun } from \"./run-dispatch\"\nimport type { SyncDefinition } from \"./types\"\n\nexport interface SyncRunRequestOptions {\n /** Stable identity used to make dispatch idempotent. */\n readonly runId?: string\n /** Optimistic concurrency guard: fail the run if the dataset moved past this version. */\n readonly expectedLatestVersionId?: string\n readonly commitMessage?: string\n}\n\nexport interface RequestSyncRunOptions extends SyncRunRequestOptions {\n /**\n * The one connection to run, on a sync of an OAuth connector. Without it, the request runs every\n * connection the caller may run.\n */\n readonly connectionId?: string\n}\n\nexport interface RequestSyncRunInput extends RequestSyncRunOptions {\n readonly syncId: string\n}\n\nexport interface SyncRunRequestResult {\n readonly syncId: string\n readonly runId: string\n /** The connection the run reads, on a sync of an OAuth connector. */\n readonly connectionId?: string\n /** Durable time at which the run entered the queue. */\n readonly queuedAt: string\n readonly jobId?: string\n readonly created: boolean\n}\n\n/** A static connector's sync queues one run; an OAuth connector's sync one per connection. */\nexport interface SyncRunRequestResults {\n readonly runs: readonly SyncRunRequestResult[]\n}\n\n/**\n * Authorize and queue a sync run request.\n *\n * Operates on an already-resolved definition and the shared runtime context, so the HTTP route and\n * the runtime verb cannot drift apart.\n *\n * The immutable child execution and queued run are persisted before queue publication.\n */\nexport async function requestSyncRun(\n runtime: SixbRuntimeContext,\n execution: ExecutionContext,\n sync: SyncDefinition,\n options: RequestSyncRunOptions = {},\n connections?: SyncConnections\n): Promise<SyncRunRequestResults> {\n resolveExecutionScopeAuthorization(runtime.projectId, {\n execution,\n authorization: runtime.runtimeAuthorization,\n })\n assertAuthorized(runtime, { kind: \"sync.run\", syncId: sync.id })\n if (!runtime.storage.syncRuns) {\n throw new SyncValidationError(\"[Sixb] Sync run storage is not configured.\")\n }\n\n const queue = runtime.queues.syncRuns\n if (!queue) {\n throw new SyncValidationError(\"[Sixb] Sync run queue is not configured.\")\n }\n\n const { connectionId, ...request } = options\n const dispatch = (runId: string | undefined, connection?: string) =>\n dispatchSyncRun({\n errorReporterHost: runtime,\n projectId: runtime.projectId,\n sync,\n storage: runtime.storage,\n queue,\n ...request,\n ...(runId === undefined ? {} : { runId }),\n // A run that has not started reads its connection when it starts: a request that arrives\n // meanwhile, like a burst of a person's notifications, is already covered by it.\n ...(connection === undefined ? {} : { connectionId: connection, joinQueuedRun: true }),\n createExecution: async (executionId, queuedRunId) => {\n const caller = await ensureExecutionRecord(\n runtime.storage.executions,\n executionRecordInputFromRuntime({\n execution,\n runtimeAuthorization: runtime.runtimeAuthorization,\n })\n )\n return createPrimitiveExecutionRecord({\n id: executionId,\n primitive: { kind: \"sync\", id: sync.id, runId: queuedRunId },\n origin: { type: \"execution\", parent: caller },\n })\n },\n })\n\n if (!isOAuthConnectorDefinition(sync.connector)) {\n if (connectionId !== undefined) {\n throw new SyncValidationError(\n `[Sixb] Sync '${sync.id}' reads static connector '${sync.connector.id}', which has no connections.`\n )\n }\n return { runs: [await dispatch(request.runId)] }\n }\n\n if (!connections) {\n throw new SyncValidationError(\n `[Sixb] Sync '${sync.id}' reads OAuth connector '${sync.connector.id}', whose connections this runtime cannot list.`\n )\n }\n const runnable = (await connections.list(sync.connector)).filter((connection) =>\n mayRunConnection(runtime, execution, connection)\n )\n\n if (connectionId !== undefined) {\n if (!runnable.some((connection) => connection.id === connectionId)) {\n throw new SyncValidationError(\n `[Sixb] Sync '${sync.id}' has no connection '${connectionId}' you can run.`\n )\n }\n return { runs: [await dispatch(request.runId, connectionId)] }\n }\n\n const runs: SyncRunRequestResult[] = []\n for (const connection of runnable) {\n const runId = request.runId === undefined ? undefined : `${request.runId}:${connection.id}`\n runs.push(await dispatch(runId, connection.id))\n }\n return { runs }\n}\n"
|
|
10
|
+
],
|
|
11
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,cAAc,CAAC,OAAe,OAAqB;AAAA,EAC1D,IAAI,CAAC,MAAM,KAAK,GAAG;AAAA,IACjB,MAAM,IAAI,gBAAe,aAAa,0BAA0B;AAAA,EAClE;AAAA;AAmBK,SAAS,gBAAyE,CACvF,IACA,SACA,UAAsC,CAAC,GACH;AAAA,EACpC,eAAe,IAAI,IAAI;AAAA,EACvB,eAAe,QAAQ,MAAM,MAAM;AAAA,EAEnC,IAAI,OAAO,QAAQ,YAAY,YAAY;AAAA,IACzC,MAAM,IAAI,gBAAe,+CAA+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