@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
|
@@ -63,6 +63,11 @@ export type TransitionAgentThreadSandboxInput = {
|
|
|
63
63
|
readonly expectedSandboxName: string
|
|
64
64
|
readonly name: string
|
|
65
65
|
}
|
|
66
|
+
| {
|
|
67
|
+
/** Go on in the sandbox a failed save left, as its owner chose: the one named `name`. */
|
|
68
|
+
readonly action: "restore"
|
|
69
|
+
readonly name: string
|
|
70
|
+
}
|
|
66
71
|
)
|
|
67
72
|
|
|
68
73
|
/**
|
|
@@ -301,6 +306,76 @@ export interface ListAgentThreadParticipantsInput {
|
|
|
301
306
|
readonly threadIds: readonly string[]
|
|
302
307
|
}
|
|
303
308
|
|
|
309
|
+
// ── agent_thread_reads — how far each person has read a conversation ──────────────────────────
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* How far one person's reading of a conversation has reached, as the `seq` of its last message.
|
|
313
|
+
*
|
|
314
|
+
* A watermark, not a flag: nothing writes here when a message arrives, so new ones sit past it
|
|
315
|
+
* until the reader moves it. A mark never moves it backwards, so two devices converge on the later
|
|
316
|
+
* position and a stale one cannot rewind the other. Only a deletion does: when a retry or an edit
|
|
317
|
+
* takes the newest messages away, every place past what remains comes back to it, because the next
|
|
318
|
+
* messages take those numbers again.
|
|
319
|
+
*/
|
|
320
|
+
export interface AgentThreadReadRecord {
|
|
321
|
+
readonly projectId: string
|
|
322
|
+
readonly threadId: string
|
|
323
|
+
readonly principal: UserPrincipal
|
|
324
|
+
/** The highest message `seq` this person's reading has reached. 0 when none has. */
|
|
325
|
+
readonly throughSeq: number
|
|
326
|
+
/** When this person last looked: every mark sets it, even one that leaves `throughSeq` alone. */
|
|
327
|
+
readonly readAt: Date
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* One person's place in a conversation, and what arrived past it.
|
|
332
|
+
*
|
|
333
|
+
* `unread` counts the messages past `throughSeq` that are new to them: every Agent answer and
|
|
334
|
+
* every other person's message. What they wrote is not, nor a message that only reports how
|
|
335
|
+
* approved calls ended (`countsAsThreadMessage`).
|
|
336
|
+
*/
|
|
337
|
+
export interface AgentThreadReadState {
|
|
338
|
+
readonly threadId: string
|
|
339
|
+
/** Where their reading reached, never past `headSeq`. 0 when they have no row. */
|
|
340
|
+
readonly throughSeq: number
|
|
341
|
+
/** The `seq` of the thread's newest message, 0 when it has none. */
|
|
342
|
+
readonly headSeq: number
|
|
343
|
+
/** Messages past `throughSeq` that someone else wrote. */
|
|
344
|
+
readonly unread: number
|
|
345
|
+
/** When they last looked; absent until they have a row. */
|
|
346
|
+
readonly readAt?: Date
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface MarkAgentThreadReadInput {
|
|
350
|
+
readonly projectId: string
|
|
351
|
+
readonly threadId: string
|
|
352
|
+
readonly principal: UserPrincipal
|
|
353
|
+
/**
|
|
354
|
+
* The last message they read, or the thread's newest when absent. A message the thread no longer
|
|
355
|
+
* holds marks nothing: a retry or an edit took it away, and its number may already name another.
|
|
356
|
+
*/
|
|
357
|
+
readonly throughMessageId?: string
|
|
358
|
+
readonly readAt?: Date
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export interface ListAgentThreadReadsInput {
|
|
362
|
+
readonly projectId: string
|
|
363
|
+
readonly threadIds: readonly string[]
|
|
364
|
+
readonly principal: UserPrincipal
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface AgentThreadReadStore {
|
|
368
|
+
/**
|
|
369
|
+
* Record that this person's reading reached a message, never moving it back, and that they
|
|
370
|
+
* looked now. A participant has a row from the moment they join, and the migration gave one to
|
|
371
|
+
* everyone in the threads that existed before; an owner without one reads as 0 until their
|
|
372
|
+
* first mark. Answers their place afterwards.
|
|
373
|
+
*/
|
|
374
|
+
mark(input: MarkAgentThreadReadInput): Promise<AgentThreadReadState>
|
|
375
|
+
/** One person's place in each of these threads; a thread that does not exist is absent. */
|
|
376
|
+
list(input: ListAgentThreadReadsInput): Promise<readonly AgentThreadReadState[]>
|
|
377
|
+
}
|
|
378
|
+
|
|
304
379
|
// ── agent_runs — one loop execution (the worker job; attribution + fencing) ───────────────────
|
|
305
380
|
|
|
306
381
|
/** Lifecycle shared by every durable agent execution, conversational or workflow-owned. */
|
|
@@ -447,6 +522,11 @@ export interface ConversationAgentRunSpec {
|
|
|
447
522
|
readonly approvalMode?: AgentApprovalMode
|
|
448
523
|
/** Its thread's `runsOn` when it was asked for: a computer's turn never reaches the agent queue. */
|
|
449
524
|
readonly runsOn?: "computer"
|
|
525
|
+
/**
|
|
526
|
+
* Which computer and folder the turn ran in: captured with `runsOn: "computer"` and updated if a
|
|
527
|
+
* queued turn moves to another folder before starting.
|
|
528
|
+
*/
|
|
529
|
+
readonly computer?: AgentThreadPlace
|
|
450
530
|
}
|
|
451
531
|
|
|
452
532
|
/** Immutable, serialisable child configuration captured before dispatch. */
|
|
@@ -633,6 +713,8 @@ export interface ListThreadSubagentsInput {
|
|
|
633
713
|
readonly threadId: string
|
|
634
714
|
readonly spawnKey?: string
|
|
635
715
|
readonly finishReason?: AgentRunFinishReason
|
|
716
|
+
/** Only children spawned by turns whose trigger message is still in the thread. */
|
|
717
|
+
readonly retainedTurnsOnly?: boolean
|
|
636
718
|
/** At most this many, 100 by default. */
|
|
637
719
|
readonly limit?: number
|
|
638
720
|
}
|
|
@@ -643,6 +725,11 @@ export interface ListAgentRunsResult {
|
|
|
643
725
|
readonly total: number
|
|
644
726
|
}
|
|
645
727
|
|
|
728
|
+
export interface ListLatestAgentRunsInput {
|
|
729
|
+
readonly projectId: string
|
|
730
|
+
readonly threadIds: readonly string[]
|
|
731
|
+
}
|
|
732
|
+
|
|
646
733
|
// ── agent_messages — one message (assistant messages inserted only once finalized) ─────────────
|
|
647
734
|
|
|
648
735
|
export type { AgentMessageRole }
|
|
@@ -683,6 +770,13 @@ export interface AppendAgentMessageInput extends AgentMessage {
|
|
|
683
770
|
readonly completedAt?: Date
|
|
684
771
|
}
|
|
685
772
|
|
|
773
|
+
export interface DeleteAgentMessagesFromSeqInput {
|
|
774
|
+
readonly projectId: string
|
|
775
|
+
readonly threadId: string
|
|
776
|
+
/** Delete every message whose per-thread sequence is greater than or equal to this boundary. */
|
|
777
|
+
readonly fromSeq: number
|
|
778
|
+
}
|
|
779
|
+
|
|
686
780
|
export interface DeleteAgentMessagesByRunInput {
|
|
687
781
|
readonly projectId: string
|
|
688
782
|
readonly threadId: string
|
|
@@ -791,8 +885,9 @@ export interface AgentThreadStore {
|
|
|
791
885
|
/** Whether the user took part until now. */
|
|
792
886
|
removeParticipant(input: RemoveAgentThreadParticipantInput): Promise<boolean>
|
|
793
887
|
/**
|
|
794
|
-
* Move a
|
|
795
|
-
* thread
|
|
888
|
+
* Move a conversation thread to a computer and folder, from the cloud or from another computer or
|
|
889
|
+
* folder, and return the thread after. Refused while a turn holds a cloud thread or runs on its
|
|
890
|
+
* computer.
|
|
796
891
|
*/
|
|
797
892
|
assignComputer(input: AssignAgentThreadComputerInput): Promise<AgentThreadRecord>
|
|
798
893
|
/**
|
|
@@ -852,18 +947,35 @@ export interface AgentRunStore {
|
|
|
852
947
|
* within a turn the latest admitted first. Read by key (one per turn) or by finish reason.
|
|
853
948
|
*/
|
|
854
949
|
listThreadSubagents(input: ListThreadSubagentsInput): Promise<readonly SubagentRunRecord[]>
|
|
950
|
+
/** The newest run of each thread, by creation and id; a thread without one is absent. */
|
|
951
|
+
latestByThread(input: ListLatestAgentRunsInput): Promise<readonly AgentRunRecord[]>
|
|
855
952
|
list(input: ListAgentRunsInput): Promise<ListAgentRunsResult>
|
|
856
953
|
}
|
|
857
954
|
|
|
858
955
|
export interface AgentMessageStore {
|
|
859
956
|
/** Insert a message (its `parts` are the canonical content) and bump thread stats. */
|
|
860
957
|
append(input: AppendAgentMessageInput): Promise<AgentMessageRecord>
|
|
861
|
-
/**
|
|
958
|
+
/**
|
|
959
|
+
* Delete every message produced by one run and repair the thread's message stats. A reader's
|
|
960
|
+
* place past the newest message left comes back to it: the next message reuses those numbers.
|
|
961
|
+
*/
|
|
862
962
|
deleteByRunId(input: DeleteAgentMessagesByRunInput): Promise<number>
|
|
963
|
+
/**
|
|
964
|
+
* Delete every message at or after `fromSeq` and repair the thread's message stats. A reader's
|
|
965
|
+
* place past the newest message left comes back to it: the edit that follows reuses the numbers.
|
|
966
|
+
*/
|
|
967
|
+
deleteFromSeq(input: DeleteAgentMessagesFromSeqInput): Promise<number>
|
|
863
968
|
getById(params: { projectId: string; id: string }): Promise<AgentMessageRecord | null>
|
|
864
969
|
list(input: ListAgentMessagesInput): Promise<ListAgentMessagesResult>
|
|
865
970
|
}
|
|
866
971
|
|
|
972
|
+
export interface DeleteAgentContextCheckpointsAfterSeqInput {
|
|
973
|
+
readonly projectId: string
|
|
974
|
+
readonly threadId: string
|
|
975
|
+
/** Delete checkpoints whose observed head exceeds this retained sequence boundary. */
|
|
976
|
+
readonly afterSeq: number
|
|
977
|
+
}
|
|
978
|
+
|
|
867
979
|
export interface AgentContextCheckpointStore {
|
|
868
980
|
/**
|
|
869
981
|
* Append one checkpoint after atomically validating run ownership and both transcript anchors.
|
|
@@ -880,6 +992,8 @@ export interface AgentContextCheckpointStore {
|
|
|
880
992
|
readonly projectId: string
|
|
881
993
|
readonly threadId: string
|
|
882
994
|
}): Promise<AgentContextCheckpointRecord | null>
|
|
995
|
+
/** Delete checkpoints that observed messages past `afterSeq`, newest first. */
|
|
996
|
+
deleteAfterSeq(input: DeleteAgentContextCheckpointsAfterSeqInput): Promise<number>
|
|
883
997
|
}
|
|
884
998
|
|
|
885
999
|
// ── agent_approvals — calls of the Agent that wait for whoever asked ───────────────────────────
|
|
@@ -1047,6 +1161,26 @@ export interface StopAgentApprovalsResult {
|
|
|
1047
1161
|
readonly stopped: number
|
|
1048
1162
|
}
|
|
1049
1163
|
|
|
1164
|
+
export interface RewindAgentApprovalsInput {
|
|
1165
|
+
readonly projectId: string
|
|
1166
|
+
readonly threadId: string
|
|
1167
|
+
/** Conversation runs removed from the thread: their approvals leave with them. */
|
|
1168
|
+
readonly runIds: readonly string[]
|
|
1169
|
+
/**
|
|
1170
|
+
* Message ids removed by the rewind: an earlier turn's approval reported in one becomes
|
|
1171
|
+
* unreported again so the replacement message carries its outcome.
|
|
1172
|
+
*/
|
|
1173
|
+
readonly clearedMessageIds?: readonly string[]
|
|
1174
|
+
readonly cancelledAt?: Date
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
export interface RewindAgentApprovalsResult {
|
|
1178
|
+
/** Pending approvals of the rewound runs, as `cancelled` records to announce. */
|
|
1179
|
+
readonly cancelled: readonly AgentApprovalRecord[]
|
|
1180
|
+
/** Total approvals deleted for the rewound runs. */
|
|
1181
|
+
readonly deleted: number
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1050
1184
|
/** Where a keyset listing resumes: after this approval, in the order approvals are listed. */
|
|
1051
1185
|
export interface AgentApprovalCursor {
|
|
1052
1186
|
readonly createdAt: Date
|
|
@@ -1113,6 +1247,11 @@ export interface AgentApprovalStore {
|
|
|
1113
1247
|
* stopped: their turn never resumes on them.
|
|
1114
1248
|
*/
|
|
1115
1249
|
stop(input: StopAgentApprovalsInput): Promise<StopAgentApprovalsResult>
|
|
1250
|
+
/**
|
|
1251
|
+
* Remove approvals belonging to rewound turns and unmark earlier turns' approvals whose
|
|
1252
|
+
* reporting message was removed.
|
|
1253
|
+
*/
|
|
1254
|
+
rewind(input: RewindAgentApprovalsInput): Promise<RewindAgentApprovalsResult>
|
|
1116
1255
|
/** Mark the ones no message reported yet, and return their ids. */
|
|
1117
1256
|
markReported(input: MarkAgentApprovalsReportedInput): Promise<readonly string[]>
|
|
1118
1257
|
/**
|
|
@@ -1362,8 +1501,180 @@ export interface AgentTokenRateStore {
|
|
|
1362
1501
|
}): Promise<readonly AgentTokenRateRecord[]>
|
|
1363
1502
|
}
|
|
1364
1503
|
|
|
1504
|
+
// -- agent_thread_inbox: mid-run steers and queued follow-up messages -------------------------
|
|
1505
|
+
|
|
1506
|
+
export const AGENT_INBOX_MODES = ["steer", "queue"] as const
|
|
1507
|
+
export type AgentInboxMode = (typeof AGENT_INBOX_MODES)[number]
|
|
1508
|
+
|
|
1509
|
+
/** Maximum pending items one conversation thread holds in its inbox at once. */
|
|
1510
|
+
export const AGENT_THREAD_INBOX_MAX_ITEMS = 50
|
|
1511
|
+
|
|
1512
|
+
/** Optional per-turn overrides carried by a queued or immediate inbox item. */
|
|
1513
|
+
export interface AgentInboxSpec {
|
|
1514
|
+
readonly model?: LanguageModelRef
|
|
1515
|
+
readonly reasoning?: AgentReasoning
|
|
1516
|
+
readonly approvalMode?: AgentApprovalMode
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
/** Claim recorded when a running conversation turn drains a `steer` item at a step boundary. */
|
|
1520
|
+
export interface AgentInboxClaim {
|
|
1521
|
+
readonly runId: string
|
|
1522
|
+
readonly executionToken: string
|
|
1523
|
+
readonly stepIndex: number
|
|
1524
|
+
readonly afterAnswer?: boolean
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
export interface AgentInboxItemRecord {
|
|
1528
|
+
readonly id: string
|
|
1529
|
+
readonly projectId: string
|
|
1530
|
+
readonly threadId: string
|
|
1531
|
+
/** Stable id reserved for `agent_messages` once this item is delivered. */
|
|
1532
|
+
readonly messageId: string
|
|
1533
|
+
readonly seq: number
|
|
1534
|
+
readonly authorPrincipal: Principal
|
|
1535
|
+
readonly mode: AgentInboxMode
|
|
1536
|
+
readonly parts: readonly AgentMessagePart[]
|
|
1537
|
+
readonly spec?: AgentInboxSpec
|
|
1538
|
+
readonly timeZone?: string
|
|
1539
|
+
readonly locale?: string
|
|
1540
|
+
/** Marked by Send now so `afterAgentRunFinished` dispatches it across a user cancel. */
|
|
1541
|
+
readonly immediate?: boolean
|
|
1542
|
+
/**
|
|
1543
|
+
* An edit waiting for the turn it stopped to end: the earlier message it replaces. When it
|
|
1544
|
+
* starts, the thread first rewinds to that message. Always sent now, as a queued message.
|
|
1545
|
+
*/
|
|
1546
|
+
readonly replacesMessageId?: string
|
|
1547
|
+
/**
|
|
1548
|
+
* The execution of the request that sent it. A turn that starts it without a request of its
|
|
1549
|
+
* sender's runs as a child of this one, with the sender's grants as they are then.
|
|
1550
|
+
*/
|
|
1551
|
+
readonly executionId?: string
|
|
1552
|
+
readonly claimedBy?: AgentInboxClaim
|
|
1553
|
+
readonly createdAt: Date
|
|
1554
|
+
readonly updatedAt: Date
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
export interface EnqueueAgentInboxItemInput {
|
|
1558
|
+
readonly id: string
|
|
1559
|
+
readonly projectId: string
|
|
1560
|
+
readonly threadId: string
|
|
1561
|
+
readonly messageId: string
|
|
1562
|
+
readonly authorPrincipal: Principal
|
|
1563
|
+
readonly mode: AgentInboxMode
|
|
1564
|
+
readonly parts: readonly AgentMessagePart[]
|
|
1565
|
+
readonly spec?: AgentInboxSpec
|
|
1566
|
+
readonly timeZone?: string
|
|
1567
|
+
readonly locale?: string
|
|
1568
|
+
readonly immediate?: boolean
|
|
1569
|
+
/**
|
|
1570
|
+
* An edit waiting for the turn it stopped to end: the earlier message it replaces. When it
|
|
1571
|
+
* starts, the thread first rewinds to that message. Always sent now, as a queued message.
|
|
1572
|
+
*/
|
|
1573
|
+
readonly replacesMessageId?: string
|
|
1574
|
+
readonly executionId?: string
|
|
1575
|
+
readonly createdAt?: Date
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
export interface EnqueueAgentInboxItemResult {
|
|
1579
|
+
readonly item: AgentInboxItemRecord
|
|
1580
|
+
readonly created: boolean
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
export interface ListAgentInboxItemsInput {
|
|
1584
|
+
readonly projectId: string
|
|
1585
|
+
readonly threadId: string
|
|
1586
|
+
/** Whether items already claimed by a running step are included; defaults to `true`. */
|
|
1587
|
+
readonly includeClaimed?: boolean
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
export interface UpdateAgentInboxItemInput {
|
|
1591
|
+
readonly projectId: string
|
|
1592
|
+
readonly threadId: string
|
|
1593
|
+
readonly id: string
|
|
1594
|
+
readonly mode?: AgentInboxMode
|
|
1595
|
+
readonly parts?: readonly AgentMessagePart[]
|
|
1596
|
+
readonly spec?: AgentInboxSpec | null
|
|
1597
|
+
readonly immediate?: boolean
|
|
1598
|
+
readonly updatedAt?: Date
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
export interface RemoveAgentInboxItemInput {
|
|
1602
|
+
readonly projectId: string
|
|
1603
|
+
readonly threadId: string
|
|
1604
|
+
readonly id: string
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
export interface TakeAgentInboxSteersInput {
|
|
1608
|
+
readonly projectId: string
|
|
1609
|
+
readonly threadId: string
|
|
1610
|
+
readonly runId: string
|
|
1611
|
+
readonly executionToken: string
|
|
1612
|
+
readonly stepIndex: number
|
|
1613
|
+
readonly afterAnswer?: boolean
|
|
1614
|
+
/**
|
|
1615
|
+
* The run's requester: a turn runs as them, so it reads only the steers they sent. Another
|
|
1616
|
+
* participant's steer waits for a turn of theirs.
|
|
1617
|
+
*/
|
|
1618
|
+
readonly authorPrincipal: Principal
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
export interface ConsumeClaimedAgentInboxInput {
|
|
1622
|
+
readonly projectId: string
|
|
1623
|
+
readonly threadId: string
|
|
1624
|
+
readonly runId: string
|
|
1625
|
+
readonly executionToken: string
|
|
1626
|
+
/** Message ids persisted into `agent_messages`; other claims of this run are released. */
|
|
1627
|
+
readonly messageIds: readonly string[]
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
export interface TakeNextQueuedAgentInboxInput {
|
|
1631
|
+
readonly projectId: string
|
|
1632
|
+
readonly threadId: string
|
|
1633
|
+
/** When `true`, only an item marked `immediate` is popped (used after a user cancel). */
|
|
1634
|
+
readonly onlyImmediate?: boolean
|
|
1635
|
+
/**
|
|
1636
|
+
* Only an item this person sent: a turn runs as its requester, so it starts the messages they
|
|
1637
|
+
* sent, and another participant's waits for a turn of theirs.
|
|
1638
|
+
*/
|
|
1639
|
+
readonly authorPrincipal?: Principal
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
export interface ListWaitingAgentInboxThreadsInput {
|
|
1643
|
+
readonly projectId: string
|
|
1644
|
+
/** Only threads holding an item created before this: newer ones a turn's end is still starting. */
|
|
1645
|
+
readonly createdBefore: Date
|
|
1646
|
+
/** Page after this thread id, in id order. */
|
|
1647
|
+
readonly afterThreadId?: string
|
|
1648
|
+
readonly limit: number
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
export interface AgentInboxStore {
|
|
1652
|
+
enqueue(input: EnqueueAgentInboxItemInput): Promise<EnqueueAgentInboxItemResult>
|
|
1653
|
+
getById(params: { projectId: string; id: string }): Promise<AgentInboxItemRecord | null>
|
|
1654
|
+
list(input: ListAgentInboxItemsInput): Promise<readonly AgentInboxItemRecord[]>
|
|
1655
|
+
/** Update an unclaimed inbox item; throws `invalid_state` when already claimed. */
|
|
1656
|
+
update(input: UpdateAgentInboxItemInput): Promise<AgentInboxItemRecord | null>
|
|
1657
|
+
/** Remove an unclaimed inbox item; throws `invalid_state` when already claimed. */
|
|
1658
|
+
remove(input: RemoveAgentInboxItemInput): Promise<AgentInboxItemRecord | null>
|
|
1659
|
+
/**
|
|
1660
|
+
* Fenced by `(runId, executionToken)`: claim the non-immediate steers `authorPrincipal` sent, in
|
|
1661
|
+
* FIFO order. The thread's running turn holds it, so a claim any other execution left behind (one
|
|
1662
|
+
* this run replaced, or a turn whose release failed) was never written, and is taken over.
|
|
1663
|
+
*/
|
|
1664
|
+
takeSteers(input: TakeAgentInboxSteersInput): Promise<readonly AgentInboxItemRecord[]>
|
|
1665
|
+
/** Consume persisted claims of `(runId, executionToken)` and release any unwritten ones. */
|
|
1666
|
+
consumeClaimed(input: ConsumeClaimedAgentInboxInput): Promise<readonly AgentInboxItemRecord[]>
|
|
1667
|
+
/** Release remaining claims held by `runId` after an interrupted, failed, or cancelled turn. */
|
|
1668
|
+
releaseClaimed(input: { projectId: string; runId: string }): Promise<number>
|
|
1669
|
+
/** Pop the next unclaimed item when `thread.activeRunId` is null; null when busy or empty. */
|
|
1670
|
+
takeNextQueued(input: TakeNextQueuedAgentInboxInput): Promise<AgentInboxItemRecord | null>
|
|
1671
|
+
/** Ids of threads no turn holds whose inbox still holds an item, for the repair pass. */
|
|
1672
|
+
listWaitingThreads(input: ListWaitingAgentInboxThreadsInput): Promise<readonly string[]>
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1365
1675
|
export interface AgentStorage {
|
|
1366
1676
|
readonly threads: AgentThreadStore
|
|
1677
|
+
readonly reads: AgentThreadReadStore
|
|
1367
1678
|
readonly runs: AgentRunStore
|
|
1368
1679
|
readonly messages: AgentMessageStore
|
|
1369
1680
|
readonly checkpoints: AgentContextCheckpointStore
|
|
@@ -1372,4 +1683,5 @@ export interface AgentStorage {
|
|
|
1372
1683
|
readonly approvalModes: AgentApprovalModeStore
|
|
1373
1684
|
readonly computers: AgentComputerSessionStore
|
|
1374
1685
|
readonly tokenRates: AgentTokenRateStore
|
|
1686
|
+
readonly inbox: AgentInboxStore
|
|
1375
1687
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { calendarPeriodStart, calendarPeriods, canonicalTimeZone } from "../../calendar"
|
|
1
2
|
import { MODEL_KINDS, type ModelKind } from "../../models/definitions"
|
|
3
|
+
import { DEFAULT_PROJECT_TIME_ZONE } from "../../runtime/locale"
|
|
2
4
|
import { type AiModelCallUsageRecord, normalizeAiModelCallUsage } from "../ai-usage"
|
|
3
5
|
import type {
|
|
4
6
|
AiAccountingAgentBreakdown,
|
|
@@ -26,7 +28,6 @@ import type {
|
|
|
26
28
|
|
|
27
29
|
const DEFAULT_MODEL_CALL_PAGE_SIZE = 50
|
|
28
30
|
const MAX_MODEL_CALL_PAGE_SIZE = 200
|
|
29
|
-
const MAX_CHART_BUCKETS = 10_000
|
|
30
31
|
|
|
31
32
|
/** One joined immutable model-call row used by in-memory analytics and bounded SQL pages. */
|
|
32
33
|
export interface AiAccountingRecordSetItem {
|
|
@@ -41,6 +42,8 @@ export interface NormalizedAiAccountingQuery extends AiAccountingFilters {
|
|
|
41
42
|
readonly projectId: string
|
|
42
43
|
readonly from: Date
|
|
43
44
|
readonly to: Date
|
|
45
|
+
/** The IANA zone whose calendar a series buckets by. */
|
|
46
|
+
readonly timeZone: string
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
export interface NormalizedAiModelCallAccountingQuery extends NormalizedAiAccountingQuery {
|
|
@@ -123,10 +126,21 @@ export function normalizeAiAccountingQuery(
|
|
|
123
126
|
assertNonBlank(input.source.workflowId, "accounting source workflowId")
|
|
124
127
|
}
|
|
125
128
|
if (input.modelKind !== undefined) aiAccountingModelKind(input.modelKind)
|
|
129
|
+
const requestedTimeZone = "timeZone" in input ? input.timeZone : undefined
|
|
130
|
+
const timeZone =
|
|
131
|
+
requestedTimeZone === undefined
|
|
132
|
+
? DEFAULT_PROJECT_TIME_ZONE
|
|
133
|
+
: canonicalTimeZone(requestedTimeZone)
|
|
134
|
+
if (timeZone === undefined) {
|
|
135
|
+
throw new TypeError(
|
|
136
|
+
`[Sixb] AI accounting timeZone must be an IANA time zone such as 'Europe/Paris'; received ${JSON.stringify(requestedTimeZone)}.`
|
|
137
|
+
)
|
|
138
|
+
}
|
|
126
139
|
return {
|
|
127
140
|
projectId: input.projectId,
|
|
128
141
|
from: new Date(input.from),
|
|
129
142
|
to: new Date(input.to),
|
|
143
|
+
timeZone,
|
|
130
144
|
...(input.providerId === undefined ? {} : { providerId: input.providerId }),
|
|
131
145
|
...(input.modelId === undefined ? {} : { modelId: input.modelId }),
|
|
132
146
|
...(input.requester === undefined ? {} : { requester: input.requester }),
|
|
@@ -210,7 +224,7 @@ export function buildAiAccountingOverview(
|
|
|
210
224
|
const query = normalizeAiAccountingQuery(input)
|
|
211
225
|
assertAiAccountingBucket(input.bucket)
|
|
212
226
|
const items = Array.from(source).filter((item) => aiAccountingItemMatchesQuery(item, query))
|
|
213
|
-
const periods =
|
|
227
|
+
const periods = calendarPeriods(query.from, query.to, input.bucket, query.timeZone)
|
|
214
228
|
const periodItems = new Map<number, AiAccountingRecordSetItem[]>(
|
|
215
229
|
periods.map((period) => [period.start.getTime(), []])
|
|
216
230
|
)
|
|
@@ -223,7 +237,11 @@ export function buildAiAccountingOverview(
|
|
|
223
237
|
const workflowItems = new Map<string, AiAccountingRecordSetItem[]>()
|
|
224
238
|
|
|
225
239
|
for (const item of items) {
|
|
226
|
-
const periodStart =
|
|
240
|
+
const periodStart = calendarPeriodStart(
|
|
241
|
+
item.usage.occurredAt,
|
|
242
|
+
input.bucket,
|
|
243
|
+
query.timeZone
|
|
244
|
+
).getTime()
|
|
227
245
|
periodItems.get(periodStart)?.push(item)
|
|
228
246
|
const modelKey = JSON.stringify([item.usage.providerId, item.usage.requestedModelId])
|
|
229
247
|
appendGrouped(modelItems, modelKey, item)
|
|
@@ -334,7 +352,7 @@ export function buildAiAccountingOverviewFromFragments(
|
|
|
334
352
|
fragments: Iterable<AiAccountingAggregateFragment>
|
|
335
353
|
): AiAccountingOverview {
|
|
336
354
|
const query = normalizeAiAccountingQuery(input)
|
|
337
|
-
const periods =
|
|
355
|
+
const periods = calendarPeriods(query.from, query.to, input.bucket, query.timeZone)
|
|
338
356
|
const totals = aggregateFragmentAccumulator()
|
|
339
357
|
const series = new Map<number, AggregateFragmentAccumulator>(
|
|
340
358
|
periods.map((period) => [period.start.getTime(), aggregateFragmentAccumulator()])
|
|
@@ -509,19 +527,6 @@ export function toAccountingItem(item: AiAccountingRecordSetItem): AiModelCallAc
|
|
|
509
527
|
}
|
|
510
528
|
}
|
|
511
529
|
|
|
512
|
-
export function aiAccountingBucketStart(at: Date, bucket: AiAccountingBucket): Date {
|
|
513
|
-
assertDate(at, "accounting bucket timestamp")
|
|
514
|
-
assertAiAccountingBucket(bucket)
|
|
515
|
-
const start = new Date(at)
|
|
516
|
-
start.setUTCMinutes(0, 0, 0)
|
|
517
|
-
if (bucket === "hour") return start
|
|
518
|
-
start.setUTCHours(0)
|
|
519
|
-
if (bucket === "day") return start
|
|
520
|
-
const mondayOffset = (start.getUTCDay() + 6) % 7
|
|
521
|
-
start.setUTCDate(start.getUTCDate() - mondayOffset)
|
|
522
|
-
return start
|
|
523
|
-
}
|
|
524
|
-
|
|
525
530
|
function aggregateAccountingItems(
|
|
526
531
|
items: readonly AiAccountingRecordSetItem[]
|
|
527
532
|
): AiAccountingAggregate {
|
|
@@ -751,32 +756,6 @@ function requiredFragmentDate(value: Date | undefined, field: string): Date {
|
|
|
751
756
|
return value
|
|
752
757
|
}
|
|
753
758
|
|
|
754
|
-
function accountingPeriods(
|
|
755
|
-
from: Date,
|
|
756
|
-
to: Date,
|
|
757
|
-
bucket: AiAccountingBucket
|
|
758
|
-
): Array<{ start: Date; end: Date }> {
|
|
759
|
-
const result: Array<{ start: Date; end: Date }> = []
|
|
760
|
-
let cursor = aiAccountingBucketStart(from, bucket)
|
|
761
|
-
while (cursor.getTime() < to.getTime()) {
|
|
762
|
-
if (result.length >= MAX_CHART_BUCKETS) {
|
|
763
|
-
throw new RangeError(`[Sixb] AI accounting query exceeds ${MAX_CHART_BUCKETS} chart buckets.`)
|
|
764
|
-
}
|
|
765
|
-
const next = nextBucket(cursor, bucket)
|
|
766
|
-
result.push({ start: new Date(cursor), end: next })
|
|
767
|
-
cursor = next
|
|
768
|
-
}
|
|
769
|
-
return result
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
function nextBucket(start: Date, bucket: AiAccountingBucket): Date {
|
|
773
|
-
const next = new Date(start)
|
|
774
|
-
if (bucket === "hour") next.setUTCHours(next.getUTCHours() + 1)
|
|
775
|
-
else if (bucket === "day") next.setUTCDate(next.getUTCDate() + 1)
|
|
776
|
-
else next.setUTCDate(next.getUTCDate() + 7)
|
|
777
|
-
return next
|
|
778
|
-
}
|
|
779
|
-
|
|
780
759
|
function appendGrouped<TKey extends string | number>(
|
|
781
760
|
groups: Map<TKey, AiAccountingRecordSetItem[]>,
|
|
782
761
|
key: TKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CalendarPeriod } from "../../calendar"
|
|
1
2
|
import type {
|
|
2
3
|
AiModelCallUsageInput,
|
|
3
4
|
AiModelCallUsageRecord,
|
|
@@ -127,7 +128,8 @@ export interface AiCostSummary {
|
|
|
127
128
|
readonly unvaluedCallCount: number
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
|
|
131
|
+
/** The width of a series period: the calendar period a chart is drawn in. */
|
|
132
|
+
export type AiAccountingBucket = CalendarPeriod
|
|
131
133
|
|
|
132
134
|
/** Inclusive start and exclusive end for project accounting reads. */
|
|
133
135
|
export interface AiAccountingRange {
|
|
@@ -165,6 +167,8 @@ export interface AiAccountingFilters {
|
|
|
165
167
|
export interface QueryAiAccountingOverviewInput extends AiAccountingRange, AiAccountingFilters {
|
|
166
168
|
readonly projectId: string
|
|
167
169
|
readonly bucket: AiAccountingBucket
|
|
170
|
+
/** The IANA zone whose calendar the buckets follow; UTC when absent. */
|
|
171
|
+
readonly timeZone?: string
|
|
168
172
|
}
|
|
169
173
|
|
|
170
174
|
export interface ListAiModelCallAccountingInput extends AiAccountingRange, AiAccountingFilters {
|
|
@@ -14,6 +14,8 @@ import type {
|
|
|
14
14
|
ArtifactCommentKey,
|
|
15
15
|
ArtifactCommentRecord,
|
|
16
16
|
ArtifactFrameGrantRecord,
|
|
17
|
+
ArtifactPdfKeyInput,
|
|
18
|
+
ArtifactPdfRecord,
|
|
17
19
|
ArtifactRecord,
|
|
18
20
|
ArtifactRestorePointReason,
|
|
19
21
|
ArtifactRestorePointRecord,
|
|
@@ -81,6 +83,7 @@ interface InMemoryArtifactSnapshot {
|
|
|
81
83
|
readonly frameGrants: ReadonlyMap<string, ArtifactFrameGrantRecord>
|
|
82
84
|
readonly state: ReadonlyMap<string, ReadonlyMap<string, ArtifactStateEntry>>
|
|
83
85
|
readonly boardPreviews: ReadonlyMap<string, ArtifactBoardPreviewRecord>
|
|
86
|
+
readonly pdfs: ReadonlyMap<string, ArtifactPdfRecord>
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
@@ -90,6 +93,8 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
90
93
|
private state = new Map<string, Map<string, ArtifactStateEntry>>()
|
|
91
94
|
/** By project, render key, mode, and size; no artifact owns one. */
|
|
92
95
|
private boardPreviews = new Map<string, ArtifactBoardPreviewRecord>()
|
|
96
|
+
/** By project and render key; no artifact owns one. */
|
|
97
|
+
private pdfs = new Map<string, ArtifactPdfRecord>()
|
|
93
98
|
|
|
94
99
|
async create(input: CreateArtifactInput): Promise<PublishedArtifactVersion> {
|
|
95
100
|
const key = artifactKey(input.projectId, input.id)
|
|
@@ -256,15 +261,25 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
256
261
|
}
|
|
257
262
|
|
|
258
263
|
async undoTurnWrites(input: UndoArtifactTurnInput): Promise<UndoneArtifactTurn> {
|
|
259
|
-
const { turnRunId } = input
|
|
264
|
+
const { turnRunId, laterTurnRunIds = [] } = input
|
|
260
265
|
const restored: PublishedArtifactVersion[] = []
|
|
261
266
|
const deleted: string[] = []
|
|
262
267
|
|
|
263
268
|
for (const [key, stored] of this.artifacts) {
|
|
264
269
|
if (stored.record.projectId !== input.projectId) continue
|
|
265
270
|
|
|
266
|
-
const
|
|
267
|
-
if (!
|
|
271
|
+
const own = stored.turnWrites.get(turnRunId)
|
|
272
|
+
if (!own) continue
|
|
273
|
+
|
|
274
|
+
// The later turns undone with this one wrote as this one did.
|
|
275
|
+
const later = laterTurnRunIds.filter((each) => stored.turnWrites.has(each))
|
|
276
|
+
const write = {
|
|
277
|
+
...own,
|
|
278
|
+
writes: later.reduce(
|
|
279
|
+
(sum, each) => sum + (stored.turnWrites.get(each)?.writes ?? 0),
|
|
280
|
+
own.writes
|
|
281
|
+
),
|
|
282
|
+
}
|
|
268
283
|
|
|
269
284
|
const revision = stored.record.revision
|
|
270
285
|
if (
|
|
@@ -291,8 +306,13 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
291
306
|
untouched && point ? undo(stored, point, input.documents?.[stored.record.id]) : null
|
|
292
307
|
|
|
293
308
|
// Undone, the turn's restore point is what the artifact holds again, and the threads it
|
|
294
|
-
// alone shared the artifact in no longer do. Kept, the artifact stays where it was made
|
|
295
|
-
|
|
309
|
+
// alone shared the artifact in no longer do. Kept, the artifact stays where it was made, and
|
|
310
|
+
// the later turns keep their records for their own undo.
|
|
311
|
+
let next = forgetTurn(undone ?? stored, turnRunId, { undone: undone !== null })
|
|
312
|
+
if (undone) {
|
|
313
|
+
for (const each of later) next = forgetTurn(next, each, { undone: true })
|
|
314
|
+
}
|
|
315
|
+
|
|
296
316
|
this.artifacts.set(key, next)
|
|
297
317
|
if (undone) restored.push(published(next))
|
|
298
318
|
}
|
|
@@ -478,6 +498,25 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
478
498
|
}
|
|
479
499
|
}
|
|
480
500
|
|
|
501
|
+
async getPdf(input: ArtifactPdfKeyInput): Promise<ArtifactPdfRecord | null> {
|
|
502
|
+
const kept = this.pdfs.get(`${input.projectId}\0${input.renderKey}`)
|
|
503
|
+
return kept ? structuredClone(kept) : null
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
async putPdf(input: ArtifactPdfRecord): Promise<void> {
|
|
507
|
+
const key = `${input.projectId}\0${input.renderKey}`
|
|
508
|
+
const kept = this.pdfs.get(key)
|
|
509
|
+
if (!kept || ("failure" in kept && !("failure" in input))) {
|
|
510
|
+
this.pdfs.set(key, structuredClone(input))
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
async clearPdfFailure(input: ArtifactPdfKeyInput): Promise<void> {
|
|
515
|
+
const key = `${input.projectId}\0${input.renderKey}`
|
|
516
|
+
const kept = this.pdfs.get(key)
|
|
517
|
+
if (kept && "failure" in kept) this.pdfs.delete(key)
|
|
518
|
+
}
|
|
519
|
+
|
|
481
520
|
async createComment(input: CreateArtifactCommentInput): Promise<ArtifactCommentRecord> {
|
|
482
521
|
const key = artifactKey(input.projectId, input.artifactId)
|
|
483
522
|
const stored = this.artifacts.get(key)
|
|
@@ -516,7 +555,12 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
516
555
|
body: input.body,
|
|
517
556
|
author:
|
|
518
557
|
input.author.type === "guest"
|
|
519
|
-
? {
|
|
558
|
+
? {
|
|
559
|
+
type: "guest",
|
|
560
|
+
id: input.author.id,
|
|
561
|
+
name: input.author.name,
|
|
562
|
+
grantId: input.author.grantId,
|
|
563
|
+
}
|
|
520
564
|
: { type: input.author.type, id: input.author.id },
|
|
521
565
|
...(input.origin
|
|
522
566
|
? { origin: { threadId: input.origin.threadId, runId: input.origin.runId } }
|
|
@@ -588,6 +632,7 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
588
632
|
frameGrants: this.frameGrants,
|
|
589
633
|
state: this.state,
|
|
590
634
|
boardPreviews: this.boardPreviews,
|
|
635
|
+
pdfs: this.pdfs,
|
|
591
636
|
})
|
|
592
637
|
}
|
|
593
638
|
|
|
@@ -597,6 +642,7 @@ export class InMemoryArtifactStorage implements ArtifactStorage {
|
|
|
597
642
|
this.frameGrants = new Map(restored.frameGrants)
|
|
598
643
|
this.state = new Map([...restored.state].map(([key, kept]) => [key, new Map(kept)]))
|
|
599
644
|
this.boardPreviews = new Map(restored.boardPreviews)
|
|
645
|
+
this.pdfs = new Map(restored.pdfs)
|
|
600
646
|
}
|
|
601
647
|
|
|
602
648
|
/**
|