@warlock.js/ai 4.2.10 → 4.3.0
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/CHANGELOG.md +61 -1
- package/cjs/index.cjs +10151 -4625
- package/cjs/index.cjs.map +1 -1
- package/cjs/magic-string.es-BtxW4VqG.cjs +1015 -0
- package/cjs/magic-string.es-BtxW4VqG.cjs.map +1 -0
- package/cjs/matcher-logic-SBnzYohQ.cjs +217 -0
- package/cjs/matcher-logic-SBnzYohQ.cjs.map +1 -0
- package/cjs/matchers-BBh3gyB-.cjs +13739 -0
- package/cjs/matchers-BBh3gyB-.cjs.map +1 -0
- package/esm/agent/agent-config.type.d.mts +19 -6
- package/esm/agent/agent-config.type.d.mts.map +1 -1
- package/esm/agent/agent.d.mts.map +1 -1
- package/esm/agent/agent.mjs +17 -6
- package/esm/agent/agent.mjs.map +1 -1
- package/esm/agent/index.d.mts +2 -1
- package/esm/agent/index.mjs +1 -0
- package/esm/agent/spawn-sub-agent.d.mts +87 -0
- package/esm/agent/spawn-sub-agent.d.mts.map +1 -0
- package/esm/agent/spawn-sub-agent.mjs +68 -0
- package/esm/agent/spawn-sub-agent.mjs.map +1 -0
- package/esm/ai.d.mts +58 -3
- package/esm/ai.d.mts.map +1 -1
- package/esm/ai.mjs +58 -3
- package/esm/ai.mjs.map +1 -1
- package/esm/batch/batch.d.mts +43 -0
- package/esm/batch/batch.d.mts.map +1 -0
- package/esm/batch/batch.mjs +179 -0
- package/esm/batch/batch.mjs.map +1 -0
- package/esm/batch/batch.type.d.mts +144 -0
- package/esm/batch/batch.type.d.mts.map +1 -0
- package/esm/batch/index.mjs +3 -0
- package/esm/batch/run-batch-item.mjs +100 -0
- package/esm/batch/run-batch-item.mjs.map +1 -0
- package/esm/batch/run-with-concurrency.mjs +39 -0
- package/esm/batch/run-with-concurrency.mjs.map +1 -0
- package/esm/checkpoint/index.d.mts +3 -0
- package/esm/checkpoint/memory.d.mts +21 -0
- package/esm/checkpoint/memory.d.mts.map +1 -0
- package/esm/checkpoint/memory.mjs +0 -0
- package/esm/checkpoint/memory.mjs.map +1 -0
- package/esm/checkpoint/pg.d.mts +37 -0
- package/esm/checkpoint/pg.d.mts.map +1 -0
- package/esm/checkpoint/pg.mjs +265 -0
- package/esm/checkpoint/pg.mjs.map +1 -0
- package/esm/checkpoint/redis.d.mts +39 -0
- package/esm/checkpoint/redis.d.mts.map +1 -0
- package/esm/checkpoint/redis.mjs +200 -0
- package/esm/checkpoint/redis.mjs.map +1 -0
- package/esm/config.d.mts +61 -14
- package/esm/config.d.mts.map +1 -1
- package/esm/config.mjs +25 -6
- package/esm/config.mjs.map +1 -1
- package/esm/contracts/agent/agent.contract.d.mts +43 -0
- package/esm/contracts/agent/agent.contract.d.mts.map +1 -1
- package/esm/contracts/agent/eval.type.d.mts +143 -0
- package/esm/contracts/agent/eval.type.d.mts.map +1 -0
- package/esm/contracts/agent/index.d.mts +1 -0
- package/esm/contracts/events/supervisor-events.type.d.mts +3 -3
- package/esm/contracts/fallback-model.contract.d.mts +65 -0
- package/esm/contracts/fallback-model.contract.d.mts.map +1 -0
- package/esm/contracts/index.d.mts +32 -12
- package/esm/contracts/memory/index.d.mts +4 -0
- package/esm/contracts/memory/memory-config.type.d.mts +150 -0
- package/esm/contracts/memory/memory-config.type.d.mts.map +1 -0
- package/esm/contracts/memory/memory-item.type.d.mts +64 -0
- package/esm/contracts/memory/memory-item.type.d.mts.map +1 -0
- package/esm/contracts/memory/memory.contract.d.mts +87 -0
- package/esm/contracts/memory/memory.contract.d.mts.map +1 -0
- package/esm/contracts/memory/recall-options.type.d.mts +33 -0
- package/esm/contracts/memory/recall-options.type.d.mts.map +1 -0
- package/esm/contracts/middleware/index.d.mts +2 -2
- package/esm/contracts/middleware/middleware-context.type.d.mts +42 -2
- package/esm/contracts/middleware/middleware-context.type.d.mts.map +1 -1
- package/esm/contracts/middleware/middleware.contract.d.mts +46 -2
- package/esm/contracts/middleware/middleware.contract.d.mts.map +1 -1
- package/esm/contracts/model.contract.d.mts +63 -2
- package/esm/contracts/model.contract.d.mts.map +1 -1
- package/esm/contracts/orchestrator/checkpoint-store.contract.d.mts +91 -0
- package/esm/contracts/orchestrator/checkpoint-store.contract.d.mts.map +1 -0
- package/esm/contracts/orchestrator/index.d.mts +8 -0
- package/esm/contracts/orchestrator/orchestrator-commands.type.d.mts +43 -0
- package/esm/contracts/orchestrator/orchestrator-commands.type.d.mts.map +1 -0
- package/esm/contracts/orchestrator/orchestrator-config.type.d.mts +170 -0
- package/esm/contracts/orchestrator/orchestrator-config.type.d.mts.map +1 -0
- package/esm/contracts/orchestrator/orchestrator-event.type.d.mts +118 -0
- package/esm/contracts/orchestrator/orchestrator-event.type.d.mts.map +1 -0
- package/esm/contracts/orchestrator/orchestrator-execute-options.type.d.mts +44 -0
- package/esm/contracts/orchestrator/orchestrator-execute-options.type.d.mts.map +1 -0
- package/esm/contracts/orchestrator/orchestrator.contract.d.mts +129 -0
- package/esm/contracts/orchestrator/orchestrator.contract.d.mts.map +1 -0
- package/esm/contracts/orchestrator/session.contract.d.mts +26 -0
- package/esm/contracts/orchestrator/session.contract.d.mts.map +1 -0
- package/esm/contracts/orchestrator/snapshot-store.contract.d.mts +89 -0
- package/esm/contracts/orchestrator/snapshot-store.contract.d.mts.map +1 -0
- package/esm/contracts/planner/index.d.mts +6 -0
- package/esm/contracts/planner/planner-capability.type.d.mts +39 -0
- package/esm/contracts/planner/planner-capability.type.d.mts.map +1 -0
- package/esm/contracts/planner/planner-config.type.d.mts +78 -0
- package/esm/contracts/planner/planner-config.type.d.mts.map +1 -0
- package/esm/contracts/planner/planner-execute-options.type.d.mts +43 -0
- package/esm/contracts/planner/planner-execute-options.type.d.mts.map +1 -0
- package/esm/contracts/planner/planner-plan.type.d.mts +48 -0
- package/esm/contracts/planner/planner-plan.type.d.mts.map +1 -0
- package/esm/contracts/planner/planner-result.type.d.mts +82 -0
- package/esm/contracts/planner/planner-result.type.d.mts.map +1 -0
- package/esm/contracts/planner/planner.contract.d.mts +60 -0
- package/esm/contracts/planner/planner.contract.d.mts.map +1 -0
- package/esm/contracts/result/base-report.type.d.mts +7 -2
- package/esm/contracts/result/base-report.type.d.mts.map +1 -1
- package/esm/contracts/result/base-report.type.mjs.map +1 -1
- package/esm/contracts/result/index.d.mts +2 -1
- package/esm/contracts/result/model-pricing.type.d.mts +10 -0
- package/esm/contracts/result/model-pricing.type.d.mts.map +1 -1
- package/esm/contracts/result/orchestrator-result.type.d.mts +139 -0
- package/esm/contracts/result/orchestrator-result.type.d.mts.map +1 -0
- package/esm/contracts/result/session-send-result.type.d.mts +12 -3
- package/esm/contracts/result/session-send-result.type.d.mts.map +1 -1
- package/esm/contracts/result/supervisor-result.type.d.mts +1 -1
- package/esm/contracts/result/usage.type.d.mts +24 -0
- package/esm/contracts/result/usage.type.d.mts.map +1 -1
- package/esm/contracts/sdk-adapter.contract.d.mts +1 -1
- package/esm/contracts/supervisor/dispatch-context.type.d.mts +3 -3
- package/esm/contracts/supervisor/evaluate-context.type.d.mts +1 -1
- package/esm/contracts/supervisor/index.d.mts +5 -5
- package/esm/contracts/supervisor/route-context.type.d.mts +2 -2
- package/esm/contracts/supervisor/supervisor-config.type.d.mts +55 -13
- package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor.contract.d.mts +9 -2
- package/esm/contracts/supervisor/supervisor.contract.d.mts.map +1 -1
- package/esm/contracts/workflow/index.d.mts +2 -2
- package/esm/contracts/workflow/workflow.contract.d.mts +28 -7
- package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -1
- package/esm/errors/error-code.type.d.mts +1 -1
- package/esm/errors/index.d.mts +7 -0
- package/esm/errors/index.mjs +7 -0
- package/esm/errors/orchestrator-cancelled-error.d.mts +32 -0
- package/esm/errors/orchestrator-cancelled-error.d.mts.map +1 -0
- package/esm/errors/orchestrator-cancelled-error.mjs +31 -0
- package/esm/errors/orchestrator-cancelled-error.mjs.map +1 -0
- package/esm/errors/orchestrator-config-error.d.mts +26 -0
- package/esm/errors/orchestrator-config-error.d.mts.map +1 -0
- package/esm/errors/orchestrator-config-error.mjs +30 -0
- package/esm/errors/orchestrator-config-error.mjs.map +1 -0
- package/esm/errors/orchestrator-drift-error.d.mts +38 -0
- package/esm/errors/orchestrator-drift-error.d.mts.map +1 -0
- package/esm/errors/orchestrator-drift-error.mjs +37 -0
- package/esm/errors/orchestrator-drift-error.mjs.map +1 -0
- package/esm/errors/orchestrator-failed-error.d.mts +33 -0
- package/esm/errors/orchestrator-failed-error.d.mts.map +1 -0
- package/esm/errors/orchestrator-failed-error.mjs +36 -0
- package/esm/errors/orchestrator-failed-error.mjs.map +1 -0
- package/esm/errors/planner-cancelled-error.d.mts +33 -0
- package/esm/errors/planner-cancelled-error.d.mts.map +1 -0
- package/esm/errors/planner-cancelled-error.mjs +29 -0
- package/esm/errors/planner-cancelled-error.mjs.map +1 -0
- package/esm/errors/planner-failed-error.d.mts +40 -0
- package/esm/errors/planner-failed-error.d.mts.map +1 -0
- package/esm/errors/planner-failed-error.mjs +37 -0
- package/esm/errors/planner-failed-error.mjs.map +1 -0
- package/esm/errors/planner-plan-invalid-error.d.mts +21 -0
- package/esm/errors/planner-plan-invalid-error.d.mts.map +1 -0
- package/esm/errors/planner-plan-invalid-error.mjs +25 -0
- package/esm/errors/planner-plan-invalid-error.mjs.map +1 -0
- package/esm/eval/eval-runner.d.mts +17 -0
- package/esm/eval/eval-runner.d.mts.map +1 -0
- package/esm/eval/eval-runner.mjs +121 -0
- package/esm/eval/eval-runner.mjs.map +1 -0
- package/esm/eval/index.d.mts +29 -0
- package/esm/eval/index.d.mts.map +1 -0
- package/esm/eval/index.mjs +30 -0
- package/esm/eval/index.mjs.map +1 -0
- package/esm/eval/judge-scorer.d.mts +21 -0
- package/esm/eval/judge-scorer.d.mts.map +1 -0
- package/esm/eval/judge-scorer.mjs +87 -0
- package/esm/eval/judge-scorer.mjs.map +1 -0
- package/esm/eval/scorers.d.mts +50 -0
- package/esm/eval/scorers.d.mts.map +1 -0
- package/esm/eval/scorers.mjs +101 -0
- package/esm/eval/scorers.mjs.map +1 -0
- package/esm/index.d.mts +95 -30
- package/esm/index.mjs +66 -22
- package/esm/memory/derive-id.mjs +24 -0
- package/esm/memory/derive-id.mjs.map +1 -0
- package/esm/memory/episodic-memory.mjs +106 -0
- package/esm/memory/episodic-memory.mjs.map +1 -0
- package/esm/memory/index.d.mts +5 -0
- package/esm/memory/memory.d.mts +42 -0
- package/esm/memory/memory.d.mts.map +1 -0
- package/esm/memory/memory.mjs +166 -0
- package/esm/memory/memory.mjs.map +1 -0
- package/esm/memory/procedural-memory.mjs +103 -0
- package/esm/memory/procedural-memory.mjs.map +1 -0
- package/esm/memory/semantic-memory.mjs +80 -0
- package/esm/memory/semantic-memory.mjs.map +1 -0
- package/esm/memory/working-memory.mjs +62 -0
- package/esm/memory/working-memory.mjs.map +1 -0
- package/esm/middleware/builtins/budget-contract.type.d.mts +126 -0
- package/esm/middleware/builtins/budget-contract.type.d.mts.map +1 -0
- package/esm/middleware/builtins/budget.d.mts +71 -1
- package/esm/middleware/builtins/budget.d.mts.map +1 -1
- package/esm/middleware/builtins/budget.mjs +119 -4
- package/esm/middleware/builtins/budget.mjs.map +1 -1
- package/esm/middleware/builtins/semantic-cache.d.mts +1 -1
- package/esm/middleware/index.d.mts +2 -1
- package/esm/middleware/index.mjs +1 -1
- package/esm/middleware/pipeline.d.mts +9 -6
- package/esm/middleware/pipeline.d.mts.map +1 -1
- package/esm/middleware/pipeline.mjs.map +1 -1
- package/esm/mock/index.d.mts +1 -0
- package/esm/mock/index.mjs +1 -0
- package/esm/mock/mock-router.d.mts +63 -0
- package/esm/mock/mock-router.d.mts.map +1 -0
- package/esm/mock/mock-router.mjs +58 -0
- package/esm/mock/mock-router.mjs.map +1 -0
- package/esm/model/fallback-model.d.mts +45 -0
- package/esm/model/fallback-model.d.mts.map +1 -0
- package/esm/model/fallback-model.mjs +218 -0
- package/esm/model/fallback-model.mjs.map +1 -0
- package/esm/model/index.d.mts +2 -0
- package/esm/model/index.mjs +3 -0
- package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +78 -0
- package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
- package/esm/node_modules/@vitest/expect/dist/index.mjs +1473 -0
- package/esm/node_modules/@vitest/expect/dist/index.mjs.map +1 -0
- package/esm/node_modules/@vitest/pretty-format/dist/index.mjs +888 -0
- package/esm/node_modules/@vitest/pretty-format/dist/index.mjs.map +1 -0
- package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs +1533 -0
- package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +1 -0
- package/esm/node_modules/@vitest/runner/dist/index.mjs +3 -0
- package/esm/node_modules/@vitest/runner/dist/utils.mjs +3 -0
- package/esm/node_modules/@vitest/snapshot/dist/index.mjs +922 -0
- package/esm/node_modules/@vitest/snapshot/dist/index.mjs.map +1 -0
- package/esm/node_modules/@vitest/spy/dist/index.mjs +386 -0
- package/esm/node_modules/@vitest/spy/dist/index.mjs.map +1 -0
- package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +82 -0
- package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +1 -0
- package/esm/node_modules/@vitest/utils/dist/diff.mjs +1357 -0
- package/esm/node_modules/@vitest/utils/dist/diff.mjs.map +1 -0
- package/esm/node_modules/@vitest/utils/dist/display.mjs +559 -0
- package/esm/node_modules/@vitest/utils/dist/display.mjs.map +1 -0
- package/esm/node_modules/@vitest/utils/dist/error.mjs +38 -0
- package/esm/node_modules/@vitest/utils/dist/error.mjs.map +1 -0
- package/esm/node_modules/@vitest/utils/dist/helpers.mjs +181 -0
- package/esm/node_modules/@vitest/utils/dist/helpers.mjs.map +1 -0
- package/esm/node_modules/@vitest/utils/dist/offset.mjs +27 -0
- package/esm/node_modules/@vitest/utils/dist/offset.mjs.map +1 -0
- package/esm/node_modules/@vitest/utils/dist/serialize.mjs +77 -0
- package/esm/node_modules/@vitest/utils/dist/serialize.mjs.map +1 -0
- package/esm/node_modules/@vitest/utils/dist/source-map.mjs +374 -0
- package/esm/node_modules/@vitest/utils/dist/source-map.mjs.map +1 -0
- package/esm/node_modules/@vitest/utils/dist/timers.mjs +37 -0
- package/esm/node_modules/@vitest/utils/dist/timers.mjs.map +1 -0
- package/esm/node_modules/chai/index.mjs +2973 -0
- package/esm/node_modules/chai/index.mjs.map +1 -0
- package/esm/node_modules/magic-string/dist/magic-string.es.mjs +940 -0
- package/esm/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
- package/esm/node_modules/tinyrainbow/dist/index.mjs +87 -0
- package/esm/node_modules/tinyrainbow/dist/index.mjs.map +1 -0
- package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +6 -0
- package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +1 -0
- package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +52 -0
- package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +1 -0
- package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +2697 -0
- package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +1 -0
- package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +45 -0
- package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +1 -0
- package/esm/orchestrator/as-tool.d.mts +42 -0
- package/esm/orchestrator/as-tool.d.mts.map +1 -0
- package/esm/orchestrator/as-tool.mjs +98 -0
- package/esm/orchestrator/as-tool.mjs.map +1 -0
- package/esm/orchestrator/checkpoint.mjs +75 -0
- package/esm/orchestrator/checkpoint.mjs.map +1 -0
- package/esm/orchestrator/commands.d.mts +38 -0
- package/esm/orchestrator/commands.d.mts.map +1 -0
- package/esm/orchestrator/commands.mjs +34 -0
- package/esm/orchestrator/commands.mjs.map +1 -0
- package/esm/orchestrator/compaction.mjs +206 -0
- package/esm/orchestrator/compaction.mjs.map +1 -0
- package/esm/orchestrator/dispatch.mjs +171 -0
- package/esm/orchestrator/dispatch.mjs.map +1 -0
- package/esm/orchestrator/emitter-port.type.d.mts +31 -0
- package/esm/orchestrator/emitter-port.type.d.mts.map +1 -0
- package/esm/orchestrator/emitter.d.mts +56 -0
- package/esm/orchestrator/emitter.d.mts.map +1 -0
- package/esm/orchestrator/emitter.mjs +85 -0
- package/esm/orchestrator/emitter.mjs.map +1 -0
- package/esm/orchestrator/engine-context.type.d.mts +56 -0
- package/esm/orchestrator/engine-context.type.d.mts.map +1 -0
- package/esm/orchestrator/execution.d.mts +116 -0
- package/esm/orchestrator/execution.d.mts.map +1 -0
- package/esm/orchestrator/execution.mjs +406 -0
- package/esm/orchestrator/execution.mjs.map +1 -0
- package/esm/orchestrator/index.d.mts +8 -0
- package/esm/orchestrator/index.mjs +10 -0
- package/esm/orchestrator/load.mjs +49 -0
- package/esm/orchestrator/load.mjs.map +1 -0
- package/esm/orchestrator/lock.mjs +75 -0
- package/esm/orchestrator/lock.mjs.map +1 -0
- package/esm/orchestrator/memory.d.mts +84 -0
- package/esm/orchestrator/memory.d.mts.map +1 -0
- package/esm/orchestrator/memory.mjs +141 -0
- package/esm/orchestrator/memory.mjs.map +1 -0
- package/esm/orchestrator/orchestrator-stream.d.mts +42 -0
- package/esm/orchestrator/orchestrator-stream.d.mts.map +1 -0
- package/esm/orchestrator/orchestrator-stream.mjs +98 -0
- package/esm/orchestrator/orchestrator-stream.mjs.map +1 -0
- package/esm/orchestrator/orchestrator.d.mts +38 -0
- package/esm/orchestrator/orchestrator.d.mts.map +1 -0
- package/esm/orchestrator/orchestrator.mjs +173 -0
- package/esm/orchestrator/orchestrator.mjs.map +1 -0
- package/esm/orchestrator/resume.mjs +74 -0
- package/esm/orchestrator/resume.mjs.map +1 -0
- package/esm/orchestrator/signature.d.mts +40 -0
- package/esm/orchestrator/signature.d.mts.map +1 -0
- package/esm/orchestrator/signature.mjs +120 -0
- package/esm/orchestrator/signature.mjs.map +1 -0
- package/esm/orchestrator/window.mjs +56 -0
- package/esm/orchestrator/window.mjs.map +1 -0
- package/esm/planner/index.d.mts +5 -0
- package/esm/planner/index.mjs +6 -0
- package/esm/planner/plan-prompt.d.mts +17 -0
- package/esm/planner/plan-prompt.d.mts.map +1 -0
- package/esm/planner/plan-prompt.mjs +30 -0
- package/esm/planner/plan-prompt.mjs.map +1 -0
- package/esm/planner/plan-schema.d.mts +27 -0
- package/esm/planner/plan-schema.d.mts.map +1 -0
- package/esm/planner/plan-schema.mjs +117 -0
- package/esm/planner/plan-schema.mjs.map +1 -0
- package/esm/planner/planner-run.d.mts +23 -0
- package/esm/planner/planner-run.d.mts.map +1 -0
- package/esm/planner/planner-run.mjs +344 -0
- package/esm/planner/planner-run.mjs.map +1 -0
- package/esm/planner/planner.d.mts +37 -0
- package/esm/planner/planner.d.mts.map +1 -0
- package/esm/planner/planner.mjs +120 -0
- package/esm/planner/planner.mjs.map +1 -0
- package/esm/planner/signature.d.mts +18 -0
- package/esm/planner/signature.d.mts.map +1 -0
- package/esm/planner/signature.mjs +27 -0
- package/esm/planner/signature.mjs.map +1 -0
- package/esm/snapshot/index.d.mts +3 -0
- package/esm/snapshot/memory.d.mts +26 -0
- package/esm/snapshot/memory.d.mts.map +1 -0
- package/esm/snapshot/memory.mjs +81 -0
- package/esm/snapshot/memory.mjs.map +1 -0
- package/esm/snapshot/pg.d.mts +41 -0
- package/esm/snapshot/pg.d.mts.map +1 -0
- package/esm/snapshot/pg.mjs +146 -0
- package/esm/snapshot/pg.mjs.map +1 -0
- package/esm/snapshot/redis.d.mts +42 -0
- package/esm/snapshot/redis.d.mts.map +1 -0
- package/esm/snapshot/redis.mjs +101 -0
- package/esm/snapshot/redis.mjs.map +1 -0
- package/esm/supervisor/as-tool.d.mts +0 -6
- package/esm/supervisor/as-tool.d.mts.map +1 -1
- package/esm/supervisor/as-tool.mjs +0 -6
- package/esm/supervisor/as-tool.mjs.map +1 -1
- package/esm/supervisor/execution.d.mts +43 -8
- package/esm/supervisor/execution.d.mts.map +1 -1
- package/esm/supervisor/execution.mjs +66 -16
- package/esm/supervisor/execution.mjs.map +1 -1
- package/esm/supervisor/fan-out.d.mts +65 -0
- package/esm/supervisor/fan-out.d.mts.map +1 -0
- package/esm/supervisor/fan-out.mjs +65 -0
- package/esm/supervisor/fan-out.mjs.map +1 -0
- package/esm/supervisor/index.d.mts +5 -3
- package/esm/supervisor/index.mjs +3 -1
- package/esm/supervisor/router-factory.d.mts +110 -0
- package/esm/supervisor/router-factory.d.mts.map +1 -0
- package/esm/supervisor/router-factory.mjs +141 -0
- package/esm/supervisor/router-factory.mjs.map +1 -0
- package/esm/supervisor/router-prompt.d.mts +1 -1
- package/esm/supervisor/snapshot.d.mts +4 -10
- package/esm/supervisor/snapshot.d.mts.map +1 -1
- package/esm/supervisor/snapshot.mjs +8 -16
- package/esm/supervisor/snapshot.mjs.map +1 -1
- package/esm/supervisor/supervisor.mjs +1 -0
- package/esm/supervisor/supervisor.mjs.map +1 -1
- package/esm/system-prompt/index.mjs +6 -0
- package/esm/system-prompt/system-prompt.d.mts +51 -3
- package/esm/system-prompt/system-prompt.d.mts.map +1 -1
- package/esm/system-prompt/system-prompt.mjs +52 -6
- package/esm/system-prompt/system-prompt.mjs.map +1 -1
- package/esm/testing/matcher-logic.d.mts +76 -0
- package/esm/testing/matcher-logic.d.mts.map +1 -0
- package/esm/testing/matcher-logic.mjs +144 -0
- package/esm/testing/matcher-logic.mjs.map +1 -0
- package/esm/testing/matchers.d.mts +48 -0
- package/esm/testing/matchers.d.mts.map +1 -0
- package/esm/testing/matchers.mjs +37 -0
- package/esm/testing/matchers.mjs.map +1 -0
- package/esm/testing/register-lazy.d.mts +20 -0
- package/esm/testing/register-lazy.d.mts.map +1 -0
- package/esm/testing/register-lazy.mjs +24 -0
- package/esm/testing/register-lazy.mjs.map +1 -0
- package/esm/tool/executable-as-tool.d.mts +87 -0
- package/esm/tool/executable-as-tool.d.mts.map +1 -0
- package/esm/tool/executable-as-tool.mjs +81 -0
- package/esm/tool/executable-as-tool.mjs.map +1 -0
- package/esm/tool/index.d.mts +2 -1
- package/esm/tool/index.mjs +1 -0
- package/esm/workflow/as-tool.mjs +0 -6
- package/esm/workflow/as-tool.mjs.map +1 -1
- package/esm/workflow/engine.mjs +2 -2
- package/esm/workflow/snapshot.mjs +13 -7
- package/esm/workflow/snapshot.mjs.map +1 -1
- package/esm/workflow/step-runner.mjs +1 -1
- package/esm/workflow/workflow.mjs +1 -0
- package/esm/workflow/workflow.mjs.map +1 -1
- package/llms-full.txt +947 -42
- package/llms.txt +13 -8
- package/package.json +3 -3
- package/skills/README.md +25 -5
- package/skills/ai-basics/SKILL.md +18 -7
- package/skills/ai-dx-helpers/SKILL.md +180 -0
- package/skills/attach-ai-middleware/SKILL.md +32 -3
- package/skills/handle-ai-errors/SKILL.md +20 -6
- package/skills/manage-ai-stores/SKILL.md +127 -0
- package/skills/persist-ai-data/SKILL.md +21 -10
- package/skills/pick-ai-provider/SKILL.md +46 -12
- package/skills/run-ai-agent/SKILL.md +51 -2
- package/skills/run-orchestrator/SKILL.md +198 -0
- package/skills/run-planner/SKILL.md +68 -0
- package/skills/run-supervisor/SKILL.md +47 -2
- package/skills/use-ai-memory/SKILL.md +124 -0
- package/skills/write-system-prompt/SKILL.md +14 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { AIErrorCode } from "../errors/error-code.type.mjs";
|
|
2
|
+
import { ModelContract } from "./model.contract.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../@warlock.js/ai/src/contracts/fallback-model.contract.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Predicate deciding whether a thrown error should advance the fallback
|
|
7
|
+
* chain to the next model. Receives the original error verbatim (an
|
|
8
|
+
* `AIError` subclass when the failure came from a provider adapter, or
|
|
9
|
+
* any thrown value otherwise) and returns `true` to fall over, `false`
|
|
10
|
+
* to re-throw immediately.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* fallbackModel([primary, backup], {
|
|
14
|
+
* retryOn: (error) => error instanceof ProviderError,
|
|
15
|
+
* });
|
|
16
|
+
*/
|
|
17
|
+
type FallbackRetryPredicate = (error: unknown) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Tuning knobs for {@link fallbackModel}. Both forms of `retryOn` are
|
|
20
|
+
* additive over the built-in transient-failure default (rate-limit,
|
|
21
|
+
* timeout, and generic 5xx provider errors); omit it entirely to use
|
|
22
|
+
* that default unchanged.
|
|
23
|
+
*/
|
|
24
|
+
type FallbackModelOptions = {
|
|
25
|
+
/**
|
|
26
|
+
* Which failures advance the chain. Either an explicit allow-list of
|
|
27
|
+
* stable {@link AIErrorCode} strings, or a predicate for arbitrary
|
|
28
|
+
* branching. Absent = the built-in transient set
|
|
29
|
+
* (`PROVIDER_RATE_LIMIT`, `PROVIDER_TIMEOUT`, `PROVIDER_ERROR`).
|
|
30
|
+
*
|
|
31
|
+
* Non-transient failures (auth, invalid-request, context-length,
|
|
32
|
+
* content-filter) are NEVER retried by default — falling over on a
|
|
33
|
+
* bad API key or an oversized prompt only burns the budget on every
|
|
34
|
+
* downstream model, since the same input fails identically.
|
|
35
|
+
*/
|
|
36
|
+
retryOn?: AIErrorCode[] | FallbackRetryPredicate;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Diagnostic record of one model that the fallback chain tried and that
|
|
40
|
+
* failed with a chain-advancing error. Exposed on the wrapper's
|
|
41
|
+
* `lastAttempts` getter so callers can see exactly which providers were
|
|
42
|
+
* burned before the chain produced a response (or re-threw the final
|
|
43
|
+
* error).
|
|
44
|
+
*/
|
|
45
|
+
type FallbackAttempt = {
|
|
46
|
+
/** Model identifier that failed (`ModelContract.name`). */modelName: string; /** Provider the failed model belonged to (`ModelContract.provider`). */
|
|
47
|
+
provider: string; /** The error that triggered the fall-over to the next model. */
|
|
48
|
+
error: unknown;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* The `ModelContract` returned by `fallbackModel()`: a fully usable
|
|
52
|
+
* model that additionally exposes which wrapped models failed (and why)
|
|
53
|
+
* during the most recent call.
|
|
54
|
+
*/
|
|
55
|
+
interface FallbackModelContract extends ModelContract {
|
|
56
|
+
/**
|
|
57
|
+
* Models that failed with a chain-advancing error during the most
|
|
58
|
+
* recent `complete()` / `stream()` call, in attempt order. Empty when
|
|
59
|
+
* the primary model succeeded outright. Overwritten on each call.
|
|
60
|
+
*/
|
|
61
|
+
readonly lastAttempts: FallbackAttempt[];
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { FallbackAttempt, FallbackModelContract, FallbackModelOptions, FallbackRetryPredicate };
|
|
65
|
+
//# sourceMappingURL=fallback-model.contract.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback-model.contract.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/fallback-model.contract.ts"],"mappings":";;;;;;AAeA;;;;AAAoD;AAQpD;;;;;KARY,sBAAA,IAA0B,KAAc;;;AAoBF;AAUlD;;;KAtBY,oBAAA;EAwBV;;;;AAIK;AAQP;;;;;;EAxBE,OAAA,GAAU,WAAA,KAAgB,sBAAsB;AAAA;AA8BV;;;;;;;AAAA,KApB5B,eAAA;6DAEV,SAAA;EAEA,QAAA;EAEA,KAAA;AAAA;;;;;;UAQe,qBAAA,SAA8B,aAAa;;;;;;WAMjD,YAAA,EAAc,eAAA;AAAA"}
|
|
@@ -18,46 +18,66 @@ import { ExecuteResult } from "./result/execute-result.type.mjs";
|
|
|
18
18
|
import { ExecutableContract } from "./executable.contract.mjs";
|
|
19
19
|
import { StreamEvent, StreamEventBody } from "./stream/stream-event.type.mjs";
|
|
20
20
|
import { StreamContract } from "./stream/stream.contract.mjs";
|
|
21
|
+
import { EvalCase, EvalCaseResult, EvalJudge, EvalOptions, EvalReport, EvalScore, EvalScorer, EvalScorerContext } from "./agent/eval.type.mjs";
|
|
21
22
|
import { AgentContract, AgentEventHandler } from "./agent/agent.contract.mjs";
|
|
22
23
|
import { END, EndSentinel } from "./end.type.mjs";
|
|
24
|
+
import { SupervisorReport, SupervisorResult, SupervisorTerminatedBy } from "./result/supervisor-result.type.mjs";
|
|
23
25
|
import { StepSnapshot } from "./result/step-result.type.mjs";
|
|
24
26
|
import { WorkflowReport, WorkflowResult } from "./result/workflow-result.type.mjs";
|
|
25
27
|
import { ToolConfig, ToolContext, ToolMeta, ToolMode } from "./tool.contract.mjs";
|
|
28
|
+
import { SupervisorInput } from "./supervisor/supervisor-input.type.mjs";
|
|
29
|
+
import { SupervisorSnapshot, SupervisorSnapshotStatus } from "./supervisor/supervisor-snapshot.type.mjs";
|
|
30
|
+
import { PgClientLike, RedisClientLike, SnapshotStore } from "./orchestrator/snapshot-store.contract.mjs";
|
|
26
31
|
import { NextStepResult } from "./workflow/next-step-result.type.mjs";
|
|
27
32
|
import { RetryBackoff, RetryConfig } from "./workflow/retry-config.type.mjs";
|
|
28
33
|
import { WorkflowContext } from "./workflow/workflow-context.type.mjs";
|
|
29
34
|
import { StepAgentInput, StepDefinition, StepLocalEvents, StepOutputSpec } from "./workflow/step.contract.mjs";
|
|
35
|
+
import { WorkflowSnapshot } from "./workflow/workflow-snapshot.type.mjs";
|
|
30
36
|
import { WorkflowDefinition, WorkflowEventHandler, WorkflowEventHandlers, WorkflowExecuteOptions, WorkflowInstance, WorkflowResumeOptions, WorkflowRunOptions } from "./workflow/workflow.contract.mjs";
|
|
37
|
+
import { ModelCallOptions, ModelCapabilities, ModelContract, ModelResponse, ModelStreamChunk, ReasoningEffort } from "./model.contract.mjs";
|
|
38
|
+
import { SupervisorExecuteOptions, SupervisorResumeOptions } from "./supervisor/supervisor-execute-options.type.mjs";
|
|
39
|
+
import { MiddlewareState } from "./middleware/middleware-state.type.mjs";
|
|
40
|
+
import { MiddlewareAgentRef, MiddlewareExecuteContext, MiddlewareModelRef, MiddlewareSupervisorContext, MiddlewareSupervisorRef, MiddlewareToolContext, MiddlewareTripContext } from "./middleware/middleware-context.type.mjs";
|
|
41
|
+
import { AgentMiddleware, AgentMiddlewareExecuteHooks, AgentMiddlewareSupervisorHooks, AgentMiddlewareToolHooks, AgentMiddlewareTripHooks } from "./middleware/middleware.contract.mjs";
|
|
31
42
|
import { Placeholders } from "./placeholders.type.mjs";
|
|
32
43
|
import { InstructionContract, PersonaContract, SystemPromptBlockContract, SystemPromptContract } from "./system-prompt.contract.mjs";
|
|
33
|
-
import { Next } from "./supervisor/next.type.mjs";
|
|
34
|
-
import { AckSnapshot, AgentBranchSnapshot, DecisionSource, IterationDecision, IterationSnapshot } from "./supervisor/iteration-snapshot.type.mjs";
|
|
35
|
-
import { SupervisorInput } from "./supervisor/supervisor-input.type.mjs";
|
|
36
|
-
import { EvaluateBranchResult, EvaluateContext, EvaluateResult } from "./supervisor/evaluate-context.type.mjs";
|
|
37
44
|
import { RouteContext } from "./supervisor/route-context.type.mjs";
|
|
38
45
|
import { AckCallback, AckConfig, AckEntry, AckRunEntry } from "./supervisor/ack-entry.type.mjs";
|
|
39
46
|
import { DispatchRawResult, IntentCallback, IntentEntry, IntentRunEntry, SupervisorIntentValue } from "./supervisor/intent-entry.type.mjs";
|
|
47
|
+
import { Next } from "./supervisor/next.type.mjs";
|
|
40
48
|
import { RouterEntry } from "./supervisor/router-entry.type.mjs";
|
|
41
49
|
import { SupervisorConfig, SupervisorEventHandler, SupervisorEventHandlers } from "./supervisor/supervisor-config.type.mjs";
|
|
42
|
-
import { SupervisorExecuteOptions, SupervisorResumeOptions } from "./supervisor/supervisor-execute-options.type.mjs";
|
|
43
50
|
import { SupervisorStreamEvent } from "./supervisor/supervisor-stream-event.type.mjs";
|
|
44
51
|
import { SupervisorAsToolOptions, SupervisorContract } from "./supervisor/supervisor.contract.mjs";
|
|
45
52
|
import { DispatchContext, IntentRunner, IntentRunnerMap } from "./supervisor/dispatch-context.type.mjs";
|
|
46
53
|
import { ClassifierAgentEntry, ClassifierCallback, ClassifierConfig, ClassifierContext, ClassifierOutput, ClassifierRefineContext, ClassifierRefineResult, ClassifierRunEntry, ClassifierSnapshot } from "./supervisor/classifier-context.type.mjs";
|
|
47
|
-
import {
|
|
54
|
+
import { EvaluateBranchResult, EvaluateContext, EvaluateResult } from "./supervisor/evaluate-context.type.mjs";
|
|
55
|
+
import { AckSnapshot, AgentBranchSnapshot, DecisionSource, IterationDecision, IterationSnapshot } from "./supervisor/iteration-snapshot.type.mjs";
|
|
56
|
+
import { CompactionResult, OrchestratorAwaitingStatus, OrchestratorReport, OrchestratorReportStatus, OrchestratorReportType, OrchestratorResult, TurnSnapshot } from "./result/orchestrator-result.type.mjs";
|
|
48
57
|
import { SessionSendResult } from "./result/session-send-result.type.mjs";
|
|
49
|
-
import { SupervisorSnapshot, SupervisorSnapshotStatus } from "./supervisor/supervisor-snapshot.type.mjs";
|
|
50
58
|
import { SupervisorAgentCompletedPayload, SupervisorAgentFailedPayload, SupervisorAgentStartingPayload, SupervisorAgentStreamingPayload, SupervisorCancelledPayload, SupervisorCompletedPayload, SupervisorErrorPayload, SupervisorEvaluateVerdictPayload, SupervisorIterationCompletedPayload, SupervisorIterationStartingPayload, SupervisorRouterDecidedPayload, SupervisorRouterDecidingPayload, SupervisorStartingPayload } from "./events/supervisor-events.type.mjs";
|
|
51
59
|
import { WorkflowCancelledPayload, WorkflowCompletedPayload, WorkflowErrorPayload, WorkflowLoopWarningPayload, WorkflowStartingPayload, WorkflowStepCompletedPayload, WorkflowStepFailedPayload, WorkflowStepRetryingPayload, WorkflowStepSkippedPayload, WorkflowStepStartingPayload, WorkflowStepStreamingPayload } from "./events/workflow-events.type.mjs";
|
|
52
60
|
import { AgentEventMap, SupervisorEventMap, WorkflowEventMap } from "./events/event-map.type.mjs";
|
|
53
61
|
import { StreamingToolGuardConfig } from "./streaming-tool-guard-config.type.mjs";
|
|
54
62
|
import { AgentExecuteOptions } from "./agent/agent-options.type.mjs";
|
|
55
63
|
import { EmbedderConfig, EmbedderContract, EmbeddingBatchResult, EmbeddingResult, EmbeddingUsage } from "./embedder.contract.mjs";
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
64
|
+
import { MemoryItem, MemoryTier, RecalledMemory } from "./memory/memory-item.type.mjs";
|
|
65
|
+
import { RecallOptions } from "./memory/recall-options.type.mjs";
|
|
66
|
+
import { MemoryContract } from "./memory/memory.contract.mjs";
|
|
67
|
+
import { MemoryConfig, SemanticMemoryConfig } from "./memory/memory-config.type.mjs";
|
|
68
|
+
import { CheckpointRecord, CheckpointStore } from "./orchestrator/checkpoint-store.contract.mjs";
|
|
69
|
+
import { OrchestratorCommands } from "./orchestrator/orchestrator-commands.type.mjs";
|
|
70
|
+
import { OrchestratorEvent, OrchestratorEventHandler, OrchestratorEventHandlers, OrchestratorEventMap, OrchestratorEventName } from "./orchestrator/orchestrator-event.type.mjs";
|
|
71
|
+
import { OrchestratorExecuteOptions, OrchestratorResumeOptions } from "./orchestrator/orchestrator-execute-options.type.mjs";
|
|
72
|
+
import { OrchestratorAsToolOptions, OrchestratorContract, OrchestratorSessionScope, SessionContextOverrides } from "./orchestrator/orchestrator.contract.mjs";
|
|
73
|
+
import { OrchestratorConfig, OrchestratorMemoryConfig, SummarizeCallback, SummarizeConfig } from "./orchestrator/orchestrator-config.type.mjs";
|
|
74
|
+
import { SessionContract } from "./orchestrator/session.contract.mjs";
|
|
75
|
+
import { PlannerCapability } from "./planner/planner-capability.type.mjs";
|
|
76
|
+
import { PlannerConfig } from "./planner/planner-config.type.mjs";
|
|
77
|
+
import { PlannerExecuteOptions } from "./planner/planner-execute-options.type.mjs";
|
|
78
|
+
import { PlannerPlan, PlannerStep } from "./planner/planner-plan.type.mjs";
|
|
79
|
+
import { PlannerReport, PlannerReportType, PlannerResult, PlannerStepSnapshot } from "./planner/planner-result.type.mjs";
|
|
80
|
+
import { PlannerContract } from "./planner/planner.contract.mjs";
|
|
60
81
|
import { ModelConfig, SDKAdapterContract } from "./sdk-adapter.contract.mjs";
|
|
61
|
-
import { WorkflowSnapshot } from "./workflow/workflow-snapshot.type.mjs";
|
|
62
82
|
import { CompleteEvent } from "./events/complete-event.type.mjs";
|
|
63
83
|
import { UsageEvent } from "./events/usage-event.type.mjs";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MemoryItem, MemoryTier, RecalledMemory } from "./memory-item.type.mjs";
|
|
2
|
+
import { RecallOptions } from "./recall-options.type.mjs";
|
|
3
|
+
import { MemoryContract } from "./memory.contract.mjs";
|
|
4
|
+
import { MemoryConfig, SemanticMemoryConfig } from "./memory-config.type.mjs";
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { EmbedderContract } from "../embedder.contract.mjs";
|
|
2
|
+
import { MemoryTier } from "./memory-item.type.mjs";
|
|
3
|
+
import { CacheDriver } from "@warlock.js/cache";
|
|
4
|
+
|
|
5
|
+
//#region ../@warlock.js/ai/src/contracts/memory/memory-config.type.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Semantic-tier wiring for `memory(config)`.
|
|
8
|
+
*
|
|
9
|
+
* Mirrors the `semanticCache` middleware's delegation model: memory does
|
|
10
|
+
* NOT implement similarity search itself — it stores embeddings in a
|
|
11
|
+
* `@warlock.js/cache` driver and retrieves them via the driver's native
|
|
12
|
+
* `.similar()`. Supply the embedder that turns text into vectors and the
|
|
13
|
+
* store that indexes them.
|
|
14
|
+
*
|
|
15
|
+
* Dev / test environments pass `new MemoryCacheDriver()` (zero config,
|
|
16
|
+
* O(N) scan). Production picks a driver with a real ANN index — `pg`
|
|
17
|
+
* with pgvector, `redis` with RediSearch. Drivers without similarity
|
|
18
|
+
* support throw `CacheUnsupportedError` from `set({ vector })` /
|
|
19
|
+
* `similar()`.
|
|
20
|
+
*/
|
|
21
|
+
type SemanticMemoryConfig = {
|
|
22
|
+
/** Embedder used to vectorize remembered text and recall queries. */embedder: EmbedderContract;
|
|
23
|
+
/**
|
|
24
|
+
* Vector-capable cache driver from `@warlock.js/cache`. Falls back to
|
|
25
|
+
* `ai.config({ defaultStore })` when omitted; the factory throws at
|
|
26
|
+
* construction when neither is available.
|
|
27
|
+
*/
|
|
28
|
+
store?: CacheDriver<any, any>;
|
|
29
|
+
/**
|
|
30
|
+
* Namespace prefix applied to every key the semantic tier writes. Lets
|
|
31
|
+
* multiple memory instances share one driver without collision.
|
|
32
|
+
* Default `"ai.memory"`.
|
|
33
|
+
*/
|
|
34
|
+
namespace?: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Episodic-tier wiring for `memory(config)`.
|
|
38
|
+
*
|
|
39
|
+
* Like the semantic tier, episodic memory is embedder-backed and stores
|
|
40
|
+
* its vectors in a `@warlock.js/cache` driver — it adds a per-entry
|
|
41
|
+
* timestamp and blends **recency** into the recall score so recent
|
|
42
|
+
* episodes outrank stale ones at equal similarity.
|
|
43
|
+
*/
|
|
44
|
+
type EpisodicMemoryConfig = {
|
|
45
|
+
/** Embedder used to vectorize remembered episodes and recall queries. */embedder: EmbedderContract;
|
|
46
|
+
/**
|
|
47
|
+
* Vector-capable cache driver. Falls back to `ai.config({ defaultStore })`
|
|
48
|
+
* when omitted; the factory throws at construction when neither exists.
|
|
49
|
+
*/
|
|
50
|
+
store?: CacheDriver<any, any>;
|
|
51
|
+
/**
|
|
52
|
+
* Namespace prefix for every key this tier writes. Default
|
|
53
|
+
* `"ai.memory.episodic"`. Keep distinct from sibling tiers when sharing
|
|
54
|
+
* one driver.
|
|
55
|
+
*/
|
|
56
|
+
namespace?: string;
|
|
57
|
+
/**
|
|
58
|
+
* How much recency counts versus similarity in the blended score, in
|
|
59
|
+
* `[0, 1]`. `0` = pure similarity (semantic-style); higher favors
|
|
60
|
+
* recent episodes. Default `0.3`.
|
|
61
|
+
*/
|
|
62
|
+
recencyWeight?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Age at which an episode's recency contribution halves, in
|
|
65
|
+
* milliseconds. Default 7 days. Larger = slower decay.
|
|
66
|
+
*/
|
|
67
|
+
halfLifeMs?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Clock used to stamp + age episodes. Defaults to `Date.now`. Override
|
|
70
|
+
* for deterministic tests or replay.
|
|
71
|
+
*/
|
|
72
|
+
now?: () => number;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Procedural-tier wiring for `memory(config)`.
|
|
76
|
+
*
|
|
77
|
+
* Embedder-backed like the semantic tier, but blends **reinforcement**
|
|
78
|
+
* into the recall score: re-remembering a procedure increments its use
|
|
79
|
+
* count, so well-worn procedures outrank one-offs at equal similarity.
|
|
80
|
+
*/
|
|
81
|
+
type ProceduralMemoryConfig = {
|
|
82
|
+
/** Embedder used to vectorize remembered procedures and recall queries. */embedder: EmbedderContract;
|
|
83
|
+
/**
|
|
84
|
+
* Vector-capable cache driver. Falls back to `ai.config({ defaultStore })`
|
|
85
|
+
* when omitted; the factory throws at construction when neither exists.
|
|
86
|
+
*/
|
|
87
|
+
store?: CacheDriver<any, any>;
|
|
88
|
+
/**
|
|
89
|
+
* Namespace prefix for every key this tier writes. Default
|
|
90
|
+
* `"ai.memory.procedural"`. Keep distinct from sibling tiers when
|
|
91
|
+
* sharing one driver.
|
|
92
|
+
*/
|
|
93
|
+
namespace?: string;
|
|
94
|
+
/**
|
|
95
|
+
* How much reinforcement counts versus similarity in the blended score,
|
|
96
|
+
* in `[0, 1]`. `0` = pure similarity; higher favors well-used
|
|
97
|
+
* procedures. Default `0.3`.
|
|
98
|
+
*/
|
|
99
|
+
reinforcementWeight?: number;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Configuration for the `memory(config)` factory.
|
|
103
|
+
*
|
|
104
|
+
* At least one tier must be enabled. The working tier is on by default
|
|
105
|
+
* (`working: true`); the semantic, episodic, and procedural tiers each
|
|
106
|
+
* activate only when their config is supplied. Enabling neither is a
|
|
107
|
+
* construction-time error — a memory with no tiers can't store or recall
|
|
108
|
+
* anything.
|
|
109
|
+
*/
|
|
110
|
+
type MemoryConfig = {
|
|
111
|
+
/** Stable identifier — used in logs and as the working-tier scope key. */name?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Enable the in-run working tier. Default `true`. Set `false` to build
|
|
114
|
+
* a semantic-only memory.
|
|
115
|
+
*/
|
|
116
|
+
working?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Enable + wire the semantic recall tier. Omit for a working-only
|
|
119
|
+
* memory.
|
|
120
|
+
*/
|
|
121
|
+
semantic?: SemanticMemoryConfig;
|
|
122
|
+
/**
|
|
123
|
+
* Enable + wire the episodic tier — durable, recency-blended recall of
|
|
124
|
+
* timestamped events. Omit to leave it off.
|
|
125
|
+
*/
|
|
126
|
+
episodic?: EpisodicMemoryConfig;
|
|
127
|
+
/**
|
|
128
|
+
* Enable + wire the procedural tier — durable, reinforcement-blended
|
|
129
|
+
* recall of learned how-tos. Omit to leave it off.
|
|
130
|
+
*/
|
|
131
|
+
procedural?: ProceduralMemoryConfig;
|
|
132
|
+
/**
|
|
133
|
+
* Tier a `remember(...)` item lands in when it doesn't name its own
|
|
134
|
+
* `tier`. Default `"working"`. Must reference an enabled tier.
|
|
135
|
+
*/
|
|
136
|
+
defaultTier?: MemoryTier;
|
|
137
|
+
/**
|
|
138
|
+
* Default number of memories `recall(...)` returns when the call
|
|
139
|
+
* doesn't override `k`. Default `5`.
|
|
140
|
+
*/
|
|
141
|
+
k?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Default minimum semantic similarity for a recall hit, in `[0, 1]`.
|
|
144
|
+
* Default `0.7`. Ignored by the working tier.
|
|
145
|
+
*/
|
|
146
|
+
threshold?: number;
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { EpisodicMemoryConfig, MemoryConfig, ProceduralMemoryConfig, SemanticMemoryConfig };
|
|
150
|
+
//# sourceMappingURL=memory-config.type.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-config.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/memory/memory-config.type.ts"],"mappings":";;;;;;;AAmBA;;;;;;;;;;AAcW;AAWX;;KAzBY,oBAAA;EAgCS,qEA9BnB,QAAA,EAAU,gBAAA;EAyBA;;;;;EAnBV,KAAA,GAAQ,WAAW;EA8CnB;;AAAG;AAUL;;EAlDE,SAAA;AAAA;;;;;;;;AAqEmB;KA1DT,oBAAA;EAsEY,yEApEtB,QAAA,EAAU,gBAAA;EAgFC;;;;EA3EX,KAAA,GAAQ,WAAW;EA0FK;;;;;EApFxB,SAAA;EA0EW;;;;;EApEX,aAAA;EAwFA;;AAAS;;EAnFT,UAAA;;;;;EAKA,GAAA;AAAA;;;;;;;;KAUU,sBAAA;6EAEV,QAAA,EAAU,gBAAA;;;;;EAKV,KAAA,GAAQ,WAAW;;;;;;EAMnB,SAAA;;;;;;EAMA,mBAAA;AAAA;;;;;;;;;;KAYU,YAAA;4EAEV,IAAA;;;;;EAKA,OAAA;;;;;EAKA,QAAA,GAAW,oBAAA;;;;;EAKX,QAAA,GAAW,oBAAA;;;;;EAKX,UAAA,GAAa,sBAAA;;;;;EAKb,WAAA,GAAc,UAAA;;;;;EAKd,CAAA;;;;;EAKA,SAAA;AAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//#region ../@warlock.js/ai/src/contracts/memory/memory-item.type.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The four memory tiers shipped in 4.3.0.
|
|
4
|
+
*
|
|
5
|
+
* - `"working"` — in-run scratch the orchestrator threads across turns.
|
|
6
|
+
* Volatile, unscored, retrieved in insertion order (recency proxy).
|
|
7
|
+
* - `"semantic"` — durable *facts*, stored as embeddings in a
|
|
8
|
+
* `@warlock.js/cache` driver, retrieved by cosine similarity.
|
|
9
|
+
* - `"episodic"` — durable *events*: a timestamped log retrieved by
|
|
10
|
+
* similarity **blended with recency**, so recent episodes outrank stale
|
|
11
|
+
* ones at equal relevance.
|
|
12
|
+
* - `"procedural"` — durable *how-tos*: learned procedures retrieved by
|
|
13
|
+
* similarity **blended with reinforcement**, so a procedure remembered
|
|
14
|
+
* (re-affirmed) more often outranks a one-off at equal relevance.
|
|
15
|
+
*
|
|
16
|
+
* `working` + `semantic` need no extra wiring (semantic needs an embedder
|
|
17
|
+
* + store); `episodic` and `procedural` are embedder-backed like
|
|
18
|
+
* semantic. Decay / forgetting (TTL-based relevance falloff, eviction)
|
|
19
|
+
* remains DEFERRED. The union widened from the v1 `working | semantic`
|
|
20
|
+
* pair to add the two new tiers — a non-breaking change, since every
|
|
21
|
+
* prior value is still valid.
|
|
22
|
+
*/
|
|
23
|
+
type MemoryTier = "working" | "semantic" | "episodic" | "procedural";
|
|
24
|
+
/**
|
|
25
|
+
* A single unit a caller hands to `memory.remember(...)`.
|
|
26
|
+
*
|
|
27
|
+
* `text` is the only required field — it is what gets embedded for the
|
|
28
|
+
* semantic tier and what is surfaced back on recall. `tier` selects the
|
|
29
|
+
* destination; omit it to fall back to the factory's `defaultTier`.
|
|
30
|
+
*
|
|
31
|
+
* `id` lets a caller address an entry for later overwrite / dedup. When
|
|
32
|
+
* absent the factory derives a stable id from the text so re-remembering
|
|
33
|
+
* identical text updates in place rather than duplicating.
|
|
34
|
+
*
|
|
35
|
+
* `metadata` is an opaque bag round-tripped verbatim onto the recalled
|
|
36
|
+
* memory — use it for source ids, timestamps, tags, or anything the
|
|
37
|
+
* consumer wants back alongside the text.
|
|
38
|
+
*/
|
|
39
|
+
type MemoryItem = {
|
|
40
|
+
/** Natural-language content. Embedded for semantic recall; surfaced verbatim on retrieval. */text: string; /** Destination tier. Defaults to the factory's `defaultTier` when omitted. */
|
|
41
|
+
tier?: MemoryTier; /** Caller-owned identifier for overwrite / dedup. Derived from `text` when omitted. */
|
|
42
|
+
id?: string; /** Opaque metadata round-tripped onto the recalled memory unchanged. */
|
|
43
|
+
metadata?: Record<string, unknown>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* A memory returned from `memory.recall(...)`, carrying the relevance
|
|
47
|
+
* `score` the retrieval assigned it.
|
|
48
|
+
*
|
|
49
|
+
* `score` is in `[0, 1]` for every tier so a consumer can sort a mixed
|
|
50
|
+
* recall set on one field without special-casing the tier: cosine
|
|
51
|
+
* similarity for `semantic`, a recency proxy for `working` (most-recent =
|
|
52
|
+
* 1), similarity blended with recency for `episodic`, and similarity
|
|
53
|
+
* blended with reinforcement for `procedural`.
|
|
54
|
+
*/
|
|
55
|
+
type RecalledMemory = {
|
|
56
|
+
/** Stable id of the stored memory. */id: string; /** The remembered text, surfaced for injection into context. */
|
|
57
|
+
text: string; /** Which tier produced this hit. */
|
|
58
|
+
tier: MemoryTier; /** Relevance in `[0, 1]` — cosine similarity (semantic) or recency proxy (working). */
|
|
59
|
+
score: number; /** Opaque metadata stored alongside the memory, returned verbatim. */
|
|
60
|
+
metadata?: Record<string, unknown>;
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { MemoryItem, MemoryTier, RecalledMemory };
|
|
64
|
+
//# sourceMappingURL=memory-item.type.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-item.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/memory/memory-item.type.ts"],"mappings":";;AAqBA;;;;AAAsB;AAiBtB;;;;;;;;;;;AAQmB;AAanB;;;KAtCY,UAAA;;;;;;;;;AAgDO;;;;;;;KA/BP,UAAA;gGAEV,IAAA;EAEA,IAAA,GAAO,UAAA;EAEP,EAAA;EAEA,QAAA,GAAW,MAAM;AAAA;;;;;;;;;;;KAaP,cAAA;wCAEV,EAAA;EAEA,IAAA;EAEA,IAAA,EAAM,UAAA;EAEN,KAAA;EAEA,QAAA,GAAW,MAAM;AAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { MemoryItem, MemoryTier, RecalledMemory } from "./memory-item.type.mjs";
|
|
2
|
+
import { RecallOptions } from "./recall-options.type.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../@warlock.js/ai/src/contracts/memory/memory.contract.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Provider-neutral contract for an agent memory store (memory core M1).
|
|
7
|
+
*
|
|
8
|
+
* **Role.** A single store that holds and retrieves what an agent /
|
|
9
|
+
* orchestrator should remember across turns. Four tiers ship in 4.3.0:
|
|
10
|
+
*
|
|
11
|
+
* - **working** — in-run scratch the orchestrator threads across turns
|
|
12
|
+
* of one session. Volatile, unscored, recalled in insertion order.
|
|
13
|
+
* - **semantic** — durable *facts* stored as embeddings in a
|
|
14
|
+
* `@warlock.js/cache` driver, retrieved by cosine similarity via the
|
|
15
|
+
* driver's `.similar()` (the same delegation the `semanticCache`
|
|
16
|
+
* middleware uses).
|
|
17
|
+
* - **episodic** — durable *events*: a timestamped log retrieved by
|
|
18
|
+
* similarity blended with recency, so recent episodes outrank stale
|
|
19
|
+
* ones at equal relevance.
|
|
20
|
+
* - **procedural** — durable *how-tos*: learned procedures retrieved by
|
|
21
|
+
* similarity blended with reinforcement, so a procedure re-affirmed
|
|
22
|
+
* more often outranks a one-off.
|
|
23
|
+
*
|
|
24
|
+
* `recall()` returns {@link RecalledMemory}[] — scored entries the
|
|
25
|
+
* caller injects into the model context (system prefix, a synthesized
|
|
26
|
+
* "what you remember" block, etc.). Memory never mutates the prompt
|
|
27
|
+
* itself; surfacing the recalled text is the consumer's call so the
|
|
28
|
+
* injection point stays explicit.
|
|
29
|
+
*
|
|
30
|
+
* **Still deferred.** Decay / forgetting (TTL-based relevance falloff,
|
|
31
|
+
* eviction policies) is not yet implemented; the four tiers above are the
|
|
32
|
+
* full 4.3.0 surface. The `episodic` and `procedural` tiers were added in
|
|
33
|
+
* 4.3.0 as a non-breaking widening of the {@link MemoryTier} union.
|
|
34
|
+
*
|
|
35
|
+
* Front it with the `memory(config)` factory — callers never `new` an
|
|
36
|
+
* implementation.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* import { ai } from "@warlock.js/ai";
|
|
40
|
+
* import { MemoryCacheDriver } from "@warlock.js/cache";
|
|
41
|
+
*
|
|
42
|
+
* const store = new MemoryCacheDriver();
|
|
43
|
+
* store.setOptions({});
|
|
44
|
+
*
|
|
45
|
+
* const mem = ai.memory({
|
|
46
|
+
* semantic: {
|
|
47
|
+
* embedder: openai.embedder({ name: "text-embedding-3-small" }),
|
|
48
|
+
* store,
|
|
49
|
+
* },
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* await mem.remember({ text: "User prefers metric units.", tier: "semantic" });
|
|
53
|
+
* const hits = await mem.recall("which units does the user like?", { k: 3 });
|
|
54
|
+
*/
|
|
55
|
+
interface MemoryContract {
|
|
56
|
+
/** Stable identifier — surfaced in logs and used as the working-tier scope key. */
|
|
57
|
+
readonly name: string;
|
|
58
|
+
/**
|
|
59
|
+
* Store one or more memories. Each item lands in its own `tier` (or
|
|
60
|
+
* the factory's `defaultTier` when unset). Items addressed to the
|
|
61
|
+
* semantic tier are embedded and indexed; working-tier items are
|
|
62
|
+
* appended to the in-run buffer.
|
|
63
|
+
*
|
|
64
|
+
* Re-remembering an item whose id (explicit or text-derived) already
|
|
65
|
+
* exists overwrites it in place rather than duplicating.
|
|
66
|
+
*/
|
|
67
|
+
remember(items: MemoryItem | MemoryItem[]): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Retrieve the memories most relevant to `query`, scored and ordered
|
|
70
|
+
* by descending relevance. Queries every enabled tier by default;
|
|
71
|
+
* `options.tier` narrows to one. `options.k` caps the result count,
|
|
72
|
+
* `options.threshold` raises the semantic-similarity floor.
|
|
73
|
+
*
|
|
74
|
+
* Returns an empty array when nothing clears the threshold — never
|
|
75
|
+
* throws on "no hits".
|
|
76
|
+
*/
|
|
77
|
+
recall(query: string, options?: RecallOptions): Promise<RecalledMemory[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Forget memories. With no argument, clears every tier. With a `tier`,
|
|
80
|
+
* clears just that tier — e.g. `clear("working")` at the end of a
|
|
81
|
+
* session while leaving durable semantic recall intact.
|
|
82
|
+
*/
|
|
83
|
+
clear(tier?: MemoryTier): Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { MemoryContract };
|
|
87
|
+
//# sourceMappingURL=memory.contract.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.contract.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/memory/memory.contract.ts"],"mappings":";;;;;;AAqDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BmC;;;;;;;;;;;;;;;;;;UA/BlB,cAAA;;WAEN,IAAA;;;;;;;;;;EAWT,QAAA,CAAS,KAAA,EAAO,UAAA,GAAa,UAAA,KAAe,OAAA;;;;;;;;;;EAW5C,MAAA,CAAO,KAAA,UAAe,OAAA,GAAU,aAAA,GAAgB,OAAA,CAAQ,cAAA;;;;;;EAOxD,KAAA,CAAM,IAAA,GAAO,UAAA,GAAa,OAAA;AAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MemoryTier } from "./memory-item.type.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../@warlock.js/ai/src/contracts/memory/recall-options.type.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Options for `memory.recall(query, options?)`.
|
|
6
|
+
*
|
|
7
|
+
* All fields are optional — the common call is `recall("some query")`,
|
|
8
|
+
* which uses the factory-configured `k` and threshold against every
|
|
9
|
+
* configured tier.
|
|
10
|
+
*/
|
|
11
|
+
type RecallOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* Maximum number of memories to return. Overrides the factory's `k`
|
|
14
|
+
* for this call. The result is the top-`k` across whichever tiers are
|
|
15
|
+
* queried, ordered by descending `score`.
|
|
16
|
+
*/
|
|
17
|
+
k?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Restrict recall to a single tier. Omit to query every tier the
|
|
20
|
+
* factory was configured with (working first, then semantic) and
|
|
21
|
+
* merge the results.
|
|
22
|
+
*/
|
|
23
|
+
tier?: MemoryTier;
|
|
24
|
+
/**
|
|
25
|
+
* Minimum semantic similarity for a hit, in `[0, 1]`. Overrides the
|
|
26
|
+
* factory's `threshold` for this call. Ignored by the working tier,
|
|
27
|
+
* which has no vector index.
|
|
28
|
+
*/
|
|
29
|
+
threshold?: number;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { RecallOptions };
|
|
33
|
+
//# sourceMappingURL=recall-options.type.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recall-options.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/memory/recall-options.type.ts"],"mappings":";;;;;AASA;;;;;KAAY,aAAA;EAYH;;;AAME;;EAZT,CAAA;;;;;;EAMA,IAAA,GAAO,UAAU;;;;;;EAMjB,SAAA;AAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MiddlewareState } from "./middleware-state.type.mjs";
|
|
2
|
-
import { MiddlewareAgentRef, MiddlewareExecuteContext, MiddlewareModelRef, MiddlewareToolContext, MiddlewareTripContext } from "./middleware-context.type.mjs";
|
|
3
|
-
import { AgentMiddleware, AgentMiddlewareExecuteHooks, AgentMiddlewareToolHooks, AgentMiddlewareTripHooks } from "./middleware.contract.mjs";
|
|
2
|
+
import { MiddlewareAgentRef, MiddlewareExecuteContext, MiddlewareModelRef, MiddlewareSupervisorContext, MiddlewareSupervisorRef, MiddlewareToolContext, MiddlewareTripContext } from "./middleware-context.type.mjs";
|
|
3
|
+
import { AgentMiddleware, AgentMiddlewareExecuteHooks, AgentMiddlewareSupervisorHooks, AgentMiddlewareToolHooks, AgentMiddlewareTripHooks } from "./middleware.contract.mjs";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ModelToolCallRequest } from "../model-tool-call-request.type.mjs";
|
|
2
2
|
import { Message } from "../conversation-message.type.mjs";
|
|
3
3
|
import { ToolMode } from "../tool.contract.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { SupervisorInput } from "../supervisor/supervisor-input.type.mjs";
|
|
5
|
+
import { SupervisorExecuteOptions } from "../supervisor/supervisor-execute-options.type.mjs";
|
|
5
6
|
import { MiddlewareState } from "./middleware-state.type.mjs";
|
|
7
|
+
import { AgentExecuteOptions } from "../agent/agent-options.type.mjs";
|
|
6
8
|
|
|
7
9
|
//#region ../@warlock.js/ai/src/contracts/middleware/middleware-context.type.d.ts
|
|
8
10
|
/**
|
|
@@ -94,6 +96,44 @@ type MiddlewareToolContext = MiddlewareTripContext & {
|
|
|
94
96
|
};
|
|
95
97
|
readonly request: ModelToolCallRequest;
|
|
96
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* Minimal identity shape of the supervisor a `supervisor`-level
|
|
101
|
+
* middleware is wrapping. Middleware never mutates the supervisor
|
|
102
|
+
* itself, so it sees only the fields it can usefully branch on — the
|
|
103
|
+
* stable `name` (logs, per-supervisor allow-lists) and the structural
|
|
104
|
+
* `signature` (cache-key namespacing, drift-aware observability).
|
|
105
|
+
*/
|
|
106
|
+
type MiddlewareSupervisorRef = {
|
|
107
|
+
readonly name: string;
|
|
108
|
+
readonly signature: string;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Context passed to the `supervisor`-level middleware phase — fires
|
|
112
|
+
* once around the entire `supervisor.execute()` / `.stream()` /
|
|
113
|
+
* `.resume()` run, wrapping the iteration loop and final assembly.
|
|
114
|
+
*
|
|
115
|
+
* **Role.** The supervisor-level peer of {@link MiddlewareExecuteContext}.
|
|
116
|
+
* Gives middleware the stable identity of the run (supervisor, input,
|
|
117
|
+
* options) and a shared-state bag scoped to this one run. Anything
|
|
118
|
+
* cumulative across the whole supervisor lifecycle lives here:
|
|
119
|
+
* cross-iteration budgets, per-session rate-limit counters, audit
|
|
120
|
+
* correlation ids.
|
|
121
|
+
*
|
|
122
|
+
* Deliberately NOT an extension of {@link MiddlewareExecuteContext} —
|
|
123
|
+
* a supervisor has no single model, and its `input` is the wider
|
|
124
|
+
* `SupervisorInput` union (`string | Record<string, unknown>`), so the
|
|
125
|
+
* shapes diverge. The `state` bag is a fresh `Map` per run, matching
|
|
126
|
+
* the agent-level isolation guarantee.
|
|
127
|
+
*
|
|
128
|
+
* All fields are `readonly`; mutations go through `ctx.state`.
|
|
129
|
+
*/
|
|
130
|
+
type MiddlewareSupervisorContext = {
|
|
131
|
+
readonly supervisor: MiddlewareSupervisorRef;
|
|
132
|
+
readonly input: SupervisorInput;
|
|
133
|
+
readonly options: SupervisorExecuteOptions | undefined;
|
|
134
|
+
readonly state: MiddlewareState;
|
|
135
|
+
readonly signal?: AbortSignal;
|
|
136
|
+
};
|
|
97
137
|
//#endregion
|
|
98
|
-
export { MiddlewareAgentRef, MiddlewareExecuteContext, MiddlewareModelRef, MiddlewareToolContext, MiddlewareTripContext };
|
|
138
|
+
export { MiddlewareAgentRef, MiddlewareExecuteContext, MiddlewareModelRef, MiddlewareSupervisorContext, MiddlewareSupervisorRef, MiddlewareToolContext, MiddlewareTripContext };
|
|
99
139
|
//# sourceMappingURL=middleware-context.type.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-context.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/middleware/middleware-context.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"middleware-context.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/middleware/middleware-context.type.ts"],"mappings":";;;;;;;;;;;AAcA;;;;KAAY,kBAAA;EAAA,SACD,IAAA;EAAA,SACA,WAAW;AAAA;;AAWH;AAgBnB;;;;KAlBY,kBAAA;EAAA,SACD,IAAA;EAAA,SACA,QAAQ;AAAA;;;;;;;;;;;;;;KAgBP,wBAAA;EAAA,SACD,KAAA,EAAO,kBAAA;EAAA,SACP,KAAA,EAAO,kBAAA;EAAA,SACP,KAAA;EAAA,SACA,OAAA,EAAS,mBAAA;EAAA,SACT,KAAA,EAAO,eAAA;EAAA,SACP,MAAA,GAAS,WAAA;AAAA;;;;;;;;;AAkBsB;AAiB1C;;;;KAnBY,qBAAA,GAAwB,wBAAA;EAAA,SACzB,SAAA;EAAA,SACA,QAAA,EAAU,aAAA,CAAc,OAAA;AAAA;;;;;;;;;;AAgCK;AAUxC;;;;KAzBY,qBAAA,GAAwB,qBAAA;EAAA,SACzB,IAAA;IAAA,SACE,IAAA;IAAA,SACA,WAAA;IAgDU;;;;;;;;;IAAA,SAtCV,IAAA,GAAO,QAAA;EAAA;EAAA,SAET,OAAA,EAAS,oBAAA;AAAA;;;;;;AAwCW;;KA9BnB,uBAAA;EAAA,SACD,IAAA;EAAA,SACA,SAAS;AAAA;;;;;;;;;;;;;;;;;;;;;KAuBR,2BAAA;EAAA,SACD,UAAA,EAAY,uBAAA;EAAA,SACZ,KAAA,EAAO,eAAA;EAAA,SACP,OAAA,EAAS,wBAAA;EAAA,SACT,KAAA,EAAO,eAAA;EAAA,SACP,MAAA,GAAS,WAAA;AAAA"}
|