@sixb/core 0.2.4 → 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/execution.d.ts +34 -2
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/ids.d.ts +2 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +6 -4
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +51 -33
- package/dist/agents/index.js.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-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/turn-answered.d.ts +7 -0
- package/dist/agents/turn-answered.d.ts.map +1 -0
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/artifacts/canvas-display.d.ts +3 -5
- package/dist/artifacts/canvas-display.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +14 -3
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/document-fill.d.ts +18 -0
- package/dist/artifacts/document-fill.d.ts.map +1 -0
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/events.d.ts +3 -2
- package/dist/artifacts/events.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +40 -4
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +8 -1
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/document-data.d.ts +98 -0
- package/dist/artifacts/frames/document-data.d.ts.map +1 -0
- package/dist/artifacts/frames/entries.d.ts +12 -7
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/index.d.ts +2 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +22 -13
- package/dist/artifacts/frames/index.js.map +4 -4
- package/dist/artifacts/frames/kit.d.ts +15 -0
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +12 -1
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/runtime.d.ts +24 -4
- package/dist/artifacts/frames/runtime.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +3 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +9 -3
- package/dist/artifacts/index.js.map +3 -3
- package/dist/artifacts/live/blocks.d.ts +62 -0
- package/dist/artifacts/live/blocks.d.ts.map +1 -0
- package/dist/artifacts/live/board.d.ts +6 -0
- package/dist/artifacts/live/board.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts +12 -0
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +2 -0
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +148 -44
- package/dist/artifacts/live/index.js.map +3 -3
- package/dist/artifacts/live/page.d.ts +49 -0
- package/dist/artifacts/live/page.d.ts.map +1 -0
- package/dist/artifacts/live/protocol.d.ts +5 -0
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +2 -2
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +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-8bns0y68.js → chunk-0hkdtwqk.js} +5 -5
- package/dist/{chunk-p8pgnq8d.js → chunk-0mvjpgvm.js} +5 -5
- package/dist/{chunk-2bn6813a.js → chunk-1yh6jgtz.js} +1 -1
- package/dist/{chunk-msyevpp3.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-td26wjr5.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-3z1vxzcm.js → chunk-aw1z0gre.js} +4 -4
- package/dist/{chunk-evj5jxz3.js → chunk-b4escq4c.js} +62 -14
- package/dist/{chunk-evj5jxz3.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-t0s7b3d1.js → chunk-ey1p8w68.js} +173 -4
- package/dist/chunk-ey1p8w68.js.map +13 -0
- package/dist/{chunk-gxwy4c3s.js → chunk-fpf57gca.js} +316 -57
- package/dist/chunk-fpf57gca.js.map +47 -0
- package/dist/{chunk-r9rtavg9.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-w1wq7gfr.js → chunk-gjhrz66x.js} +225 -17
- package/dist/{chunk-w1wq7gfr.js.map → chunk-gjhrz66x.js.map} +5 -5
- package/dist/chunk-hn2r7z41.js.map +1 -1
- package/dist/{chunk-vepea5c3.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-yy914zfr.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-6ef4esq4.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-rsrc7vtw.js → chunk-rg725hry.js} +174 -30
- package/dist/{chunk-rsrc7vtw.js.map → chunk-rg725hry.js.map} +9 -8
- package/dist/{chunk-rsxb14an.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-hvbvq7p4.js → chunk-vs2s3p8n.js} +731 -10
- package/dist/chunk-vs2s3p8n.js.map +20 -0
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-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-rtm1jq00.js → chunk-z1njfqqs.js} +439 -48
- package/dist/{chunk-rtm1jq00.js.map → chunk-z1njfqqs.js.map} +10 -8
- 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-7kpqntgw.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/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 +155 -0
- 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/execution.ts +167 -29
- package/src/agents/ids.ts +5 -0
- package/src/agents/index.ts +18 -4
- 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-http.ts +9 -2
- package/src/agents/run-session-serve.ts +2 -8
- package/src/agents/run-session.ts +142 -3
- package/src/agents/run-turn.ts +8 -0
- package/src/agents/streams/index.ts +1 -0
- package/src/agents/streams/protocol.ts +41 -1
- package/src/agents/turn-answered.ts +31 -0
- package/src/agents/validation.ts +2 -0
- package/src/artifacts/canvas-display.ts +4 -6
- package/src/artifacts/comments.ts +70 -17
- package/src/artifacts/document-fill.ts +103 -0
- package/src/artifacts/errors.ts +2 -0
- package/src/artifacts/events.ts +4 -1
- package/src/artifacts/execution.ts +265 -31
- package/src/artifacts/frames/assets.ts +42 -7
- package/src/artifacts/frames/document-data.ts +353 -0
- package/src/artifacts/frames/entries.ts +22 -16
- package/src/artifacts/frames/grants.ts +2 -2
- package/src/artifacts/frames/index.ts +3 -0
- package/src/artifacts/frames/kit.ts +102 -0
- package/src/artifacts/frames/protocol.ts +12 -1
- package/src/artifacts/frames/runtime.ts +413 -6
- package/src/artifacts/index.ts +3 -0
- package/src/artifacts/live/blocks.ts +889 -0
- package/src/artifacts/live/board.ts +195 -42
- package/src/artifacts/live/document.ts +170 -5
- package/src/artifacts/live/index.ts +7 -0
- package/src/artifacts/live/page.ts +807 -0
- package/src/artifacts/live/protocol.ts +5 -0
- package/src/artifacts/live/server.ts +2 -2
- package/src/artifacts/live/state.ts +9 -4
- package/src/artifacts/outline.ts +17 -0
- package/src/artifacts/paper.ts +173 -0
- package/src/artifacts/pdf-job.ts +11 -0
- package/src/artifacts/publish/fields.ts +177 -0
- package/src/artifacts/publish/index.ts +6 -1
- package/src/artifacts/publish/merge.ts +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 +25 -0
- 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/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 +167 -0
- 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-9nsjjd44.js.map +0 -12
- package/dist/chunk-b9qfh2ya.js.map +0 -11
- package/dist/chunk-eptrvnby.js.map +0 -12
- package/dist/chunk-f6ahf5gf.js.map +0 -13
- package/dist/chunk-gxwy4c3s.js.map +0 -47
- package/dist/chunk-hvbvq7p4.js.map +0 -18
- package/dist/chunk-m2jerfef.js +0 -474
- package/dist/chunk-m2jerfef.js.map +0 -11
- package/dist/chunk-n4zzaf6q.js.map +0 -10
- package/dist/chunk-smnt672s.js.map +0 -10
- package/dist/chunk-t0s7b3d1.js.map +0 -13
- package/dist/chunk-vzkxqf8h.js.map +0 -23
- package/dist/chunk-wa05txmk.js.map +0 -11
- package/dist/chunk-yv8hv4wq.js.map +0 -10
- package/dist/chunk-yy914zfr.js.map +0 -30
- /package/dist/{chunk-8bns0y68.js.map → chunk-0hkdtwqk.js.map} +0 -0
- /package/dist/{chunk-p8pgnq8d.js.map → chunk-0mvjpgvm.js.map} +0 -0
- /package/dist/{chunk-2bn6813a.js.map → chunk-1yh6jgtz.js.map} +0 -0
- /package/dist/{chunk-msyevpp3.js.map → chunk-5t9gm5tt.js.map} +0 -0
- /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
- /package/dist/{chunk-td26wjr5.js.map → chunk-68hm50qh.js.map} +0 -0
- /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
- /package/dist/{chunk-3z1vxzcm.js.map → chunk-aw1z0gre.js.map} +0 -0
- /package/dist/{chunk-r9rtavg9.js.map → chunk-fzae1jpq.js.map} +0 -0
- /package/dist/{chunk-vepea5c3.js.map → chunk-k29n4176.js.map} +0 -0
- /package/dist/{chunk-sysnvjce.js.map → chunk-naxjka9v.js.map} +0 -0
- /package/dist/{chunk-6ef4esq4.js.map → chunk-pqvvqc65.js.map} +0 -0
- /package/dist/{chunk-rsxb14an.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-7kpqntgw.js.map → chunk-zxhym8tr.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import type { BlobStorage } from "../blob-storage"
|
|
|
2
2
|
import type { Broker } from "../broker"
|
|
3
3
|
import { createSixbError } from "../errors/internal"
|
|
4
4
|
import type { DomainEventLog } from "../events/service"
|
|
5
|
-
import type { AuthorizationRef } from "../execution"
|
|
5
|
+
import type { AuthorizablePrincipal, AuthorizationRef } from "../execution"
|
|
6
6
|
import {
|
|
7
7
|
type AgentExecutionHost,
|
|
8
8
|
bindAgentModelExecution,
|
|
@@ -25,6 +25,7 @@ import type { Sixb } from "../runtime/sixb"
|
|
|
25
25
|
import type { SecurityDefinitionCatalog } from "../security"
|
|
26
26
|
import type { Storage } from "../storage"
|
|
27
27
|
import {
|
|
28
|
+
type AgentInboxItemRecord,
|
|
28
29
|
type AgentRunRecord,
|
|
29
30
|
type AgentStorage,
|
|
30
31
|
AgentStorageError,
|
|
@@ -88,6 +89,7 @@ import {
|
|
|
88
89
|
readAgentRunContext,
|
|
89
90
|
readAgentTurnHistory,
|
|
90
91
|
} from "./run-turn"
|
|
92
|
+
import type { AgentInboxReadMessage } from "./streams"
|
|
91
93
|
import { subscribeAgentRunCancel } from "./streams/protocol"
|
|
92
94
|
import { subagentSandboxFiles } from "./subagent-runs"
|
|
93
95
|
import { conversationThreadId } from "./thread-access"
|
|
@@ -127,6 +129,8 @@ export interface AgentRunSession<TRun extends AgentRunRecord = AgentRunRecord> {
|
|
|
127
129
|
readonly events: StreamSink
|
|
128
130
|
/** Approvals that hold the run: they are created by the API its commands call, never here. */
|
|
129
131
|
readonly heldCalls: AgentRunHeldCalls
|
|
132
|
+
/** Mid-run steers waiting in a conversation turn's inbox. */
|
|
133
|
+
readonly inbox: AgentRunInbox
|
|
130
134
|
/** A conversation turn's children: spawning them, and reading them and their threads. */
|
|
131
135
|
readonly children: AgentRunChildren
|
|
132
136
|
/**
|
|
@@ -259,6 +263,18 @@ export interface AgentRunHeldCalls {
|
|
|
259
263
|
pausesAfterStep(): Promise<boolean>
|
|
260
264
|
}
|
|
261
265
|
|
|
266
|
+
export interface AgentRunInbox {
|
|
267
|
+
/**
|
|
268
|
+
* Claim unclaimed non-immediate `steer` items of a conversation turn's thread at `stepIndex`:
|
|
269
|
+
* those its requester sent, since the turn runs as them. Answers `[]` on a sub-agent's session,
|
|
270
|
+
* whose parent steers it through `FamilyMailbox`.
|
|
271
|
+
*/
|
|
272
|
+
takeSteers(input: {
|
|
273
|
+
readonly stepIndex: number
|
|
274
|
+
readonly afterAnswer?: boolean
|
|
275
|
+
}): Promise<readonly AgentInboxItemRecord[]>
|
|
276
|
+
}
|
|
277
|
+
|
|
262
278
|
/** How a run ended; the session supplies which run, and its token. */
|
|
263
279
|
export type AgentRunOutcome = FinishAgentRunInput extends infer Finish
|
|
264
280
|
? Finish extends FinishAgentRunInput
|
|
@@ -363,6 +379,27 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
|
|
|
363
379
|
return bound
|
|
364
380
|
}
|
|
365
381
|
const runSdk = async () => (await bind()).sixb
|
|
382
|
+
|
|
383
|
+
// Who the turn runs as, read once from its execution, which never changes.
|
|
384
|
+
let requestedBy: Promise<AuthorizablePrincipal | undefined> | undefined
|
|
385
|
+
const requester = () => {
|
|
386
|
+
requestedBy ??= host.storage.executions
|
|
387
|
+
.getById({ projectId: host.projectId, id: run.executionId })
|
|
388
|
+
.then((execution) => {
|
|
389
|
+
if (!execution) {
|
|
390
|
+
throw new Error(
|
|
391
|
+
`[Sixb] Agent run '${run.id}' references missing execution '${run.executionId}'.`
|
|
392
|
+
)
|
|
393
|
+
}
|
|
394
|
+
return execution.requestedBy
|
|
395
|
+
})
|
|
396
|
+
.catch((error: unknown) => {
|
|
397
|
+
requestedBy = undefined
|
|
398
|
+
throw error
|
|
399
|
+
})
|
|
400
|
+
return requestedBy
|
|
401
|
+
}
|
|
402
|
+
|
|
366
403
|
const cancel = await watchAgentRunCancel(host, [run.id, ...cancelWith])
|
|
367
404
|
// A cancel recorded on the run reaches a runner the broker's cancel did not: at the claim, and at
|
|
368
405
|
// each renewal of its lease.
|
|
@@ -458,6 +495,35 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
|
|
|
458
495
|
host.storage.agents.approvals.holdsRun({ projectId: host.projectId, runId: run.id }),
|
|
459
496
|
pausesAfterStep: () => turnPausesOnHeldCalls(host.storage.agents, run),
|
|
460
497
|
},
|
|
498
|
+
inbox: {
|
|
499
|
+
async takeSteers({ stepIndex, afterAnswer }) {
|
|
500
|
+
if (run.kind !== "conversation") return []
|
|
501
|
+
|
|
502
|
+
// The turn runs as its requester, so it reads only what they sent: another participant's
|
|
503
|
+
// steer waits for a turn of theirs. A turn nobody requested has no one to steer it.
|
|
504
|
+
const authorPrincipal = await requester()
|
|
505
|
+
if (!authorPrincipal) return []
|
|
506
|
+
|
|
507
|
+
const items = await fenced(run.id, () =>
|
|
508
|
+
agents.inbox.takeSteers({
|
|
509
|
+
projectId: host.projectId,
|
|
510
|
+
threadId: run.threadId,
|
|
511
|
+
runId: run.id,
|
|
512
|
+
executionToken,
|
|
513
|
+
stepIndex,
|
|
514
|
+
...(afterAnswer ? { afterAnswer: true } : {}),
|
|
515
|
+
authorPrincipal,
|
|
516
|
+
})
|
|
517
|
+
)
|
|
518
|
+
|
|
519
|
+
// Whoever watches sees each message where the turn read it, before the step it answers
|
|
520
|
+
// streams, from what was stored: a runner never says what was sent, or by whom.
|
|
521
|
+
if (items.length > 0) {
|
|
522
|
+
await host.events.publishInboxRead({ run, messages: items.map(inboxReadMessage) })
|
|
523
|
+
}
|
|
524
|
+
return items
|
|
525
|
+
},
|
|
526
|
+
},
|
|
461
527
|
models: {
|
|
462
528
|
async language(ref, options) {
|
|
463
529
|
const key = `${ref.provider}/${ref.modelId}`
|
|
@@ -514,6 +580,7 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
|
|
|
514
580
|
async finish(outcome, messages) {
|
|
515
581
|
const finished = await finishWithRetries(
|
|
516
582
|
host.storage,
|
|
583
|
+
run,
|
|
517
584
|
{ ...outcome, ...fence },
|
|
518
585
|
messages ?? []
|
|
519
586
|
)
|
|
@@ -625,6 +692,13 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
|
|
|
625
692
|
`[Sixb] Agent run '${run.id}' moves only its own thread's workspace, not '${input.id}'.`
|
|
626
693
|
)
|
|
627
694
|
}
|
|
695
|
+
// Recreating or restoring is its owner's choice, never a run's.
|
|
696
|
+
const { action } = input as { readonly action: string }
|
|
697
|
+
if (action !== "acquire" && action !== "replace" && action !== "settle") {
|
|
698
|
+
throw new AgentRunRefusedError(
|
|
699
|
+
`[Sixb] Agent run '${run.id}' cannot ${action} its thread's workspace: only its owner recovers it.`
|
|
700
|
+
)
|
|
701
|
+
}
|
|
628
702
|
return fenced(run.id, () =>
|
|
629
703
|
host.storage.agents.threads.transitionSandbox({
|
|
630
704
|
...input,
|
|
@@ -833,19 +907,27 @@ const FINISH_BACKOFF_MS = [50, 200, 600] as const
|
|
|
833
907
|
|
|
834
908
|
async function finishWithRetries(
|
|
835
909
|
storage: AgentRunSessionHost["storage"],
|
|
910
|
+
run: AgentRunRecord,
|
|
836
911
|
finish: FinishAgentRunInput,
|
|
837
912
|
messages: readonly AppendAgentMessageInput[]
|
|
838
913
|
): Promise<AgentRunRecord> {
|
|
839
914
|
for (let attempt = 0; ; attempt += 1) {
|
|
840
915
|
try {
|
|
841
|
-
if (messages.length === 0)
|
|
916
|
+
if (run.kind !== "conversation" && messages.length === 0) {
|
|
917
|
+
return await storage.agents.runs.finish(finish)
|
|
918
|
+
}
|
|
842
919
|
return await storage.transaction(async (tx) => {
|
|
843
920
|
const agents = tx.agents
|
|
844
921
|
if (!agents) throw new Error("[Sixb] Agent storage is not configured.")
|
|
845
|
-
|
|
922
|
+
const resolved =
|
|
923
|
+
run.kind === "conversation"
|
|
924
|
+
? await reconcileClaimedSteers(agents, run, finish.executionToken, messages)
|
|
925
|
+
: messages
|
|
926
|
+
for (const message of resolved) await agents.messages.append(message)
|
|
846
927
|
return agents.runs.finish(finish)
|
|
847
928
|
})
|
|
848
929
|
} catch (error) {
|
|
930
|
+
if (error instanceof AgentRunRefusedError) throw error
|
|
849
931
|
if (isTerminalOrExecutionGone(error)) throw new AgentExecutionLostError(finish.id)
|
|
850
932
|
const delay = FINISH_BACKOFF_MS[attempt]
|
|
851
933
|
if (delay === undefined) throw new AgentFinalizationError(finish.id, { cause: error })
|
|
@@ -853,3 +935,60 @@ async function finishWithRetries(
|
|
|
853
935
|
}
|
|
854
936
|
}
|
|
855
937
|
}
|
|
938
|
+
|
|
939
|
+
async function reconcileClaimedSteers(
|
|
940
|
+
agents: AgentStorage,
|
|
941
|
+
run: ConversationAgentRunRecord,
|
|
942
|
+
executionToken: string,
|
|
943
|
+
messages: readonly AppendAgentMessageInput[]
|
|
944
|
+
): Promise<readonly AppendAgentMessageInput[]> {
|
|
945
|
+
// A storage without an inbox claims nothing, so every message is the turn's own.
|
|
946
|
+
if (typeof agents.inbox?.consumeClaimed !== "function") return messages
|
|
947
|
+
const userIds = messages.filter((message) => message.role === "user").map((message) => message.id)
|
|
948
|
+
const consumed = await agents.inbox.consumeClaimed({
|
|
949
|
+
projectId: run.projectId,
|
|
950
|
+
threadId: run.threadId,
|
|
951
|
+
runId: run.id,
|
|
952
|
+
executionToken,
|
|
953
|
+
messageIds: userIds,
|
|
954
|
+
})
|
|
955
|
+
const byMessageId = new Map(consumed.map((item) => [item.messageId, item]))
|
|
956
|
+
|
|
957
|
+
return messages.map((message): AppendAgentMessageInput => {
|
|
958
|
+
if (message.role !== "user") return message
|
|
959
|
+
const claimed = byMessageId.get(message.id)
|
|
960
|
+
if (!claimed) {
|
|
961
|
+
throw new AgentRunRefusedError(
|
|
962
|
+
`[Sixb] Agent run '${run.id}' finishes only with user messages from its thread's inbox.`
|
|
963
|
+
)
|
|
964
|
+
}
|
|
965
|
+
const metadata =
|
|
966
|
+
claimed.timeZone || claimed.locale
|
|
967
|
+
? {
|
|
968
|
+
...(claimed.timeZone ? { timeZone: claimed.timeZone } : {}),
|
|
969
|
+
...(claimed.locale ? { locale: claimed.locale } : {}),
|
|
970
|
+
}
|
|
971
|
+
: undefined
|
|
972
|
+
return {
|
|
973
|
+
id: claimed.messageId,
|
|
974
|
+
projectId: claimed.projectId,
|
|
975
|
+
threadId: claimed.threadId,
|
|
976
|
+
runId: null,
|
|
977
|
+
role: "user",
|
|
978
|
+
parts: claimed.parts,
|
|
979
|
+
authorPrincipal: claimed.authorPrincipal,
|
|
980
|
+
createdAt: claimed.createdAt,
|
|
981
|
+
...(metadata ? { metadata } : {}),
|
|
982
|
+
}
|
|
983
|
+
})
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/** A message a turn read, as its stream tells whoever watches: the stored item, not the runner. */
|
|
987
|
+
function inboxReadMessage(item: AgentInboxItemRecord): AgentInboxReadMessage {
|
|
988
|
+
return {
|
|
989
|
+
id: item.messageId,
|
|
990
|
+
authorPrincipal: item.authorPrincipal,
|
|
991
|
+
parts: item.parts,
|
|
992
|
+
createdAt: item.createdAt.toISOString(),
|
|
993
|
+
}
|
|
994
|
+
}
|
package/src/agents/run-turn.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Principal, UserPrincipal } from "../auth/types"
|
|
2
|
+
import { isPlainRecord } from "../json"
|
|
2
3
|
import type {
|
|
3
4
|
AgentContextCheckpointRecord,
|
|
4
5
|
AgentMessageRecord,
|
|
@@ -280,6 +281,13 @@ async function readSentSettings(
|
|
|
280
281
|
const retained = new Set(userMessages.map((message) => message.id))
|
|
281
282
|
const zones: Record<string, string> = {}
|
|
282
283
|
const locales: Record<string, string> = {}
|
|
284
|
+
for (const message of userMessages) {
|
|
285
|
+
// A message a turn read mid-run keeps the settings it was rendered with, so a later turn closes
|
|
286
|
+
// it with the same `<sixb_current_time>`.
|
|
287
|
+
const metadata = isPlainRecord(message.metadata) ? message.metadata : undefined
|
|
288
|
+
if (typeof metadata?.timeZone === "string") zones[message.id] = metadata.timeZone
|
|
289
|
+
if (typeof metadata?.locale === "string") locales[message.id] = metadata.locale
|
|
290
|
+
}
|
|
283
291
|
for (const run of runs) {
|
|
284
292
|
if (run.kind !== "conversation" || !retained.has(run.triggerMessageId)) continue
|
|
285
293
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { Principal } from "../../auth"
|
|
1
2
|
import type { Broker, BrokerStreamDefinition } from "../../broker"
|
|
2
3
|
import { parseSixbFailure } from "../../errors/internal"
|
|
3
4
|
import type { SixbFailure } from "../../errors/types"
|
|
4
|
-
import { isPlainRecord, type JsonValue } from "../../json"
|
|
5
|
+
import { isJsonValue, isPlainRecord, type JsonValue } from "../../json"
|
|
5
6
|
import { isModelUiChunk, type ModelUiChunk } from "../../models/events"
|
|
6
7
|
import {
|
|
7
8
|
AGENT_APPROVAL_STATUSES,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
type AgentRunRecord,
|
|
14
15
|
type ConversationAgentRunRecord,
|
|
15
16
|
} from "../../storage/agents/types"
|
|
17
|
+
import type { AgentMessagePart } from "../message"
|
|
16
18
|
|
|
17
19
|
export const AGENT_RUN_STREAM_SCHEMA_VERSION = 1 as const
|
|
18
20
|
export const DEFAULT_AGENT_RUN_STREAM_RETENTION = {
|
|
@@ -422,6 +424,18 @@ export const AGENT_COMPACTION_FAILURE_CODES = [
|
|
|
422
424
|
] as const
|
|
423
425
|
export type AgentCompactionFailureCode = (typeof AGENT_COMPACTION_FAILURE_CODES)[number]
|
|
424
426
|
|
|
427
|
+
/**
|
|
428
|
+
* A message a turn read from its thread's inbox as it answered. The conversation holds it as a user
|
|
429
|
+
* message, with this id, where the turn read it: after what the run streamed before this record.
|
|
430
|
+
*/
|
|
431
|
+
export interface AgentInboxReadMessage {
|
|
432
|
+
/** The id the message is saved with once the turn ends. */
|
|
433
|
+
readonly id: string
|
|
434
|
+
readonly authorPrincipal: Principal
|
|
435
|
+
readonly parts: readonly AgentMessagePart[]
|
|
436
|
+
readonly createdAt: string
|
|
437
|
+
}
|
|
438
|
+
|
|
425
439
|
export type AgentRunStreamEvent =
|
|
426
440
|
| (AgentRunStreamEventBase & {
|
|
427
441
|
readonly type: "agent.run.started"
|
|
@@ -449,6 +463,10 @@ export type AgentRunStreamEvent =
|
|
|
449
463
|
readonly chunkIndex: number
|
|
450
464
|
readonly chunk: ModelUiChunk
|
|
451
465
|
})
|
|
466
|
+
| (AgentRunStreamEventBase & {
|
|
467
|
+
readonly type: "agent.inbox.read"
|
|
468
|
+
readonly messages: readonly AgentInboxReadMessage[]
|
|
469
|
+
})
|
|
452
470
|
| (AgentRunStreamEventBase & {
|
|
453
471
|
readonly type: "agent.message.finalized"
|
|
454
472
|
readonly messageId: string
|
|
@@ -546,6 +564,12 @@ export function isAgentRunStreamEvent(value: unknown): value is AgentRunStreamEv
|
|
|
546
564
|
case "agent.ui.chunk":
|
|
547
565
|
// A chunk type this reader does not know fails here, so a newer producer's chunk is skipped.
|
|
548
566
|
return Number.isInteger(value.chunkIndex) && isModelUiChunk(value.chunk)
|
|
567
|
+
case "agent.inbox.read":
|
|
568
|
+
return (
|
|
569
|
+
Array.isArray(value.messages) &&
|
|
570
|
+
value.messages.length > 0 &&
|
|
571
|
+
value.messages.every(isAgentInboxReadMessage)
|
|
572
|
+
)
|
|
549
573
|
case "agent.message.finalized":
|
|
550
574
|
return typeof value.messageId === "string"
|
|
551
575
|
case "agent.run.finished":
|
|
@@ -559,6 +583,20 @@ export function isAgentRunStreamEvent(value: unknown): value is AgentRunStreamEv
|
|
|
559
583
|
}
|
|
560
584
|
}
|
|
561
585
|
|
|
586
|
+
function isAgentInboxReadMessage(value: unknown): value is AgentInboxReadMessage {
|
|
587
|
+
return (
|
|
588
|
+
isPlainRecord(value) &&
|
|
589
|
+
typeof value.id === "string" &&
|
|
590
|
+
isPlainRecord(value.authorPrincipal) &&
|
|
591
|
+
typeof value.authorPrincipal.type === "string" &&
|
|
592
|
+
typeof value.authorPrincipal.id === "string" &&
|
|
593
|
+
Array.isArray(value.parts) &&
|
|
594
|
+
value.parts.every((part) => isPlainRecord(part) && typeof part.type === "string") &&
|
|
595
|
+
isJsonValue(value.parts) &&
|
|
596
|
+
typeof value.createdAt === "string"
|
|
597
|
+
)
|
|
598
|
+
}
|
|
599
|
+
|
|
562
600
|
function isAgentContextCheckpointReason(value: unknown): value is AgentContextCheckpointReason {
|
|
563
601
|
return value === "threshold" || value === "overflow"
|
|
564
602
|
}
|
|
@@ -598,6 +636,8 @@ export function agentRunStreamIdempotencyKey(event: AgentRunStreamEvent): string
|
|
|
598
636
|
return `${event.runId}:${event.attempt}:compaction:${event.reason}:failed:${event.errorCode}`
|
|
599
637
|
case "agent.ui.chunk":
|
|
600
638
|
return `${event.runId}:${event.attempt}:chunk:${event.chunkIndex}`
|
|
639
|
+
case "agent.inbox.read":
|
|
640
|
+
return `${event.runId}:${event.attempt}:inbox:${event.messages.map((message) => message.id).join(",")}:read`
|
|
601
641
|
case "agent.message.finalized":
|
|
602
642
|
return `${event.runId}:${event.attempt}:message:${event.messageId}:finalized`
|
|
603
643
|
case "agent.run.finished":
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isJsonObject } from "../json"
|
|
2
|
+
import type { AgentRunRecord, AgentStorage } from "../storage/agents"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Whether the turn answered: it succeeded without asking a question the requester answers next.
|
|
6
|
+
* Only after one does a message queued for later start; after any other end, only one sent now.
|
|
7
|
+
*/
|
|
8
|
+
export async function turnAnsweredEveryMessage(
|
|
9
|
+
agents: AgentStorage,
|
|
10
|
+
run: AgentRunRecord
|
|
11
|
+
): Promise<boolean> {
|
|
12
|
+
if (run.status !== "succeeded") return false
|
|
13
|
+
const { messages } = await agents.messages.list({
|
|
14
|
+
projectId: run.projectId,
|
|
15
|
+
threadId: run.threadId,
|
|
16
|
+
roles: ["assistant"],
|
|
17
|
+
order: "desc",
|
|
18
|
+
limit: 1,
|
|
19
|
+
})
|
|
20
|
+
const answer = messages[0]
|
|
21
|
+
if (!answer || answer.runId !== run.id) return true
|
|
22
|
+
// `ask` answers `{ status: "asked" }`: the requester's next message is their answer, so a message
|
|
23
|
+
// they queued instead is not one.
|
|
24
|
+
return !answer.parts.some(
|
|
25
|
+
(part) =>
|
|
26
|
+
part.type === "tool-call" &&
|
|
27
|
+
part.state === "output-available" &&
|
|
28
|
+
isJsonObject(part.output) &&
|
|
29
|
+
part.output.status === "asked"
|
|
30
|
+
)
|
|
31
|
+
}
|
package/src/agents/validation.ts
CHANGED
|
@@ -34,16 +34,14 @@ export function canvasShapeFontSize(width: number, height: number): number {
|
|
|
34
34
|
export const SMALL_BOARD_PREVIEW_WIDTH = 480
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* How the
|
|
38
|
-
*
|
|
39
|
-
* within its 120 seconds; each attempt within `timeoutMs`, up to `attempts`, `backoffMs` apart.
|
|
37
|
+
* How the render worker renders a canvas's missing previews: `settleMs` after the last write that
|
|
38
|
+
* asked; each attempt within `timeoutMs`, up to `attempts`, `backoffMs` apart.
|
|
40
39
|
*
|
|
41
40
|
* `settleMs` is longer than a live canvas waits between two write-backs (`SAVE_MAX_MS` in the
|
|
42
41
|
* server's live rooms), so someone typing in a board is rendered once they pause.
|
|
43
42
|
*/
|
|
44
43
|
export const BOARD_PREVIEW_JOB = {
|
|
45
44
|
settleMs: 15_000,
|
|
46
|
-
graceMs: 180_000,
|
|
47
45
|
timeoutMs: 5 * 60_000,
|
|
48
46
|
attempts: 3,
|
|
49
47
|
backoffMs: 60_000,
|
|
@@ -51,11 +49,11 @@ export const BOARD_PREVIEW_JOB = {
|
|
|
51
49
|
|
|
52
50
|
/**
|
|
53
51
|
* How long after a canvas version is published a missing board preview is still worth waiting
|
|
54
|
-
* for: the job's
|
|
52
|
+
* for: the job's settling, then every one of its attempts and the waits between them. Past it,
|
|
55
53
|
* nothing more will come, so the server says so and a viewer stops asking.
|
|
56
54
|
*/
|
|
57
55
|
export const BOARD_PREVIEW_WAIT_MS =
|
|
58
|
-
BOARD_PREVIEW_JOB.
|
|
56
|
+
BOARD_PREVIEW_JOB.settleMs +
|
|
59
57
|
BOARD_PREVIEW_JOB.attempts * BOARD_PREVIEW_JOB.timeoutMs +
|
|
60
58
|
(BOARD_PREVIEW_JOB.attempts - 1) * BOARD_PREVIEW_JOB.backoffMs
|
|
61
59
|
|
|
@@ -19,6 +19,10 @@ import { ARTIFACT_COMMENT_LIMITS } from "./limits"
|
|
|
19
19
|
// Comments on an artifact: whoever reads it reads and adds them, a shared link's guest included;
|
|
20
20
|
// their author, or whoever may change the artifact, resolves or deletes them, and only the latter a
|
|
21
21
|
// guest's. Each change is announced to its readers.
|
|
22
|
+
//
|
|
23
|
+
// A thread is the team's unless a guest started it. A guest reads only the threads started by a
|
|
24
|
+
// guest of the same link, themselves or whoever else opened it, with every reply, a member's
|
|
25
|
+
// included: the team's threads are missing to them, as if there were none.
|
|
22
26
|
|
|
23
27
|
/** A comment to add, or a reply. */
|
|
24
28
|
export interface ArtifactCommentInput {
|
|
@@ -38,18 +42,22 @@ export interface ArtifactCommentInput {
|
|
|
38
42
|
|
|
39
43
|
/** The comment methods of the artifacts runtime. */
|
|
40
44
|
export interface ArtifactCommentsRuntime {
|
|
41
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Every comment and reply the caller reads, oldest first: a shared link's guest, only its link's
|
|
47
|
+
* threads. `null` when the caller cannot read the artifact.
|
|
48
|
+
*/
|
|
42
49
|
listComments(artifactId: string): Promise<ArtifactCommentRecord[] | null>
|
|
43
50
|
/**
|
|
44
51
|
* Adds a comment, or a reply, authored by the caller, who must read the artifact. A shared link's
|
|
45
52
|
* guest writes it under the name they gave, and is refused with `name_required` until they give
|
|
46
53
|
* one. Throws `invalid_comment` for words or an anchor that will not do, `comment_not_found` for
|
|
47
|
-
* a reply to no comment, and `comments_full`.
|
|
54
|
+
* a reply to no comment the caller reads, and `comments_full`.
|
|
48
55
|
*/
|
|
49
56
|
addComment(artifactId: string, input: ArtifactCommentInput): Promise<ArtifactCommentRecord>
|
|
50
57
|
/**
|
|
51
58
|
* Marks a comment resolved, or opens it again. Its author or whoever may change the artifact
|
|
52
|
-
* may: anyone else, and every guest, is refused with `not_allowed
|
|
59
|
+
* may: anyone else, and every guest, is refused with `not_allowed`, or `comment_not_found` for a
|
|
60
|
+
* guest's comment they do not read.
|
|
53
61
|
*/
|
|
54
62
|
resolveComment(
|
|
55
63
|
artifactId: string,
|
|
@@ -72,11 +80,29 @@ export function createArtifactCommentsRuntime(input: {
|
|
|
72
80
|
readonly author: () => Promise<ArtifactCommentAuthor>
|
|
73
81
|
/** Who resolves or deletes one; throws `not_allowed` for a caller who never may. */
|
|
74
82
|
readonly manager: () => Principal
|
|
83
|
+
/**
|
|
84
|
+
* For a shared link's guest, the link they came through, by its grant: they read only the
|
|
85
|
+
* threads its guests started. Without it, a member reads every thread.
|
|
86
|
+
*/
|
|
87
|
+
readonly guest?: { readonly grantId?: string }
|
|
75
88
|
readonly reach: (
|
|
76
89
|
artifactId: string
|
|
77
90
|
) => Promise<{ readonly artifact: ArtifactRecord; readonly access: ArtifactAccess } | null>
|
|
78
91
|
}): ArtifactCommentsRuntime {
|
|
79
|
-
const { projectId, events } = input
|
|
92
|
+
const { projectId, events, guest } = input
|
|
93
|
+
|
|
94
|
+
/** The thread a comment is in: the comment itself, or the one it replies to. */
|
|
95
|
+
const threadOf = (comment: ArtifactCommentRecord) =>
|
|
96
|
+
comment.parentId === undefined
|
|
97
|
+
? Promise.resolve(comment)
|
|
98
|
+
: input
|
|
99
|
+
.storage()
|
|
100
|
+
.getComment({ projectId, artifactId: comment.artifactId, id: comment.parentId })
|
|
101
|
+
|
|
102
|
+
/** Whether the caller reads this thread: a member every one, a guest only its link's. */
|
|
103
|
+
const reads = (thread: ArtifactCommentRecord | null): thread is ArtifactCommentRecord =>
|
|
104
|
+
thread !== null &&
|
|
105
|
+
(!guest || (guest.grantId !== undefined && threadLink(thread) === guest.grantId))
|
|
80
106
|
|
|
81
107
|
/** The artifact the caller reads; refused with why otherwise. */
|
|
82
108
|
const readable = async (artifactId: string) => {
|
|
@@ -91,12 +117,16 @@ export function createArtifactCommentsRuntime(input: {
|
|
|
91
117
|
return reached
|
|
92
118
|
}
|
|
93
119
|
|
|
94
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* A comment the caller may resolve or delete, with its thread: theirs, or one on an artifact they
|
|
122
|
+
* may change. One in a thread they do not read is missing.
|
|
123
|
+
*/
|
|
95
124
|
const managed = async (artifactId: string, commentId: string) => {
|
|
96
125
|
const { access } = await readable(artifactId)
|
|
97
|
-
const manager = input.manager()
|
|
98
126
|
const comment = await input.storage().getComment({ projectId, artifactId, id: commentId })
|
|
99
|
-
|
|
127
|
+
const thread = comment ? await threadOf(comment) : null
|
|
128
|
+
if (!comment || !reads(thread)) throw commentNotFound(artifactId, commentId)
|
|
129
|
+
const manager = input.manager()
|
|
100
130
|
|
|
101
131
|
// A guest's comment is managed by those who may change the artifact, never by a guest.
|
|
102
132
|
const changes = access === "owner" || access === "update"
|
|
@@ -107,14 +137,23 @@ export function createArtifactCommentsRuntime(input: {
|
|
|
107
137
|
"[Sixb] Only a comment's author, or whoever may change the artifact, resolves or deletes it."
|
|
108
138
|
)
|
|
109
139
|
}
|
|
110
|
-
return comment
|
|
140
|
+
return { comment, thread }
|
|
111
141
|
}
|
|
112
142
|
|
|
113
143
|
return {
|
|
114
144
|
async listComments(artifactId) {
|
|
115
145
|
const reached = await input.reach(artifactId)
|
|
116
146
|
if (!reached || reached.access === "none") return null
|
|
117
|
-
|
|
147
|
+
|
|
148
|
+
const comments = await input.storage().listComments({ projectId, id: artifactId })
|
|
149
|
+
if (!guest) return comments
|
|
150
|
+
|
|
151
|
+
const threads = new Set(
|
|
152
|
+
comments
|
|
153
|
+
.filter((comment) => comment.parentId === undefined && reads(comment))
|
|
154
|
+
.map((comment) => comment.id)
|
|
155
|
+
)
|
|
156
|
+
return comments.filter((comment) => threads.has(comment.parentId ?? comment.id))
|
|
118
157
|
},
|
|
119
158
|
|
|
120
159
|
async addComment(artifactId, comment) {
|
|
@@ -129,11 +168,12 @@ export function createArtifactCommentsRuntime(input: {
|
|
|
129
168
|
)
|
|
130
169
|
}
|
|
131
170
|
|
|
132
|
-
// A reply is about what it replies to.
|
|
171
|
+
// A reply is about what it replies to, in a thread the caller reads.
|
|
133
172
|
let anchor: ArtifactCommentAnchor
|
|
173
|
+
let parent: ArtifactCommentRecord | null = null
|
|
134
174
|
if (comment.parentId !== undefined) {
|
|
135
|
-
|
|
136
|
-
if (!parent) throw commentNotFound(artifactId, comment.parentId)
|
|
175
|
+
parent = await storage.getComment({ projectId, artifactId, id: comment.parentId })
|
|
176
|
+
if (!reads(parent)) throw commentNotFound(artifactId, comment.parentId)
|
|
137
177
|
anchor = parent.anchor
|
|
138
178
|
} else {
|
|
139
179
|
anchor = await checkAnchor(storage, artifact, comment.anchor ?? {})
|
|
@@ -151,7 +191,7 @@ export function createArtifactCommentsRuntime(input: {
|
|
|
151
191
|
...(comment.origin ? { origin: comment.origin } : {}),
|
|
152
192
|
createdAt: new Date(),
|
|
153
193
|
})
|
|
154
|
-
await announceArtifactComment(events, created, "created")
|
|
194
|
+
await announceArtifactComment(events, created, threadLink(parent ?? created), "created")
|
|
155
195
|
return created
|
|
156
196
|
} catch (error) {
|
|
157
197
|
throw commentRequestError(error)
|
|
@@ -159,7 +199,7 @@ export function createArtifactCommentsRuntime(input: {
|
|
|
159
199
|
},
|
|
160
200
|
|
|
161
201
|
async resolveComment(artifactId, commentId, resolved = true) {
|
|
162
|
-
await managed(artifactId, commentId)
|
|
202
|
+
const { thread } = await managed(artifactId, commentId)
|
|
163
203
|
const changed = await input.storage().resolveComment({
|
|
164
204
|
projectId,
|
|
165
205
|
artifactId,
|
|
@@ -168,20 +208,33 @@ export function createArtifactCommentsRuntime(input: {
|
|
|
168
208
|
})
|
|
169
209
|
if (!changed) throw commentNotFound(artifactId, commentId)
|
|
170
210
|
|
|
171
|
-
await announceArtifactComment(
|
|
211
|
+
await announceArtifactComment(
|
|
212
|
+
events,
|
|
213
|
+
changed,
|
|
214
|
+
threadLink(thread),
|
|
215
|
+
resolved ? "resolved" : "reopened"
|
|
216
|
+
)
|
|
172
217
|
return changed
|
|
173
218
|
},
|
|
174
219
|
|
|
175
220
|
async deleteComment(artifactId, commentId) {
|
|
176
|
-
const comment = await managed(artifactId, commentId)
|
|
221
|
+
const { comment, thread } = await managed(artifactId, commentId)
|
|
177
222
|
const deleted = await input.storage().deleteComment({ projectId, artifactId, id: commentId })
|
|
178
223
|
if (!deleted) throw commentNotFound(artifactId, commentId)
|
|
179
224
|
|
|
180
|
-
await announceArtifactComment(events, comment, "deleted")
|
|
225
|
+
await announceArtifactComment(events, comment, threadLink(thread), "deleted")
|
|
181
226
|
},
|
|
182
227
|
}
|
|
183
228
|
}
|
|
184
229
|
|
|
230
|
+
/**
|
|
231
|
+
* The shared link whose guests read a thread, by its grant: the one its first comment's guest came
|
|
232
|
+
* through. None for a thread a member started, which is the team's.
|
|
233
|
+
*/
|
|
234
|
+
function threadLink(thread: Pick<ArtifactCommentRecord, "author">): string | undefined {
|
|
235
|
+
return thread.author.type === "guest" ? thread.author.grantId : undefined
|
|
236
|
+
}
|
|
237
|
+
|
|
185
238
|
/**
|
|
186
239
|
* The anchor as it is kept: a board the canvas's latest version shows, an element's address
|
|
187
240
|
* under it, its label cut to length, and a revision the artifact has had.
|