@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
|
@@ -22,6 +22,11 @@ export type {
|
|
|
22
22
|
AgentContextCheckpointStore,
|
|
23
23
|
AgentExecutionStatus,
|
|
24
24
|
AgentHoldingApprovalMode,
|
|
25
|
+
AgentInboxClaim,
|
|
26
|
+
AgentInboxItemRecord,
|
|
27
|
+
AgentInboxMode,
|
|
28
|
+
AgentInboxSpec,
|
|
29
|
+
AgentInboxStore,
|
|
25
30
|
AgentMemoryChange,
|
|
26
31
|
AgentMemoryFile,
|
|
27
32
|
AgentMemoryRepoRecord,
|
|
@@ -46,6 +51,9 @@ export type {
|
|
|
46
51
|
AgentThreadParent,
|
|
47
52
|
AgentThreadParticipantRecord,
|
|
48
53
|
AgentThreadPlace,
|
|
54
|
+
AgentThreadReadRecord,
|
|
55
|
+
AgentThreadReadState,
|
|
56
|
+
AgentThreadReadStore,
|
|
49
57
|
AgentThreadRecord,
|
|
50
58
|
AgentThreadSandboxParams,
|
|
51
59
|
AgentThreadSandboxState,
|
|
@@ -56,6 +64,7 @@ export type {
|
|
|
56
64
|
AppendAgentMessageInput,
|
|
57
65
|
AssignAgentThreadComputerInput,
|
|
58
66
|
ConfirmAgentRunExecutionOwnershipInput,
|
|
67
|
+
ConsumeClaimedAgentInboxInput,
|
|
59
68
|
ConversationAgentRunRecord,
|
|
60
69
|
ConversationAgentRunSpec,
|
|
61
70
|
CreateAgentContextCheckpointInput,
|
|
@@ -64,12 +73,17 @@ export type {
|
|
|
64
73
|
CreateSubagentRunInput,
|
|
65
74
|
DecideAgentApprovalInput,
|
|
66
75
|
DecideAgentApprovalResult,
|
|
76
|
+
DeleteAgentContextCheckpointsAfterSeqInput,
|
|
67
77
|
DeleteAgentMessagesByRunInput,
|
|
78
|
+
DeleteAgentMessagesFromSeqInput,
|
|
79
|
+
EnqueueAgentInboxItemInput,
|
|
80
|
+
EnqueueAgentInboxItemResult,
|
|
68
81
|
FinishAgentRunInput,
|
|
69
82
|
FinishQueuedAgentRunInput,
|
|
70
83
|
ForkAgentThreadInput,
|
|
71
84
|
ListAgentApprovalsInput,
|
|
72
85
|
ListAgentApprovalsResult,
|
|
86
|
+
ListAgentInboxItemsInput,
|
|
73
87
|
ListAgentMemoryRevisionsInput,
|
|
74
88
|
ListAgentMemoryRevisionsResult,
|
|
75
89
|
ListAgentMessagesInput,
|
|
@@ -78,17 +92,24 @@ export type {
|
|
|
78
92
|
ListAgentRunsResult,
|
|
79
93
|
ListAgentThreadChildrenInput,
|
|
80
94
|
ListAgentThreadParticipantsInput,
|
|
95
|
+
ListAgentThreadReadsInput,
|
|
81
96
|
ListAgentThreadsInput,
|
|
82
97
|
ListAgentThreadsResult,
|
|
98
|
+
ListLatestAgentRunsInput,
|
|
83
99
|
ListThreadSubagentsInput,
|
|
100
|
+
ListWaitingAgentInboxThreadsInput,
|
|
84
101
|
MarkAgentApprovalsReportedInput,
|
|
102
|
+
MarkAgentThreadReadInput,
|
|
85
103
|
MoveAgentThreadToCloudInput,
|
|
86
104
|
MoveAgentThreadToCloudResult,
|
|
87
105
|
ReclaimAgentRunInput,
|
|
106
|
+
RemoveAgentInboxItemInput,
|
|
88
107
|
RemoveAgentThreadParticipantInput,
|
|
89
108
|
RequestAgentApprovalInput,
|
|
90
109
|
RequestAgentApprovalResult,
|
|
91
110
|
RequestAgentRunCancelInput,
|
|
111
|
+
RewindAgentApprovalsInput,
|
|
112
|
+
RewindAgentApprovalsResult,
|
|
92
113
|
SaveAgentMemoryInput,
|
|
93
114
|
SaveAgentMemoryResult,
|
|
94
115
|
SettleAgentApprovalsInput,
|
|
@@ -99,14 +120,19 @@ export type {
|
|
|
99
120
|
SubagentRunRecord,
|
|
100
121
|
SubagentRunResult,
|
|
101
122
|
SubagentRunSpec,
|
|
123
|
+
TakeAgentInboxSteersInput,
|
|
124
|
+
TakeNextQueuedAgentInboxInput,
|
|
102
125
|
TransitionAgentThreadSandboxInput,
|
|
126
|
+
UpdateAgentInboxItemInput,
|
|
103
127
|
} from "./types"
|
|
104
128
|
export {
|
|
105
129
|
AGENT_APPROVAL_MODES,
|
|
106
130
|
AGENT_APPROVAL_STATUSES,
|
|
107
131
|
AGENT_HOLDING_APPROVAL_MODES,
|
|
132
|
+
AGENT_INBOX_MODES,
|
|
108
133
|
AGENT_RUN_DIAGNOSTIC_CODES,
|
|
109
134
|
AGENT_RUN_FAILURE_CODES,
|
|
110
135
|
AGENT_RUN_FINISH_REASONS,
|
|
136
|
+
AGENT_THREAD_INBOX_MAX_ITEMS,
|
|
111
137
|
coerceAgentRunFinishReason,
|
|
112
138
|
} from "./types"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isDeepStrictEqual } from "node:util"
|
|
2
2
|
import { createAgentMessageId, createCopiedAgentContextCheckpointId } from "../../agents/ids"
|
|
3
|
+
import type { AgentMessagePart } from "../../agents/message"
|
|
3
4
|
import { AGENT_REASONING_LEVELS } from "../../agents/types"
|
|
4
5
|
import type { Principal, UserPrincipal } from "../../auth"
|
|
5
6
|
import { isFileRef } from "../../blob-storage/validation"
|
|
@@ -9,9 +10,9 @@ import { isModelReasoning } from "../../models/language-model"
|
|
|
9
10
|
import type { ExecutionRecord, ExecutionStorage } from "../executions"
|
|
10
11
|
import { findAgentRunExecution } from "../executions/run-link"
|
|
11
12
|
import { AgentStorageError } from "./errors"
|
|
12
|
-
import { AGENT_COMPUTER_BACKGROUND_COMMANDS_MAX } from "./types"
|
|
13
|
+
import { AGENT_COMPUTER_BACKGROUND_COMMANDS_MAX, AGENT_THREAD_INBOX_MAX_ITEMS } from "./types"
|
|
13
14
|
|
|
14
|
-
export { AGENT_COMPUTER_BACKGROUND_COMMANDS_MAX }
|
|
15
|
+
export { AGENT_COMPUTER_BACKGROUND_COMMANDS_MAX, AGENT_THREAD_INBOX_MAX_ITEMS }
|
|
15
16
|
|
|
16
17
|
import type {
|
|
17
18
|
AddAgentThreadParticipantsInput,
|
|
@@ -22,6 +23,9 @@ import type {
|
|
|
22
23
|
AgentBackgroundCommandRef,
|
|
23
24
|
AgentComputerSessionRecord,
|
|
24
25
|
AgentContextCheckpointRecord,
|
|
26
|
+
AgentInboxItemRecord,
|
|
27
|
+
AgentInboxMode,
|
|
28
|
+
AgentInboxSpec,
|
|
25
29
|
AgentMemoryChange,
|
|
26
30
|
AgentMessageRecord,
|
|
27
31
|
AgentRunRecord,
|
|
@@ -32,10 +36,14 @@ import type {
|
|
|
32
36
|
AgentThreadSandboxParams,
|
|
33
37
|
AgentThreadSandboxState,
|
|
34
38
|
AgentTokenRateRecord,
|
|
39
|
+
ConsumeClaimedAgentInboxInput,
|
|
35
40
|
ConversationAgentRunRecord,
|
|
36
41
|
ConversationAgentRunSpec,
|
|
37
42
|
CreateAgentContextCheckpointInput,
|
|
38
43
|
CreateSubagentRunInput,
|
|
44
|
+
DeleteAgentContextCheckpointsAfterSeqInput,
|
|
45
|
+
DeleteAgentMessagesFromSeqInput,
|
|
46
|
+
EnqueueAgentInboxItemInput,
|
|
39
47
|
FinishAgentRunInput,
|
|
40
48
|
ForkAgentThreadInput,
|
|
41
49
|
ListAgentApprovalsInput,
|
|
@@ -45,11 +53,14 @@ import type {
|
|
|
45
53
|
SubagentRunFile,
|
|
46
54
|
SubagentRunRecord,
|
|
47
55
|
SubagentRunResult,
|
|
56
|
+
TakeAgentInboxSteersInput,
|
|
48
57
|
TransitionAgentThreadSandboxInput,
|
|
58
|
+
UpdateAgentInboxItemInput,
|
|
49
59
|
} from "./types"
|
|
50
60
|
import {
|
|
51
61
|
AGENT_APPROVAL_MODES,
|
|
52
62
|
AGENT_HOLDING_APPROVAL_MODES,
|
|
63
|
+
AGENT_INBOX_MODES,
|
|
53
64
|
AGENT_MEMORY_HISTORY_DAYS,
|
|
54
65
|
AGENT_TOKEN_RATE_MAX_BYTES_PER_TOKEN,
|
|
55
66
|
AGENT_TOKEN_RATE_MIN_BYTES_PER_TOKEN,
|
|
@@ -91,6 +102,23 @@ export function transitionAgentThreadSandbox(
|
|
|
91
102
|
resetAt: new Date().toISOString(),
|
|
92
103
|
}
|
|
93
104
|
}
|
|
105
|
+
if (input.action === "restore") {
|
|
106
|
+
if (thread.activeRunId !== null) return fail("cannot be restored during an active run.")
|
|
107
|
+
if (!state || state.name !== input.name) return fail("changed; reload before restoring.")
|
|
108
|
+
if (state.status !== "busy" && state.status !== "blocked") {
|
|
109
|
+
return fail("does not require recovery.")
|
|
110
|
+
}
|
|
111
|
+
// Only a workspace its run finished preparing holds anything to go on from. A provider never
|
|
112
|
+
// resumes a VM that still runs, so the next run cannot reach a late operation of the last one.
|
|
113
|
+
if (!state.initialized) return fail("was never prepared; start fresh instead.")
|
|
114
|
+
return {
|
|
115
|
+
name: state.name,
|
|
116
|
+
status: "ready",
|
|
117
|
+
initialized: true,
|
|
118
|
+
...(state.sourceFingerprint ? { sourceFingerprint: state.sourceFingerprint } : {}),
|
|
119
|
+
...(state.resetAt ? { resetAt: state.resetAt } : {}),
|
|
120
|
+
}
|
|
121
|
+
}
|
|
94
122
|
if (
|
|
95
123
|
!run ||
|
|
96
124
|
run.threadId !== thread.id ||
|
|
@@ -268,17 +296,37 @@ export interface AgentThreadForkPlan {
|
|
|
268
296
|
readonly thread: AgentThreadRecord
|
|
269
297
|
/** The source messages to copy, in `seq` order, with the id of each copy. */
|
|
270
298
|
readonly messages: readonly { readonly sourceId: string; readonly id: string }[]
|
|
299
|
+
/** The seq of the last message copied, 0 when none: the copy's newest, as copies keep theirs. */
|
|
300
|
+
readonly headSeq: number
|
|
271
301
|
readonly checkpoint?: AgentContextCheckpointRecord
|
|
272
302
|
}
|
|
273
303
|
|
|
274
|
-
/**
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
304
|
+
/** `fromSeq` names a message of the thread: sequences start at 1. */
|
|
305
|
+
export function assertDeleteAgentMessagesFromSeqInput(
|
|
306
|
+
input: DeleteAgentMessagesFromSeqInput,
|
|
307
|
+
prefix = "Sixb"
|
|
308
|
+
): void {
|
|
309
|
+
if (!Number.isSafeInteger(input.fromSeq) || input.fromSeq < 1) {
|
|
310
|
+
throw new AgentStorageError(
|
|
311
|
+
"invalid_input",
|
|
312
|
+
`[${prefix}] Agent message 'fromSeq' must be a positive safe integer.`
|
|
313
|
+
)
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/** `afterSeq` is the last sequence whose summaries stay: 0 keeps none. */
|
|
318
|
+
export function assertDeleteAgentContextCheckpointsAfterSeqInput(
|
|
319
|
+
input: DeleteAgentContextCheckpointsAfterSeqInput,
|
|
320
|
+
prefix = "Sixb"
|
|
321
|
+
): void {
|
|
322
|
+
if (!Number.isSafeInteger(input.afterSeq) || input.afterSeq < 0) {
|
|
323
|
+
throw new AgentStorageError(
|
|
324
|
+
"invalid_input",
|
|
325
|
+
`[${prefix}] Agent context checkpoint 'afterSeq' must be a non-negative safe integer.`
|
|
326
|
+
)
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
282
330
|
/**
|
|
283
331
|
* Whether a message counts in its thread's `messageCount`, which reads as what the conversation
|
|
284
332
|
* shows. The message Sixb writes to resume a paused turn carries only how its calls ended, which the
|
|
@@ -290,6 +338,32 @@ export function countsAsThreadMessage(message: Pick<AgentMessageRecord, "parts">
|
|
|
290
338
|
)
|
|
291
339
|
}
|
|
292
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Whether a message past a reader's place is new to them: every Agent answer and every other
|
|
343
|
+
* person's message. What they wrote themselves is not, and neither is a message the thread does
|
|
344
|
+
* not count. An Agent answer carries its requester as author, so only a user message is theirs.
|
|
345
|
+
* The SQL providers say the same in their `unread` count.
|
|
346
|
+
*/
|
|
347
|
+
export function isUnreadFor(
|
|
348
|
+
message: Pick<AgentMessageRecord, "role" | "authorPrincipal" | "parts">,
|
|
349
|
+
reader: UserPrincipal
|
|
350
|
+
): boolean {
|
|
351
|
+
if (!countsAsThreadMessage(message)) return false
|
|
352
|
+
|
|
353
|
+
const author = message.authorPrincipal
|
|
354
|
+
const ownMessage = message.role === "user" && author?.type === "user" && author.id === reader.id
|
|
355
|
+
|
|
356
|
+
return !ownMessage
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Decide what a fork copies. While a turn is running, the fork copies what came before its trigger
|
|
361
|
+
* message, so the copy never has a gap; otherwise it copies everything. Copies keep their `seq`,
|
|
362
|
+
* so the latest checkpoint whose observed head was copied projects unchanged.
|
|
363
|
+
*
|
|
364
|
+
* The plan mints the ids of the copies: which messages are copied is only known here, under the
|
|
365
|
+
* provider's lock, so the caller cannot supply them.
|
|
366
|
+
*/
|
|
293
367
|
export function planAgentThreadFork(
|
|
294
368
|
input: ForkAgentThreadInput,
|
|
295
369
|
source: AgentThreadForkSource,
|
|
@@ -334,6 +408,7 @@ export function planAgentThreadFork(
|
|
|
334
408
|
return {
|
|
335
409
|
thread,
|
|
336
410
|
messages: copied.map((message) => ({ sourceId: message.id, id: createAgentMessageId() })),
|
|
411
|
+
headSeq: lastCopiedSeq,
|
|
337
412
|
...(checkpoint === undefined
|
|
338
413
|
? {}
|
|
339
414
|
: {
|
|
@@ -440,6 +515,12 @@ export function assertConversationAgentRunSpec(
|
|
|
440
515
|
}
|
|
441
516
|
assertApprovalModeField(spec.approvalMode, "Conversational Agent run", prefix)
|
|
442
517
|
assertRunsOn(spec.runsOn, "Conversational Agent run", prefix)
|
|
518
|
+
if (spec.computer !== undefined) {
|
|
519
|
+
if (spec.runsOn !== "computer") {
|
|
520
|
+
throw new AgentStorageError("invalid_input", `[${prefix}] Only a computer's turn names one.`)
|
|
521
|
+
}
|
|
522
|
+
assertAgentThreadPlace(spec.computer, prefix)
|
|
523
|
+
}
|
|
443
524
|
}
|
|
444
525
|
|
|
445
526
|
/** Validate where a thread or turn runs: `computer`, or absent for the cloud. */
|
|
@@ -452,6 +533,33 @@ export function assertRunsOn(value: unknown, subject: string, prefix = "Sixb"):
|
|
|
452
533
|
}
|
|
453
534
|
}
|
|
454
535
|
|
|
536
|
+
/**
|
|
537
|
+
* Validate which computer and folder a turn ran in. Both are shown back to its owner, so neither
|
|
538
|
+
* holds a control character.
|
|
539
|
+
*/
|
|
540
|
+
export function assertAgentThreadPlace(
|
|
541
|
+
value: unknown,
|
|
542
|
+
prefix = "Sixb"
|
|
543
|
+
): asserts value is AgentThreadPlace {
|
|
544
|
+
const place = value as Partial<AgentThreadPlace> | null
|
|
545
|
+
for (const [field, text, max] of [
|
|
546
|
+
["id", place?.id, 200],
|
|
547
|
+
["folder", place?.folder, 4096],
|
|
548
|
+
] as const) {
|
|
549
|
+
if (
|
|
550
|
+
typeof text !== "string" ||
|
|
551
|
+
text.trim() === "" ||
|
|
552
|
+
text.length > max ||
|
|
553
|
+
CONTROL_CHARACTER.test(text)
|
|
554
|
+
) {
|
|
555
|
+
throw new AgentStorageError(
|
|
556
|
+
"invalid_input",
|
|
557
|
+
`[${prefix}] A turn's computer '${field}' must be a non-blank string of at most ${max} characters, without control characters.`
|
|
558
|
+
)
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
455
563
|
/**
|
|
456
564
|
* Validate where on a computer a thread runs: the CLI's id for the computer, its name, and the
|
|
457
565
|
* folder there. All are shown back to its owner, so none holds a control character.
|
|
@@ -569,8 +677,8 @@ export const CONTROL_CHARACTER =
|
|
|
569
677
|
/[\u0000-\u001f\u007f-\u009f\u200e\u200f\u202a-\u202e\u2066-\u2069]/
|
|
570
678
|
|
|
571
679
|
/**
|
|
572
|
-
* Refuse to assign a computer to a thread
|
|
573
|
-
* while a turn runs in its folder.
|
|
680
|
+
* Refuse to assign a computer to a sub-agent's thread or one that does not exist, to move a cloud
|
|
681
|
+
* thread while a turn holds it, or to move a computer's thread while a turn runs in its folder.
|
|
574
682
|
*/
|
|
575
683
|
export function assertAssignableComputer(
|
|
576
684
|
thread: AgentThreadRecord | null,
|
|
@@ -582,12 +690,23 @@ export function assertAssignableComputer(
|
|
|
582
690
|
if (!thread) {
|
|
583
691
|
throw new AgentStorageError("thread_not_found", `[${prefix}] Agent thread '${id}' not found.`)
|
|
584
692
|
}
|
|
585
|
-
if (thread.
|
|
693
|
+
if (thread.kind !== "conversation") {
|
|
586
694
|
throw new AgentStorageError(
|
|
587
695
|
"invalid_input",
|
|
588
|
-
`[${prefix}]
|
|
696
|
+
`[${prefix}] Sub-agent thread '${id}' never runs on a computer.`
|
|
589
697
|
)
|
|
590
698
|
}
|
|
699
|
+
if (thread.runsOn !== "computer") {
|
|
700
|
+
// A turn in flight, or one waiting for its computer, would be left where nothing runs it. A
|
|
701
|
+
// turn paused on held calls passes here: the caller refuses that, with its approvals in view.
|
|
702
|
+
if (activeRun?.status === "queued" || activeRun?.status === "running") {
|
|
703
|
+
throw new AgentStorageError(
|
|
704
|
+
"active_run_exists",
|
|
705
|
+
`[${prefix}] A turn of Agent thread '${id}' is in progress in the cloud: stop it, or let it end, first.`
|
|
706
|
+
)
|
|
707
|
+
}
|
|
708
|
+
return
|
|
709
|
+
}
|
|
591
710
|
if (movesComputerPlace(thread, computer)) assertNoTurnRunning(activeRun, id, prefix)
|
|
592
711
|
}
|
|
593
712
|
|
|
@@ -677,15 +796,62 @@ export function queuedTurnInCloud(
|
|
|
677
796
|
): ConversationAgentRunRecord | undefined {
|
|
678
797
|
if (active?.kind !== "conversation" || active.status !== "queued") return undefined
|
|
679
798
|
if (active.spec?.runsOn !== "computer") return undefined
|
|
680
|
-
const { runsOn: _runsOn, ...cloud } = active.spec
|
|
799
|
+
const { runsOn: _runsOn, computer: _computer, ...cloud } = active.spec
|
|
681
800
|
return { ...active, spec: cloud }
|
|
682
801
|
}
|
|
683
802
|
|
|
803
|
+
/** The queued turn of a computer's thread that moves to another folder, with its new place. */
|
|
804
|
+
export function queuedTurnOnComputer(
|
|
805
|
+
active: AgentRunRecord | null,
|
|
806
|
+
computer: AgentThreadPlace
|
|
807
|
+
): ConversationAgentRunRecord | undefined {
|
|
808
|
+
if (active?.kind !== "conversation" || active.status !== "queued") return undefined
|
|
809
|
+
if (active.spec?.runsOn !== "computer" || active.spec.computer === undefined) return undefined
|
|
810
|
+
const place = { id: computer.id, folder: computer.folder }
|
|
811
|
+
if (sameComputerPlace(active.spec.computer, place)) return undefined
|
|
812
|
+
return { ...active, spec: { ...active.spec, computer: place } }
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* Mark a paused sub-agent's saved cloud workspace unavailable when its conversation leaves the
|
|
817
|
+
* cloud: a continuation on the computer updates out/, so a later return to the cloud starts fresh.
|
|
818
|
+
*/
|
|
819
|
+
export function unavailableChildSandboxState(
|
|
820
|
+
state: AgentThreadSandboxState | undefined
|
|
821
|
+
): AgentThreadSandboxState | undefined {
|
|
822
|
+
if (!state || (state.status !== "ready" && state.status !== "new")) return undefined
|
|
823
|
+
return { ...state, status: "unavailable" }
|
|
824
|
+
}
|
|
825
|
+
|
|
684
826
|
/** Whether two places are the same folder of the same computer, whatever they call it. */
|
|
685
827
|
export function sameComputerPlace(a: AgentThreadPlace, b: AgentThreadPlace): boolean {
|
|
686
828
|
return a.id === b.id && a.folder === b.folder
|
|
687
829
|
}
|
|
688
830
|
|
|
831
|
+
/** Where a turn runs, as its spec records it: the cloud, or a folder of its owner's computer. */
|
|
832
|
+
export type AgentTurnPlace = Pick<ConversationAgentRunSpec, "runsOn" | "computer">
|
|
833
|
+
|
|
834
|
+
/** The place a turn's spec records, from its thread's: the cloud, or a computer and its folder. */
|
|
835
|
+
export function turnPlace(
|
|
836
|
+
runsOn: "computer" | undefined,
|
|
837
|
+
computer: AgentThreadPlace | undefined
|
|
838
|
+
): AgentTurnPlace {
|
|
839
|
+
if (runsOn === undefined) return {}
|
|
840
|
+
|
|
841
|
+
return computer
|
|
842
|
+
? { runsOn, computer: Object.freeze({ id: computer.id, folder: computer.folder }) }
|
|
843
|
+
: { runsOn }
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* The same key for two turns that ran in the same workspace: the cloud, or one folder of one
|
|
848
|
+
* computer. A computer's turn from before folders were kept ran in a folder nobody knows.
|
|
849
|
+
*/
|
|
850
|
+
export function runPlaceKey(spec: AgentTurnPlace | undefined): string {
|
|
851
|
+
if (spec?.runsOn !== "computer") return "cloud"
|
|
852
|
+
return spec.computer ? `computer:${spec.computer.id}:${spec.computer.folder}` : "computer"
|
|
853
|
+
}
|
|
854
|
+
|
|
689
855
|
export function isAgentApprovalMode(value: unknown): value is AgentApprovalMode {
|
|
690
856
|
return (AGENT_APPROVAL_MODES as readonly unknown[]).includes(value)
|
|
691
857
|
}
|
|
@@ -1538,3 +1704,276 @@ export function agentApprovalMatches(
|
|
|
1538
1704
|
(approval.reportedInMessageId !== undefined) === input.reported)
|
|
1539
1705
|
)
|
|
1540
1706
|
}
|
|
1707
|
+
|
|
1708
|
+
// -- agent_thread_inbox: shared validation and transitions ------------------------------------
|
|
1709
|
+
|
|
1710
|
+
function assertNonEmptyText(value: unknown, field: string, prefix: string): void {
|
|
1711
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
1712
|
+
throw new AgentStorageError(
|
|
1713
|
+
"invalid_input",
|
|
1714
|
+
`[${prefix}] Agent inbox '${field}' must not be empty.`
|
|
1715
|
+
)
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
function assertPrincipalInput(principal: Principal, field: string, prefix: string): void {
|
|
1720
|
+
if (
|
|
1721
|
+
!isPlainRecord(principal) ||
|
|
1722
|
+
!["user", "serviceAccount", "system"].includes(principal.type) ||
|
|
1723
|
+
typeof principal.id !== "string" ||
|
|
1724
|
+
principal.id.trim().length === 0
|
|
1725
|
+
) {
|
|
1726
|
+
throw new AgentStorageError("invalid_input", `[${prefix}] Agent inbox '${field}' is invalid.`)
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
export function assertAgentInboxMode(
|
|
1731
|
+
mode: unknown,
|
|
1732
|
+
prefix = "Sixb"
|
|
1733
|
+
): asserts mode is AgentInboxMode {
|
|
1734
|
+
if (!(AGENT_INBOX_MODES as readonly unknown[]).includes(mode)) {
|
|
1735
|
+
throw new AgentStorageError(
|
|
1736
|
+
"invalid_input",
|
|
1737
|
+
`[${prefix}] Agent inbox mode must be one of: ${AGENT_INBOX_MODES.join(", ")}.`
|
|
1738
|
+
)
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
export function assertAgentInboxSpec(spec: AgentInboxSpec | undefined, prefix = "Sixb"): void {
|
|
1743
|
+
if (spec === undefined) return
|
|
1744
|
+
if (!isPlainRecord(spec)) {
|
|
1745
|
+
throw new AgentStorageError("invalid_input", `[${prefix}] Agent inbox spec must be an object.`)
|
|
1746
|
+
}
|
|
1747
|
+
if (spec.model !== undefined) {
|
|
1748
|
+
if (
|
|
1749
|
+
!isPlainRecord(spec.model) ||
|
|
1750
|
+
typeof spec.model.provider !== "string" ||
|
|
1751
|
+
spec.model.provider.trim().length === 0 ||
|
|
1752
|
+
typeof spec.model.modelId !== "string" ||
|
|
1753
|
+
spec.model.modelId.trim().length === 0
|
|
1754
|
+
) {
|
|
1755
|
+
throw new AgentStorageError(
|
|
1756
|
+
"invalid_input",
|
|
1757
|
+
`[${prefix}] Agent inbox model reference must have non-empty provider and modelId.`
|
|
1758
|
+
)
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
if (spec.reasoning !== undefined) {
|
|
1762
|
+
const validLevel = (AGENT_REASONING_LEVELS as readonly unknown[]).includes(spec.reasoning)
|
|
1763
|
+
if (!validLevel && !isModelReasoning(spec.reasoning)) {
|
|
1764
|
+
throw new AgentStorageError("invalid_input", `[${prefix}] Agent inbox reasoning is invalid.`)
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
if (
|
|
1768
|
+
spec.approvalMode !== undefined &&
|
|
1769
|
+
!(AGENT_APPROVAL_MODES as readonly unknown[]).includes(spec.approvalMode)
|
|
1770
|
+
) {
|
|
1771
|
+
throw new AgentStorageError(
|
|
1772
|
+
"invalid_input",
|
|
1773
|
+
`[${prefix}] Agent inbox approvalMode must be one of: ${AGENT_APPROVAL_MODES.join(", ")}.`
|
|
1774
|
+
)
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
export function assertEnqueueAgentInboxItemInput(
|
|
1779
|
+
input: EnqueueAgentInboxItemInput,
|
|
1780
|
+
prefix = "Sixb"
|
|
1781
|
+
): void {
|
|
1782
|
+
assertNonEmptyText(input.projectId, "projectId", prefix)
|
|
1783
|
+
assertNonEmptyText(input.id, "id", prefix)
|
|
1784
|
+
assertNonEmptyText(input.threadId, "threadId", prefix)
|
|
1785
|
+
assertNonEmptyText(input.messageId, "messageId", prefix)
|
|
1786
|
+
assertPrincipalInput(input.authorPrincipal, "authorPrincipal", prefix)
|
|
1787
|
+
assertAgentInboxMode(input.mode, prefix)
|
|
1788
|
+
assertAgentInboxParts(input.parts, input.mode, prefix)
|
|
1789
|
+
assertAgentInboxSpec(input.spec, prefix)
|
|
1790
|
+
if (input.executionId !== undefined) assertNonEmptyText(input.executionId, "executionId", prefix)
|
|
1791
|
+
if (input.replacesMessageId !== undefined) {
|
|
1792
|
+
assertNonEmptyText(input.replacesMessageId, "replacesMessageId", prefix)
|
|
1793
|
+
if (input.mode !== "queue" || input.immediate !== true) {
|
|
1794
|
+
throw new AgentStorageError(
|
|
1795
|
+
"invalid_input",
|
|
1796
|
+
`[${prefix}] An agent inbox item that replaces a message is a queued message sent now.`
|
|
1797
|
+
)
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
/**
|
|
1803
|
+
* A steer is read mid-turn, where nothing prepares its files: its bytes must be the ones a later
|
|
1804
|
+
* replay of the saved message sends, so it carries no file part. A message with one waits for the
|
|
1805
|
+
* next turn, where the turn prepares its attachments as it does the trigger's.
|
|
1806
|
+
*/
|
|
1807
|
+
function assertAgentInboxParts(
|
|
1808
|
+
parts: readonly AgentMessagePart[] | undefined,
|
|
1809
|
+
mode: AgentInboxMode,
|
|
1810
|
+
prefix: string
|
|
1811
|
+
): void {
|
|
1812
|
+
if (!Array.isArray(parts) || parts.length === 0) {
|
|
1813
|
+
throw new AgentStorageError(
|
|
1814
|
+
"invalid_input",
|
|
1815
|
+
`[${prefix}] Agent inbox 'parts' must be a non-empty array.`
|
|
1816
|
+
)
|
|
1817
|
+
}
|
|
1818
|
+
if (mode === "steer" && parts.some((part) => part.type === "file")) {
|
|
1819
|
+
throw new AgentStorageError(
|
|
1820
|
+
"invalid_input",
|
|
1821
|
+
`[${prefix}] An agent inbox 'steer' carries no file: queue it for the next turn instead.`
|
|
1822
|
+
)
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
export function assertUpdateAgentInboxItemInput(
|
|
1827
|
+
input: UpdateAgentInboxItemInput,
|
|
1828
|
+
prefix = "Sixb"
|
|
1829
|
+
): void {
|
|
1830
|
+
assertNonEmptyText(input.projectId, "projectId", prefix)
|
|
1831
|
+
assertNonEmptyText(input.threadId, "threadId", prefix)
|
|
1832
|
+
assertNonEmptyText(input.id, "id", prefix)
|
|
1833
|
+
if (input.mode !== undefined) assertAgentInboxMode(input.mode, prefix)
|
|
1834
|
+
if (input.parts !== undefined) assertAgentInboxParts(input.parts, input.mode ?? "queue", prefix)
|
|
1835
|
+
if (input.spec !== undefined && input.spec !== null) assertAgentInboxSpec(input.spec, prefix)
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
export function assertTakeAgentInboxSteersInput(
|
|
1839
|
+
input: TakeAgentInboxSteersInput,
|
|
1840
|
+
prefix = "Sixb"
|
|
1841
|
+
): void {
|
|
1842
|
+
assertNonEmptyText(input.projectId, "projectId", prefix)
|
|
1843
|
+
assertNonEmptyText(input.threadId, "threadId", prefix)
|
|
1844
|
+
assertNonEmptyText(input.runId, "runId", prefix)
|
|
1845
|
+
assertNonEmptyText(input.executionToken, "executionToken", prefix)
|
|
1846
|
+
if (!Number.isInteger(input.stepIndex) || input.stepIndex < 0) {
|
|
1847
|
+
throw new AgentStorageError(
|
|
1848
|
+
"invalid_input",
|
|
1849
|
+
`[${prefix}] Agent inbox 'stepIndex' must be a non-negative integer.`
|
|
1850
|
+
)
|
|
1851
|
+
}
|
|
1852
|
+
assertPrincipalInput(input.authorPrincipal, "authorPrincipal", prefix)
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
export function assertInboxThreadAcceptsItem(
|
|
1856
|
+
thread: Pick<AgentThreadRecord, "id" | "kind" | "status"> | null,
|
|
1857
|
+
threadId: string,
|
|
1858
|
+
projectId: string,
|
|
1859
|
+
existingCount: number,
|
|
1860
|
+
prefix = "Sixb"
|
|
1861
|
+
): void {
|
|
1862
|
+
if (!thread) {
|
|
1863
|
+
throw new AgentStorageError(
|
|
1864
|
+
"thread_not_found",
|
|
1865
|
+
`[${prefix}] Agent thread '${threadId}' not found for project '${projectId}'.`
|
|
1866
|
+
)
|
|
1867
|
+
}
|
|
1868
|
+
assertConversationThreadRow(thread, "holds inbox messages", prefix)
|
|
1869
|
+
if (thread.status !== "active") {
|
|
1870
|
+
throw new AgentStorageError(
|
|
1871
|
+
"invalid_state",
|
|
1872
|
+
`[${prefix}] Archived agent thread '${thread.id}' does not accept inbox messages.`
|
|
1873
|
+
)
|
|
1874
|
+
}
|
|
1875
|
+
if (existingCount >= AGENT_THREAD_INBOX_MAX_ITEMS) {
|
|
1876
|
+
throw new AgentStorageError(
|
|
1877
|
+
"inbox_limit",
|
|
1878
|
+
`[${prefix}] Agent thread '${thread.id}' can hold at most ${AGENT_THREAD_INBOX_MAX_ITEMS} pending inbox items.`
|
|
1879
|
+
)
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
export function assertInboxRunOwnership(
|
|
1884
|
+
run: Pick<AgentRunRecord, "id" | "kind" | "threadId" | "status" | "execution"> | null,
|
|
1885
|
+
input: Pick<ConsumeClaimedAgentInboxInput, "projectId" | "threadId" | "runId" | "executionToken">,
|
|
1886
|
+
prefix = "Sixb"
|
|
1887
|
+
): void {
|
|
1888
|
+
if (
|
|
1889
|
+
!run ||
|
|
1890
|
+
run.kind !== "conversation" ||
|
|
1891
|
+
run.threadId !== input.threadId ||
|
|
1892
|
+
run.status !== "running" ||
|
|
1893
|
+
run.execution?.token !== input.executionToken
|
|
1894
|
+
) {
|
|
1895
|
+
throw new AgentStorageError(
|
|
1896
|
+
"execution_lost",
|
|
1897
|
+
`[${prefix}] Execution token is no longer current on agent run '${input.runId}'.`
|
|
1898
|
+
)
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
export function newAgentInboxItemRecord(
|
|
1903
|
+
input: EnqueueAgentInboxItemInput,
|
|
1904
|
+
seq: number
|
|
1905
|
+
): AgentInboxItemRecord {
|
|
1906
|
+
const createdAt = new Date(input.createdAt ?? new Date())
|
|
1907
|
+
const normalizedSpec = normalizeInboxSpec(input.spec)
|
|
1908
|
+
return {
|
|
1909
|
+
id: input.id,
|
|
1910
|
+
projectId: input.projectId,
|
|
1911
|
+
threadId: input.threadId,
|
|
1912
|
+
messageId: input.messageId,
|
|
1913
|
+
seq,
|
|
1914
|
+
authorPrincipal: structuredClone(input.authorPrincipal),
|
|
1915
|
+
mode: input.mode,
|
|
1916
|
+
parts: structuredClone(input.parts),
|
|
1917
|
+
...(normalizedSpec ? { spec: normalizedSpec } : {}),
|
|
1918
|
+
...(input.timeZone ? { timeZone: input.timeZone } : {}),
|
|
1919
|
+
...(input.locale ? { locale: input.locale } : {}),
|
|
1920
|
+
...(input.immediate ? { immediate: true } : {}),
|
|
1921
|
+
...(input.replacesMessageId ? { replacesMessageId: input.replacesMessageId } : {}),
|
|
1922
|
+
...(input.executionId ? { executionId: input.executionId } : {}),
|
|
1923
|
+
createdAt,
|
|
1924
|
+
updatedAt: new Date(createdAt),
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
export function updatedAgentInboxItemRecord(
|
|
1929
|
+
current: AgentInboxItemRecord,
|
|
1930
|
+
input: UpdateAgentInboxItemInput
|
|
1931
|
+
): AgentInboxItemRecord {
|
|
1932
|
+
if (current.claimedBy !== undefined) {
|
|
1933
|
+
throw new AgentStorageError(
|
|
1934
|
+
"invalid_state",
|
|
1935
|
+
`[Sixb] Agent inbox item '${current.id}' was already claimed by run '${current.claimedBy.runId}'.`
|
|
1936
|
+
)
|
|
1937
|
+
}
|
|
1938
|
+
const nextSpec =
|
|
1939
|
+
input.spec === undefined
|
|
1940
|
+
? current.spec
|
|
1941
|
+
: input.spec === null
|
|
1942
|
+
? undefined
|
|
1943
|
+
: normalizeInboxSpec(input.spec)
|
|
1944
|
+
const nextImmediate = input.immediate === undefined ? current.immediate : input.immediate
|
|
1945
|
+
const { spec: _oldSpec, immediate: _oldImmediate, ...base } = current
|
|
1946
|
+
const mode = input.mode ?? current.mode
|
|
1947
|
+
// An edit rewinds the thread when it starts: it goes now, after the turn it stopped.
|
|
1948
|
+
if (current.replacesMessageId !== undefined && (mode !== "queue" || nextImmediate !== true)) {
|
|
1949
|
+
throw new AgentStorageError(
|
|
1950
|
+
"invalid_state",
|
|
1951
|
+
`[Sixb] Agent inbox item '${current.id}' edits message '${current.replacesMessageId}': it stays a message sent now.`
|
|
1952
|
+
)
|
|
1953
|
+
}
|
|
1954
|
+
const parts =
|
|
1955
|
+
input.parts !== undefined ? structuredClone(input.parts) : structuredClone(current.parts)
|
|
1956
|
+
// Promoting a message that carries a file to a steer would read bytes a replay cannot send.
|
|
1957
|
+
assertAgentInboxParts(parts, mode, "Sixb")
|
|
1958
|
+
return {
|
|
1959
|
+
...base,
|
|
1960
|
+
mode,
|
|
1961
|
+
parts,
|
|
1962
|
+
...(nextSpec ? { spec: structuredClone(nextSpec) } : {}),
|
|
1963
|
+
...(nextImmediate ? { immediate: true } : {}),
|
|
1964
|
+
updatedAt: new Date(input.updatedAt ?? new Date()),
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
function normalizeInboxSpec(spec: AgentInboxSpec | undefined): AgentInboxSpec | undefined {
|
|
1969
|
+
if (!spec) return undefined
|
|
1970
|
+
const out: {
|
|
1971
|
+
model?: AgentInboxSpec["model"]
|
|
1972
|
+
reasoning?: AgentInboxSpec["reasoning"]
|
|
1973
|
+
approvalMode?: AgentInboxSpec["approvalMode"]
|
|
1974
|
+
} = {}
|
|
1975
|
+
if (spec.model !== undefined) out.model = structuredClone(spec.model)
|
|
1976
|
+
if (spec.reasoning !== undefined) out.reasoning = structuredClone(spec.reasoning)
|
|
1977
|
+
if (spec.approvalMode !== undefined) out.approvalMode = spec.approvalMode
|
|
1978
|
+
return Object.keys(out).length > 0 ? out : undefined
|
|
1979
|
+
}
|