@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
|
@@ -21,9 +21,13 @@ import {
|
|
|
21
21
|
turnPausesOnHeldCalls2,
|
|
22
22
|
resolveAgentRunExecutionScope2,
|
|
23
23
|
requestAgentRunCancel2,
|
|
24
|
+
cancelQueuedRun,
|
|
24
25
|
listSubagentThreadRuns2,
|
|
25
|
-
subagentSandboxFiles2
|
|
26
|
-
|
|
26
|
+
subagentSandboxFiles2,
|
|
27
|
+
startQueuedAgentTurn2,
|
|
28
|
+
turnAnsweredEveryMessage,
|
|
29
|
+
isBoundSixb
|
|
30
|
+
} from "./chunk-z1njfqqs.js";
|
|
27
31
|
import {
|
|
28
32
|
createSixbError2,
|
|
29
33
|
captureSixbFailure2,
|
|
@@ -31,13 +35,16 @@ import {
|
|
|
31
35
|
} from "./chunk-mvz89age.js";
|
|
32
36
|
import {
|
|
33
37
|
principalsEqual2
|
|
34
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-xcrnrpfh.js";
|
|
39
|
+
import {
|
|
40
|
+
createPrincipalRuntimeAuthorization
|
|
41
|
+
} from "./chunk-paxabbqd.js";
|
|
35
42
|
import {
|
|
36
43
|
resolveAgentPropertyClearance2,
|
|
37
44
|
resolveAgentExecutionAuthorization2,
|
|
38
45
|
userCanRunAgent2,
|
|
39
46
|
resolveInheritedAgentExecutionAuthorization2
|
|
40
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-s5pj68fa.js";
|
|
41
48
|
import {
|
|
42
49
|
indexModelBindings,
|
|
43
50
|
WebSearchModelResponseError2,
|
|
@@ -52,17 +59,18 @@ import {
|
|
|
52
59
|
createSubagentThreadId2,
|
|
53
60
|
createSubagentExecutionId2,
|
|
54
61
|
createAgentRunExecutionToken2
|
|
55
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-ey1p8w68.js";
|
|
56
63
|
import {
|
|
57
64
|
ARTIFACT_LIMITS2
|
|
58
65
|
} from "./chunk-9vsc919v.js";
|
|
66
|
+
import {
|
|
67
|
+
ArtifactRequestError2
|
|
68
|
+
} from "./chunk-vs2s3p8n.js";
|
|
59
69
|
import {
|
|
60
70
|
conversationThreadId2,
|
|
61
71
|
announceArtifactUpdates,
|
|
62
72
|
firstArtifactDocument,
|
|
63
73
|
withMergedWrite,
|
|
64
|
-
missingBoardPreviews2,
|
|
65
|
-
storeBoardPreviews2,
|
|
66
74
|
prepareArtifactVersion2,
|
|
67
75
|
storeArtifactVersion2,
|
|
68
76
|
artifactVersionWarnings2,
|
|
@@ -70,13 +78,7 @@ import {
|
|
|
70
78
|
artifactTransactionRules,
|
|
71
79
|
artifactQueryChecker2,
|
|
72
80
|
artifactPreviewRequester
|
|
73
|
-
} from "./chunk-
|
|
74
|
-
import {
|
|
75
|
-
BOARD_PREVIEW_JOB2
|
|
76
|
-
} from "./chunk-a6fjkcne.js";
|
|
77
|
-
import {
|
|
78
|
-
ArtifactRequestError2
|
|
79
|
-
} from "./chunk-qds484t8.js";
|
|
81
|
+
} from "./chunk-m3qx2pns.js";
|
|
80
82
|
import {
|
|
81
83
|
resolveLoggingService2
|
|
82
84
|
} from "./chunk-1vg43g9q.js";
|
|
@@ -88,16 +90,16 @@ import {
|
|
|
88
90
|
agentRunFinishedEvent2,
|
|
89
91
|
agentRunStreamEventBase2,
|
|
90
92
|
agentRunStreamIdempotencyKey2
|
|
91
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-k3jh8gsg.js";
|
|
92
94
|
import {
|
|
93
95
|
ModelUsageRecordingError2,
|
|
94
96
|
createAiModelCallLimitController2,
|
|
95
97
|
AiModelCallRecorder2
|
|
96
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-1yh6jgtz.js";
|
|
97
99
|
import {
|
|
98
100
|
appendArtifactLive2,
|
|
99
101
|
changedBoards
|
|
100
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-zxhym8tr.js";
|
|
101
103
|
import {
|
|
102
104
|
renderOntologyDocs2
|
|
103
105
|
} from "./chunk-bc3y6gff.js";
|
|
@@ -105,7 +107,7 @@ import {
|
|
|
105
107
|
SIXB_API_ROUTES2,
|
|
106
108
|
matchesPathPattern2,
|
|
107
109
|
normalizeRoutePath2
|
|
108
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-q8d9p0tb.js";
|
|
109
111
|
import {
|
|
110
112
|
assertValidSchema
|
|
111
113
|
} from "./chunk-rtdrm592.js";
|
|
@@ -117,7 +119,7 @@ import {
|
|
|
117
119
|
} from "./chunk-0kgrghqx.js";
|
|
118
120
|
import {
|
|
119
121
|
ensureExecutionRecord2
|
|
120
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-pc7kra3k.js";
|
|
121
123
|
import {
|
|
122
124
|
RuntimeError2
|
|
123
125
|
} from "./chunk-m4ehq95f.js";
|
|
@@ -135,7 +137,7 @@ import {
|
|
|
135
137
|
AGENT_TOKEN_RATE_SAMPLES2,
|
|
136
138
|
AGENT_TOKEN_RATE_MIN_BYTES_PER_TOKEN2,
|
|
137
139
|
AGENT_TOKEN_RATE_MAX_BYTES_PER_TOKEN
|
|
138
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-nxysqbt0.js";
|
|
139
141
|
import {
|
|
140
142
|
openFileRef2
|
|
141
143
|
} from "./chunk-a3faa34j.js";
|
|
@@ -169,7 +171,7 @@ function escapeAttribute(value) {
|
|
|
169
171
|
function approvalOutcomeInstruction(part) {
|
|
170
172
|
const call = describeCall(part.call);
|
|
171
173
|
const text = approvalOutcomeText(part, call);
|
|
172
|
-
const body = part.caller === undefined ? text : `Your sub-agent '${part.caller.key}' made this request. ${text} ${part.caller.continues ? "It continues with this outcome, and
|
|
174
|
+
const body = part.caller === undefined ? text : `Your sub-agent '${part.caller.key}' made this request. ${text} ${part.caller.continues ? "It continues with this outcome, and wait with its key returns its answer." : "It does not continue: wait with its key returns how it ended, and you can spawn it again with a new key if its work is still needed."}`;
|
|
173
175
|
return `<sixb_approval id="${part.approvalId}" status="${part.status}">${body}</sixb_approval>`;
|
|
174
176
|
}
|
|
175
177
|
function approvalOutcomeText(part, call) {
|
|
@@ -767,17 +769,24 @@ function invalidRule(field, value) {
|
|
|
767
769
|
var AGENT_TOOL_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]{0,63}$/;
|
|
768
770
|
var AGENT_RESERVED_TOOL_NAMES2 = [
|
|
769
771
|
"bash",
|
|
772
|
+
"wait",
|
|
773
|
+
"stop",
|
|
770
774
|
"bash_output",
|
|
771
775
|
"bash_stop",
|
|
772
776
|
"read",
|
|
777
|
+
"edit",
|
|
778
|
+
"write",
|
|
779
|
+
"glob",
|
|
780
|
+
"grep",
|
|
773
781
|
"view_file",
|
|
774
782
|
"spawn_agent",
|
|
775
|
-
"wait_agent",
|
|
776
783
|
"message_agent",
|
|
784
|
+
"wait_agent",
|
|
785
|
+
"ask",
|
|
777
786
|
"ask_parent",
|
|
778
787
|
"publish_artifact",
|
|
779
|
-
"update_artifact",
|
|
780
788
|
"open_artifact",
|
|
789
|
+
"update_artifact",
|
|
781
790
|
"publish_artifact_version",
|
|
782
791
|
...AGENT_WEB_TOOL_NAMES
|
|
783
792
|
];
|
|
@@ -1573,7 +1582,7 @@ async function readAgentRunContext(host, run) {
|
|
|
1573
1582
|
});
|
|
1574
1583
|
return run.kind === "conversation" ? readTurnContext(host, run, execution) : readChildContext(host, run, execution);
|
|
1575
1584
|
}
|
|
1576
|
-
async function
|
|
1585
|
+
async function readAgentTurnHistory2(host, threadId) {
|
|
1577
1586
|
const { checkpoint, messages } = await readRetainedHistory(host, threadId);
|
|
1578
1587
|
const [sent, usageAnchor] = await Promise.all([
|
|
1579
1588
|
readSentSettings(host, threadId, messages),
|
|
@@ -1603,7 +1612,7 @@ async function readTurnContext(host, run, execution) {
|
|
|
1603
1612
|
const [thread, participants, history] = await Promise.all([
|
|
1604
1613
|
host.storage.agents.threads.getById({ projectId, id: run.threadId }),
|
|
1605
1614
|
host.storage.agents.threads.listParticipants({ projectId, threadIds: [run.threadId] }),
|
|
1606
|
-
|
|
1615
|
+
readAgentTurnHistory2(host, run.threadId)
|
|
1607
1616
|
]);
|
|
1608
1617
|
const readers = await readReaders(host, participants);
|
|
1609
1618
|
const named = [
|
|
@@ -1628,7 +1637,7 @@ async function readChildContext(host, run, execution) {
|
|
|
1628
1637
|
const [parent, thread, history, runs] = await Promise.all([
|
|
1629
1638
|
agents.runs.getById({ projectId, id: run.parentRunId }),
|
|
1630
1639
|
agents.threads.getById({ projectId, id: run.threadId }),
|
|
1631
|
-
|
|
1640
|
+
readAgentTurnHistory2(host, run.threadId),
|
|
1632
1641
|
listSubagentThreadRuns2(agents, { projectId, threadId: run.threadId })
|
|
1633
1642
|
]);
|
|
1634
1643
|
const [conversation, task] = await Promise.all([
|
|
@@ -1693,6 +1702,13 @@ async function readSentSettings(host, threadId, messages) {
|
|
|
1693
1702
|
const retained = new Set(userMessages.map((message) => message.id));
|
|
1694
1703
|
const zones = {};
|
|
1695
1704
|
const locales = {};
|
|
1705
|
+
for (const message of userMessages) {
|
|
1706
|
+
const metadata = isPlainRecord(message.metadata) ? message.metadata : undefined;
|
|
1707
|
+
if (typeof metadata?.timeZone === "string")
|
|
1708
|
+
zones[message.id] = metadata.timeZone;
|
|
1709
|
+
if (typeof metadata?.locale === "string")
|
|
1710
|
+
locales[message.id] = metadata.locale;
|
|
1711
|
+
}
|
|
1696
1712
|
for (const run of runs) {
|
|
1697
1713
|
if (run.kind !== "conversation" || !retained.has(run.triggerMessageId))
|
|
1698
1714
|
continue;
|
|
@@ -1859,8 +1875,176 @@ async function afterAgentRunFinished2(host, run) {
|
|
|
1859
1875
|
return;
|
|
1860
1876
|
const ended = run.finishReason === "interrupted" ? "was interrupted" : run.status === "succeeded" ? "has finished" : `was ${run.status}`;
|
|
1861
1877
|
await stopActiveChildren(host, run.id, `The parent Agent run ${ended}.`);
|
|
1862
|
-
|
|
1878
|
+
const inbox = await readInbox(host, run);
|
|
1879
|
+
if (inbox?.claimed)
|
|
1880
|
+
await releaseInboxClaims(host, run.id);
|
|
1881
|
+
if (isAwaitingApprovalRun2(run)) {
|
|
1882
|
+
await resumeDecidedTurn(host, run);
|
|
1883
|
+
return;
|
|
1884
|
+
}
|
|
1885
|
+
if (!inbox || inbox.waiting.length === 0)
|
|
1863
1886
|
return;
|
|
1887
|
+
await startNextQueuedMessage(host, run, inbox.waiting);
|
|
1888
|
+
}
|
|
1889
|
+
var INBOX_REPAIR_PAGE_SIZE = 100;
|
|
1890
|
+
var INBOX_REPAIR_GRACE_MS = 30000;
|
|
1891
|
+
async function repairAgentInboxes2(host, input = {}) {
|
|
1892
|
+
if (typeof host.storage.agents.inbox?.listWaitingThreads !== "function")
|
|
1893
|
+
return;
|
|
1894
|
+
const createdBefore = new Date((input.now ?? new Date).getTime() - INBOX_REPAIR_GRACE_MS);
|
|
1895
|
+
let afterThreadId;
|
|
1896
|
+
for (;; ) {
|
|
1897
|
+
const threadIds = await host.storage.agents.inbox.listWaitingThreads({
|
|
1898
|
+
projectId: host.projectId,
|
|
1899
|
+
createdBefore,
|
|
1900
|
+
limit: INBOX_REPAIR_PAGE_SIZE,
|
|
1901
|
+
...afterThreadId === undefined ? {} : { afterThreadId }
|
|
1902
|
+
});
|
|
1903
|
+
for (const threadId of threadIds) {
|
|
1904
|
+
try {
|
|
1905
|
+
await repairThreadInbox(host, threadId);
|
|
1906
|
+
} catch (error) {
|
|
1907
|
+
console.error(`[Sixb] Could not repair the inbox of Agent thread '${threadId}'; retrying.`, error);
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
afterThreadId = threadIds.at(-1);
|
|
1911
|
+
if (afterThreadId === undefined || threadIds.length < INBOX_REPAIR_PAGE_SIZE)
|
|
1912
|
+
return;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
async function repairThreadInbox(host, threadId) {
|
|
1916
|
+
const { runs } = await host.storage.agents.runs.list({
|
|
1917
|
+
projectId: host.projectId,
|
|
1918
|
+
threadId,
|
|
1919
|
+
kinds: ["conversation"],
|
|
1920
|
+
order: "desc",
|
|
1921
|
+
limit: 1
|
|
1922
|
+
});
|
|
1923
|
+
const last = runs[0];
|
|
1924
|
+
if (!last || last.status === "queued" || last.status === "running")
|
|
1925
|
+
return;
|
|
1926
|
+
const items = await host.storage.agents.inbox.list({ projectId: host.projectId, threadId });
|
|
1927
|
+
const holders = new Set(items.flatMap((item) => item.claimedBy ? [item.claimedBy.runId] : []));
|
|
1928
|
+
for (const runId of holders)
|
|
1929
|
+
await releaseInboxClaims(host, runId);
|
|
1930
|
+
if (isAwaitingApprovalRun2(last))
|
|
1931
|
+
return;
|
|
1932
|
+
await startNextQueuedMessage(host, last, items);
|
|
1933
|
+
}
|
|
1934
|
+
async function readInbox(host, run) {
|
|
1935
|
+
const inbox = host.storage.agents.inbox;
|
|
1936
|
+
if (typeof inbox?.list !== "function")
|
|
1937
|
+
return null;
|
|
1938
|
+
try {
|
|
1939
|
+
const items = await inbox.list({
|
|
1940
|
+
projectId: host.projectId,
|
|
1941
|
+
threadId: run.threadId,
|
|
1942
|
+
includeClaimed: true
|
|
1943
|
+
});
|
|
1944
|
+
const claimed = items.some((item) => item.claimedBy?.runId === run.id);
|
|
1945
|
+
return {
|
|
1946
|
+
claimed,
|
|
1947
|
+
waiting: items.filter((item) => item.claimedBy === undefined || item.claimedBy.runId === run.id)
|
|
1948
|
+
};
|
|
1949
|
+
} catch (error) {
|
|
1950
|
+
console.error(`[Sixb] Could not read the inbox of Agent run '${run.id}'; repair retries it.`, error);
|
|
1951
|
+
return null;
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
async function startNextQueuedMessage(host, run, waiting) {
|
|
1955
|
+
try {
|
|
1956
|
+
const execution = await host.storage.executions.getById({
|
|
1957
|
+
projectId: host.projectId,
|
|
1958
|
+
id: run.executionId
|
|
1959
|
+
});
|
|
1960
|
+
const requester = execution?.requestedBy;
|
|
1961
|
+
if (!requester)
|
|
1962
|
+
return;
|
|
1963
|
+
const onlyImmediate = !await turnAnsweredEveryMessage(host.storage.agents, run);
|
|
1964
|
+
const startable = waiting.filter((item) => !onlyImmediate || item.immediate);
|
|
1965
|
+
for (const next of nextOfEachAuthor(startable, requester)) {
|
|
1966
|
+
const sender = await boundSender(host, next);
|
|
1967
|
+
if (!sender)
|
|
1968
|
+
continue;
|
|
1969
|
+
const started = await startQueuedAgentTurn2(sender, run.id, { onlyImmediate });
|
|
1970
|
+
if (started.status === "started")
|
|
1971
|
+
return;
|
|
1972
|
+
}
|
|
1973
|
+
} catch (error) {
|
|
1974
|
+
console.error(`[Sixb] Could not start what was queued after Agent run '${run.id}'; it waits in the thread.`, error);
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
function nextOfEachAuthor(items, requester) {
|
|
1978
|
+
const byAuthor = [];
|
|
1979
|
+
for (const item of [...items].sort((left, right) => left.seq - right.seq)) {
|
|
1980
|
+
const own = byAuthor.find((each) => principalsEqual2(each[0].authorPrincipal, item.authorPrincipal));
|
|
1981
|
+
if (own)
|
|
1982
|
+
own.push(item);
|
|
1983
|
+
else
|
|
1984
|
+
byAuthor.push([item]);
|
|
1985
|
+
}
|
|
1986
|
+
const order = (each) => principalsEqual2(each[0].authorPrincipal, requester) ? 0 : 1;
|
|
1987
|
+
return byAuthor.sort((left, right) => order(left) - order(right)).map((own) => [...own].sort((left, right) => priority(left) - priority(right))[0]);
|
|
1988
|
+
}
|
|
1989
|
+
function priority(item) {
|
|
1990
|
+
if (item.immediate)
|
|
1991
|
+
return 0;
|
|
1992
|
+
return item.mode === "steer" ? 1 : 2;
|
|
1993
|
+
}
|
|
1994
|
+
async function boundSender(host, item) {
|
|
1995
|
+
if (item.executionId === undefined)
|
|
1996
|
+
return null;
|
|
1997
|
+
const request = await host.storage.executions.getById({
|
|
1998
|
+
projectId: host.projectId,
|
|
1999
|
+
id: item.executionId
|
|
2000
|
+
});
|
|
2001
|
+
const ref = request?.authorizationRef;
|
|
2002
|
+
if (request?.executor.type !== "request" || ref?.type !== "principal")
|
|
2003
|
+
return null;
|
|
2004
|
+
let authorization;
|
|
2005
|
+
try {
|
|
2006
|
+
authorization = await resolveInheritedAgentExecutionAuthorization2({
|
|
2007
|
+
auth: host.storage.auth,
|
|
2008
|
+
projectId: host.projectId,
|
|
2009
|
+
authorizationRef: ref,
|
|
2010
|
+
security: host.security
|
|
2011
|
+
});
|
|
2012
|
+
} catch (error) {
|
|
2013
|
+
if (isSixbError2(error) && error.code === "agent.execution_failed")
|
|
2014
|
+
return null;
|
|
2015
|
+
throw error;
|
|
2016
|
+
}
|
|
2017
|
+
if (authorization.type !== "principal")
|
|
2018
|
+
return null;
|
|
2019
|
+
const execution = Object.freeze({
|
|
2020
|
+
id: request.id,
|
|
2021
|
+
projectId: request.projectId,
|
|
2022
|
+
...request.requestedBy === undefined ? {} : { requestedBy: request.requestedBy },
|
|
2023
|
+
executor: request.executor,
|
|
2024
|
+
source: request.source,
|
|
2025
|
+
correlationId: request.correlationId
|
|
2026
|
+
});
|
|
2027
|
+
const sixb = host.sdk.withScope({
|
|
2028
|
+
execution,
|
|
2029
|
+
authorization: createPrincipalRuntimeAuthorization({
|
|
2030
|
+
execution,
|
|
2031
|
+
context: authorization.context,
|
|
2032
|
+
...ref.credential === undefined ? {} : { credential: ref.credential }
|
|
2033
|
+
})
|
|
2034
|
+
});
|
|
2035
|
+
if (!isBoundSixb(sixb)) {
|
|
2036
|
+
throw new Error("[Sixb] Agent session host returned an invalid bound SDK.");
|
|
2037
|
+
}
|
|
2038
|
+
return sixb;
|
|
2039
|
+
}
|
|
2040
|
+
async function releaseInboxClaims(host, runId) {
|
|
2041
|
+
try {
|
|
2042
|
+
await host.storage.agents.inbox.releaseClaimed({ projectId: host.projectId, runId });
|
|
2043
|
+
} catch (error) {
|
|
2044
|
+
console.error(`[Sixb] Could not release the inbox claims of Agent run '${runId}'; repair retries.`, error);
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
async function resumeDecidedTurn(host, run) {
|
|
1864
2048
|
try {
|
|
1865
2049
|
const scope = await resolveAgentRunExecutionScope2({ id: host.projectId, storage: host.storage, definitions: { security: host.security } }, { runId: run.id, executionId: run.executionId, authority: { type: "inherited" } });
|
|
1866
2050
|
await resumeDecidedAgentTurn2(bindDurableAgentExecution2(host.sdk, scope), run.id);
|
|
@@ -2064,7 +2248,7 @@ function agentRunArtifacts2(host, run, executionToken, sdk) {
|
|
|
2064
2248
|
await announceArtifactUpdates(host.domainEvents, [stored.version]);
|
|
2065
2249
|
if (kind === "canvas")
|
|
2066
2250
|
await announceAgentBoards(host, turnRunId, before, stored.version);
|
|
2067
|
-
await artifactPreviewRequester(reader)(stored.version
|
|
2251
|
+
await artifactPreviewRequester(reader)(stored.version);
|
|
2068
2252
|
return {
|
|
2069
2253
|
...stored,
|
|
2070
2254
|
warnings: await artifactVersionWarnings2(context, prepared, stored),
|
|
@@ -2073,28 +2257,8 @@ function agentRunArtifacts2(host, run, executionToken, sdk) {
|
|
|
2073
2257
|
},
|
|
2074
2258
|
async turnWrites() {
|
|
2075
2259
|
return requireArtifacts(storage).listTurnWrites({ projectId, turnRunId });
|
|
2076
|
-
},
|
|
2077
|
-
async storePreviews({ previews, ...at }) {
|
|
2078
|
-
const [{ blobs }, version] = await Promise.all([sdk(), publishedVersion(at)]);
|
|
2079
|
-
return storeBoardPreviews2({ storage: requireArtifacts(storage), blobStorage: blobs }, version, previews);
|
|
2080
|
-
},
|
|
2081
|
-
async missingPreviews(at) {
|
|
2082
|
-
const missing = await missingBoardPreviews2(requireArtifacts(storage), await publishedVersion(at));
|
|
2083
|
-
return missing.map(({ board, themes }) => ({ board: board.id, themes }));
|
|
2084
2260
|
}
|
|
2085
2261
|
};
|
|
2086
|
-
async function publishedVersion(at) {
|
|
2087
|
-
const version = await requireArtifacts(storage).getVersion({
|
|
2088
|
-
projectId,
|
|
2089
|
-
artifactId: at.artifactId,
|
|
2090
|
-
version: at.version
|
|
2091
|
-
});
|
|
2092
|
-
const written = at.updatedAt.getTime();
|
|
2093
|
-
if (!version || version.origin?.runId !== run.id || version.updatedAt.getTime() !== written) {
|
|
2094
|
-
throw new ArtifactRequestError2("not_allowed", `[Sixb] Version ${at.version} of artifact '${at.artifactId}' does not hold what this run wrote at ${at.updatedAt.toISOString()}.`);
|
|
2095
|
-
}
|
|
2096
|
-
return version;
|
|
2097
|
-
}
|
|
2098
2262
|
}
|
|
2099
2263
|
async function latestVersionOf(storage, projectId, artifactId) {
|
|
2100
2264
|
const artifact = await storage.get({ projectId, id: artifactId });
|
|
@@ -2177,6 +2341,7 @@ var NOOP_STREAM_SINK2 = {
|
|
|
2177
2341
|
async publishCompactionCompleted() {},
|
|
2178
2342
|
async publishCompactionFailed() {},
|
|
2179
2343
|
async publishUiChunk() {},
|
|
2344
|
+
async publishInboxRead() {},
|
|
2180
2345
|
async publishMessageFinalized() {},
|
|
2181
2346
|
async publishRunFinished() {}
|
|
2182
2347
|
};
|
|
@@ -2190,6 +2355,7 @@ function isolateStreamSink2(sink) {
|
|
|
2190
2355
|
publishCompactionCompleted: (input) => isolateStreamSinkCall(input.run.id, "compaction completed", () => sink.publishCompactionCompleted(input)),
|
|
2191
2356
|
publishCompactionFailed: (input) => isolateStreamSinkCall(input.run.id, "compaction failed", () => sink.publishCompactionFailed(input)),
|
|
2192
2357
|
publishUiChunk: (input) => isolateStreamSinkCall(input.run.id, "ui chunk", () => sink.publishUiChunk(input)),
|
|
2358
|
+
publishInboxRead: (input) => isolateStreamSinkCall(input.run.id, "inbox read", () => sink.publishInboxRead(input)),
|
|
2193
2359
|
publishMessageFinalized: (input) => isolateStreamSinkCall(input.run.id, "message finalized", () => sink.publishMessageFinalized(input)),
|
|
2194
2360
|
publishRunFinished: (run) => isolateStreamSinkCall(run.id, "run finished", () => sink.publishRunFinished(run))
|
|
2195
2361
|
};
|
|
@@ -2204,6 +2370,7 @@ function withAgentActivityStream2(sink, broker) {
|
|
|
2204
2370
|
publishCompactionCompleted: (input) => sink.publishCompactionCompleted(input),
|
|
2205
2371
|
publishCompactionFailed: (input) => sink.publishCompactionFailed(input),
|
|
2206
2372
|
publishUiChunk: (input) => sink.publishUiChunk(input),
|
|
2373
|
+
publishInboxRead: (input) => sink.publishInboxRead(input),
|
|
2207
2374
|
publishMessageFinalized: (input) => sink.publishMessageFinalized(input),
|
|
2208
2375
|
publishRunFinished: (run) => publishLifecycle([
|
|
2209
2376
|
sink.publishRunFinished(run),
|
|
@@ -2276,6 +2443,13 @@ class BrokerStreamSink {
|
|
|
2276
2443
|
chunk
|
|
2277
2444
|
}, { prevalidated: true });
|
|
2278
2445
|
}
|
|
2446
|
+
async publishInboxRead(input) {
|
|
2447
|
+
await this.publish({
|
|
2448
|
+
...agentRunStreamEventBase2(input.run),
|
|
2449
|
+
type: "agent.inbox.read",
|
|
2450
|
+
messages: input.messages
|
|
2451
|
+
});
|
|
2452
|
+
}
|
|
2279
2453
|
async publishMessageFinalized(input) {
|
|
2280
2454
|
await this.publish({
|
|
2281
2455
|
...agentRunStreamEventBase2(input.run),
|
|
@@ -2867,6 +3041,23 @@ function agentRunChildren(host, run, executionToken, scope, delegable) {
|
|
|
2867
3041
|
});
|
|
2868
3042
|
}));
|
|
2869
3043
|
},
|
|
3044
|
+
async cancel(runId) {
|
|
3045
|
+
const child = await get(runId);
|
|
3046
|
+
if (child?.kind !== "subagent" || child.parentRunId !== run.id) {
|
|
3047
|
+
throw new AgentRunRefusedError2(`[Sixb] Agent run '${run.id}' stops only its own children, not '${runId}'.`);
|
|
3048
|
+
}
|
|
3049
|
+
if (child.status === "queued") {
|
|
3050
|
+
const queued = await cancelQueuedRun(host, agents, child);
|
|
3051
|
+
if (queued.cancelled)
|
|
3052
|
+
return requireSubagent(queued.run);
|
|
3053
|
+
if (queued.run?.status !== "running")
|
|
3054
|
+
return requireSubagent(queued.run ?? child);
|
|
3055
|
+
} else if (child.status !== "running") {
|
|
3056
|
+
return child;
|
|
3057
|
+
}
|
|
3058
|
+
await requestAgentRunCancel2({ projectId, broker: host.broker, storage: agents }, child.id);
|
|
3059
|
+
return child;
|
|
3060
|
+
},
|
|
2870
3061
|
async clearAttempt({ threadId, runId }) {
|
|
2871
3062
|
const attempt = await get(runId);
|
|
2872
3063
|
if (attempt?.kind !== "subagent" || attempt.threadId !== threadId || attempt.status === "queued" || attempt.status === "running") {
|
|
@@ -2881,6 +3072,11 @@ function agentRunChildren(host, run, executionToken, scope, delegable) {
|
|
|
2881
3072
|
}
|
|
2882
3073
|
};
|
|
2883
3074
|
}
|
|
3075
|
+
function requireSubagent(run) {
|
|
3076
|
+
if (run.kind !== "subagent")
|
|
3077
|
+
throw new Error(`[Sixb] Agent run '${run.id}' changed kind.`);
|
|
3078
|
+
return run;
|
|
3079
|
+
}
|
|
2884
3080
|
function assertDelegable(run, child, delegable) {
|
|
2885
3081
|
const { model, toolNames } = child.spec;
|
|
2886
3082
|
const unknownTool = toolNames.find((name) => !delegable.tools.includes(name));
|
|
@@ -2933,6 +3129,19 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
2933
3129
|
return bound;
|
|
2934
3130
|
};
|
|
2935
3131
|
const runSdk = async () => (await bind()).sixb;
|
|
3132
|
+
let requestedBy;
|
|
3133
|
+
const requester = () => {
|
|
3134
|
+
requestedBy ??= host.storage.executions.getById({ projectId: host.projectId, id: run.executionId }).then((execution) => {
|
|
3135
|
+
if (!execution) {
|
|
3136
|
+
throw new Error(`[Sixb] Agent run '${run.id}' references missing execution '${run.executionId}'.`);
|
|
3137
|
+
}
|
|
3138
|
+
return execution.requestedBy;
|
|
3139
|
+
}).catch((error) => {
|
|
3140
|
+
requestedBy = undefined;
|
|
3141
|
+
throw error;
|
|
3142
|
+
});
|
|
3143
|
+
return requestedBy;
|
|
3144
|
+
};
|
|
2936
3145
|
const cancel = await watchAgentRunCancel2(host, [run.id, ...cancelWith]);
|
|
2937
3146
|
const recordedCancel = new AbortController;
|
|
2938
3147
|
const readCancel = (current) => {
|
|
@@ -3016,6 +3225,28 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
3016
3225
|
holdsRun: () => host.storage.agents.approvals.holdsRun({ projectId: host.projectId, runId: run.id }),
|
|
3017
3226
|
pausesAfterStep: () => turnPausesOnHeldCalls2(host.storage.agents, run)
|
|
3018
3227
|
},
|
|
3228
|
+
inbox: {
|
|
3229
|
+
async takeSteers({ stepIndex, afterAnswer }) {
|
|
3230
|
+
if (run.kind !== "conversation")
|
|
3231
|
+
return [];
|
|
3232
|
+
const authorPrincipal = await requester();
|
|
3233
|
+
if (!authorPrincipal)
|
|
3234
|
+
return [];
|
|
3235
|
+
const items = await fenced(run.id, () => agents.inbox.takeSteers({
|
|
3236
|
+
projectId: host.projectId,
|
|
3237
|
+
threadId: run.threadId,
|
|
3238
|
+
runId: run.id,
|
|
3239
|
+
executionToken,
|
|
3240
|
+
stepIndex,
|
|
3241
|
+
...afterAnswer ? { afterAnswer: true } : {},
|
|
3242
|
+
authorPrincipal
|
|
3243
|
+
}));
|
|
3244
|
+
if (items.length > 0) {
|
|
3245
|
+
await host.events.publishInboxRead({ run, messages: items.map(inboxReadMessage) });
|
|
3246
|
+
}
|
|
3247
|
+
return items;
|
|
3248
|
+
}
|
|
3249
|
+
},
|
|
3019
3250
|
models: {
|
|
3020
3251
|
async language(ref, options) {
|
|
3021
3252
|
const key = `${ref.provider}/${ref.modelId}`;
|
|
@@ -3058,7 +3289,7 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
3058
3289
|
}
|
|
3059
3290
|
},
|
|
3060
3291
|
async finish(outcome, messages) {
|
|
3061
|
-
const finished = await finishWithRetries(host.storage, { ...outcome, ...fence }, messages ?? []);
|
|
3292
|
+
const finished = await finishWithRetries(host.storage, run, { ...outcome, ...fence }, messages ?? []);
|
|
3062
3293
|
await host.afterFinish?.(finished).catch((error) => {
|
|
3063
3294
|
console.error(`[Sixb] What follows agent run '${run.id}' failed; repair retries it.`, error);
|
|
3064
3295
|
});
|
|
@@ -3137,13 +3368,17 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
3137
3368
|
createdByRunId: run.id,
|
|
3138
3369
|
executionToken
|
|
3139
3370
|
}));
|
|
3140
|
-
return
|
|
3371
|
+
return readAgentTurnHistory2(host, input.threadId);
|
|
3141
3372
|
},
|
|
3142
3373
|
workspace: {
|
|
3143
3374
|
async transition(input) {
|
|
3144
3375
|
if (input.id !== run.threadId) {
|
|
3145
3376
|
throw new AgentRunRefusedError2(`[Sixb] Agent run '${run.id}' moves only its own thread's workspace, not '${input.id}'.`);
|
|
3146
3377
|
}
|
|
3378
|
+
const { action } = input;
|
|
3379
|
+
if (action !== "acquire" && action !== "replace" && action !== "settle") {
|
|
3380
|
+
throw new AgentRunRefusedError2(`[Sixb] Agent run '${run.id}' cannot ${action} its thread's workspace: only its owner recovers it.`);
|
|
3381
|
+
}
|
|
3147
3382
|
return fenced(run.id, () => host.storage.agents.threads.transitionSandbox({
|
|
3148
3383
|
...input,
|
|
3149
3384
|
projectId: host.projectId,
|
|
@@ -3276,20 +3511,24 @@ function sameKind(run, claimed, while_) {
|
|
|
3276
3511
|
return claimed;
|
|
3277
3512
|
}
|
|
3278
3513
|
var FINISH_BACKOFF_MS = [50, 200, 600];
|
|
3279
|
-
async function finishWithRetries(storage, finish, messages) {
|
|
3514
|
+
async function finishWithRetries(storage, run, finish, messages) {
|
|
3280
3515
|
for (let attempt = 0;; attempt += 1) {
|
|
3281
3516
|
try {
|
|
3282
|
-
if (messages.length === 0)
|
|
3517
|
+
if (run.kind !== "conversation" && messages.length === 0) {
|
|
3283
3518
|
return await storage.agents.runs.finish(finish);
|
|
3519
|
+
}
|
|
3284
3520
|
return await storage.transaction(async (tx) => {
|
|
3285
3521
|
const agents = tx.agents;
|
|
3286
3522
|
if (!agents)
|
|
3287
3523
|
throw new Error("[Sixb] Agent storage is not configured.");
|
|
3288
|
-
|
|
3524
|
+
const resolved = run.kind === "conversation" ? await reconcileClaimedSteers(agents, run, finish.executionToken, messages) : messages;
|
|
3525
|
+
for (const message of resolved)
|
|
3289
3526
|
await agents.messages.append(message);
|
|
3290
3527
|
return agents.runs.finish(finish);
|
|
3291
3528
|
});
|
|
3292
3529
|
} catch (error) {
|
|
3530
|
+
if (error instanceof AgentRunRefusedError2)
|
|
3531
|
+
throw error;
|
|
3293
3532
|
if (isTerminalOrExecutionGone2(error))
|
|
3294
3533
|
throw new AgentExecutionLostError2(finish.id);
|
|
3295
3534
|
const delay = FINISH_BACKOFF_MS[attempt];
|
|
@@ -3299,6 +3538,50 @@ async function finishWithRetries(storage, finish, messages) {
|
|
|
3299
3538
|
}
|
|
3300
3539
|
}
|
|
3301
3540
|
}
|
|
3541
|
+
async function reconcileClaimedSteers(agents, run, executionToken, messages) {
|
|
3542
|
+
if (typeof agents.inbox?.consumeClaimed !== "function")
|
|
3543
|
+
return messages;
|
|
3544
|
+
const userIds = messages.filter((message) => message.role === "user").map((message) => message.id);
|
|
3545
|
+
const consumed = await agents.inbox.consumeClaimed({
|
|
3546
|
+
projectId: run.projectId,
|
|
3547
|
+
threadId: run.threadId,
|
|
3548
|
+
runId: run.id,
|
|
3549
|
+
executionToken,
|
|
3550
|
+
messageIds: userIds
|
|
3551
|
+
});
|
|
3552
|
+
const byMessageId = new Map(consumed.map((item) => [item.messageId, item]));
|
|
3553
|
+
return messages.map((message) => {
|
|
3554
|
+
if (message.role !== "user")
|
|
3555
|
+
return message;
|
|
3556
|
+
const claimed = byMessageId.get(message.id);
|
|
3557
|
+
if (!claimed) {
|
|
3558
|
+
throw new AgentRunRefusedError2(`[Sixb] Agent run '${run.id}' finishes only with user messages from its thread's inbox.`);
|
|
3559
|
+
}
|
|
3560
|
+
const metadata = claimed.timeZone || claimed.locale ? {
|
|
3561
|
+
...claimed.timeZone ? { timeZone: claimed.timeZone } : {},
|
|
3562
|
+
...claimed.locale ? { locale: claimed.locale } : {}
|
|
3563
|
+
} : undefined;
|
|
3564
|
+
return {
|
|
3565
|
+
id: claimed.messageId,
|
|
3566
|
+
projectId: claimed.projectId,
|
|
3567
|
+
threadId: claimed.threadId,
|
|
3568
|
+
runId: null,
|
|
3569
|
+
role: "user",
|
|
3570
|
+
parts: claimed.parts,
|
|
3571
|
+
authorPrincipal: claimed.authorPrincipal,
|
|
3572
|
+
createdAt: claimed.createdAt,
|
|
3573
|
+
...metadata ? { metadata } : {}
|
|
3574
|
+
};
|
|
3575
|
+
});
|
|
3576
|
+
}
|
|
3577
|
+
function inboxReadMessage(item) {
|
|
3578
|
+
return {
|
|
3579
|
+
id: item.messageId,
|
|
3580
|
+
authorPrincipal: item.authorPrincipal,
|
|
3581
|
+
parts: item.parts,
|
|
3582
|
+
createdAt: item.createdAt.toISOString()
|
|
3583
|
+
};
|
|
3584
|
+
}
|
|
3302
3585
|
|
|
3303
3586
|
// src/agents/run-liveness.ts
|
|
3304
3587
|
class AgentTurnInterruptedError2 extends Error {
|
|
@@ -3568,6 +3851,12 @@ function createHttpAgentRunSession2(input) {
|
|
|
3568
3851
|
holdsRun: () => call("heldCalls.holdsRun"),
|
|
3569
3852
|
pausesAfterStep: () => call("heldCalls.pausesAfterStep")
|
|
3570
3853
|
},
|
|
3854
|
+
inbox: {
|
|
3855
|
+
takeSteers: async (input) => {
|
|
3856
|
+
await sink.flush();
|
|
3857
|
+
return call("inbox.takeSteers", [input]);
|
|
3858
|
+
}
|
|
3859
|
+
},
|
|
3571
3860
|
children: {
|
|
3572
3861
|
get: (runId) => call("children.get", [runId]),
|
|
3573
3862
|
getMany: (runIds) => call("children.getMany", [runIds]),
|
|
@@ -3578,7 +3867,8 @@ function createHttpAgentRunSession2(input) {
|
|
|
3578
3867
|
awaitingApproval: (runIds) => call("children.awaitingApproval", [runIds]),
|
|
3579
3868
|
activeCount: () => call("children.activeCount"),
|
|
3580
3869
|
spawn: (draft) => call("children.spawn", [draft]),
|
|
3581
|
-
clearAttempt: (attempt) => call("children.clearAttempt", [attempt])
|
|
3870
|
+
clearAttempt: (attempt) => call("children.clearAttempt", [attempt]),
|
|
3871
|
+
cancel: (runId) => call("children.cancel", [runId])
|
|
3582
3872
|
},
|
|
3583
3873
|
async renewLease(leaseExpiresAt) {
|
|
3584
3874
|
try {
|
|
@@ -3620,9 +3910,7 @@ function createHttpAgentRunSession2(input) {
|
|
|
3620
3910
|
query: (...args) => call("artifacts.query", args),
|
|
3621
3911
|
updatable: (artifactId) => call("artifacts.updatable", [artifactId]),
|
|
3622
3912
|
publish: (publish) => call("artifacts.publish", [publish]),
|
|
3623
|
-
turnWrites: () => call("artifacts.turnWrites", [])
|
|
3624
|
-
storePreviews: (previews) => call("artifacts.storePreviews", [previews]),
|
|
3625
|
-
missingPreviews: (version) => call("artifacts.missingPreviews", [version])
|
|
3913
|
+
turnWrites: () => call("artifacts.turnWrites", [])
|
|
3626
3914
|
},
|
|
3627
3915
|
files: {
|
|
3628
3916
|
async put(file) {
|
|
@@ -3778,6 +4066,7 @@ function batchedEvents(deliver) {
|
|
|
3778
4066
|
publishCompactionCompleted: enqueue("publishCompactionCompleted"),
|
|
3779
4067
|
publishCompactionFailed: enqueue("publishCompactionFailed"),
|
|
3780
4068
|
publishUiChunk: enqueue("publishUiChunk"),
|
|
4069
|
+
publishInboxRead: async () => {},
|
|
3781
4070
|
publishMessageFinalized: enqueue("publishMessageFinalized"),
|
|
3782
4071
|
async publishRunFinished(record) {
|
|
3783
4072
|
await enqueue("publishRunFinished")(record);
|
|
@@ -3864,6 +4153,7 @@ var OPERATIONS = {
|
|
|
3864
4153
|
renewLease: (session, [leaseExpiresAt]) => renew(session, capLease(leaseExpiresAt)),
|
|
3865
4154
|
"heldCalls.holdsRun": (session) => session.heldCalls.holdsRun(),
|
|
3866
4155
|
"heldCalls.pausesAfterStep": (session) => session.heldCalls.pausesAfterStep(),
|
|
4156
|
+
"inbox.takeSteers": (session, [input]) => session.inbox.takeSteers(input),
|
|
3867
4157
|
"children.get": (session, [runId]) => session.children.get(runId),
|
|
3868
4158
|
"children.getMany": (session, [runIds]) => session.children.getMany(runIds),
|
|
3869
4159
|
"children.inConversation": (session, [input]) => session.children.inConversation(input),
|
|
@@ -3874,6 +4164,7 @@ var OPERATIONS = {
|
|
|
3874
4164
|
"children.activeCount": (session) => session.children.activeCount(),
|
|
3875
4165
|
"children.spawn": (session, [draft]) => session.children.spawn(draft),
|
|
3876
4166
|
"children.clearAttempt": (session, [input]) => session.children.clearAttempt(input),
|
|
4167
|
+
"children.cancel": (session, [runId]) => session.children.cancel(runId),
|
|
3877
4168
|
"threads.message": (session, [messageId]) => session.threads.message(messageId),
|
|
3878
4169
|
"threads.messages": (session, [input]) => session.threads.messages(input),
|
|
3879
4170
|
"artifacts.list": (session, [input]) => session.artifacts.list(input),
|
|
@@ -3884,8 +4175,6 @@ var OPERATIONS = {
|
|
|
3884
4175
|
"artifacts.updatable": (session, [artifactId]) => session.artifacts.updatable(artifactId),
|
|
3885
4176
|
"artifacts.publish": (session, [input]) => session.artifacts.publish(input),
|
|
3886
4177
|
"artifacts.turnWrites": (session) => session.artifacts.turnWrites(),
|
|
3887
|
-
"artifacts.storePreviews": (session, [input]) => session.artifacts.storePreviews(input),
|
|
3888
|
-
"artifacts.missingPreviews": (session, [input]) => session.artifacts.missingPreviews(input),
|
|
3889
4178
|
callTool: (session, [call, options], signal) => session.callTool(call, {
|
|
3890
4179
|
...options ?? {},
|
|
3891
4180
|
signal
|
|
@@ -4433,6 +4722,6 @@ function requireFinishedAt(record) {
|
|
|
4433
4722
|
}
|
|
4434
4723
|
return record.finishedAt;
|
|
4435
4724
|
}
|
|
4436
|
-
export { serializeAgentContextForModel2, isAgentToolResult2, toModelMessages2, agentMessageSteps2, attachmentKey2, toolResultAttachmentKey2, attachmentKeyMessageId2, findMessageAttachment2, listMessageAttachments2, resolveAgentWebOptions, assertNoProviderWebTools, webDomainPolicy2, bindAgentWebSearch2, AGENT_RESERVED_TOOL_NAMES2, isAgentToolDefinition2, validateAndNormalizeAgentToolInput2, toolsFromProjectConfig, defineAgentTool2, AGENT_INLINE_IMAGE_LIMITS2, AGENT_IMAGE_INPUT_TOKENS2, projectAgentThreadModelContext2, AGENT_CONTEXT_ESTIMATOR_VERSION2, shouldCompactAgentContext2, estimateAgentContextRequestTokens2, estimateAgentContextMessagesTokens2, agentContextSizeTokens2, measureAgentModelRequest2, measureModelRequest2, selectAgentContextCompactionBoundary2, measureAgentContextTokenRate2, calibrateAgentContextBytesPerToken2, learnedAgentContextBytesPerToken2, readAgentContextTokenRates2, measuringAgentContextTokenRates2, DEFAULT_AGENT_CONTEXT_WINDOW_TOKENS2, AGENT_CONTEXT_COMPACTED_SHARE2, AGENT_IDLE_COMPACTION_TOKENS2, agentOutputCapTokens2, resolveAgentContextBudget2, contextSummaryOutputTokens2, measureAgentStepRequest2, estimateAgentThreadRequest2, readAgentThreadContextUse2, agent2, afterAgentRunFinished2, stopAgentRunChild2, AgentExecutionLostError2, AgentRunRefusedError2, isTerminalOrExecutionGone2, agentRunArtifacts2, NOOP_STREAM_SINK2, createBrokerStreamSink2, isolateStreamSink2, withAgentActivityStream2, SANDBOX_CONTEXT_DIRECTORY2, AGENT_FILE_MAX_BYTES2, storeAgentToolFile2, agentToolFilePath2, agentToolOutputPath2, AGENT_TOOL_OUTPUTS_DIRECTORY2, isAgentToolOutputFile2, agentToolSpec2, runAgentTool2, threadToolAttachments2, UNATTENDED_AGENT_MAX_STEPS2, assertMaxSteps, readAgentRunPlan2, readAgentRunWebPlan2, listSandboxModels2, readAgentRunMemory2, renderAgentRunOntologyDocs2, readAgentRunDelegation2, claimAgentRun2, openAgentRunSession2, agentRunPeople2, watchAgentRunCancel2, AgentFinalizationError2, AgentTurnInterruptedError2, interruptedError2, agentRunLeaseLapsed2, endInterruptedAgentRun2, endLapsedAgentRuns2, encodeWireValue2, decodeWireValue2, encodeWireError2, createHttpAgentRunSession2, claimAgentRunOverHttp2, claimAgentRunChildOverHttp2, AGENT_API_ROUTES2, createAgentRunToken2, isAgentRunToken2, agentRunTokenRunId2, isValidAgentRunToken2, createAgentRunnerToken2, isAgentRunnerToken2, isAllowedAgentApiRequest2, findAgentApiRoute2, serveAgentRunSession2, claimAgentRunForRunner2, WorkflowResumeDispatchError2, claimWorkflowAgentNode2, enqueueWorkflowAgentNodeResume2 };
|
|
4725
|
+
export { serializeAgentContextForModel2, isAgentToolResult2, toModelMessages2, agentMessageSteps2, attachmentKey2, toolResultAttachmentKey2, attachmentKeyMessageId2, findMessageAttachment2, listMessageAttachments2, resolveAgentWebOptions, assertNoProviderWebTools, webDomainPolicy2, bindAgentWebSearch2, AGENT_RESERVED_TOOL_NAMES2, isAgentToolDefinition2, validateAndNormalizeAgentToolInput2, toolsFromProjectConfig, defineAgentTool2, AGENT_INLINE_IMAGE_LIMITS2, AGENT_IMAGE_INPUT_TOKENS2, projectAgentThreadModelContext2, AGENT_CONTEXT_ESTIMATOR_VERSION2, shouldCompactAgentContext2, estimateAgentContextRequestTokens2, estimateAgentContextMessagesTokens2, agentContextSizeTokens2, measureAgentModelRequest2, measureModelRequest2, selectAgentContextCompactionBoundary2, measureAgentContextTokenRate2, calibrateAgentContextBytesPerToken2, learnedAgentContextBytesPerToken2, readAgentContextTokenRates2, measuringAgentContextTokenRates2, DEFAULT_AGENT_CONTEXT_WINDOW_TOKENS2, AGENT_CONTEXT_COMPACTED_SHARE2, AGENT_IDLE_COMPACTION_TOKENS2, agentOutputCapTokens2, resolveAgentContextBudget2, contextSummaryOutputTokens2, measureAgentStepRequest2, readAgentTurnHistory2, estimateAgentThreadRequest2, readAgentThreadContextUse2, agent2, afterAgentRunFinished2, repairAgentInboxes2, stopAgentRunChild2, AgentExecutionLostError2, AgentRunRefusedError2, isTerminalOrExecutionGone2, agentRunArtifacts2, NOOP_STREAM_SINK2, createBrokerStreamSink2, isolateStreamSink2, withAgentActivityStream2, SANDBOX_CONTEXT_DIRECTORY2, AGENT_FILE_MAX_BYTES2, storeAgentToolFile2, agentToolFilePath2, agentToolOutputPath2, AGENT_TOOL_OUTPUTS_DIRECTORY2, isAgentToolOutputFile2, agentToolSpec2, runAgentTool2, threadToolAttachments2, UNATTENDED_AGENT_MAX_STEPS2, assertMaxSteps, readAgentRunPlan2, readAgentRunWebPlan2, listSandboxModels2, readAgentRunMemory2, renderAgentRunOntologyDocs2, readAgentRunDelegation2, claimAgentRun2, openAgentRunSession2, agentRunPeople2, watchAgentRunCancel2, AgentFinalizationError2, AgentTurnInterruptedError2, interruptedError2, agentRunLeaseLapsed2, endInterruptedAgentRun2, endLapsedAgentRuns2, encodeWireValue2, decodeWireValue2, encodeWireError2, createHttpAgentRunSession2, claimAgentRunOverHttp2, claimAgentRunChildOverHttp2, AGENT_API_ROUTES2, createAgentRunToken2, isAgentRunToken2, agentRunTokenRunId2, isValidAgentRunToken2, createAgentRunnerToken2, isAgentRunnerToken2, isAllowedAgentApiRequest2, findAgentApiRoute2, serveAgentRunSession2, claimAgentRunForRunner2, WorkflowResumeDispatchError2, claimWorkflowAgentNode2, enqueueWorkflowAgentNodeResume2 };
|
|
4437
4726
|
|
|
4438
|
-
//# debugId=
|
|
4727
|
+
//# debugId=5174D1DB86498E1264756E2164756E21
|