@sixb/core 0.2.5 → 0.2.7
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 +36 -35
- 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 +17 -2
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/index.d.ts +3 -3
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +53 -45
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/model-routing.d.ts +16 -2
- package/dist/agents/model-routing.d.ts.map +1 -1
- package/dist/agents/request.d.ts +45 -4
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/run-events.d.ts +4 -0
- 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-token.d.ts +6 -0
- package/dist/agents/run-token.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 +37 -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/artifacts/live/server.js +19 -18
- package/dist/artifacts/live/server.js.map +1 -1
- package/dist/artifacts/publish/index.js +18 -17
- package/dist/artifacts/publish/index.js.map +1 -1
- package/dist/artifacts/publish/merge.d.ts +2 -1
- package/dist/artifacts/publish/merge.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/index.js +2 -2
- package/dist/bootstrap/discovery.d.ts +6 -0
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.js +40 -38
- 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-04r2fdsd.js +386 -0
- package/dist/chunk-04r2fdsd.js.map +14 -0
- package/dist/{chunk-gjhrz66x.js → chunk-06kpaqg4.js} +248 -21
- package/dist/{chunk-gjhrz66x.js.map → chunk-06kpaqg4.js.map} +6 -6
- package/dist/{chunk-5a4a52tq.js → chunk-0pmpwn3g.js} +18 -2
- package/dist/chunk-0pmpwn3g.js.map +10 -0
- package/dist/{chunk-nxysqbt0.js → chunk-389ybvw9.js} +6 -2
- package/dist/chunk-389ybvw9.js.map +10 -0
- package/dist/{chunk-xcrnrpfh.js → chunk-394zjzjs.js} +20 -10
- package/dist/{chunk-xcrnrpfh.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-0hkdtwqk.js → chunk-44hrfmbk.js} +5 -5
- package/dist/{chunk-ey1p8w68.js → chunk-5pz3htbe.js} +86 -5
- package/dist/chunk-5pz3htbe.js.map +13 -0
- package/dist/{chunk-s5pj68fa.js → chunk-5sswe5ej.js} +2 -2
- package/dist/{chunk-k3jh8gsg.js → chunk-5xkqasvn.js} +21 -4
- package/dist/chunk-5xkqasvn.js.map +10 -0
- package/dist/{chunk-5t9gm5tt.js → chunk-6md802cc.js} +38 -14
- package/dist/chunk-6md802cc.js.map +22 -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-ewqn51gr.js → chunk-88xeh6zx.js} +6 -4
- package/dist/{chunk-ewqn51gr.js.map → chunk-88xeh6zx.js.map} +4 -4
- package/dist/{chunk-z1njfqqs.js → chunk-8qmp9fpa.js} +783 -171
- package/dist/{chunk-z1njfqqs.js.map → chunk-8qmp9fpa.js.map} +13 -13
- package/dist/{chunk-r2psmn42.js → chunk-95ps0k5q.js} +3 -3
- package/dist/{chunk-r2psmn42.js.map → chunk-95ps0k5q.js.map} +3 -3
- package/dist/{chunk-fpf57gca.js → chunk-9cyq87qa.js} +276 -68
- package/dist/{chunk-fpf57gca.js.map → chunk-9cyq87qa.js.map} +6 -6
- package/dist/{chunk-q9nkpr8k.js → chunk-9tpmfh3n.js} +1 -1
- package/dist/chunk-9wr3yajk.js.map +2 -2
- package/dist/{chunk-naxjka9v.js → chunk-brhp9d97.js} +2 -2
- package/dist/{chunk-8a8k38tz.js → chunk-brybqw5k.js} +1 -1
- package/dist/{chunk-vehcr9eb.js → chunk-cg7cygfj.js} +1 -1
- package/dist/{chunk-b4escq4c.js → chunk-cpy282b8.js} +6 -6
- package/dist/chunk-dq3t5sr3.js +114 -0
- package/dist/chunk-dq3t5sr3.js.map +11 -0
- package/dist/{chunk-68hm50qh.js → chunk-fdk0ks9p.js} +16 -46
- package/dist/chunk-fdk0ks9p.js.map +12 -0
- package/dist/{chunk-fzae1jpq.js → chunk-fycac8e9.js} +50 -16
- package/dist/{chunk-fzae1jpq.js.map → chunk-fycac8e9.js.map} +3 -3
- package/dist/{chunk-zft9bzbc.js → chunk-hkbks1xm.js} +2 -1
- package/dist/{chunk-zft9bzbc.js.map → chunk-hkbks1xm.js.map} +3 -3
- package/dist/{chunk-m3qx2pns.js → chunk-hvq8xs66.js} +28 -12
- package/dist/{chunk-m3qx2pns.js.map → chunk-hvq8xs66.js.map} +5 -5
- package/dist/{chunk-bc3y6gff.js → chunk-jka26v8c.js} +1 -1
- package/dist/{chunk-s1mqyqmm.js → chunk-js9e6487.js} +12 -8
- package/dist/chunk-js9e6487.js.map +18 -0
- package/dist/{chunk-zxhym8tr.js → chunk-k29rdc3h.js} +1 -1
- package/dist/{chunk-rg725hry.js → chunk-m1cwncee.js} +86 -34
- package/dist/{chunk-rg725hry.js.map → chunk-m1cwncee.js.map} +8 -8
- package/dist/{chunk-1yh6jgtz.js → chunk-mrs7jy17.js} +2 -2
- package/dist/{chunk-qavwr628.js → chunk-n1hbwc6y.js} +5 -6
- package/dist/chunk-n1hbwc6y.js.map +12 -0
- package/dist/{chunk-pqvvqc65.js → chunk-pfdq1ga6.js} +3 -3
- package/dist/{chunk-k29n4176.js → chunk-phs5fbff.js} +6 -6
- package/dist/{chunk-wqe9shx2.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-r588h4ev.js +98 -0
- package/dist/chunk-r588h4ev.js.map +10 -0
- package/dist/{chunk-rtdrm592.js → chunk-t58sktr5.js} +12 -4
- package/dist/{chunk-rtdrm592.js.map → chunk-t58sktr5.js.map} +3 -3
- package/dist/{chunk-paxabbqd.js → chunk-tapdssb5.js} +1 -1
- package/dist/{chunk-dhkc9b23.js → chunk-v8a1qjzp.js} +1 -1
- package/dist/{chunk-q8d9p0tb.js → chunk-wzcjhv54.js} +8 -1
- package/dist/{chunk-q8d9p0tb.js.map → chunk-wzcjhv54.js.map} +3 -3
- package/dist/{chunk-pc7kra3k.js → chunk-xavet0qs.js} +1 -1
- package/dist/{chunk-m9ketb51.js → chunk-ygvay56w.js} +1 -1
- package/dist/{chunk-0mvjpgvm.js → chunk-yyj009tv.js} +4 -4
- package/dist/connectors/connections/capability.d.ts +11 -0
- package/dist/connectors/connections/capability.d.ts.map +1 -1
- 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/service.d.ts +9 -1
- 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/service.d.ts +5 -1
- package/dist/connectors/service.d.ts.map +1 -1
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +2 -2
- package/dist/deploy/internal.js.map +2 -2
- package/dist/deploy/types.d.ts +12 -59
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/env/index.d.ts +10 -3
- package/dist/env/index.d.ts.map +1 -1
- package/dist/env/index.js.map +2 -2
- package/dist/events/execution.d.ts +8 -1
- package/dist/events/execution.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 +37 -36
- package/dist/execution/agent.js.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 +36 -35
- 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 +33 -32
- package/dist/execution/request.js.map +3 -3
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -59
- package/dist/index.js.map +1 -1
- package/dist/maintenance/index.js +1 -1
- package/dist/materializer/index.js +22 -21
- package/dist/materializer/index.js.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 +20 -19
- 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 +36 -35
- 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 +19 -18
- 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 +21 -20
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +20 -19
- package/dist/projections/internal.js.map +1 -1
- package/dist/queues/in-memory.d.ts +1 -1
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +14 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +3 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/internal.js +24 -23
- package/dist/runtime/internal.js.map +2 -2
- package/dist/runtime/locale.d.ts +0 -2
- package/dist/runtime/locale.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +2 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- 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/errors.d.ts +19 -0
- package/dist/sandboxes/errors.d.ts.map +1 -1
- package/dist/sandboxes/exec.d.ts +2 -0
- package/dist/sandboxes/exec.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +4 -2
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +13 -7
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/sandboxes/sandbox.d.ts +15 -1
- package/dist/sandboxes/sandbox.d.ts.map +1 -1
- package/dist/security/view-conditions.d.ts.map +1 -1
- package/dist/shares/internal.js +16 -15
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/in-memory.d.ts +18 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts +43 -9
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +19 -3
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +150 -4
- 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.map +1 -1
- package/dist/storage/artifacts/record.d.ts +3 -1
- package/dist/storage/artifacts/record.d.ts.map +1 -1
- package/dist/storage/artifacts/types.d.ts +7 -0
- package/dist/storage/artifacts/types.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +7 -7
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +23 -22
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.js +8 -8
- 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 +22 -21
- 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-inbox-storage-contract.d.ts.map +1 -1
- 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/index.js +1157 -100
- package/dist/testing/index.js.map +9 -9
- package/dist/testing/run-claim-storage-contract.d.ts.map +1 -1
- package/dist/testing/sandboxes-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +17 -16
- package/dist/webhooks/internal.js.map +2 -2
- 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/worker.d.ts +8 -0
- package/dist/workers/worker.d.ts.map +1 -1
- package/dist/workflows/index.js +42 -40
- package/dist/workflows/index.js.map +1 -1
- package/package.json +7 -1
- package/src/actions/validation.ts +3 -1
- package/src/agents/children.ts +6 -0
- package/src/agents/errors.ts +3 -0
- package/src/agents/execution.ts +170 -20
- package/src/agents/index.ts +5 -0
- package/src/agents/model-routing.ts +116 -34
- package/src/agents/request.ts +783 -38
- package/src/agents/run-events.ts +235 -38
- package/src/agents/run-session-children.ts +13 -2
- package/src/agents/run-token.ts +7 -0
- package/src/agents/run-turn.ts +140 -23
- package/src/agents/streams/index.ts +2 -0
- package/src/agents/streams/internal.ts +12 -0
- package/src/agents/streams/protocol.ts +69 -1
- package/src/agents/streams/steps.ts +131 -0
- package/src/agents/thread-access.ts +57 -2
- package/src/artifacts/publish/merge.ts +14 -3
- package/src/artifacts/run-query.ts +5 -2
- package/src/bootstrap/discovery.ts +61 -11
- package/src/calendar.ts +195 -0
- package/src/connectors/connections/capability.ts +40 -0
- package/src/connectors/connections/internal.ts +3 -0
- package/src/connectors/connections/service.ts +74 -5
- package/src/connectors/execution.ts +5 -6
- package/src/connectors/service.ts +23 -0
- package/src/deploy/index.ts +0 -5
- package/src/deploy/types.ts +12 -64
- package/src/deploy/validation.ts +1 -1
- package/src/env/index.ts +10 -4
- package/src/events/execution.ts +42 -2
- package/src/events/types/syncs.ts +4 -0
- package/src/execution/authorized-object-reader.ts +33 -5
- package/src/execution/object-reader-ontology.ts +6 -0
- package/src/execution/request.ts +1 -0
- package/src/http/api-routes.ts +8 -0
- package/src/index.ts +21 -2
- 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/runtime/create.ts +1 -0
- package/src/runtime/definitions.ts +25 -0
- package/src/runtime/host.ts +16 -8
- package/src/runtime/index.ts +6 -1
- package/src/runtime/locale.ts +0 -10
- package/src/runtime/resolve-definitions.ts +7 -1
- package/src/runtime/sixb.ts +12 -2
- package/src/sandboxes/README.md +12 -1
- package/src/sandboxes/auth.ts +32 -4
- package/src/sandboxes/errors.ts +27 -0
- package/src/sandboxes/exec.ts +3 -1
- package/src/sandboxes/index.ts +18 -1
- package/src/sandboxes/sandbox.ts +15 -1
- package/src/security/view-conditions.ts +2 -1
- package/src/storage/agents/in-memory.ts +271 -6
- package/src/storage/agents/index.ts +10 -0
- package/src/storage/agents/provider.ts +178 -13
- package/src/storage/agents/types.ts +166 -4
- 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 +20 -5
- package/src/storage/artifacts/record.ts +8 -2
- package/src/storage/artifacts/types.ts +7 -0
- package/src/storage/index.ts +11 -0
- package/src/storage/operation-scope.ts +1 -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-inbox-storage-contract.ts +59 -0
- package/src/testing/agent-storage-contract.ts +794 -8
- package/src/testing/ai-cost-storage-contract.ts +80 -0
- package/src/testing/artifact-storage-contract.ts +139 -0
- package/src/testing/run-claim-storage-contract.ts +116 -0
- package/src/testing/sandboxes-contract.ts +50 -0
- 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/worker.ts +67 -7
- package/dist/chunk-5a4a52tq.js.map +0 -10
- package/dist/chunk-5t9gm5tt.js.map +0 -22
- package/dist/chunk-68hm50qh.js.map +0 -13
- package/dist/chunk-aw1z0gre.js +0 -234
- package/dist/chunk-aw1z0gre.js.map +0 -12
- package/dist/chunk-ey1p8w68.js.map +0 -13
- package/dist/chunk-k3jh8gsg.js.map +0 -10
- package/dist/chunk-nxysqbt0.js.map +0 -10
- package/dist/chunk-qavwr628.js.map +0 -12
- package/dist/chunk-s1mqyqmm.js.map +0 -18
- package/dist/chunk-zeykm8my.js.map +0 -14
- /package/dist/{chunk-stmxh0hv.js.map → chunk-3neam1y5.js.map} +0 -0
- /package/dist/{chunk-0hkdtwqk.js.map → chunk-44hrfmbk.js.map} +0 -0
- /package/dist/{chunk-s5pj68fa.js.map → chunk-5sswe5ej.js.map} +0 -0
- /package/dist/{chunk-q9nkpr8k.js.map → chunk-9tpmfh3n.js.map} +0 -0
- /package/dist/{chunk-naxjka9v.js.map → chunk-brhp9d97.js.map} +0 -0
- /package/dist/{chunk-8a8k38tz.js.map → chunk-brybqw5k.js.map} +0 -0
- /package/dist/{chunk-vehcr9eb.js.map → chunk-cg7cygfj.js.map} +0 -0
- /package/dist/{chunk-b4escq4c.js.map → chunk-cpy282b8.js.map} +0 -0
- /package/dist/{chunk-bc3y6gff.js.map → chunk-jka26v8c.js.map} +0 -0
- /package/dist/{chunk-zxhym8tr.js.map → chunk-k29rdc3h.js.map} +0 -0
- /package/dist/{chunk-1yh6jgtz.js.map → chunk-mrs7jy17.js.map} +0 -0
- /package/dist/{chunk-pqvvqc65.js.map → chunk-pfdq1ga6.js.map} +0 -0
- /package/dist/{chunk-k29n4176.js.map → chunk-phs5fbff.js.map} +0 -0
- /package/dist/{chunk-wqe9shx2.js.map → chunk-qbd282aa.js.map} +0 -0
- /package/dist/{chunk-paxabbqd.js.map → chunk-tapdssb5.js.map} +0 -0
- /package/dist/{chunk-dhkc9b23.js.map → chunk-v8a1qjzp.js.map} +0 -0
- /package/dist/{chunk-pc7kra3k.js.map → chunk-xavet0qs.js.map} +0 -0
- /package/dist/{chunk-m9ketb51.js.map → chunk-ygvay56w.js.map} +0 -0
- /package/dist/{chunk-0mvjpgvm.js.map → chunk-yyj009tv.js.map} +0 -0
|
@@ -11,6 +11,7 @@ import { question } from "../models/decision/questions"
|
|
|
11
11
|
import { supportsQuestion } from "../models/decision/validation"
|
|
12
12
|
import { RuntimeError } from "../runtime/errors"
|
|
13
13
|
import type { ConversationAgentRunRecord } from "../storage/agents"
|
|
14
|
+
import { type AgentTurnPlace, runPlaceKey } from "../storage/agents/provider"
|
|
14
15
|
|
|
15
16
|
/** Moving up needs no confidence: a turn goes to `heavy` from this probability. */
|
|
16
17
|
const HEAVY_FROM = 0.4
|
|
@@ -27,25 +28,53 @@ const DECISION_TIMEOUT_MS = 2_000
|
|
|
27
28
|
/** How long a provider keeps a thread's prompt cache after the last call that read it. */
|
|
28
29
|
const PROMPT_CACHE_TTL_MS = 5 * 60_000
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
/** How much of the previous message the decision model reads: enough to tell what work it set. */
|
|
32
|
+
const PREVIOUS_MESSAGE_CHARS = 2_000
|
|
33
|
+
|
|
34
|
+
/** What each tier is for, whatever the project: its models' descriptions say how it uses them. */
|
|
35
|
+
const TIER_WORK: Readonly<Record<LanguageModelTier, string>> = {
|
|
36
|
+
light:
|
|
37
|
+
"A lookup, a count, a filter or a list with an obvious answer. Greetings, thanks, and short " +
|
|
38
|
+
"questions that start no new work.",
|
|
39
|
+
standard:
|
|
40
|
+
"Usual work with a clear path: several queries or reads, a comparison, a short summary, a " +
|
|
41
|
+
"simple action, or a small change to a few files.",
|
|
42
|
+
heavy:
|
|
43
|
+
"Open-ended or long work: a multi-step investigation, explaining why something happened, " +
|
|
44
|
+
"weighing trade-offs, building a plan, writing a long report, or changes across many files " +
|
|
45
|
+
"that must be checked.",
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The tier question for a project: the work each tier is for, and the description of the model a
|
|
50
|
+
* routed turn runs on in that tier, which the project can write to steer the choice.
|
|
51
|
+
*/
|
|
52
|
+
function tierQuestions(language: LanguageModelCatalog) {
|
|
53
|
+
return {
|
|
54
|
+
tier: question.choice({
|
|
55
|
+
instructions:
|
|
56
|
+
"A user sent this message to an agent that works in a project with tools: it reads and " +
|
|
57
|
+
"changes the project's data, runs actions, writes documents, and in a workspace runs " +
|
|
58
|
+
"commands and edits files. Pick the model tier the answer needs. Judge the work the " +
|
|
59
|
+
"answer takes, not the length or tone of the message. When the input holds the " +
|
|
60
|
+
"previous message, with the tier it ran on, judge the <message> in its light: a short " +
|
|
61
|
+
"message that carries on that work, such as approving a plan or asking for the next " +
|
|
62
|
+
"step, takes the tier the work needs.",
|
|
63
|
+
options: {
|
|
64
|
+
light: tierOption(language, "light"),
|
|
65
|
+
standard: tierOption(language, "standard"),
|
|
66
|
+
heavy: tierOption(language, "heavy"),
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function tierOption(language: LanguageModelCatalog, tier: LanguageModelTier): string {
|
|
73
|
+
const description = language.tiers.includes(tier)
|
|
74
|
+
? language.getByTier(tier).model.definition.description?.trim()
|
|
75
|
+
: undefined
|
|
76
|
+
|
|
77
|
+
return description ? `${TIER_WORK[tier]} This tier's model: ${description}` : TIER_WORK[tier]
|
|
49
78
|
}
|
|
50
79
|
|
|
51
80
|
export interface TurnModelChoice {
|
|
@@ -57,9 +86,23 @@ export interface TurnModelChoice {
|
|
|
57
86
|
readonly tierProbabilities?: LanguageModelTierProbabilities
|
|
58
87
|
}
|
|
59
88
|
|
|
89
|
+
/** A turn whose model Sixb picks. */
|
|
90
|
+
export interface TurnToRoute {
|
|
91
|
+
/** The words of its message. */
|
|
92
|
+
readonly text: string
|
|
93
|
+
/** The thread's previous turn, absent for its first. */
|
|
94
|
+
readonly previous?: {
|
|
95
|
+
readonly run: ConversationAgentRunRecord
|
|
96
|
+
/** The words of the message that started it, which a short follow-up carries on. */
|
|
97
|
+
readonly text?: string
|
|
98
|
+
}
|
|
99
|
+
/** Where the turn runs: the previous turn's cache holds its prompt only if it ran there. */
|
|
100
|
+
readonly place: AgentTurnPlace
|
|
101
|
+
}
|
|
102
|
+
|
|
60
103
|
export interface TurnModelRouter {
|
|
61
|
-
/** The model of a turn that names none
|
|
62
|
-
choose(
|
|
104
|
+
/** The model of a turn that names none. */
|
|
105
|
+
choose(turn: TurnToRoute): Promise<TurnModelChoice>
|
|
63
106
|
}
|
|
64
107
|
|
|
65
108
|
/**
|
|
@@ -67,10 +110,12 @@ export interface TurnModelRouter {
|
|
|
67
110
|
* Checked at startup: a model that cannot would leave every turn on `standard`, warning each time.
|
|
68
111
|
*/
|
|
69
112
|
export function assertTurnModelRouting(models: ModelCatalog | undefined): void {
|
|
70
|
-
const
|
|
113
|
+
const language = models?.language
|
|
71
114
|
const decision = models?.decision?.default
|
|
72
|
-
if (tiers.length === 0 || !decision) return
|
|
73
|
-
|
|
115
|
+
if (!language || language.tiers.length === 0 || !decision) return
|
|
116
|
+
|
|
117
|
+
const { tier } = tierQuestions(language)
|
|
118
|
+
if (supportsQuestion(decision.model.definition.capabilities, tier)) return
|
|
74
119
|
|
|
75
120
|
throw new RuntimeError(
|
|
76
121
|
`[Sixb] The default decision model '${decision.provider}/${decision.modelId}' cannot pick the tier of an Agent turn: it needs 'choice' questions with ${LANGUAGE_MODEL_TIERS.length} options. Put a decision model that supports them first in 'models.decision', or configure 'models.language' as a list.`
|
|
@@ -85,25 +130,55 @@ export function createTurnModelRouter(
|
|
|
85
130
|
const language = models?.language
|
|
86
131
|
if (!language || language.tiers.length === 0 || !models?.decision) return undefined
|
|
87
132
|
|
|
133
|
+
const questions = tierQuestions(language)
|
|
134
|
+
|
|
88
135
|
return {
|
|
89
|
-
async choose(
|
|
136
|
+
async choose(turn) {
|
|
137
|
+
const last = turn.previous && previousTurn(language, turn.previous.run, turn.place)
|
|
138
|
+
|
|
90
139
|
// Files sent alone leave nothing to judge: the turn aims for standard, and the cache rule
|
|
91
140
|
// keeps a warm thread on its model.
|
|
92
|
-
const tierProbabilities = text.trim()
|
|
141
|
+
const tierProbabilities = turn.text.trim()
|
|
142
|
+
? await askTier(decision, questions, decisionInput(turn, last))
|
|
143
|
+
: undefined
|
|
93
144
|
const tier = tierProbabilities ? tierFor(tierProbabilities) : "standard"
|
|
94
145
|
|
|
95
146
|
return {
|
|
96
|
-
model: turnModel(language, tier,
|
|
147
|
+
model: turnModel(language, tier, last),
|
|
97
148
|
...(tierProbabilities ? { tierProbabilities } : {}),
|
|
98
149
|
}
|
|
99
150
|
},
|
|
100
151
|
}
|
|
101
152
|
}
|
|
102
153
|
|
|
154
|
+
/**
|
|
155
|
+
* The message, after the one before it and the tier that one ran on: "Go ahead" after a plan for
|
|
156
|
+
* a large change asks for that change, and judged alone it reads like thanks.
|
|
157
|
+
*/
|
|
158
|
+
function decisionInput(turn: TurnToRoute, last: PreviousTurn | undefined): string {
|
|
159
|
+
const before = turn.previous?.text?.trim()
|
|
160
|
+
if (!before) return turn.text
|
|
161
|
+
|
|
162
|
+
const clipped =
|
|
163
|
+
before.length > PREVIOUS_MESSAGE_CHARS ? `${before.slice(0, PREVIOUS_MESSAGE_CHARS)}…` : before
|
|
164
|
+
const tier = last ? ` tier="${last.tier}"` : ""
|
|
165
|
+
|
|
166
|
+
return [
|
|
167
|
+
`<previous_message${tier}>`,
|
|
168
|
+
clipped,
|
|
169
|
+
"</previous_message>",
|
|
170
|
+
"",
|
|
171
|
+
"<message>",
|
|
172
|
+
turn.text,
|
|
173
|
+
"</message>",
|
|
174
|
+
].join("\n")
|
|
175
|
+
}
|
|
176
|
+
|
|
103
177
|
/** The decision model's answer, or nothing when it fails or is too slow. */
|
|
104
178
|
async function askTier(
|
|
105
179
|
decision: DecisionModelsRuntime,
|
|
106
|
-
|
|
180
|
+
questions: ReturnType<typeof tierQuestions>,
|
|
181
|
+
input: string
|
|
107
182
|
): Promise<LanguageModelTierProbabilities | undefined> {
|
|
108
183
|
const timeout = new AbortController()
|
|
109
184
|
const timer = setTimeout(() => {
|
|
@@ -115,7 +190,7 @@ async function askTier(
|
|
|
115
190
|
try {
|
|
116
191
|
// The race holds the turn to its timeout even when a provider ignores the signal.
|
|
117
192
|
const { output } = await Promise.race([
|
|
118
|
-
decision.evaluate({ input
|
|
193
|
+
decision.evaluate({ input, questions, signal: timeout.signal }),
|
|
119
194
|
rejectOnAbort(timeout.signal),
|
|
120
195
|
])
|
|
121
196
|
const { light, standard, heavy } = output.tier.probabilities
|
|
@@ -148,10 +223,9 @@ function tierFor(probabilities: LanguageModelTierProbabilities): LanguageModelTi
|
|
|
148
223
|
function turnModel(
|
|
149
224
|
language: LanguageModelCatalog,
|
|
150
225
|
tier: LanguageModelTier,
|
|
151
|
-
|
|
226
|
+
last: PreviousTurn | undefined
|
|
152
227
|
): LanguageModelEntry {
|
|
153
228
|
const target = language.getByTier(tier)
|
|
154
|
-
const last = previous && previousTurn(language, previous)
|
|
155
229
|
if (!last) return target
|
|
156
230
|
|
|
157
231
|
const change = tierRank(target.tier ?? tier) - tierRank(last.tier)
|
|
@@ -170,7 +244,8 @@ interface PreviousTurn {
|
|
|
170
244
|
/** An older run without a tier takes its model's; one without either counts as no turn at all. */
|
|
171
245
|
function previousTurn(
|
|
172
246
|
language: LanguageModelCatalog,
|
|
173
|
-
run: ConversationAgentRunRecord
|
|
247
|
+
run: ConversationAgentRunRecord,
|
|
248
|
+
place: AgentTurnPlace
|
|
174
249
|
): PreviousTurn | undefined {
|
|
175
250
|
if (!run.spec) return undefined
|
|
176
251
|
|
|
@@ -178,9 +253,16 @@ function previousTurn(
|
|
|
178
253
|
const tier = run.spec.tier ?? model?.tier
|
|
179
254
|
if (tier === undefined) return undefined
|
|
180
255
|
|
|
181
|
-
// A run that never recorded its end counts from its start, or from its admission.
|
|
256
|
+
// A run that never recorded its end counts from its start, or from its admission. A turn in
|
|
257
|
+
// another workspace sent another system prompt, so its cache does not hold this turn's; one
|
|
258
|
+
// where this turn runs does, however the thread moved in between.
|
|
182
259
|
const lastCallAt = run.completedAt ?? run.startedAt ?? run.createdAt
|
|
183
|
-
|
|
260
|
+
const samePlace = runPlaceKey(run.spec) === runPlaceKey(place)
|
|
261
|
+
return {
|
|
262
|
+
model,
|
|
263
|
+
tier,
|
|
264
|
+
cacheWarm: samePlace && Date.now() - lastCallAt.getTime() < PROMPT_CACHE_TTL_MS,
|
|
265
|
+
}
|
|
184
266
|
}
|
|
185
267
|
|
|
186
268
|
function tierRank(tier: LanguageModelTier): number {
|