@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
|
@@ -2,7 +2,7 @@ import type { BlobStorage } from "../blob-storage"
|
|
|
2
2
|
import type { Broker } from "../broker"
|
|
3
3
|
import { createSixbError } from "../errors/internal"
|
|
4
4
|
import type { DomainEventLog } from "../events/service"
|
|
5
|
-
import type { AuthorizationRef } from "../execution"
|
|
5
|
+
import type { AuthorizablePrincipal, AuthorizationRef } from "../execution"
|
|
6
6
|
import {
|
|
7
7
|
type AgentExecutionHost,
|
|
8
8
|
bindAgentModelExecution,
|
|
@@ -25,6 +25,7 @@ import type { Sixb } from "../runtime/sixb"
|
|
|
25
25
|
import type { SecurityDefinitionCatalog } from "../security"
|
|
26
26
|
import type { Storage } from "../storage"
|
|
27
27
|
import {
|
|
28
|
+
type AgentInboxItemRecord,
|
|
28
29
|
type AgentRunRecord,
|
|
29
30
|
type AgentStorage,
|
|
30
31
|
AgentStorageError,
|
|
@@ -88,6 +89,7 @@ import {
|
|
|
88
89
|
readAgentRunContext,
|
|
89
90
|
readAgentTurnHistory,
|
|
90
91
|
} from "./run-turn"
|
|
92
|
+
import type { AgentInboxReadMessage } from "./streams"
|
|
91
93
|
import { subscribeAgentRunCancel } from "./streams/protocol"
|
|
92
94
|
import { subagentSandboxFiles } from "./subagent-runs"
|
|
93
95
|
import { conversationThreadId } from "./thread-access"
|
|
@@ -127,6 +129,8 @@ export interface AgentRunSession<TRun extends AgentRunRecord = AgentRunRecord> {
|
|
|
127
129
|
readonly events: StreamSink
|
|
128
130
|
/** Approvals that hold the run: they are created by the API its commands call, never here. */
|
|
129
131
|
readonly heldCalls: AgentRunHeldCalls
|
|
132
|
+
/** Mid-run steers waiting in a conversation turn's inbox. */
|
|
133
|
+
readonly inbox: AgentRunInbox
|
|
130
134
|
/** A conversation turn's children: spawning them, and reading them and their threads. */
|
|
131
135
|
readonly children: AgentRunChildren
|
|
132
136
|
/**
|
|
@@ -259,6 +263,18 @@ export interface AgentRunHeldCalls {
|
|
|
259
263
|
pausesAfterStep(): Promise<boolean>
|
|
260
264
|
}
|
|
261
265
|
|
|
266
|
+
export interface AgentRunInbox {
|
|
267
|
+
/**
|
|
268
|
+
* Claim unclaimed non-immediate `steer` items of a conversation turn's thread at `stepIndex`:
|
|
269
|
+
* those its requester sent, since the turn runs as them. Answers `[]` on a sub-agent's session,
|
|
270
|
+
* whose parent steers it through `FamilyMailbox`.
|
|
271
|
+
*/
|
|
272
|
+
takeSteers(input: {
|
|
273
|
+
readonly stepIndex: number
|
|
274
|
+
readonly afterAnswer?: boolean
|
|
275
|
+
}): Promise<readonly AgentInboxItemRecord[]>
|
|
276
|
+
}
|
|
277
|
+
|
|
262
278
|
/** How a run ended; the session supplies which run, and its token. */
|
|
263
279
|
export type AgentRunOutcome = FinishAgentRunInput extends infer Finish
|
|
264
280
|
? Finish extends FinishAgentRunInput
|
|
@@ -363,6 +379,27 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
|
|
|
363
379
|
return bound
|
|
364
380
|
}
|
|
365
381
|
const runSdk = async () => (await bind()).sixb
|
|
382
|
+
|
|
383
|
+
// Who the turn runs as, read once from its execution, which never changes.
|
|
384
|
+
let requestedBy: Promise<AuthorizablePrincipal | undefined> | undefined
|
|
385
|
+
const requester = () => {
|
|
386
|
+
requestedBy ??= host.storage.executions
|
|
387
|
+
.getById({ projectId: host.projectId, id: run.executionId })
|
|
388
|
+
.then((execution) => {
|
|
389
|
+
if (!execution) {
|
|
390
|
+
throw new Error(
|
|
391
|
+
`[Sixb] Agent run '${run.id}' references missing execution '${run.executionId}'.`
|
|
392
|
+
)
|
|
393
|
+
}
|
|
394
|
+
return execution.requestedBy
|
|
395
|
+
})
|
|
396
|
+
.catch((error: unknown) => {
|
|
397
|
+
requestedBy = undefined
|
|
398
|
+
throw error
|
|
399
|
+
})
|
|
400
|
+
return requestedBy
|
|
401
|
+
}
|
|
402
|
+
|
|
366
403
|
const cancel = await watchAgentRunCancel(host, [run.id, ...cancelWith])
|
|
367
404
|
// A cancel recorded on the run reaches a runner the broker's cancel did not: at the claim, and at
|
|
368
405
|
// each renewal of its lease.
|
|
@@ -458,6 +495,35 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
|
|
|
458
495
|
host.storage.agents.approvals.holdsRun({ projectId: host.projectId, runId: run.id }),
|
|
459
496
|
pausesAfterStep: () => turnPausesOnHeldCalls(host.storage.agents, run),
|
|
460
497
|
},
|
|
498
|
+
inbox: {
|
|
499
|
+
async takeSteers({ stepIndex, afterAnswer }) {
|
|
500
|
+
if (run.kind !== "conversation") return []
|
|
501
|
+
|
|
502
|
+
// The turn runs as its requester, so it reads only what they sent: another participant's
|
|
503
|
+
// steer waits for a turn of theirs. A turn nobody requested has no one to steer it.
|
|
504
|
+
const authorPrincipal = await requester()
|
|
505
|
+
if (!authorPrincipal) return []
|
|
506
|
+
|
|
507
|
+
const items = await fenced(run.id, () =>
|
|
508
|
+
agents.inbox.takeSteers({
|
|
509
|
+
projectId: host.projectId,
|
|
510
|
+
threadId: run.threadId,
|
|
511
|
+
runId: run.id,
|
|
512
|
+
executionToken,
|
|
513
|
+
stepIndex,
|
|
514
|
+
...(afterAnswer ? { afterAnswer: true } : {}),
|
|
515
|
+
authorPrincipal,
|
|
516
|
+
})
|
|
517
|
+
)
|
|
518
|
+
|
|
519
|
+
// Whoever watches sees each message where the turn read it, before the step it answers
|
|
520
|
+
// streams, from what was stored: a runner never says what was sent, or by whom.
|
|
521
|
+
if (items.length > 0) {
|
|
522
|
+
await host.events.publishInboxRead({ run, messages: items.map(inboxReadMessage) })
|
|
523
|
+
}
|
|
524
|
+
return items
|
|
525
|
+
},
|
|
526
|
+
},
|
|
461
527
|
models: {
|
|
462
528
|
async language(ref, options) {
|
|
463
529
|
const key = `${ref.provider}/${ref.modelId}`
|
|
@@ -514,6 +580,7 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
|
|
|
514
580
|
async finish(outcome, messages) {
|
|
515
581
|
const finished = await finishWithRetries(
|
|
516
582
|
host.storage,
|
|
583
|
+
run,
|
|
517
584
|
{ ...outcome, ...fence },
|
|
518
585
|
messages ?? []
|
|
519
586
|
)
|
|
@@ -625,6 +692,13 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
|
|
|
625
692
|
`[Sixb] Agent run '${run.id}' moves only its own thread's workspace, not '${input.id}'.`
|
|
626
693
|
)
|
|
627
694
|
}
|
|
695
|
+
// Recreating or restoring is its owner's choice, never a run's.
|
|
696
|
+
const { action } = input as { readonly action: string }
|
|
697
|
+
if (action !== "acquire" && action !== "replace" && action !== "settle") {
|
|
698
|
+
throw new AgentRunRefusedError(
|
|
699
|
+
`[Sixb] Agent run '${run.id}' cannot ${action} its thread's workspace: only its owner recovers it.`
|
|
700
|
+
)
|
|
701
|
+
}
|
|
628
702
|
return fenced(run.id, () =>
|
|
629
703
|
host.storage.agents.threads.transitionSandbox({
|
|
630
704
|
...input,
|
|
@@ -833,19 +907,27 @@ const FINISH_BACKOFF_MS = [50, 200, 600] as const
|
|
|
833
907
|
|
|
834
908
|
async function finishWithRetries(
|
|
835
909
|
storage: AgentRunSessionHost["storage"],
|
|
910
|
+
run: AgentRunRecord,
|
|
836
911
|
finish: FinishAgentRunInput,
|
|
837
912
|
messages: readonly AppendAgentMessageInput[]
|
|
838
913
|
): Promise<AgentRunRecord> {
|
|
839
914
|
for (let attempt = 0; ; attempt += 1) {
|
|
840
915
|
try {
|
|
841
|
-
if (messages.length === 0)
|
|
916
|
+
if (run.kind !== "conversation" && messages.length === 0) {
|
|
917
|
+
return await storage.agents.runs.finish(finish)
|
|
918
|
+
}
|
|
842
919
|
return await storage.transaction(async (tx) => {
|
|
843
920
|
const agents = tx.agents
|
|
844
921
|
if (!agents) throw new Error("[Sixb] Agent storage is not configured.")
|
|
845
|
-
|
|
922
|
+
const resolved =
|
|
923
|
+
run.kind === "conversation"
|
|
924
|
+
? await reconcileClaimedSteers(agents, run, finish.executionToken, messages)
|
|
925
|
+
: messages
|
|
926
|
+
for (const message of resolved) await agents.messages.append(message)
|
|
846
927
|
return agents.runs.finish(finish)
|
|
847
928
|
})
|
|
848
929
|
} catch (error) {
|
|
930
|
+
if (error instanceof AgentRunRefusedError) throw error
|
|
849
931
|
if (isTerminalOrExecutionGone(error)) throw new AgentExecutionLostError(finish.id)
|
|
850
932
|
const delay = FINISH_BACKOFF_MS[attempt]
|
|
851
933
|
if (delay === undefined) throw new AgentFinalizationError(finish.id, { cause: error })
|
|
@@ -853,3 +935,60 @@ async function finishWithRetries(
|
|
|
853
935
|
}
|
|
854
936
|
}
|
|
855
937
|
}
|
|
938
|
+
|
|
939
|
+
async function reconcileClaimedSteers(
|
|
940
|
+
agents: AgentStorage,
|
|
941
|
+
run: ConversationAgentRunRecord,
|
|
942
|
+
executionToken: string,
|
|
943
|
+
messages: readonly AppendAgentMessageInput[]
|
|
944
|
+
): Promise<readonly AppendAgentMessageInput[]> {
|
|
945
|
+
// A storage without an inbox claims nothing, so every message is the turn's own.
|
|
946
|
+
if (typeof agents.inbox?.consumeClaimed !== "function") return messages
|
|
947
|
+
const userIds = messages.filter((message) => message.role === "user").map((message) => message.id)
|
|
948
|
+
const consumed = await agents.inbox.consumeClaimed({
|
|
949
|
+
projectId: run.projectId,
|
|
950
|
+
threadId: run.threadId,
|
|
951
|
+
runId: run.id,
|
|
952
|
+
executionToken,
|
|
953
|
+
messageIds: userIds,
|
|
954
|
+
})
|
|
955
|
+
const byMessageId = new Map(consumed.map((item) => [item.messageId, item]))
|
|
956
|
+
|
|
957
|
+
return messages.map((message): AppendAgentMessageInput => {
|
|
958
|
+
if (message.role !== "user") return message
|
|
959
|
+
const claimed = byMessageId.get(message.id)
|
|
960
|
+
if (!claimed) {
|
|
961
|
+
throw new AgentRunRefusedError(
|
|
962
|
+
`[Sixb] Agent run '${run.id}' finishes only with user messages from its thread's inbox.`
|
|
963
|
+
)
|
|
964
|
+
}
|
|
965
|
+
const metadata =
|
|
966
|
+
claimed.timeZone || claimed.locale
|
|
967
|
+
? {
|
|
968
|
+
...(claimed.timeZone ? { timeZone: claimed.timeZone } : {}),
|
|
969
|
+
...(claimed.locale ? { locale: claimed.locale } : {}),
|
|
970
|
+
}
|
|
971
|
+
: undefined
|
|
972
|
+
return {
|
|
973
|
+
id: claimed.messageId,
|
|
974
|
+
projectId: claimed.projectId,
|
|
975
|
+
threadId: claimed.threadId,
|
|
976
|
+
runId: null,
|
|
977
|
+
role: "user",
|
|
978
|
+
parts: claimed.parts,
|
|
979
|
+
authorPrincipal: claimed.authorPrincipal,
|
|
980
|
+
createdAt: claimed.createdAt,
|
|
981
|
+
...(metadata ? { metadata } : {}),
|
|
982
|
+
}
|
|
983
|
+
})
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/** A message a turn read, as its stream tells whoever watches: the stored item, not the runner. */
|
|
987
|
+
function inboxReadMessage(item: AgentInboxItemRecord): AgentInboxReadMessage {
|
|
988
|
+
return {
|
|
989
|
+
id: item.messageId,
|
|
990
|
+
authorPrincipal: item.authorPrincipal,
|
|
991
|
+
parts: item.parts,
|
|
992
|
+
createdAt: item.createdAt.toISOString(),
|
|
993
|
+
}
|
|
994
|
+
}
|
package/src/agents/run-turn.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { Principal, UserPrincipal } from "../auth/types"
|
|
2
|
+
import { isPlainRecord } from "../json"
|
|
2
3
|
import type {
|
|
3
4
|
AgentContextCheckpointRecord,
|
|
4
5
|
AgentMessageRecord,
|
|
5
6
|
AgentRunRecord,
|
|
6
7
|
AgentThreadParticipantRecord,
|
|
7
8
|
AgentThreadRecord,
|
|
9
|
+
ConversationAgentRunRecord,
|
|
8
10
|
SubagentRunRecord,
|
|
9
11
|
} from "../storage/agents"
|
|
12
|
+
import { runPlaceKey } from "../storage/agents/provider"
|
|
10
13
|
import type { AiModelCallUsageRecord } from "../storage/ai-usage"
|
|
11
14
|
import type { ExecutionRecord } from "../storage/executions/types"
|
|
12
15
|
import { isPausedSubagentRun } from "./approvals"
|
|
@@ -49,6 +52,12 @@ export interface AgentTurnHistory {
|
|
|
49
52
|
* project that predates it.
|
|
50
53
|
*/
|
|
51
54
|
readonly sentLocales?: Readonly<Record<string, string>>
|
|
55
|
+
/**
|
|
56
|
+
* Retained user messages where the conversation changed workspace (between the cloud, computers
|
|
57
|
+
* or folders) since the message before. Stored run history decides it, so the system prompt
|
|
58
|
+
* carries no move timestamp and cached prefixes hold across round-trip moves.
|
|
59
|
+
*/
|
|
60
|
+
readonly movedMessageIds?: readonly string[]
|
|
52
61
|
/**
|
|
53
62
|
* The model call that ended the latest assistant message after the checkpoint: what a token
|
|
54
63
|
* estimate anchors on, as the provider counted it. None when that message's run compacted the
|
|
@@ -105,11 +114,17 @@ export interface AgentTurnHistoryHost {
|
|
|
105
114
|
/** A conversation's history: its latest checkpoint and the messages after it. */
|
|
106
115
|
export async function readAgentTurnHistory(
|
|
107
116
|
host: AgentTurnHistoryHost,
|
|
108
|
-
threadId: string
|
|
117
|
+
threadId: string,
|
|
118
|
+
options?: { readonly thread?: AgentThreadRecord | null }
|
|
109
119
|
): Promise<AgentTurnHistory> {
|
|
110
|
-
const { checkpoint, messages } = await
|
|
120
|
+
const [{ checkpoint, messages }, thread] = await Promise.all([
|
|
121
|
+
readRetainedHistory(host, threadId),
|
|
122
|
+
options && "thread" in options
|
|
123
|
+
? Promise.resolve(options.thread ?? null)
|
|
124
|
+
: host.storage.agents.threads.getById({ projectId: host.projectId, id: threadId }),
|
|
125
|
+
])
|
|
111
126
|
const [sent, usageAnchor] = await Promise.all([
|
|
112
|
-
readSentSettings(host, threadId, messages),
|
|
127
|
+
readSentSettings(host, threadId, messages, checkpoint, thread),
|
|
113
128
|
readUsageAnchor(host, messages, checkpoint),
|
|
114
129
|
])
|
|
115
130
|
return { checkpoint, messages, ...sent, ...(usageAnchor ? { usageAnchor } : {}) }
|
|
@@ -147,10 +162,10 @@ async function readTurnContext(
|
|
|
147
162
|
execution: ExecutionRecord | null
|
|
148
163
|
): Promise<AgentTurnContext> {
|
|
149
164
|
const { projectId } = host
|
|
150
|
-
const
|
|
151
|
-
|
|
165
|
+
const thread = await host.storage.agents.threads.getById({ projectId, id: run.threadId })
|
|
166
|
+
const [participants, history] = await Promise.all([
|
|
152
167
|
host.storage.agents.threads.listParticipants({ projectId, threadIds: [run.threadId] }),
|
|
153
|
-
readAgentTurnHistory(host, run.threadId),
|
|
168
|
+
readAgentTurnHistory(host, run.threadId, { thread }),
|
|
154
169
|
])
|
|
155
170
|
const readers = await readReaders(host, participants)
|
|
156
171
|
const named: Principal[] = [
|
|
@@ -179,10 +194,10 @@ async function readChildContext(
|
|
|
179
194
|
): Promise<AgentChildContext> {
|
|
180
195
|
const { projectId } = host
|
|
181
196
|
const agents = host.storage.agents
|
|
182
|
-
const
|
|
197
|
+
const thread = await agents.threads.getById({ projectId, id: run.threadId })
|
|
198
|
+
const [parent, history, runs] = await Promise.all([
|
|
183
199
|
agents.runs.getById({ projectId, id: run.parentRunId }),
|
|
184
|
-
|
|
185
|
-
readAgentTurnHistory(host, run.threadId),
|
|
200
|
+
readAgentTurnHistory(host, run.threadId, { thread }),
|
|
186
201
|
listSubagentThreadRuns(agents, { projectId, threadId: run.threadId }),
|
|
187
202
|
])
|
|
188
203
|
const [conversation, task] = await Promise.all([
|
|
@@ -258,35 +273,145 @@ function readUser(host: AgentRunSessionHost, id: string) {
|
|
|
258
273
|
}
|
|
259
274
|
|
|
260
275
|
/**
|
|
261
|
-
* The time zone and
|
|
262
|
-
*
|
|
276
|
+
* The time zone, locale and workspace transitions of each retained user message: read from the
|
|
277
|
+
* runs that answered them, so every later turn replays the exact same bytes.
|
|
263
278
|
*/
|
|
264
279
|
async function readSentSettings(
|
|
265
280
|
host: AgentTurnHistoryHost,
|
|
266
281
|
threadId: string,
|
|
267
|
-
messages: readonly AgentMessageRecord[]
|
|
268
|
-
|
|
282
|
+
messages: readonly AgentMessageRecord[],
|
|
283
|
+
checkpoint: AgentContextCheckpointRecord | null,
|
|
284
|
+
thread: AgentThreadRecord | null
|
|
285
|
+
): Promise<Pick<AgentTurnHistory, "sentTimeZones" | "sentLocales" | "movedMessageIds">> {
|
|
269
286
|
const userMessages = messages.filter((message) => message.role === "user")
|
|
270
287
|
const oldest = userMessages[0]
|
|
271
|
-
if (!oldest) return { sentTimeZones: {}, sentLocales: {} }
|
|
288
|
+
if (!oldest || thread?.kind === "subagent") return { sentTimeZones: {}, sentLocales: {} }
|
|
272
289
|
|
|
273
|
-
// A run starts after its trigger message, so this window holds every run that answered one
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
290
|
+
// A run starts after its trigger message, so this window holds every run that answered one;
|
|
291
|
+
// after a compaction, also check the latest summarized turn to catch a move right across it.
|
|
292
|
+
const [{ runs }, earlier] = await Promise.all([
|
|
293
|
+
host.storage.agents.runs.list({
|
|
294
|
+
projectId: host.projectId,
|
|
295
|
+
threadId,
|
|
296
|
+
kinds: ["conversation"],
|
|
297
|
+
startedAfter: new Date(oldest.createdAt.getTime() - 1),
|
|
298
|
+
}),
|
|
299
|
+
checkpoint
|
|
300
|
+
? host.storage.agents.runs.list({
|
|
301
|
+
projectId: host.projectId,
|
|
302
|
+
threadId,
|
|
303
|
+
kinds: ["conversation"],
|
|
304
|
+
startedBefore: new Date(oldest.createdAt.getTime()),
|
|
305
|
+
order: "desc",
|
|
306
|
+
limit: 5,
|
|
307
|
+
})
|
|
308
|
+
: Promise.resolve({ runs: [] }),
|
|
309
|
+
])
|
|
280
310
|
const retained = new Set(userMessages.map((message) => message.id))
|
|
281
311
|
const zones: Record<string, string> = {}
|
|
282
312
|
const locales: Record<string, string> = {}
|
|
283
|
-
|
|
313
|
+
const places: Record<string, string> = {}
|
|
314
|
+
for (const message of userMessages) {
|
|
315
|
+
// A message a turn read mid-run keeps the settings it was rendered with, so a later turn closes
|
|
316
|
+
// it with the same `<sixb_current_time>`.
|
|
317
|
+
const metadata = isPlainRecord(message.metadata) ? message.metadata : undefined
|
|
318
|
+
if (typeof metadata?.timeZone === "string") zones[message.id] = metadata.timeZone
|
|
319
|
+
if (typeof metadata?.locale === "string") locales[message.id] = metadata.locale
|
|
320
|
+
}
|
|
321
|
+
// Oldest first so a retried turn's latest run records where the message ultimately ran.
|
|
322
|
+
for (const run of [...runs].reverse()) {
|
|
284
323
|
if (run.kind !== "conversation" || !retained.has(run.triggerMessageId)) continue
|
|
285
324
|
|
|
286
325
|
if (run.spec?.timeZone) zones[run.triggerMessageId] = run.spec.timeZone
|
|
287
326
|
if (run.spec?.locale) locales[run.triggerMessageId] = run.spec.locale
|
|
327
|
+
places[run.triggerMessageId] = runPlaceKey(run.spec)
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// The latest turn the summary holds. It may have started after the oldest message kept, one sent
|
|
331
|
+
// while it waited: look for it in both lists.
|
|
332
|
+
const priorRun = await latestSummarizedRun(host, [...runs, ...earlier.runs], retained)
|
|
333
|
+
const movedMessageIds = detectMovedMessages({
|
|
334
|
+
userMessages,
|
|
335
|
+
checkpoint,
|
|
336
|
+
places,
|
|
337
|
+
priorPlace: priorRun ? runPlaceKey(priorRun.spec) : undefined,
|
|
338
|
+
})
|
|
339
|
+
return {
|
|
340
|
+
sentTimeZones: zones,
|
|
341
|
+
sentLocales: locales,
|
|
342
|
+
...(movedMessageIds.length > 0 ? { movedMessageIds } : {}),
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* The newest turn whose trigger message the summary holds. A turn whose message isn't kept is
|
|
348
|
+
* either summarized, its message still stored, or rewound by an edit, its message deleted: only the
|
|
349
|
+
* first tells where the conversation ran before its oldest kept message.
|
|
350
|
+
*/
|
|
351
|
+
async function latestSummarizedRun(
|
|
352
|
+
host: AgentTurnHistoryHost,
|
|
353
|
+
runs: readonly AgentRunRecord[],
|
|
354
|
+
retained: ReadonlySet<string>
|
|
355
|
+
): Promise<ConversationAgentRunRecord | undefined> {
|
|
356
|
+
const candidates = runs
|
|
357
|
+
.filter(
|
|
358
|
+
(run): run is ConversationAgentRunRecord =>
|
|
359
|
+
run.kind === "conversation" && !retained.has(run.triggerMessageId)
|
|
360
|
+
)
|
|
361
|
+
.sort((left, right) => startOf(right) - startOf(left))
|
|
362
|
+
|
|
363
|
+
const rewound = new Set<string>()
|
|
364
|
+
for (const run of candidates) {
|
|
365
|
+
if (rewound.has(run.triggerMessageId)) continue
|
|
366
|
+
|
|
367
|
+
const trigger = await host.storage.agents.messages.getById({
|
|
368
|
+
projectId: host.projectId,
|
|
369
|
+
id: run.triggerMessageId,
|
|
370
|
+
})
|
|
371
|
+
if (trigger) return run
|
|
372
|
+
rewound.add(run.triggerMessageId)
|
|
373
|
+
}
|
|
374
|
+
return undefined
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** When a run started, or was admitted when it never did: the order the run lists sort by. */
|
|
378
|
+
function startOf(run: AgentRunRecord): number {
|
|
379
|
+
return (run.startedAt ?? run.createdAt).getTime()
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* The user messages that ran in another workspace than the one before them. Only runs decide it,
|
|
384
|
+
* never the thread's latest move, so a message keeps its note, or its lack of one, at every later
|
|
385
|
+
* turn: a round trip with no turn in between changes nothing, and the workspace it comes back to
|
|
386
|
+
* reads its cached prefix again.
|
|
387
|
+
*/
|
|
388
|
+
function detectMovedMessages(input: {
|
|
389
|
+
readonly userMessages: readonly AgentMessageRecord[]
|
|
390
|
+
readonly checkpoint: AgentContextCheckpointRecord | null
|
|
391
|
+
readonly places: Readonly<Record<string, string>>
|
|
392
|
+
readonly priorPlace: string | undefined
|
|
393
|
+
}): readonly string[] {
|
|
394
|
+
const moved: string[] = []
|
|
395
|
+
let previous = input.priorPlace
|
|
396
|
+
|
|
397
|
+
// A message with no run of its own, such as one sent into a turn that runs, decides nothing.
|
|
398
|
+
// Before any run of the thread, though, such messages are a fork's copies, answered in its
|
|
399
|
+
// source's workspace, as is a summary with no run before it: the fork's first turn starts
|
|
400
|
+
// elsewhere.
|
|
401
|
+
let inherited = previous === undefined && input.checkpoint !== null
|
|
402
|
+
|
|
403
|
+
for (const message of input.userMessages) {
|
|
404
|
+
const place = input.places[message.id]
|
|
405
|
+
if (place === undefined) {
|
|
406
|
+
inherited = true
|
|
407
|
+
continue
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const crossed = previous === undefined ? inherited : previous !== place
|
|
411
|
+
if (crossed) moved.push(message.id)
|
|
412
|
+
previous = place
|
|
288
413
|
}
|
|
289
|
-
return
|
|
414
|
+
return moved
|
|
290
415
|
}
|
|
291
416
|
|
|
292
417
|
/**
|
|
@@ -5,10 +5,13 @@ export type {
|
|
|
5
5
|
AgentApprovalActivityEvent,
|
|
6
6
|
AgentCompactionFailureCode,
|
|
7
7
|
AgentComputerActivityEvent,
|
|
8
|
+
AgentInboxReadMessage,
|
|
8
9
|
AgentRunActivityEvent,
|
|
9
10
|
AgentRunControlStreamId,
|
|
10
11
|
AgentRunFailure,
|
|
11
12
|
AgentRunFinishedEvent,
|
|
13
|
+
AgentRunStepsEvent,
|
|
14
|
+
AgentRunStepsRead,
|
|
12
15
|
AgentRunStreamEvent,
|
|
13
16
|
AgentRunStreamId,
|
|
14
17
|
AgentThreadMovedEvent,
|
|
@@ -6,11 +6,14 @@ export {
|
|
|
6
6
|
agentRunControlStreamDefinition,
|
|
7
7
|
agentRunControlStreamId,
|
|
8
8
|
agentRunFinishedEvent,
|
|
9
|
+
agentRunStepsStreamDefinition,
|
|
10
|
+
agentRunStepsStreamId,
|
|
9
11
|
agentRunStreamDefinition,
|
|
10
12
|
agentRunStreamEventBase,
|
|
11
13
|
agentRunStreamId,
|
|
12
14
|
agentRunStreamIdempotencyKey,
|
|
13
15
|
DEFAULT_AGENT_ACTIVITY_STREAM_RETENTION,
|
|
16
|
+
DEFAULT_AGENT_RUN_STEPS_RETENTION,
|
|
14
17
|
DEFAULT_AGENT_RUN_STREAM_RETENTION,
|
|
15
18
|
publishAgentComputerActivity,
|
|
16
19
|
publishAgentRunActivity,
|
|
@@ -19,3 +22,12 @@ export {
|
|
|
19
22
|
publishAgentThreadMoved,
|
|
20
23
|
subscribeAgentRunCancel,
|
|
21
24
|
} from "./protocol"
|
|
25
|
+
export {
|
|
26
|
+
appendCompacted,
|
|
27
|
+
continuesDelta,
|
|
28
|
+
coveredBySteps,
|
|
29
|
+
type DeltaChunk,
|
|
30
|
+
isDeltaChunk,
|
|
31
|
+
mergeDeltas,
|
|
32
|
+
readAgentRunSteps,
|
|
33
|
+
} from "./steps"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { Principal } from "../../auth"
|
|
1
2
|
import type { Broker, BrokerStreamDefinition } from "../../broker"
|
|
2
3
|
import { parseSixbFailure } from "../../errors/internal"
|
|
3
4
|
import type { SixbFailure } from "../../errors/types"
|
|
4
|
-
import { isPlainRecord, type JsonValue } from "../../json"
|
|
5
|
+
import { isJsonValue, isPlainRecord, type JsonValue } from "../../json"
|
|
5
6
|
import { isModelUiChunk, type ModelUiChunk } from "../../models/events"
|
|
6
7
|
import {
|
|
7
8
|
AGENT_APPROVAL_STATUSES,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
type AgentRunRecord,
|
|
14
15
|
type ConversationAgentRunRecord,
|
|
15
16
|
} from "../../storage/agents/types"
|
|
17
|
+
import type { AgentMessagePart } from "../message"
|
|
16
18
|
|
|
17
19
|
export const AGENT_RUN_STREAM_SCHEMA_VERSION = 1 as const
|
|
18
20
|
export const DEFAULT_AGENT_RUN_STREAM_RETENTION = {
|
|
@@ -20,6 +22,16 @@ export const DEFAULT_AGENT_RUN_STREAM_RETENTION = {
|
|
|
20
22
|
maxRecords: 5_000,
|
|
21
23
|
} as const
|
|
22
24
|
|
|
25
|
+
/**
|
|
26
|
+
* A run's finished steps, kept apart from its live stream: the live stream drops its oldest records,
|
|
27
|
+
* and a long turn outgrows it, so whoever opens a turn late reads what it did here. Records last as
|
|
28
|
+
* long as the longest turn, and the run's whole answer fits well within the byte limit.
|
|
29
|
+
*/
|
|
30
|
+
export const DEFAULT_AGENT_RUN_STEPS_RETENTION = {
|
|
31
|
+
maxAgeMs: 24 * 60 * 60 * 1000, // 24 hours
|
|
32
|
+
maxBytes: 64 * 1024 * 1024,
|
|
33
|
+
} as const
|
|
34
|
+
|
|
23
35
|
export const AGENT_ACTIVITY_STREAM_SCHEMA_VERSION = 1 as const
|
|
24
36
|
export const AGENT_ACTIVITY_STREAM_ID = "agents.activity" as const
|
|
25
37
|
export const DEFAULT_AGENT_ACTIVITY_STREAM_RETENTION = {
|
|
@@ -321,6 +333,16 @@ export function agentRunStreamDefinition(runId: string): BrokerStreamDefinition
|
|
|
321
333
|
}
|
|
322
334
|
}
|
|
323
335
|
|
|
336
|
+
export type AgentRunStepsStreamId = `agents.runs.${string}.steps`
|
|
337
|
+
|
|
338
|
+
export function agentRunStepsStreamId(runId: string): AgentRunStepsStreamId {
|
|
339
|
+
return `agents.runs.${runId}.steps`
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export function agentRunStepsStreamDefinition(runId: string): BrokerStreamDefinition {
|
|
343
|
+
return { id: agentRunStepsStreamId(runId), retention: DEFAULT_AGENT_RUN_STEPS_RETENTION }
|
|
344
|
+
}
|
|
345
|
+
|
|
324
346
|
type AgentRunStreamEventBase = {
|
|
325
347
|
readonly schemaVersion: typeof AGENT_RUN_STREAM_SCHEMA_VERSION
|
|
326
348
|
readonly projectId: string
|
|
@@ -422,6 +444,24 @@ export const AGENT_COMPACTION_FAILURE_CODES = [
|
|
|
422
444
|
] as const
|
|
423
445
|
export type AgentCompactionFailureCode = (typeof AGENT_COMPACTION_FAILURE_CODES)[number]
|
|
424
446
|
|
|
447
|
+
/**
|
|
448
|
+
* A message a turn read from its thread's inbox as it answered. The conversation holds it as a user
|
|
449
|
+
* message, with this id, where the turn read it: after what the run streamed before this record.
|
|
450
|
+
*/
|
|
451
|
+
export interface AgentInboxReadMessage {
|
|
452
|
+
/** The id the message is saved with once the turn ends. */
|
|
453
|
+
readonly id: string
|
|
454
|
+
readonly authorPrincipal: Principal
|
|
455
|
+
readonly parts: readonly AgentMessagePart[]
|
|
456
|
+
readonly createdAt: string
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/** Messages a turn read in its finished steps, after the first `at` of their chunks. */
|
|
460
|
+
export interface AgentRunStepsRead {
|
|
461
|
+
readonly at: number
|
|
462
|
+
readonly messages: readonly AgentInboxReadMessage[]
|
|
463
|
+
}
|
|
464
|
+
|
|
425
465
|
export type AgentRunStreamEvent =
|
|
426
466
|
| (AgentRunStreamEventBase & {
|
|
427
467
|
readonly type: "agent.run.started"
|
|
@@ -449,6 +489,28 @@ export type AgentRunStreamEvent =
|
|
|
449
489
|
readonly chunkIndex: number
|
|
450
490
|
readonly chunk: ModelUiChunk
|
|
451
491
|
})
|
|
492
|
+
| (AgentRunStreamEventBase & {
|
|
493
|
+
readonly type: "agent.inbox.read"
|
|
494
|
+
readonly messages: readonly AgentInboxReadMessage[]
|
|
495
|
+
/**
|
|
496
|
+
* The last live chunk published before the turn read them, absent before the first: the
|
|
497
|
+
* finished steps that cover it hold this read too, where it happened.
|
|
498
|
+
*/
|
|
499
|
+
readonly afterChunkIndex?: number
|
|
500
|
+
})
|
|
501
|
+
| (AgentRunStreamEventBase & {
|
|
502
|
+
/**
|
|
503
|
+
* The turn's finished steps, as the chunks that rebuild them. Never a live record: the server
|
|
504
|
+
* sends it first to a reader who opens the turn late, and that reader then skips the live
|
|
505
|
+
* records it covers. It replaces whatever the reader rebuilt before.
|
|
506
|
+
*/
|
|
507
|
+
readonly type: "agent.ui.steps"
|
|
508
|
+
/** The last live chunk it covers. */
|
|
509
|
+
readonly throughChunkIndex: number
|
|
510
|
+
readonly chunks: readonly ModelUiChunk[]
|
|
511
|
+
/** What the turn read from its inbox in those steps, each after the first `at` chunks. */
|
|
512
|
+
readonly reads?: readonly AgentRunStepsRead[]
|
|
513
|
+
})
|
|
452
514
|
| (AgentRunStreamEventBase & {
|
|
453
515
|
readonly type: "agent.message.finalized"
|
|
454
516
|
readonly messageId: string
|
|
@@ -461,6 +523,7 @@ export type AgentRunStreamEvent =
|
|
|
461
523
|
})
|
|
462
524
|
|
|
463
525
|
export type AgentRunFinishedEvent = Extract<AgentRunStreamEvent, { type: "agent.run.finished" }>
|
|
526
|
+
export type AgentRunStepsEvent = Extract<AgentRunStreamEvent, { type: "agent.ui.steps" }>
|
|
464
527
|
|
|
465
528
|
// ── Record construction ──────────────────────────────────────────────────────────────────────────
|
|
466
529
|
//
|
|
@@ -546,6 +609,22 @@ export function isAgentRunStreamEvent(value: unknown): value is AgentRunStreamEv
|
|
|
546
609
|
case "agent.ui.chunk":
|
|
547
610
|
// A chunk type this reader does not know fails here, so a newer producer's chunk is skipped.
|
|
548
611
|
return Number.isInteger(value.chunkIndex) && isModelUiChunk(value.chunk)
|
|
612
|
+
case "agent.inbox.read":
|
|
613
|
+
return (
|
|
614
|
+
Array.isArray(value.messages) &&
|
|
615
|
+
value.messages.length > 0 &&
|
|
616
|
+
value.messages.every(isAgentInboxReadMessage) &&
|
|
617
|
+
(value.afterChunkIndex === undefined || Number.isInteger(value.afterChunkIndex))
|
|
618
|
+
)
|
|
619
|
+
case "agent.ui.steps":
|
|
620
|
+
// As for one chunk: steps holding a chunk this reader does not know are skipped whole.
|
|
621
|
+
return (
|
|
622
|
+
Number.isInteger(value.throughChunkIndex) &&
|
|
623
|
+
Array.isArray(value.chunks) &&
|
|
624
|
+
value.chunks.every(isModelUiChunk) &&
|
|
625
|
+
(value.reads === undefined ||
|
|
626
|
+
(Array.isArray(value.reads) && value.reads.every(isAgentRunStepsRead)))
|
|
627
|
+
)
|
|
549
628
|
case "agent.message.finalized":
|
|
550
629
|
return typeof value.messageId === "string"
|
|
551
630
|
case "agent.run.finished":
|
|
@@ -559,6 +638,31 @@ export function isAgentRunStreamEvent(value: unknown): value is AgentRunStreamEv
|
|
|
559
638
|
}
|
|
560
639
|
}
|
|
561
640
|
|
|
641
|
+
function isAgentInboxReadMessage(value: unknown): value is AgentInboxReadMessage {
|
|
642
|
+
return (
|
|
643
|
+
isPlainRecord(value) &&
|
|
644
|
+
typeof value.id === "string" &&
|
|
645
|
+
isPlainRecord(value.authorPrincipal) &&
|
|
646
|
+
typeof value.authorPrincipal.type === "string" &&
|
|
647
|
+
typeof value.authorPrincipal.id === "string" &&
|
|
648
|
+
Array.isArray(value.parts) &&
|
|
649
|
+
value.parts.every((part) => isPlainRecord(part) && typeof part.type === "string") &&
|
|
650
|
+
isJsonValue(value.parts) &&
|
|
651
|
+
typeof value.createdAt === "string"
|
|
652
|
+
)
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
function isAgentRunStepsRead(value: unknown): value is AgentRunStepsRead {
|
|
656
|
+
return (
|
|
657
|
+
isPlainRecord(value) &&
|
|
658
|
+
Number.isInteger(value.at) &&
|
|
659
|
+
(value.at as number) >= 0 &&
|
|
660
|
+
Array.isArray(value.messages) &&
|
|
661
|
+
value.messages.length > 0 &&
|
|
662
|
+
value.messages.every(isAgentInboxReadMessage)
|
|
663
|
+
)
|
|
664
|
+
}
|
|
665
|
+
|
|
562
666
|
function isAgentContextCheckpointReason(value: unknown): value is AgentContextCheckpointReason {
|
|
563
667
|
return value === "threshold" || value === "overflow"
|
|
564
668
|
}
|
|
@@ -598,6 +702,10 @@ export function agentRunStreamIdempotencyKey(event: AgentRunStreamEvent): string
|
|
|
598
702
|
return `${event.runId}:${event.attempt}:compaction:${event.reason}:failed:${event.errorCode}`
|
|
599
703
|
case "agent.ui.chunk":
|
|
600
704
|
return `${event.runId}:${event.attempt}:chunk:${event.chunkIndex}`
|
|
705
|
+
case "agent.inbox.read":
|
|
706
|
+
return `${event.runId}:${event.attempt}:inbox:${event.messages.map((message) => message.id).join(",")}:read`
|
|
707
|
+
case "agent.ui.steps":
|
|
708
|
+
return `${event.runId}:${event.attempt}:steps:${event.throughChunkIndex}`
|
|
601
709
|
case "agent.message.finalized":
|
|
602
710
|
return `${event.runId}:${event.attempt}:message:${event.messageId}:finalized`
|
|
603
711
|
case "agent.run.finished":
|