@sixb/core 0.2.3 → 0.2.5
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 +28 -28
- package/dist/agents/cancel.d.ts +1 -1
- package/dist/agents/cancel.d.ts.map +1 -1
- package/dist/agents/child-question.d.ts +35 -2
- package/dist/agents/child-question.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +35 -3
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/ids.d.ts +4 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +9 -7
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +59 -33
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-loop.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 +79 -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 +6 -1
- package/dist/agents/run-events.d.ts.map +1 -1
- package/dist/agents/run-session-children.d.ts +9 -0
- 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.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.js +1 -1
- package/dist/agents/streams/protocol.d.ts +16 -0
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts +1 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/agents/tool-input-coercion.d.ts +20 -0
- package/dist/agents/tool-input-coercion.d.ts.map +1 -0
- 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 +65 -3
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/runtime.d.ts +32 -5
- package/dist/artifacts/frames/runtime.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +4 -2
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +35 -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 +23 -19
- 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 +26 -18
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +5 -5
- 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/auth/index.js +2 -2
- package/dist/authorization/event-visibility.d.ts.map +1 -1
- package/dist/authorization/index.js +1 -1
- package/dist/blob-storage/index.js +1 -1
- package/dist/bootstrap/index.js +38 -38
- package/dist/{chunk-tqa68kj7.js → chunk-0hkdtwqk.js} +5 -5
- package/dist/{chunk-s5n9617r.js → chunk-0mvjpgvm.js} +5 -5
- package/dist/{chunk-k66rp2hr.js → chunk-1yh6jgtz.js} +1 -1
- package/dist/{chunk-26qet7wh.js → chunk-5t9gm5tt.js} +4 -4
- 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-hkaa807g.js → chunk-68hm50qh.js} +3 -3
- package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
- package/dist/chunk-8tv3qd65.js.map +12 -0
- package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
- package/dist/{chunk-m7b9q5dk.js → chunk-aw1z0gre.js} +4 -4
- package/dist/chunk-az95tsh3.js.map +2 -2
- package/dist/{chunk-4j0sagwv.js → chunk-b4escq4c.js} +62 -14
- package/dist/{chunk-4j0sagwv.js.map → chunk-b4escq4c.js.map} +7 -7
- package/dist/chunk-bqr703h4.js +1799 -0
- package/dist/chunk-bqr703h4.js.map +13 -0
- package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
- package/dist/chunk-c29729me.js.map +12 -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-3014rfjz.js → chunk-ewqn51gr.js} +25 -7
- package/dist/{chunk-3014rfjz.js.map → chunk-ewqn51gr.js.map} +3 -3
- package/dist/{chunk-7z5rkf0m.js → chunk-ey1p8w68.js} +175 -5
- package/dist/chunk-ey1p8w68.js.map +13 -0
- package/dist/{chunk-z0t4p2sk.js → chunk-fpf57gca.js} +350 -61
- package/dist/chunk-fpf57gca.js.map +47 -0
- package/dist/{chunk-kv0kvknv.js → chunk-fzae1jpq.js} +7 -7
- package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
- package/dist/chunk-fzbhybya.js.map +11 -0
- package/dist/{chunk-2by73sm2.js → chunk-gjhrz66x.js} +225 -17
- package/dist/{chunk-2by73sm2.js.map → chunk-gjhrz66x.js.map} +5 -5
- package/dist/chunk-hn2r7z41.js.map +1 -1
- package/dist/{chunk-6gtxshcc.js → chunk-k29n4176.js} +6 -6
- package/dist/{chunk-48c1z8nj.js → chunk-k3jh8gsg.js} +10 -2
- package/dist/chunk-k3jh8gsg.js.map +10 -0
- package/dist/{chunk-w9s23r24.js → chunk-m3qx2pns.js} +751 -93
- package/dist/chunk-m3qx2pns.js.map +34 -0
- package/dist/{chunk-smnt672s.js → chunk-m9ketb51.js} +20 -4
- package/dist/chunk-m9ketb51.js.map +10 -0
- package/dist/chunk-mbwsgjn7.js +40 -0
- package/dist/chunk-mbwsgjn7.js.map +11 -0
- package/dist/{chunk-sysnvjce.js → chunk-naxjka9v.js} +2 -2
- package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
- package/dist/chunk-nxysqbt0.js.map +10 -0
- package/dist/{chunk-vzkxqf8h.js → chunk-paxabbqd.js} +49 -5
- package/dist/chunk-paxabbqd.js.map +23 -0
- package/dist/{chunk-8tqnsx3q.js → chunk-pc7kra3k.js} +5 -3
- package/dist/{chunk-8tqnsx3q.js.map → chunk-pc7kra3k.js.map} +3 -3
- package/dist/{chunk-qafng88v.js → chunk-pqvvqc65.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-8t2ynwg0.js → chunk-q8d9p0tb.js} +24 -1
- package/dist/{chunk-8t2ynwg0.js.map → chunk-q8d9p0tb.js.map} +3 -3
- package/dist/{chunk-wa05txmk.js → chunk-qavwr628.js} +49 -5
- package/dist/chunk-qavwr628.js.map +12 -0
- package/dist/{chunk-bkmnd7zq.js → chunk-rg725hry.js} +174 -30
- package/dist/{chunk-bkmnd7zq.js.map → chunk-rg725hry.js.map} +9 -8
- package/dist/{chunk-8p7bze4c.js → chunk-s1mqyqmm.js} +3 -3
- package/dist/{chunk-p351afzm.js → chunk-s5pj68fa.js} +2 -2
- package/dist/{chunk-855w9nvw.js → chunk-vehcr9eb.js} +1 -1
- package/dist/{chunk-qds484t8.js → chunk-vs2s3p8n.js} +932 -21
- package/dist/chunk-vs2s3p8n.js.map +20 -0
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-n68vz95m.js → chunk-wqe9shx2.js} +1 -1
- package/dist/{chunk-0k3r5kb3.js → chunk-xcrnrpfh.js} +1 -1
- 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-e9w4mgdh.js → chunk-z1njfqqs.js} +589 -53
- package/dist/{chunk-e9w4mgdh.js.map → chunk-z1njfqqs.js.map} +14 -11
- package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
- package/dist/chunk-z4jqb44a.js.map +10 -0
- package/dist/{chunk-s7xqfxs9.js → chunk-zft9bzbc.js} +2 -1
- package/dist/{chunk-s7xqfxs9.js.map → chunk-zft9bzbc.js.map} +3 -3
- package/dist/{chunk-38yvdqzd.js → chunk-zxhym8tr.js} +1 -1
- 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/events.d.ts +17 -0
- package/dist/connectors/connections/events.d.ts.map +1 -0
- 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 +4 -0
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/execution.d.ts +7 -1
- package/dist/connectors/execution.d.ts.map +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.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 +18 -1
- 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.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/execution/agent.js +28 -28
- package/dist/execution/authorization.d.ts +5 -0
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/primitive.js +28 -28
- package/dist/execution/request.js +29 -29
- 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 +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -44
- 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 +1 -1
- 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 +13 -13
- 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/execution/index.js +12 -12
- package/dist/models/language-model.d.ts +6 -0
- package/dist/models/language-model.d.ts.map +1 -1
- package/dist/models/tools.d.ts +2 -0
- package/dist/models/tools.d.ts.map +1 -1
- package/dist/objects/index.js +28 -28
- package/dist/objects/query/index.js +12 -12
- package/dist/pipelines/index.js +18 -18
- 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 +13 -13
- 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 +2 -1
- 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 +39 -18
- package/dist/runtime/internal.js.map +4 -3
- 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/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/shares/internal.js +12 -12
- 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 +26 -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 +12 -3
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +25 -5
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +156 -1
- package/dist/storage/agents/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 +2 -1
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +34 -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 +3 -3
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +18 -14
- 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 +8 -6
- 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/workflow-runs/provider.js +3 -3
- package/dist/syncs/index.js +19 -19
- 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/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 +5524 -4555
- package/dist/testing/index.js.map +10 -9
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-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 +16 -49
- 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/queued-run-dispatch.d.ts.map +1 -1
- package/dist/workflows/index.js +35 -35
- package/package.json +6 -1
- package/src/agents/README.md +6 -2
- package/src/agents/approval-outcome.ts +2 -2
- package/src/agents/cancel.ts +2 -2
- package/src/agents/child-question.ts +76 -8
- package/src/agents/execution.ts +168 -30
- package/src/agents/ids.ts +9 -1
- package/src/agents/index.ts +27 -6
- package/src/agents/model-loop.ts +3 -1
- package/src/agents/queued-turn.ts +46 -0
- package/src/agents/request.ts +517 -2
- package/src/agents/run-after-finish.ts +259 -2
- package/src/agents/run-artifacts.ts +3 -93
- package/src/agents/run-events.ts +26 -1
- package/src/agents/run-session-children.ts +33 -0
- package/src/agents/run-session-http.ts +10 -2
- package/src/agents/run-session-serve.ts +3 -8
- package/src/agents/run-session.ts +142 -3
- package/src/agents/run-turn.ts +8 -0
- package/src/agents/streams/index.ts +1 -0
- package/src/agents/streams/protocol.ts +41 -1
- package/src/agents/tool-files.ts +1 -1
- package/src/agents/tool-input-coercion.ts +140 -0
- package/src/agents/turn-answered.ts +31 -0
- package/src/agents/validation.ts +13 -3
- 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 +96 -3
- package/src/artifacts/frames/runtime.ts +709 -19
- package/src/artifacts/index.ts +6 -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 +14 -12
- 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/authorization/event-visibility.ts +13 -0
- package/src/connectors/connection-handles.ts +71 -0
- package/src/connectors/connections/authorizations.ts +50 -2
- package/src/connectors/connections/events.ts +57 -0
- package/src/connectors/connections/runs.ts +5 -0
- package/src/connectors/connections/service.ts +19 -1
- package/src/connectors/execution.ts +30 -2
- package/src/connectors/index.ts +3 -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 +26 -1
- package/src/events/definitions.ts +14 -0
- package/src/events/execution.ts +9 -2
- 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/execution/authorization.ts +45 -0
- package/src/execution/durable.ts +2 -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 +26 -1
- package/src/index.ts +21 -2
- 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/language-model.ts +6 -0
- package/src/models/tools.ts +2 -0
- 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 +112 -4
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/resolve-definitions.ts +4 -1
- package/src/runtime/script.ts +62 -0
- package/src/runtime/sixb.ts +3 -3
- package/src/schedules/builders.ts +4 -1
- package/src/schedules/runtime.ts +3 -0
- package/src/schedules/validation.ts +20 -2
- package/src/storage/agents/errors.ts +1 -0
- package/src/storage/agents/in-memory.ts +229 -1
- package/src/storage/agents/index.ts +16 -0
- package/src/storage/agents/provider.ts +284 -2
- package/src/storage/agents/types.ts +168 -1
- package/src/storage/artifacts/in-memory.ts +32 -1
- package/src/storage/artifacts/index.ts +2 -0
- package/src/storage/artifacts/record.ts +25 -2
- package/src/storage/artifacts/types.ts +37 -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 +18 -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 +1 -0
- package/src/testing/agent-execution.ts +45 -2
- package/src/testing/agent-inbox-storage-contract.ts +815 -0
- package/src/testing/agent-storage-contract.ts +103 -0
- package/src/testing/artifact-storage-contract.ts +72 -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/webhooks/connections.ts +9 -50
- package/src/webhooks/index.ts +0 -2
- package/src/webhooks/types.ts +2 -13
- package/src/workers/queued-run-dispatch.ts +8 -1
- 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-7z5rkf0m.js.map +0 -13
- 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-m2jerfef.js +0 -474
- package/dist/chunk-m2jerfef.js.map +0 -11
- package/dist/chunk-n4zzaf6q.js.map +0 -10
- package/dist/chunk-qds484t8.js.map +0 -18
- package/dist/chunk-smnt672s.js.map +0 -10
- package/dist/chunk-vzkxqf8h.js.map +0 -23
- package/dist/chunk-w9s23r24.js.map +0 -30
- package/dist/chunk-wa05txmk.js.map +0 -11
- package/dist/chunk-yv8hv4wq.js.map +0 -10
- package/dist/chunk-z0t4p2sk.js.map +0 -47
- /package/dist/{chunk-tqa68kj7.js.map → chunk-0hkdtwqk.js.map} +0 -0
- /package/dist/{chunk-s5n9617r.js.map → chunk-0mvjpgvm.js.map} +0 -0
- /package/dist/{chunk-k66rp2hr.js.map → chunk-1yh6jgtz.js.map} +0 -0
- /package/dist/{chunk-26qet7wh.js.map → chunk-5t9gm5tt.js.map} +0 -0
- /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
- /package/dist/{chunk-hkaa807g.js.map → chunk-68hm50qh.js.map} +0 -0
- /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
- /package/dist/{chunk-m7b9q5dk.js.map → chunk-aw1z0gre.js.map} +0 -0
- /package/dist/{chunk-kv0kvknv.js.map → chunk-fzae1jpq.js.map} +0 -0
- /package/dist/{chunk-6gtxshcc.js.map → chunk-k29n4176.js.map} +0 -0
- /package/dist/{chunk-sysnvjce.js.map → chunk-naxjka9v.js.map} +0 -0
- /package/dist/{chunk-qafng88v.js.map → chunk-pqvvqc65.js.map} +0 -0
- /package/dist/{chunk-8p7bze4c.js.map → chunk-s1mqyqmm.js.map} +0 -0
- /package/dist/{chunk-p351afzm.js.map → chunk-s5pj68fa.js.map} +0 -0
- /package/dist/{chunk-855w9nvw.js.map → chunk-vehcr9eb.js.map} +0 -0
- /package/dist/{chunk-n68vz95m.js.map → chunk-wqe9shx2.js.map} +0 -0
- /package/dist/{chunk-0k3r5kb3.js.map → chunk-xcrnrpfh.js.map} +0 -0
- /package/dist/{chunk-38yvdqzd.js.map → chunk-zxhym8tr.js.map} +0 -0
|
@@ -33,18 +33,24 @@ import {
|
|
|
33
33
|
assertConversationThreadRow,
|
|
34
34
|
assertCreateAgentContextCheckpointInput,
|
|
35
35
|
assertCreateSubagentRunInput,
|
|
36
|
+
assertEnqueueAgentInboxItemInput,
|
|
37
|
+
assertInboxRunOwnership,
|
|
38
|
+
assertInboxThreadAcceptsItem,
|
|
36
39
|
assertMovableToCloud,
|
|
37
40
|
assertRequestAgentApprovalInput,
|
|
38
41
|
assertSaveAgentMemoryInput,
|
|
39
42
|
assertStartsOnComputer,
|
|
40
43
|
assertSubagentThreadTakesRun,
|
|
44
|
+
assertTakeAgentInboxSteersInput,
|
|
41
45
|
assertTurnInThreadPlace,
|
|
46
|
+
assertUpdateAgentInboxItemInput,
|
|
42
47
|
compareAgentMemoryPaths,
|
|
43
48
|
compareAgentThreadParticipants,
|
|
44
49
|
countsAsThreadMessage,
|
|
45
50
|
LIVE_AGENT_APPROVAL_STATUSES,
|
|
46
51
|
movesComputerPlace,
|
|
47
52
|
newAgentApprovalRecord,
|
|
53
|
+
newAgentInboxItemRecord,
|
|
48
54
|
newSubagentThreadRecord,
|
|
49
55
|
participantsToAdd,
|
|
50
56
|
planAgentThreadFork,
|
|
@@ -53,6 +59,7 @@ import {
|
|
|
53
59
|
snapshotAgentThreadSandboxParams,
|
|
54
60
|
subagentRunMatchesCreateInput,
|
|
55
61
|
transitionAgentThreadSandbox,
|
|
62
|
+
updatedAgentInboxItemRecord,
|
|
56
63
|
withStopRequest,
|
|
57
64
|
} from "./provider"
|
|
58
65
|
import type {
|
|
@@ -68,6 +75,8 @@ import type {
|
|
|
68
75
|
AgentComputerSessionStore,
|
|
69
76
|
AgentContextCheckpointRecord,
|
|
70
77
|
AgentContextCheckpointStore,
|
|
78
|
+
AgentInboxItemRecord,
|
|
79
|
+
AgentInboxStore,
|
|
71
80
|
AgentMemoryChange,
|
|
72
81
|
AgentMemoryRepoRecord,
|
|
73
82
|
AgentMemoryRevisionRecord,
|
|
@@ -87,6 +96,7 @@ import type {
|
|
|
87
96
|
AppendAgentMessageInput,
|
|
88
97
|
AssignAgentThreadComputerInput,
|
|
89
98
|
ConfirmAgentRunExecutionOwnershipInput,
|
|
99
|
+
ConsumeClaimedAgentInboxInput,
|
|
90
100
|
ConversationAgentRunRecord,
|
|
91
101
|
CreateAgentContextCheckpointInput,
|
|
92
102
|
CreateAgentRunInput,
|
|
@@ -95,11 +105,14 @@ import type {
|
|
|
95
105
|
DecideAgentApprovalInput,
|
|
96
106
|
DecideAgentApprovalResult,
|
|
97
107
|
DeleteAgentMessagesByRunInput,
|
|
108
|
+
EnqueueAgentInboxItemInput,
|
|
109
|
+
EnqueueAgentInboxItemResult,
|
|
98
110
|
FinishAgentRunInput,
|
|
99
111
|
FinishQueuedAgentRunInput,
|
|
100
112
|
ForkAgentThreadInput,
|
|
101
113
|
ListAgentApprovalsInput,
|
|
102
114
|
ListAgentApprovalsResult,
|
|
115
|
+
ListAgentInboxItemsInput,
|
|
103
116
|
ListAgentMemoryRevisionsInput,
|
|
104
117
|
ListAgentMemoryRevisionsResult,
|
|
105
118
|
ListAgentMessagesInput,
|
|
@@ -111,10 +124,12 @@ import type {
|
|
|
111
124
|
ListAgentThreadsInput,
|
|
112
125
|
ListAgentThreadsResult,
|
|
113
126
|
ListThreadSubagentsInput,
|
|
127
|
+
ListWaitingAgentInboxThreadsInput,
|
|
114
128
|
MarkAgentApprovalsReportedInput,
|
|
115
129
|
MoveAgentThreadToCloudInput,
|
|
116
130
|
MoveAgentThreadToCloudResult,
|
|
117
131
|
ReclaimAgentRunInput,
|
|
132
|
+
RemoveAgentInboxItemInput,
|
|
118
133
|
RemoveAgentThreadParticipantInput,
|
|
119
134
|
RequestAgentApprovalInput,
|
|
120
135
|
RequestAgentApprovalResult,
|
|
@@ -126,7 +141,10 @@ import type {
|
|
|
126
141
|
StopAgentApprovalsInput,
|
|
127
142
|
StopAgentApprovalsResult,
|
|
128
143
|
SubagentRunRecord,
|
|
144
|
+
TakeAgentInboxSteersInput,
|
|
145
|
+
TakeNextQueuedAgentInboxInput,
|
|
129
146
|
TransitionAgentThreadSandboxInput,
|
|
147
|
+
UpdateAgentInboxItemInput,
|
|
130
148
|
} from "./types"
|
|
131
149
|
import { AGENT_RUN_FAILURE_CODES, AGENT_TOKEN_RATE_SAMPLES } from "./types"
|
|
132
150
|
|
|
@@ -193,6 +211,8 @@ interface AgentStoreState {
|
|
|
193
211
|
readonly approvalModes: Map<string, AgentApprovalMode>
|
|
194
212
|
/** By `[projectId, runId]`. */
|
|
195
213
|
readonly tokenRates: Map<string, AgentTokenRateRecord>
|
|
214
|
+
/** By `[projectId, id]`. */
|
|
215
|
+
readonly inbox: Map<string, AgentInboxItemRecord>
|
|
196
216
|
}
|
|
197
217
|
|
|
198
218
|
/** A memory repo as its two SQL tables hold it: revisions, and the file versions each wrote. */
|
|
@@ -213,6 +233,7 @@ export interface InMemoryAgentStorageSnapshot {
|
|
|
213
233
|
readonly approvals: Map<string, AgentApprovalRecord>
|
|
214
234
|
readonly approvalModes: Map<string, AgentApprovalMode>
|
|
215
235
|
readonly tokenRates: Map<string, AgentTokenRateRecord>
|
|
236
|
+
readonly inbox: Map<string, AgentInboxItemRecord>
|
|
216
237
|
}
|
|
217
238
|
|
|
218
239
|
// ── threads ───────────────────────────────────────────────────────────────────────────────────
|
|
@@ -226,7 +247,7 @@ class InMemoryAgentThreadStore implements AgentThreadStore {
|
|
|
226
247
|
const threadKey = key(input.projectId, input.id)
|
|
227
248
|
const thread = this.state.threads.get(threadKey) ?? null
|
|
228
249
|
const run =
|
|
229
|
-
input.action === "recreate"
|
|
250
|
+
input.action === "recreate" || input.action === "restore"
|
|
230
251
|
? null
|
|
231
252
|
: (this.state.runs.get(key(input.projectId, input.runId)) ?? null)
|
|
232
253
|
const sandboxState = transitionAgentThreadSandbox(thread, run, input)
|
|
@@ -1781,6 +1802,208 @@ class InMemoryAgentTokenRateStore implements AgentTokenRateStore {
|
|
|
1781
1802
|
}
|
|
1782
1803
|
}
|
|
1783
1804
|
|
|
1805
|
+
// -- inbox ------------------------------------------------------------------------------------
|
|
1806
|
+
|
|
1807
|
+
class InMemoryAgentInboxStore implements AgentInboxStore {
|
|
1808
|
+
constructor(private readonly state: AgentStoreState) {}
|
|
1809
|
+
|
|
1810
|
+
async enqueue(input: EnqueueAgentInboxItemInput): Promise<EnqueueAgentInboxItemResult> {
|
|
1811
|
+
assertEnqueueAgentInboxItemInput(input, "Sixb")
|
|
1812
|
+
|
|
1813
|
+
const itemKey = key(input.projectId, input.id)
|
|
1814
|
+
const existing = this.state.inbox.get(itemKey)
|
|
1815
|
+
if (existing) {
|
|
1816
|
+
if (existing.threadId === input.threadId) {
|
|
1817
|
+
return { item: clone(existing), created: false }
|
|
1818
|
+
}
|
|
1819
|
+
throw new AgentStorageError(
|
|
1820
|
+
"duplicate_id",
|
|
1821
|
+
`[Sixb] Agent inbox item '${input.id}' already exists on another thread in project '${input.projectId}'.`
|
|
1822
|
+
)
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
const thread = this.state.threads.get(key(input.projectId, input.threadId)) ?? null
|
|
1826
|
+
const threadItems = this.threadItems(input.projectId, input.threadId)
|
|
1827
|
+
assertInboxThreadAcceptsItem(
|
|
1828
|
+
thread,
|
|
1829
|
+
input.threadId,
|
|
1830
|
+
input.projectId,
|
|
1831
|
+
threadItems.length,
|
|
1832
|
+
"Sixb"
|
|
1833
|
+
)
|
|
1834
|
+
|
|
1835
|
+
if (
|
|
1836
|
+
this.state.messages.has(key(input.projectId, input.messageId)) ||
|
|
1837
|
+
[...this.state.inbox.values()].some(
|
|
1838
|
+
(item) => item.projectId === input.projectId && item.messageId === input.messageId
|
|
1839
|
+
)
|
|
1840
|
+
) {
|
|
1841
|
+
throw new AgentStorageError(
|
|
1842
|
+
"duplicate_id",
|
|
1843
|
+
`[Sixb] Agent message '${input.messageId}' already exists for project '${input.projectId}'.`
|
|
1844
|
+
)
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
const seq = threadItems.reduce((max, item) => Math.max(max, item.seq), 0) + 1
|
|
1848
|
+
const record = newAgentInboxItemRecord(input, seq)
|
|
1849
|
+
this.state.inbox.set(itemKey, clone(record))
|
|
1850
|
+
return { item: clone(record), created: true }
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
async getById(params: { projectId: string; id: string }): Promise<AgentInboxItemRecord | null> {
|
|
1854
|
+
const record = this.state.inbox.get(key(params.projectId, params.id))
|
|
1855
|
+
return record ? clone(record) : null
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
async list(input: ListAgentInboxItemsInput): Promise<readonly AgentInboxItemRecord[]> {
|
|
1859
|
+
const includeClaimed = input.includeClaimed ?? true
|
|
1860
|
+
return this.threadItems(input.projectId, input.threadId)
|
|
1861
|
+
.filter((item) => includeClaimed || item.claimedBy === undefined)
|
|
1862
|
+
.map(clone)
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
async update(input: UpdateAgentInboxItemInput): Promise<AgentInboxItemRecord | null> {
|
|
1866
|
+
assertUpdateAgentInboxItemInput(input, "Sixb")
|
|
1867
|
+
const itemKey = key(input.projectId, input.id)
|
|
1868
|
+
const current = this.state.inbox.get(itemKey)
|
|
1869
|
+
if (!current || current.threadId !== input.threadId) return null
|
|
1870
|
+
|
|
1871
|
+
const next = updatedAgentInboxItemRecord(current, input)
|
|
1872
|
+
this.state.inbox.set(itemKey, clone(next))
|
|
1873
|
+
return clone(next)
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
async remove(input: RemoveAgentInboxItemInput): Promise<AgentInboxItemRecord | null> {
|
|
1877
|
+
const itemKey = key(input.projectId, input.id)
|
|
1878
|
+
const current = this.state.inbox.get(itemKey)
|
|
1879
|
+
if (!current || current.threadId !== input.threadId) return null
|
|
1880
|
+
if (current.claimedBy !== undefined) {
|
|
1881
|
+
throw new AgentStorageError(
|
|
1882
|
+
"invalid_state",
|
|
1883
|
+
`[Sixb] Agent inbox item '${current.id}' was already claimed by run '${current.claimedBy.runId}'.`
|
|
1884
|
+
)
|
|
1885
|
+
}
|
|
1886
|
+
this.state.inbox.delete(itemKey)
|
|
1887
|
+
return clone(current)
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
async takeSteers(input: TakeAgentInboxSteersInput): Promise<readonly AgentInboxItemRecord[]> {
|
|
1891
|
+
assertTakeAgentInboxSteersInput(input, "Sixb")
|
|
1892
|
+
const run = this.state.runs.get(key(input.projectId, input.runId)) ?? null
|
|
1893
|
+
assertInboxRunOwnership(run, input, "Sixb")
|
|
1894
|
+
|
|
1895
|
+
const now = new Date()
|
|
1896
|
+
const claimed: AgentInboxItemRecord[] = []
|
|
1897
|
+
for (const item of this.threadItems(input.projectId, input.threadId)) {
|
|
1898
|
+
if (item.mode !== "steer" || item.immediate) continue
|
|
1899
|
+
if (!principalsEqual(item.authorPrincipal, input.authorPrincipal)) continue
|
|
1900
|
+
if (
|
|
1901
|
+
item.claimedBy?.runId === input.runId &&
|
|
1902
|
+
item.claimedBy.executionToken === input.executionToken
|
|
1903
|
+
) {
|
|
1904
|
+
continue
|
|
1905
|
+
}
|
|
1906
|
+
const next: AgentInboxItemRecord = {
|
|
1907
|
+
...item,
|
|
1908
|
+
claimedBy: {
|
|
1909
|
+
runId: input.runId,
|
|
1910
|
+
executionToken: input.executionToken,
|
|
1911
|
+
stepIndex: input.stepIndex,
|
|
1912
|
+
...(input.afterAnswer ? { afterAnswer: true } : {}),
|
|
1913
|
+
},
|
|
1914
|
+
updatedAt: now,
|
|
1915
|
+
}
|
|
1916
|
+
this.state.inbox.set(key(item.projectId, item.id), clone(next))
|
|
1917
|
+
claimed.push(clone(next))
|
|
1918
|
+
}
|
|
1919
|
+
return claimed
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
async consumeClaimed(
|
|
1923
|
+
input: ConsumeClaimedAgentInboxInput
|
|
1924
|
+
): Promise<readonly AgentInboxItemRecord[]> {
|
|
1925
|
+
const run = this.state.runs.get(key(input.projectId, input.runId)) ?? null
|
|
1926
|
+
assertInboxRunOwnership(run, input, "Sixb")
|
|
1927
|
+
|
|
1928
|
+
const persisted = new Set(input.messageIds)
|
|
1929
|
+
const now = new Date()
|
|
1930
|
+
const consumed: AgentInboxItemRecord[] = []
|
|
1931
|
+
for (const item of this.threadItems(input.projectId, input.threadId)) {
|
|
1932
|
+
if (
|
|
1933
|
+
item.claimedBy?.runId !== input.runId ||
|
|
1934
|
+
item.claimedBy.executionToken !== input.executionToken
|
|
1935
|
+
) {
|
|
1936
|
+
continue
|
|
1937
|
+
}
|
|
1938
|
+
const itemKey = key(item.projectId, item.id)
|
|
1939
|
+
if (persisted.has(item.messageId)) {
|
|
1940
|
+
this.state.inbox.delete(itemKey)
|
|
1941
|
+
consumed.push(clone(item))
|
|
1942
|
+
} else {
|
|
1943
|
+
const { claimedBy: _claimedBy, ...rest } = item
|
|
1944
|
+
this.state.inbox.set(itemKey, clone({ ...rest, updatedAt: now }))
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
return consumed
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
async releaseClaimed(input: { projectId: string; runId: string }): Promise<number> {
|
|
1951
|
+
const now = new Date()
|
|
1952
|
+
let released = 0
|
|
1953
|
+
for (const [itemKey, item] of this.state.inbox) {
|
|
1954
|
+
if (item.projectId !== input.projectId || item.claimedBy?.runId !== input.runId) continue
|
|
1955
|
+
const { claimedBy: _claimedBy, ...rest } = item
|
|
1956
|
+
this.state.inbox.set(itemKey, clone({ ...rest, updatedAt: now }))
|
|
1957
|
+
released += 1
|
|
1958
|
+
}
|
|
1959
|
+
return released
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
async takeNextQueued(input: TakeNextQueuedAgentInboxInput): Promise<AgentInboxItemRecord | null> {
|
|
1963
|
+
const thread = this.state.threads.get(key(input.projectId, input.threadId))
|
|
1964
|
+
if (!thread || thread.status !== "active" || thread.activeRunId !== null) return null
|
|
1965
|
+
|
|
1966
|
+
const candidates = this.threadItems(input.projectId, input.threadId)
|
|
1967
|
+
.filter(
|
|
1968
|
+
(item) =>
|
|
1969
|
+
item.claimedBy === undefined &&
|
|
1970
|
+
(!input.onlyImmediate || item.immediate) &&
|
|
1971
|
+
(input.authorPrincipal === undefined ||
|
|
1972
|
+
principalsEqual(item.authorPrincipal, input.authorPrincipal))
|
|
1973
|
+
)
|
|
1974
|
+
.sort((left, right) => inboxPriority(left) - inboxPriority(right) || left.seq - right.seq)
|
|
1975
|
+
const winner = candidates[0]
|
|
1976
|
+
if (!winner) return null
|
|
1977
|
+
|
|
1978
|
+
this.state.inbox.delete(key(winner.projectId, winner.id))
|
|
1979
|
+
return clone(winner)
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
async listWaitingThreads(input: ListWaitingAgentInboxThreadsInput): Promise<readonly string[]> {
|
|
1983
|
+
const ids = new Set<string>()
|
|
1984
|
+
for (const item of this.state.inbox.values()) {
|
|
1985
|
+
if (item.projectId !== input.projectId) continue
|
|
1986
|
+
if (item.createdAt.getTime() >= input.createdBefore.getTime()) continue
|
|
1987
|
+
if (input.afterThreadId !== undefined && item.threadId <= input.afterThreadId) continue
|
|
1988
|
+
const thread = this.state.threads.get(key(item.projectId, item.threadId))
|
|
1989
|
+
if (!thread || thread.activeRunId !== null) continue
|
|
1990
|
+
ids.add(item.threadId)
|
|
1991
|
+
}
|
|
1992
|
+
return [...ids].sort().slice(0, input.limit)
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
private threadItems(projectId: string, threadId: string): AgentInboxItemRecord[] {
|
|
1996
|
+
return [...this.state.inbox.values()]
|
|
1997
|
+
.filter((item) => item.projectId === projectId && item.threadId === threadId)
|
|
1998
|
+
.sort((left, right) => left.seq - right.seq)
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
function inboxPriority(item: Pick<AgentInboxItemRecord, "immediate" | "mode">): number {
|
|
2003
|
+
if (item.immediate) return 0
|
|
2004
|
+
return item.mode === "steer" ? 1 : 2
|
|
2005
|
+
}
|
|
2006
|
+
|
|
1784
2007
|
export class InMemoryAgentStorage implements AgentStorage {
|
|
1785
2008
|
private readonly state: AgentStoreState = {
|
|
1786
2009
|
threads: new Map(),
|
|
@@ -1792,6 +2015,7 @@ export class InMemoryAgentStorage implements AgentStorage {
|
|
|
1792
2015
|
approvals: new Map(),
|
|
1793
2016
|
approvalModes: new Map(),
|
|
1794
2017
|
tokenRates: new Map(),
|
|
2018
|
+
inbox: new Map(),
|
|
1795
2019
|
}
|
|
1796
2020
|
|
|
1797
2021
|
readonly threads: InMemoryAgentThreadStore
|
|
@@ -1802,6 +2026,7 @@ export class InMemoryAgentStorage implements AgentStorage {
|
|
|
1802
2026
|
readonly approvals: InMemoryAgentApprovalStore
|
|
1803
2027
|
readonly approvalModes: InMemoryAgentApprovalModeStore
|
|
1804
2028
|
readonly tokenRates: InMemoryAgentTokenRateStore
|
|
2029
|
+
readonly inbox: InMemoryAgentInboxStore
|
|
1805
2030
|
readonly computers = new InMemoryAgentComputerSessionStore()
|
|
1806
2031
|
|
|
1807
2032
|
constructor(executions: ExecutionStorage) {
|
|
@@ -1813,6 +2038,7 @@ export class InMemoryAgentStorage implements AgentStorage {
|
|
|
1813
2038
|
this.approvals = new InMemoryAgentApprovalStore(this.state)
|
|
1814
2039
|
this.approvalModes = new InMemoryAgentApprovalModeStore(this.state)
|
|
1815
2040
|
this.tokenRates = new InMemoryAgentTokenRateStore(this.state)
|
|
2041
|
+
this.inbox = new InMemoryAgentInboxStore(this.state)
|
|
1816
2042
|
}
|
|
1817
2043
|
|
|
1818
2044
|
snapshot(): InMemoryAgentStorageSnapshot {
|
|
@@ -1826,6 +2052,7 @@ export class InMemoryAgentStorage implements AgentStorage {
|
|
|
1826
2052
|
approvals: structuredClone(this.state.approvals),
|
|
1827
2053
|
approvalModes: structuredClone(this.state.approvalModes),
|
|
1828
2054
|
tokenRates: structuredClone(this.state.tokenRates),
|
|
2055
|
+
inbox: structuredClone(this.state.inbox),
|
|
1829
2056
|
}
|
|
1830
2057
|
}
|
|
1831
2058
|
|
|
@@ -1839,6 +2066,7 @@ export class InMemoryAgentStorage implements AgentStorage {
|
|
|
1839
2066
|
replace(this.state.approvals, snapshot.approvals)
|
|
1840
2067
|
replace(this.state.approvalModes, snapshot.approvalModes)
|
|
1841
2068
|
replace(this.state.tokenRates, snapshot.tokenRates)
|
|
2069
|
+
replace(this.state.inbox, snapshot.inbox)
|
|
1842
2070
|
}
|
|
1843
2071
|
}
|
|
1844
2072
|
|
|
@@ -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,
|
|
@@ -56,6 +61,7 @@ export type {
|
|
|
56
61
|
AppendAgentMessageInput,
|
|
57
62
|
AssignAgentThreadComputerInput,
|
|
58
63
|
ConfirmAgentRunExecutionOwnershipInput,
|
|
64
|
+
ConsumeClaimedAgentInboxInput,
|
|
59
65
|
ConversationAgentRunRecord,
|
|
60
66
|
ConversationAgentRunSpec,
|
|
61
67
|
CreateAgentContextCheckpointInput,
|
|
@@ -65,11 +71,14 @@ export type {
|
|
|
65
71
|
DecideAgentApprovalInput,
|
|
66
72
|
DecideAgentApprovalResult,
|
|
67
73
|
DeleteAgentMessagesByRunInput,
|
|
74
|
+
EnqueueAgentInboxItemInput,
|
|
75
|
+
EnqueueAgentInboxItemResult,
|
|
68
76
|
FinishAgentRunInput,
|
|
69
77
|
FinishQueuedAgentRunInput,
|
|
70
78
|
ForkAgentThreadInput,
|
|
71
79
|
ListAgentApprovalsInput,
|
|
72
80
|
ListAgentApprovalsResult,
|
|
81
|
+
ListAgentInboxItemsInput,
|
|
73
82
|
ListAgentMemoryRevisionsInput,
|
|
74
83
|
ListAgentMemoryRevisionsResult,
|
|
75
84
|
ListAgentMessagesInput,
|
|
@@ -81,10 +90,12 @@ export type {
|
|
|
81
90
|
ListAgentThreadsInput,
|
|
82
91
|
ListAgentThreadsResult,
|
|
83
92
|
ListThreadSubagentsInput,
|
|
93
|
+
ListWaitingAgentInboxThreadsInput,
|
|
84
94
|
MarkAgentApprovalsReportedInput,
|
|
85
95
|
MoveAgentThreadToCloudInput,
|
|
86
96
|
MoveAgentThreadToCloudResult,
|
|
87
97
|
ReclaimAgentRunInput,
|
|
98
|
+
RemoveAgentInboxItemInput,
|
|
88
99
|
RemoveAgentThreadParticipantInput,
|
|
89
100
|
RequestAgentApprovalInput,
|
|
90
101
|
RequestAgentApprovalResult,
|
|
@@ -99,14 +110,19 @@ export type {
|
|
|
99
110
|
SubagentRunRecord,
|
|
100
111
|
SubagentRunResult,
|
|
101
112
|
SubagentRunSpec,
|
|
113
|
+
TakeAgentInboxSteersInput,
|
|
114
|
+
TakeNextQueuedAgentInboxInput,
|
|
102
115
|
TransitionAgentThreadSandboxInput,
|
|
116
|
+
UpdateAgentInboxItemInput,
|
|
103
117
|
} from "./types"
|
|
104
118
|
export {
|
|
105
119
|
AGENT_APPROVAL_MODES,
|
|
106
120
|
AGENT_APPROVAL_STATUSES,
|
|
107
121
|
AGENT_HOLDING_APPROVAL_MODES,
|
|
122
|
+
AGENT_INBOX_MODES,
|
|
108
123
|
AGENT_RUN_DIAGNOSTIC_CODES,
|
|
109
124
|
AGENT_RUN_FAILURE_CODES,
|
|
110
125
|
AGENT_RUN_FINISH_REASONS,
|
|
126
|
+
AGENT_THREAD_INBOX_MAX_ITEMS,
|
|
111
127
|
coerceAgentRunFinishReason,
|
|
112
128
|
} from "./types"
|