@sixb/core 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.js +41 -40
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/validation.d.ts.map +1 -1
- package/dist/agents/errors.d.ts +1 -1
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +50 -3
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/ids.d.ts +2 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +7 -5
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +74 -50
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-routing.d.ts +5 -2
- package/dist/agents/model-routing.d.ts.map +1 -1
- package/dist/agents/queued-turn.d.ts +16 -0
- package/dist/agents/queued-turn.d.ts.map +1 -0
- package/dist/agents/request.d.ts +120 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-after-finish.d.ts +10 -0
- package/dist/agents/run-after-finish.d.ts.map +1 -1
- package/dist/agents/run-artifacts.d.ts +0 -38
- package/dist/agents/run-artifacts.d.ts.map +1 -1
- package/dist/agents/run-events.d.ts +10 -1
- package/dist/agents/run-events.d.ts.map +1 -1
- package/dist/agents/run-session-children.d.ts.map +1 -1
- package/dist/agents/run-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session.d.ts +14 -1
- package/dist/agents/run-session.d.ts.map +1 -1
- package/dist/agents/run-turn.d.ts +9 -1
- package/dist/agents/run-turn.d.ts.map +1 -1
- package/dist/agents/streams/index.d.ts +1 -1
- package/dist/agents/streams/index.d.ts.map +1 -1
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.d.ts +2 -1
- package/dist/agents/streams/internal.d.ts.map +1 -1
- package/dist/agents/streams/internal.js +22 -2
- package/dist/agents/streams/internal.js.map +1 -1
- package/dist/agents/streams/protocol.d.ts +53 -0
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/streams/steps.d.ts +24 -0
- package/dist/agents/streams/steps.d.ts.map +1 -0
- package/dist/agents/thread-access.d.ts +44 -2
- package/dist/agents/thread-access.d.ts.map +1 -1
- package/dist/agents/turn-answered.d.ts +7 -0
- package/dist/agents/turn-answered.d.ts.map +1 -0
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/artifacts/canvas-display.d.ts +3 -5
- package/dist/artifacts/canvas-display.d.ts.map +1 -1
- package/dist/artifacts/comments.d.ts +14 -3
- package/dist/artifacts/comments.d.ts.map +1 -1
- package/dist/artifacts/document-fill.d.ts +18 -0
- package/dist/artifacts/document-fill.d.ts.map +1 -0
- package/dist/artifacts/errors.d.ts +1 -1
- package/dist/artifacts/errors.d.ts.map +1 -1
- package/dist/artifacts/events.d.ts +3 -2
- package/dist/artifacts/events.d.ts.map +1 -1
- package/dist/artifacts/execution.d.ts +40 -4
- package/dist/artifacts/execution.d.ts.map +1 -1
- package/dist/artifacts/frames/assets.d.ts +8 -1
- package/dist/artifacts/frames/assets.d.ts.map +1 -1
- package/dist/artifacts/frames/document-data.d.ts +98 -0
- package/dist/artifacts/frames/document-data.d.ts.map +1 -0
- package/dist/artifacts/frames/entries.d.ts +12 -7
- package/dist/artifacts/frames/entries.d.ts.map +1 -1
- package/dist/artifacts/frames/index.d.ts +2 -1
- package/dist/artifacts/frames/index.d.ts.map +1 -1
- package/dist/artifacts/frames/index.js +22 -13
- package/dist/artifacts/frames/index.js.map +4 -4
- package/dist/artifacts/frames/kit.d.ts +15 -0
- package/dist/artifacts/frames/kit.d.ts.map +1 -1
- package/dist/artifacts/frames/protocol.d.ts +12 -1
- package/dist/artifacts/frames/protocol.d.ts.map +1 -1
- package/dist/artifacts/frames/runtime.d.ts +24 -4
- package/dist/artifacts/frames/runtime.d.ts.map +1 -1
- package/dist/artifacts/index.d.ts +3 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +9 -3
- package/dist/artifacts/index.js.map +3 -3
- package/dist/artifacts/live/blocks.d.ts +62 -0
- package/dist/artifacts/live/blocks.d.ts.map +1 -0
- package/dist/artifacts/live/board.d.ts +6 -0
- package/dist/artifacts/live/board.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts +12 -0
- package/dist/artifacts/live/document.d.ts.map +1 -1
- package/dist/artifacts/live/index.d.ts +2 -0
- package/dist/artifacts/live/index.d.ts.map +1 -1
- package/dist/artifacts/live/index.js +148 -44
- package/dist/artifacts/live/index.js.map +3 -3
- package/dist/artifacts/live/page.d.ts +49 -0
- package/dist/artifacts/live/page.d.ts.map +1 -0
- package/dist/artifacts/live/protocol.d.ts +5 -0
- package/dist/artifacts/live/protocol.d.ts.map +1 -1
- package/dist/artifacts/live/server.d.ts +2 -2
- package/dist/artifacts/live/server.d.ts.map +1 -1
- package/dist/artifacts/live/server.js +29 -24
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/live/state.d.ts +4 -1
- package/dist/artifacts/live/state.d.ts.map +1 -1
- package/dist/artifacts/outline.d.ts +16 -0
- package/dist/artifacts/outline.d.ts.map +1 -1
- package/dist/artifacts/paper.d.ts +22 -0
- package/dist/artifacts/paper.d.ts.map +1 -0
- package/dist/artifacts/pdf-job.d.ts +9 -0
- package/dist/artifacts/pdf-job.d.ts.map +1 -0
- package/dist/artifacts/publish/fields.d.ts +25 -0
- package/dist/artifacts/publish/fields.d.ts.map +1 -0
- package/dist/artifacts/publish/index.d.ts +2 -1
- package/dist/artifacts/publish/index.d.ts.map +1 -1
- package/dist/artifacts/publish/index.js +32 -23
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +7 -6
- package/dist/artifacts/publish/merge.d.ts.map +1 -1
- package/dist/artifacts/publish/pdf.d.ts +28 -0
- package/dist/artifacts/publish/pdf.d.ts.map +1 -0
- package/dist/artifacts/publish/previews.d.ts +12 -20
- package/dist/artifacts/publish/previews.d.ts.map +1 -1
- package/dist/artifacts/publish/publish.d.ts.map +1 -1
- package/dist/artifacts/publish/queries.d.ts +6 -1
- package/dist/artifacts/publish/queries.d.ts.map +1 -1
- package/dist/artifacts/publish/query-answers.d.ts +5 -2
- package/dist/artifacts/publish/query-answers.d.ts.map +1 -1
- package/dist/artifacts/publish/validate/document-html.d.ts +24 -0
- package/dist/artifacts/publish/validate/document-html.d.ts.map +1 -0
- package/dist/artifacts/publish/validate/document.d.ts +5 -3
- package/dist/artifacts/publish/validate/document.d.ts.map +1 -1
- package/dist/artifacts/queries.d.ts +16 -2
- package/dist/artifacts/queries.d.ts.map +1 -1
- package/dist/artifacts/run-query.d.ts.map +1 -1
- package/dist/auth/index.js +6 -6
- package/dist/authorization/event-visibility.d.ts.map +1 -1
- package/dist/authorization/index.js +2 -2
- package/dist/blob-storage/index.js +1 -1
- package/dist/bootstrap/index.js +50 -48
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/calendar.d.ts +55 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +19 -0
- package/dist/calendar.js.map +9 -0
- package/dist/{chunk-5a4a52tq.js → chunk-0pmpwn3g.js} +18 -2
- package/dist/chunk-0pmpwn3g.js.map +10 -0
- package/dist/{chunk-0k3r5kb3.js → chunk-394zjzjs.js} +20 -10
- package/dist/{chunk-0k3r5kb3.js.map → chunk-394zjzjs.js.map} +5 -5
- package/dist/{chunk-stmxh0hv.js → chunk-3neam1y5.js} +2 -2
- package/dist/{chunk-zeykm8my.js → chunk-3qtk0070.js} +16 -42
- package/dist/chunk-3qtk0070.js.map +14 -0
- package/dist/{chunk-p8pgnq8d.js → chunk-425ydk65.js} +5 -5
- package/dist/{chunk-p351afzm.js → chunk-5sswe5ej.js} +2 -2
- package/dist/{chunk-a6fjkcne.js → chunk-60662fyv.js} +54 -28
- package/dist/{chunk-a6fjkcne.js.map → chunk-60662fyv.js.map} +7 -6
- package/dist/{chunk-e0hnbb1m.js → chunk-61zptves.js} +1 -1
- package/dist/chunk-6hfbz4d0.js +98 -0
- package/dist/chunk-6hfbz4d0.js.map +10 -0
- package/dist/{chunk-3zagkr6w.js → chunk-7mhbs9yy.js} +4 -4
- package/dist/{chunk-3zagkr6w.js.map → chunk-7mhbs9yy.js.map} +1 -1
- package/dist/{chunk-gxwy4c3s.js → chunk-7r9mqpva.js} +570 -104
- package/dist/chunk-7r9mqpva.js.map +47 -0
- package/dist/{chunk-3014rfjz.js → chunk-88xeh6zx.js} +28 -8
- package/dist/{chunk-3014rfjz.js.map → chunk-88xeh6zx.js.map} +4 -4
- package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
- package/dist/chunk-8tv3qd65.js.map +12 -0
- package/dist/chunk-90nqenq8.js +386 -0
- package/dist/chunk-90nqenq8.js.map +14 -0
- package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
- package/dist/{chunk-w1wq7gfr.js → chunk-9c9yknwt.js} +464 -29
- package/dist/{chunk-w1wq7gfr.js.map → chunk-9c9yknwt.js.map} +7 -7
- package/dist/{chunk-q9nkpr8k.js → chunk-9tpmfh3n.js} +1 -1
- package/dist/chunk-9wr3yajk.js.map +2 -2
- package/dist/{chunk-rtm1jq00.js → chunk-ats8y3d9.js} +1202 -246
- package/dist/{chunk-rtm1jq00.js.map → chunk-ats8y3d9.js.map} +16 -14
- package/dist/{chunk-td26wjr5.js → chunk-bcz9dxtf.js} +17 -47
- package/dist/chunk-bcz9dxtf.js.map +12 -0
- package/dist/chunk-bqr703h4.js +1799 -0
- package/dist/chunk-bqr703h4.js.map +13 -0
- package/dist/{chunk-sysnvjce.js → chunk-brhp9d97.js} +2 -2
- package/dist/{chunk-8a8k38tz.js → chunk-brybqw5k.js} +1 -1
- package/dist/{chunk-rsxb14an.js → chunk-bs1sd0e0.js} +12 -8
- package/dist/chunk-bs1sd0e0.js.map +18 -0
- package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
- package/dist/chunk-c29729me.js.map +12 -0
- package/dist/{chunk-855w9nvw.js → chunk-cg7cygfj.js} +1 -1
- package/dist/chunk-dq3t5sr3.js +114 -0
- package/dist/chunk-dq3t5sr3.js.map +11 -0
- package/dist/{chunk-t24yktqr.js → chunk-dvgc56n2.js} +20 -4
- package/dist/{chunk-t24yktqr.js.map → chunk-dvgc56n2.js.map} +5 -5
- package/dist/{chunk-r2psmn42.js → chunk-eg6xqef7.js} +1 -1
- package/dist/{chunk-7kpqntgw.js → chunk-f05994as.js} +1 -1
- package/dist/{chunk-msyevpp3.js → chunk-fmgf9h5e.js} +38 -14
- package/dist/chunk-fmgf9h5e.js.map +22 -0
- package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
- package/dist/chunk-fzbhybya.js.map +11 -0
- package/dist/{chunk-t0s7b3d1.js → chunk-gaj8djsw.js} +251 -6
- package/dist/chunk-gaj8djsw.js.map +13 -0
- package/dist/{chunk-2bn6813a.js → chunk-grt2j5vp.js} +2 -2
- package/dist/{chunk-s7xqfxs9.js → chunk-hkbks1xm.js} +3 -1
- package/dist/{chunk-s7xqfxs9.js.map → chunk-hkbks1xm.js.map} +3 -3
- package/dist/chunk-hn2r7z41.js.map +1 -1
- package/dist/{chunk-rtdrm592.js → chunk-htdzx40w.js} +2 -2
- package/dist/{chunk-bc3y6gff.js → chunk-jka26v8c.js} +1 -1
- package/dist/{chunk-yy914zfr.js → chunk-jt012fxq.js} +772 -98
- package/dist/chunk-jt012fxq.js.map +34 -0
- package/dist/{chunk-48c1z8nj.js → chunk-kft7mp7z.js} +28 -3
- package/dist/chunk-kft7mp7z.js.map +10 -0
- package/dist/chunk-mbwsgjn7.js +40 -0
- package/dist/chunk-mbwsgjn7.js.map +11 -0
- package/dist/{chunk-wa05txmk.js → chunk-n1hbwc6y.js} +51 -8
- package/dist/chunk-n1hbwc6y.js.map +12 -0
- package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
- package/dist/chunk-nxysqbt0.js.map +10 -0
- package/dist/{chunk-6ef4esq4.js → chunk-pqj8vff9.js} +4 -4
- package/dist/chunk-pvpq483h.js.map +2 -2
- package/dist/{chunk-mzx71snp.js → chunk-q7g9cqwt.js} +7 -2
- package/dist/{chunk-mzx71snp.js.map → chunk-q7g9cqwt.js.map} +3 -3
- package/dist/{chunk-n68vz95m.js → chunk-qbd282aa.js} +2 -2
- package/dist/{chunk-e91fmg6t.js → chunk-qsa7nw6f.js} +2 -1
- package/dist/{chunk-e91fmg6t.js.map → chunk-qsa7nw6f.js.map} +3 -3
- package/dist/{chunk-rsrc7vtw.js → chunk-s8xxef60.js} +240 -46
- package/dist/chunk-s8xxef60.js.map +50 -0
- package/dist/{chunk-r9rtavg9.js → chunk-t19wjmnc.js} +7 -7
- package/dist/{chunk-vzkxqf8h.js → chunk-tapdssb5.js} +50 -6
- package/dist/chunk-tapdssb5.js.map +23 -0
- package/dist/{chunk-dhkc9b23.js → chunk-v8a1qjzp.js} +1 -1
- package/dist/{chunk-hvbvq7p4.js → chunk-vs2s3p8n.js} +731 -10
- package/dist/chunk-vs2s3p8n.js.map +20 -0
- package/dist/chunk-vtjzwymr.js.map +2 -2
- package/dist/{chunk-8t2ynwg0.js → chunk-wzcjhv54.js} +31 -1
- package/dist/{chunk-8t2ynwg0.js.map → chunk-wzcjhv54.js.map} +3 -3
- package/dist/{chunk-8tqnsx3q.js → chunk-xavet0qs.js} +5 -3
- package/dist/{chunk-8tqnsx3q.js.map → chunk-xavet0qs.js.map} +3 -3
- package/dist/{chunk-8bns0y68.js → chunk-xf76csps.js} +5 -5
- package/dist/{chunk-cwdzcv37.js → chunk-xrmbhap8.js} +2 -2
- package/dist/{chunk-cwdzcv37.js.map → chunk-xrmbhap8.js.map} +2 -2
- package/dist/{chunk-f6ahf5gf.js → chunk-xxfj0rr2.js} +20 -5
- package/dist/chunk-xxfj0rr2.js.map +13 -0
- package/dist/{chunk-3hzhcfsv.js → chunk-y8fwm3z2.js} +2 -2
- package/dist/{chunk-3hzhcfsv.js.map → chunk-y8fwm3z2.js.map} +3 -3
- package/dist/{chunk-smnt672s.js → chunk-ygvay56w.js} +20 -4
- package/dist/chunk-ygvay56w.js.map +10 -0
- package/dist/{chunk-evj5jxz3.js → chunk-ykchk644.js} +63 -15
- package/dist/{chunk-evj5jxz3.js.map → chunk-ykchk644.js.map} +7 -7
- package/dist/{chunk-vepea5c3.js → chunk-ym1bqd98.js} +6 -6
- package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
- package/dist/chunk-z4jqb44a.js.map +10 -0
- package/dist/connectors/connection-handles.d.ts +9 -0
- package/dist/connectors/connection-handles.d.ts.map +1 -0
- package/dist/connectors/connections/authorizations.d.ts +9 -0
- package/dist/connectors/connections/authorizations.d.ts.map +1 -1
- package/dist/connectors/connections/capability.d.ts +11 -0
- package/dist/connectors/connections/capability.d.ts.map +1 -1
- package/dist/connectors/connections/events.d.ts +17 -0
- package/dist/connectors/connections/events.d.ts.map +1 -0
- package/dist/connectors/connections/internal.d.ts +2 -1
- package/dist/connectors/connections/internal.d.ts.map +1 -1
- package/dist/connectors/connections/internal.js +8 -4
- package/dist/connectors/connections/internal.js.map +1 -1
- package/dist/connectors/connections/runs.d.ts +3 -0
- package/dist/connectors/connections/runs.d.ts.map +1 -1
- package/dist/connectors/connections/service.d.ts +13 -1
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/execution.d.ts +14 -2
- package/dist/connectors/execution.d.ts.map +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/service.d.ts +5 -1
- package/dist/connectors/service.d.ts.map +1 -1
- package/dist/connectors/types.d.ts +22 -1
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/datasets/write.js +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +3 -2
- package/dist/deploy/internal.js.map +3 -3
- package/dist/deploy/services.d.ts.map +1 -1
- package/dist/deploy/types.d.ts +22 -2
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/events/definitions.d.ts +4 -0
- package/dist/events/definitions.d.ts.map +1 -1
- package/dist/events/execution.d.ts +8 -1
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +3 -3
- package/dist/events/outbox-dispatcher.d.ts +7 -0
- package/dist/events/outbox-dispatcher.d.ts.map +1 -1
- package/dist/events/scope.d.ts +1 -0
- package/dist/events/scope.d.ts.map +1 -1
- package/dist/events/scope.js +1 -1
- package/dist/events/selectors/builder.d.ts +9 -1
- package/dist/events/selectors/builder.d.ts.map +1 -1
- package/dist/events/selectors/index.d.ts +2 -2
- package/dist/events/selectors/index.d.ts.map +1 -1
- package/dist/events/selectors/index.js +2 -2
- package/dist/events/selectors/predicate.d.ts.map +1 -1
- package/dist/events/selectors/types.d.ts +18 -3
- package/dist/events/selectors/types.d.ts.map +1 -1
- package/dist/events/types/artifacts.d.ts +7 -1
- package/dist/events/types/artifacts.d.ts.map +1 -1
- package/dist/events/types/connectors.d.ts +32 -0
- package/dist/events/types/connectors.d.ts.map +1 -0
- package/dist/events/types/index.d.ts +3 -1
- package/dist/events/types/index.d.ts.map +1 -1
- package/dist/events/types/syncs.d.ts +4 -0
- package/dist/events/types/syncs.d.ts.map +1 -1
- package/dist/execution/agent.js +43 -42
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts +5 -0
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +4 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/object-reader-ontology.d.ts +3 -0
- package/dist/execution/object-reader-ontology.d.ts.map +1 -1
- package/dist/execution/primitive.js +41 -40
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.d.ts +1 -1
- package/dist/execution/request.d.ts.map +1 -1
- package/dist/execution/request.js +39 -38
- package/dist/execution/request.js.map +3 -3
- package/dist/execution/scopes.d.ts +8 -0
- package/dist/execution/scopes.d.ts.map +1 -1
- package/dist/execution/script.d.ts +7 -0
- package/dist/execution/script.d.ts.map +1 -0
- package/dist/execution/types.d.ts +16 -1
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +13 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -70
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +1 -1
- package/dist/lineage/executors.d.ts +1 -1
- package/dist/lineage/executors.d.ts.map +1 -1
- package/dist/maintenance/index.js +2 -2
- package/dist/materialization/event-envelopes.d.ts +3 -3
- package/dist/materialization/event-envelopes.d.ts.map +1 -1
- package/dist/materialization/events.d.ts +6 -0
- package/dist/materialization/events.d.ts.map +1 -1
- package/dist/materialization/index.js +1 -1
- package/dist/materialization/model.d.ts +6 -0
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/index.js +24 -23
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/projections/replace.d.ts.map +1 -1
- package/dist/materializer/projections/replacement-plan.d.ts +2 -0
- package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
- package/dist/materializer/shared/normalize.d.ts +1 -0
- package/dist/materializer/shared/normalize.d.ts.map +1 -1
- package/dist/models/audio/runtime.d.ts.map +1 -1
- package/dist/models/audio/types.d.ts +19 -0
- package/dist/models/audio/types.d.ts.map +1 -1
- package/dist/models/execution/index.js +22 -21
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/objects/index.js +41 -40
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/executor.d.ts +3 -1
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/explain.d.ts +3 -1
- package/dist/objects/query/explain.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +1 -1
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +21 -20
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/link-query-clearance.d.ts +3 -0
- package/dist/objects/query/link-query-clearance.d.ts.map +1 -1
- package/dist/objects/query/links.d.ts +1 -1
- package/dist/objects/query/links.d.ts.map +1 -1
- package/dist/objects/query/validate.d.ts +17 -0
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
- package/dist/ontology/index.js +3 -3
- package/dist/ontology/internal.js +3 -3
- package/dist/pipelines/index.js +27 -26
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/builders.d.ts +7 -1
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/index.d.ts +1 -1
- package/dist/projections/index.d.ts.map +1 -1
- package/dist/projections/internal.js +22 -21
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/types.d.ts +10 -0
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/queues/in-memory.d.ts +3 -2
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +40 -13
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +13 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +1 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +47 -25
- package/dist/runtime/internal.js.map +4 -3
- package/dist/runtime/locale.d.ts +0 -2
- package/dist/runtime/locale.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +1 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/script.d.ts +39 -0
- package/dist/runtime/script.d.ts.map +1 -0
- package/dist/runtime/sixb.d.ts +2 -2
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/auth.d.ts +26 -4
- package/dist/sandboxes/auth.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +3 -1
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +5 -5
- package/dist/schedules/builders.d.ts.map +1 -1
- package/dist/schedules/index.js +3 -3
- package/dist/schedules/runtime.d.ts.map +1 -1
- package/dist/schedules/validation.d.ts +2 -0
- package/dist/schedules/validation.d.ts.map +1 -1
- package/dist/security/view-conditions.d.ts.map +1 -1
- package/dist/shares/internal.js +19 -18
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/errors.d.ts +1 -1
- package/dist/storage/agents/errors.d.ts.map +1 -1
- package/dist/storage/agents/in-memory.d.ts +43 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +2 -2
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts +54 -11
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +41 -5
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +291 -3
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +3 -2
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +4 -3
- package/dist/storage/ai-cost/provider.js.map +1 -1
- package/dist/storage/ai-cost/types.d.ts +5 -1
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/artifacts/in-memory.d.ts +7 -1
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
- package/dist/storage/artifacts/index.d.ts +1 -1
- package/dist/storage/artifacts/index.d.ts.map +1 -1
- package/dist/storage/artifacts/record.d.ts +5 -2
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +41 -0
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/executions/provider.d.ts +3 -3
- package/dist/storage/executions/provider.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +1 -1
- package/dist/storage/executions/types.d.ts +6 -0
- package/dist/storage/executions/types.d.ts.map +1 -1
- package/dist/storage/executions/validation.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +7 -7
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +30 -25
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +1 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +12 -10
- package/dist/storage/internal.js.map +2 -2
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts +2 -0
- package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +1 -1
- package/dist/storage/ontology/replacement-plans.d.ts +8 -0
- package/dist/storage/ontology/replacement-plans.d.ts.map +1 -1
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +1 -1
- package/dist/storage/sync-runs/idempotency.d.ts.map +1 -1
- package/dist/storage/sync-runs/in-memory.d.ts +2 -1
- package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/sync-runs/index.d.ts +1 -1
- package/dist/storage/sync-runs/index.d.ts.map +1 -1
- package/dist/storage/sync-runs/types.d.ts +27 -2
- package/dist/storage/sync-runs/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +7 -7
- package/dist/syncs/accounts.d.ts +36 -0
- package/dist/syncs/accounts.d.ts.map +1 -0
- package/dist/syncs/builders.d.ts.map +1 -1
- package/dist/syncs/connections.d.ts +36 -0
- package/dist/syncs/connections.d.ts.map +1 -0
- package/dist/syncs/execution.d.ts +14 -4
- package/dist/syncs/execution.d.ts.map +1 -1
- package/dist/syncs/index.d.ts +2 -1
- package/dist/syncs/index.d.ts.map +1 -1
- package/dist/syncs/index.js +28 -27
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/request.d.ts +16 -2
- package/dist/syncs/request.d.ts.map +1 -1
- package/dist/syncs/run-dispatch.d.ts +14 -2
- package/dist/syncs/run-dispatch.d.ts.map +1 -1
- package/dist/testing/agent-approval-storage-contract.d.ts.map +1 -1
- package/dist/testing/agent-execution.d.ts +3 -0
- package/dist/testing/agent-execution.d.ts.map +1 -1
- package/dist/testing/agent-inbox-storage-contract.d.ts +15 -0
- package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -0
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6589 -4627
- package/dist/testing/index.js.map +13 -12
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/testing/run-claim-storage-contract.d.ts.map +1 -1
- package/dist/webhooks/connections.d.ts +3 -4
- package/dist/webhooks/connections.d.ts.map +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.d.ts.map +1 -1
- package/dist/webhooks/internal.js +22 -54
- package/dist/webhooks/internal.js.map +3 -3
- package/dist/webhooks/types.d.ts +2 -11
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/workers/index.js +66 -13
- package/dist/workers/index.js.map +4 -4
- package/dist/workers/queue-worker.d.ts +5 -0
- package/dist/workers/queue-worker.d.ts.map +1 -1
- package/dist/workers/queued-run-dispatch.d.ts.map +1 -1
- package/dist/workers/worker.d.ts +8 -0
- package/dist/workers/worker.d.ts.map +1 -1
- package/dist/workflows/index.js +50 -48
- package/dist/workflows/index.js.map +1 -1
- package/package.json +12 -1
- package/src/actions/validation.ts +3 -1
- package/src/agents/README.md +6 -2
- package/src/agents/children.ts +6 -0
- package/src/agents/errors.ts +3 -0
- package/src/agents/execution.ts +331 -43
- package/src/agents/ids.ts +5 -0
- package/src/agents/index.ts +22 -4
- package/src/agents/model-routing.ts +25 -9
- package/src/agents/queued-turn.ts +46 -0
- package/src/agents/request.ts +1444 -210
- package/src/agents/run-after-finish.ts +259 -2
- package/src/agents/run-artifacts.ts +3 -93
- package/src/agents/run-events.ts +256 -34
- package/src/agents/run-session-children.ts +13 -2
- package/src/agents/run-session-http.ts +9 -2
- package/src/agents/run-session-serve.ts +2 -8
- package/src/agents/run-session.ts +142 -3
- package/src/agents/run-turn.ts +148 -23
- package/src/agents/streams/index.ts +3 -0
- package/src/agents/streams/internal.ts +12 -0
- package/src/agents/streams/protocol.ts +109 -1
- package/src/agents/streams/steps.ts +131 -0
- package/src/agents/thread-access.ts +57 -2
- package/src/agents/turn-answered.ts +31 -0
- package/src/agents/validation.ts +2 -0
- package/src/artifacts/canvas-display.ts +4 -6
- package/src/artifacts/comments.ts +70 -17
- package/src/artifacts/document-fill.ts +103 -0
- package/src/artifacts/errors.ts +2 -0
- package/src/artifacts/events.ts +4 -1
- package/src/artifacts/execution.ts +265 -31
- package/src/artifacts/frames/assets.ts +42 -7
- package/src/artifacts/frames/document-data.ts +353 -0
- package/src/artifacts/frames/entries.ts +22 -16
- package/src/artifacts/frames/grants.ts +2 -2
- package/src/artifacts/frames/index.ts +3 -0
- package/src/artifacts/frames/kit.ts +102 -0
- package/src/artifacts/frames/protocol.ts +12 -1
- package/src/artifacts/frames/runtime.ts +413 -6
- package/src/artifacts/index.ts +3 -0
- package/src/artifacts/live/blocks.ts +889 -0
- package/src/artifacts/live/board.ts +195 -42
- package/src/artifacts/live/document.ts +170 -5
- package/src/artifacts/live/index.ts +7 -0
- package/src/artifacts/live/page.ts +807 -0
- package/src/artifacts/live/protocol.ts +5 -0
- package/src/artifacts/live/server.ts +2 -2
- package/src/artifacts/live/state.ts +9 -4
- package/src/artifacts/outline.ts +17 -0
- package/src/artifacts/paper.ts +173 -0
- package/src/artifacts/pdf-job.ts +11 -0
- package/src/artifacts/publish/fields.ts +177 -0
- package/src/artifacts/publish/index.ts +6 -1
- package/src/artifacts/publish/merge.ts +28 -15
- package/src/artifacts/publish/pdf.ts +82 -0
- package/src/artifacts/publish/previews.ts +24 -34
- package/src/artifacts/publish/publish.ts +26 -3
- package/src/artifacts/publish/queries.ts +20 -4
- package/src/artifacts/publish/query-answers.ts +14 -3
- package/src/artifacts/publish/validate/document-html.ts +245 -0
- package/src/artifacts/publish/validate/document.ts +34 -3
- package/src/artifacts/queries.ts +59 -13
- package/src/artifacts/run-query.ts +5 -2
- package/src/authorization/event-visibility.ts +13 -0
- package/src/calendar.ts +195 -0
- package/src/connectors/connection-handles.ts +71 -0
- package/src/connectors/connections/authorizations.ts +50 -2
- package/src/connectors/connections/capability.ts +40 -0
- package/src/connectors/connections/events.ts +57 -0
- package/src/connectors/connections/internal.ts +3 -0
- package/src/connectors/connections/runs.ts +5 -0
- package/src/connectors/connections/service.ts +93 -6
- package/src/connectors/execution.ts +35 -8
- package/src/connectors/index.ts +3 -0
- package/src/connectors/service.ts +23 -0
- package/src/connectors/types.ts +29 -1
- package/src/deploy/index.ts +1 -0
- package/src/deploy/services.ts +1 -0
- package/src/deploy/types.ts +30 -2
- package/src/events/definitions.ts +14 -0
- package/src/events/execution.ts +51 -4
- package/src/events/index.ts +8 -0
- package/src/events/outbox-dispatcher.ts +12 -2
- package/src/events/scope.ts +3 -0
- package/src/events/selectors/builder.ts +49 -0
- package/src/events/selectors/index.ts +5 -0
- package/src/events/selectors/predicate.ts +2 -0
- package/src/events/selectors/types.ts +30 -1
- package/src/events/types/artifacts.ts +7 -1
- package/src/events/types/connectors.ts +36 -0
- package/src/events/types/index.ts +7 -0
- package/src/events/types/syncs.ts +4 -0
- package/src/execution/authorization.ts +45 -0
- package/src/execution/authorized-object-reader.ts +33 -5
- package/src/execution/durable.ts +2 -0
- package/src/execution/object-reader-ontology.ts +6 -0
- package/src/execution/request.ts +1 -0
- package/src/execution/scopes.ts +24 -0
- package/src/execution/script.ts +27 -0
- package/src/execution/types.ts +7 -1
- package/src/http/api-routes.ts +33 -0
- package/src/index.ts +39 -4
- package/src/lineage/executors.ts +3 -1
- package/src/materialization/event-envelopes.ts +10 -5
- package/src/materialization/events.ts +2 -0
- package/src/materialization/model.ts +6 -0
- package/src/materializer/README.md +10 -0
- package/src/materializer/projections/replace.ts +42 -1
- package/src/materializer/projections/replacement-plan.ts +44 -4
- package/src/materializer/shared/normalize.ts +4 -0
- package/src/models/audio/runtime.ts +57 -14
- package/src/models/audio/types.ts +20 -0
- package/src/models/index.ts +1 -0
- package/src/objects/query/executor.ts +4 -0
- package/src/objects/query/explain.ts +5 -0
- package/src/objects/query/index.ts +1 -0
- package/src/objects/query/link-query-clearance.ts +4 -1
- package/src/objects/query/links.ts +5 -1
- package/src/objects/query/validate.ts +33 -1
- package/src/objects/sdk/runtime-query-executor.ts +7 -3
- package/src/projections/builders.ts +20 -0
- package/src/projections/index.ts +1 -0
- package/src/projections/registry.ts +1 -0
- package/src/projections/revision.ts +2 -0
- package/src/projections/types.ts +11 -0
- package/src/projections/validation.ts +6 -0
- package/src/queues/in-memory.ts +5 -0
- package/src/queues/index.ts +3 -1
- package/src/queues/types.ts +45 -14
- package/src/runtime/host.ts +125 -11
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/locale.ts +0 -10
- package/src/runtime/resolve-definitions.ts +4 -1
- package/src/runtime/script.ts +62 -0
- package/src/runtime/sixb.ts +15 -5
- package/src/sandboxes/README.md +3 -1
- package/src/sandboxes/auth.ts +32 -4
- package/src/sandboxes/index.ts +15 -1
- package/src/schedules/builders.ts +4 -1
- package/src/schedules/runtime.ts +3 -0
- package/src/schedules/validation.ts +20 -2
- package/src/security/view-conditions.ts +2 -1
- package/src/storage/agents/errors.ts +1 -0
- package/src/storage/agents/in-memory.ts +500 -7
- package/src/storage/agents/index.ts +26 -0
- package/src/storage/agents/provider.ts +454 -15
- package/src/storage/agents/types.ts +315 -3
- package/src/storage/ai-cost/analytics.ts +22 -43
- package/src/storage/ai-cost/types.ts +5 -1
- package/src/storage/artifacts/in-memory.ts +52 -6
- package/src/storage/artifacts/index.ts +2 -0
- package/src/storage/artifacts/record.ts +33 -4
- package/src/storage/artifacts/types.ts +44 -0
- package/src/storage/executions/provider.ts +22 -2
- package/src/storage/executions/types.ts +2 -0
- package/src/storage/executions/validation.ts +27 -0
- package/src/storage/index.ts +29 -0
- package/src/storage/internal.ts +1 -0
- package/src/storage/ontology/in-memory/replacement-plans.ts +22 -0
- package/src/storage/ontology/replacement-plans.ts +6 -0
- package/src/storage/operation-scope.ts +2 -0
- package/src/storage/sync-runs/idempotency.ts +1 -0
- package/src/storage/sync-runs/in-memory.ts +43 -1
- package/src/storage/sync-runs/index.ts +1 -0
- package/src/storage/sync-runs/types.ts +30 -1
- package/src/syncs/accounts.ts +85 -0
- package/src/syncs/builders.ts +18 -1
- package/src/syncs/connections.ts +123 -0
- package/src/syncs/execution.ts +64 -22
- package/src/syncs/index.ts +3 -0
- package/src/syncs/request.ts +81 -23
- package/src/syncs/run-dispatch.ts +69 -7
- package/src/testing/agent-approval-storage-contract.ts +123 -0
- package/src/testing/agent-execution.ts +45 -2
- package/src/testing/agent-inbox-storage-contract.ts +874 -0
- package/src/testing/agent-storage-contract.ts +965 -103
- package/src/testing/ai-cost-storage-contract.ts +80 -0
- package/src/testing/artifact-storage-contract.ts +201 -4
- package/src/testing/execution-storage-contract.ts +31 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/materializer-storage-contract.ts +139 -1
- package/src/testing/queues-contract.ts +22 -0
- package/src/testing/run-claim-storage-contract.ts +116 -0
- package/src/webhooks/connections.ts +9 -50
- package/src/webhooks/index.ts +0 -2
- package/src/webhooks/types.ts +2 -13
- package/src/workers/README.md +4 -1
- package/src/workers/lost-runs.ts +1 -0
- package/src/workers/queue-worker.ts +16 -5
- package/src/workers/queued-run-dispatch.ts +8 -1
- package/src/workers/worker.ts +67 -7
- package/dist/chunk-3z1vxzcm.js +0 -234
- package/dist/chunk-3z1vxzcm.js.map +0 -12
- package/dist/chunk-48c1z8nj.js.map +0 -10
- package/dist/chunk-58geavnf.js +0 -29
- package/dist/chunk-58geavnf.js.map +0 -10
- package/dist/chunk-5a4a52tq.js.map +0 -10
- package/dist/chunk-9nsjjd44.js.map +0 -12
- package/dist/chunk-b9qfh2ya.js.map +0 -11
- package/dist/chunk-eptrvnby.js.map +0 -12
- package/dist/chunk-f6ahf5gf.js.map +0 -13
- package/dist/chunk-gxwy4c3s.js.map +0 -47
- package/dist/chunk-hvbvq7p4.js.map +0 -18
- package/dist/chunk-m2jerfef.js +0 -474
- package/dist/chunk-m2jerfef.js.map +0 -11
- package/dist/chunk-msyevpp3.js.map +0 -22
- package/dist/chunk-n4zzaf6q.js.map +0 -10
- package/dist/chunk-rsrc7vtw.js.map +0 -49
- package/dist/chunk-rsxb14an.js.map +0 -18
- package/dist/chunk-smnt672s.js.map +0 -10
- package/dist/chunk-t0s7b3d1.js.map +0 -13
- package/dist/chunk-td26wjr5.js.map +0 -13
- package/dist/chunk-vzkxqf8h.js.map +0 -23
- package/dist/chunk-wa05txmk.js.map +0 -11
- package/dist/chunk-yv8hv4wq.js.map +0 -10
- package/dist/chunk-yy914zfr.js.map +0 -30
- package/dist/chunk-zeykm8my.js.map +0 -14
- /package/dist/{chunk-stmxh0hv.js.map → chunk-3neam1y5.js.map} +0 -0
- /package/dist/{chunk-p8pgnq8d.js.map → chunk-425ydk65.js.map} +0 -0
- /package/dist/{chunk-p351afzm.js.map → chunk-5sswe5ej.js.map} +0 -0
- /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
- /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
- /package/dist/{chunk-q9nkpr8k.js.map → chunk-9tpmfh3n.js.map} +0 -0
- /package/dist/{chunk-sysnvjce.js.map → chunk-brhp9d97.js.map} +0 -0
- /package/dist/{chunk-8a8k38tz.js.map → chunk-brybqw5k.js.map} +0 -0
- /package/dist/{chunk-855w9nvw.js.map → chunk-cg7cygfj.js.map} +0 -0
- /package/dist/{chunk-r2psmn42.js.map → chunk-eg6xqef7.js.map} +0 -0
- /package/dist/{chunk-7kpqntgw.js.map → chunk-f05994as.js.map} +0 -0
- /package/dist/{chunk-2bn6813a.js.map → chunk-grt2j5vp.js.map} +0 -0
- /package/dist/{chunk-rtdrm592.js.map → chunk-htdzx40w.js.map} +0 -0
- /package/dist/{chunk-bc3y6gff.js.map → chunk-jka26v8c.js.map} +0 -0
- /package/dist/{chunk-6ef4esq4.js.map → chunk-pqj8vff9.js.map} +0 -0
- /package/dist/{chunk-n68vz95m.js.map → chunk-qbd282aa.js.map} +0 -0
- /package/dist/{chunk-r9rtavg9.js.map → chunk-t19wjmnc.js.map} +0 -0
- /package/dist/{chunk-dhkc9b23.js.map → chunk-v8a1qjzp.js.map} +0 -0
- /package/dist/{chunk-8bns0y68.js.map → chunk-xf76csps.js.map} +0 -0
- /package/dist/{chunk-vepea5c3.js.map → chunk-ym1bqd98.js.map} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
validateSchemaValue2,
|
|
4
4
|
normalizeSchemaValue2
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7mhbs9yy.js";
|
|
6
6
|
import {
|
|
7
7
|
sniffFileMediaType2,
|
|
8
8
|
isFileRef2
|
|
@@ -23,8 +23,11 @@ import {
|
|
|
23
23
|
requestAgentRunCancel2,
|
|
24
24
|
cancelQueuedRun,
|
|
25
25
|
listSubagentThreadRuns2,
|
|
26
|
-
subagentSandboxFiles2
|
|
27
|
-
|
|
26
|
+
subagentSandboxFiles2,
|
|
27
|
+
startQueuedAgentTurn2,
|
|
28
|
+
turnAnsweredEveryMessage,
|
|
29
|
+
isBoundSixb
|
|
30
|
+
} from "./chunk-ats8y3d9.js";
|
|
28
31
|
import {
|
|
29
32
|
createSixbError2,
|
|
30
33
|
captureSixbFailure2,
|
|
@@ -32,13 +35,16 @@ import {
|
|
|
32
35
|
} from "./chunk-mvz89age.js";
|
|
33
36
|
import {
|
|
34
37
|
principalsEqual2
|
|
35
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-394zjzjs.js";
|
|
39
|
+
import {
|
|
40
|
+
createPrincipalRuntimeAuthorization
|
|
41
|
+
} from "./chunk-tapdssb5.js";
|
|
36
42
|
import {
|
|
37
43
|
resolveAgentPropertyClearance2,
|
|
38
44
|
resolveAgentExecutionAuthorization2,
|
|
39
45
|
userCanRunAgent2,
|
|
40
46
|
resolveInheritedAgentExecutionAuthorization2
|
|
41
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-5sswe5ej.js";
|
|
42
48
|
import {
|
|
43
49
|
indexModelBindings,
|
|
44
50
|
WebSearchModelResponseError2,
|
|
@@ -52,18 +58,20 @@ import {
|
|
|
52
58
|
createSubagentRunId2,
|
|
53
59
|
createSubagentThreadId2,
|
|
54
60
|
createSubagentExecutionId2,
|
|
55
|
-
createAgentRunExecutionToken2
|
|
56
|
-
|
|
61
|
+
createAgentRunExecutionToken2,
|
|
62
|
+
runPlaceKey2
|
|
63
|
+
} from "./chunk-gaj8djsw.js";
|
|
57
64
|
import {
|
|
58
65
|
ARTIFACT_LIMITS2
|
|
59
66
|
} from "./chunk-9vsc919v.js";
|
|
67
|
+
import {
|
|
68
|
+
ArtifactRequestError2
|
|
69
|
+
} from "./chunk-vs2s3p8n.js";
|
|
60
70
|
import {
|
|
61
71
|
conversationThreadId2,
|
|
62
72
|
announceArtifactUpdates,
|
|
63
73
|
firstArtifactDocument,
|
|
64
74
|
withMergedWrite,
|
|
65
|
-
missingBoardPreviews2,
|
|
66
|
-
storeBoardPreviews2,
|
|
67
75
|
prepareArtifactVersion2,
|
|
68
76
|
storeArtifactVersion2,
|
|
69
77
|
artifactVersionWarnings2,
|
|
@@ -71,13 +79,7 @@ import {
|
|
|
71
79
|
artifactTransactionRules,
|
|
72
80
|
artifactQueryChecker2,
|
|
73
81
|
artifactPreviewRequester
|
|
74
|
-
} from "./chunk-
|
|
75
|
-
import {
|
|
76
|
-
BOARD_PREVIEW_JOB2
|
|
77
|
-
} from "./chunk-a6fjkcne.js";
|
|
78
|
-
import {
|
|
79
|
-
ArtifactRequestError2
|
|
80
|
-
} from "./chunk-hvbvq7p4.js";
|
|
82
|
+
} from "./chunk-jt012fxq.js";
|
|
81
83
|
import {
|
|
82
84
|
resolveLoggingService2
|
|
83
85
|
} from "./chunk-1vg43g9q.js";
|
|
@@ -85,40 +87,42 @@ import {
|
|
|
85
87
|
publishAgentRunActivity2,
|
|
86
88
|
agentRunStreamId2,
|
|
87
89
|
agentRunStreamDefinition2,
|
|
90
|
+
agentRunStepsStreamId2,
|
|
91
|
+
agentRunStepsStreamDefinition2,
|
|
88
92
|
subscribeAgentRunCancel2,
|
|
89
93
|
agentRunFinishedEvent2,
|
|
90
94
|
agentRunStreamEventBase2,
|
|
91
95
|
agentRunStreamIdempotencyKey2
|
|
92
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-kft7mp7z.js";
|
|
93
97
|
import {
|
|
94
98
|
ModelUsageRecordingError2,
|
|
95
99
|
createAiModelCallLimitController2,
|
|
96
100
|
AiModelCallRecorder2
|
|
97
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-grt2j5vp.js";
|
|
98
102
|
import {
|
|
99
103
|
appendArtifactLive2,
|
|
100
104
|
changedBoards
|
|
101
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-f05994as.js";
|
|
102
106
|
import {
|
|
103
107
|
renderOntologyDocs2
|
|
104
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-jka26v8c.js";
|
|
105
109
|
import {
|
|
106
110
|
SIXB_API_ROUTES2,
|
|
107
111
|
matchesPathPattern2,
|
|
108
112
|
normalizeRoutePath2
|
|
109
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-wzcjhv54.js";
|
|
110
114
|
import {
|
|
111
115
|
assertValidSchema
|
|
112
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-htdzx40w.js";
|
|
117
|
+
import {
|
|
118
|
+
ensureExecutionRecord2
|
|
119
|
+
} from "./chunk-xavet0qs.js";
|
|
113
120
|
import {
|
|
114
121
|
resolveLanguageModel2
|
|
115
122
|
} from "./chunk-3723kgba.js";
|
|
116
123
|
import {
|
|
117
124
|
schemaRecordToJsonSchema2
|
|
118
125
|
} from "./chunk-0kgrghqx.js";
|
|
119
|
-
import {
|
|
120
|
-
ensureExecutionRecord2
|
|
121
|
-
} from "./chunk-8tqnsx3q.js";
|
|
122
126
|
import {
|
|
123
127
|
RuntimeError2
|
|
124
128
|
} from "./chunk-m4ehq95f.js";
|
|
@@ -131,12 +135,18 @@ import {
|
|
|
131
135
|
AgentToolResultValidationError2,
|
|
132
136
|
AgentMemoryError2
|
|
133
137
|
} from "./chunk-9wr3yajk.js";
|
|
138
|
+
import {
|
|
139
|
+
isDeltaChunk2,
|
|
140
|
+
continuesDelta2,
|
|
141
|
+
mergeDeltas2,
|
|
142
|
+
appendCompacted2
|
|
143
|
+
} from "./chunk-6hfbz4d0.js";
|
|
134
144
|
import {
|
|
135
145
|
AGENT_RUN_FAILURE_CODES2,
|
|
136
146
|
AGENT_TOKEN_RATE_SAMPLES2,
|
|
137
147
|
AGENT_TOKEN_RATE_MIN_BYTES_PER_TOKEN2,
|
|
138
148
|
AGENT_TOKEN_RATE_MAX_BYTES_PER_TOKEN
|
|
139
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-nxysqbt0.js";
|
|
140
150
|
import {
|
|
141
151
|
openFileRef2
|
|
142
152
|
} from "./chunk-a3faa34j.js";
|
|
@@ -775,6 +785,8 @@ var AGENT_RESERVED_TOOL_NAMES2 = [
|
|
|
775
785
|
"read",
|
|
776
786
|
"edit",
|
|
777
787
|
"write",
|
|
788
|
+
"glob",
|
|
789
|
+
"grep",
|
|
778
790
|
"view_file",
|
|
779
791
|
"spawn_agent",
|
|
780
792
|
"message_agent",
|
|
@@ -1579,10 +1591,13 @@ async function readAgentRunContext(host, run) {
|
|
|
1579
1591
|
});
|
|
1580
1592
|
return run.kind === "conversation" ? readTurnContext(host, run, execution) : readChildContext(host, run, execution);
|
|
1581
1593
|
}
|
|
1582
|
-
async function
|
|
1583
|
-
const { checkpoint, messages } = await
|
|
1594
|
+
async function readAgentTurnHistory2(host, threadId, options) {
|
|
1595
|
+
const [{ checkpoint, messages }, thread] = await Promise.all([
|
|
1596
|
+
readRetainedHistory(host, threadId),
|
|
1597
|
+
options && "thread" in options ? Promise.resolve(options.thread ?? null) : host.storage.agents.threads.getById({ projectId: host.projectId, id: threadId })
|
|
1598
|
+
]);
|
|
1584
1599
|
const [sent, usageAnchor] = await Promise.all([
|
|
1585
|
-
readSentSettings(host, threadId, messages),
|
|
1600
|
+
readSentSettings(host, threadId, messages, checkpoint, thread),
|
|
1586
1601
|
readUsageAnchor(host, messages, checkpoint)
|
|
1587
1602
|
]);
|
|
1588
1603
|
return { checkpoint, messages, ...sent, ...usageAnchor ? { usageAnchor } : {} };
|
|
@@ -1606,10 +1621,10 @@ async function readRetainedHistory(host, threadId) {
|
|
|
1606
1621
|
}
|
|
1607
1622
|
async function readTurnContext(host, run, execution) {
|
|
1608
1623
|
const { projectId } = host;
|
|
1609
|
-
const
|
|
1610
|
-
|
|
1624
|
+
const thread = await host.storage.agents.threads.getById({ projectId, id: run.threadId });
|
|
1625
|
+
const [participants, history] = await Promise.all([
|
|
1611
1626
|
host.storage.agents.threads.listParticipants({ projectId, threadIds: [run.threadId] }),
|
|
1612
|
-
|
|
1627
|
+
readAgentTurnHistory2(host, run.threadId, { thread })
|
|
1613
1628
|
]);
|
|
1614
1629
|
const readers = await readReaders(host, participants);
|
|
1615
1630
|
const named = [
|
|
@@ -1631,10 +1646,10 @@ async function readTurnContext(host, run, execution) {
|
|
|
1631
1646
|
async function readChildContext(host, run, execution) {
|
|
1632
1647
|
const { projectId } = host;
|
|
1633
1648
|
const agents = host.storage.agents;
|
|
1634
|
-
const
|
|
1649
|
+
const thread = await agents.threads.getById({ projectId, id: run.threadId });
|
|
1650
|
+
const [parent, history, runs] = await Promise.all([
|
|
1635
1651
|
agents.runs.getById({ projectId, id: run.parentRunId }),
|
|
1636
|
-
|
|
1637
|
-
readAgentTurnHistory(host, run.threadId),
|
|
1652
|
+
readAgentTurnHistory2(host, run.threadId, { thread }),
|
|
1638
1653
|
listSubagentThreadRuns2(agents, { projectId, threadId: run.threadId })
|
|
1639
1654
|
]);
|
|
1640
1655
|
const [conversation, task] = await Promise.all([
|
|
@@ -1685,29 +1700,95 @@ async function readNames(host, principals) {
|
|
|
1685
1700
|
function readUser(host, id) {
|
|
1686
1701
|
return host.storage.auth.users.getById({ projectId: host.projectId, id });
|
|
1687
1702
|
}
|
|
1688
|
-
async function readSentSettings(host, threadId, messages) {
|
|
1703
|
+
async function readSentSettings(host, threadId, messages, checkpoint, thread) {
|
|
1689
1704
|
const userMessages = messages.filter((message) => message.role === "user");
|
|
1690
1705
|
const oldest = userMessages[0];
|
|
1691
|
-
if (!oldest)
|
|
1706
|
+
if (!oldest || thread?.kind === "subagent")
|
|
1692
1707
|
return { sentTimeZones: {}, sentLocales: {} };
|
|
1693
|
-
const { runs } = await
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1708
|
+
const [{ runs }, earlier] = await Promise.all([
|
|
1709
|
+
host.storage.agents.runs.list({
|
|
1710
|
+
projectId: host.projectId,
|
|
1711
|
+
threadId,
|
|
1712
|
+
kinds: ["conversation"],
|
|
1713
|
+
startedAfter: new Date(oldest.createdAt.getTime() - 1)
|
|
1714
|
+
}),
|
|
1715
|
+
checkpoint ? host.storage.agents.runs.list({
|
|
1716
|
+
projectId: host.projectId,
|
|
1717
|
+
threadId,
|
|
1718
|
+
kinds: ["conversation"],
|
|
1719
|
+
startedBefore: new Date(oldest.createdAt.getTime()),
|
|
1720
|
+
order: "desc",
|
|
1721
|
+
limit: 5
|
|
1722
|
+
}) : Promise.resolve({ runs: [] })
|
|
1723
|
+
]);
|
|
1699
1724
|
const retained = new Set(userMessages.map((message) => message.id));
|
|
1700
1725
|
const zones = {};
|
|
1701
1726
|
const locales = {};
|
|
1702
|
-
|
|
1727
|
+
const places = {};
|
|
1728
|
+
for (const message of userMessages) {
|
|
1729
|
+
const metadata = isPlainRecord(message.metadata) ? message.metadata : undefined;
|
|
1730
|
+
if (typeof metadata?.timeZone === "string")
|
|
1731
|
+
zones[message.id] = metadata.timeZone;
|
|
1732
|
+
if (typeof metadata?.locale === "string")
|
|
1733
|
+
locales[message.id] = metadata.locale;
|
|
1734
|
+
}
|
|
1735
|
+
for (const run of [...runs].reverse()) {
|
|
1703
1736
|
if (run.kind !== "conversation" || !retained.has(run.triggerMessageId))
|
|
1704
1737
|
continue;
|
|
1705
1738
|
if (run.spec?.timeZone)
|
|
1706
1739
|
zones[run.triggerMessageId] = run.spec.timeZone;
|
|
1707
1740
|
if (run.spec?.locale)
|
|
1708
1741
|
locales[run.triggerMessageId] = run.spec.locale;
|
|
1742
|
+
places[run.triggerMessageId] = runPlaceKey2(run.spec);
|
|
1743
|
+
}
|
|
1744
|
+
const priorRun = await latestSummarizedRun(host, [...runs, ...earlier.runs], retained);
|
|
1745
|
+
const movedMessageIds = detectMovedMessages({
|
|
1746
|
+
userMessages,
|
|
1747
|
+
checkpoint,
|
|
1748
|
+
places,
|
|
1749
|
+
priorPlace: priorRun ? runPlaceKey2(priorRun.spec) : undefined
|
|
1750
|
+
});
|
|
1751
|
+
return {
|
|
1752
|
+
sentTimeZones: zones,
|
|
1753
|
+
sentLocales: locales,
|
|
1754
|
+
...movedMessageIds.length > 0 ? { movedMessageIds } : {}
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
async function latestSummarizedRun(host, runs, retained) {
|
|
1758
|
+
const candidates = runs.filter((run) => run.kind === "conversation" && !retained.has(run.triggerMessageId)).sort((left, right) => startOf(right) - startOf(left));
|
|
1759
|
+
const rewound = new Set;
|
|
1760
|
+
for (const run of candidates) {
|
|
1761
|
+
if (rewound.has(run.triggerMessageId))
|
|
1762
|
+
continue;
|
|
1763
|
+
const trigger = await host.storage.agents.messages.getById({
|
|
1764
|
+
projectId: host.projectId,
|
|
1765
|
+
id: run.triggerMessageId
|
|
1766
|
+
});
|
|
1767
|
+
if (trigger)
|
|
1768
|
+
return run;
|
|
1769
|
+
rewound.add(run.triggerMessageId);
|
|
1770
|
+
}
|
|
1771
|
+
return;
|
|
1772
|
+
}
|
|
1773
|
+
function startOf(run) {
|
|
1774
|
+
return (run.startedAt ?? run.createdAt).getTime();
|
|
1775
|
+
}
|
|
1776
|
+
function detectMovedMessages(input) {
|
|
1777
|
+
const moved = [];
|
|
1778
|
+
let previous = input.priorPlace;
|
|
1779
|
+
let inherited = previous === undefined && input.checkpoint !== null;
|
|
1780
|
+
for (const message of input.userMessages) {
|
|
1781
|
+
const place = input.places[message.id];
|
|
1782
|
+
if (place === undefined) {
|
|
1783
|
+
inherited = true;
|
|
1784
|
+
continue;
|
|
1785
|
+
}
|
|
1786
|
+
const crossed = previous === undefined ? inherited : previous !== place;
|
|
1787
|
+
if (crossed)
|
|
1788
|
+
moved.push(message.id);
|
|
1789
|
+
previous = place;
|
|
1709
1790
|
}
|
|
1710
|
-
return
|
|
1791
|
+
return moved;
|
|
1711
1792
|
}
|
|
1712
1793
|
function matchingAgentUsageAnchor(history, model) {
|
|
1713
1794
|
const anchor = history.usageAnchor;
|
|
@@ -1865,8 +1946,176 @@ async function afterAgentRunFinished2(host, run) {
|
|
|
1865
1946
|
return;
|
|
1866
1947
|
const ended = run.finishReason === "interrupted" ? "was interrupted" : run.status === "succeeded" ? "has finished" : `was ${run.status}`;
|
|
1867
1948
|
await stopActiveChildren(host, run.id, `The parent Agent run ${ended}.`);
|
|
1868
|
-
|
|
1949
|
+
const inbox = await readInbox(host, run);
|
|
1950
|
+
if (inbox?.claimed)
|
|
1951
|
+
await releaseInboxClaims(host, run.id);
|
|
1952
|
+
if (isAwaitingApprovalRun2(run)) {
|
|
1953
|
+
await resumeDecidedTurn(host, run);
|
|
1954
|
+
return;
|
|
1955
|
+
}
|
|
1956
|
+
if (!inbox || inbox.waiting.length === 0)
|
|
1957
|
+
return;
|
|
1958
|
+
await startNextQueuedMessage(host, run, inbox.waiting);
|
|
1959
|
+
}
|
|
1960
|
+
var INBOX_REPAIR_PAGE_SIZE = 100;
|
|
1961
|
+
var INBOX_REPAIR_GRACE_MS = 30000;
|
|
1962
|
+
async function repairAgentInboxes2(host, input = {}) {
|
|
1963
|
+
if (typeof host.storage.agents.inbox?.listWaitingThreads !== "function")
|
|
1964
|
+
return;
|
|
1965
|
+
const createdBefore = new Date((input.now ?? new Date).getTime() - INBOX_REPAIR_GRACE_MS);
|
|
1966
|
+
let afterThreadId;
|
|
1967
|
+
for (;; ) {
|
|
1968
|
+
const threadIds = await host.storage.agents.inbox.listWaitingThreads({
|
|
1969
|
+
projectId: host.projectId,
|
|
1970
|
+
createdBefore,
|
|
1971
|
+
limit: INBOX_REPAIR_PAGE_SIZE,
|
|
1972
|
+
...afterThreadId === undefined ? {} : { afterThreadId }
|
|
1973
|
+
});
|
|
1974
|
+
for (const threadId of threadIds) {
|
|
1975
|
+
try {
|
|
1976
|
+
await repairThreadInbox(host, threadId);
|
|
1977
|
+
} catch (error) {
|
|
1978
|
+
console.error(`[Sixb] Could not repair the inbox of Agent thread '${threadId}'; retrying.`, error);
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
afterThreadId = threadIds.at(-1);
|
|
1982
|
+
if (afterThreadId === undefined || threadIds.length < INBOX_REPAIR_PAGE_SIZE)
|
|
1983
|
+
return;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
async function repairThreadInbox(host, threadId) {
|
|
1987
|
+
const { runs } = await host.storage.agents.runs.list({
|
|
1988
|
+
projectId: host.projectId,
|
|
1989
|
+
threadId,
|
|
1990
|
+
kinds: ["conversation"],
|
|
1991
|
+
order: "desc",
|
|
1992
|
+
limit: 1
|
|
1993
|
+
});
|
|
1994
|
+
const last = runs[0];
|
|
1995
|
+
if (!last || last.status === "queued" || last.status === "running")
|
|
1996
|
+
return;
|
|
1997
|
+
const items = await host.storage.agents.inbox.list({ projectId: host.projectId, threadId });
|
|
1998
|
+
const holders = new Set(items.flatMap((item) => item.claimedBy ? [item.claimedBy.runId] : []));
|
|
1999
|
+
for (const runId of holders)
|
|
2000
|
+
await releaseInboxClaims(host, runId);
|
|
2001
|
+
if (isAwaitingApprovalRun2(last))
|
|
1869
2002
|
return;
|
|
2003
|
+
await startNextQueuedMessage(host, last, items);
|
|
2004
|
+
}
|
|
2005
|
+
async function readInbox(host, run) {
|
|
2006
|
+
const inbox = host.storage.agents.inbox;
|
|
2007
|
+
if (typeof inbox?.list !== "function")
|
|
2008
|
+
return null;
|
|
2009
|
+
try {
|
|
2010
|
+
const items = await inbox.list({
|
|
2011
|
+
projectId: host.projectId,
|
|
2012
|
+
threadId: run.threadId,
|
|
2013
|
+
includeClaimed: true
|
|
2014
|
+
});
|
|
2015
|
+
const claimed = items.some((item) => item.claimedBy?.runId === run.id);
|
|
2016
|
+
return {
|
|
2017
|
+
claimed,
|
|
2018
|
+
waiting: items.filter((item) => item.claimedBy === undefined || item.claimedBy.runId === run.id)
|
|
2019
|
+
};
|
|
2020
|
+
} catch (error) {
|
|
2021
|
+
console.error(`[Sixb] Could not read the inbox of Agent run '${run.id}'; repair retries it.`, error);
|
|
2022
|
+
return null;
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
async function startNextQueuedMessage(host, run, waiting) {
|
|
2026
|
+
try {
|
|
2027
|
+
const execution = await host.storage.executions.getById({
|
|
2028
|
+
projectId: host.projectId,
|
|
2029
|
+
id: run.executionId
|
|
2030
|
+
});
|
|
2031
|
+
const requester = execution?.requestedBy;
|
|
2032
|
+
if (!requester)
|
|
2033
|
+
return;
|
|
2034
|
+
const onlyImmediate = !await turnAnsweredEveryMessage(host.storage.agents, run);
|
|
2035
|
+
const startable = waiting.filter((item) => !onlyImmediate || item.immediate);
|
|
2036
|
+
for (const next of nextOfEachAuthor(startable, requester)) {
|
|
2037
|
+
const sender = await boundSender(host, next);
|
|
2038
|
+
if (!sender)
|
|
2039
|
+
continue;
|
|
2040
|
+
const started = await startQueuedAgentTurn2(sender, run.id, { onlyImmediate });
|
|
2041
|
+
if (started.status === "started")
|
|
2042
|
+
return;
|
|
2043
|
+
}
|
|
2044
|
+
} catch (error) {
|
|
2045
|
+
console.error(`[Sixb] Could not start what was queued after Agent run '${run.id}'; it waits in the thread.`, error);
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
function nextOfEachAuthor(items, requester) {
|
|
2049
|
+
const byAuthor = [];
|
|
2050
|
+
for (const item of [...items].sort((left, right) => left.seq - right.seq)) {
|
|
2051
|
+
const own = byAuthor.find((each) => principalsEqual2(each[0].authorPrincipal, item.authorPrincipal));
|
|
2052
|
+
if (own)
|
|
2053
|
+
own.push(item);
|
|
2054
|
+
else
|
|
2055
|
+
byAuthor.push([item]);
|
|
2056
|
+
}
|
|
2057
|
+
const order = (each) => principalsEqual2(each[0].authorPrincipal, requester) ? 0 : 1;
|
|
2058
|
+
return byAuthor.sort((left, right) => order(left) - order(right)).map((own) => [...own].sort((left, right) => priority(left) - priority(right))[0]);
|
|
2059
|
+
}
|
|
2060
|
+
function priority(item) {
|
|
2061
|
+
if (item.immediate)
|
|
2062
|
+
return 0;
|
|
2063
|
+
return item.mode === "steer" ? 1 : 2;
|
|
2064
|
+
}
|
|
2065
|
+
async function boundSender(host, item) {
|
|
2066
|
+
if (item.executionId === undefined)
|
|
2067
|
+
return null;
|
|
2068
|
+
const request = await host.storage.executions.getById({
|
|
2069
|
+
projectId: host.projectId,
|
|
2070
|
+
id: item.executionId
|
|
2071
|
+
});
|
|
2072
|
+
const ref = request?.authorizationRef;
|
|
2073
|
+
if (request?.executor.type !== "request" || ref?.type !== "principal")
|
|
2074
|
+
return null;
|
|
2075
|
+
let authorization;
|
|
2076
|
+
try {
|
|
2077
|
+
authorization = await resolveInheritedAgentExecutionAuthorization2({
|
|
2078
|
+
auth: host.storage.auth,
|
|
2079
|
+
projectId: host.projectId,
|
|
2080
|
+
authorizationRef: ref,
|
|
2081
|
+
security: host.security
|
|
2082
|
+
});
|
|
2083
|
+
} catch (error) {
|
|
2084
|
+
if (isSixbError2(error) && error.code === "agent.execution_failed")
|
|
2085
|
+
return null;
|
|
2086
|
+
throw error;
|
|
2087
|
+
}
|
|
2088
|
+
if (authorization.type !== "principal")
|
|
2089
|
+
return null;
|
|
2090
|
+
const execution = Object.freeze({
|
|
2091
|
+
id: request.id,
|
|
2092
|
+
projectId: request.projectId,
|
|
2093
|
+
...request.requestedBy === undefined ? {} : { requestedBy: request.requestedBy },
|
|
2094
|
+
executor: request.executor,
|
|
2095
|
+
source: request.source,
|
|
2096
|
+
correlationId: request.correlationId
|
|
2097
|
+
});
|
|
2098
|
+
const sixb = host.sdk.withScope({
|
|
2099
|
+
execution,
|
|
2100
|
+
authorization: createPrincipalRuntimeAuthorization({
|
|
2101
|
+
execution,
|
|
2102
|
+
context: authorization.context,
|
|
2103
|
+
...ref.credential === undefined ? {} : { credential: ref.credential }
|
|
2104
|
+
})
|
|
2105
|
+
});
|
|
2106
|
+
if (!isBoundSixb(sixb)) {
|
|
2107
|
+
throw new Error("[Sixb] Agent session host returned an invalid bound SDK.");
|
|
2108
|
+
}
|
|
2109
|
+
return sixb;
|
|
2110
|
+
}
|
|
2111
|
+
async function releaseInboxClaims(host, runId) {
|
|
2112
|
+
try {
|
|
2113
|
+
await host.storage.agents.inbox.releaseClaimed({ projectId: host.projectId, runId });
|
|
2114
|
+
} catch (error) {
|
|
2115
|
+
console.error(`[Sixb] Could not release the inbox claims of Agent run '${runId}'; repair retries.`, error);
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
async function resumeDecidedTurn(host, run) {
|
|
1870
2119
|
try {
|
|
1871
2120
|
const scope = await resolveAgentRunExecutionScope2({ id: host.projectId, storage: host.storage, definitions: { security: host.security } }, { runId: run.id, executionId: run.executionId, authority: { type: "inherited" } });
|
|
1872
2121
|
await resumeDecidedAgentTurn2(bindDurableAgentExecution2(host.sdk, scope), run.id);
|
|
@@ -2070,7 +2319,7 @@ function agentRunArtifacts2(host, run, executionToken, sdk) {
|
|
|
2070
2319
|
await announceArtifactUpdates(host.domainEvents, [stored.version]);
|
|
2071
2320
|
if (kind === "canvas")
|
|
2072
2321
|
await announceAgentBoards(host, turnRunId, before, stored.version);
|
|
2073
|
-
await artifactPreviewRequester(reader)(stored.version
|
|
2322
|
+
await artifactPreviewRequester(reader)(stored.version);
|
|
2074
2323
|
return {
|
|
2075
2324
|
...stored,
|
|
2076
2325
|
warnings: await artifactVersionWarnings2(context, prepared, stored),
|
|
@@ -2079,28 +2328,8 @@ function agentRunArtifacts2(host, run, executionToken, sdk) {
|
|
|
2079
2328
|
},
|
|
2080
2329
|
async turnWrites() {
|
|
2081
2330
|
return requireArtifacts(storage).listTurnWrites({ projectId, turnRunId });
|
|
2082
|
-
},
|
|
2083
|
-
async storePreviews({ previews, ...at }) {
|
|
2084
|
-
const [{ blobs }, version] = await Promise.all([sdk(), publishedVersion(at)]);
|
|
2085
|
-
return storeBoardPreviews2({ storage: requireArtifacts(storage), blobStorage: blobs }, version, previews);
|
|
2086
|
-
},
|
|
2087
|
-
async missingPreviews(at) {
|
|
2088
|
-
const missing = await missingBoardPreviews2(requireArtifacts(storage), await publishedVersion(at));
|
|
2089
|
-
return missing.map(({ board, themes }) => ({ board: board.id, themes }));
|
|
2090
2331
|
}
|
|
2091
2332
|
};
|
|
2092
|
-
async function publishedVersion(at) {
|
|
2093
|
-
const version = await requireArtifacts(storage).getVersion({
|
|
2094
|
-
projectId,
|
|
2095
|
-
artifactId: at.artifactId,
|
|
2096
|
-
version: at.version
|
|
2097
|
-
});
|
|
2098
|
-
const written = at.updatedAt.getTime();
|
|
2099
|
-
if (!version || version.origin?.runId !== run.id || version.updatedAt.getTime() !== written) {
|
|
2100
|
-
throw new ArtifactRequestError2("not_allowed", `[Sixb] Version ${at.version} of artifact '${at.artifactId}' does not hold what this run wrote at ${at.updatedAt.toISOString()}.`);
|
|
2101
|
-
}
|
|
2102
|
-
return version;
|
|
2103
|
-
}
|
|
2104
2333
|
}
|
|
2105
2334
|
async function latestVersionOf(storage, projectId, artifactId) {
|
|
2106
2335
|
const artifact = await storage.get({ projectId, id: artifactId });
|
|
@@ -2183,11 +2412,12 @@ var NOOP_STREAM_SINK2 = {
|
|
|
2183
2412
|
async publishCompactionCompleted() {},
|
|
2184
2413
|
async publishCompactionFailed() {},
|
|
2185
2414
|
async publishUiChunk() {},
|
|
2415
|
+
async publishInboxRead() {},
|
|
2186
2416
|
async publishMessageFinalized() {},
|
|
2187
2417
|
async publishRunFinished() {}
|
|
2188
2418
|
};
|
|
2189
2419
|
function createBrokerStreamSink2(input) {
|
|
2190
|
-
return new BrokerStreamSink(input.broker, input.projectId);
|
|
2420
|
+
return new BrokerStreamSink(input.broker, input.projectId, input.deltaWindowMs ?? AGENT_RUN_STREAM_DELTA_WINDOW_MS);
|
|
2191
2421
|
}
|
|
2192
2422
|
function isolateStreamSink2(sink) {
|
|
2193
2423
|
return {
|
|
@@ -2196,6 +2426,7 @@ function isolateStreamSink2(sink) {
|
|
|
2196
2426
|
publishCompactionCompleted: (input) => isolateStreamSinkCall(input.run.id, "compaction completed", () => sink.publishCompactionCompleted(input)),
|
|
2197
2427
|
publishCompactionFailed: (input) => isolateStreamSinkCall(input.run.id, "compaction failed", () => sink.publishCompactionFailed(input)),
|
|
2198
2428
|
publishUiChunk: (input) => isolateStreamSinkCall(input.run.id, "ui chunk", () => sink.publishUiChunk(input)),
|
|
2429
|
+
publishInboxRead: (input) => isolateStreamSinkCall(input.run.id, "inbox read", () => sink.publishInboxRead(input)),
|
|
2199
2430
|
publishMessageFinalized: (input) => isolateStreamSinkCall(input.run.id, "message finalized", () => sink.publishMessageFinalized(input)),
|
|
2200
2431
|
publishRunFinished: (run) => isolateStreamSinkCall(run.id, "run finished", () => sink.publishRunFinished(run))
|
|
2201
2432
|
};
|
|
@@ -2210,6 +2441,7 @@ function withAgentActivityStream2(sink, broker) {
|
|
|
2210
2441
|
publishCompactionCompleted: (input) => sink.publishCompactionCompleted(input),
|
|
2211
2442
|
publishCompactionFailed: (input) => sink.publishCompactionFailed(input),
|
|
2212
2443
|
publishUiChunk: (input) => sink.publishUiChunk(input),
|
|
2444
|
+
publishInboxRead: (input) => sink.publishInboxRead(input),
|
|
2213
2445
|
publishMessageFinalized: (input) => sink.publishMessageFinalized(input),
|
|
2214
2446
|
publishRunFinished: (run) => publishLifecycle([
|
|
2215
2447
|
sink.publishRunFinished(run),
|
|
@@ -2223,24 +2455,29 @@ async function publishLifecycle(deliveries) {
|
|
|
2223
2455
|
if (failure?.status === "rejected")
|
|
2224
2456
|
throw failure.reason;
|
|
2225
2457
|
}
|
|
2458
|
+
var AGENT_RUN_STREAM_DELTA_WINDOW_MS = 50;
|
|
2459
|
+
var MAX_TRACKED_RUNS = 256;
|
|
2226
2460
|
|
|
2227
2461
|
class BrokerStreamSink {
|
|
2228
2462
|
broker;
|
|
2229
2463
|
projectId;
|
|
2464
|
+
deltaWindowMs;
|
|
2230
2465
|
ensured = new Set;
|
|
2231
|
-
|
|
2466
|
+
runs = new Map;
|
|
2467
|
+
constructor(broker, projectId, deltaWindowMs) {
|
|
2232
2468
|
this.broker = broker;
|
|
2233
2469
|
this.projectId = projectId;
|
|
2470
|
+
this.deltaWindowMs = deltaWindowMs;
|
|
2234
2471
|
}
|
|
2235
2472
|
async publishStarted(run) {
|
|
2236
|
-
await this.
|
|
2473
|
+
await this.publishInOrder(run, {
|
|
2237
2474
|
...agentRunStreamEventBase2(run),
|
|
2238
2475
|
type: "agent.run.started",
|
|
2239
2476
|
...run.modelId === undefined ? {} : { modelId: run.modelId }
|
|
2240
2477
|
});
|
|
2241
2478
|
}
|
|
2242
2479
|
async publishCompactionStarted(input) {
|
|
2243
|
-
await this.
|
|
2480
|
+
await this.publishInOrder(input.run, {
|
|
2244
2481
|
...agentRunStreamEventBase2(input.run),
|
|
2245
2482
|
type: "agent.compaction.started",
|
|
2246
2483
|
reason: input.reason,
|
|
@@ -2248,7 +2485,7 @@ class BrokerStreamSink {
|
|
|
2248
2485
|
});
|
|
2249
2486
|
}
|
|
2250
2487
|
async publishCompactionCompleted(input) {
|
|
2251
|
-
await this.
|
|
2488
|
+
await this.publishInOrder(input.run, {
|
|
2252
2489
|
...agentRunStreamEventBase2(input.run),
|
|
2253
2490
|
type: "agent.compaction.completed",
|
|
2254
2491
|
reason: input.reason,
|
|
@@ -2258,7 +2495,7 @@ class BrokerStreamSink {
|
|
|
2258
2495
|
});
|
|
2259
2496
|
}
|
|
2260
2497
|
async publishCompactionFailed(input) {
|
|
2261
|
-
await this.
|
|
2498
|
+
await this.publishInOrder(input.run, {
|
|
2262
2499
|
...agentRunStreamEventBase2(input.run),
|
|
2263
2500
|
type: "agent.compaction.failed",
|
|
2264
2501
|
reason: input.reason,
|
|
@@ -2275,15 +2512,38 @@ class BrokerStreamSink {
|
|
|
2275
2512
|
console.error("[Sixb] Agent run stream chunk encoding failed:", error);
|
|
2276
2513
|
return;
|
|
2277
2514
|
}
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2515
|
+
const stream = this.stream(input.run);
|
|
2516
|
+
const pending = stream.pending;
|
|
2517
|
+
if (pending && continuesDelta2(pending.chunk, chunk)) {
|
|
2518
|
+
pending.chunk = mergeDeltas2(pending.chunk, chunk);
|
|
2519
|
+
pending.run = input.run;
|
|
2520
|
+
return;
|
|
2521
|
+
}
|
|
2522
|
+
const flushed = this.flush(stream);
|
|
2523
|
+
if (isDeltaChunk2(chunk) && this.deltaWindowMs > 0) {
|
|
2524
|
+
stream.pending = { run: input.run, chunkIndex: input.chunkIndex, chunk };
|
|
2525
|
+
stream.timer = setTimeout(() => void this.flush(stream), this.deltaWindowMs);
|
|
2526
|
+
await flushed;
|
|
2527
|
+
return;
|
|
2528
|
+
}
|
|
2529
|
+
await this.enqueue(stream, () => this.appendChunk(input.run, stream, input.chunkIndex, chunk));
|
|
2530
|
+
}
|
|
2531
|
+
async publishInboxRead(input) {
|
|
2532
|
+
const stream = this.stream(input.run);
|
|
2533
|
+
this.flush(stream);
|
|
2534
|
+
await this.enqueue(stream, async () => {
|
|
2535
|
+
const afterChunkIndex = stream.lastChunkIndex;
|
|
2536
|
+
await this.publish({
|
|
2537
|
+
...agentRunStreamEventBase2(input.run),
|
|
2538
|
+
type: "agent.inbox.read",
|
|
2539
|
+
messages: input.messages,
|
|
2540
|
+
...afterChunkIndex === undefined ? {} : { afterChunkIndex }
|
|
2541
|
+
});
|
|
2542
|
+
stream.reads.push({ at: stream.step.length, messages: input.messages });
|
|
2543
|
+
});
|
|
2284
2544
|
}
|
|
2285
2545
|
async publishMessageFinalized(input) {
|
|
2286
|
-
await this.
|
|
2546
|
+
await this.publishInOrder(input.run, {
|
|
2287
2547
|
...agentRunStreamEventBase2(input.run),
|
|
2288
2548
|
type: "agent.message.finalized",
|
|
2289
2549
|
messageId: input.messageId
|
|
@@ -2293,11 +2553,118 @@ class BrokerStreamSink {
|
|
|
2293
2553
|
if (run.status === "queued" || run.status === "running") {
|
|
2294
2554
|
return;
|
|
2295
2555
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2556
|
+
try {
|
|
2557
|
+
await this.publishInOrder(run, agentRunFinishedEvent2(run));
|
|
2558
|
+
} finally {
|
|
2559
|
+
this.forget(run.id);
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
stream(run) {
|
|
2563
|
+
const known = this.runs.get(run.id);
|
|
2564
|
+
if (known && known.attempt === run.attempt)
|
|
2565
|
+
return known;
|
|
2566
|
+
if (known)
|
|
2567
|
+
clearTimeout(known.timer);
|
|
2568
|
+
else if (this.runs.size >= MAX_TRACKED_RUNS) {
|
|
2569
|
+
const [oldest] = this.runs.keys();
|
|
2570
|
+
if (oldest !== undefined)
|
|
2571
|
+
this.forget(oldest);
|
|
2572
|
+
}
|
|
2573
|
+
const stream = {
|
|
2574
|
+
attempt: run.attempt,
|
|
2575
|
+
tail: Promise.resolve(),
|
|
2576
|
+
pending: null,
|
|
2577
|
+
timer: undefined,
|
|
2578
|
+
step: [],
|
|
2579
|
+
reads: [],
|
|
2580
|
+
lastChunkIndex: undefined
|
|
2581
|
+
};
|
|
2582
|
+
this.runs.set(run.id, stream);
|
|
2583
|
+
return stream;
|
|
2584
|
+
}
|
|
2585
|
+
forget(runId) {
|
|
2586
|
+
clearTimeout(this.runs.get(runId)?.timer);
|
|
2587
|
+
this.runs.delete(runId);
|
|
2588
|
+
this.ensured.delete(agentRunStreamId2(runId));
|
|
2589
|
+
this.ensured.delete(agentRunStepsStreamId2(runId));
|
|
2590
|
+
}
|
|
2591
|
+
enqueue(stream, task) {
|
|
2592
|
+
const next = stream.tail.then(task);
|
|
2593
|
+
stream.tail = next.catch(() => {});
|
|
2594
|
+
return next;
|
|
2595
|
+
}
|
|
2596
|
+
flush(stream) {
|
|
2597
|
+
clearTimeout(stream.timer);
|
|
2598
|
+
stream.timer = undefined;
|
|
2599
|
+
const pending = stream.pending;
|
|
2600
|
+
if (!pending)
|
|
2601
|
+
return stream.tail;
|
|
2602
|
+
stream.pending = null;
|
|
2603
|
+
return this.enqueue(stream, () => this.appendChunk(pending.run, stream, pending.chunkIndex, pending.chunk)).catch((error) => {
|
|
2604
|
+
console.error(`[Sixb] Agent run '${pending.run.id}' ui chunk stream publish failed:`, error);
|
|
2605
|
+
});
|
|
2606
|
+
}
|
|
2607
|
+
async publishInOrder(run, event) {
|
|
2608
|
+
const stream = this.stream(run);
|
|
2609
|
+
this.flush(stream);
|
|
2610
|
+
await this.enqueue(stream, () => this.publish(event));
|
|
2611
|
+
}
|
|
2612
|
+
async appendChunk(run, stream, chunkIndex, chunk) {
|
|
2613
|
+
const startsStep = chunk.type === "start-step" && !chunk.retry;
|
|
2614
|
+
if (startsStep && (stream.step.length > 0 || stream.reads.length > 0)) {
|
|
2615
|
+
await this.logStep(run, stream);
|
|
2616
|
+
}
|
|
2617
|
+
await this.publish({
|
|
2618
|
+
...agentRunStreamEventBase2(run),
|
|
2619
|
+
type: "agent.ui.chunk",
|
|
2620
|
+
chunkIndex,
|
|
2621
|
+
chunk
|
|
2622
|
+
}, { prevalidated: true });
|
|
2623
|
+
stream.lastChunkIndex = chunkIndex;
|
|
2624
|
+
if (chunk.type === "start-step" && chunk.retry) {
|
|
2625
|
+
const [head] = stream.step;
|
|
2626
|
+
stream.step = head?.type === "start-step" ? [head] : [];
|
|
2627
|
+
stream.reads = stream.reads.filter((read) => read.at <= stream.step.length);
|
|
2628
|
+
return;
|
|
2629
|
+
}
|
|
2630
|
+
if (stream.reads.at(-1)?.at === stream.step.length)
|
|
2631
|
+
stream.step.push(chunk);
|
|
2632
|
+
else
|
|
2633
|
+
appendCompacted2(stream.step, chunk);
|
|
2634
|
+
}
|
|
2635
|
+
async logStep(run, stream) {
|
|
2636
|
+
if (stream.lastChunkIndex === undefined)
|
|
2637
|
+
return;
|
|
2638
|
+
const event = {
|
|
2639
|
+
...agentRunStreamEventBase2(run),
|
|
2640
|
+
type: "agent.ui.steps",
|
|
2641
|
+
throughChunkIndex: stream.lastChunkIndex,
|
|
2642
|
+
chunks: stream.step,
|
|
2643
|
+
...stream.reads.length === 0 ? {} : { reads: stream.reads }
|
|
2644
|
+
};
|
|
2645
|
+
try {
|
|
2646
|
+
const definition = agentRunStepsStreamDefinition2(run.id);
|
|
2647
|
+
await this.ensure(definition);
|
|
2648
|
+
await this.broker.append({
|
|
2649
|
+
projectId: this.projectId,
|
|
2650
|
+
streamId: definition.id,
|
|
2651
|
+
records: [
|
|
2652
|
+
{
|
|
2653
|
+
name: event.type,
|
|
2654
|
+
key: run.id,
|
|
2655
|
+
payload: event,
|
|
2656
|
+
idempotencyKey: agentRunStreamIdempotencyKey2(event)
|
|
2657
|
+
}
|
|
2658
|
+
]
|
|
2659
|
+
});
|
|
2660
|
+
stream.step = [];
|
|
2661
|
+
stream.reads = [];
|
|
2662
|
+
} catch (error) {
|
|
2663
|
+
console.error(`[Sixb] Agent run '${run.id}' step log publish failed:`, error);
|
|
2664
|
+
}
|
|
2298
2665
|
}
|
|
2299
2666
|
async publish(event, options = {}) {
|
|
2300
|
-
await this.ensure(event.runId);
|
|
2667
|
+
await this.ensure(agentRunStreamDefinition2(event.runId));
|
|
2301
2668
|
const payload = options.prevalidated ? event : toBrokerJson(event, "Agent stream event", {
|
|
2302
2669
|
runId: event.runId
|
|
2303
2670
|
});
|
|
@@ -2314,16 +2681,12 @@ class BrokerStreamSink {
|
|
|
2314
2681
|
]
|
|
2315
2682
|
});
|
|
2316
2683
|
}
|
|
2317
|
-
async ensure(
|
|
2318
|
-
|
|
2319
|
-
if (this.ensured.has(streamId)) {
|
|
2684
|
+
async ensure(stream) {
|
|
2685
|
+
if (this.ensured.has(stream.id)) {
|
|
2320
2686
|
return;
|
|
2321
2687
|
}
|
|
2322
|
-
await this.broker.ensureStream({
|
|
2323
|
-
|
|
2324
|
-
stream: agentRunStreamDefinition2(runId)
|
|
2325
|
-
});
|
|
2326
|
-
this.ensured.add(streamId);
|
|
2688
|
+
await this.broker.ensureStream({ projectId: this.projectId, stream });
|
|
2689
|
+
this.ensured.add(stream.id);
|
|
2327
2690
|
}
|
|
2328
2691
|
}
|
|
2329
2692
|
async function isolateStreamSinkCall(runId, label, publish) {
|
|
@@ -2813,7 +3176,19 @@ function agentRunChildren(host, run, executionToken, scope, delegable) {
|
|
|
2813
3176
|
const included = await Promise.all(found.map((each) => scope.includes(each.threadId)));
|
|
2814
3177
|
return found.filter((_, index) => included[index]);
|
|
2815
3178
|
},
|
|
2816
|
-
inConversation: (input) =>
|
|
3179
|
+
inConversation: async (input) => {
|
|
3180
|
+
const { total } = await agents.messages.list({
|
|
3181
|
+
projectId,
|
|
3182
|
+
threadId: run.threadId,
|
|
3183
|
+
limit: 1
|
|
3184
|
+
});
|
|
3185
|
+
return agents.runs.listThreadSubagents({
|
|
3186
|
+
...input,
|
|
3187
|
+
projectId,
|
|
3188
|
+
threadId: run.threadId,
|
|
3189
|
+
...total > 0 ? { retainedTurnsOnly: true } : {}
|
|
3190
|
+
});
|
|
3191
|
+
},
|
|
2817
3192
|
async threadRuns(threadId) {
|
|
2818
3193
|
if (!await scope.includes(threadId))
|
|
2819
3194
|
return [];
|
|
@@ -2961,6 +3336,19 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
2961
3336
|
return bound;
|
|
2962
3337
|
};
|
|
2963
3338
|
const runSdk = async () => (await bind()).sixb;
|
|
3339
|
+
let requestedBy;
|
|
3340
|
+
const requester = () => {
|
|
3341
|
+
requestedBy ??= host.storage.executions.getById({ projectId: host.projectId, id: run.executionId }).then((execution) => {
|
|
3342
|
+
if (!execution) {
|
|
3343
|
+
throw new Error(`[Sixb] Agent run '${run.id}' references missing execution '${run.executionId}'.`);
|
|
3344
|
+
}
|
|
3345
|
+
return execution.requestedBy;
|
|
3346
|
+
}).catch((error) => {
|
|
3347
|
+
requestedBy = undefined;
|
|
3348
|
+
throw error;
|
|
3349
|
+
});
|
|
3350
|
+
return requestedBy;
|
|
3351
|
+
};
|
|
2964
3352
|
const cancel = await watchAgentRunCancel2(host, [run.id, ...cancelWith]);
|
|
2965
3353
|
const recordedCancel = new AbortController;
|
|
2966
3354
|
const readCancel = (current) => {
|
|
@@ -3044,6 +3432,28 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
3044
3432
|
holdsRun: () => host.storage.agents.approvals.holdsRun({ projectId: host.projectId, runId: run.id }),
|
|
3045
3433
|
pausesAfterStep: () => turnPausesOnHeldCalls2(host.storage.agents, run)
|
|
3046
3434
|
},
|
|
3435
|
+
inbox: {
|
|
3436
|
+
async takeSteers({ stepIndex, afterAnswer }) {
|
|
3437
|
+
if (run.kind !== "conversation")
|
|
3438
|
+
return [];
|
|
3439
|
+
const authorPrincipal = await requester();
|
|
3440
|
+
if (!authorPrincipal)
|
|
3441
|
+
return [];
|
|
3442
|
+
const items = await fenced(run.id, () => agents.inbox.takeSteers({
|
|
3443
|
+
projectId: host.projectId,
|
|
3444
|
+
threadId: run.threadId,
|
|
3445
|
+
runId: run.id,
|
|
3446
|
+
executionToken,
|
|
3447
|
+
stepIndex,
|
|
3448
|
+
...afterAnswer ? { afterAnswer: true } : {},
|
|
3449
|
+
authorPrincipal
|
|
3450
|
+
}));
|
|
3451
|
+
if (items.length > 0) {
|
|
3452
|
+
await host.events.publishInboxRead({ run, messages: items.map(inboxReadMessage) });
|
|
3453
|
+
}
|
|
3454
|
+
return items;
|
|
3455
|
+
}
|
|
3456
|
+
},
|
|
3047
3457
|
models: {
|
|
3048
3458
|
async language(ref, options) {
|
|
3049
3459
|
const key = `${ref.provider}/${ref.modelId}`;
|
|
@@ -3086,7 +3496,7 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
3086
3496
|
}
|
|
3087
3497
|
},
|
|
3088
3498
|
async finish(outcome, messages) {
|
|
3089
|
-
const finished = await finishWithRetries(host.storage, { ...outcome, ...fence }, messages ?? []);
|
|
3499
|
+
const finished = await finishWithRetries(host.storage, run, { ...outcome, ...fence }, messages ?? []);
|
|
3090
3500
|
await host.afterFinish?.(finished).catch((error) => {
|
|
3091
3501
|
console.error(`[Sixb] What follows agent run '${run.id}' failed; repair retries it.`, error);
|
|
3092
3502
|
});
|
|
@@ -3165,13 +3575,17 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
3165
3575
|
createdByRunId: run.id,
|
|
3166
3576
|
executionToken
|
|
3167
3577
|
}));
|
|
3168
|
-
return
|
|
3578
|
+
return readAgentTurnHistory2(host, input.threadId);
|
|
3169
3579
|
},
|
|
3170
3580
|
workspace: {
|
|
3171
3581
|
async transition(input) {
|
|
3172
3582
|
if (input.id !== run.threadId) {
|
|
3173
3583
|
throw new AgentRunRefusedError2(`[Sixb] Agent run '${run.id}' moves only its own thread's workspace, not '${input.id}'.`);
|
|
3174
3584
|
}
|
|
3585
|
+
const { action } = input;
|
|
3586
|
+
if (action !== "acquire" && action !== "replace" && action !== "settle") {
|
|
3587
|
+
throw new AgentRunRefusedError2(`[Sixb] Agent run '${run.id}' cannot ${action} its thread's workspace: only its owner recovers it.`);
|
|
3588
|
+
}
|
|
3175
3589
|
return fenced(run.id, () => host.storage.agents.threads.transitionSandbox({
|
|
3176
3590
|
...input,
|
|
3177
3591
|
projectId: host.projectId,
|
|
@@ -3304,20 +3718,24 @@ function sameKind(run, claimed, while_) {
|
|
|
3304
3718
|
return claimed;
|
|
3305
3719
|
}
|
|
3306
3720
|
var FINISH_BACKOFF_MS = [50, 200, 600];
|
|
3307
|
-
async function finishWithRetries(storage, finish, messages) {
|
|
3721
|
+
async function finishWithRetries(storage, run, finish, messages) {
|
|
3308
3722
|
for (let attempt = 0;; attempt += 1) {
|
|
3309
3723
|
try {
|
|
3310
|
-
if (messages.length === 0)
|
|
3724
|
+
if (run.kind !== "conversation" && messages.length === 0) {
|
|
3311
3725
|
return await storage.agents.runs.finish(finish);
|
|
3726
|
+
}
|
|
3312
3727
|
return await storage.transaction(async (tx) => {
|
|
3313
3728
|
const agents = tx.agents;
|
|
3314
3729
|
if (!agents)
|
|
3315
3730
|
throw new Error("[Sixb] Agent storage is not configured.");
|
|
3316
|
-
|
|
3731
|
+
const resolved = run.kind === "conversation" ? await reconcileClaimedSteers(agents, run, finish.executionToken, messages) : messages;
|
|
3732
|
+
for (const message of resolved)
|
|
3317
3733
|
await agents.messages.append(message);
|
|
3318
3734
|
return agents.runs.finish(finish);
|
|
3319
3735
|
});
|
|
3320
3736
|
} catch (error) {
|
|
3737
|
+
if (error instanceof AgentRunRefusedError2)
|
|
3738
|
+
throw error;
|
|
3321
3739
|
if (isTerminalOrExecutionGone2(error))
|
|
3322
3740
|
throw new AgentExecutionLostError2(finish.id);
|
|
3323
3741
|
const delay = FINISH_BACKOFF_MS[attempt];
|
|
@@ -3327,6 +3745,50 @@ async function finishWithRetries(storage, finish, messages) {
|
|
|
3327
3745
|
}
|
|
3328
3746
|
}
|
|
3329
3747
|
}
|
|
3748
|
+
async function reconcileClaimedSteers(agents, run, executionToken, messages) {
|
|
3749
|
+
if (typeof agents.inbox?.consumeClaimed !== "function")
|
|
3750
|
+
return messages;
|
|
3751
|
+
const userIds = messages.filter((message) => message.role === "user").map((message) => message.id);
|
|
3752
|
+
const consumed = await agents.inbox.consumeClaimed({
|
|
3753
|
+
projectId: run.projectId,
|
|
3754
|
+
threadId: run.threadId,
|
|
3755
|
+
runId: run.id,
|
|
3756
|
+
executionToken,
|
|
3757
|
+
messageIds: userIds
|
|
3758
|
+
});
|
|
3759
|
+
const byMessageId = new Map(consumed.map((item) => [item.messageId, item]));
|
|
3760
|
+
return messages.map((message) => {
|
|
3761
|
+
if (message.role !== "user")
|
|
3762
|
+
return message;
|
|
3763
|
+
const claimed = byMessageId.get(message.id);
|
|
3764
|
+
if (!claimed) {
|
|
3765
|
+
throw new AgentRunRefusedError2(`[Sixb] Agent run '${run.id}' finishes only with user messages from its thread's inbox.`);
|
|
3766
|
+
}
|
|
3767
|
+
const metadata = claimed.timeZone || claimed.locale ? {
|
|
3768
|
+
...claimed.timeZone ? { timeZone: claimed.timeZone } : {},
|
|
3769
|
+
...claimed.locale ? { locale: claimed.locale } : {}
|
|
3770
|
+
} : undefined;
|
|
3771
|
+
return {
|
|
3772
|
+
id: claimed.messageId,
|
|
3773
|
+
projectId: claimed.projectId,
|
|
3774
|
+
threadId: claimed.threadId,
|
|
3775
|
+
runId: null,
|
|
3776
|
+
role: "user",
|
|
3777
|
+
parts: claimed.parts,
|
|
3778
|
+
authorPrincipal: claimed.authorPrincipal,
|
|
3779
|
+
createdAt: claimed.createdAt,
|
|
3780
|
+
...metadata ? { metadata } : {}
|
|
3781
|
+
};
|
|
3782
|
+
});
|
|
3783
|
+
}
|
|
3784
|
+
function inboxReadMessage(item) {
|
|
3785
|
+
return {
|
|
3786
|
+
id: item.messageId,
|
|
3787
|
+
authorPrincipal: item.authorPrincipal,
|
|
3788
|
+
parts: item.parts,
|
|
3789
|
+
createdAt: item.createdAt.toISOString()
|
|
3790
|
+
};
|
|
3791
|
+
}
|
|
3330
3792
|
|
|
3331
3793
|
// src/agents/run-liveness.ts
|
|
3332
3794
|
class AgentTurnInterruptedError2 extends Error {
|
|
@@ -3596,6 +4058,12 @@ function createHttpAgentRunSession2(input) {
|
|
|
3596
4058
|
holdsRun: () => call("heldCalls.holdsRun"),
|
|
3597
4059
|
pausesAfterStep: () => call("heldCalls.pausesAfterStep")
|
|
3598
4060
|
},
|
|
4061
|
+
inbox: {
|
|
4062
|
+
takeSteers: async (input) => {
|
|
4063
|
+
await sink.flush();
|
|
4064
|
+
return call("inbox.takeSteers", [input]);
|
|
4065
|
+
}
|
|
4066
|
+
},
|
|
3599
4067
|
children: {
|
|
3600
4068
|
get: (runId) => call("children.get", [runId]),
|
|
3601
4069
|
getMany: (runIds) => call("children.getMany", [runIds]),
|
|
@@ -3649,9 +4117,7 @@ function createHttpAgentRunSession2(input) {
|
|
|
3649
4117
|
query: (...args) => call("artifacts.query", args),
|
|
3650
4118
|
updatable: (artifactId) => call("artifacts.updatable", [artifactId]),
|
|
3651
4119
|
publish: (publish) => call("artifacts.publish", [publish]),
|
|
3652
|
-
turnWrites: () => call("artifacts.turnWrites", [])
|
|
3653
|
-
storePreviews: (previews) => call("artifacts.storePreviews", [previews]),
|
|
3654
|
-
missingPreviews: (version) => call("artifacts.missingPreviews", [version])
|
|
4120
|
+
turnWrites: () => call("artifacts.turnWrites", [])
|
|
3655
4121
|
},
|
|
3656
4122
|
files: {
|
|
3657
4123
|
async put(file) {
|
|
@@ -3807,6 +4273,7 @@ function batchedEvents(deliver) {
|
|
|
3807
4273
|
publishCompactionCompleted: enqueue("publishCompactionCompleted"),
|
|
3808
4274
|
publishCompactionFailed: enqueue("publishCompactionFailed"),
|
|
3809
4275
|
publishUiChunk: enqueue("publishUiChunk"),
|
|
4276
|
+
publishInboxRead: async () => {},
|
|
3810
4277
|
publishMessageFinalized: enqueue("publishMessageFinalized"),
|
|
3811
4278
|
async publishRunFinished(record) {
|
|
3812
4279
|
await enqueue("publishRunFinished")(record);
|
|
@@ -3893,6 +4360,7 @@ var OPERATIONS = {
|
|
|
3893
4360
|
renewLease: (session, [leaseExpiresAt]) => renew(session, capLease(leaseExpiresAt)),
|
|
3894
4361
|
"heldCalls.holdsRun": (session) => session.heldCalls.holdsRun(),
|
|
3895
4362
|
"heldCalls.pausesAfterStep": (session) => session.heldCalls.pausesAfterStep(),
|
|
4363
|
+
"inbox.takeSteers": (session, [input]) => session.inbox.takeSteers(input),
|
|
3896
4364
|
"children.get": (session, [runId]) => session.children.get(runId),
|
|
3897
4365
|
"children.getMany": (session, [runIds]) => session.children.getMany(runIds),
|
|
3898
4366
|
"children.inConversation": (session, [input]) => session.children.inConversation(input),
|
|
@@ -3914,8 +4382,6 @@ var OPERATIONS = {
|
|
|
3914
4382
|
"artifacts.updatable": (session, [artifactId]) => session.artifacts.updatable(artifactId),
|
|
3915
4383
|
"artifacts.publish": (session, [input]) => session.artifacts.publish(input),
|
|
3916
4384
|
"artifacts.turnWrites": (session) => session.artifacts.turnWrites(),
|
|
3917
|
-
"artifacts.storePreviews": (session, [input]) => session.artifacts.storePreviews(input),
|
|
3918
|
-
"artifacts.missingPreviews": (session, [input]) => session.artifacts.missingPreviews(input),
|
|
3919
4385
|
callTool: (session, [call, options], signal) => session.callTool(call, {
|
|
3920
4386
|
...options ?? {},
|
|
3921
4387
|
signal
|
|
@@ -4463,6 +4929,6 @@ function requireFinishedAt(record) {
|
|
|
4463
4929
|
}
|
|
4464
4930
|
return record.finishedAt;
|
|
4465
4931
|
}
|
|
4466
|
-
export { serializeAgentContextForModel2, isAgentToolResult2, toModelMessages2, agentMessageSteps2, attachmentKey2, toolResultAttachmentKey2, attachmentKeyMessageId2, findMessageAttachment2, listMessageAttachments2, resolveAgentWebOptions, assertNoProviderWebTools, webDomainPolicy2, bindAgentWebSearch2, AGENT_RESERVED_TOOL_NAMES2, isAgentToolDefinition2, validateAndNormalizeAgentToolInput2, toolsFromProjectConfig, defineAgentTool2, AGENT_INLINE_IMAGE_LIMITS2, AGENT_IMAGE_INPUT_TOKENS2, projectAgentThreadModelContext2, AGENT_CONTEXT_ESTIMATOR_VERSION2, shouldCompactAgentContext2, estimateAgentContextRequestTokens2, estimateAgentContextMessagesTokens2, agentContextSizeTokens2, measureAgentModelRequest2, measureModelRequest2, selectAgentContextCompactionBoundary2, measureAgentContextTokenRate2, calibrateAgentContextBytesPerToken2, learnedAgentContextBytesPerToken2, readAgentContextTokenRates2, measuringAgentContextTokenRates2, DEFAULT_AGENT_CONTEXT_WINDOW_TOKENS2, AGENT_CONTEXT_COMPACTED_SHARE2, AGENT_IDLE_COMPACTION_TOKENS2, agentOutputCapTokens2, resolveAgentContextBudget2, contextSummaryOutputTokens2, measureAgentStepRequest2, estimateAgentThreadRequest2, readAgentThreadContextUse2, agent2, afterAgentRunFinished2, stopAgentRunChild2, AgentExecutionLostError2, AgentRunRefusedError2, isTerminalOrExecutionGone2, agentRunArtifacts2, NOOP_STREAM_SINK2, createBrokerStreamSink2, isolateStreamSink2, withAgentActivityStream2, SANDBOX_CONTEXT_DIRECTORY2, AGENT_FILE_MAX_BYTES2, storeAgentToolFile2, agentToolFilePath2, agentToolOutputPath2, AGENT_TOOL_OUTPUTS_DIRECTORY2, isAgentToolOutputFile2, agentToolSpec2, runAgentTool2, threadToolAttachments2, UNATTENDED_AGENT_MAX_STEPS2, assertMaxSteps, readAgentRunPlan2, readAgentRunWebPlan2, listSandboxModels2, readAgentRunMemory2, renderAgentRunOntologyDocs2, readAgentRunDelegation2, claimAgentRun2, openAgentRunSession2, agentRunPeople2, watchAgentRunCancel2, AgentFinalizationError2, AgentTurnInterruptedError2, interruptedError2, agentRunLeaseLapsed2, endInterruptedAgentRun2, endLapsedAgentRuns2, encodeWireValue2, decodeWireValue2, encodeWireError2, createHttpAgentRunSession2, claimAgentRunOverHttp2, claimAgentRunChildOverHttp2, AGENT_API_ROUTES2, createAgentRunToken2, isAgentRunToken2, agentRunTokenRunId2, isValidAgentRunToken2, createAgentRunnerToken2, isAgentRunnerToken2, isAllowedAgentApiRequest2, findAgentApiRoute2, serveAgentRunSession2, claimAgentRunForRunner2, WorkflowResumeDispatchError2, claimWorkflowAgentNode2, enqueueWorkflowAgentNodeResume2 };
|
|
4932
|
+
export { serializeAgentContextForModel2, isAgentToolResult2, toModelMessages2, agentMessageSteps2, attachmentKey2, toolResultAttachmentKey2, attachmentKeyMessageId2, findMessageAttachment2, listMessageAttachments2, resolveAgentWebOptions, assertNoProviderWebTools, webDomainPolicy2, bindAgentWebSearch2, AGENT_RESERVED_TOOL_NAMES2, isAgentToolDefinition2, validateAndNormalizeAgentToolInput2, toolsFromProjectConfig, defineAgentTool2, AGENT_INLINE_IMAGE_LIMITS2, AGENT_IMAGE_INPUT_TOKENS2, projectAgentThreadModelContext2, AGENT_CONTEXT_ESTIMATOR_VERSION2, shouldCompactAgentContext2, estimateAgentContextRequestTokens2, estimateAgentContextMessagesTokens2, agentContextSizeTokens2, measureAgentModelRequest2, measureModelRequest2, selectAgentContextCompactionBoundary2, measureAgentContextTokenRate2, calibrateAgentContextBytesPerToken2, learnedAgentContextBytesPerToken2, readAgentContextTokenRates2, measuringAgentContextTokenRates2, DEFAULT_AGENT_CONTEXT_WINDOW_TOKENS2, AGENT_CONTEXT_COMPACTED_SHARE2, AGENT_IDLE_COMPACTION_TOKENS2, agentOutputCapTokens2, resolveAgentContextBudget2, contextSummaryOutputTokens2, measureAgentStepRequest2, readAgentTurnHistory2, estimateAgentThreadRequest2, readAgentThreadContextUse2, agent2, afterAgentRunFinished2, repairAgentInboxes2, stopAgentRunChild2, AgentExecutionLostError2, AgentRunRefusedError2, isTerminalOrExecutionGone2, agentRunArtifacts2, NOOP_STREAM_SINK2, createBrokerStreamSink2, isolateStreamSink2, withAgentActivityStream2, SANDBOX_CONTEXT_DIRECTORY2, AGENT_FILE_MAX_BYTES2, storeAgentToolFile2, agentToolFilePath2, agentToolOutputPath2, AGENT_TOOL_OUTPUTS_DIRECTORY2, isAgentToolOutputFile2, agentToolSpec2, runAgentTool2, threadToolAttachments2, UNATTENDED_AGENT_MAX_STEPS2, assertMaxSteps, readAgentRunPlan2, readAgentRunWebPlan2, listSandboxModels2, readAgentRunMemory2, renderAgentRunOntologyDocs2, readAgentRunDelegation2, claimAgentRun2, openAgentRunSession2, agentRunPeople2, watchAgentRunCancel2, AgentFinalizationError2, AgentTurnInterruptedError2, interruptedError2, agentRunLeaseLapsed2, endInterruptedAgentRun2, endLapsedAgentRuns2, encodeWireValue2, decodeWireValue2, encodeWireError2, createHttpAgentRunSession2, claimAgentRunOverHttp2, claimAgentRunChildOverHttp2, AGENT_API_ROUTES2, createAgentRunToken2, isAgentRunToken2, agentRunTokenRunId2, isValidAgentRunToken2, createAgentRunnerToken2, isAgentRunnerToken2, isAllowedAgentApiRequest2, findAgentApiRoute2, serveAgentRunSession2, claimAgentRunForRunner2, WorkflowResumeDispatchError2, claimWorkflowAgentNode2, enqueueWorkflowAgentNodeResume2 };
|
|
4467
4933
|
|
|
4468
|
-
//# debugId=
|
|
4934
|
+
//# debugId=94A1C17F432CCCB664756E2164756E21
|