@sixb/core 0.1.2 → 0.1.4
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 +19 -17
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/worker.js +4 -4
- package/dist/actions/worker.js.map +1 -1
- package/dist/agents/adapters.d.ts +11 -1
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/context-compaction.d.ts +40 -0
- package/dist/agents/context-compaction.d.ts.map +1 -0
- package/dist/agents/context.js +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 +3 -0
- 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 +10 -6
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +51 -35
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/streams.d.ts +17 -1
- package/dist/agents/streams.d.ts.map +1 -1
- package/dist/agents/streams.js +5 -3
- package/dist/agents/streams.js.map +1 -1
- package/dist/agents/thread-context-projection.d.ts +19 -0
- package/dist/agents/thread-context-projection.d.ts.map +1 -0
- package/dist/agents/tool-definition.d.ts.map +1 -1
- package/dist/agents/tool-result.d.ts +6 -0
- package/dist/agents/tool-result.d.ts.map +1 -0
- package/dist/agents/types.d.ts +46 -1
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +2 -2
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/auth/index.js +11 -5
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/index.js +6 -2
- package/dist/authorization/index.js.map +1 -1
- package/dist/bootstrap/index.js +33 -31
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/{chunk-ys1nse2v.js → chunk-1wk20wn3.js} +438 -246
- package/dist/{chunk-ys1nse2v.js.map → chunk-1wk20wn3.js.map} +11 -11
- package/dist/{chunk-sa4340y1.js → chunk-1yz3x65y.js} +7 -7
- package/dist/{chunk-gqdd7508.js → chunk-4rh2m6zg.js} +1 -1
- package/dist/{chunk-fmx1sz2h.js → chunk-72q2y8hn.js} +3 -3
- package/dist/{chunk-fmx1sz2h.js.map → chunk-72q2y8hn.js.map} +4 -4
- package/dist/{chunk-nnyp53zt.js → chunk-7gw7mepb.js} +259 -9
- package/dist/chunk-7gw7mepb.js.map +14 -0
- package/dist/{chunk-nten49ta.js → chunk-819wnjz8.js} +11 -5
- package/dist/chunk-819wnjz8.js.map +12 -0
- package/dist/chunk-96swp2wd.js +47 -0
- package/dist/chunk-96swp2wd.js.map +10 -0
- package/dist/{chunk-4x43bkbp.js → chunk-a09jx26t.js} +1 -1
- package/dist/{chunk-st4xgxey.js → chunk-afjpa2hs.js} +205 -48
- package/dist/chunk-afjpa2hs.js.map +45 -0
- package/dist/{chunk-0mbx247x.js → chunk-c43qr6s0.js} +427 -99
- package/dist/chunk-c43qr6s0.js.map +46 -0
- package/dist/{chunk-zg9yryhz.js → chunk-cbkm2vam.js} +3 -3
- package/dist/{chunk-57zpb99z.js → chunk-dm72y8wt.js} +26 -3
- package/dist/chunk-dm72y8wt.js.map +10 -0
- package/dist/chunk-drjqm1aa.js +913 -0
- package/dist/chunk-drjqm1aa.js.map +15 -0
- package/dist/chunk-dysw7nsm.js.map +1 -1
- package/dist/{chunk-8ryen3p3.js → chunk-f6erf2vv.js} +1 -1
- package/dist/{chunk-34bqh420.js → chunk-f83ka50g.js} +188 -44
- package/dist/chunk-f83ka50g.js.map +23 -0
- package/dist/{chunk-bct7hmfc.js → chunk-g13869yf.js} +3 -3
- package/dist/{chunk-0k4avqr2.js → chunk-hbeh8j9w.js} +2 -2
- package/dist/{chunk-qvybnnpe.js → chunk-nzw7sm3b.js} +2 -2
- package/dist/{chunk-k9pts48t.js → chunk-pn8n8sba.js} +16 -15
- package/dist/{chunk-k9pts48t.js.map → chunk-pn8n8sba.js.map} +3 -3
- package/dist/{chunk-63te770v.js → chunk-qewtks41.js} +8 -8
- package/dist/{chunk-63te770v.js.map → chunk-qewtks41.js.map} +2 -2
- package/dist/{chunk-85j5ybfj.js → chunk-rdeagz6b.js} +2 -2
- package/dist/{chunk-85j5ybfj.js.map → chunk-rdeagz6b.js.map} +3 -3
- package/dist/chunk-rhrbz7d4.js +36 -0
- package/dist/chunk-rhrbz7d4.js.map +10 -0
- package/dist/{chunk-bh6k3nc6.js → chunk-rs1wbvy6.js} +1 -1
- package/dist/{chunk-88ppkr54.js → chunk-rte5sm3z.js} +26 -2
- package/dist/chunk-rte5sm3z.js.map +12 -0
- package/dist/{chunk-n8herkry.js → chunk-s31d0qmq.js} +57 -20
- package/dist/{chunk-n8herkry.js.map → chunk-s31d0qmq.js.map} +8 -7
- package/dist/{chunk-7pc8b818.js → chunk-sxwk41qa.js} +1 -1
- package/dist/{chunk-663csy96.js → chunk-t0jjkep3.js} +2 -1
- package/dist/chunk-t0jjkep3.js.map +10 -0
- package/dist/{chunk-c6qd89g5.js → chunk-tek1qwgm.js} +6 -6
- package/dist/{chunk-c6qd89g5.js.map → chunk-tek1qwgm.js.map} +1 -1
- package/dist/{chunk-jaj13078.js → chunk-tkdscva6.js} +3 -33
- package/dist/{chunk-jaj13078.js.map → chunk-tkdscva6.js.map} +3 -4
- package/dist/{chunk-5egfka8j.js → chunk-tycbzedm.js} +2 -2
- package/dist/{chunk-g9t3kdtx.js → chunk-x2yw73hy.js} +1 -1
- package/dist/{chunk-57r1cpxx.js → chunk-xc7hq65b.js} +3 -2
- package/dist/{chunk-57r1cpxx.js.map → chunk-xc7hq65b.js.map} +3 -3
- package/dist/chunk-xdf9yswn.js +133 -0
- package/dist/chunk-xdf9yswn.js.map +11 -0
- package/dist/execution/agent.js +29 -27
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/primitive.js +29 -27
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.js +30 -28
- package/dist/execution/request.js.map +2 -2
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +60 -58
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/types.d.ts +2 -1
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/materialization/model.d.ts +4 -0
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/edits/apply.d.ts +6 -1
- package/dist/materializer/edits/apply.d.ts.map +1 -1
- package/dist/materializer/edits/working-state.d.ts +2 -0
- package/dist/materializer/edits/working-state.d.ts.map +1 -1
- package/dist/materializer/effective/resolve.d.ts +3 -1
- package/dist/materializer/effective/resolve.d.ts.map +1 -1
- package/dist/materializer/execution/work-records.d.ts.map +1 -1
- package/dist/materializer/index.js +19 -17
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
- package/dist/materializer/shared/normalize.d.ts.map +1 -1
- package/dist/models/index.d.ts +40 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/objects/execution.d.ts +6 -1
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +21 -19
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/link/endpoints.d.ts.map +1 -1
- package/dist/objects/query/executor.d.ts +1 -0
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/explain.d.ts +1 -0
- package/dist/objects/query/explain.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +3 -1
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +30 -5
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/ir.d.ts +14 -1
- package/dist/objects/query/ir.d.ts.map +1 -1
- package/dist/objects/query/links.d.ts +25 -0
- package/dist/objects/query/links.d.ts.map +1 -0
- package/dist/objects/query/normalize.d.ts.map +1 -1
- package/dist/objects/query/planner.d.ts.map +1 -1
- package/dist/objects/query/validate.d.ts +1 -0
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/pipelines/index.js +16 -15
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/builders.d.ts +52 -10
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/index.d.ts +2 -1
- package/dist/projections/index.d.ts.map +1 -1
- package/dist/projections/internal.d.ts +4 -1
- package/dist/projections/internal.d.ts.map +1 -1
- package/dist/projections/internal.js +22 -17
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/run-dispatch.d.ts +1 -0
- package/dist/projections/run-dispatch.d.ts.map +1 -1
- package/dist/projections/timestamp.d.ts +3 -0
- package/dist/projections/timestamp.d.ts.map +1 -0
- package/dist/projections/types.d.ts +21 -9
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/projections/validation.d.ts +6 -5
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/query.d.ts +2 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +2 -2
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/types.d.ts +7 -0
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/ai-cost.d.ts +8 -0
- package/dist/runtime/ai-cost.d.ts.map +1 -0
- package/dist/runtime/create.d.ts +3 -0
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +3 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +2 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +2 -0
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/storage/agents/in-memory.d.ts +22 -4
- 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 +31 -0
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +22 -7
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +75 -4
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/analytics.d.ts +61 -0
- package/dist/storage/ai-cost/analytics.d.ts.map +1 -0
- package/dist/storage/ai-cost/codec.d.ts +14 -0
- package/dist/storage/ai-cost/codec.d.ts.map +1 -0
- package/dist/storage/ai-cost/errors.d.ts +7 -0
- package/dist/storage/ai-cost/errors.d.ts.map +1 -0
- package/dist/storage/ai-cost/in-memory.d.ts +32 -0
- package/dist/storage/ai-cost/in-memory.d.ts.map +1 -0
- package/dist/storage/ai-cost/index.d.ts +6 -0
- package/dist/storage/ai-cost/index.d.ts.map +1 -0
- package/dist/storage/ai-cost/provider.d.ts +7 -0
- package/dist/storage/ai-cost/provider.d.ts.map +1 -0
- package/dist/storage/ai-cost/provider.js +132 -0
- package/dist/storage/ai-cost/provider.js.map +10 -0
- package/dist/storage/ai-cost/types.d.ts +154 -0
- package/dist/storage/ai-cost/types.d.ts.map +1 -0
- package/dist/storage/ai-cost/validation.d.ts +7 -0
- package/dist/storage/ai-cost/validation.d.ts.map +1 -0
- package/dist/storage/ai-usage/in-memory.d.ts +2 -1
- package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-usage/index.d.ts +1 -1
- package/dist/storage/ai-usage/index.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +6 -0
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/in-memory/index.d.ts +5 -0
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +6 -3
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +33 -21
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/objects/in-memory.d.ts +6 -3
- package/dist/storage/objects/in-memory.d.ts.map +1 -1
- package/dist/storage/objects/index.d.ts +3 -1
- package/dist/storage/objects/index.d.ts.map +1 -1
- package/dist/storage/objects/keys.d.ts +16 -0
- package/dist/storage/objects/keys.d.ts.map +1 -0
- package/dist/storage/objects/types.d.ts +33 -6
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/materializations.d.ts +3 -0
- package/dist/storage/ontology/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +1 -1
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +1 -1
- package/dist/storage/types.d.ts +2 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +10 -5
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +16 -15
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts +3 -2
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-cost-storage-contract.d.ts +12 -0
- package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -0
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/effective-storage-contract.d.ts +1 -1
- package/dist/testing/effective-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 +2525 -1480
- package/dist/testing/index.js.map +10 -9
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- package/dist/testing/object-query-contract.d.ts +1 -1
- package/dist/testing/object-query-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +14 -13
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +12 -2
- package/dist/workers/index.js.map +3 -3
- package/dist/workers/queue-worker.d.ts +2 -0
- package/dist/workers/queue-worker.d.ts.map +1 -1
- package/dist/workflows/execution.d.ts +3 -0
- package/dist/workflows/execution.d.ts.map +1 -1
- package/dist/workflows/index.js +30 -28
- package/dist/workflows/index.js.map +1 -1
- package/package.json +7 -1
- package/src/agents/adapters.ts +64 -23
- package/src/agents/builders.ts +3 -3
- package/src/agents/context-compaction.ts +261 -0
- package/src/agents/errors.ts +2 -2
- package/src/agents/execution.ts +14 -2
- package/src/agents/ids.ts +5 -0
- package/src/agents/index.ts +32 -6
- package/src/agents/request.ts +5 -0
- package/src/agents/streams.ts +56 -0
- package/src/agents/thread-context-projection.ts +93 -0
- package/src/agents/tool-definition.ts +17 -2
- package/src/agents/tool-result.ts +61 -0
- package/src/agents/types.ts +57 -1
- package/src/agents/validation.ts +36 -6
- package/src/http/api-routes.ts +7 -7
- package/src/index.ts +27 -0
- package/src/lake-storage/types.ts +2 -1
- package/src/materialization/model.ts +4 -0
- package/src/materializer/edits/apply.ts +55 -2
- package/src/materializer/edits/operations.ts +8 -1
- package/src/materializer/edits/working-state.ts +7 -0
- package/src/materializer/effective/resolve.ts +78 -9
- package/src/materializer/execution/work-records.ts +3 -1
- package/src/materializer/projections/entry-validator.ts +23 -1
- package/src/materializer/projections/replacement-plan.ts +2 -0
- package/src/materializer/shared/normalize.ts +16 -0
- package/src/materializer/telemetry/append.ts +33 -16
- package/src/models/index.ts +71 -0
- package/src/objects/execution.ts +20 -0
- package/src/objects/link/endpoints.ts +2 -1
- package/src/objects/query/executor.ts +42 -11
- package/src/objects/query/explain.ts +11 -0
- package/src/objects/query/index.ts +6 -0
- package/src/objects/query/ir.ts +16 -0
- package/src/objects/query/links.ts +308 -0
- package/src/objects/query/normalize.ts +40 -1
- package/src/objects/query/planner.ts +5 -0
- package/src/objects/query/validate.ts +58 -2
- package/src/projections/builders.ts +320 -50
- package/src/projections/index.ts +7 -0
- package/src/projections/internal.ts +4 -1
- package/src/projections/ownership.ts +5 -5
- package/src/projections/registry.ts +16 -3
- package/src/projections/revision.ts +35 -5
- package/src/projections/run-dispatch.ts +10 -1
- package/src/projections/timestamp.ts +66 -0
- package/src/projections/types.ts +20 -9
- package/src/projections/validation.ts +85 -19
- package/src/query.ts +2 -0
- package/src/queues/index.ts +1 -0
- package/src/queues/types.ts +8 -0
- package/src/runtime/ai-cost.ts +15 -0
- package/src/runtime/create.ts +4 -0
- package/src/runtime/definitions.ts +3 -0
- package/src/runtime/host.ts +2 -0
- package/src/runtime/resolve-definitions.ts +28 -0
- package/src/storage/agents/in-memory.ts +186 -4
- package/src/storage/agents/index.ts +5 -0
- package/src/storage/agents/provider.ts +225 -0
- package/src/storage/agents/types.ts +82 -3
- package/src/storage/ai-cost/analytics.ts +602 -0
- package/src/storage/ai-cost/codec.ts +136 -0
- package/src/storage/ai-cost/errors.ts +12 -0
- package/src/storage/ai-cost/in-memory.ts +164 -0
- package/src/storage/ai-cost/index.ts +35 -0
- package/src/storage/ai-cost/provider.ts +20 -0
- package/src/storage/ai-cost/types.ts +193 -0
- package/src/storage/ai-cost/validation.ts +337 -0
- package/src/storage/ai-usage/in-memory.ts +23 -0
- package/src/storage/ai-usage/index.ts +1 -0
- package/src/storage/ai-usage/types.ts +10 -0
- package/src/storage/in-memory/index.ts +50 -0
- package/src/storage/index.ts +48 -0
- package/src/storage/objects/in-memory.ts +103 -16
- package/src/storage/objects/index.ts +9 -0
- package/src/storage/objects/keys.ts +36 -0
- package/src/storage/objects/types.ts +34 -6
- package/src/storage/ontology/in-memory/materializations.ts +1 -0
- package/src/storage/ontology/materializations.ts +3 -0
- package/src/storage/ontology/provider-header-validation.ts +2 -2
- package/src/storage/operation-scope.ts +1 -0
- package/src/storage/types.ts +2 -0
- package/src/testing/agent-storage-contract.ts +353 -2
- package/src/testing/ai-cost-storage-contract.ts +320 -0
- package/src/testing/ai-usage-storage-contract.ts +35 -0
- package/src/testing/effective-storage-contract.ts +194 -4
- package/src/testing/index.ts +5 -0
- package/src/testing/lake-storage-contract.ts +56 -0
- package/src/testing/materializer-storage-contract.ts +120 -2
- package/src/testing/object-query-contract.ts +208 -1
- package/src/workers/queue-worker.ts +14 -1
- package/src/workflows/execution.ts +31 -10
- package/dist/agents/prompt.d.ts +0 -15
- package/dist/agents/prompt.d.ts.map +0 -1
- package/dist/chunk-0mbx247x.js.map +0 -43
- package/dist/chunk-34bqh420.js.map +0 -23
- package/dist/chunk-57zpb99z.js.map +0 -10
- package/dist/chunk-663csy96.js.map +0 -10
- package/dist/chunk-6wetht33.js +0 -89
- package/dist/chunk-6wetht33.js.map +0 -10
- package/dist/chunk-88ppkr54.js.map +0 -12
- package/dist/chunk-nnyp53zt.js.map +0 -13
- package/dist/chunk-nten49ta.js.map +0 -12
- package/dist/chunk-st4xgxey.js.map +0 -45
- package/dist/chunk-vp1vc6ee.js +0 -35
- package/dist/chunk-vp1vc6ee.js.map +0 -11
- package/src/agents/prompt.ts +0 -57
- /package/dist/{chunk-sa4340y1.js.map → chunk-1yz3x65y.js.map} +0 -0
- /package/dist/{chunk-gqdd7508.js.map → chunk-4rh2m6zg.js.map} +0 -0
- /package/dist/{chunk-4x43bkbp.js.map → chunk-a09jx26t.js.map} +0 -0
- /package/dist/{chunk-zg9yryhz.js.map → chunk-cbkm2vam.js.map} +0 -0
- /package/dist/{chunk-8ryen3p3.js.map → chunk-f6erf2vv.js.map} +0 -0
- /package/dist/{chunk-bct7hmfc.js.map → chunk-g13869yf.js.map} +0 -0
- /package/dist/{chunk-0k4avqr2.js.map → chunk-hbeh8j9w.js.map} +0 -0
- /package/dist/{chunk-qvybnnpe.js.map → chunk-nzw7sm3b.js.map} +0 -0
- /package/dist/{chunk-bh6k3nc6.js.map → chunk-rs1wbvy6.js.map} +0 -0
- /package/dist/{chunk-7pc8b818.js.map → chunk-sxwk41qa.js.map} +0 -0
- /package/dist/{chunk-5egfka8j.js.map → chunk-tycbzedm.js.map} +0 -0
- /package/dist/{chunk-g9t3kdtx.js.map → chunk-x2yw73hy.js.map} +0 -0
|
@@ -55,6 +55,23 @@ const devices = defineDataset("storage_contract_devices", {
|
|
|
55
55
|
const readings = defineDataset("storage_contract_readings", {
|
|
56
56
|
schema: [col("device_id", "string"), col("at", "timestamp"), col("value", "float64")],
|
|
57
57
|
})
|
|
58
|
+
const ConflictDevice = defineObjectType({
|
|
59
|
+
id: "StorageContractConflictDevice",
|
|
60
|
+
name: "Conflict device",
|
|
61
|
+
properties: [
|
|
62
|
+
prop("id", "string", { primary: true, required: true }),
|
|
63
|
+
prop("name", "string", { required: true }),
|
|
64
|
+
prop("state", "string", { required: true }),
|
|
65
|
+
],
|
|
66
|
+
})
|
|
67
|
+
const conflictDevices = defineDataset("storage_contract_conflict_devices", {
|
|
68
|
+
schema: [
|
|
69
|
+
col("id", "string"),
|
|
70
|
+
col("name", "string"),
|
|
71
|
+
col("state", "string"),
|
|
72
|
+
col("updated_at", "timestamp"),
|
|
73
|
+
],
|
|
74
|
+
})
|
|
58
75
|
const deviceProjection = defineProjection("storage_contract_devices", Device)
|
|
59
76
|
.fromDataset(devices)
|
|
60
77
|
.properties({ id: "id", name: "name" })
|
|
@@ -71,14 +88,22 @@ const temperatureProjection = defineProjection(
|
|
|
71
88
|
)
|
|
72
89
|
.fromDataset(readings)
|
|
73
90
|
.points({ objectId: "device_id", at: "at", value: "value" })
|
|
91
|
+
const conflictDeviceProjection = defineProjection(
|
|
92
|
+
"storage_contract_conflict_devices",
|
|
93
|
+
ConflictDevice
|
|
94
|
+
)
|
|
95
|
+
.fromDataset(conflictDevices)
|
|
96
|
+
.properties({ id: "id", name: "name", state: "state" })
|
|
97
|
+
.resolveConflicts({ strategy: "mostRecent", sourceTimestamp: "updated_at" })
|
|
74
98
|
|
|
75
|
-
const ontology = new OntologyRegistry({ sources: [Device] })
|
|
99
|
+
const ontology = new OntologyRegistry({ sources: [Device, ConflictDevice] })
|
|
76
100
|
const projections = new ProjectionRegistry({
|
|
77
|
-
projections: [deviceProjection, temperatureProjection],
|
|
101
|
+
projections: [deviceProjection, temperatureProjection, conflictDeviceProjection],
|
|
78
102
|
ontology,
|
|
79
103
|
datasetsById: new Map<string, DatasetDefinition>([
|
|
80
104
|
[devices.id, devices],
|
|
81
105
|
[readings.id, readings],
|
|
106
|
+
[conflictDevices.id, conflictDevices],
|
|
82
107
|
]),
|
|
83
108
|
})
|
|
84
109
|
|
|
@@ -339,6 +364,99 @@ export function runMaterializerStorageContractSuite<TStorage extends Storage>(
|
|
|
339
364
|
}
|
|
340
365
|
})
|
|
341
366
|
|
|
367
|
+
test(`${name} persists per-property Action edit times`, async () => {
|
|
368
|
+
const createdStorage = await provider.createStorage()
|
|
369
|
+
const storage = requireContractStorage(createdStorage)
|
|
370
|
+
let materializationOrdinal = 0
|
|
371
|
+
let now = new Date("2026-02-01T00:00:10.000Z")
|
|
372
|
+
const materializer = createOntologyMaterializer({
|
|
373
|
+
projectId: "materializer-storage-contract",
|
|
374
|
+
ontology,
|
|
375
|
+
projections,
|
|
376
|
+
storage,
|
|
377
|
+
dependencies: {
|
|
378
|
+
batching: { sourceStageRows: 1, statePageRows: 1, planChunkRows: 1 },
|
|
379
|
+
clock: () => now,
|
|
380
|
+
materializationId: () => `conflict-contract-candidate-${++materializationOrdinal}`,
|
|
381
|
+
},
|
|
382
|
+
})
|
|
383
|
+
const runtimeMaterializer = materializer.withScope(runtimeScope())
|
|
384
|
+
const ref = { objectTypeId: ConflictDevice.id, primaryId: "one" }
|
|
385
|
+
const replace = async (
|
|
386
|
+
versionId: string,
|
|
387
|
+
sourceUpdatedAt: string,
|
|
388
|
+
name: string,
|
|
389
|
+
state: string
|
|
390
|
+
) => {
|
|
391
|
+
const datasetVersion = {
|
|
392
|
+
datasetId: conflictDevices.id,
|
|
393
|
+
versionId,
|
|
394
|
+
createdAt: sourceUpdatedAt,
|
|
395
|
+
}
|
|
396
|
+
const execution = await claim(storage, {
|
|
397
|
+
runId: `conflict-${versionId}`,
|
|
398
|
+
projectionId: conflictDeviceProjection.id,
|
|
399
|
+
protocol: "replacement",
|
|
400
|
+
datasetVersion,
|
|
401
|
+
})
|
|
402
|
+
const projectionMaterializerForRun = await projectionMaterializer(
|
|
403
|
+
materializer,
|
|
404
|
+
storage,
|
|
405
|
+
conflictDeviceProjection.id,
|
|
406
|
+
`conflict-${versionId}`
|
|
407
|
+
)
|
|
408
|
+
await projectionMaterializerForRun.projections.replace({
|
|
409
|
+
source: { projectionId: conflictDeviceProjection.id },
|
|
410
|
+
datasetVersion,
|
|
411
|
+
execution,
|
|
412
|
+
entries: entries([
|
|
413
|
+
{
|
|
414
|
+
root: { kind: "object", ref },
|
|
415
|
+
assertions: [{ kind: "object", ref, properties: { name, state }, sourceUpdatedAt }],
|
|
416
|
+
},
|
|
417
|
+
]),
|
|
418
|
+
})
|
|
419
|
+
}
|
|
420
|
+
const edit = (requestId: string, propertyId: "name" | "state", value: string) =>
|
|
421
|
+
runtimeMaterializer.edits.commit({
|
|
422
|
+
mode: "atomic",
|
|
423
|
+
source: { kind: "runtime", requestId },
|
|
424
|
+
operations: [
|
|
425
|
+
{
|
|
426
|
+
id: requestId,
|
|
427
|
+
kind: "object.patch",
|
|
428
|
+
ref,
|
|
429
|
+
set: { [propertyId]: value },
|
|
430
|
+
unset: [],
|
|
431
|
+
reset: [],
|
|
432
|
+
},
|
|
433
|
+
],
|
|
434
|
+
expectedObjects: [],
|
|
435
|
+
expectedLinks: [],
|
|
436
|
+
expectedLinkScopes: [],
|
|
437
|
+
})
|
|
438
|
+
|
|
439
|
+
try {
|
|
440
|
+
await replace("v1", "2026-02-01T00:00:10.000Z", "Source A", "source-open")
|
|
441
|
+
|
|
442
|
+
now = new Date("2026-02-01T00:00:11.000Z")
|
|
443
|
+
await edit("conflict-name", "name", "Action B")
|
|
444
|
+
now = new Date("2026-02-01T00:00:13.000Z")
|
|
445
|
+
await edit("conflict-state", "state", "action-closed")
|
|
446
|
+
|
|
447
|
+
await replace("v2", "2026-02-01T00:00:12.000Z", "Source C", "source-changed")
|
|
448
|
+
expect(
|
|
449
|
+
await storage.objects.getByPrimaryId({
|
|
450
|
+
projectId: "materializer-storage-contract",
|
|
451
|
+
objectTypeId: ConflictDevice.id,
|
|
452
|
+
primaryId: "one",
|
|
453
|
+
})
|
|
454
|
+
).toMatchObject({ properties: { id: "one", name: "Source C", state: "action-closed" } })
|
|
455
|
+
} finally {
|
|
456
|
+
await provider.cleanup?.(createdStorage)
|
|
457
|
+
}
|
|
458
|
+
})
|
|
459
|
+
|
|
342
460
|
test(`${name} persists cardinality-one edit authority by scope`, async () => {
|
|
343
461
|
const createdStorage = await provider.createStorage()
|
|
344
462
|
const storage = requireContractStorage(createdStorage)
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
collectObjectQueryValidationIssues,
|
|
5
5
|
countObjects,
|
|
6
6
|
executeObjectQuery,
|
|
7
|
+
executeObjectQueryLinks,
|
|
7
8
|
existsObjects,
|
|
8
9
|
facetObjects,
|
|
9
10
|
normalizeObjectQuery,
|
|
@@ -145,7 +146,7 @@ export const objectQueryContractOntology = new OntologyRegistry({
|
|
|
145
146
|
*
|
|
146
147
|
* The contract defines the portable V1 query surface: capability declarations,
|
|
147
148
|
* validation/normalization handoff, provider pushdown, bounded fallback,
|
|
148
|
-
* traversal, set operations, pagination, search profile defaults, and stable
|
|
149
|
+
* canonical reference sets, traversal, set operations, pagination, search profile defaults, and stable
|
|
149
150
|
* structured rejections for features outside a provider's capability map.
|
|
150
151
|
*/
|
|
151
152
|
export function runObjectQueryProviderContractSuite<TStorage extends Storage>(
|
|
@@ -345,6 +346,212 @@ export function runObjectQueryProviderContractSuite<TStorage extends Storage>(
|
|
|
345
346
|
})
|
|
346
347
|
})
|
|
347
348
|
|
|
349
|
+
test("queries opaque ids through canonical exact refs", async () => {
|
|
350
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
351
|
+
const issue297 = "github:issue:sixb-ai/sixb#297"
|
|
352
|
+
const issue298 = "github:issue:sixb-ai/sixb#298"
|
|
353
|
+
await fixture.seed({
|
|
354
|
+
objects: [
|
|
355
|
+
objectSeed(Asset.id, issue297, { id: issue297 }),
|
|
356
|
+
objectSeed(Asset.id, issue298, { id: issue298 }),
|
|
357
|
+
],
|
|
358
|
+
})
|
|
359
|
+
|
|
360
|
+
const refs = await executeObjectQuery(
|
|
361
|
+
{
|
|
362
|
+
projectId,
|
|
363
|
+
query: {
|
|
364
|
+
kind: "refs",
|
|
365
|
+
refs: [
|
|
366
|
+
{ objectTypeId: Asset.id, primaryId: issue298 },
|
|
367
|
+
{ objectTypeId: Asset.id, primaryId: issue297 },
|
|
368
|
+
],
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
{ ontology: objectQueryContractOntology, storage }
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
// The JSON query body preserves URL-reserved characters without encoding.
|
|
375
|
+
expect(refs.plan.mode).toBe(
|
|
376
|
+
storage.queryCapabilities().nodes?.refs === true ? "pushdown" : "fallback"
|
|
377
|
+
)
|
|
378
|
+
expect(ids(refs)).toEqual([issue297, issue298])
|
|
379
|
+
})
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
test("executes canonical heterogeneous refs with pagination and projection", async () => {
|
|
383
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
384
|
+
await seedObjectQueryContractData(fixture)
|
|
385
|
+
|
|
386
|
+
const refs: Extract<ObjectQuery, { kind: "refs" }>["refs"] = [
|
|
387
|
+
{ objectTypeId: Device.id, primaryId: "device-sensor" },
|
|
388
|
+
{ objectTypeId: Room.id, primaryId: "room-gamma" },
|
|
389
|
+
{ objectTypeId: Room.id, primaryId: "missing" },
|
|
390
|
+
{ objectTypeId: Room.id, primaryId: "room-alpha" },
|
|
391
|
+
]
|
|
392
|
+
const first = await executeObjectQuery(
|
|
393
|
+
{
|
|
394
|
+
projectId,
|
|
395
|
+
query: {
|
|
396
|
+
kind: "project",
|
|
397
|
+
properties: ["id"],
|
|
398
|
+
input: { kind: "page", pageSize: 2, input: { kind: "refs", refs } },
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
{ ontology: objectQueryContractOntology, storage }
|
|
402
|
+
)
|
|
403
|
+
const second = await executeObjectQuery(
|
|
404
|
+
{
|
|
405
|
+
projectId,
|
|
406
|
+
query: {
|
|
407
|
+
kind: "project",
|
|
408
|
+
properties: ["id"],
|
|
409
|
+
input: {
|
|
410
|
+
kind: "page",
|
|
411
|
+
pageSize: 2,
|
|
412
|
+
pageToken: first.nextPageToken,
|
|
413
|
+
input: { kind: "refs", refs },
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
{ ontology: objectQueryContractOntology, storage }
|
|
418
|
+
)
|
|
419
|
+
const count = await countObjects(
|
|
420
|
+
{ projectId, query: { kind: "refs", refs } },
|
|
421
|
+
{ ontology: objectQueryContractOntology, storage }
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
const expectedMode =
|
|
425
|
+
storage.queryCapabilities().nodes?.refs === true ? "pushdown" : "fallback"
|
|
426
|
+
expect(first.plan.mode).toBe(expectedMode)
|
|
427
|
+
expect(ids(first)).toEqual(["device-sensor", "room-alpha"])
|
|
428
|
+
expect(first.objects.map((row) => row.properties)).toEqual([
|
|
429
|
+
{ id: "device-sensor" },
|
|
430
|
+
{ id: "room-alpha" },
|
|
431
|
+
])
|
|
432
|
+
expect(first.total).toBe(3)
|
|
433
|
+
expect(first.hasMore).toBe(true)
|
|
434
|
+
expect(first.nextPageToken).toBeTruthy()
|
|
435
|
+
expect(second.plan.mode).toBe(expectedMode)
|
|
436
|
+
expect(ids(second)).toEqual(["room-gamma"])
|
|
437
|
+
expect(second.hasMore).toBe(false)
|
|
438
|
+
expect(count.plan.mode).toBe(expectedMode)
|
|
439
|
+
expect(count.count).toBe(3)
|
|
440
|
+
})
|
|
441
|
+
})
|
|
442
|
+
|
|
443
|
+
test("composes refs with traversal in provider pushdown", async () => {
|
|
444
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
445
|
+
if (storage.queryCapabilities().nodes?.refs !== true) return
|
|
446
|
+
await seedObjectQueryContractData(fixture)
|
|
447
|
+
|
|
448
|
+
const result = await executeObjectQuery(
|
|
449
|
+
{
|
|
450
|
+
projectId,
|
|
451
|
+
query: {
|
|
452
|
+
kind: "traverse",
|
|
453
|
+
direction: "outgoing",
|
|
454
|
+
linkId: "hasDevice",
|
|
455
|
+
input: {
|
|
456
|
+
kind: "refs",
|
|
457
|
+
refs: [{ objectTypeId: Room.id, primaryId: "room-alpha" }],
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
{ ontology: objectQueryContractOntology, storage }
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
expect(result.plan.mode).toBe("pushdown")
|
|
465
|
+
expect(ids(result)).toEqual(["device-projector"])
|
|
466
|
+
})
|
|
467
|
+
})
|
|
468
|
+
|
|
469
|
+
test("queries and paginates incident links over a provider-backed object set", async () => {
|
|
470
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
471
|
+
await seedObjectQueryContractData(fixture)
|
|
472
|
+
const query: ObjectQuery = {
|
|
473
|
+
kind: "refs",
|
|
474
|
+
refs: [{ objectTypeId: Device.id, primaryId: "device-projector" }],
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
const first = await executeObjectQueryLinks(
|
|
478
|
+
{
|
|
479
|
+
projectId,
|
|
480
|
+
query,
|
|
481
|
+
direction: "incoming",
|
|
482
|
+
includeObjects: true,
|
|
483
|
+
pageSize: 1,
|
|
484
|
+
},
|
|
485
|
+
{ ontology: objectQueryContractOntology, storage }
|
|
486
|
+
)
|
|
487
|
+
const second = await executeObjectQueryLinks(
|
|
488
|
+
{
|
|
489
|
+
projectId,
|
|
490
|
+
query,
|
|
491
|
+
direction: "incoming",
|
|
492
|
+
includeObjects: true,
|
|
493
|
+
pageSize: 1,
|
|
494
|
+
pageToken: first.nextPageToken,
|
|
495
|
+
},
|
|
496
|
+
{ ontology: objectQueryContractOntology, storage }
|
|
497
|
+
)
|
|
498
|
+
|
|
499
|
+
expect(first.links).toEqual([
|
|
500
|
+
expect.objectContaining({
|
|
501
|
+
sourceTypeId: Room.id,
|
|
502
|
+
sourceId: "room-alpha",
|
|
503
|
+
linkId: "hasDevice",
|
|
504
|
+
targetTypeId: Device.id,
|
|
505
|
+
targetId: "device-projector",
|
|
506
|
+
}),
|
|
507
|
+
])
|
|
508
|
+
expect(first.objects.map((row) => row.primaryId)).toEqual([
|
|
509
|
+
"device-projector",
|
|
510
|
+
"room-alpha",
|
|
511
|
+
])
|
|
512
|
+
expect(first.hasMore).toBe(true)
|
|
513
|
+
expect(first.nextPageToken).toBeTruthy()
|
|
514
|
+
expect(second.links).toEqual([
|
|
515
|
+
expect.objectContaining({
|
|
516
|
+
sourceTypeId: Zone.id,
|
|
517
|
+
sourceId: "zone-one",
|
|
518
|
+
linkId: "hasDevice",
|
|
519
|
+
targetTypeId: Device.id,
|
|
520
|
+
targetId: "device-projector",
|
|
521
|
+
}),
|
|
522
|
+
])
|
|
523
|
+
expect(second.objects.map((row) => row.primaryId)).toEqual(["device-projector", "zone-one"])
|
|
524
|
+
expect(second.hasMore).toBe(false)
|
|
525
|
+
})
|
|
526
|
+
})
|
|
527
|
+
|
|
528
|
+
test("does not admit a provider page probe into the link selector", async () => {
|
|
529
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
530
|
+
await seedObjectQueryContractData(fixture)
|
|
531
|
+
|
|
532
|
+
const result = await executeObjectQueryLinks(
|
|
533
|
+
{
|
|
534
|
+
projectId,
|
|
535
|
+
query: {
|
|
536
|
+
kind: "page",
|
|
537
|
+
pageSize: 1,
|
|
538
|
+
input: {
|
|
539
|
+
kind: "sort",
|
|
540
|
+
fields: [{ kind: "property", propertyId: "id", direction: "asc" }],
|
|
541
|
+
input: { kind: "start", objectTypeId: Room.id },
|
|
542
|
+
},
|
|
543
|
+
},
|
|
544
|
+
direction: "outgoing",
|
|
545
|
+
},
|
|
546
|
+
{ ontology: objectQueryContractOntology, storage }
|
|
547
|
+
)
|
|
548
|
+
|
|
549
|
+
expect(result.links).toEqual([
|
|
550
|
+
expect.objectContaining({ sourceId: "room-alpha", targetId: "device-projector" }),
|
|
551
|
+
])
|
|
552
|
+
})
|
|
553
|
+
})
|
|
554
|
+
|
|
348
555
|
test("matches null, missing, neq, in, and not predicate semantics", async () => {
|
|
349
556
|
await withStorage(async ({ objects: storage, fixture }) => {
|
|
350
557
|
await seedObjectQueryContractData(fixture)
|
|
@@ -66,11 +66,16 @@ export abstract class QueueWorker<
|
|
|
66
66
|
failureCodes: config.failureCodes,
|
|
67
67
|
workerId: config.workerId,
|
|
68
68
|
leaseMs: config.leaseMs ?? DEFAULT_LEASE_MS,
|
|
69
|
-
claimLimit: config.claimLimit
|
|
69
|
+
claimLimit: normalizeClaimLimit(config.claimLimit),
|
|
70
70
|
idlePollMs: config.idlePollMs ?? DEFAULT_IDLE_POLL_MS,
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
/** Maximum jobs this worker process claims and executes at once. */
|
|
75
|
+
get concurrency(): number {
|
|
76
|
+
return this.config.claimLimit
|
|
77
|
+
}
|
|
78
|
+
|
|
74
79
|
protected async run(signal: AbortSignal): Promise<void> {
|
|
75
80
|
const inFlight = new Set<Promise<void>>()
|
|
76
81
|
let runError: unknown = null
|
|
@@ -243,6 +248,14 @@ export abstract class QueueWorker<
|
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
250
|
|
|
251
|
+
function normalizeClaimLimit(value: number | undefined): number {
|
|
252
|
+
const claimLimit = value ?? DEFAULT_CLAIM_LIMIT
|
|
253
|
+
if (!Number.isSafeInteger(claimLimit) || claimLimit < 1) {
|
|
254
|
+
throw new Error("[SixbQueueWorker] Worker concurrency must be a positive safe integer.")
|
|
255
|
+
}
|
|
256
|
+
return claimLimit
|
|
257
|
+
}
|
|
258
|
+
|
|
246
259
|
async function settleOrLog<TJob extends QueueJob, TFailureCode extends SixbErrorCode>(
|
|
247
260
|
delivery: QueueDelivery<TJob, TFailureCode>,
|
|
248
261
|
operation: string,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { canViewWorkflowIntervention, canViewWorkflowRun, isAllowed } from "../authorization"
|
|
2
2
|
import type { AuthorizablePrincipal, ExecutionContext } from "../execution"
|
|
3
|
+
import { resolveExecutionCosts } from "../runtime/ai-cost"
|
|
3
4
|
import { resolveExecutionUsage } from "../runtime/ai-usage"
|
|
4
5
|
import type { SixbRuntimeContext } from "../runtime/types"
|
|
6
|
+
import type { AiCostSummary } from "../storage/ai-cost"
|
|
5
7
|
import type { AiModelCallUsage } from "../storage/ai-usage"
|
|
6
8
|
import type {
|
|
7
9
|
ListWorkflowInterventionsInput,
|
|
@@ -61,6 +63,8 @@ export type ListWorkflowRunNodesInput = Omit<
|
|
|
61
63
|
/** Execution-facing Agent node view derived from its run row and model-call ledger. */
|
|
62
64
|
export interface WorkflowAgentNodeRunView extends Omit<WorkflowAgentNodeRunRecord, "execution"> {
|
|
63
65
|
readonly usage?: AiModelCallUsage
|
|
66
|
+
/** Preferred valuation; omitted when there are no calls or cost storage is unavailable. */
|
|
67
|
+
readonly cost?: AiCostSummary
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
/** Execution-facing workflow node view with optional Agent execution details. */
|
|
@@ -226,29 +230,45 @@ async function attachWorkflowNodeViews(
|
|
|
226
230
|
)
|
|
227
231
|
if (agentExecutions.length === 0) return nodes
|
|
228
232
|
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
const executionIds = agentExecutions.map((execution) => execution.executionId)
|
|
234
|
+
const [usages, costs] = await Promise.all([
|
|
235
|
+
resolveExecutionUsage({
|
|
236
|
+
storage: runtime.storage.aiUsage,
|
|
237
|
+
projectId: runtime.projectId,
|
|
238
|
+
executionIds,
|
|
239
|
+
}),
|
|
240
|
+
resolveExecutionCosts({
|
|
241
|
+
storage: runtime.storage.aiCosts,
|
|
242
|
+
projectId: runtime.projectId,
|
|
243
|
+
executionIds,
|
|
244
|
+
}),
|
|
245
|
+
])
|
|
246
|
+
const accountingByExecutionId = new Map(
|
|
247
|
+
agentExecutions.map((execution, index) => [
|
|
248
|
+
execution.executionId,
|
|
249
|
+
{ usage: usages[index], cost: costs[index] },
|
|
250
|
+
])
|
|
236
251
|
)
|
|
237
252
|
|
|
238
253
|
return nodes.map((node, index) => {
|
|
239
254
|
const execution = executions[index]
|
|
240
255
|
if (!execution) return node
|
|
241
|
-
const
|
|
256
|
+
const accounting = accountingByExecutionId.get(execution.executionId)
|
|
242
257
|
return {
|
|
243
258
|
...node,
|
|
244
|
-
agentExecution: toWorkflowAgentNodeRunView(
|
|
259
|
+
agentExecution: toWorkflowAgentNodeRunView(
|
|
260
|
+
execution,
|
|
261
|
+
accounting?.usage,
|
|
262
|
+
accounting?.usage === undefined ? undefined : accounting.cost
|
|
263
|
+
),
|
|
245
264
|
}
|
|
246
265
|
})
|
|
247
266
|
}
|
|
248
267
|
|
|
249
268
|
function toWorkflowAgentNodeRunView(
|
|
250
269
|
execution: WorkflowAgentNodeRunRecord,
|
|
251
|
-
usage: AiModelCallUsage | undefined
|
|
270
|
+
usage: AiModelCallUsage | undefined,
|
|
271
|
+
cost: AiCostSummary | undefined
|
|
252
272
|
): WorkflowAgentNodeRunView {
|
|
253
273
|
return {
|
|
254
274
|
projectId: execution.projectId,
|
|
@@ -267,6 +287,7 @@ function toWorkflowAgentNodeRunView(
|
|
|
267
287
|
startedAt: execution.startedAt,
|
|
268
288
|
completedAt: execution.completedAt,
|
|
269
289
|
...(usage === undefined ? {} : { usage }),
|
|
290
|
+
...(usage === undefined || cost === undefined ? {} : { cost }),
|
|
270
291
|
}
|
|
271
292
|
}
|
|
272
293
|
|
package/dist/agents/prompt.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_AGENT_SYSTEM_CONTEXT: string;
|
|
2
|
-
export declare const DEFAULT_AGENT_TASK_SYSTEM_CONTEXT: string;
|
|
3
|
-
export interface BuildAgentSystemPromptInput {
|
|
4
|
-
readonly instructions: string;
|
|
5
|
-
readonly addendum?: string;
|
|
6
|
-
readonly mode?: "conversation" | "task";
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Compose the framework-owned system prompt for every agent turn.
|
|
10
|
-
*
|
|
11
|
-
* Core Sixb rules are first and explicitly separated from runtime context and project-authored
|
|
12
|
-
* agent instructions so models can distinguish platform behavior from agent-specific goals.
|
|
13
|
-
*/
|
|
14
|
-
export declare function buildAgentSystemPrompt(input: BuildAgentSystemPromptInput): string;
|
|
15
|
-
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/agents/prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,QAQ7B,CAAA;AAEZ,eAAO,MAAM,iCAAiC,QAKlC,CAAA;AAWZ,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,MAAM,CAAA;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,MAAM,CAcjF"}
|