@sixb/core 0.1.6 → 0.1.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 +37 -33
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/worker.js +3 -3
- package/dist/agents/adapters.d.ts +33 -76
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/authority.d.ts +22 -6
- package/dist/agents/authority.d.ts.map +1 -1
- package/dist/agents/builders.d.ts +3 -11
- package/dist/agents/builders.d.ts.map +1 -1
- package/dist/agents/context.js +2 -2
- package/dist/agents/dispatch.d.ts +9 -1
- package/dist/agents/dispatch.d.ts.map +1 -1
- package/dist/agents/errors.d.ts +2 -2
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/execution.d.ts +9 -10
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/ids.d.ts +4 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +13 -9
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +80 -68
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/message.d.ts +17 -10
- package/dist/agents/message.d.ts.map +1 -1
- package/dist/agents/model-loop.d.ts +56 -0
- package/dist/agents/model-loop.d.ts.map +1 -0
- package/dist/agents/reference.d.ts +4 -0
- package/dist/agents/reference.d.ts.map +1 -0
- package/dist/agents/request.d.ts +10 -8
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/retired-config.d.ts +4 -0
- package/dist/agents/retired-config.d.ts.map +1 -0
- package/dist/agents/streams.d.ts +13 -8
- package/dist/agents/streams.d.ts.map +1 -1
- package/dist/agents/streams.js +7 -5
- package/dist/agents/streams.js.map +1 -1
- package/dist/agents/tool-catalog.d.ts +9 -0
- package/dist/agents/tool-catalog.d.ts.map +1 -0
- package/dist/agents/tool-definition.d.ts +1 -0
- package/dist/agents/tool-definition.d.ts.map +1 -1
- package/dist/agents/types.d.ts +31 -68
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +4 -10
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/ai-usage/execution.d.ts +53 -0
- package/dist/ai-usage/execution.d.ts.map +1 -0
- package/dist/ai-usage/index.d.ts +3 -0
- package/dist/ai-usage/index.d.ts.map +1 -0
- package/dist/auth/index.js +7 -7
- package/dist/authorization/decision.d.ts +5 -2
- package/dist/authorization/decision.d.ts.map +1 -1
- package/dist/authorization/grant-kinds.d.ts +24 -8
- package/dist/authorization/grant-kinds.d.ts.map +1 -1
- package/dist/authorization/index.d.ts +1 -1
- package/dist/authorization/index.d.ts.map +1 -1
- package/dist/authorization/index.js +8 -6
- package/dist/authorization/index.js.map +1 -1
- package/dist/authorization/resolve.d.ts +3 -3
- package/dist/authorization/resolve.d.ts.map +1 -1
- package/dist/authorization/types.d.ts +7 -5
- package/dist/authorization/types.d.ts.map +1 -1
- package/dist/blob-storage/browser.js +2 -2
- package/dist/blob-storage/index.js +3 -3
- package/dist/bootstrap/discovery.d.ts +1 -7
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.js +52 -48
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/broker/index.js +2 -2
- package/dist/{chunk-zqysyfjt.js → chunk-08m3b6w8.js} +1 -1
- package/dist/{chunk-1g8negke.js → chunk-08twe8m6.js} +93 -8
- package/dist/chunk-08twe8m6.js.map +12 -0
- package/dist/{chunk-xkthy56g.js → chunk-1kamz6j0.js} +1 -1
- package/dist/{chunk-dy311asx.js → chunk-2b5qtban.js} +12 -12
- package/dist/{chunk-dy311asx.js.map → chunk-2b5qtban.js.map} +3 -3
- package/dist/{chunk-0172wgm9.js → chunk-2xns679x.js} +10 -2
- package/dist/{chunk-0172wgm9.js.map → chunk-2xns679x.js.map} +3 -3
- package/dist/{chunk-f83ka50g.js → chunk-37wk412q.js} +86 -28
- package/dist/{chunk-f83ka50g.js.map → chunk-37wk412q.js.map} +8 -8
- package/dist/{chunk-md8k0r54.js → chunk-3fqt22c4.js} +4 -4
- package/dist/{chunk-t9xghkva.js → chunk-3kv70xwp.js} +3 -2
- package/dist/{chunk-t9xghkva.js.map → chunk-3kv70xwp.js.map} +3 -3
- package/dist/{chunk-z3zp0bj1.js → chunk-407j3msh.js} +1 -1
- package/dist/{chunk-rhrbz7d4.js → chunk-4a849fr1.js} +1 -1
- package/dist/{chunk-62c7t4jc.js → chunk-4nxeacx7.js} +1 -1
- package/dist/{chunk-cy0n5dms.js → chunk-5jcdmjam.js} +1 -1
- package/dist/{chunk-819wnjz8.js → chunk-64sr682n.js} +7 -7
- package/dist/{chunk-t624af60.js → chunk-6ed5bwnd.js} +646 -67
- package/dist/{chunk-t624af60.js.map → chunk-6ed5bwnd.js.map} +10 -9
- package/dist/{chunk-x2yw73hy.js → chunk-7ds9620f.js} +1 -1
- package/dist/{chunk-dm72y8wt.js → chunk-7y0f6rf1.js} +29 -16
- package/dist/chunk-7y0f6rf1.js.map +10 -0
- package/dist/{chunk-72q2y8hn.js → chunk-8tsf6dmc.js} +2 -2
- package/dist/{chunk-nkbfrt0c.js → chunk-9aehf39w.js} +7 -7
- package/dist/{chunk-ezake7g1.js → chunk-agsvg9ar.js} +1 -1
- package/dist/{chunk-rdeagz6b.js → chunk-atmkaf60.js} +1 -1
- package/dist/{chunk-rdeagz6b.js.map → chunk-atmkaf60.js.map} +2 -2
- package/dist/chunk-c15dr03f.js +43 -0
- package/dist/chunk-c15dr03f.js.map +10 -0
- package/dist/{chunk-0hc5j867.js → chunk-d2ndstdf.js} +8 -6
- package/dist/{chunk-0hc5j867.js.map → chunk-d2ndstdf.js.map} +2 -2
- package/dist/{chunk-rnshztfq.js → chunk-d63tybny.js} +2 -2
- package/dist/{chunk-t0jjkep3.js → chunk-d8qkxt2v.js} +4 -2
- package/dist/chunk-d8qkxt2v.js.map +10 -0
- package/dist/{chunk-vybf6pkp.js → chunk-dbc80ad7.js} +1 -1
- package/dist/{chunk-4gz41why.js → chunk-dqn23610.js} +1 -1
- package/dist/{chunk-5sxb1168.js → chunk-e4rvtvpw.js} +13 -11
- package/dist/{chunk-5sxb1168.js.map → chunk-e4rvtvpw.js.map} +2 -2
- package/dist/{chunk-h9kxd41f.js → chunk-gbrpsx4m.js} +19 -6
- package/dist/chunk-gbrpsx4m.js.map +11 -0
- package/dist/{chunk-nva1xkjz.js → chunk-h0knpbz5.js} +468 -1236
- package/dist/chunk-h0knpbz5.js.map +38 -0
- package/dist/{chunk-tg5mee00.js → chunk-ha58tjtt.js} +6 -6
- package/dist/{chunk-f6erf2vv.js → chunk-hdz94br2.js} +2 -2
- package/dist/chunk-jecn6t54.js +307 -0
- package/dist/chunk-jecn6t54.js.map +12 -0
- package/dist/{chunk-dsrkgtnh.js → chunk-jq43kdvk.js} +1 -1
- package/dist/{chunk-wtmzkcht.js → chunk-k34z5rvh.js} +1 -1
- package/dist/{chunk-htq0qh7z.js → chunk-ka3a2ft3.js} +2 -2
- package/dist/{chunk-znagycq7.js → chunk-kt81c11h.js} +2 -2
- package/dist/chunk-n2arzn6e.js +1745 -0
- package/dist/chunk-n2arzn6e.js.map +20 -0
- package/dist/{chunk-f2rt4vkh.js → chunk-n2w475r0.js} +3 -3
- package/dist/{chunk-t8t39h7v.js → chunk-n6jxh8sw.js} +10 -2
- package/dist/chunk-n6jxh8sw.js.map +10 -0
- package/dist/{chunk-drjqm1aa.js → chunk-p03r0h5s.js} +310 -28
- package/dist/chunk-p03r0h5s.js.map +16 -0
- package/dist/chunk-p2vqaxkc.js +528 -0
- package/dist/chunk-p2vqaxkc.js.map +15 -0
- package/dist/{chunk-n4spznws.js → chunk-qjycjdj6.js} +84 -11
- package/dist/chunk-qjycjdj6.js.map +12 -0
- package/dist/chunk-qjzp9xyb.js +286 -0
- package/dist/chunk-qjzp9xyb.js.map +12 -0
- package/dist/{chunk-5gynx4xn.js → chunk-qv38twt8.js} +50 -69
- package/dist/{chunk-5gynx4xn.js.map → chunk-qv38twt8.js.map} +8 -8
- package/dist/{chunk-bhxaq2nn.js → chunk-qw9gvjv5.js} +1 -1
- package/dist/{chunk-8gv5z0zm.js → chunk-rp1mvzb4.js} +6 -6
- package/dist/{chunk-1e8m6yn3.js → chunk-rre42skh.js} +182 -18
- package/dist/chunk-rre42skh.js.map +39 -0
- package/dist/{chunk-ghteq96b.js → chunk-s5y30bc9.js} +2 -2
- package/dist/{chunk-a31h57d5.js → chunk-tn7xcs2n.js} +2 -2
- package/dist/{chunk-6gjqgd3d.js → chunk-tpnd31c1.js} +2 -1
- package/dist/chunk-tpnd31c1.js.map +11 -0
- package/dist/chunk-trxxmgnf.js +68 -0
- package/dist/chunk-trxxmgnf.js.map +11 -0
- package/dist/{chunk-e42bc6m3.js → chunk-vjjv9mrb.js} +2 -2
- package/dist/{chunk-8b55ygje.js → chunk-w3e09qqk.js} +1 -1
- package/dist/{chunk-ckxfnx7f.js → chunk-wjgm6jjt.js} +2 -2
- package/dist/{chunk-3j7573mj.js → chunk-x0qhkqje.js} +2 -2
- package/dist/{chunk-dysw7nsm.js → chunk-xdpwpkha.js} +2 -2
- package/dist/{chunk-a44d5zgd.js → chunk-y35ma3mj.js} +11 -16
- package/dist/{chunk-a44d5zgd.js.map → chunk-y35ma3mj.js.map} +3 -4
- package/dist/{chunk-qewtks41.js → chunk-z2sery1b.js} +64 -1
- package/dist/{chunk-qewtks41.js.map → chunk-z2sery1b.js.map} +3 -3
- package/dist/error-reporting/internal.js +4 -4
- package/dist/error-reporting/types.d.ts +7 -2
- package/dist/error-reporting/types.d.ts.map +1 -1
- package/dist/errors/catalog.d.ts +8 -0
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/internal.js +2 -2
- package/dist/events/index.js +4 -4
- package/dist/execution/agent.d.ts +18 -9
- package/dist/execution/agent.d.ts.map +1 -1
- package/dist/execution/agent.js +52 -43
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts +14 -4
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/primitive.js +45 -43
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.d.ts +3 -1
- package/dist/execution/request.d.ts.map +1 -1
- package/dist/execution/request.js +46 -44
- package/dist/execution/request.js.map +3 -3
- package/dist/execution/types.d.ts +1 -1
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +82 -77
- package/dist/index.js.map +1 -1
- package/dist/json.d.ts +2 -0
- package/dist/json.d.ts.map +1 -1
- package/dist/lake-storage/index.js +5 -5
- package/dist/logging/index.js +3 -3
- package/dist/logging/types.js +2 -2
- package/dist/materialization/index.js +2 -2
- package/dist/materializer/index.js +33 -29
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/catalog.d.ts +40 -0
- package/dist/models/catalog.d.ts.map +1 -0
- package/dist/models/definitions.d.ts +25 -0
- package/dist/models/definitions.d.ts.map +1 -0
- package/dist/models/errors.d.ts +52 -0
- package/dist/models/errors.d.ts.map +1 -0
- package/dist/models/events.d.ts +192 -0
- package/dist/models/events.d.ts.map +1 -0
- package/dist/models/index.d.ts +17 -39
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +50 -0
- package/dist/models/index.js.map +9 -0
- package/dist/models/language-model.d.ts +90 -0
- package/dist/models/language-model.d.ts.map +1 -0
- package/dist/models/messages.d.ts +74 -0
- package/dist/models/messages.d.ts.map +1 -0
- package/dist/models/pricing.d.ts +69 -0
- package/dist/models/pricing.d.ts.map +1 -0
- package/dist/models/rate-card.d.ts +24 -0
- package/dist/models/rate-card.d.ts.map +1 -0
- package/dist/models/tools.d.ts +24 -0
- package/dist/models/tools.d.ts.map +1 -0
- package/dist/objects/index.js +38 -34
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/index.js +32 -28
- package/dist/objects/query/index.js.map +1 -1
- package/dist/ontology/index.js +5 -5
- package/dist/ontology/internal.js +4 -4
- package/dist/pipelines/index.js +37 -35
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +35 -31
- package/dist/projections/internal.js.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 +3 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +15 -3
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/create.d.ts +4 -4
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +2 -2
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +3 -2
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +2 -2
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts +4 -2
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/security/every.d.ts +1 -4
- package/dist/security/every.d.ts.map +1 -1
- package/dist/security/grants.d.ts +6 -5
- package/dist/security/grants.d.ts.map +1 -1
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/registry.d.ts +1 -1
- package/dist/security/registry.d.ts.map +1 -1
- package/dist/security/types.d.ts +13 -5
- package/dist/security/types.d.ts.map +1 -1
- package/dist/security/validation.d.ts +4 -2
- package/dist/security/validation.d.ts.map +1 -1
- package/dist/storage/action-runs/failure.js +3 -3
- package/dist/storage/action-runs/provider.js +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 +3 -2
- 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 +11 -4
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +18 -15
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +65 -17
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +2 -1
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
- package/dist/storage/ai-cost/codec.d.ts +3 -2
- package/dist/storage/ai-cost/codec.d.ts.map +1 -1
- package/dist/storage/ai-cost/groups.d.ts +51 -0
- package/dist/storage/ai-cost/groups.d.ts.map +1 -0
- package/dist/storage/ai-cost/in-memory.d.ts +11 -1
- package/dist/storage/ai-cost/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-cost/index.d.ts +1 -1
- package/dist/storage/ai-cost/index.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.d.ts +2 -0
- package/dist/storage/ai-cost/provider.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +29 -13
- package/dist/storage/ai-cost/provider.js.map +3 -3
- package/dist/storage/ai-cost/types.d.ts +64 -15
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/validation.d.ts +2 -1
- package/dist/storage/ai-cost/validation.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.d.ts +14 -0
- package/dist/storage/ai-limits/enforcement.d.ts.map +1 -0
- package/dist/storage/ai-limits/enforcement.js +21 -0
- package/dist/storage/ai-limits/enforcement.js.map +9 -0
- package/dist/storage/ai-limits/errors.d.ts +8 -0
- package/dist/storage/ai-limits/errors.d.ts.map +1 -0
- package/dist/storage/ai-limits/in-memory.d.ts +78 -0
- package/dist/storage/ai-limits/in-memory.d.ts.map +1 -0
- package/dist/storage/ai-limits/index.d.ts +7 -0
- package/dist/storage/ai-limits/index.d.ts.map +1 -0
- package/dist/storage/ai-limits/period.d.ts +4 -0
- package/dist/storage/ai-limits/period.d.ts.map +1 -0
- package/dist/storage/ai-limits/provider.d.ts +85 -0
- package/dist/storage/ai-limits/provider.d.ts.map +1 -0
- package/dist/storage/ai-limits/provider.js +62 -0
- package/dist/storage/ai-limits/provider.js.map +9 -0
- package/dist/storage/ai-limits/types.d.ts +175 -0
- package/dist/storage/ai-limits/types.d.ts.map +1 -0
- package/dist/storage/ai-usage/in-memory.d.ts +4 -0
- package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-usage/record.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +6 -2
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/auth/errors.d.ts +1 -1
- package/dist/storage/auth/errors.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/auth-storage.d.ts +4 -1
- package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/device-authorizations.d.ts +29 -0
- package/dist/storage/auth/in-memory/device-authorizations.d.ts.map +1 -0
- package/dist/storage/auth/in-memory/shared.d.ts +3 -1
- package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
- package/dist/storage/auth/index.d.ts +2 -1
- package/dist/storage/auth/index.d.ts.map +1 -1
- package/dist/storage/auth/types.d.ts +66 -0
- package/dist/storage/auth/types.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +2 -2
- package/dist/storage/executions/provider.js +1 -1
- package/dist/storage/executions/run-link.d.ts +7 -2
- package/dist/storage/executions/run-link.d.ts.map +1 -1
- package/dist/storage/executions/validation.d.ts.map +1 -1
- package/dist/storage/in-memory/index.d.ts +4 -0
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +7 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +51 -38
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/ontology/provider.js +3 -3
- package/dist/storage/pipeline-runs/provider.js +2 -2
- package/dist/storage/projection-runs/provider.js +4 -4
- package/dist/storage/sync-runs/provider.js +2 -2
- package/dist/storage/types.d.ts +5 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/webhook-runs/provider.js +2 -2
- package/dist/storage/workflow-runs/provider.d.ts +1 -1
- package/dist/storage/workflow-runs/provider.js +10 -11
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/storage/workflow-runs/types.d.ts +5 -4
- package/dist/storage/workflow-runs/types.d.ts.map +1 -1
- package/dist/syncs/index.js +37 -35
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/agent-execution.d.ts +3 -1
- package/dist/testing/agent-execution.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/ai-limit-storage-contract.d.ts +18 -0
- package/dist/testing/ai-limit-storage-contract.d.ts.map +1 -0
- package/dist/testing/ai-model-call-groups-contract.d.ts +6 -0
- package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -0
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/auth-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3637 -1962
- package/dist/testing/index.js.map +14 -12
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +32 -28
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +2 -2
- package/dist/workflows/agent-step-identity.d.ts +3 -0
- package/dist/workflows/agent-step-identity.d.ts.map +1 -0
- package/dist/workflows/builders.d.ts +2 -3
- package/dist/workflows/builders.d.ts.map +1 -1
- package/dist/workflows/execution.d.ts +1 -1
- package/dist/workflows/execution.d.ts.map +1 -1
- package/dist/workflows/failure.d.ts +1 -1
- package/dist/workflows/failure.d.ts.map +1 -1
- package/dist/workflows/index.d.ts +3 -2
- package/dist/workflows/index.d.ts.map +1 -1
- package/dist/workflows/index.js +53 -45
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/types.d.ts +26 -11
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/validation.d.ts +7 -1
- package/dist/workflows/validation.d.ts.map +1 -1
- package/package.json +19 -4
- package/src/agents/adapters.ts +109 -115
- package/src/agents/authority.ts +214 -32
- package/src/agents/builders.ts +3 -50
- package/src/agents/context-compaction.ts +4 -0
- package/src/agents/dispatch.ts +59 -2
- package/src/agents/errors.ts +5 -2
- package/src/agents/execution.ts +53 -52
- package/src/agents/ids.ts +16 -1
- package/src/agents/index.ts +23 -11
- package/src/agents/message.ts +18 -9
- package/src/agents/model-loop.ts +1023 -0
- package/src/agents/reference.ts +7 -0
- package/src/agents/request.ts +141 -74
- package/src/agents/retired-config.ts +20 -0
- package/src/agents/streams.ts +45 -19
- package/src/agents/tool-catalog.ts +21 -0
- package/src/agents/tool-definition.ts +23 -0
- package/src/agents/types.ts +39 -81
- package/src/agents/validation.ts +34 -180
- package/src/ai-usage/execution.ts +196 -0
- package/src/ai-usage/index.ts +15 -0
- package/src/authorization/decision.ts +27 -10
- package/src/authorization/grant-kinds.ts +62 -15
- package/src/authorization/index.ts +1 -0
- package/src/authorization/resolve.ts +12 -5
- package/src/authorization/types.ts +7 -5
- package/src/bootstrap/discovery.ts +0 -3
- package/src/error-reporting/types.ts +4 -2
- package/src/errors/catalog.ts +8 -0
- package/src/execution/agent.ts +129 -22
- package/src/execution/authorization.ts +48 -18
- package/src/execution/request.ts +4 -1
- package/src/execution/types.ts +1 -1
- package/src/http/api-routes.ts +63 -0
- package/src/index.ts +36 -7
- package/src/json.ts +9 -0
- package/src/models/catalog.ts +137 -0
- package/src/models/definitions.ts +202 -0
- package/src/models/errors.ts +83 -0
- package/src/models/events.ts +198 -0
- package/src/models/index.ts +89 -71
- package/src/models/language-model.ts +143 -0
- package/src/models/messages.ts +78 -0
- package/src/models/pricing.ts +390 -0
- package/src/models/rate-card.ts +101 -0
- package/src/models/tools.ts +29 -0
- package/src/queues/in-memory.ts +5 -0
- package/src/queues/index.ts +11 -0
- package/src/queues/types.ts +20 -3
- package/src/runtime/create.ts +7 -5
- package/src/runtime/definitions.ts +2 -2
- package/src/runtime/host.ts +3 -2
- package/src/runtime/resolve-definitions.ts +13 -36
- package/src/runtime/sixb.ts +6 -8
- package/src/security/every.ts +0 -4
- package/src/security/grants.ts +55 -11
- package/src/security/index.ts +2 -0
- package/src/security/registry.ts +6 -5
- package/src/security/types.ts +15 -4
- package/src/security/validation.ts +30 -9
- package/src/storage/agents/errors.ts +1 -0
- package/src/storage/agents/in-memory.ts +121 -11
- package/src/storage/agents/index.ts +7 -0
- package/src/storage/agents/provider.ts +150 -6
- package/src/storage/agents/types.ts +73 -16
- package/src/storage/ai-cost/analytics.ts +63 -6
- package/src/storage/ai-cost/codec.ts +37 -12
- package/src/storage/ai-cost/groups.ts +248 -0
- package/src/storage/ai-cost/in-memory.ts +42 -0
- package/src/storage/ai-cost/index.ts +6 -0
- package/src/storage/ai-cost/provider.ts +7 -0
- package/src/storage/ai-cost/types.ts +76 -14
- package/src/storage/ai-cost/validation.ts +147 -17
- package/src/storage/ai-limits/enforcement.ts +68 -0
- package/src/storage/ai-limits/errors.ts +23 -0
- package/src/storage/ai-limits/in-memory.ts +671 -0
- package/src/storage/ai-limits/index.ts +31 -0
- package/src/storage/ai-limits/period.ts +11 -0
- package/src/storage/ai-limits/provider.ts +430 -0
- package/src/storage/ai-limits/types.ts +195 -0
- package/src/storage/ai-usage/in-memory.ts +13 -0
- package/src/storage/ai-usage/record.ts +17 -0
- package/src/storage/ai-usage/types.ts +6 -2
- package/src/storage/auth/errors.ts +6 -0
- package/src/storage/auth/in-memory/auth-storage.ts +69 -0
- package/src/storage/auth/in-memory/device-authorizations.ts +145 -0
- package/src/storage/auth/in-memory/shared.ts +7 -0
- package/src/storage/auth/index.ts +7 -0
- package/src/storage/auth/types.ts +73 -0
- package/src/storage/executions/run-link.ts +16 -6
- package/src/storage/executions/validation.ts +36 -6
- package/src/storage/in-memory/index.ts +48 -4
- package/src/storage/index.ts +51 -1
- package/src/storage/types.ts +37 -0
- package/src/storage/workflow-runs/in-memory.ts +3 -3
- package/src/storage/workflow-runs/provider.ts +2 -2
- package/src/storage/workflow-runs/types.ts +6 -3
- package/src/testing/agent-execution.ts +40 -28
- package/src/testing/agent-storage-contract.ts +249 -28
- package/src/testing/ai-cost-storage-contract.ts +96 -8
- package/src/testing/ai-limit-storage-contract.ts +1134 -0
- package/src/testing/ai-model-call-groups-contract.ts +353 -0
- package/src/testing/ai-usage-storage-contract.ts +31 -0
- package/src/testing/auth-storage-contract.ts +85 -0
- package/src/testing/execution-storage-contract.ts +2 -2
- package/src/testing/index.ts +10 -0
- package/src/testing/queues-contract.ts +36 -1
- package/src/workflows/agent-step-identity.ts +4 -0
- package/src/workflows/builders.ts +95 -9
- package/src/workflows/execution.ts +2 -2
- package/src/workflows/failure.ts +2 -2
- package/src/workflows/index.ts +3 -0
- package/src/workflows/types.ts +23 -11
- package/src/workflows/validation.ts +100 -7
- package/dist/chunk-1e8m6yn3.js.map +0 -37
- package/dist/chunk-1g8negke.js.map +0 -11
- package/dist/chunk-6gjqgd3d.js.map +0 -11
- package/dist/chunk-dm72y8wt.js.map +0 -10
- package/dist/chunk-drjqm1aa.js.map +0 -15
- package/dist/chunk-fe5ev6mr.js +0 -55
- package/dist/chunk-fe5ev6mr.js.map +0 -11
- package/dist/chunk-h9kxd41f.js.map +0 -11
- package/dist/chunk-hceck7dq.js +0 -137
- package/dist/chunk-hceck7dq.js.map +0 -10
- package/dist/chunk-n4spznws.js.map +0 -11
- package/dist/chunk-nva1xkjz.js.map +0 -46
- package/dist/chunk-t0jjkep3.js.map +0 -10
- package/dist/chunk-t8t39h7v.js.map +0 -10
- /package/dist/{chunk-zqysyfjt.js.map → chunk-08m3b6w8.js.map} +0 -0
- /package/dist/{chunk-xkthy56g.js.map → chunk-1kamz6j0.js.map} +0 -0
- /package/dist/{chunk-md8k0r54.js.map → chunk-3fqt22c4.js.map} +0 -0
- /package/dist/{chunk-z3zp0bj1.js.map → chunk-407j3msh.js.map} +0 -0
- /package/dist/{chunk-rhrbz7d4.js.map → chunk-4a849fr1.js.map} +0 -0
- /package/dist/{chunk-62c7t4jc.js.map → chunk-4nxeacx7.js.map} +0 -0
- /package/dist/{chunk-cy0n5dms.js.map → chunk-5jcdmjam.js.map} +0 -0
- /package/dist/{chunk-819wnjz8.js.map → chunk-64sr682n.js.map} +0 -0
- /package/dist/{chunk-x2yw73hy.js.map → chunk-7ds9620f.js.map} +0 -0
- /package/dist/{chunk-72q2y8hn.js.map → chunk-8tsf6dmc.js.map} +0 -0
- /package/dist/{chunk-nkbfrt0c.js.map → chunk-9aehf39w.js.map} +0 -0
- /package/dist/{chunk-ezake7g1.js.map → chunk-agsvg9ar.js.map} +0 -0
- /package/dist/{chunk-rnshztfq.js.map → chunk-d63tybny.js.map} +0 -0
- /package/dist/{chunk-vybf6pkp.js.map → chunk-dbc80ad7.js.map} +0 -0
- /package/dist/{chunk-4gz41why.js.map → chunk-dqn23610.js.map} +0 -0
- /package/dist/{chunk-tg5mee00.js.map → chunk-ha58tjtt.js.map} +0 -0
- /package/dist/{chunk-f6erf2vv.js.map → chunk-hdz94br2.js.map} +0 -0
- /package/dist/{chunk-dsrkgtnh.js.map → chunk-jq43kdvk.js.map} +0 -0
- /package/dist/{chunk-wtmzkcht.js.map → chunk-k34z5rvh.js.map} +0 -0
- /package/dist/{chunk-htq0qh7z.js.map → chunk-ka3a2ft3.js.map} +0 -0
- /package/dist/{chunk-znagycq7.js.map → chunk-kt81c11h.js.map} +0 -0
- /package/dist/{chunk-f2rt4vkh.js.map → chunk-n2w475r0.js.map} +0 -0
- /package/dist/{chunk-bhxaq2nn.js.map → chunk-qw9gvjv5.js.map} +0 -0
- /package/dist/{chunk-8gv5z0zm.js.map → chunk-rp1mvzb4.js.map} +0 -0
- /package/dist/{chunk-ghteq96b.js.map → chunk-s5y30bc9.js.map} +0 -0
- /package/dist/{chunk-a31h57d5.js.map → chunk-tn7xcs2n.js.map} +0 -0
- /package/dist/{chunk-e42bc6m3.js.map → chunk-vjjv9mrb.js.map} +0 -0
- /package/dist/{chunk-8b55ygje.js.map → chunk-w3e09qqk.js.map} +0 -0
- /package/dist/{chunk-ckxfnx7f.js.map → chunk-wjgm6jjt.js.map} +0 -0
- /package/dist/{chunk-3j7573mj.js.map → chunk-x0qhkqje.js.map} +0 -0
- /package/dist/{chunk-dysw7nsm.js.map → chunk-xdpwpkha.js.map} +0 -0
package/src/agents/execution.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { principalsEqual, SYSTEM_PRINCIPAL } from "../auth"
|
|
2
2
|
import { assertAuthorized, isAllowed } from "../authorization"
|
|
3
3
|
import type { AuthorizablePrincipal, ExecutionContext } from "../execution"
|
|
4
|
+
import type { ModelCatalog } from "../models"
|
|
4
5
|
import { resolveExecutionCosts } from "../runtime/ai-cost"
|
|
5
6
|
import { resolveExecutionUsage } from "../runtime/ai-usage"
|
|
6
7
|
import type { SixbRuntimeContext } from "../runtime/types"
|
|
7
|
-
import type { SecurityDefinitionCatalog } from "../security"
|
|
8
8
|
import type {
|
|
9
|
-
AgentRunRecord,
|
|
10
9
|
AgentThreadRecord,
|
|
10
|
+
ConversationAgentRunRecord,
|
|
11
11
|
ListAgentRunsInput,
|
|
12
12
|
ListAgentRunsResult,
|
|
13
13
|
ListAgentThreadsInput,
|
|
@@ -23,17 +23,17 @@ import {
|
|
|
23
23
|
requestAgentRun,
|
|
24
24
|
retryAgentRun,
|
|
25
25
|
} from "./request"
|
|
26
|
-
import
|
|
26
|
+
import { assertNoAgentSelector } from "./retired-config"
|
|
27
|
+
import type { AgentDescriptor } from "./types"
|
|
27
28
|
|
|
28
29
|
export type ExecutionAgentRequestInput = Omit<RequestAgentRunInput, "principal">
|
|
29
30
|
export type ListExecutionAgentThreadsInput = Omit<
|
|
30
31
|
ListAgentThreadsInput,
|
|
31
|
-
"projectId" | "
|
|
32
|
+
"projectId" | "ownerPrincipal"
|
|
32
33
|
>
|
|
33
34
|
|
|
34
35
|
export interface CreateExecutionAgentThreadInput {
|
|
35
36
|
readonly id?: string
|
|
36
|
-
readonly agentId: string
|
|
37
37
|
readonly title?: string
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -54,7 +54,7 @@ export interface AgentRunsRuntime {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/** Execution-facing run view with provenance resolved from the immutable execution ledger. */
|
|
57
|
-
export interface AgentRunView extends
|
|
57
|
+
export interface AgentRunView extends ConversationAgentRunRecord {
|
|
58
58
|
readonly requestedBy?: AuthorizablePrincipal
|
|
59
59
|
/** Derived from the model-call ledger; never persisted on the Agent run row. */
|
|
60
60
|
readonly usage?: AiModelCallUsage
|
|
@@ -70,49 +70,51 @@ export interface ExecutionAgentRunResult extends Omit<RequestAgentRunResult, "ru
|
|
|
70
70
|
readonly run: AgentRunView
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export interface
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
export interface AgentRuntime {
|
|
74
|
+
/** Null when no language models are configured or the caller cannot run the Agent. */
|
|
75
|
+
get(): AgentDescriptor | null
|
|
76
76
|
readonly threads: AgentThreadsRuntime
|
|
77
77
|
readonly runs: AgentRunsRuntime
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
export function
|
|
80
|
+
export function createAgentRuntime(
|
|
81
81
|
runtime: SixbRuntimeContext,
|
|
82
82
|
execution: ExecutionContext,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
): AgentsRuntime {
|
|
83
|
+
models?: ModelCatalog
|
|
84
|
+
): AgentRuntime {
|
|
86
85
|
const principal = runtime.authorization?.principal ?? SYSTEM_PRINCIPAL
|
|
87
|
-
const allowed = (
|
|
88
|
-
isAllowed(runtime.authorization, { kind: "agent.run", agentId })
|
|
86
|
+
const allowed = () => isAllowed(runtime.authorization, { kind: "agent.run" })
|
|
89
87
|
|
|
90
|
-
const
|
|
88
|
+
const getVisibleThreadRecord = async (threadId: string): Promise<AgentThreadRecord | null> => {
|
|
91
89
|
const thread =
|
|
92
90
|
(await runtime.storage.agents?.threads.getById({
|
|
93
91
|
projectId: runtime.projectId,
|
|
94
92
|
id: threadId,
|
|
95
93
|
})) ?? null
|
|
96
|
-
if (!thread || !allowed(
|
|
94
|
+
if (!thread || !allowed()) return null
|
|
97
95
|
return runtime.authorization && !principalsEqual(principal, thread.ownerPrincipal)
|
|
98
96
|
? null
|
|
99
97
|
: thread
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
const getAgent = (
|
|
103
|
-
const
|
|
104
|
-
|
|
100
|
+
const getAgent = (): AgentDescriptor | null => {
|
|
101
|
+
const model = models?.language.default
|
|
102
|
+
if (!model || !allowed()) return null
|
|
103
|
+
return {
|
|
104
|
+
name: "Sixb",
|
|
105
|
+
model: { provider: model.provider, modelId: model.modelId },
|
|
106
|
+
}
|
|
105
107
|
}
|
|
106
108
|
|
|
107
|
-
const getVisibleRunRecord = async (runId: string): Promise<
|
|
109
|
+
const getVisibleRunRecord = async (runId: string): Promise<ConversationAgentRunRecord | null> => {
|
|
108
110
|
const run =
|
|
109
111
|
(await runtime.storage.agents?.runs.getById({
|
|
110
112
|
projectId: runtime.projectId,
|
|
111
113
|
id: runId,
|
|
112
114
|
})) ?? null
|
|
113
|
-
if (!run) return null
|
|
114
|
-
const thread = await
|
|
115
|
-
return thread
|
|
115
|
+
if (!run || run.kind !== "conversation") return null
|
|
116
|
+
const thread = await getVisibleThreadRecord(run.threadId)
|
|
117
|
+
return thread ? run : null
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
const getRun = async (runId: string): Promise<AgentRunView | null> => {
|
|
@@ -121,13 +123,13 @@ export function createAgentsRuntime(
|
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
return {
|
|
124
|
-
|
|
125
|
-
getById: getAgent,
|
|
126
|
+
get: getAgent,
|
|
126
127
|
threads: {
|
|
127
128
|
create: async (input) => {
|
|
128
|
-
|
|
129
|
+
assertNoAgentSelector(input)
|
|
130
|
+
const agent = getAgent()
|
|
129
131
|
if (!agent) {
|
|
130
|
-
throw new AgentRequestError("agent_not_found",
|
|
132
|
+
throw new AgentRequestError("agent_not_found", "[Sixb] The project Agent is unavailable.")
|
|
131
133
|
}
|
|
132
134
|
const storage = runtime.storage.agents
|
|
133
135
|
if (!storage) {
|
|
@@ -139,39 +141,37 @@ export function createAgentsRuntime(
|
|
|
139
141
|
return storage.threads.create({
|
|
140
142
|
id: input.id ?? createAgentThreadId(),
|
|
141
143
|
projectId: runtime.projectId,
|
|
142
|
-
agentId: agent.id,
|
|
143
144
|
ownerPrincipal: principal,
|
|
144
145
|
...(input.title === undefined ? {} : { title: input.title }),
|
|
145
146
|
})
|
|
146
147
|
},
|
|
147
|
-
getById:
|
|
148
|
-
list: (input = {}) => {
|
|
148
|
+
getById: getVisibleThreadRecord,
|
|
149
|
+
list: async (input = {}) => {
|
|
150
|
+
assertNoAgentSelector(input)
|
|
149
151
|
const storage = runtime.storage.agents
|
|
150
|
-
if (!storage) return
|
|
152
|
+
if (!storage || !allowed()) return { threads: [], hasMore: false, total: 0 }
|
|
151
153
|
return storage.threads.list({
|
|
152
|
-
projectId: runtime.projectId,
|
|
153
154
|
...input,
|
|
154
|
-
|
|
155
|
-
? [...runtime.authorization.grants["run:agent"]]
|
|
156
|
-
: undefined,
|
|
155
|
+
projectId: runtime.projectId,
|
|
157
156
|
ownerPrincipal: runtime.authorization ? principal : undefined,
|
|
158
157
|
})
|
|
159
158
|
},
|
|
160
159
|
},
|
|
161
160
|
runs: {
|
|
162
161
|
request: async (input) => {
|
|
163
|
-
|
|
162
|
+
assertNoAgentSelector(input)
|
|
163
|
+
const agent = getAgent()
|
|
164
164
|
if (!agent) {
|
|
165
|
-
throw new AgentRequestError("agent_not_found",
|
|
165
|
+
throw new AgentRequestError("agent_not_found", "[Sixb] The project Agent is unavailable.")
|
|
166
166
|
}
|
|
167
|
-
assertAuthorized(runtime, { kind: "agent.run"
|
|
168
|
-
if (input.threadId && !(await
|
|
167
|
+
assertAuthorized(runtime, { kind: "agent.run" })
|
|
168
|
+
if (input.threadId && !(await getVisibleThreadRecord(input.threadId))) {
|
|
169
169
|
throw new AgentRequestError(
|
|
170
170
|
"thread_not_found",
|
|
171
171
|
`[Sixb] Agent thread '${input.threadId}' not found.`
|
|
172
172
|
)
|
|
173
173
|
}
|
|
174
|
-
const result = await requestAgentRun(runtime, execution,
|
|
174
|
+
const result = await requestAgentRun(runtime, execution, models?.language, {
|
|
175
175
|
...input,
|
|
176
176
|
principal,
|
|
177
177
|
})
|
|
@@ -182,28 +182,29 @@ export function createAgentsRuntime(
|
|
|
182
182
|
if (!failedRun) {
|
|
183
183
|
throw new AgentRequestError("run_not_found", `[Sixb] Agent run '${runId}' was not found.`)
|
|
184
184
|
}
|
|
185
|
-
const agent = getAgent(
|
|
185
|
+
const agent = getAgent()
|
|
186
186
|
if (!agent) {
|
|
187
|
-
throw new AgentRequestError(
|
|
188
|
-
"agent_not_found",
|
|
189
|
-
`[Sixb] Unknown agent '${failedRun.agentId}'.`
|
|
190
|
-
)
|
|
187
|
+
throw new AgentRequestError("agent_not_found", "[Sixb] The project Agent is unavailable.")
|
|
191
188
|
}
|
|
192
|
-
const result = await retryAgentRun(runtime, execution,
|
|
189
|
+
const result = await retryAgentRun(runtime, execution, models?.language, failedRun)
|
|
193
190
|
return { ...result, run: await attachRunView(runtime, result.run) }
|
|
194
191
|
},
|
|
195
192
|
getById: getRun,
|
|
196
193
|
listForThread: async (threadId, input = {}) => {
|
|
194
|
+
assertNoAgentSelector(input)
|
|
197
195
|
const storage = runtime.storage.agents
|
|
198
|
-
if (!storage || !(await
|
|
196
|
+
if (!storage || !(await getVisibleThreadRecord(threadId))) return null
|
|
199
197
|
const result = await storage.runs.list({
|
|
200
|
-
projectId: runtime.projectId,
|
|
201
198
|
...input,
|
|
199
|
+
projectId: runtime.projectId,
|
|
202
200
|
threadId,
|
|
203
201
|
})
|
|
204
202
|
return {
|
|
205
203
|
...result,
|
|
206
|
-
runs: await attachRunViews(
|
|
204
|
+
runs: await attachRunViews(
|
|
205
|
+
runtime,
|
|
206
|
+
result.runs.filter((run) => run.kind === "conversation")
|
|
207
|
+
),
|
|
207
208
|
}
|
|
208
209
|
},
|
|
209
210
|
},
|
|
@@ -212,7 +213,7 @@ export function createAgentsRuntime(
|
|
|
212
213
|
|
|
213
214
|
async function attachRunView(
|
|
214
215
|
runtime: SixbRuntimeContext,
|
|
215
|
-
run:
|
|
216
|
+
run: ConversationAgentRunRecord
|
|
216
217
|
): Promise<AgentRunView> {
|
|
217
218
|
const [view] = await attachRunViews(runtime, [run])
|
|
218
219
|
if (!view) throw new Error(`[Sixb] Could not build Agent run '${run.id}' view.`)
|
|
@@ -221,7 +222,7 @@ async function attachRunView(
|
|
|
221
222
|
|
|
222
223
|
async function attachRunViews(
|
|
223
224
|
runtime: SixbRuntimeContext,
|
|
224
|
-
runs: readonly
|
|
225
|
+
runs: readonly ConversationAgentRunRecord[]
|
|
225
226
|
): Promise<readonly AgentRunView[]> {
|
|
226
227
|
const executionIds = runs.map((run) => run.executionId)
|
|
227
228
|
const [executions, usages, costs] = await Promise.all([
|
package/src/agents/ids.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto"
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Id helpers for agent persistence. Threads, the run id, and the user (trigger) message are minted
|
|
@@ -14,6 +14,21 @@ export function createAgentRunId(): string {
|
|
|
14
14
|
return `agt_run_${randomUUID()}`
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/** One stable child identity per parent-selected spawn key. */
|
|
18
|
+
export function createSubagentRunId(parentRunId: string, spawnKey: string): string {
|
|
19
|
+
const digest = createHash("sha256")
|
|
20
|
+
.update(parentRunId)
|
|
21
|
+
.update("\0")
|
|
22
|
+
.update(spawnKey)
|
|
23
|
+
.digest("hex")
|
|
24
|
+
return `agt_run_child_${digest}`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Stable execution identity paired with a deterministic child run. */
|
|
28
|
+
export function createSubagentExecutionId(runId: string): string {
|
|
29
|
+
return `exec_${runId}`
|
|
30
|
+
}
|
|
31
|
+
|
|
17
32
|
export function createAgentMessageId(): string {
|
|
18
33
|
return `agt_msg_${randomUUID()}`
|
|
19
34
|
}
|
package/src/agents/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type {
|
|
|
18
18
|
ToModelMessagesOptions,
|
|
19
19
|
} from "./adapters"
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
fromUiMessage,
|
|
22
22
|
omitUndefinedObjectProperties,
|
|
23
23
|
toModelMessages,
|
|
24
24
|
toUiMessage,
|
|
@@ -31,13 +31,14 @@ export {
|
|
|
31
31
|
isAllowedAgentApiRequest,
|
|
32
32
|
isValidAgentApiGatewayCapability,
|
|
33
33
|
} from "./api-gateway"
|
|
34
|
-
export type { AgentExecutionIdentity } from "./authority"
|
|
34
|
+
export type { AgentExecutionAuthorization, AgentExecutionIdentity } from "./authority"
|
|
35
35
|
export {
|
|
36
36
|
agentServiceAccountId,
|
|
37
|
-
|
|
37
|
+
ensureManagedAgentExecutionIdentity,
|
|
38
38
|
resolveAgentExecutionAuthorization,
|
|
39
|
+
resolveInheritedAgentExecutionAuthorization,
|
|
39
40
|
} from "./authority"
|
|
40
|
-
export {
|
|
41
|
+
export { defineAgentTool } from "./builders"
|
|
41
42
|
export type {
|
|
42
43
|
AgentContextEntryInput,
|
|
43
44
|
AgentContextInput,
|
|
@@ -78,6 +79,8 @@ export type {
|
|
|
78
79
|
export {
|
|
79
80
|
agentRunQueueJobId,
|
|
80
81
|
dispatchQueuedAgentRuns,
|
|
82
|
+
dispatchQueuedSubagentRuns,
|
|
83
|
+
subagentRunQueueJobId,
|
|
81
84
|
workflowAgentNodeQueueJobId,
|
|
82
85
|
} from "./dispatch"
|
|
83
86
|
export {
|
|
@@ -94,6 +97,8 @@ export {
|
|
|
94
97
|
createAgentRunExecutionToken,
|
|
95
98
|
createAgentRunId,
|
|
96
99
|
createAgentThreadId,
|
|
100
|
+
createSubagentExecutionId,
|
|
101
|
+
createSubagentRunId,
|
|
97
102
|
} from "./ids"
|
|
98
103
|
export {
|
|
99
104
|
AGENT_MESSAGE_CONTENT_VERSION,
|
|
@@ -102,12 +107,21 @@ export {
|
|
|
102
107
|
type AgentMessagePart,
|
|
103
108
|
type AgentMessagePartType,
|
|
104
109
|
type AgentMessageRole,
|
|
110
|
+
type AgentProviderStatePart,
|
|
105
111
|
type AgentReasoningPart,
|
|
106
112
|
type AgentStepStartPart,
|
|
107
113
|
type AgentTextPart,
|
|
108
114
|
type AgentToolCallPart,
|
|
109
115
|
type AgentToolCallState,
|
|
110
116
|
} from "./message"
|
|
117
|
+
export type {
|
|
118
|
+
ModelLoopResult,
|
|
119
|
+
PrepareModelStepInput,
|
|
120
|
+
PrepareModelStepResult,
|
|
121
|
+
RunModelLoopInput,
|
|
122
|
+
} from "./model-loop"
|
|
123
|
+
export { runModelLoop } from "./model-loop"
|
|
124
|
+
export { agent } from "./reference"
|
|
111
125
|
export {
|
|
112
126
|
type RequestAgentRunInput,
|
|
113
127
|
type RequestAgentRunResult,
|
|
@@ -143,12 +157,13 @@ export type {
|
|
|
143
157
|
ProjectAgentThreadModelContextInput,
|
|
144
158
|
} from "./thread-context-projection"
|
|
145
159
|
export { projectAgentThreadModelContext } from "./thread-context-projection"
|
|
160
|
+
export type { AgentToolCatalog } from "./tool-catalog"
|
|
146
161
|
export { isAgentToolResult } from "./tool-result"
|
|
147
162
|
export type {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
AgentLoopConfig,
|
|
163
|
+
AgentDescriptor,
|
|
164
|
+
AgentReasoning,
|
|
151
165
|
AgentReasoningLevel,
|
|
166
|
+
AgentReference,
|
|
152
167
|
AgentToolArtifact,
|
|
153
168
|
AgentToolArtifactPutInput,
|
|
154
169
|
AgentToolArtifacts,
|
|
@@ -165,16 +180,13 @@ export type {
|
|
|
165
180
|
AgentToolRunContext,
|
|
166
181
|
AgentToolRunInfo,
|
|
167
182
|
AgentToolTextContent,
|
|
168
|
-
|
|
183
|
+
AgentUsageReference,
|
|
169
184
|
InferAgentToolInput,
|
|
170
185
|
InferAgentToolInputSchema,
|
|
171
186
|
} from "./types"
|
|
172
187
|
export { AGENT_REASONING_LEVELS } from "./types"
|
|
173
188
|
export {
|
|
174
189
|
AGENT_RESERVED_TOOL_NAMES,
|
|
175
|
-
isAgentDefinition,
|
|
176
190
|
isAgentToolDefinition,
|
|
177
|
-
validateAgentGroupReferences,
|
|
178
|
-
validateAgentToolsAtStartup,
|
|
179
191
|
validateAndNormalizeAgentToolInput,
|
|
180
192
|
} from "./validation"
|
package/src/agents/message.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FileRef } from "../blob-storage"
|
|
2
2
|
import type { JsonValue } from "../json"
|
|
3
|
+
import type { ProviderData } from "../models"
|
|
3
4
|
import type { AgentContextPart } from "./context"
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -8,12 +9,12 @@ import type { AgentContextPart } from "./context"
|
|
|
8
9
|
* self-describing wrapper: the storage row owns the message's identity, and `contentVersion` (a
|
|
9
10
|
* column) versions the parts shape so it can be migrated.
|
|
10
11
|
*
|
|
11
|
-
* The part union is intentionally focused on what
|
|
12
|
+
* The part union is intentionally focused on what agent runs actually produce (text, reasoning, step
|
|
12
13
|
* boundaries, tool calls). It is extensible: adding a part kind later is non-breaking. The adapter
|
|
13
|
-
* `
|
|
14
|
+
* `fromUiMessage` is total — it throws on any part it cannot model rather than dropping it silently,
|
|
14
15
|
* which both prevents data loss and signals exactly when the union must grow.
|
|
15
16
|
*/
|
|
16
|
-
export const AGENT_MESSAGE_CONTENT_VERSION =
|
|
17
|
+
export const AGENT_MESSAGE_CONTENT_VERSION = 2 as const
|
|
17
18
|
|
|
18
19
|
export type AgentMessageRole = "system" | "user" | "assistant"
|
|
19
20
|
|
|
@@ -22,7 +23,7 @@ export interface AgentTextPart {
|
|
|
22
23
|
readonly type: "text"
|
|
23
24
|
readonly text: string
|
|
24
25
|
/** Provider passthrough (kept because some providers require it on the next turn). */
|
|
25
|
-
readonly providerMetadata?:
|
|
26
|
+
readonly providerMetadata?: ProviderData
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -32,7 +33,7 @@ export interface AgentTextPart {
|
|
|
32
33
|
export interface AgentReasoningPart {
|
|
33
34
|
readonly type: "reasoning"
|
|
34
35
|
readonly text: string
|
|
35
|
-
readonly providerMetadata?:
|
|
36
|
+
readonly providerMetadata?: ProviderData
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/** A step boundary between assistant loop iterations. */
|
|
@@ -45,19 +46,26 @@ export interface AgentFilePart {
|
|
|
45
46
|
readonly type: "file"
|
|
46
47
|
readonly fileRef: FileRef
|
|
47
48
|
/** Provider passthrough for future model-specific file handling. */
|
|
48
|
-
readonly providerMetadata?:
|
|
49
|
+
readonly providerMetadata?: ProviderData
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
interface AgentToolCallBase {
|
|
52
53
|
readonly type: "tool-call"
|
|
53
54
|
readonly toolCallId: string
|
|
54
55
|
readonly toolName: string
|
|
55
|
-
/** `true` when reconstructed from
|
|
56
|
+
/** `true` when reconstructed from a dynamic tool part (vs a static `tool-${name}` part). */
|
|
56
57
|
readonly dynamic?: boolean
|
|
57
|
-
/** `true` when the provider executed the tool inline (steers model projection).
|
|
58
|
+
/** `true` when the provider executed the tool inline (steers model projection). */
|
|
58
59
|
readonly providerExecuted?: boolean
|
|
59
60
|
readonly input: JsonValue
|
|
60
|
-
readonly providerMetadata?:
|
|
61
|
+
readonly providerMetadata?: ProviderData
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Ordered, hidden provider state required to replay a model response losslessly. */
|
|
65
|
+
export interface AgentProviderStatePart {
|
|
66
|
+
readonly type: "provider-state"
|
|
67
|
+
readonly providerId: string
|
|
68
|
+
readonly data: JsonValue
|
|
61
69
|
}
|
|
62
70
|
|
|
63
71
|
/**
|
|
@@ -78,6 +86,7 @@ export type AgentMessagePart =
|
|
|
78
86
|
| AgentFilePart
|
|
79
87
|
| AgentContextPart
|
|
80
88
|
| AgentToolCallPart
|
|
89
|
+
| AgentProviderStatePart
|
|
81
90
|
|
|
82
91
|
export type AgentMessagePartType = AgentMessagePart["type"]
|
|
83
92
|
export type AgentToolCallState = AgentToolCallPart["state"]
|