@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
package/src/agents/execution.ts
CHANGED
|
@@ -12,10 +12,12 @@ import type { SecurityDefinitionCatalog } from "../security"
|
|
|
12
12
|
import type {
|
|
13
13
|
AgentApprovalMode,
|
|
14
14
|
AgentApprovalRecord,
|
|
15
|
+
AgentInboxItemRecord,
|
|
15
16
|
AgentRunRecord,
|
|
16
17
|
AgentStorage,
|
|
17
18
|
AgentThreadComputer,
|
|
18
19
|
AgentThreadRecord,
|
|
20
|
+
AgentThreadSandboxState,
|
|
19
21
|
ConversationAgentRunRecord,
|
|
20
22
|
ListAgentApprovalsInput,
|
|
21
23
|
ListAgentApprovalsResult,
|
|
@@ -64,14 +66,22 @@ import {
|
|
|
64
66
|
addAgentThreadParticipants,
|
|
65
67
|
removeAgentThreadParticipant,
|
|
66
68
|
} from "./participants"
|
|
69
|
+
import { registerAgentQueuedTurn } from "./queued-turn"
|
|
67
70
|
import {
|
|
71
|
+
type AgentQueuedTurnStart,
|
|
68
72
|
assertComputerPlaceRequest,
|
|
69
73
|
dispatchAgentRun,
|
|
74
|
+
type PromoteAgentInboxItemInput,
|
|
75
|
+
promoteAgentInboxItem,
|
|
70
76
|
type RequestAgentRunInput,
|
|
71
77
|
type RequestAgentRunResult,
|
|
72
78
|
requestAgentRun,
|
|
73
79
|
resumeAgentTurn,
|
|
74
80
|
retryAgentRun,
|
|
81
|
+
type SendAgentMessageInput,
|
|
82
|
+
sendAgentMessage,
|
|
83
|
+
startQueuedAgentTurnFromInbox,
|
|
84
|
+
withdrawAgentInboxItem,
|
|
75
85
|
} from "./request"
|
|
76
86
|
import { assertNoAgentSelector } from "./retired-config"
|
|
77
87
|
import { normalizeSandboxBinding } from "./sandbox"
|
|
@@ -121,6 +131,15 @@ export type AgentThreadsRuntime<TParams extends Record<string, unknown> = Record
|
|
|
121
131
|
threadId: string,
|
|
122
132
|
input: { readonly expectedSandboxName: string }
|
|
123
133
|
): Promise<AgentThreadView>
|
|
134
|
+
/**
|
|
135
|
+
* Go on in the sandbox a failed save left, with its files as they were: only one its run
|
|
136
|
+
* finished preparing. The next run resumes it if the provider kept it, or starts fresh and says
|
|
137
|
+
* so if it did not. Owner only.
|
|
138
|
+
*/
|
|
139
|
+
restoreSandbox(
|
|
140
|
+
threadId: string,
|
|
141
|
+
input: { readonly expectedSandboxName: string }
|
|
142
|
+
): Promise<AgentThreadView>
|
|
124
143
|
/**
|
|
125
144
|
* Move a computer's thread to another of its owner's computers or folders, which alone run its
|
|
126
145
|
* turns from then on. Owner only; refused while a turn runs or waits on approvals.
|
|
@@ -273,8 +292,35 @@ export interface ObservedAgentThreadsRuntime {
|
|
|
273
292
|
getChild(threadId: string): Promise<AgentChildView | null>
|
|
274
293
|
}
|
|
275
294
|
|
|
295
|
+
/** What a message sent to a thread became: the turn it started, or the inbox item that waits. */
|
|
296
|
+
export type ExecutionAgentSendResult =
|
|
297
|
+
| ({ readonly kind: "turn" } & ExecutionAgentRunResult)
|
|
298
|
+
| { readonly kind: "inbox"; readonly item: AgentInboxItemRecord }
|
|
299
|
+
|
|
300
|
+
/** A message waiting in a thread's inbox, changed before a turn reads it. */
|
|
301
|
+
export type AgentInboxMessageUpdate = Omit<PromoteAgentInboxItemInput, "threadId" | "itemId">
|
|
302
|
+
|
|
303
|
+
/** The thread's messages that wait for a turn. */
|
|
304
|
+
export interface AgentInboxRuntime {
|
|
305
|
+
/** Its unclaimed messages, oldest first. */
|
|
306
|
+
list(threadId: string): Promise<readonly AgentInboxItemRecord[]>
|
|
307
|
+
/** Edit, promote or send now one the caller sent. */
|
|
308
|
+
update(
|
|
309
|
+
threadId: string,
|
|
310
|
+
itemId: string,
|
|
311
|
+
input: AgentInboxMessageUpdate
|
|
312
|
+
): Promise<AgentInboxItemRecord>
|
|
313
|
+
/** Take back one the caller sent, before a turn reads it. */
|
|
314
|
+
remove(threadId: string, itemId: string): Promise<void>
|
|
315
|
+
}
|
|
316
|
+
|
|
276
317
|
export interface AgentRunsRuntime {
|
|
277
318
|
request(input: ExecutionAgentRequestInput): Promise<ExecutionAgentRunResult>
|
|
319
|
+
/**
|
|
320
|
+
* Send a message delivered as asked: it starts a turn, steers the running one, waits for the next,
|
|
321
|
+
* or stops the running one and starts now.
|
|
322
|
+
*/
|
|
323
|
+
send(input: SendAgentMessageInput): Promise<ExecutionAgentSendResult>
|
|
278
324
|
/**
|
|
279
325
|
* Retry a failed or interrupted turn; only whoever asked for it can, as it runs with their rights.
|
|
280
326
|
* A sub-agent's run is never retried: its turn decides whether to spawn it again.
|
|
@@ -285,7 +331,7 @@ export interface AgentRunsRuntime {
|
|
|
285
331
|
* this returns; a running one is still running, with the stop signal sent to its worker. A turn
|
|
286
332
|
* paused for approval stays as it ended, with its held calls cancelled: it never resumes. A
|
|
287
333
|
* sub-agent's run stops as its turn would: whoever asked for that turn, or the conversation's
|
|
288
|
-
* owner, can, and its parent's `
|
|
334
|
+
* owner, can, and its parent's `wait` reads that it was stopped.
|
|
289
335
|
*/
|
|
290
336
|
cancel(runId: string): Promise<AgentRunView>
|
|
291
337
|
/** A turn, or a sub-agent's run, read through its thread. */
|
|
@@ -344,6 +390,7 @@ export type AgentRuntime<TParams extends Record<string, unknown> = Record<string
|
|
|
344
390
|
get(): AgentDescriptor | null
|
|
345
391
|
readonly threads: AgentThreadsRuntime<TParams>
|
|
346
392
|
readonly runs: AgentRunsRuntime
|
|
393
|
+
readonly inbox: AgentInboxRuntime
|
|
347
394
|
/** Other users' conversations, read-only, with `can.observe(agent.threads)`. */
|
|
348
395
|
readonly observed: ObservedAgentThreadsRuntime
|
|
349
396
|
readonly memory: AgentMemoryRuntime
|
|
@@ -703,6 +750,29 @@ export function createAgentRuntime<
|
|
|
703
750
|
}
|
|
704
751
|
}
|
|
705
752
|
|
|
753
|
+
/**
|
|
754
|
+
* Start the next message the caller queued for the run's thread, as the caller, once the run
|
|
755
|
+
* ended. It never throws: what keeps the message from starting comes back as `closed`, and the
|
|
756
|
+
* message waits.
|
|
757
|
+
*/
|
|
758
|
+
const startQueuedTurn = async (
|
|
759
|
+
runId: string,
|
|
760
|
+
options: { readonly onlyImmediate: boolean }
|
|
761
|
+
): Promise<AgentQueuedTurnStart> => {
|
|
762
|
+
const agents = requireAgents()
|
|
763
|
+
const run = await agents.runs.getById({ projectId: runtime.projectId, id: runId })
|
|
764
|
+
if (run?.kind !== "conversation") return { status: "closed" }
|
|
765
|
+
|
|
766
|
+
try {
|
|
767
|
+
// Someone who left the thread no longer starts turns in it.
|
|
768
|
+
if (!(await rule.read(run.threadId))) return { status: "closed" }
|
|
769
|
+
return await startQueuedAgentTurnFromInbox(runtime, execution, run, options)
|
|
770
|
+
} catch (error) {
|
|
771
|
+
console.error(`[Sixb] Could not start a queued message of Agent run '${run.id}'.`, error)
|
|
772
|
+
return { status: "closed" }
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
706
776
|
const preferences: AgentPreferencesRuntime = {
|
|
707
777
|
get: async () => {
|
|
708
778
|
const { approvalMode, approvalModeSource } = await defaultAgentApprovalMode(requireAgents(), {
|
|
@@ -726,6 +796,32 @@ export function createAgentRuntime<
|
|
|
726
796
|
},
|
|
727
797
|
}
|
|
728
798
|
|
|
799
|
+
/** Move a conversation's sandbox out of recovery, as its owner chose: fresh, or as it was. */
|
|
800
|
+
const recoverSandbox = async (
|
|
801
|
+
threadId: string,
|
|
802
|
+
choice: "recreate" | "restore",
|
|
803
|
+
transition: (storage: AgentStorage) => Promise<AgentThreadSandboxState>
|
|
804
|
+
): Promise<AgentThreadView> => {
|
|
805
|
+
const readable = await rule.read(threadId)
|
|
806
|
+
if (!readable) throw new AgentRequestError("thread_not_found", "[Sixb] Agent thread not found.")
|
|
807
|
+
assertConversationThread(readable.thread)
|
|
808
|
+
if (readable.access !== "owner") {
|
|
809
|
+
throw new AgentRequestError(
|
|
810
|
+
"not_thread_owner",
|
|
811
|
+
`[Sixb] Only the owner of Agent thread '${threadId}' can ${choice} its sandbox.`
|
|
812
|
+
)
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
const storage = runtime.storage.agents
|
|
816
|
+
if (!storage) {
|
|
817
|
+
throw new AgentRequestError("storage_unavailable", "[Sixb] Agent storage is not configured.")
|
|
818
|
+
}
|
|
819
|
+
const thread = readable.thread
|
|
820
|
+
const sandboxState = await transition(storage)
|
|
821
|
+
const [view] = await agentThreadViews(runtime, [{ ...thread, sandboxState }])
|
|
822
|
+
return view ?? thread
|
|
823
|
+
}
|
|
824
|
+
|
|
729
825
|
const ownedComputerThread = async (threadId: string): Promise<AgentThreadRecord> => {
|
|
730
826
|
const readable = await rule.read(threadId)
|
|
731
827
|
if (!readable) throw new AgentRequestError("thread_not_found", "[Sixb] Agent thread not found.")
|
|
@@ -796,35 +892,25 @@ export function createAgentRuntime<
|
|
|
796
892
|
approvals,
|
|
797
893
|
preferences,
|
|
798
894
|
threads: {
|
|
799
|
-
recreateSandbox:
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
const sandboxState = await storage.threads.transitionSandbox({
|
|
819
|
-
projectId: runtime.projectId,
|
|
820
|
-
id: threadId,
|
|
821
|
-
action: "recreate",
|
|
822
|
-
expectedSandboxName: input.expectedSandboxName,
|
|
823
|
-
name: createAgentThreadSandboxName(runtime.projectId, threadId),
|
|
824
|
-
})
|
|
825
|
-
const [view] = await agentThreadViews(runtime, [{ ...thread, sandboxState }])
|
|
826
|
-
return view ?? thread
|
|
827
|
-
},
|
|
895
|
+
recreateSandbox: (threadId, input) =>
|
|
896
|
+
recoverSandbox(threadId, "recreate", (storage) =>
|
|
897
|
+
storage.threads.transitionSandbox({
|
|
898
|
+
projectId: runtime.projectId,
|
|
899
|
+
id: threadId,
|
|
900
|
+
action: "recreate",
|
|
901
|
+
expectedSandboxName: input.expectedSandboxName,
|
|
902
|
+
name: createAgentThreadSandboxName(runtime.projectId, threadId),
|
|
903
|
+
})
|
|
904
|
+
),
|
|
905
|
+
restoreSandbox: (threadId, input) =>
|
|
906
|
+
recoverSandbox(threadId, "restore", (storage) =>
|
|
907
|
+
storage.threads.transitionSandbox({
|
|
908
|
+
projectId: runtime.projectId,
|
|
909
|
+
id: threadId,
|
|
910
|
+
action: "restore",
|
|
911
|
+
name: input.expectedSandboxName,
|
|
912
|
+
})
|
|
913
|
+
),
|
|
828
914
|
moveToComputer: async (threadId, computer) => {
|
|
829
915
|
const thread = await ownedComputerThread(threadId)
|
|
830
916
|
const moves = movesComputerPlace(thread, computer)
|
|
@@ -962,7 +1048,58 @@ export function createAgentRuntime<
|
|
|
962
1048
|
getApprovalMode: getThreadApprovalMode,
|
|
963
1049
|
setApprovalMode: setThreadApprovalMode,
|
|
964
1050
|
},
|
|
1051
|
+
inbox: {
|
|
1052
|
+
list: async (threadId) => {
|
|
1053
|
+
const thread = await getVisibleThreadRecord(threadId)
|
|
1054
|
+
if (!thread) {
|
|
1055
|
+
throw new AgentRequestError(
|
|
1056
|
+
"thread_not_found",
|
|
1057
|
+
`[Sixb] Agent thread '${threadId}' not found.`
|
|
1058
|
+
)
|
|
1059
|
+
}
|
|
1060
|
+
return requireAgents().inbox.list({
|
|
1061
|
+
projectId: runtime.projectId,
|
|
1062
|
+
threadId: thread.id,
|
|
1063
|
+
includeClaimed: false,
|
|
1064
|
+
})
|
|
1065
|
+
},
|
|
1066
|
+
update: async (threadId, itemId, input) => {
|
|
1067
|
+
if (!(await getVisibleThreadRecord(threadId))) {
|
|
1068
|
+
throw new AgentRequestError(
|
|
1069
|
+
"thread_not_found",
|
|
1070
|
+
`[Sixb] Agent thread '${threadId}' not found.`
|
|
1071
|
+
)
|
|
1072
|
+
}
|
|
1073
|
+
return promoteAgentInboxItem(runtime, execution, { ...input, threadId, itemId })
|
|
1074
|
+
},
|
|
1075
|
+
remove: async (threadId, itemId) => {
|
|
1076
|
+
if (!(await getVisibleThreadRecord(threadId))) {
|
|
1077
|
+
throw new AgentRequestError(
|
|
1078
|
+
"thread_not_found",
|
|
1079
|
+
`[Sixb] Agent thread '${threadId}' not found.`
|
|
1080
|
+
)
|
|
1081
|
+
}
|
|
1082
|
+
await withdrawAgentInboxItem(runtime, execution, { threadId, itemId })
|
|
1083
|
+
},
|
|
1084
|
+
},
|
|
965
1085
|
runs: {
|
|
1086
|
+
send: async (input) => {
|
|
1087
|
+
assertNoAgentSelector(input)
|
|
1088
|
+
if (!getAgent()) {
|
|
1089
|
+
throw new AgentRequestError("agent_not_found", "[Sixb] The project Agent is unavailable.")
|
|
1090
|
+
}
|
|
1091
|
+
assertAuthorized(runtime, { kind: "agent.run" })
|
|
1092
|
+
if (!(await getVisibleThreadRecord(input.threadId))) {
|
|
1093
|
+
throw new AgentRequestError(
|
|
1094
|
+
"thread_not_found",
|
|
1095
|
+
`[Sixb] Agent thread '${input.threadId}' not found.`
|
|
1096
|
+
)
|
|
1097
|
+
}
|
|
1098
|
+
const result = await sendAgentMessage(runtime, execution, turnModels, input)
|
|
1099
|
+
return result.kind === "turn"
|
|
1100
|
+
? { ...result, run: await attachRunView(runtime, result.run) }
|
|
1101
|
+
: result
|
|
1102
|
+
},
|
|
966
1103
|
request: async (input) => {
|
|
967
1104
|
assertNoAgentSelector(input)
|
|
968
1105
|
const agent = getAgent()
|
|
@@ -1019,6 +1156,7 @@ export function createAgentRuntime<
|
|
|
1019
1156
|
observed: createObservedAgentThreadsRuntime(runtime),
|
|
1020
1157
|
}
|
|
1021
1158
|
registerAgentTurnResume(agentRuntime, resumeDecidedTurn)
|
|
1159
|
+
registerAgentQueuedTurn(agentRuntime, startQueuedTurn)
|
|
1022
1160
|
return agentRuntime
|
|
1023
1161
|
}
|
|
1024
1162
|
|
package/src/agents/ids.ts
CHANGED
|
@@ -22,9 +22,12 @@ export function createAgentRunId(): string {
|
|
|
22
22
|
return `agt_run_${randomUUID()}`
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/** How every child's first run id starts: told apart from the key the Agent spawned it under. */
|
|
26
|
+
export const SUBAGENT_RUN_ID_PREFIX = "agt_run_child_"
|
|
27
|
+
|
|
25
28
|
/** One stable child identity per parent-selected spawn key. */
|
|
26
29
|
export function createSubagentRunId(parentRunId: string, spawnKey: string): string {
|
|
27
|
-
return
|
|
30
|
+
return `${SUBAGENT_RUN_ID_PREFIX}${spawnDigest(parentRunId, spawnKey)}`
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
/**
|
|
@@ -48,6 +51,11 @@ export function createAgentMessageId(): string {
|
|
|
48
51
|
return `agt_msg_${randomUUID()}`
|
|
49
52
|
}
|
|
50
53
|
|
|
54
|
+
/** A message waiting in a thread's inbox, before it is a message of the conversation. */
|
|
55
|
+
export function createAgentInboxItemId(): string {
|
|
56
|
+
return `agt_inb_${randomUUID()}`
|
|
57
|
+
}
|
|
58
|
+
|
|
51
59
|
/** One deterministic context-checkpoint identity per conversational run. */
|
|
52
60
|
export function agentContextCheckpointId(runId: string): string {
|
|
53
61
|
return `agt_ctx_${runId}`
|
package/src/agents/index.ts
CHANGED
|
@@ -59,8 +59,14 @@ export {
|
|
|
59
59
|
} from "./authority"
|
|
60
60
|
export { defineAgentTool } from "./builders"
|
|
61
61
|
export { requestAgentRunCancel } from "./cancel"
|
|
62
|
-
export type { AgentChildQuestion } from "./child-question"
|
|
63
|
-
export {
|
|
62
|
+
export type { AgentChildQuestion, AgentQuestion } from "./child-question"
|
|
63
|
+
export {
|
|
64
|
+
AGENT_QUESTION_LIMITS,
|
|
65
|
+
agentQuestionsText,
|
|
66
|
+
deferredChildQuestion,
|
|
67
|
+
isAwaitingAnswerRun,
|
|
68
|
+
isChildAskTool,
|
|
69
|
+
} from "./child-question"
|
|
64
70
|
export type {
|
|
65
71
|
AgentContextEntryInput,
|
|
66
72
|
AgentContextInput,
|
|
@@ -146,6 +152,7 @@ export {
|
|
|
146
152
|
createSubagentExecutionId,
|
|
147
153
|
createSubagentRunId,
|
|
148
154
|
createSubagentThreadId,
|
|
155
|
+
SUBAGENT_RUN_ID_PREFIX,
|
|
149
156
|
} from "./ids"
|
|
150
157
|
export { AGENT_IMAGE_INPUT_TOKENS, AGENT_INLINE_IMAGE_LIMITS } from "./inline-images"
|
|
151
158
|
export {
|
|
@@ -181,21 +188,33 @@ export type {
|
|
|
181
188
|
RunModelLoopInput,
|
|
182
189
|
} from "./model-loop"
|
|
183
190
|
export { runModelLoop } from "./model-loop"
|
|
191
|
+
export { registerAgentQueuedTurn, startQueuedAgentTurn } from "./queued-turn"
|
|
184
192
|
export { agent } from "./reference"
|
|
185
193
|
export {
|
|
194
|
+
AGENT_MESSAGE_DELIVERIES,
|
|
195
|
+
type AgentMessageDelivery,
|
|
196
|
+
type AgentQueuedTurnStart,
|
|
186
197
|
isRetryableAgentRun,
|
|
198
|
+
type PromoteAgentInboxItemInput,
|
|
199
|
+
promoteAgentInboxItem,
|
|
187
200
|
type RequestAgentRunInput,
|
|
188
201
|
type RequestAgentRunResult,
|
|
189
202
|
requestAgentRun,
|
|
190
203
|
retryAgentRun,
|
|
204
|
+
type SendAgentMessageInput,
|
|
205
|
+
type SendAgentMessageResult,
|
|
206
|
+
sendAgentMessage,
|
|
207
|
+
startQueuedAgentTurnFromInbox,
|
|
208
|
+
withdrawAgentInboxItem,
|
|
191
209
|
} from "./request"
|
|
192
|
-
export {
|
|
210
|
+
export {
|
|
211
|
+
afterAgentRunFinished,
|
|
212
|
+
repairAgentInboxes,
|
|
213
|
+
stopAgentRunChild,
|
|
214
|
+
} from "./run-after-finish"
|
|
193
215
|
export type {
|
|
194
216
|
AgentRunArtifactPublish,
|
|
195
217
|
AgentRunArtifacts,
|
|
196
|
-
AgentRunBoardPreviews,
|
|
197
|
-
AgentRunMissingPreview,
|
|
198
|
-
AgentRunVersion,
|
|
199
218
|
} from "./run-artifacts"
|
|
200
219
|
export { agentRunArtifacts } from "./run-artifacts"
|
|
201
220
|
export type {
|
|
@@ -252,6 +271,7 @@ export type {
|
|
|
252
271
|
AgentRunCheckpoint,
|
|
253
272
|
AgentRunFileStore,
|
|
254
273
|
AgentRunHeldCalls,
|
|
274
|
+
AgentRunInbox,
|
|
255
275
|
AgentRunModels,
|
|
256
276
|
AgentRunOutcome,
|
|
257
277
|
AgentRunPeople,
|
|
@@ -306,6 +326,7 @@ export type {
|
|
|
306
326
|
AgentTurnContext,
|
|
307
327
|
AgentTurnHistory,
|
|
308
328
|
} from "./run-turn"
|
|
329
|
+
export { readAgentTurnHistory } from "./run-turn"
|
|
309
330
|
export type {
|
|
310
331
|
AgentDefinitions,
|
|
311
332
|
AgentDefinitionsInput,
|
package/src/agents/model-loop.ts
CHANGED
|
@@ -34,6 +34,7 @@ import type {
|
|
|
34
34
|
} from "../models/messages"
|
|
35
35
|
import type { ModelCallCost, ModelReportedCost } from "../models/pricing"
|
|
36
36
|
import type { ModelOutput, ModelTool } from "../models/tools"
|
|
37
|
+
import { coerceToolInput } from "./tool-input-coercion"
|
|
37
38
|
|
|
38
39
|
const MAX_PROVIDER_DATA_BYTES = 256 * 1024
|
|
39
40
|
interface ModelLoopOptions {
|
|
@@ -177,6 +178,7 @@ export async function runModelLoop(
|
|
|
177
178
|
name: tool.name,
|
|
178
179
|
description: tool.description,
|
|
179
180
|
inputSchema: tool.inputSchema,
|
|
181
|
+
...(tool.strict ? { strict: true } : {}),
|
|
180
182
|
}))
|
|
181
183
|
let messages: readonly ModelMessage[] = [...input.messages]
|
|
182
184
|
const steps: ModelStep[] = []
|
|
@@ -643,7 +645,7 @@ async function executeToolCall(
|
|
|
643
645
|
|
|
644
646
|
let parsed: unknown
|
|
645
647
|
try {
|
|
646
|
-
parsed = tool.parseInput(part.input)
|
|
648
|
+
parsed = tool.parseInput(coerceToolInput(tool.inputSchema, part.input))
|
|
647
649
|
} catch (error) {
|
|
648
650
|
const errorText = error instanceof Error ? error.message : "Tool input validation failed."
|
|
649
651
|
await onEvent?.({
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Sixb } from "../runtime/sixb"
|
|
2
|
+
import type { AgentQueuedTurnStart } from "./request"
|
|
3
|
+
|
|
4
|
+
export type { AgentQueuedTurnStart }
|
|
5
|
+
|
|
6
|
+
const queuedTurnKey = Symbol("sixb.agentQueuedTurn")
|
|
7
|
+
|
|
8
|
+
interface QueuedTurnOwner {
|
|
9
|
+
readonly [queuedTurnKey]?: (
|
|
10
|
+
runId: string,
|
|
11
|
+
options: { readonly onlyImmediate: boolean }
|
|
12
|
+
) => Promise<AgentQueuedTurnStart>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Let code without a request start the next message someone queued for a thread: the worker's
|
|
17
|
+
* session host, the API's, and the repair pass. The SDK it is given is bound to the request that
|
|
18
|
+
* sent the message, so the message runs as the person who sent it.
|
|
19
|
+
*/
|
|
20
|
+
export function registerAgentQueuedTurn(
|
|
21
|
+
agent: object,
|
|
22
|
+
start: (
|
|
23
|
+
runId: string,
|
|
24
|
+
options: { readonly onlyImmediate: boolean }
|
|
25
|
+
) => Promise<AgentQueuedTurnStart>
|
|
26
|
+
): void {
|
|
27
|
+
Object.defineProperty(agent, queuedTurnKey, {
|
|
28
|
+
configurable: false,
|
|
29
|
+
enumerable: false,
|
|
30
|
+
value: start,
|
|
31
|
+
writable: false,
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Start the bound SDK's principal's next queued message in `run`'s thread, once `run` ended. */
|
|
36
|
+
export function startQueuedAgentTurn(
|
|
37
|
+
sixb: Sixb,
|
|
38
|
+
runId: string,
|
|
39
|
+
options: { readonly onlyImmediate: boolean }
|
|
40
|
+
): Promise<AgentQueuedTurnStart> {
|
|
41
|
+
const start = (sixb.agent as QueuedTurnOwner)[queuedTurnKey]
|
|
42
|
+
if (!start) {
|
|
43
|
+
throw new Error("[Sixb] Queued Agent messages cannot start: Sixb did not bind this SDK.")
|
|
44
|
+
}
|
|
45
|
+
return start(runId, options)
|
|
46
|
+
}
|