@sixb/core 0.2.4 → 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 +41 -40
- 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 +50 -3
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/ids.d.ts +2 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +7 -5
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +74 -50
- 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/queued-turn.d.ts +16 -0
- package/dist/agents/queued-turn.d.ts.map +1 -0
- package/dist/agents/request.d.ts +120 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-after-finish.d.ts +10 -0
- package/dist/agents/run-after-finish.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +0 -38
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-events.d.ts +10 -1
- 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-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session.d.ts +14 -1
- package/dist/agents/run-session.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 +53 -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/agents/turn-answered.d.ts +7 -0
- package/dist/agents/turn-answered.d.ts.map +1 -0
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/artifacts/canvas-display.d.ts +3 -5
- package/dist/artifacts/canvas-display.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +14 -3
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/document-fill.d.ts +18 -0
- package/dist/artifacts/document-fill.d.ts.map +1 -0
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/events.d.ts +3 -2
- package/dist/artifacts/events.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +40 -4
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +8 -1
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/document-data.d.ts +98 -0
- package/dist/artifacts/frames/document-data.d.ts.map +1 -0
- package/dist/artifacts/frames/entries.d.ts +12 -7
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/index.d.ts +2 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +22 -13
- package/dist/artifacts/frames/index.js.map +4 -4
- package/dist/artifacts/frames/kit.d.ts +15 -0
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +12 -1
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/runtime.d.ts +24 -4
- package/dist/artifacts/frames/runtime.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +3 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +9 -3
- package/dist/artifacts/index.js.map +3 -3
- package/dist/artifacts/live/blocks.d.ts +62 -0
- package/dist/artifacts/live/blocks.d.ts.map +1 -0
- package/dist/artifacts/live/board.d.ts +6 -0
- package/dist/artifacts/live/board.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts +12 -0
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +2 -0
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +148 -44
- package/dist/artifacts/live/index.js.map +3 -3
- package/dist/artifacts/live/page.d.ts +49 -0
- package/dist/artifacts/live/page.d.ts.map +1 -0
- package/dist/artifacts/live/protocol.d.ts +5 -0
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +2 -2
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +29 -24
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/live/state.d.ts +4 -1
- package/dist/artifacts/live/state.d.ts.map +1 -1
- package/dist/artifacts/outline.d.ts +16 -0
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/paper.d.ts +22 -0
- package/dist/artifacts/paper.d.ts.map +1 -0
- package/dist/artifacts/pdf-job.d.ts +9 -0
- package/dist/artifacts/pdf-job.d.ts.map +1 -0
- package/dist/artifacts/publish/fields.d.ts +25 -0
- package/dist/artifacts/publish/fields.d.ts.map +1 -0
- package/dist/artifacts/publish/index.d.ts +2 -1
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +32 -23
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +7 -6
- package/dist/artifacts/publish/merge.d.ts.map +1 -1
- package/dist/artifacts/publish/pdf.d.ts +28 -0
- package/dist/artifacts/publish/pdf.d.ts.map +1 -0
- package/dist/artifacts/publish/previews.d.ts +12 -20
- package/dist/artifacts/publish/previews.d.ts.map +1 -1
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/queries.d.ts +6 -1
- package/dist/artifacts/publish/queries.d.ts.map +1 -1
- package/dist/artifacts/publish/query-answers.d.ts +5 -2
- package/dist/artifacts/publish/query-answers.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/document-html.d.ts +24 -0
- package/dist/artifacts/publish/validate/document-html.d.ts.map +1 -0
- package/dist/artifacts/publish/validate/document.d.ts +5 -3
- package/dist/artifacts/publish/validate/document.d.ts.map +1 -1
- package/dist/artifacts/queries.d.ts +16 -2
- package/dist/artifacts/queries.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/event-visibility.d.ts.map +1 -1
- package/dist/authorization/index.js +2 -2
- package/dist/blob-storage/index.js +1 -1
- package/dist/bootstrap/index.js +50 -48
- 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-0k3r5kb3.js → chunk-394zjzjs.js} +20 -10
- package/dist/{chunk-0k3r5kb3.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-p8pgnq8d.js → chunk-425ydk65.js} +5 -5
- package/dist/{chunk-p351afzm.js → chunk-5sswe5ej.js} +2 -2
- package/dist/{chunk-a6fjkcne.js → chunk-60662fyv.js} +54 -28
- package/dist/{chunk-a6fjkcne.js.map → chunk-60662fyv.js.map} +7 -6
- package/dist/{chunk-e0hnbb1m.js → chunk-61zptves.js} +1 -1
- 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-gxwy4c3s.js → chunk-7r9mqpva.js} +570 -104
- package/dist/chunk-7r9mqpva.js.map +47 -0
- package/dist/{chunk-3014rfjz.js → chunk-88xeh6zx.js} +28 -8
- package/dist/{chunk-3014rfjz.js.map → chunk-88xeh6zx.js.map} +4 -4
- package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
- package/dist/chunk-8tv3qd65.js.map +12 -0
- package/dist/chunk-90nqenq8.js +386 -0
- package/dist/chunk-90nqenq8.js.map +14 -0
- package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
- package/dist/{chunk-w1wq7gfr.js → chunk-9c9yknwt.js} +464 -29
- package/dist/{chunk-w1wq7gfr.js.map → chunk-9c9yknwt.js.map} +7 -7
- package/dist/{chunk-q9nkpr8k.js → chunk-9tpmfh3n.js} +1 -1
- package/dist/chunk-9wr3yajk.js.map +2 -2
- package/dist/{chunk-rtm1jq00.js → chunk-ats8y3d9.js} +1202 -246
- package/dist/{chunk-rtm1jq00.js.map → chunk-ats8y3d9.js.map} +16 -14
- package/dist/{chunk-td26wjr5.js → chunk-bcz9dxtf.js} +17 -47
- package/dist/chunk-bcz9dxtf.js.map +12 -0
- package/dist/chunk-bqr703h4.js +1799 -0
- package/dist/chunk-bqr703h4.js.map +13 -0
- package/dist/{chunk-sysnvjce.js → chunk-brhp9d97.js} +2 -2
- package/dist/{chunk-8a8k38tz.js → chunk-brybqw5k.js} +1 -1
- package/dist/{chunk-rsxb14an.js → chunk-bs1sd0e0.js} +12 -8
- package/dist/chunk-bs1sd0e0.js.map +18 -0
- package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
- package/dist/chunk-c29729me.js.map +12 -0
- package/dist/{chunk-855w9nvw.js → chunk-cg7cygfj.js} +1 -1
- package/dist/chunk-dq3t5sr3.js +114 -0
- package/dist/chunk-dq3t5sr3.js.map +11 -0
- package/dist/{chunk-t24yktqr.js → chunk-dvgc56n2.js} +20 -4
- package/dist/{chunk-t24yktqr.js.map → chunk-dvgc56n2.js.map} +5 -5
- package/dist/{chunk-r2psmn42.js → chunk-eg6xqef7.js} +1 -1
- package/dist/{chunk-7kpqntgw.js → chunk-f05994as.js} +1 -1
- package/dist/{chunk-msyevpp3.js → chunk-fmgf9h5e.js} +38 -14
- package/dist/chunk-fmgf9h5e.js.map +22 -0
- package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
- package/dist/chunk-fzbhybya.js.map +11 -0
- package/dist/{chunk-t0s7b3d1.js → chunk-gaj8djsw.js} +251 -6
- package/dist/chunk-gaj8djsw.js.map +13 -0
- package/dist/{chunk-2bn6813a.js → chunk-grt2j5vp.js} +2 -2
- package/dist/{chunk-s7xqfxs9.js → chunk-hkbks1xm.js} +3 -1
- package/dist/{chunk-s7xqfxs9.js.map → chunk-hkbks1xm.js.map} +3 -3
- package/dist/chunk-hn2r7z41.js.map +1 -1
- package/dist/{chunk-rtdrm592.js → chunk-htdzx40w.js} +2 -2
- package/dist/{chunk-bc3y6gff.js → chunk-jka26v8c.js} +1 -1
- package/dist/{chunk-yy914zfr.js → chunk-jt012fxq.js} +772 -98
- package/dist/chunk-jt012fxq.js.map +34 -0
- package/dist/{chunk-48c1z8nj.js → chunk-kft7mp7z.js} +28 -3
- package/dist/chunk-kft7mp7z.js.map +10 -0
- package/dist/chunk-mbwsgjn7.js +40 -0
- package/dist/chunk-mbwsgjn7.js.map +11 -0
- package/dist/{chunk-wa05txmk.js → chunk-n1hbwc6y.js} +51 -8
- package/dist/chunk-n1hbwc6y.js.map +12 -0
- package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
- package/dist/chunk-nxysqbt0.js.map +10 -0
- package/dist/{chunk-6ef4esq4.js → chunk-pqj8vff9.js} +4 -4
- package/dist/chunk-pvpq483h.js.map +2 -2
- package/dist/{chunk-mzx71snp.js → chunk-q7g9cqwt.js} +7 -2
- package/dist/{chunk-mzx71snp.js.map → chunk-q7g9cqwt.js.map} +3 -3
- package/dist/{chunk-n68vz95m.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-rsrc7vtw.js → chunk-s8xxef60.js} +240 -46
- package/dist/chunk-s8xxef60.js.map +50 -0
- package/dist/{chunk-r9rtavg9.js → chunk-t19wjmnc.js} +7 -7
- package/dist/{chunk-vzkxqf8h.js → chunk-tapdssb5.js} +50 -6
- package/dist/chunk-tapdssb5.js.map +23 -0
- package/dist/{chunk-dhkc9b23.js → chunk-v8a1qjzp.js} +1 -1
- package/dist/{chunk-hvbvq7p4.js → chunk-vs2s3p8n.js} +731 -10
- package/dist/chunk-vs2s3p8n.js.map +20 -0
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-8t2ynwg0.js → chunk-wzcjhv54.js} +31 -1
- package/dist/{chunk-8t2ynwg0.js.map → chunk-wzcjhv54.js.map} +3 -3
- package/dist/{chunk-8tqnsx3q.js → chunk-xavet0qs.js} +5 -3
- package/dist/{chunk-8tqnsx3q.js.map → chunk-xavet0qs.js.map} +3 -3
- package/dist/{chunk-8bns0y68.js → chunk-xf76csps.js} +5 -5
- package/dist/{chunk-cwdzcv37.js → chunk-xrmbhap8.js} +2 -2
- package/dist/{chunk-cwdzcv37.js.map → chunk-xrmbhap8.js.map} +2 -2
- package/dist/{chunk-f6ahf5gf.js → chunk-xxfj0rr2.js} +20 -5
- package/dist/chunk-xxfj0rr2.js.map +13 -0
- package/dist/{chunk-3hzhcfsv.js → chunk-y8fwm3z2.js} +2 -2
- package/dist/{chunk-3hzhcfsv.js.map → chunk-y8fwm3z2.js.map} +3 -3
- package/dist/{chunk-smnt672s.js → chunk-ygvay56w.js} +20 -4
- package/dist/chunk-ygvay56w.js.map +10 -0
- package/dist/{chunk-evj5jxz3.js → chunk-ykchk644.js} +63 -15
- package/dist/{chunk-evj5jxz3.js.map → chunk-ykchk644.js.map} +7 -7
- package/dist/{chunk-vepea5c3.js → chunk-ym1bqd98.js} +6 -6
- package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
- package/dist/chunk-z4jqb44a.js.map +10 -0
- package/dist/connectors/connection-handles.d.ts +9 -0
- package/dist/connectors/connection-handles.d.ts.map +1 -0
- package/dist/connectors/connections/authorizations.d.ts +9 -0
- package/dist/connectors/connections/authorizations.d.ts.map +1 -1
- package/dist/connectors/connections/capability.d.ts +11 -0
- package/dist/connectors/connections/capability.d.ts.map +1 -1
- package/dist/connectors/connections/events.d.ts +17 -0
- package/dist/connectors/connections/events.d.ts.map +1 -0
- 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/runs.d.ts +3 -0
- package/dist/connectors/connections/runs.d.ts.map +1 -1
- package/dist/connectors/connections/service.d.ts +13 -1
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/execution.d.ts +14 -2
- package/dist/connectors/execution.d.ts.map +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/service.d.ts +5 -1
- package/dist/connectors/service.d.ts.map +1 -1
- package/dist/connectors/types.d.ts +22 -1
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/datasets/write.js +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +3 -2
- package/dist/deploy/internal.js.map +3 -3
- package/dist/deploy/services.d.ts.map +1 -1
- package/dist/deploy/types.d.ts +22 -2
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/events/definitions.d.ts +4 -0
- package/dist/events/definitions.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/index.d.ts +2 -2
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +3 -3
- package/dist/events/outbox-dispatcher.d.ts +7 -0
- package/dist/events/outbox-dispatcher.d.ts.map +1 -1
- package/dist/events/scope.d.ts +1 -0
- package/dist/events/scope.d.ts.map +1 -1
- package/dist/events/scope.js +1 -1
- package/dist/events/selectors/builder.d.ts +9 -1
- package/dist/events/selectors/builder.d.ts.map +1 -1
- package/dist/events/selectors/index.d.ts +2 -2
- package/dist/events/selectors/index.d.ts.map +1 -1
- package/dist/events/selectors/index.js +2 -2
- package/dist/events/selectors/predicate.d.ts.map +1 -1
- package/dist/events/selectors/types.d.ts +18 -3
- package/dist/events/selectors/types.d.ts.map +1 -1
- package/dist/events/types/artifacts.d.ts +7 -1
- package/dist/events/types/artifacts.d.ts.map +1 -1
- package/dist/events/types/connectors.d.ts +32 -0
- package/dist/events/types/connectors.d.ts.map +1 -0
- package/dist/events/types/index.d.ts +3 -1
- package/dist/events/types/index.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 +43 -42
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts +5 -0
- package/dist/execution/authorization.d.ts.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 +41 -40
- 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 +39 -38
- package/dist/execution/request.js.map +3 -3
- package/dist/execution/scopes.d.ts +8 -0
- package/dist/execution/scopes.d.ts.map +1 -1
- package/dist/execution/script.d.ts +7 -0
- package/dist/execution/script.d.ts.map +1 -0
- package/dist/execution/types.d.ts +16 -1
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +13 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -70
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +1 -1
- package/dist/lineage/executors.d.ts +1 -1
- package/dist/lineage/executors.d.ts.map +1 -1
- package/dist/maintenance/index.js +2 -2
- package/dist/materialization/event-envelopes.d.ts +3 -3
- package/dist/materialization/event-envelopes.d.ts.map +1 -1
- package/dist/materialization/events.d.ts +6 -0
- package/dist/materialization/events.d.ts.map +1 -1
- package/dist/materialization/index.js +1 -1
- package/dist/materialization/model.d.ts +6 -0
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/index.js +24 -23
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/projections/replace.d.ts.map +1 -1
- package/dist/materializer/projections/replacement-plan.d.ts +2 -0
- package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
- package/dist/materializer/shared/normalize.d.ts +1 -0
- package/dist/materializer/shared/normalize.d.ts.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 +22 -21
- 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 +41 -40
- 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 +21 -20
- 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 +27 -26
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/builders.d.ts +7 -1
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/index.d.ts +1 -1
- package/dist/projections/index.d.ts.map +1 -1
- package/dist/projections/internal.js +22 -21
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/types.d.ts +10 -0
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/queues/in-memory.d.ts +3 -2
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +40 -13
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +13 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +1 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +47 -25
- package/dist/runtime/internal.js.map +4 -3
- package/dist/runtime/locale.d.ts +0 -2
- package/dist/runtime/locale.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +1 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/script.d.ts +39 -0
- package/dist/runtime/script.d.ts.map +1 -0
- package/dist/runtime/sixb.d.ts +2 -2
- 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/schedules/builders.d.ts.map +1 -1
- package/dist/schedules/index.js +3 -3
- package/dist/schedules/runtime.d.ts.map +1 -1
- package/dist/schedules/validation.d.ts +2 -0
- package/dist/schedules/validation.d.ts.map +1 -1
- package/dist/security/view-conditions.d.ts.map +1 -1
- package/dist/shares/internal.js +19 -18
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/errors.d.ts +1 -1
- package/dist/storage/agents/errors.d.ts.map +1 -1
- package/dist/storage/agents/in-memory.d.ts +43 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +2 -2
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts +54 -11
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +41 -5
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +291 -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 +7 -1
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
- package/dist/storage/artifacts/index.d.ts +1 -1
- package/dist/storage/artifacts/index.d.ts.map +1 -1
- package/dist/storage/artifacts/record.d.ts +5 -2
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +41 -0
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.d.ts +3 -3
- package/dist/storage/executions/provider.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +1 -1
- package/dist/storage/executions/types.d.ts +6 -0
- package/dist/storage/executions/types.d.ts.map +1 -1
- package/dist/storage/executions/validation.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +7 -7
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +30 -25
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +1 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +12 -10
- package/dist/storage/internal.js.map +2 -2
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts +2 -0
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +1 -1
- package/dist/storage/ontology/replacement-plans.d.ts +8 -0
- package/dist/storage/ontology/replacement-plans.d.ts.map +1 -1
- 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 +28 -27
- 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-execution.d.ts +3 -0
- package/dist/testing/agent-execution.d.ts.map +1 -1
- package/dist/testing/agent-inbox-storage-contract.d.ts +15 -0
- package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -0
- 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/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6589 -4627
- package/dist/testing/index.js.map +13 -12
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/testing/run-claim-storage-contract.d.ts.map +1 -1
- package/dist/webhooks/connections.d.ts +3 -4
- package/dist/webhooks/connections.d.ts.map +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.d.ts.map +1 -1
- package/dist/webhooks/internal.js +22 -54
- package/dist/webhooks/internal.js.map +3 -3
- package/dist/webhooks/types.d.ts +2 -11
- package/dist/webhooks/types.d.ts.map +1 -1
- 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/queued-run-dispatch.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 +50 -48
- package/dist/workflows/index.js.map +1 -1
- package/package.json +12 -1
- package/src/actions/validation.ts +3 -1
- package/src/agents/README.md +6 -2
- package/src/agents/children.ts +6 -0
- package/src/agents/errors.ts +3 -0
- package/src/agents/execution.ts +331 -43
- package/src/agents/ids.ts +5 -0
- package/src/agents/index.ts +22 -4
- package/src/agents/model-routing.ts +25 -9
- package/src/agents/queued-turn.ts +46 -0
- package/src/agents/request.ts +1444 -210
- package/src/agents/run-after-finish.ts +259 -2
- package/src/agents/run-artifacts.ts +3 -93
- package/src/agents/run-events.ts +256 -34
- package/src/agents/run-session-children.ts +13 -2
- package/src/agents/run-session-http.ts +9 -2
- package/src/agents/run-session-serve.ts +2 -8
- package/src/agents/run-session.ts +142 -3
- package/src/agents/run-turn.ts +148 -23
- package/src/agents/streams/index.ts +3 -0
- package/src/agents/streams/internal.ts +12 -0
- package/src/agents/streams/protocol.ts +109 -1
- package/src/agents/streams/steps.ts +131 -0
- package/src/agents/thread-access.ts +57 -2
- package/src/agents/turn-answered.ts +31 -0
- package/src/agents/validation.ts +2 -0
- package/src/artifacts/canvas-display.ts +4 -6
- package/src/artifacts/comments.ts +70 -17
- package/src/artifacts/document-fill.ts +103 -0
- package/src/artifacts/errors.ts +2 -0
- package/src/artifacts/events.ts +4 -1
- package/src/artifacts/execution.ts +265 -31
- package/src/artifacts/frames/assets.ts +42 -7
- package/src/artifacts/frames/document-data.ts +353 -0
- package/src/artifacts/frames/entries.ts +22 -16
- package/src/artifacts/frames/grants.ts +2 -2
- package/src/artifacts/frames/index.ts +3 -0
- package/src/artifacts/frames/kit.ts +102 -0
- package/src/artifacts/frames/protocol.ts +12 -1
- package/src/artifacts/frames/runtime.ts +413 -6
- package/src/artifacts/index.ts +3 -0
- package/src/artifacts/live/blocks.ts +889 -0
- package/src/artifacts/live/board.ts +195 -42
- package/src/artifacts/live/document.ts +170 -5
- package/src/artifacts/live/index.ts +7 -0
- package/src/artifacts/live/page.ts +807 -0
- package/src/artifacts/live/protocol.ts +5 -0
- package/src/artifacts/live/server.ts +2 -2
- package/src/artifacts/live/state.ts +9 -4
- package/src/artifacts/outline.ts +17 -0
- package/src/artifacts/paper.ts +173 -0
- package/src/artifacts/pdf-job.ts +11 -0
- package/src/artifacts/publish/fields.ts +177 -0
- package/src/artifacts/publish/index.ts +6 -1
- package/src/artifacts/publish/merge.ts +28 -15
- package/src/artifacts/publish/pdf.ts +82 -0
- package/src/artifacts/publish/previews.ts +24 -34
- package/src/artifacts/publish/publish.ts +26 -3
- package/src/artifacts/publish/queries.ts +20 -4
- package/src/artifacts/publish/query-answers.ts +14 -3
- package/src/artifacts/publish/validate/document-html.ts +245 -0
- package/src/artifacts/publish/validate/document.ts +34 -3
- package/src/artifacts/queries.ts +59 -13
- package/src/artifacts/run-query.ts +5 -2
- package/src/authorization/event-visibility.ts +13 -0
- package/src/calendar.ts +195 -0
- package/src/connectors/connection-handles.ts +71 -0
- package/src/connectors/connections/authorizations.ts +50 -2
- package/src/connectors/connections/capability.ts +40 -0
- package/src/connectors/connections/events.ts +57 -0
- package/src/connectors/connections/internal.ts +3 -0
- package/src/connectors/connections/runs.ts +5 -0
- package/src/connectors/connections/service.ts +93 -6
- package/src/connectors/execution.ts +35 -8
- package/src/connectors/index.ts +3 -0
- package/src/connectors/service.ts +23 -0
- package/src/connectors/types.ts +29 -1
- package/src/deploy/index.ts +1 -0
- package/src/deploy/services.ts +1 -0
- package/src/deploy/types.ts +30 -2
- package/src/events/definitions.ts +14 -0
- package/src/events/execution.ts +51 -4
- package/src/events/index.ts +8 -0
- package/src/events/outbox-dispatcher.ts +12 -2
- package/src/events/scope.ts +3 -0
- package/src/events/selectors/builder.ts +49 -0
- package/src/events/selectors/index.ts +5 -0
- package/src/events/selectors/predicate.ts +2 -0
- package/src/events/selectors/types.ts +30 -1
- package/src/events/types/artifacts.ts +7 -1
- package/src/events/types/connectors.ts +36 -0
- package/src/events/types/index.ts +7 -0
- package/src/events/types/syncs.ts +4 -0
- package/src/execution/authorization.ts +45 -0
- package/src/execution/authorized-object-reader.ts +33 -5
- package/src/execution/durable.ts +2 -0
- package/src/execution/object-reader-ontology.ts +6 -0
- package/src/execution/request.ts +1 -0
- package/src/execution/scopes.ts +24 -0
- package/src/execution/script.ts +27 -0
- package/src/execution/types.ts +7 -1
- package/src/http/api-routes.ts +33 -0
- package/src/index.ts +39 -4
- package/src/lineage/executors.ts +3 -1
- package/src/materialization/event-envelopes.ts +10 -5
- package/src/materialization/events.ts +2 -0
- package/src/materialization/model.ts +6 -0
- package/src/materializer/README.md +10 -0
- package/src/materializer/projections/replace.ts +42 -1
- package/src/materializer/projections/replacement-plan.ts +44 -4
- package/src/materializer/shared/normalize.ts +4 -0
- 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/projections/builders.ts +20 -0
- package/src/projections/index.ts +1 -0
- package/src/projections/registry.ts +1 -0
- package/src/projections/revision.ts +2 -0
- package/src/projections/types.ts +11 -0
- package/src/projections/validation.ts +6 -0
- package/src/queues/in-memory.ts +5 -0
- package/src/queues/index.ts +3 -1
- package/src/queues/types.ts +45 -14
- package/src/runtime/host.ts +125 -11
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/locale.ts +0 -10
- package/src/runtime/resolve-definitions.ts +4 -1
- package/src/runtime/script.ts +62 -0
- package/src/runtime/sixb.ts +15 -5
- package/src/sandboxes/README.md +3 -1
- package/src/sandboxes/auth.ts +32 -4
- package/src/sandboxes/index.ts +15 -1
- package/src/schedules/builders.ts +4 -1
- package/src/schedules/runtime.ts +3 -0
- package/src/schedules/validation.ts +20 -2
- package/src/security/view-conditions.ts +2 -1
- package/src/storage/agents/errors.ts +1 -0
- package/src/storage/agents/in-memory.ts +500 -7
- package/src/storage/agents/index.ts +26 -0
- package/src/storage/agents/provider.ts +454 -15
- package/src/storage/agents/types.ts +315 -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 +52 -6
- package/src/storage/artifacts/index.ts +2 -0
- package/src/storage/artifacts/record.ts +33 -4
- package/src/storage/artifacts/types.ts +44 -0
- package/src/storage/executions/provider.ts +22 -2
- package/src/storage/executions/types.ts +2 -0
- package/src/storage/executions/validation.ts +27 -0
- package/src/storage/index.ts +29 -0
- package/src/storage/internal.ts +1 -0
- package/src/storage/ontology/in-memory/replacement-plans.ts +22 -0
- package/src/storage/ontology/replacement-plans.ts +6 -0
- package/src/storage/operation-scope.ts +2 -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-execution.ts +45 -2
- package/src/testing/agent-inbox-storage-contract.ts +874 -0
- package/src/testing/agent-storage-contract.ts +965 -103
- package/src/testing/ai-cost-storage-contract.ts +80 -0
- package/src/testing/artifact-storage-contract.ts +201 -4
- package/src/testing/execution-storage-contract.ts +31 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/materializer-storage-contract.ts +139 -1
- package/src/testing/queues-contract.ts +22 -0
- package/src/testing/run-claim-storage-contract.ts +116 -0
- package/src/webhooks/connections.ts +9 -50
- package/src/webhooks/index.ts +0 -2
- package/src/webhooks/types.ts +2 -13
- 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/queued-run-dispatch.ts +8 -1
- package/src/workers/worker.ts +67 -7
- package/dist/chunk-3z1vxzcm.js +0 -234
- package/dist/chunk-3z1vxzcm.js.map +0 -12
- package/dist/chunk-48c1z8nj.js.map +0 -10
- package/dist/chunk-58geavnf.js +0 -29
- package/dist/chunk-58geavnf.js.map +0 -10
- package/dist/chunk-5a4a52tq.js.map +0 -10
- package/dist/chunk-9nsjjd44.js.map +0 -12
- package/dist/chunk-b9qfh2ya.js.map +0 -11
- package/dist/chunk-eptrvnby.js.map +0 -12
- package/dist/chunk-f6ahf5gf.js.map +0 -13
- package/dist/chunk-gxwy4c3s.js.map +0 -47
- package/dist/chunk-hvbvq7p4.js.map +0 -18
- package/dist/chunk-m2jerfef.js +0 -474
- package/dist/chunk-m2jerfef.js.map +0 -11
- package/dist/chunk-msyevpp3.js.map +0 -22
- package/dist/chunk-n4zzaf6q.js.map +0 -10
- package/dist/chunk-rsrc7vtw.js.map +0 -49
- package/dist/chunk-rsxb14an.js.map +0 -18
- package/dist/chunk-smnt672s.js.map +0 -10
- package/dist/chunk-t0s7b3d1.js.map +0 -13
- package/dist/chunk-td26wjr5.js.map +0 -13
- package/dist/chunk-vzkxqf8h.js.map +0 -23
- package/dist/chunk-wa05txmk.js.map +0 -11
- package/dist/chunk-yv8hv4wq.js.map +0 -10
- package/dist/chunk-yy914zfr.js.map +0 -30
- package/dist/chunk-zeykm8my.js.map +0 -14
- /package/dist/{chunk-stmxh0hv.js.map → chunk-3neam1y5.js.map} +0 -0
- /package/dist/{chunk-p8pgnq8d.js.map → chunk-425ydk65.js.map} +0 -0
- /package/dist/{chunk-p351afzm.js.map → chunk-5sswe5ej.js.map} +0 -0
- /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
- /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
- /package/dist/{chunk-q9nkpr8k.js.map → chunk-9tpmfh3n.js.map} +0 -0
- /package/dist/{chunk-sysnvjce.js.map → chunk-brhp9d97.js.map} +0 -0
- /package/dist/{chunk-8a8k38tz.js.map → chunk-brybqw5k.js.map} +0 -0
- /package/dist/{chunk-855w9nvw.js.map → chunk-cg7cygfj.js.map} +0 -0
- /package/dist/{chunk-r2psmn42.js.map → chunk-eg6xqef7.js.map} +0 -0
- /package/dist/{chunk-7kpqntgw.js.map → chunk-f05994as.js.map} +0 -0
- /package/dist/{chunk-2bn6813a.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-6ef4esq4.js.map → chunk-pqj8vff9.js.map} +0 -0
- /package/dist/{chunk-n68vz95m.js.map → chunk-qbd282aa.js.map} +0 -0
- /package/dist/{chunk-r9rtavg9.js.map → chunk-t19wjmnc.js.map} +0 -0
- /package/dist/{chunk-dhkc9b23.js.map → chunk-v8a1qjzp.js.map} +0 -0
- /package/dist/{chunk-8bns0y68.js.map → chunk-xf76csps.js.map} +0 -0
- /package/dist/{chunk-vepea5c3.js.map → chunk-ym1bqd98.js.map} +0 -0
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
paginate,
|
|
17
17
|
InMemoryAuthStorage2,
|
|
18
18
|
principalsEqual2
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-394zjzjs.js";
|
|
20
20
|
import {
|
|
21
21
|
ObjectReadLimitExceededError2,
|
|
22
22
|
snapshotObjectReadExecutionLimits2,
|
|
23
23
|
assertObjectReadFacetCount2,
|
|
24
24
|
assertObjectReadOutputWithinLimit2
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-tapdssb5.js";
|
|
26
26
|
import {
|
|
27
27
|
assertObjectReaderProject2
|
|
28
28
|
} from "./chunk-rt9deb92.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
queryScalarKindForSchema,
|
|
34
34
|
resolvePropertyQueryCapabilities2,
|
|
35
35
|
resolveQuerySchema
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-7mhbs9yy.js";
|
|
37
37
|
import {
|
|
38
38
|
createEventId2
|
|
39
39
|
} from "./chunk-zrvhsq7f.js";
|
|
@@ -44,7 +44,10 @@ import {
|
|
|
44
44
|
participantsToAdd2,
|
|
45
45
|
compareAgentThreadParticipants2,
|
|
46
46
|
remapArtifactIds2,
|
|
47
|
+
assertDeleteAgentMessagesFromSeqInput2,
|
|
48
|
+
assertDeleteAgentContextCheckpointsAfterSeqInput2,
|
|
47
49
|
countsAsThreadMessage2,
|
|
50
|
+
isUnreadFor2,
|
|
48
51
|
planAgentThreadFork2,
|
|
49
52
|
assertConversationAgentRunSpec2,
|
|
50
53
|
assertAgentThreadComputer2,
|
|
@@ -58,6 +61,8 @@ import {
|
|
|
58
61
|
assertStartsOnComputer2,
|
|
59
62
|
movesComputerPlace2,
|
|
60
63
|
queuedTurnInCloud2,
|
|
64
|
+
queuedTurnOnComputer2,
|
|
65
|
+
unavailableChildSandboxState2,
|
|
61
66
|
assertAgentApprovalModeInput2,
|
|
62
67
|
assertAgentRunExecution2,
|
|
63
68
|
assertCreateSubagentRunInput2,
|
|
@@ -87,8 +92,15 @@ import {
|
|
|
87
92
|
assertRequestAgentApprovalInput2,
|
|
88
93
|
assertAgentApprovalCaller2,
|
|
89
94
|
newAgentApprovalRecord2,
|
|
90
|
-
agentApprovalMatches2
|
|
91
|
-
|
|
95
|
+
agentApprovalMatches2,
|
|
96
|
+
assertEnqueueAgentInboxItemInput2,
|
|
97
|
+
assertUpdateAgentInboxItemInput2,
|
|
98
|
+
assertTakeAgentInboxSteersInput2,
|
|
99
|
+
assertInboxThreadAcceptsItem2,
|
|
100
|
+
assertInboxRunOwnership2,
|
|
101
|
+
newAgentInboxItemRecord2,
|
|
102
|
+
updatedAgentInboxItemRecord2
|
|
103
|
+
} from "./chunk-gaj8djsw.js";
|
|
92
104
|
import {
|
|
93
105
|
InMemoryAiUsageStorage2,
|
|
94
106
|
buildAiAccountingOverview,
|
|
@@ -97,7 +109,7 @@ import {
|
|
|
97
109
|
buildAiModelCallGroups,
|
|
98
110
|
normalizeAiModelCallCostRecord2,
|
|
99
111
|
aiModelCallCostMatchesUsage2
|
|
100
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-3qtk0070.js";
|
|
101
113
|
import {
|
|
102
114
|
AiLimitStorageError2,
|
|
103
115
|
aiLimitCalendarMonth2,
|
|
@@ -134,7 +146,7 @@ import {
|
|
|
134
146
|
} from "./chunk-h89wz928.js";
|
|
135
147
|
import {
|
|
136
148
|
DurableFileUploadSessions2
|
|
137
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-cg7cygfj.js";
|
|
138
150
|
import {
|
|
139
151
|
actionSubjectsEqual,
|
|
140
152
|
normalizeRecordActionRunInput2,
|
|
@@ -158,7 +170,7 @@ import {
|
|
|
158
170
|
canFinishSyncRun2,
|
|
159
171
|
createTransactionStorageProxy2,
|
|
160
172
|
throwNestedStorageTransaction2
|
|
161
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-88xeh6zx.js";
|
|
162
174
|
import {
|
|
163
175
|
ARTIFACT_RESTORE_POINTS2,
|
|
164
176
|
ARTIFACT_COMMENT_LIMITS2
|
|
@@ -168,7 +180,7 @@ import {
|
|
|
168
180
|
prepareExecutionRecord2,
|
|
169
181
|
cloneExecutionRecord,
|
|
170
182
|
compareExecutionCreation2
|
|
171
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-c29729me.js";
|
|
172
184
|
import {
|
|
173
185
|
objectRefKey2,
|
|
174
186
|
linkRefKey2,
|
|
@@ -223,7 +235,7 @@ import {
|
|
|
223
235
|
assertSourceStagedRow2,
|
|
224
236
|
isExactStagingManifest2,
|
|
225
237
|
sourceConflict2
|
|
226
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-61zptves.js";
|
|
227
239
|
import {
|
|
228
240
|
createStorageOperationScope2,
|
|
229
241
|
createOperationScopedFacade2,
|
|
@@ -232,7 +244,7 @@ import {
|
|
|
232
244
|
createOntologyOperationScope2,
|
|
233
245
|
createObjectOperationScope2,
|
|
234
246
|
createWorkflowRunOperationScope2
|
|
235
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-hkbks1xm.js";
|
|
236
248
|
import {
|
|
237
249
|
planRunClaim2,
|
|
238
250
|
selectLostRuns,
|
|
@@ -287,7 +299,7 @@ import {
|
|
|
287
299
|
WorkflowRunError2,
|
|
288
300
|
assertWorkflowRunExecution2,
|
|
289
301
|
assertWorkflowAgentNodeRunExecution2
|
|
290
|
-
} from "./chunk-
|
|
302
|
+
} from "./chunk-5sswe5ej.js";
|
|
291
303
|
import {
|
|
292
304
|
ShareGrantStorageError2,
|
|
293
305
|
normalizeShareGrantCreate2,
|
|
@@ -331,7 +343,7 @@ import {
|
|
|
331
343
|
import {
|
|
332
344
|
AGENT_RUN_FAILURE_CODES2,
|
|
333
345
|
AGENT_TOKEN_RATE_SAMPLES2
|
|
334
|
-
} from "./chunk-
|
|
346
|
+
} from "./chunk-nxysqbt0.js";
|
|
335
347
|
import {
|
|
336
348
|
cloneJsonValue2,
|
|
337
349
|
stableJsonStringify2,
|
|
@@ -448,6 +460,9 @@ function normalizeFailure(failure) {
|
|
|
448
460
|
function key(projectId, id) {
|
|
449
461
|
return JSON.stringify([projectId, id]);
|
|
450
462
|
}
|
|
463
|
+
function readKey(projectId, threadId, principal) {
|
|
464
|
+
return JSON.stringify([projectId, threadId, principal.id]);
|
|
465
|
+
}
|
|
451
466
|
function clone(value) {
|
|
452
467
|
return structuredClone(value);
|
|
453
468
|
}
|
|
@@ -476,7 +491,7 @@ class InMemoryAgentThreadStore {
|
|
|
476
491
|
async transitionSandbox(input) {
|
|
477
492
|
const threadKey = key(input.projectId, input.id);
|
|
478
493
|
const thread = this.state.threads.get(threadKey) ?? null;
|
|
479
|
-
const run = input.action === "recreate" ? null : this.state.runs.get(key(input.projectId, input.runId)) ?? null;
|
|
494
|
+
const run = input.action === "recreate" || input.action === "restore" ? null : this.state.runs.get(key(input.projectId, input.runId)) ?? null;
|
|
480
495
|
const sandboxState = transitionAgentThreadSandbox2(thread, run, input);
|
|
481
496
|
if (!thread)
|
|
482
497
|
throw new AgentStorageError2("thread_not_found", "[Sixb] Thread not found.");
|
|
@@ -543,6 +558,14 @@ class InMemoryAgentThreadStore {
|
|
|
543
558
|
if (plan.checkpoint) {
|
|
544
559
|
this.state.checkpoints.set(key(input.projectId, plan.checkpoint.id), clone(plan.checkpoint));
|
|
545
560
|
}
|
|
561
|
+
const sourceRead = input.ownerPrincipal.type === "user" ? this.state.reads.get(readKey(input.projectId, input.sourceThreadId, input.ownerPrincipal)) : undefined;
|
|
562
|
+
if (sourceRead && input.ownerPrincipal.type === "user") {
|
|
563
|
+
this.state.reads.set(readKey(input.projectId, input.id, input.ownerPrincipal), {
|
|
564
|
+
...sourceRead,
|
|
565
|
+
threadId: input.id,
|
|
566
|
+
throughSeq: Math.min(sourceRead.throughSeq, plan.headSeq)
|
|
567
|
+
});
|
|
568
|
+
}
|
|
546
569
|
return clone(plan.thread);
|
|
547
570
|
}
|
|
548
571
|
async getById(params) {
|
|
@@ -594,6 +617,16 @@ class InMemoryAgentThreadStore {
|
|
|
594
617
|
}));
|
|
595
618
|
const participants = [...existing, ...added].sort(compareAgentThreadParticipants2);
|
|
596
619
|
this.state.participants.set(threadKey, participants);
|
|
620
|
+
const headSeq = headSeqOf(this.state, input.projectId, input.threadId);
|
|
621
|
+
for (const participant of added) {
|
|
622
|
+
this.state.reads.set(readKey(input.projectId, input.threadId, participant.principal), {
|
|
623
|
+
projectId: input.projectId,
|
|
624
|
+
threadId: input.threadId,
|
|
625
|
+
principal: clone(participant.principal),
|
|
626
|
+
throughSeq: headSeq,
|
|
627
|
+
readAt: new Date(addedAt)
|
|
628
|
+
});
|
|
629
|
+
}
|
|
597
630
|
return clone(participants);
|
|
598
631
|
}
|
|
599
632
|
async removeParticipant(input) {
|
|
@@ -603,6 +636,7 @@ class InMemoryAgentThreadStore {
|
|
|
603
636
|
if (!existing || !kept || kept.length === existing.length)
|
|
604
637
|
return false;
|
|
605
638
|
this.state.participants.set(threadKey, kept);
|
|
639
|
+
this.state.reads.delete(readKey(input.projectId, input.threadId, input.principal));
|
|
606
640
|
return true;
|
|
607
641
|
}
|
|
608
642
|
async assignComputer(input) {
|
|
@@ -611,8 +645,21 @@ class InMemoryAgentThreadStore {
|
|
|
611
645
|
const thread = this.state.threads.get(threadKey) ?? null;
|
|
612
646
|
const active = thread?.activeRunId ? this.state.runs.get(key(input.projectId, thread.activeRunId)) ?? null : null;
|
|
613
647
|
assertAssignableComputer2(thread, active, input.computer, input.id);
|
|
648
|
+
const queued = queuedTurnOnComputer2(active, input.computer);
|
|
649
|
+
if (queued)
|
|
650
|
+
this.state.runs.set(key(input.projectId, queued.id), queued);
|
|
651
|
+
if (thread.runsOn !== "computer") {
|
|
652
|
+
for (const [childKey, child] of this.state.threads) {
|
|
653
|
+
if (child.projectId !== input.projectId || child.parent?.threadId !== input.id)
|
|
654
|
+
continue;
|
|
655
|
+
const nextState = unavailableChildSandboxState2(child.sandboxState);
|
|
656
|
+
if (nextState)
|
|
657
|
+
this.state.threads.set(childKey, { ...child, sandboxState: nextState });
|
|
658
|
+
}
|
|
659
|
+
}
|
|
614
660
|
const assigned = {
|
|
615
661
|
...thread,
|
|
662
|
+
runsOn: "computer",
|
|
616
663
|
computer: clone(input.computer),
|
|
617
664
|
...movesComputerPlace2(thread, input.computer) ? { movedAt: new Date(input.movedAt ?? new Date) } : {}
|
|
618
665
|
};
|
|
@@ -640,6 +687,62 @@ class InMemoryAgentThreadStore {
|
|
|
640
687
|
}
|
|
641
688
|
}
|
|
642
689
|
|
|
690
|
+
class InMemoryAgentThreadReadStore {
|
|
691
|
+
state;
|
|
692
|
+
constructor(state) {
|
|
693
|
+
this.state = state;
|
|
694
|
+
}
|
|
695
|
+
async mark(input) {
|
|
696
|
+
const thread = this.state.threads.get(key(input.projectId, input.threadId));
|
|
697
|
+
if (!thread) {
|
|
698
|
+
throw new AgentStorageError2("thread_not_found", `[Sixb] Agent thread '${input.threadId}' not found for project '${input.projectId}'.`);
|
|
699
|
+
}
|
|
700
|
+
const reached = this.reachedSeq(input);
|
|
701
|
+
if (reached === null)
|
|
702
|
+
return this.stateOf(thread, input.principal);
|
|
703
|
+
const storedKey = readKey(input.projectId, input.threadId, input.principal);
|
|
704
|
+
const known = this.state.reads.get(storedKey);
|
|
705
|
+
const readAt = new Date(input.readAt ?? new Date);
|
|
706
|
+
this.state.reads.set(storedKey, {
|
|
707
|
+
projectId: input.projectId,
|
|
708
|
+
threadId: input.threadId,
|
|
709
|
+
principal: clone(input.principal),
|
|
710
|
+
throughSeq: Math.max(known?.throughSeq ?? 0, reached),
|
|
711
|
+
readAt: known && known.readAt > readAt ? known.readAt : readAt
|
|
712
|
+
});
|
|
713
|
+
return this.stateOf(thread, input.principal);
|
|
714
|
+
}
|
|
715
|
+
async list(input) {
|
|
716
|
+
return [...new Set(input.threadIds)].map((threadId) => this.state.threads.get(key(input.projectId, threadId))).filter((thread) => thread !== undefined).map((thread) => this.stateOf(thread, input.principal));
|
|
717
|
+
}
|
|
718
|
+
reachedSeq(input) {
|
|
719
|
+
if (input.throughMessageId === undefined) {
|
|
720
|
+
return headSeqOf(this.state, input.projectId, input.threadId);
|
|
721
|
+
}
|
|
722
|
+
const message = this.state.messages.get(key(input.projectId, input.throughMessageId));
|
|
723
|
+
return message?.threadId === input.threadId ? message.seq : null;
|
|
724
|
+
}
|
|
725
|
+
stateOf(thread, reader) {
|
|
726
|
+
const read = this.state.reads.get(readKey(thread.projectId, thread.id, reader));
|
|
727
|
+
const headSeq = headSeqOf(this.state, thread.projectId, thread.id);
|
|
728
|
+
const throughSeq = Math.min(read?.throughSeq ?? 0, headSeq);
|
|
729
|
+
let unread = 0;
|
|
730
|
+
for (const message of this.state.messages.values()) {
|
|
731
|
+
if (message.projectId !== thread.projectId || message.threadId !== thread.id)
|
|
732
|
+
continue;
|
|
733
|
+
if (message.seq > throughSeq && isUnreadFor2(message, reader))
|
|
734
|
+
unread += 1;
|
|
735
|
+
}
|
|
736
|
+
return {
|
|
737
|
+
threadId: thread.id,
|
|
738
|
+
throughSeq,
|
|
739
|
+
headSeq,
|
|
740
|
+
unread,
|
|
741
|
+
...read === undefined ? {} : { readAt: new Date(read.readAt) }
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
643
746
|
class InMemoryAgentRunStore {
|
|
644
747
|
state;
|
|
645
748
|
executions;
|
|
@@ -895,13 +998,33 @@ class InMemoryAgentRunStore {
|
|
|
895
998
|
}
|
|
896
999
|
async listThreadSubagents(input) {
|
|
897
1000
|
const runs = [...this.state.runs.values()].filter((run) => run.projectId === input.projectId);
|
|
898
|
-
const turns = new Map(runs.flatMap((run) =>
|
|
1001
|
+
const turns = new Map(runs.flatMap((run) => {
|
|
1002
|
+
if (run.kind !== "conversation" || run.threadId !== input.threadId)
|
|
1003
|
+
return [];
|
|
1004
|
+
if (input.retainedTurnsOnly && this.state.messages.get(key(run.projectId, run.triggerMessageId))?.threadId !== run.threadId) {
|
|
1005
|
+
return [];
|
|
1006
|
+
}
|
|
1007
|
+
return [[run.id, run]];
|
|
1008
|
+
}));
|
|
899
1009
|
const children = runs.filter((run) => run.kind === "subagent").filter((run) => turns.has(run.parentRunId)).filter((run) => input.spawnKey === undefined ? true : run.spawnKey === input.spawnKey).filter((run) => input.finishReason === undefined ? true : run.finishReason === input.finishReason).sort((left, right) => {
|
|
900
1010
|
const [a, b] = [turns.get(left.parentRunId), turns.get(right.parentRunId)];
|
|
901
1011
|
return compareByDate(a?.startedAt ?? a?.createdAt, b?.startedAt ?? b?.createdAt, left.parentRunId, right.parentRunId, "desc") || compareByDate(left.createdAt, right.createdAt, left.id, right.id, "desc");
|
|
902
1012
|
});
|
|
903
1013
|
return children.slice(0, input.limit ?? 100).map(clone);
|
|
904
1014
|
}
|
|
1015
|
+
async latestByThread(input) {
|
|
1016
|
+
const wanted = new Set(input.threadIds);
|
|
1017
|
+
const latest = new Map;
|
|
1018
|
+
for (const run of this.state.runs.values()) {
|
|
1019
|
+
if (run.projectId !== input.projectId || !wanted.has(run.threadId))
|
|
1020
|
+
continue;
|
|
1021
|
+
const known = latest.get(run.threadId);
|
|
1022
|
+
if (!known || compareByDate(run.createdAt, known.createdAt, run.id, known.id, "desc") < 0) {
|
|
1023
|
+
latest.set(run.threadId, run);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
return [...latest.values()].map(clone);
|
|
1027
|
+
}
|
|
905
1028
|
async list(input) {
|
|
906
1029
|
const order = input.order ?? "desc";
|
|
907
1030
|
const statuses = input.statuses ? new Set(input.statuses) : null;
|
|
@@ -1015,6 +1138,7 @@ class InMemoryAgentMessageStore {
|
|
|
1015
1138
|
for (const [messageKey] of messages) {
|
|
1016
1139
|
this.state.messages.delete(messageKey);
|
|
1017
1140
|
}
|
|
1141
|
+
clampReadsToHead(this.state, input.projectId, input.threadId);
|
|
1018
1142
|
const remainingMessages = [...this.state.messages.values()].filter((message) => message.projectId === input.projectId && message.threadId === input.threadId).sort((left, right) => right.seq - left.seq);
|
|
1019
1143
|
const latestMessage = remainingMessages[0];
|
|
1020
1144
|
const updatedAt = new Date;
|
|
@@ -1026,6 +1150,31 @@ class InMemoryAgentMessageStore {
|
|
|
1026
1150
|
}));
|
|
1027
1151
|
return messages.length;
|
|
1028
1152
|
}
|
|
1153
|
+
async deleteFromSeq(input) {
|
|
1154
|
+
assertDeleteAgentMessagesFromSeqInput2(input);
|
|
1155
|
+
const threadKey = key(input.projectId, input.threadId);
|
|
1156
|
+
const thread = this.state.threads.get(threadKey);
|
|
1157
|
+
if (!thread) {
|
|
1158
|
+
throw new AgentStorageError2("thread_not_found", `[Sixb] Agent thread '${input.threadId}' not found for project '${input.projectId}'.`);
|
|
1159
|
+
}
|
|
1160
|
+
const toDelete = [...this.state.messages.entries()].filter(([, message]) => message.projectId === input.projectId && message.threadId === input.threadId && message.seq >= input.fromSeq);
|
|
1161
|
+
if (toDelete.length === 0)
|
|
1162
|
+
return 0;
|
|
1163
|
+
for (const [messageKey] of toDelete) {
|
|
1164
|
+
this.state.messages.delete(messageKey);
|
|
1165
|
+
}
|
|
1166
|
+
clampReadsToHead(this.state, input.projectId, input.threadId);
|
|
1167
|
+
const remainingMessages = [...this.state.messages.values()].filter((message) => message.projectId === input.projectId && message.threadId === input.threadId).sort((left, right) => right.seq - left.seq);
|
|
1168
|
+
const latestMessage = remainingMessages[0];
|
|
1169
|
+
const updatedAt = new Date;
|
|
1170
|
+
this.state.threads.set(threadKey, clone({
|
|
1171
|
+
...thread,
|
|
1172
|
+
messageCount: remainingMessages.filter(countsAsThreadMessage2).length,
|
|
1173
|
+
lastMessageAt: latestMessage?.createdAt,
|
|
1174
|
+
updatedAt
|
|
1175
|
+
}));
|
|
1176
|
+
return toDelete.length;
|
|
1177
|
+
}
|
|
1029
1178
|
async getById(params) {
|
|
1030
1179
|
const record = this.state.messages.get(key(params.projectId, params.id));
|
|
1031
1180
|
return record ? clone(record) : null;
|
|
@@ -1038,14 +1187,26 @@ class InMemoryAgentMessageStore {
|
|
|
1038
1187
|
return { messages: page.map(clone), hasMore, total };
|
|
1039
1188
|
}
|
|
1040
1189
|
}
|
|
1041
|
-
function
|
|
1190
|
+
function headSeqOf(state, projectId, threadId) {
|
|
1042
1191
|
let max = 0;
|
|
1043
1192
|
for (const message of state.messages.values()) {
|
|
1044
1193
|
if (message.projectId === projectId && message.threadId === threadId && message.seq > max) {
|
|
1045
1194
|
max = message.seq;
|
|
1046
1195
|
}
|
|
1047
1196
|
}
|
|
1048
|
-
return max
|
|
1197
|
+
return max;
|
|
1198
|
+
}
|
|
1199
|
+
function nextMessageSeq(state, projectId, threadId) {
|
|
1200
|
+
return headSeqOf(state, projectId, threadId) + 1;
|
|
1201
|
+
}
|
|
1202
|
+
function clampReadsToHead(state, projectId, threadId) {
|
|
1203
|
+
const headSeq = headSeqOf(state, projectId, threadId);
|
|
1204
|
+
for (const [readKey, read] of state.reads) {
|
|
1205
|
+
if (read.projectId !== projectId || read.threadId !== threadId)
|
|
1206
|
+
continue;
|
|
1207
|
+
if (read.throughSeq > headSeq)
|
|
1208
|
+
state.reads.set(readKey, { ...read, throughSeq: headSeq });
|
|
1209
|
+
}
|
|
1049
1210
|
}
|
|
1050
1211
|
|
|
1051
1212
|
class InMemoryAgentContextCheckpointStore {
|
|
@@ -1107,6 +1268,14 @@ class InMemoryAgentContextCheckpointStore {
|
|
|
1107
1268
|
const record = this.findLatest(input.projectId, input.threadId);
|
|
1108
1269
|
return record ? clone(record) : null;
|
|
1109
1270
|
}
|
|
1271
|
+
async deleteAfterSeq(input) {
|
|
1272
|
+
assertDeleteAgentContextCheckpointsAfterSeqInput2(input);
|
|
1273
|
+
const matching = [...this.state.checkpoints.entries()].filter(([, checkpoint]) => checkpoint.projectId === input.projectId && checkpoint.threadId === input.threadId && checkpoint.observedHeadSeq > input.afterSeq);
|
|
1274
|
+
for (const [checkpointKey] of matching) {
|
|
1275
|
+
this.state.checkpoints.delete(checkpointKey);
|
|
1276
|
+
}
|
|
1277
|
+
return matching.length;
|
|
1278
|
+
}
|
|
1110
1279
|
async getByRunIds(input) {
|
|
1111
1280
|
const byRunId = new Map([...this.state.checkpoints.values()].filter((checkpoint) => checkpoint.projectId === input.projectId).filter((checkpoint) => checkpoint.threadId === input.threadId).map((checkpoint) => [checkpoint.createdByRunId, checkpoint]));
|
|
1112
1281
|
return [...new Set(input.runIds)].flatMap((runId) => {
|
|
@@ -1293,6 +1462,34 @@ class InMemoryAgentApprovalStore {
|
|
|
1293
1462
|
}
|
|
1294
1463
|
return { cancelled: cancelled.sort(compareApprovals).map(clone), stopped };
|
|
1295
1464
|
}
|
|
1465
|
+
async rewind(input) {
|
|
1466
|
+
const runIds = new Set(input.runIds);
|
|
1467
|
+
const clearedIds = new Set(input.clearedMessageIds ?? []);
|
|
1468
|
+
const cancelledAt = new Date(input.cancelledAt ?? new Date);
|
|
1469
|
+
const cancelled = [];
|
|
1470
|
+
let deleted = 0;
|
|
1471
|
+
for (const [approvalKey, approval] of [...this.state.approvals.entries()]) {
|
|
1472
|
+
if (approval.projectId !== input.projectId || approval.threadId !== input.threadId)
|
|
1473
|
+
continue;
|
|
1474
|
+
if (runIds.has(approval.runId)) {
|
|
1475
|
+
this.state.approvals.delete(approvalKey);
|
|
1476
|
+
deleted += 1;
|
|
1477
|
+
if (approval.status === "pending") {
|
|
1478
|
+
cancelled.push({
|
|
1479
|
+
...approval,
|
|
1480
|
+
status: "cancelled",
|
|
1481
|
+
turnStoppedAt: approval.turnStoppedAt ?? cancelledAt
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
continue;
|
|
1485
|
+
}
|
|
1486
|
+
if (approval.reportedInMessageId && clearedIds.has(approval.reportedInMessageId)) {
|
|
1487
|
+
const { reportedInMessageId: _reported, ...unreported } = approval;
|
|
1488
|
+
this.state.approvals.set(approvalKey, clone(unreported));
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
return { cancelled: cancelled.sort(compareApprovals).map(clone), deleted };
|
|
1492
|
+
}
|
|
1296
1493
|
async holdsRun(input) {
|
|
1297
1494
|
return holdsRun(this.state, input.projectId, input.runId);
|
|
1298
1495
|
}
|
|
@@ -1438,19 +1635,176 @@ class InMemoryAgentTokenRateStore {
|
|
|
1438
1635
|
}
|
|
1439
1636
|
}
|
|
1440
1637
|
|
|
1638
|
+
class InMemoryAgentInboxStore {
|
|
1639
|
+
state;
|
|
1640
|
+
constructor(state) {
|
|
1641
|
+
this.state = state;
|
|
1642
|
+
}
|
|
1643
|
+
async enqueue(input) {
|
|
1644
|
+
assertEnqueueAgentInboxItemInput2(input, "Sixb");
|
|
1645
|
+
const itemKey = key(input.projectId, input.id);
|
|
1646
|
+
const existing = this.state.inbox.get(itemKey);
|
|
1647
|
+
if (existing) {
|
|
1648
|
+
if (existing.threadId === input.threadId) {
|
|
1649
|
+
return { item: clone(existing), created: false };
|
|
1650
|
+
}
|
|
1651
|
+
throw new AgentStorageError2("duplicate_id", `[Sixb] Agent inbox item '${input.id}' already exists on another thread in project '${input.projectId}'.`);
|
|
1652
|
+
}
|
|
1653
|
+
const thread = this.state.threads.get(key(input.projectId, input.threadId)) ?? null;
|
|
1654
|
+
const threadItems = this.threadItems(input.projectId, input.threadId);
|
|
1655
|
+
assertInboxThreadAcceptsItem2(thread, input.threadId, input.projectId, threadItems.length, "Sixb");
|
|
1656
|
+
if (this.state.messages.has(key(input.projectId, input.messageId)) || [...this.state.inbox.values()].some((item) => item.projectId === input.projectId && item.messageId === input.messageId)) {
|
|
1657
|
+
throw new AgentStorageError2("duplicate_id", `[Sixb] Agent message '${input.messageId}' already exists for project '${input.projectId}'.`);
|
|
1658
|
+
}
|
|
1659
|
+
const seq = threadItems.reduce((max, item) => Math.max(max, item.seq), 0) + 1;
|
|
1660
|
+
const record = newAgentInboxItemRecord2(input, seq);
|
|
1661
|
+
this.state.inbox.set(itemKey, clone(record));
|
|
1662
|
+
return { item: clone(record), created: true };
|
|
1663
|
+
}
|
|
1664
|
+
async getById(params) {
|
|
1665
|
+
const record = this.state.inbox.get(key(params.projectId, params.id));
|
|
1666
|
+
return record ? clone(record) : null;
|
|
1667
|
+
}
|
|
1668
|
+
async list(input) {
|
|
1669
|
+
const includeClaimed = input.includeClaimed ?? true;
|
|
1670
|
+
return this.threadItems(input.projectId, input.threadId).filter((item) => includeClaimed || item.claimedBy === undefined).map(clone);
|
|
1671
|
+
}
|
|
1672
|
+
async update(input) {
|
|
1673
|
+
assertUpdateAgentInboxItemInput2(input, "Sixb");
|
|
1674
|
+
const itemKey = key(input.projectId, input.id);
|
|
1675
|
+
const current = this.state.inbox.get(itemKey);
|
|
1676
|
+
if (!current || current.threadId !== input.threadId)
|
|
1677
|
+
return null;
|
|
1678
|
+
const next = updatedAgentInboxItemRecord2(current, input);
|
|
1679
|
+
this.state.inbox.set(itemKey, clone(next));
|
|
1680
|
+
return clone(next);
|
|
1681
|
+
}
|
|
1682
|
+
async remove(input) {
|
|
1683
|
+
const itemKey = key(input.projectId, input.id);
|
|
1684
|
+
const current = this.state.inbox.get(itemKey);
|
|
1685
|
+
if (!current || current.threadId !== input.threadId)
|
|
1686
|
+
return null;
|
|
1687
|
+
if (current.claimedBy !== undefined) {
|
|
1688
|
+
throw new AgentStorageError2("invalid_state", `[Sixb] Agent inbox item '${current.id}' was already claimed by run '${current.claimedBy.runId}'.`);
|
|
1689
|
+
}
|
|
1690
|
+
this.state.inbox.delete(itemKey);
|
|
1691
|
+
return clone(current);
|
|
1692
|
+
}
|
|
1693
|
+
async takeSteers(input) {
|
|
1694
|
+
assertTakeAgentInboxSteersInput2(input, "Sixb");
|
|
1695
|
+
const run = this.state.runs.get(key(input.projectId, input.runId)) ?? null;
|
|
1696
|
+
assertInboxRunOwnership2(run, input, "Sixb");
|
|
1697
|
+
const now = new Date;
|
|
1698
|
+
const claimed = [];
|
|
1699
|
+
for (const item of this.threadItems(input.projectId, input.threadId)) {
|
|
1700
|
+
if (item.mode !== "steer" || item.immediate)
|
|
1701
|
+
continue;
|
|
1702
|
+
if (!principalsEqual2(item.authorPrincipal, input.authorPrincipal))
|
|
1703
|
+
continue;
|
|
1704
|
+
if (item.claimedBy?.runId === input.runId && item.claimedBy.executionToken === input.executionToken) {
|
|
1705
|
+
continue;
|
|
1706
|
+
}
|
|
1707
|
+
const next = {
|
|
1708
|
+
...item,
|
|
1709
|
+
claimedBy: {
|
|
1710
|
+
runId: input.runId,
|
|
1711
|
+
executionToken: input.executionToken,
|
|
1712
|
+
stepIndex: input.stepIndex,
|
|
1713
|
+
...input.afterAnswer ? { afterAnswer: true } : {}
|
|
1714
|
+
},
|
|
1715
|
+
updatedAt: now
|
|
1716
|
+
};
|
|
1717
|
+
this.state.inbox.set(key(item.projectId, item.id), clone(next));
|
|
1718
|
+
claimed.push(clone(next));
|
|
1719
|
+
}
|
|
1720
|
+
return claimed;
|
|
1721
|
+
}
|
|
1722
|
+
async consumeClaimed(input) {
|
|
1723
|
+
const run = this.state.runs.get(key(input.projectId, input.runId)) ?? null;
|
|
1724
|
+
assertInboxRunOwnership2(run, input, "Sixb");
|
|
1725
|
+
const persisted = new Set(input.messageIds);
|
|
1726
|
+
const now = new Date;
|
|
1727
|
+
const consumed = [];
|
|
1728
|
+
for (const item of this.threadItems(input.projectId, input.threadId)) {
|
|
1729
|
+
if (item.claimedBy?.runId !== input.runId || item.claimedBy.executionToken !== input.executionToken) {
|
|
1730
|
+
continue;
|
|
1731
|
+
}
|
|
1732
|
+
const itemKey = key(item.projectId, item.id);
|
|
1733
|
+
if (persisted.has(item.messageId)) {
|
|
1734
|
+
this.state.inbox.delete(itemKey);
|
|
1735
|
+
consumed.push(clone(item));
|
|
1736
|
+
} else {
|
|
1737
|
+
const { claimedBy: _claimedBy, ...rest } = item;
|
|
1738
|
+
this.state.inbox.set(itemKey, clone({ ...rest, updatedAt: now }));
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
return consumed;
|
|
1742
|
+
}
|
|
1743
|
+
async releaseClaimed(input) {
|
|
1744
|
+
const now = new Date;
|
|
1745
|
+
let released = 0;
|
|
1746
|
+
for (const [itemKey, item] of this.state.inbox) {
|
|
1747
|
+
if (item.projectId !== input.projectId || item.claimedBy?.runId !== input.runId)
|
|
1748
|
+
continue;
|
|
1749
|
+
const { claimedBy: _claimedBy, ...rest } = item;
|
|
1750
|
+
this.state.inbox.set(itemKey, clone({ ...rest, updatedAt: now }));
|
|
1751
|
+
released += 1;
|
|
1752
|
+
}
|
|
1753
|
+
return released;
|
|
1754
|
+
}
|
|
1755
|
+
async takeNextQueued(input) {
|
|
1756
|
+
const thread = this.state.threads.get(key(input.projectId, input.threadId));
|
|
1757
|
+
if (!thread || thread.status !== "active" || thread.activeRunId !== null)
|
|
1758
|
+
return null;
|
|
1759
|
+
const candidates = this.threadItems(input.projectId, input.threadId).filter((item) => item.claimedBy === undefined && (!input.onlyImmediate || item.immediate) && (input.authorPrincipal === undefined || principalsEqual2(item.authorPrincipal, input.authorPrincipal))).sort((left, right) => inboxPriority(left) - inboxPriority(right) || left.seq - right.seq);
|
|
1760
|
+
const winner = candidates[0];
|
|
1761
|
+
if (!winner)
|
|
1762
|
+
return null;
|
|
1763
|
+
this.state.inbox.delete(key(winner.projectId, winner.id));
|
|
1764
|
+
return clone(winner);
|
|
1765
|
+
}
|
|
1766
|
+
async listWaitingThreads(input) {
|
|
1767
|
+
const ids = new Set;
|
|
1768
|
+
for (const item of this.state.inbox.values()) {
|
|
1769
|
+
if (item.projectId !== input.projectId)
|
|
1770
|
+
continue;
|
|
1771
|
+
if (item.createdAt.getTime() >= input.createdBefore.getTime())
|
|
1772
|
+
continue;
|
|
1773
|
+
if (input.afterThreadId !== undefined && item.threadId <= input.afterThreadId)
|
|
1774
|
+
continue;
|
|
1775
|
+
const thread = this.state.threads.get(key(item.projectId, item.threadId));
|
|
1776
|
+
if (!thread || thread.activeRunId !== null)
|
|
1777
|
+
continue;
|
|
1778
|
+
ids.add(item.threadId);
|
|
1779
|
+
}
|
|
1780
|
+
return [...ids].sort().slice(0, input.limit);
|
|
1781
|
+
}
|
|
1782
|
+
threadItems(projectId, threadId) {
|
|
1783
|
+
return [...this.state.inbox.values()].filter((item) => item.projectId === projectId && item.threadId === threadId).sort((left, right) => left.seq - right.seq);
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
function inboxPriority(item) {
|
|
1787
|
+
if (item.immediate)
|
|
1788
|
+
return 0;
|
|
1789
|
+
return item.mode === "steer" ? 1 : 2;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1441
1792
|
class InMemoryAgentStorage2 {
|
|
1442
1793
|
state = {
|
|
1443
1794
|
threads: new Map,
|
|
1444
1795
|
participants: new Map,
|
|
1796
|
+
reads: new Map,
|
|
1445
1797
|
runs: new Map,
|
|
1446
1798
|
messages: new Map,
|
|
1447
1799
|
checkpoints: new Map,
|
|
1448
1800
|
memory: new Map,
|
|
1449
1801
|
approvals: new Map,
|
|
1450
1802
|
approvalModes: new Map,
|
|
1451
|
-
tokenRates: new Map
|
|
1803
|
+
tokenRates: new Map,
|
|
1804
|
+
inbox: new Map
|
|
1452
1805
|
};
|
|
1453
1806
|
threads;
|
|
1807
|
+
reads;
|
|
1454
1808
|
runs;
|
|
1455
1809
|
messages;
|
|
1456
1810
|
checkpoints;
|
|
@@ -1458,9 +1812,11 @@ class InMemoryAgentStorage2 {
|
|
|
1458
1812
|
approvals;
|
|
1459
1813
|
approvalModes;
|
|
1460
1814
|
tokenRates;
|
|
1815
|
+
inbox;
|
|
1461
1816
|
computers = new InMemoryAgentComputerSessionStore;
|
|
1462
1817
|
constructor(executions) {
|
|
1463
1818
|
this.threads = new InMemoryAgentThreadStore(this.state);
|
|
1819
|
+
this.reads = new InMemoryAgentThreadReadStore(this.state);
|
|
1464
1820
|
this.runs = new InMemoryAgentRunStore(this.state, executions);
|
|
1465
1821
|
this.messages = new InMemoryAgentMessageStore(this.state);
|
|
1466
1822
|
this.checkpoints = new InMemoryAgentContextCheckpointStore(this.state);
|
|
@@ -1468,23 +1824,27 @@ class InMemoryAgentStorage2 {
|
|
|
1468
1824
|
this.approvals = new InMemoryAgentApprovalStore(this.state);
|
|
1469
1825
|
this.approvalModes = new InMemoryAgentApprovalModeStore(this.state);
|
|
1470
1826
|
this.tokenRates = new InMemoryAgentTokenRateStore(this.state);
|
|
1827
|
+
this.inbox = new InMemoryAgentInboxStore(this.state);
|
|
1471
1828
|
}
|
|
1472
1829
|
snapshot() {
|
|
1473
1830
|
return {
|
|
1474
1831
|
threads: structuredClone(this.state.threads),
|
|
1475
1832
|
participants: structuredClone(this.state.participants),
|
|
1833
|
+
reads: structuredClone(this.state.reads),
|
|
1476
1834
|
runs: structuredClone(this.state.runs),
|
|
1477
1835
|
messages: structuredClone(this.state.messages),
|
|
1478
1836
|
checkpoints: structuredClone(this.state.checkpoints),
|
|
1479
1837
|
memory: structuredClone(this.state.memory),
|
|
1480
1838
|
approvals: structuredClone(this.state.approvals),
|
|
1481
1839
|
approvalModes: structuredClone(this.state.approvalModes),
|
|
1482
|
-
tokenRates: structuredClone(this.state.tokenRates)
|
|
1840
|
+
tokenRates: structuredClone(this.state.tokenRates),
|
|
1841
|
+
inbox: structuredClone(this.state.inbox)
|
|
1483
1842
|
};
|
|
1484
1843
|
}
|
|
1485
1844
|
restore(snapshot) {
|
|
1486
1845
|
replace(this.state.threads, snapshot.threads);
|
|
1487
1846
|
replace(this.state.participants, snapshot.participants);
|
|
1847
|
+
replace(this.state.reads, snapshot.reads);
|
|
1488
1848
|
replace(this.state.runs, snapshot.runs);
|
|
1489
1849
|
replace(this.state.messages, snapshot.messages);
|
|
1490
1850
|
replace(this.state.checkpoints, snapshot.checkpoints);
|
|
@@ -1492,6 +1852,7 @@ class InMemoryAgentStorage2 {
|
|
|
1492
1852
|
replace(this.state.approvals, snapshot.approvals);
|
|
1493
1853
|
replace(this.state.approvalModes, snapshot.approvalModes);
|
|
1494
1854
|
replace(this.state.tokenRates, snapshot.tokenRates);
|
|
1855
|
+
replace(this.state.inbox, snapshot.inbox);
|
|
1495
1856
|
}
|
|
1496
1857
|
}
|
|
1497
1858
|
function replace(target, source) {
|
|
@@ -3383,6 +3744,7 @@ class InMemoryArtifactStorage {
|
|
|
3383
3744
|
frameGrants = new Map;
|
|
3384
3745
|
state = new Map;
|
|
3385
3746
|
boardPreviews = new Map;
|
|
3747
|
+
pdfs = new Map;
|
|
3386
3748
|
async create(input) {
|
|
3387
3749
|
const key = artifactKey(input.projectId, input.id);
|
|
3388
3750
|
if (this.artifacts.has(key))
|
|
@@ -3511,15 +3873,20 @@ class InMemoryArtifactStorage {
|
|
|
3511
3873
|
return writes.sort((left, right) => left.artifactId < right.artifactId ? -1 : 1);
|
|
3512
3874
|
}
|
|
3513
3875
|
async undoTurnWrites(input) {
|
|
3514
|
-
const { turnRunId } = input;
|
|
3876
|
+
const { turnRunId, laterTurnRunIds = [] } = input;
|
|
3515
3877
|
const restored = [];
|
|
3516
3878
|
const deleted = [];
|
|
3517
3879
|
for (const [key, stored] of this.artifacts) {
|
|
3518
3880
|
if (stored.record.projectId !== input.projectId)
|
|
3519
3881
|
continue;
|
|
3520
|
-
const
|
|
3521
|
-
if (!
|
|
3882
|
+
const own = stored.turnWrites.get(turnRunId);
|
|
3883
|
+
if (!own)
|
|
3522
3884
|
continue;
|
|
3885
|
+
const later = laterTurnRunIds.filter((each) => stored.turnWrites.has(each));
|
|
3886
|
+
const write = {
|
|
3887
|
+
...own,
|
|
3888
|
+
writes: later.reduce((sum, each) => sum + (stored.turnWrites.get(each)?.writes ?? 0), own.writes)
|
|
3889
|
+
};
|
|
3523
3890
|
const revision = stored.record.revision;
|
|
3524
3891
|
if (write.created && turnUndoable2({ write, revision }) && !othersCommented2(stored.comments, input)) {
|
|
3525
3892
|
this.deleteArtifact(key);
|
|
@@ -3535,7 +3902,11 @@ class InMemoryArtifactStorage {
|
|
|
3535
3902
|
...target ? { target: { frozen: target.frozenAt !== undefined } } : {}
|
|
3536
3903
|
});
|
|
3537
3904
|
const undone = untouched && point ? undo(stored, point, input.documents?.[stored.record.id]) : null;
|
|
3538
|
-
|
|
3905
|
+
let next = forgetTurn(undone ?? stored, turnRunId, { undone: undone !== null });
|
|
3906
|
+
if (undone) {
|
|
3907
|
+
for (const each of later)
|
|
3908
|
+
next = forgetTurn(next, each, { undone: true });
|
|
3909
|
+
}
|
|
3539
3910
|
this.artifacts.set(key, next);
|
|
3540
3911
|
if (undone)
|
|
3541
3912
|
restored.push(published(next));
|
|
@@ -3679,6 +4050,23 @@ class InMemoryArtifactStorage {
|
|
|
3679
4050
|
this.boardPreviews.set(key, structuredClone({ projectId: input.projectId, ...preview }));
|
|
3680
4051
|
}
|
|
3681
4052
|
}
|
|
4053
|
+
async getPdf(input) {
|
|
4054
|
+
const kept = this.pdfs.get(`${input.projectId}\x00${input.renderKey}`);
|
|
4055
|
+
return kept ? structuredClone(kept) : null;
|
|
4056
|
+
}
|
|
4057
|
+
async putPdf(input) {
|
|
4058
|
+
const key = `${input.projectId}\x00${input.renderKey}`;
|
|
4059
|
+
const kept = this.pdfs.get(key);
|
|
4060
|
+
if (!kept || "failure" in kept && !("failure" in input)) {
|
|
4061
|
+
this.pdfs.set(key, structuredClone(input));
|
|
4062
|
+
}
|
|
4063
|
+
}
|
|
4064
|
+
async clearPdfFailure(input) {
|
|
4065
|
+
const key = `${input.projectId}\x00${input.renderKey}`;
|
|
4066
|
+
const kept = this.pdfs.get(key);
|
|
4067
|
+
if (kept && "failure" in kept)
|
|
4068
|
+
this.pdfs.delete(key);
|
|
4069
|
+
}
|
|
3682
4070
|
async createComment(input) {
|
|
3683
4071
|
const key = artifactKey(input.projectId, input.artifactId);
|
|
3684
4072
|
const stored = this.artifacts.get(key);
|
|
@@ -3710,7 +4098,12 @@ class InMemoryArtifactStorage {
|
|
|
3710
4098
|
revision: input.anchor.revision
|
|
3711
4099
|
},
|
|
3712
4100
|
body: input.body,
|
|
3713
|
-
author: input.author.type === "guest" ? {
|
|
4101
|
+
author: input.author.type === "guest" ? {
|
|
4102
|
+
type: "guest",
|
|
4103
|
+
id: input.author.id,
|
|
4104
|
+
name: input.author.name,
|
|
4105
|
+
grantId: input.author.grantId
|
|
4106
|
+
} : { type: input.author.type, id: input.author.id },
|
|
3714
4107
|
...input.origin ? { origin: { threadId: input.origin.threadId, runId: input.origin.runId } } : {},
|
|
3715
4108
|
createdAt: input.createdAt
|
|
3716
4109
|
});
|
|
@@ -3764,7 +4157,8 @@ class InMemoryArtifactStorage {
|
|
|
3764
4157
|
artifacts: this.artifacts,
|
|
3765
4158
|
frameGrants: this.frameGrants,
|
|
3766
4159
|
state: this.state,
|
|
3767
|
-
boardPreviews: this.boardPreviews
|
|
4160
|
+
boardPreviews: this.boardPreviews,
|
|
4161
|
+
pdfs: this.pdfs
|
|
3768
4162
|
});
|
|
3769
4163
|
}
|
|
3770
4164
|
restore(snapshot) {
|
|
@@ -3773,6 +4167,7 @@ class InMemoryArtifactStorage {
|
|
|
3773
4167
|
this.frameGrants = new Map(restored.frameGrants);
|
|
3774
4168
|
this.state = new Map([...restored.state].map(([key, kept]) => [key, new Map(kept)]));
|
|
3775
4169
|
this.boardPreviews = new Map(restored.boardPreviews);
|
|
4170
|
+
this.pdfs = new Map(restored.pdfs);
|
|
3776
4171
|
}
|
|
3777
4172
|
deleteArtifact(key) {
|
|
3778
4173
|
for (const [grantKey, grant] of this.frameGrants) {
|
|
@@ -6487,10 +6882,27 @@ class InMemoryOntologyReplacementPlanStorage {
|
|
|
6487
6882
|
addIdentity(plan, row.assertion, true);
|
|
6488
6883
|
}
|
|
6489
6884
|
}
|
|
6885
|
+
if (input.createdObjects) {
|
|
6886
|
+
for (const ref of this.unassertedCreatedObjects(input, input.createdObjects.objectTypeId)) {
|
|
6887
|
+
addIdentity(plan, { kind: "object", ref }, true);
|
|
6888
|
+
}
|
|
6889
|
+
}
|
|
6490
6890
|
this.state.replacementPlans.set(key, plan);
|
|
6491
6891
|
return { committedAt: plan.committedAt };
|
|
6492
6892
|
});
|
|
6493
6893
|
}
|
|
6894
|
+
*unassertedCreatedObjects(input, objectTypeId) {
|
|
6895
|
+
const liveRoots = this.state.activeSourceRoots.get(projectEntityKey(input.projectId, input.source.projectionId));
|
|
6896
|
+
for (const stored of this.state.objectOverrides.values()) {
|
|
6897
|
+
if (stored.projectId !== input.projectId || stored.ref.objectTypeId !== objectTypeId)
|
|
6898
|
+
continue;
|
|
6899
|
+
if (stored.value.kind !== "create")
|
|
6900
|
+
continue;
|
|
6901
|
+
if (liveRoots?.has(projectionEntityKey2({ kind: "object", ref: stored.ref })))
|
|
6902
|
+
continue;
|
|
6903
|
+
yield stored.ref;
|
|
6904
|
+
}
|
|
6905
|
+
}
|
|
6494
6906
|
async* streamState(input) {
|
|
6495
6907
|
assertPageRows2(input.pageRows);
|
|
6496
6908
|
this.hooks.beforeRead?.(`replacement-plan.${input.entityKind}`);
|
|
@@ -9282,7 +9694,8 @@ var SYNC_RUN_FAILURE_CODES2 = [
|
|
|
9282
9694
|
"internal.unexpected",
|
|
9283
9695
|
"runtime.cancelled",
|
|
9284
9696
|
"queue.enqueue_failed",
|
|
9285
|
-
"sync.execution_failed"
|
|
9697
|
+
"sync.execution_failed",
|
|
9698
|
+
"connector.authorization_required"
|
|
9286
9699
|
];
|
|
9287
9700
|
|
|
9288
9701
|
// src/storage/sync-runs/in-memory.ts
|
|
@@ -9354,6 +9767,7 @@ class InMemorySyncRunStorage2 {
|
|
|
9354
9767
|
projectId: input.projectId,
|
|
9355
9768
|
executionId: input.executionId,
|
|
9356
9769
|
syncId: input.syncId,
|
|
9770
|
+
...input.connectionId === undefined ? {} : { connectionId: input.connectionId },
|
|
9357
9771
|
datasetId: input.datasetId,
|
|
9358
9772
|
mode: input.mode,
|
|
9359
9773
|
status: "queued",
|
|
@@ -9468,7 +9882,7 @@ class InMemorySyncRunStorage2 {
|
|
|
9468
9882
|
const order = input.order ?? "desc";
|
|
9469
9883
|
const statuses = toStatusSet(input.statuses);
|
|
9470
9884
|
const syncIds = input.syncIds ? new Set(input.syncIds) : null;
|
|
9471
|
-
const filtered = [...this.rows.values()].filter((record) => record.projectId === input.projectId).filter((record) => input.syncId ? record.syncId === input.syncId : true).filter((record) => syncIds ? syncIds.has(record.syncId) : true).filter((record) => input.datasetId ? record.datasetId === input.datasetId : true).filter((record) => matchesRunListDateFilters(record, {
|
|
9885
|
+
const filtered = [...this.rows.values()].filter((record) => record.projectId === input.projectId).filter((record) => input.syncId ? record.syncId === input.syncId : true).filter((record) => syncIds ? syncIds.has(record.syncId) : true).filter((record) => input.connectionId === undefined ? true : (record.connectionId ?? null) === input.connectionId).filter((record) => isVisibleRun(record, input.visibleConnectionIds)).filter((record) => input.datasetId ? record.datasetId === input.datasetId : true).filter((record) => matchesRunListDateFilters(record, {
|
|
9472
9886
|
statuses,
|
|
9473
9887
|
startedAfter: input.startedAfter,
|
|
9474
9888
|
startedBefore: input.startedBefore
|
|
@@ -9481,11 +9895,29 @@ class InMemorySyncRunStorage2 {
|
|
|
9481
9895
|
};
|
|
9482
9896
|
}
|
|
9483
9897
|
async listLatestBySyncIds(input) {
|
|
9484
|
-
const runs = latestStartedAtByOwnerId([...this.rows.values()].filter((record) => record.projectId === input.projectId), input.syncIds, (record) => record.syncId);
|
|
9898
|
+
const runs = latestStartedAtByOwnerId([...this.rows.values()].filter((record) => record.projectId === input.projectId && isVisibleRun(record, input.visibleConnectionIds)), input.syncIds, (record) => record.syncId);
|
|
9485
9899
|
return {
|
|
9486
9900
|
runs: runs.map(cloneSyncRunRecord)
|
|
9487
9901
|
};
|
|
9488
9902
|
}
|
|
9903
|
+
async listLatestByConnection(input) {
|
|
9904
|
+
const syncIds = new Set(input.syncIds);
|
|
9905
|
+
const connectionIds = input.connectionIds ? new Set(input.connectionIds) : null;
|
|
9906
|
+
const latest = new Map;
|
|
9907
|
+
for (const record of this.rows.values()) {
|
|
9908
|
+
const { connectionId } = record;
|
|
9909
|
+
if (record.projectId !== input.projectId || connectionId === undefined)
|
|
9910
|
+
continue;
|
|
9911
|
+
if (!syncIds.has(record.syncId) || connectionIds && !connectionIds.has(connectionId)) {
|
|
9912
|
+
continue;
|
|
9913
|
+
}
|
|
9914
|
+
const key = JSON.stringify([record.syncId, connectionId]);
|
|
9915
|
+
const current = latest.get(key);
|
|
9916
|
+
if (!current || compareStartedAt(record, current, "desc") < 0)
|
|
9917
|
+
latest.set(key, record);
|
|
9918
|
+
}
|
|
9919
|
+
return { runs: [...latest.values()].map(cloneSyncRunRecord) };
|
|
9920
|
+
}
|
|
9489
9921
|
requireRun(projectId, id) {
|
|
9490
9922
|
const existing = this.rows.get(syncRunKey(projectId, id));
|
|
9491
9923
|
if (!existing) {
|
|
@@ -9505,6 +9937,9 @@ class InMemorySyncRunStorage2 {
|
|
|
9505
9937
|
return cloneSyncRunRecord(run);
|
|
9506
9938
|
}
|
|
9507
9939
|
}
|
|
9940
|
+
function isVisibleRun(record, visibleConnectionIds) {
|
|
9941
|
+
return visibleConnectionIds === undefined || record.connectionId === undefined || visibleConnectionIds.includes(record.connectionId);
|
|
9942
|
+
}
|
|
9508
9943
|
function staleExecution2(id) {
|
|
9509
9944
|
return new SyncRunError2(`[Sixb] Execution token is no longer current on sync run '${id}'.`);
|
|
9510
9945
|
}
|
|
@@ -11082,4 +11517,4 @@ var VECTOR_INDEXING_FAILURE_CODES2 = [
|
|
|
11082
11517
|
];
|
|
11083
11518
|
export { InMemoryActionRunStorage2, AGENT_MESSAGE_CONTENT_VERSION2, InMemoryAgentStorage2, AiCostStorageError2, InMemoryAiCostStorage2, InMemoryAiLimitStorage2, InMemoryConnectorConnectionStorage2, InMemoryDatasetIngestStorage2, InMemoryFileUploadSessions2, objectBatchKey2, linkBatchKey2, objectLinkCursor2, compareQueryScalarValues, matchesPredicate, sortTieDirection2, PIPELINE_RUN_FAILURE_CODES2, InMemoryPipelineRunStorage2, InMemoryProjectionRunStorage2, InMemoryRulesStorage2, InMemoryShareGrantStorage2, InMemoryShareSessionStorage2, SYNC_RUN_FAILURE_CODES2, InMemorySyncRunStorage2, WEBHOOK_RUN_FAILURE_CODES2, WEBHOOK_RUN_LEASE_MS2, canRetryWebhookRun2, InMemoryWebhookRunStorage2, WorkflowInterventionError2, InMemoryWorkflowInterventionStorage2, WORKFLOW_RUN_FAILURE_CODES2, InMemoryWorkflowRunStorage2, InMemoryWorkflowNodeRunStorage2, InMemoryWorkflowAgentNodeRunStorage2, InMemoryStorage2, prepareObjectQueries2, isMigrationCapableStorage2, migrateStorage2, checkStorageSchema2, step2, defineMigrations2, runMigrationSet2, describeMigrationHistory2, VECTOR_INDEXING_FAILURE_CODES2 };
|
|
11084
11519
|
|
|
11085
|
-
//# debugId=
|
|
11520
|
+
//# debugId=F61C51DAC05AF24964756E2164756E21
|