@cuylabs/agent-core 4.9.0 → 4.10.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/README.md +11 -12
- package/dist/agent/chat-loop/commit-batch.d.ts +10 -0
- package/dist/agent/chat-loop/commit-batch.d.ts.map +1 -0
- package/dist/agent/chat-loop/context-recovery.d.ts +29 -0
- package/dist/agent/chat-loop/context-recovery.d.ts.map +1 -0
- package/dist/agent/chat-loop/finalize-turn.d.ts +19 -0
- package/dist/agent/chat-loop/finalize-turn.d.ts.map +1 -0
- package/dist/agent/chat-loop/index.d.ts +7 -0
- package/dist/agent/chat-loop/index.d.ts.map +1 -0
- package/dist/agent/chat-loop/loop.d.ts +8 -0
- package/dist/agent/chat-loop/loop.d.ts.map +1 -0
- package/dist/agent/chat-loop/model-step-runner.d.ts +26 -0
- package/dist/agent/chat-loop/model-step-runner.d.ts.map +1 -0
- package/dist/agent/chat-loop/model-step-snapshot.d.ts +49 -0
- package/dist/agent/chat-loop/model-step-snapshot.d.ts.map +1 -0
- package/dist/agent/chat-loop/turn-tools.d.ts +19 -0
- package/dist/agent/chat-loop/turn-tools.d.ts.map +1 -0
- package/dist/agent/chat-loop/types.d.ts +60 -0
- package/dist/agent/chat-loop/types.d.ts.map +1 -0
- package/dist/agent/defaults.d.ts +69 -0
- package/dist/agent/defaults.d.ts.map +1 -0
- package/dist/agent/event-printer.d.ts +94 -0
- package/dist/agent/event-printer.d.ts.map +1 -0
- package/dist/agent/fork.d.ts +59 -0
- package/dist/agent/fork.d.ts.map +1 -0
- package/dist/agent/index.d.ts +17 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/instance/context-management.d.ts +29 -0
- package/dist/agent/instance/context-management.d.ts.map +1 -0
- package/dist/agent/instance/forking.d.ts +26 -0
- package/dist/agent/instance/forking.d.ts.map +1 -0
- package/dist/agent/instance/index.d.ts +170 -0
- package/dist/agent/instance/index.d.ts.map +1 -0
- package/dist/agent/instance/interventions.d.ts +10 -0
- package/dist/agent/instance/interventions.d.ts.map +1 -0
- package/dist/agent/instance/mcp.d.ts +21 -0
- package/dist/agent/instance/mcp.d.ts.map +1 -0
- package/dist/agent/instance/sessions.d.ts +8 -0
- package/dist/agent/instance/sessions.d.ts.map +1 -0
- package/dist/agent/instance/tools.d.ts +16 -0
- package/dist/agent/instance/tools.d.ts.map +1 -0
- package/dist/agent/instance/turn-lifecycle.d.ts +61 -0
- package/dist/agent/instance/turn-lifecycle.d.ts.map +1 -0
- package/dist/agent/session.d.ts +16 -0
- package/dist/agent/session.d.ts.map +1 -0
- package/dist/agent/setup/config.d.ts +8 -0
- package/dist/agent/setup/config.d.ts.map +1 -0
- package/dist/agent/setup/context-window.d.ts +4 -0
- package/dist/agent/setup/context-window.d.ts.map +1 -0
- package/dist/agent/setup/environment.d.ts +5 -0
- package/dist/agent/setup/environment.d.ts.map +1 -0
- package/dist/agent/setup/middleware.d.ts +9 -0
- package/dist/agent/setup/middleware.d.ts.map +1 -0
- package/dist/agent/setup/runtime-config.d.ts +9 -0
- package/dist/agent/setup/runtime-config.d.ts.map +1 -0
- package/dist/agent/setup/state.d.ts +4 -0
- package/dist/agent/setup/state.d.ts.map +1 -0
- package/dist/agent/setup/tools.d.ts +8 -0
- package/dist/agent/setup/tools.d.ts.map +1 -0
- package/dist/agent/setup.d.ts +47 -0
- package/dist/agent/setup.d.ts.map +1 -0
- package/dist/agent/stream-provider.d.ts +27 -0
- package/dist/agent/stream-provider.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/agent-context.d.ts +53 -0
- package/dist/agent/turn-context/compaction/agent-context.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/budget.d.ts +4 -0
- package/dist/agent/turn-context/compaction/budget.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/check.d.ts +39 -0
- package/dist/agent/turn-context/compaction/check.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/fragments.d.ts +4 -0
- package/dist/agent/turn-context/compaction/fragments.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/index.d.ts +5 -0
- package/dist/agent/turn-context/compaction/index.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/memory.d.ts +17 -0
- package/dist/agent/turn-context/compaction/memory.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/results.d.ts +19 -0
- package/dist/agent/turn-context/compaction/results.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/summary.d.ts +3 -0
- package/dist/agent/turn-context/compaction/summary.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/types.d.ts +24 -0
- package/dist/agent/turn-context/compaction/types.d.ts.map +1 -0
- package/dist/agent/turn-context/fit-model-context.d.ts +29 -0
- package/dist/agent/turn-context/fit-model-context.d.ts.map +1 -0
- package/dist/agent/turn-context/index.d.ts +5 -0
- package/dist/agent/turn-context/index.d.ts.map +1 -0
- package/dist/agent/turn-context/system-prompts.d.ts +12 -0
- package/dist/agent/turn-context/system-prompts.d.ts.map +1 -0
- package/dist/agent/types/config.d.ts +199 -0
- package/dist/agent/types/config.d.ts.map +1 -0
- package/dist/agent/types/index.d.ts +11 -0
- package/dist/agent/types/index.d.ts.map +1 -0
- package/dist/agent/types/state.d.ts +16 -0
- package/dist/agent/types/state.d.ts.map +1 -0
- package/dist/agent/types/tracing.d.ts +12 -0
- package/dist/agent/types/tracing.d.ts.map +1 -0
- package/dist/{chunk-KYLPMBHD.js → chunk-336EDIBL.js} +1 -1
- package/dist/chunk-AAGKWUXR.js +539 -0
- package/dist/chunk-AHDCR7SX.js +83 -0
- package/dist/{chunk-CSR75JVC.js → chunk-ASXF5AC6.js} +1 -1
- package/dist/{chunk-2TTOLHBT.js → chunk-CFBSQLP5.js} +1 -1
- package/dist/{chunk-GJFP5L2V.js → chunk-CNM6OROH.js} +15 -3
- package/dist/chunk-E66PKKDL.js +772 -0
- package/dist/{chunk-HSUPTXNV.js → chunk-EBVSPHXA.js} +13 -10
- package/dist/chunk-EEAGM5MS.js +257 -0
- package/dist/chunk-IQA64CAO.js +84 -0
- package/dist/chunk-JFH6HBUG.js +227 -0
- package/dist/{chunk-MWPU2EVV.js → chunk-JUIL2NJC.js} +4 -81
- package/dist/{chunk-NS7D7JJU.js → chunk-K453AFTL.js} +35 -16
- package/dist/chunk-LX4AHGI3.js +960 -0
- package/dist/chunk-MJRZ2ZRI.js +498 -0
- package/dist/chunk-NMJNN6LS.js +1155 -0
- package/dist/{chunk-UMIVJDEJ.js → chunk-SAWRDGBE.js} +30 -7
- package/dist/{chunk-GEBFHREI.js → chunk-TU5KDFWI.js} +30 -5
- package/dist/{chunk-QJV5XPPS.js → chunk-UEEHZ4QH.js} +1 -1
- package/dist/chunk-UG5PVNZV.js +53 -0
- package/dist/{chunk-BGG2HVIR.js → chunk-V4MIDL5B.js} +9 -0
- package/dist/{chunk-BJC46FIF.js → chunk-V4YQ6MBK.js} +2 -2
- package/dist/{chunk-H3GRHFFG.js → chunk-VMGZKIFT.js} +30 -9
- package/dist/chunk-W6LWIMIX.js +8 -0
- package/dist/context/assembly/index.d.ts +3 -0
- package/dist/context/assembly/index.d.ts.map +1 -0
- package/dist/context/assembly/prepare.d.ts +11 -0
- package/dist/context/assembly/prepare.d.ts.map +1 -0
- package/dist/context/assembly/types.d.ts +60 -0
- package/dist/context/assembly/types.d.ts.map +1 -0
- package/dist/context/config.d.ts +11 -0
- package/dist/context/config.d.ts.map +1 -0
- package/dist/context/fragments/index.d.ts +4 -0
- package/dist/context/fragments/index.d.ts.map +1 -0
- package/dist/context/fragments/messages.d.ts +10 -0
- package/dist/context/fragments/messages.d.ts.map +1 -0
- package/dist/context/fragments/render.d.ts +16 -0
- package/dist/context/fragments/render.d.ts.map +1 -0
- package/dist/context/fragments/types.d.ts +87 -0
- package/dist/context/fragments/types.d.ts.map +1 -0
- package/dist/context/index.d.ts +13 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +90 -0
- package/dist/context/text/truncation.d.ts +13 -0
- package/dist/context/text/truncation.d.ts.map +1 -0
- package/dist/context/window/budget.d.ts +108 -0
- package/dist/context/window/budget.d.ts.map +1 -0
- package/dist/context/window/compactor.d.ts +74 -0
- package/dist/context/window/compactor.d.ts.map +1 -0
- package/dist/context/window/cut-planner.d.ts +64 -0
- package/dist/context/window/cut-planner.d.ts.map +1 -0
- package/dist/context/window/decision.d.ts +41 -0
- package/dist/context/window/decision.d.ts.map +1 -0
- package/dist/context/window/estimation.d.ts +45 -0
- package/dist/context/window/estimation.d.ts.map +1 -0
- package/dist/context/window/index.d.ts +26 -0
- package/dist/context/window/index.d.ts.map +1 -0
- package/dist/context/window/manager.d.ts +80 -0
- package/dist/context/window/manager.d.ts.map +1 -0
- package/dist/context/window/summary-policy.d.ts +50 -0
- package/dist/context/window/summary-policy.d.ts.map +1 -0
- package/dist/context/window/summary.d.ts +56 -0
- package/dist/context/window/summary.d.ts.map +1 -0
- package/dist/context/window/tool-pruning.d.ts +62 -0
- package/dist/context/window/tool-pruning.d.ts.map +1 -0
- package/dist/dispatch/executor.d.ts +56 -0
- package/dist/dispatch/executor.d.ts.map +1 -0
- package/dist/dispatch/index.d.ts +7 -95
- package/dist/dispatch/index.d.ts.map +1 -0
- package/dist/dispatch/index.js +4 -3
- package/dist/dispatch/results.d.ts +9 -0
- package/dist/dispatch/results.d.ts.map +1 -0
- package/dist/dispatch/runtime.d.ts +19 -0
- package/dist/dispatch/runtime.d.ts.map +1 -0
- package/dist/dispatch/tool-factories.d.ts +8 -0
- package/dist/dispatch/tool-factories.d.ts.map +1 -0
- package/dist/dispatch/tools.d.ts +10 -0
- package/dist/dispatch/tools.d.ts.map +1 -0
- package/dist/dispatch/types.d.ts +131 -0
- package/dist/dispatch/types.d.ts.map +1 -0
- package/dist/events/event-bus/index.d.ts +13 -0
- package/dist/events/event-bus/index.d.ts.map +1 -0
- package/dist/events/event-bus/index.js +6 -0
- package/dist/events/event-bus/local.d.ts +14 -0
- package/dist/events/event-bus/local.d.ts.map +1 -0
- package/dist/events/event-bus/types.d.ts +78 -0
- package/dist/events/event-bus/types.d.ts.map +1 -0
- package/dist/events/index.d.ts +10 -89
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +6 -1
- package/dist/events/signal/index.d.ts +18 -0
- package/dist/events/signal/index.d.ts.map +1 -0
- package/dist/events/signal/index.js +6 -0
- package/dist/events/signal/local.d.ts +22 -0
- package/dist/events/signal/local.d.ts.map +1 -0
- package/dist/events/signal/types.d.ts +69 -0
- package/dist/events/signal/types.d.ts.map +1 -0
- package/dist/execution/index.d.ts +33 -481
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +45 -19
- package/dist/execution/scope/index.d.ts +10 -0
- package/dist/execution/scope/index.d.ts.map +1 -0
- package/dist/execution/scope/index.js +12 -0
- package/dist/execution/scope/run.d.ts +8 -0
- package/dist/execution/scope/run.d.ts.map +1 -0
- package/dist/execution/scope/store.d.ts +6 -0
- package/dist/execution/scope/store.d.ts.map +1 -0
- package/dist/execution/scope/types.d.ts +28 -0
- package/dist/execution/scope/types.d.ts.map +1 -0
- package/dist/execution/shared/usage.d.ts +9 -0
- package/dist/execution/shared/usage.d.ts.map +1 -0
- package/dist/execution/task/index.d.ts +6 -0
- package/dist/execution/task/index.d.ts.map +1 -0
- package/dist/execution/task/observer.d.ts +80 -0
- package/dist/execution/task/observer.d.ts.map +1 -0
- package/dist/execution/task/runner.d.ts +39 -0
- package/dist/execution/task/runner.d.ts.map +1 -0
- package/dist/execution/task/types.d.ts +85 -0
- package/dist/execution/task/types.d.ts.map +1 -0
- package/dist/execution/turn/engine/commit-batch.d.ts +16 -0
- package/dist/execution/turn/engine/commit-batch.d.ts.map +1 -0
- package/dist/execution/turn/engine/engine.d.ts +32 -0
- package/dist/execution/turn/engine/engine.d.ts.map +1 -0
- package/dist/execution/turn/engine/index.d.ts +12 -0
- package/dist/execution/turn/engine/index.d.ts.map +1 -0
- package/dist/execution/turn/engine/types.d.ts +67 -0
- package/dist/execution/turn/engine/types.d.ts.map +1 -0
- package/dist/execution/turn/index.d.ts +18 -0
- package/dist/execution/turn/index.d.ts.map +1 -0
- package/dist/execution/turn/index.js +52 -0
- package/dist/execution/turn/runner/commit.d.ts +11 -0
- package/dist/execution/turn/runner/commit.d.ts.map +1 -0
- package/dist/execution/turn/runner/index.d.ts +16 -0
- package/dist/execution/turn/runner/index.d.ts.map +1 -0
- package/dist/execution/turn/runner/prepare.d.ts +6 -0
- package/dist/execution/turn/runner/prepare.d.ts.map +1 -0
- package/dist/execution/turn/runner/stream-step.d.ts +8 -0
- package/dist/execution/turn/runner/stream-step.d.ts.map +1 -0
- package/dist/execution/turn/runner/tool-batch.d.ts +13 -0
- package/dist/execution/turn/runner/tool-batch.d.ts.map +1 -0
- package/dist/execution/turn/runner/types.d.ts +111 -0
- package/dist/execution/turn/runner/types.d.ts.map +1 -0
- package/dist/execution/turn/state.d.ts +110 -0
- package/dist/execution/turn/state.d.ts.map +1 -0
- package/dist/execution/turn/step-ledger.d.ts +89 -0
- package/dist/execution/turn/step-ledger.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/doom-loop.d.ts +28 -0
- package/dist/execution/turn/step-processing/doom-loop.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/index.d.ts +14 -0
- package/dist/execution/turn/step-processing/index.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/overflow.d.ts +17 -0
- package/dist/execution/turn/step-processing/overflow.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/process.d.ts +7 -0
- package/dist/execution/turn/step-processing/process.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/types.d.ts +65 -0
- package/dist/execution/turn/step-processing/types.d.ts.map +1 -0
- package/dist/execution/workflow/index.d.ts +12 -0
- package/dist/execution/workflow/index.d.ts.map +1 -0
- package/dist/execution/workflow/index.js +39 -0
- package/dist/execution/workflow/planner/apply.d.ts +30 -0
- package/dist/execution/workflow/planner/apply.d.ts.map +1 -0
- package/dist/execution/workflow/planner/helpers.d.ts +6 -0
- package/dist/execution/workflow/planner/helpers.d.ts.map +1 -0
- package/dist/execution/workflow/planner/index.d.ts +13 -0
- package/dist/execution/workflow/planner/index.d.ts.map +1 -0
- package/dist/execution/workflow/planner/plan.d.ts +7 -0
- package/dist/execution/workflow/planner/plan.d.ts.map +1 -0
- package/dist/execution/workflow/planner/types.d.ts +49 -0
- package/dist/execution/workflow/planner/types.d.ts.map +1 -0
- package/dist/execution/workflow/snapshot.d.ts +11 -0
- package/dist/execution/workflow/snapshot.d.ts.map +1 -0
- package/dist/execution/workflow/state.d.ts +161 -0
- package/dist/execution/workflow/state.d.ts.map +1 -0
- package/dist/human/controller.d.ts +24 -0
- package/dist/human/controller.d.ts.map +1 -0
- package/dist/human/handler.d.ts +15 -0
- package/dist/human/handler.d.ts.map +1 -0
- package/dist/human/index.d.ts +5 -0
- package/dist/human/index.d.ts.map +1 -0
- package/dist/human/tool.d.ts +17 -0
- package/dist/human/tool.d.ts.map +1 -0
- package/dist/human/types.d.ts +62 -0
- package/dist/human/types.d.ts.map +1 -0
- package/dist/index.d.ts +66 -567
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2482 -1846
- package/dist/inference/defaults.d.ts +8 -0
- package/dist/inference/defaults.d.ts.map +1 -0
- package/dist/inference/errors/classify.d.ts +5 -0
- package/dist/inference/errors/classify.d.ts.map +1 -0
- package/dist/inference/errors/extract.d.ts +3 -0
- package/dist/inference/errors/extract.d.ts.map +1 -0
- package/dist/inference/errors/index.d.ts +8 -11
- package/dist/inference/errors/index.d.ts.map +1 -0
- package/dist/inference/errors/llm-error.d.ts +14 -0
- package/dist/inference/errors/llm-error.d.ts.map +1 -0
- package/dist/inference/errors/types.d.ts +18 -0
- package/dist/inference/errors/types.d.ts.map +1 -0
- package/dist/inference/errors/utils.d.ts +5 -0
- package/dist/inference/errors/utils.d.ts.map +1 -0
- package/dist/inference/index.d.ts +17 -49
- package/dist/inference/index.d.ts.map +1 -0
- package/dist/inference/index.js +7 -7
- package/dist/inference/middleware-support.d.ts +14 -0
- package/dist/inference/middleware-support.d.ts.map +1 -0
- package/dist/{model-messages-n_ZMZwIm.d.ts → inference/model-messages.d.ts} +4 -6
- package/dist/inference/model-messages.d.ts.map +1 -0
- package/dist/inference/retry.d.ts +73 -0
- package/dist/inference/retry.d.ts.map +1 -0
- package/dist/inference/stream.d.ts +16 -0
- package/dist/inference/stream.d.ts.map +1 -0
- package/dist/inference/toolset.d.ts +26 -0
- package/dist/inference/toolset.d.ts.map +1 -0
- package/dist/inference/types.d.ts +129 -0
- package/dist/inference/types.d.ts.map +1 -0
- package/dist/intervention/follow-up-policy.d.ts +41 -0
- package/dist/intervention/follow-up-policy.d.ts.map +1 -0
- package/dist/intervention/index.d.ts +5 -0
- package/dist/intervention/index.d.ts.map +1 -0
- package/dist/intervention/intervention.d.ts +130 -0
- package/dist/intervention/intervention.d.ts.map +1 -0
- package/dist/intervention/types.d.ts +74 -0
- package/dist/intervention/types.d.ts.map +1 -0
- package/dist/logger/index.d.ts +5 -47
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/logger.d.ts +46 -0
- package/dist/logger/logger.d.ts.map +1 -0
- package/dist/{types-RSCv7nQ4.d.ts → logger/types.d.ts} +6 -7
- package/dist/logger/types.d.ts.map +1 -0
- package/dist/mcp/auth.d.ts +109 -0
- package/dist/mcp/auth.d.ts.map +1 -0
- package/dist/mcp/diagnostics.d.ts +23 -0
- package/dist/mcp/diagnostics.d.ts.map +1 -0
- package/dist/mcp/factories.d.ts +47 -0
- package/dist/mcp/factories.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +14 -175
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/manager.d.ts +45 -0
- package/dist/mcp/manager.d.ts.map +1 -0
- package/dist/mcp/modules.d.ts +6 -0
- package/dist/mcp/modules.d.ts.map +1 -0
- package/dist/{types-DMjoFKKv.d.ts → mcp/types.d.ts} +18 -19
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/memory/config.d.ts +4 -0
- package/dist/memory/config.d.ts.map +1 -0
- package/dist/memory/format.d.ts +8 -0
- package/dist/memory/format.d.ts.map +1 -0
- package/dist/memory/index.d.ts +5 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +14 -0
- package/dist/memory/middleware.d.ts +14 -0
- package/dist/memory/middleware.d.ts.map +1 -0
- package/dist/memory/types.d.ts +232 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/middleware/approval.d.ts +70 -0
- package/dist/middleware/approval.d.ts.map +1 -0
- package/dist/middleware/index.d.ts +24 -110
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +2 -2
- package/dist/middleware/prompt-cache/cache.d.ts +44 -0
- package/dist/middleware/prompt-cache/cache.d.ts.map +1 -0
- package/dist/middleware/prompt-cache/index.d.ts +14 -0
- package/dist/middleware/prompt-cache/index.d.ts.map +1 -0
- package/dist/middleware/prompt-cache/types.d.ts +50 -0
- package/dist/middleware/prompt-cache/types.d.ts.map +1 -0
- package/dist/middleware/runner.d.ts +100 -0
- package/dist/middleware/runner.d.ts.map +1 -0
- package/dist/middleware/telemetry/index.d.ts +12 -0
- package/dist/middleware/telemetry/index.d.ts.map +1 -0
- package/dist/middleware/telemetry/otel.d.ts +4 -0
- package/dist/middleware/telemetry/otel.d.ts.map +1 -0
- package/dist/middleware/telemetry/provider.d.ts +3 -0
- package/dist/middleware/telemetry/provider.d.ts.map +1 -0
- package/dist/middleware/telemetry/types.d.ts +150 -0
- package/dist/middleware/telemetry/types.d.ts.map +1 -0
- package/dist/middleware/types.d.ts +371 -0
- package/dist/middleware/types.d.ts.map +1 -0
- package/dist/models/cache/adapters.d.ts +4 -0
- package/dist/models/cache/adapters.d.ts.map +1 -0
- package/dist/models/cache/index.d.ts +5 -0
- package/dist/models/cache/index.d.ts.map +1 -0
- package/dist/models/cache/manager.d.ts +32 -0
- package/dist/models/cache/manager.d.ts.map +1 -0
- package/dist/models/cache/types.d.ts +17 -0
- package/dist/models/cache/types.d.ts.map +1 -0
- package/dist/models/capability-resolver.d.ts +104 -0
- package/dist/models/capability-resolver.d.ts.map +1 -0
- package/dist/models/identifiers.d.ts +23 -0
- package/dist/models/identifiers.d.ts.map +1 -0
- package/dist/models/index.d.ts +35 -256
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +1 -1
- package/dist/models/overrides.d.ts +10 -0
- package/dist/models/overrides.d.ts.map +1 -0
- package/dist/models/profiles.d.ts +38 -0
- package/dist/models/profiles.d.ts.map +1 -0
- package/dist/models/reasoning/config.d.ts +49 -0
- package/dist/models/reasoning/config.d.ts.map +1 -0
- package/dist/models/reasoning/index.d.ts +12 -4
- package/dist/models/reasoning/index.d.ts.map +1 -0
- package/dist/models/reasoning/index.js +1 -1
- package/dist/models/reasoning/providers.d.ts +63 -0
- package/dist/models/reasoning/providers.d.ts.map +1 -0
- package/dist/{types-CQaXbRsS.d.ts → models/reasoning/types.d.ts} +7 -8
- package/dist/models/reasoning/types.d.ts.map +1 -0
- package/dist/models/remote/fetcher.d.ts +13 -0
- package/dist/models/remote/fetcher.d.ts.map +1 -0
- package/dist/models/remote/index.d.ts +8 -0
- package/dist/models/remote/index.d.ts.map +1 -0
- package/dist/models/remote/network.d.ts +6 -0
- package/dist/models/remote/network.d.ts.map +1 -0
- package/dist/models/remote/source.d.ts +16 -0
- package/dist/models/remote/source.d.ts.map +1 -0
- package/dist/models/remote/transform.d.ts +4 -0
- package/dist/models/remote/transform.d.ts.map +1 -0
- package/dist/models/remote/types.d.ts +28 -0
- package/dist/models/remote/types.d.ts.map +1 -0
- package/dist/models/resolver.d.ts +26 -0
- package/dist/models/resolver.d.ts.map +1 -0
- package/dist/models/types.d.ts +137 -0
- package/dist/models/types.d.ts.map +1 -0
- package/dist/plugin/compatibility.d.ts +11 -0
- package/dist/plugin/compatibility.d.ts.map +1 -0
- package/dist/plugin/define.d.ts +77 -0
- package/dist/plugin/define.d.ts.map +1 -0
- package/dist/plugin/event-bus.d.ts +31 -0
- package/dist/plugin/event-bus.d.ts.map +1 -0
- package/dist/plugin/index.d.ts +9 -458
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/loader.d.ts +63 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/plugin/registry.d.ts +81 -0
- package/dist/plugin/registry.d.ts.map +1 -0
- package/dist/plugin/settings.d.ts +36 -0
- package/dist/plugin/settings.d.ts.map +1 -0
- package/dist/plugin/types.d.ts +168 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/profiles/apply.d.ts +17 -0
- package/dist/profiles/apply.d.ts.map +1 -0
- package/dist/profiles/builtins.d.ts +18 -0
- package/dist/profiles/builtins.d.ts.map +1 -0
- package/dist/profiles/index.d.ts +12 -55
- package/dist/profiles/index.d.ts.map +1 -0
- package/dist/profiles/patterns.d.ts +12 -0
- package/dist/profiles/patterns.d.ts.map +1 -0
- package/dist/profiles/types.d.ts +48 -0
- package/dist/profiles/types.d.ts.map +1 -0
- package/dist/prompt/builder/builder.d.ts +27 -0
- package/dist/prompt/builder/builder.d.ts.map +1 -0
- package/dist/prompt/builder/index.d.ts +11 -0
- package/dist/prompt/builder/index.d.ts.map +1 -0
- package/dist/prompt/builder/priorities.d.ts +13 -0
- package/dist/prompt/builder/priorities.d.ts.map +1 -0
- package/dist/prompt/builder/sections.d.ts +30 -0
- package/dist/prompt/builder/sections.d.ts.map +1 -0
- package/dist/prompt/environment.d.ts +46 -0
- package/dist/prompt/environment.d.ts.map +1 -0
- package/dist/prompt/index.d.ts +31 -220
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +3 -1
- package/dist/prompt/instructions.d.ts +104 -0
- package/dist/prompt/instructions.d.ts.map +1 -0
- package/dist/prompt/templates.d.ts +56 -0
- package/dist/prompt/templates.d.ts.map +1 -0
- package/dist/prompt/types.d.ts +218 -0
- package/dist/prompt/types.d.ts.map +1 -0
- package/dist/safety/errors.d.ts +18 -0
- package/dist/safety/errors.d.ts.map +1 -0
- package/dist/safety/handler.d.ts +16 -0
- package/dist/safety/handler.d.ts.map +1 -0
- package/dist/safety/index.d.ts +11 -133
- package/dist/safety/index.d.ts.map +1 -0
- package/dist/safety/patterns.d.ts +17 -0
- package/dist/safety/patterns.d.ts.map +1 -0
- package/dist/safety/policy.d.ts +31 -0
- package/dist/safety/policy.d.ts.map +1 -0
- package/dist/safety/presets.d.ts +43 -0
- package/dist/safety/presets.d.ts.map +1 -0
- package/dist/safety/risk.d.ts +14 -0
- package/dist/safety/risk.d.ts.map +1 -0
- package/dist/safety/types.d.ts +165 -0
- package/dist/safety/types.d.ts.map +1 -0
- package/dist/sandbox/index.d.ts +2 -81
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/types.d.ts +79 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/skill/discovery/constants.d.ts +6 -0
- package/dist/skill/discovery/constants.d.ts.map +1 -0
- package/dist/skill/discovery/dedupe.d.ts +3 -0
- package/dist/skill/discovery/dedupe.d.ts.map +1 -0
- package/dist/skill/discovery/discover.d.ts +3 -0
- package/dist/skill/discovery/discover.d.ts.map +1 -0
- package/dist/skill/discovery/fs.d.ts +4 -0
- package/dist/skill/discovery/fs.d.ts.map +1 -0
- package/dist/skill/discovery/index.d.ts +6 -0
- package/dist/skill/discovery/index.d.ts.map +1 -0
- package/dist/skill/discovery/scan.d.ts +3 -0
- package/dist/skill/discovery/scan.d.ts.map +1 -0
- package/dist/skill/discovery/types.d.ts +15 -0
- package/dist/skill/discovery/types.d.ts.map +1 -0
- package/dist/skill/index.d.ts +67 -89
- package/dist/skill/index.d.ts.map +1 -0
- package/dist/skill/index.js +2 -2
- package/dist/skill/loader/constants.d.ts +5 -0
- package/dist/skill/loader/constants.d.ts.map +1 -0
- package/dist/skill/loader/frontmatter.d.ts +5 -0
- package/dist/skill/loader/frontmatter.d.ts.map +1 -0
- package/dist/skill/loader/index.d.ts +8 -0
- package/dist/skill/loader/index.d.ts.map +1 -0
- package/dist/skill/loader/metadata.d.ts +3 -0
- package/dist/skill/loader/metadata.d.ts.map +1 -0
- package/dist/skill/loader/resources.d.ts +5 -0
- package/dist/skill/loader/resources.d.ts.map +1 -0
- package/dist/skill/registry.d.ts +177 -0
- package/dist/skill/registry.d.ts.map +1 -0
- package/dist/skill/tools.d.ts +77 -0
- package/dist/skill/tools.d.ts.map +1 -0
- package/dist/skill/types.d.ts +291 -0
- package/dist/skill/types.d.ts.map +1 -0
- package/dist/storage/file/helpers.d.ts +16 -0
- package/dist/storage/file/helpers.d.ts.map +1 -0
- package/dist/storage/file/index.d.ts +6 -0
- package/dist/storage/file/index.d.ts.map +1 -0
- package/dist/storage/file/storage.d.ts +29 -0
- package/dist/storage/file/storage.d.ts.map +1 -0
- package/dist/storage/file/types.d.ts +6 -0
- package/dist/storage/file/types.d.ts.map +1 -0
- package/dist/storage/index.d.ts +11 -188
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +2 -1
- package/dist/storage/lock.d.ts +18 -0
- package/dist/storage/lock.d.ts.map +1 -0
- package/dist/storage/manager/default.d.ts +11 -0
- package/dist/storage/manager/default.d.ts.map +1 -0
- package/dist/storage/manager/index.d.ts +12 -0
- package/dist/storage/manager/index.d.ts.map +1 -0
- package/dist/storage/manager/session-manager.d.ts +57 -0
- package/dist/storage/manager/session-manager.d.ts.map +1 -0
- package/dist/storage/manager/types.d.ts +42 -0
- package/dist/storage/manager/types.d.ts.map +1 -0
- package/dist/storage/memory.d.ts +22 -0
- package/dist/storage/memory.d.ts.map +1 -0
- package/dist/storage/paths.d.ts +37 -0
- package/dist/storage/paths.d.ts.map +1 -0
- package/dist/storage/types.d.ts +205 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/utils.d.ts +77 -0
- package/dist/storage/utils.d.ts.map +1 -0
- package/dist/subagents/index.d.ts +8 -179
- package/dist/subagents/index.d.ts.map +1 -0
- package/dist/subagents/index.js +5 -4
- package/dist/subagents/installation.d.ts +23 -0
- package/dist/subagents/installation.d.ts.map +1 -0
- package/dist/subagents/results.d.ts +15 -0
- package/dist/subagents/results.d.ts.map +1 -0
- package/dist/subagents/roles/discovery.d.ts +38 -0
- package/dist/subagents/roles/discovery.d.ts.map +1 -0
- package/dist/subagents/roles/index.d.ts +5 -0
- package/dist/subagents/roles/index.d.ts.map +1 -0
- package/dist/subagents/roles/markdown-profile.d.ts +61 -0
- package/dist/subagents/roles/markdown-profile.d.ts.map +1 -0
- package/dist/subagents/tool-factories.d.ts +11 -0
- package/dist/subagents/tool-factories.d.ts.map +1 -0
- package/dist/subagents/tools.d.ts +13 -0
- package/dist/subagents/tools.d.ts.map +1 -0
- package/dist/subagents/types.d.ts +21 -0
- package/dist/subagents/types.d.ts.map +1 -0
- package/dist/team/coordinator/coordinator.d.ts +342 -0
- package/dist/team/coordinator/coordinator.d.ts.map +1 -0
- package/dist/team/coordinator/inbox.d.ts +99 -0
- package/dist/team/coordinator/inbox.d.ts.map +1 -0
- package/dist/team/coordinator/index.d.ts +19 -0
- package/dist/team/coordinator/index.d.ts.map +1 -0
- package/dist/team/coordinator/planning.d.ts +33 -0
- package/dist/team/coordinator/planning.d.ts.map +1 -0
- package/dist/team/coordinator/policy.d.ts +31 -0
- package/dist/team/coordinator/policy.d.ts.map +1 -0
- package/dist/team/coordinator/round-engine.d.ts +25 -0
- package/dist/team/coordinator/round-engine.d.ts.map +1 -0
- package/dist/team/coordinator/synthesis.d.ts +20 -0
- package/dist/team/coordinator/synthesis.d.ts.map +1 -0
- package/dist/team/coordinator/turn.d.ts +107 -0
- package/dist/team/coordinator/turn.d.ts.map +1 -0
- package/dist/team/coordinator/types.d.ts +344 -0
- package/dist/team/coordinator/types.d.ts.map +1 -0
- package/dist/team/events.d.ts +148 -0
- package/dist/team/events.d.ts.map +1 -0
- package/dist/team/execution.d.ts +51 -0
- package/dist/team/execution.d.ts.map +1 -0
- package/dist/team/index.d.ts +23 -545
- package/dist/team/index.d.ts.map +1 -0
- package/dist/team/index.js +2 -2
- package/dist/team/mailbox.d.ts +91 -0
- package/dist/team/mailbox.d.ts.map +1 -0
- package/dist/team/notifications.d.ts +23 -0
- package/dist/team/notifications.d.ts.map +1 -0
- package/dist/team/permissions.d.ts +88 -0
- package/dist/team/permissions.d.ts.map +1 -0
- package/dist/team/shutdown.d.ts +38 -0
- package/dist/team/shutdown.d.ts.map +1 -0
- package/dist/team/task-board.d.ts +161 -0
- package/dist/team/task-board.d.ts.map +1 -0
- package/dist/team/types.d.ts +233 -0
- package/dist/team/types.d.ts.map +1 -0
- package/dist/team/work-loop.d.ts +30 -0
- package/dist/team/work-loop.d.ts.map +1 -0
- package/dist/tool/executor.d.ts +59 -0
- package/dist/tool/executor.d.ts.map +1 -0
- package/dist/tool/host/index.d.ts +7 -38
- package/dist/tool/host/index.d.ts.map +1 -0
- package/dist/tool/host/local.d.ts +15 -0
- package/dist/tool/host/local.d.ts.map +1 -0
- package/dist/tool/host/registry.d.ts +17 -0
- package/dist/tool/host/registry.d.ts.map +1 -0
- package/dist/{types-C_LCeYNg.d.ts → tool/host/types.d.ts} +6 -7
- package/dist/tool/host/types.d.ts.map +1 -0
- package/dist/tool/index.d.ts +21 -285
- package/dist/tool/index.d.ts.map +1 -0
- package/dist/tool/index.js +4 -3
- package/dist/tool/registry.d.ts +130 -0
- package/dist/tool/registry.d.ts.map +1 -0
- package/dist/tool/replay.d.ts +11 -0
- package/dist/tool/replay.d.ts.map +1 -0
- package/dist/tool/tool-search.d.ts +50 -0
- package/dist/tool/tool-search.d.ts.map +1 -0
- package/dist/tool/tool.d.ts +308 -0
- package/dist/tool/tool.d.ts.map +1 -0
- package/dist/tool/truncation.d.ts +34 -0
- package/dist/tool/truncation.d.ts.map +1 -0
- package/dist/tool/turn-tools.d.ts +71 -0
- package/dist/tool/turn-tools.d.ts.map +1 -0
- package/dist/tracking/file-tracking.d.ts +25 -0
- package/dist/tracking/file-tracking.d.ts.map +1 -0
- package/dist/tracking/index.d.ts +9 -0
- package/dist/tracking/index.d.ts.map +1 -0
- package/dist/tracking/turn-tracker/diff.d.ts +11 -0
- package/dist/tracking/turn-tracker/diff.d.ts.map +1 -0
- package/dist/tracking/turn-tracker/index.d.ts +11 -0
- package/dist/tracking/turn-tracker/index.d.ts.map +1 -0
- package/dist/tracking/turn-tracker/tracker.d.ts +31 -0
- package/dist/tracking/turn-tracker/tracker.d.ts.map +1 -0
- package/dist/tracking/turn-tracker/types.d.ts +66 -0
- package/dist/tracking/turn-tracker/types.d.ts.map +1 -0
- package/dist/types/compaction.d.ts +142 -0
- package/dist/types/compaction.d.ts.map +1 -0
- package/dist/types/doom-loop.d.ts +25 -0
- package/dist/types/doom-loop.d.ts.map +1 -0
- package/dist/types/events.d.ts +194 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/messages.d.ts +119 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/stream.d.ts +172 -0
- package/dist/types/stream.d.ts.map +1 -0
- package/dist/types/tool.d.ts +309 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/turn-source.d.ts +36 -0
- package/dist/types/turn-source.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +7 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/package.json +45 -8
- package/dist/chunk-CJI7PVS2.js +0 -58
- package/dist/chunk-V6ETEYST.js +0 -2091
- package/dist/index-BCqEGzBj.d.ts +0 -251
- package/dist/instance-Bg61WSyz.d.ts +0 -6004
- package/dist/llm-error-D93FNNLY.d.ts +0 -32
- package/dist/turn-tools/index.d.ts +0 -12
- package/dist/turn-tools/index.js +0 -1
- package/dist/{chunk-O2WCYSXQ.js → chunk-3NBTQHVV.js} +0 -0
- package/dist/{chunk-Q742PSH3.js → chunk-MJML3A2F.js} +36 -36
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Middleware Runner
|
|
3
|
+
*
|
|
4
|
+
* Executes middleware hooks in the correct order with proper
|
|
5
|
+
* error handling and short-circuit semantics.
|
|
6
|
+
*
|
|
7
|
+
* This is the internal engine — consumers never see it.
|
|
8
|
+
* They interact with middleware through AgentConfig.middleware.
|
|
9
|
+
*/
|
|
10
|
+
import type { AgentMiddleware, BlockedModelCall, ChatLifecycleContext, ModelCallContext, ModelCallInput, ModelCallOutput, ToolCallDecision, ToolCallOutput } from "./types.js";
|
|
11
|
+
import type { AgentEvent } from "../types/events.js";
|
|
12
|
+
import type { PromptBuildContext, PromptSection } from "../prompt/types.js";
|
|
13
|
+
import type { TokenUsage } from "../types/messages.js";
|
|
14
|
+
import type { StreamChunk } from "../types/stream.js";
|
|
15
|
+
import type { ToolContext } from "../types/tool.js";
|
|
16
|
+
import type { Logger } from "../logger/types.js";
|
|
17
|
+
import type { AgentContextFragmentBuildContext, AgentContextFragmentInput } from "../context/fragments/types.js";
|
|
18
|
+
/**
|
|
19
|
+
* Middleware runner — holds an ordered list of middleware and
|
|
20
|
+
* exposes methods to run each hook type with correct semantics.
|
|
21
|
+
*
|
|
22
|
+
* Immutable after construction. Fork creates a new runner
|
|
23
|
+
* (with inherited + additional middleware).
|
|
24
|
+
*/
|
|
25
|
+
export declare class MiddlewareRunner {
|
|
26
|
+
private readonly stack;
|
|
27
|
+
private readonly log;
|
|
28
|
+
constructor(middleware?: AgentMiddleware[], logger?: Logger);
|
|
29
|
+
/** Number of registered middleware */
|
|
30
|
+
get count(): number;
|
|
31
|
+
/** Whether any middleware is registered */
|
|
32
|
+
get hasMiddleware(): boolean;
|
|
33
|
+
/** Get the middleware list (for fork inheritance) */
|
|
34
|
+
getMiddleware(): readonly AgentMiddleware[];
|
|
35
|
+
runModelInput(input: ModelCallInput, ctx: ModelCallContext): Promise<ModelCallInput | BlockedModelCall>;
|
|
36
|
+
runModelChunk(chunk: StreamChunk, ctx: ModelCallContext): Promise<StreamChunk | undefined>;
|
|
37
|
+
runModelOutput(output: ModelCallOutput, ctx: ModelCallContext): Promise<ModelCallOutput>;
|
|
38
|
+
/**
|
|
39
|
+
* Run all `beforeToolCall` hooks in order.
|
|
40
|
+
*
|
|
41
|
+
* Returns `{ action: "allow" }` if all middleware allow (or have no hook).
|
|
42
|
+
* Returns `{ action: "deny", reason }` on first denial — remaining
|
|
43
|
+
* middleware are skipped.
|
|
44
|
+
*
|
|
45
|
+
* When a middleware rewrites args via `decision.args`, subsequent
|
|
46
|
+
* middleware in the chain receive the rewritten args.
|
|
47
|
+
*/
|
|
48
|
+
runBeforeToolCall(tool: string, args: unknown, ctx: ToolContext): Promise<ToolCallDecision>;
|
|
49
|
+
/**
|
|
50
|
+
* Run all `afterToolCall` hooks in reverse order.
|
|
51
|
+
*
|
|
52
|
+
* Each hook receives the result from the previous hook (or the
|
|
53
|
+
* original tool result for the first hook). Errors are caught
|
|
54
|
+
* and logged — the original result passes through.
|
|
55
|
+
*
|
|
56
|
+
* Middleware can add a `supplement` to inject extra text the model
|
|
57
|
+
* sees alongside the tool output. Supplements chain naturally —
|
|
58
|
+
* each middleware receives any supplement added by earlier hooks.
|
|
59
|
+
*/
|
|
60
|
+
runAfterToolCall(tool: string, args: unknown, result: ToolCallOutput, ctx: ToolContext): Promise<ToolCallOutput>;
|
|
61
|
+
/**
|
|
62
|
+
* Collect prompt sections from all middleware.
|
|
63
|
+
*
|
|
64
|
+
* Returns a flat array of sections. Each middleware can return a single
|
|
65
|
+
* section, an array of sections, or undefined/empty.
|
|
66
|
+
*/
|
|
67
|
+
collectPromptSections(ctx: PromptBuildContext): PromptSection[];
|
|
68
|
+
collectContextFragments(ctx: AgentContextFragmentBuildContext): Promise<AgentContextFragmentInput[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Broadcast an event to all middleware observers.
|
|
71
|
+
*
|
|
72
|
+
* Non-blocking — errors are caught and logged. This never
|
|
73
|
+
* slows down the streaming pipeline.
|
|
74
|
+
*/
|
|
75
|
+
emitEvent(event: AgentEvent): void;
|
|
76
|
+
/**
|
|
77
|
+
* Get the OTel context for a session from the telemetry middleware.
|
|
78
|
+
* Returns undefined if no telemetry middleware is registered.
|
|
79
|
+
*/
|
|
80
|
+
getOtelContext(sessionId: string, ctx?: ChatLifecycleContext): unknown | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Run all `onChatStart` hooks in order.
|
|
83
|
+
*
|
|
84
|
+
* Errors are caught and logged — a broken logger should not
|
|
85
|
+
* prevent the chat from starting.
|
|
86
|
+
*/
|
|
87
|
+
runChatStart(sessionId: string, message: string, ctx?: ChatLifecycleContext): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Run all `onChatEnd` hooks in order.
|
|
90
|
+
*
|
|
91
|
+
* Always called, even when the stream errored. Errors in handlers
|
|
92
|
+
* are caught and logged.
|
|
93
|
+
*/
|
|
94
|
+
runChatEnd(sessionId: string, result: {
|
|
95
|
+
usage?: TokenUsage;
|
|
96
|
+
error?: Error;
|
|
97
|
+
output?: string;
|
|
98
|
+
}, ctx?: ChatLifecycleContext): Promise<void>;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/middleware/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,O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,CAAC;IA2BvC;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAalC;;;OAGG;IACH,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,GAAG,CAAC,EAAE,oBAAoB,GACzB,OAAO,GAAG,SAAS;IActB;;;;;OAKG;IACG,YAAY,CAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC;IAiBhB;;;;;OAKG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,UAAU,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAC9D,GAAG,CAAC,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC;CAYjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenTelemetry middleware module.
|
|
3
|
+
*
|
|
4
|
+
* Split by responsibility:
|
|
5
|
+
* - `types` defines the public tracing contracts
|
|
6
|
+
* - `otel` owns span creation and middleware lifecycle hooks
|
|
7
|
+
* - `provider` owns optional SDK/provider bootstrap helpers
|
|
8
|
+
*/
|
|
9
|
+
export { otelMiddleware } from "./otel.js";
|
|
10
|
+
export { createTelemetryConfig } from "./provider.js";
|
|
11
|
+
export type { OtelMiddlewareConfig, TelemetryConfig, TelemetryConfigResult, } from "./types.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/middleware/telemetry/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,GACtB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otel.d.ts","sourceRoot":"","sources":["../../../src/middleware/telemetry/otel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAiLvD,wBAAgB,cAAc,CAC5B,MAAM,GAAE,oBAAyB,GAChC,eAAe,CAyTjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/middleware/telemetry/provider.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAezE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,GACtB,qBAAqB,CAyDvB"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { TelemetryOptions } from "ai";
|
|
2
|
+
import type { SpanProcessor } from "@opentelemetry/sdk-trace-node";
|
|
3
|
+
import type { AgentMiddleware } from "../types.js";
|
|
4
|
+
export type SpanAttributeValue = string | number | boolean | string[] | number[] | boolean[];
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for the OpenTelemetry middleware.
|
|
7
|
+
*/
|
|
8
|
+
export interface OtelMiddlewareConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Whether to record tool call arguments as span attributes.
|
|
11
|
+
* Defaults to `true`.
|
|
12
|
+
*/
|
|
13
|
+
recordInputs?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to record tool results as span attributes.
|
|
16
|
+
* Defaults to `true`.
|
|
17
|
+
*/
|
|
18
|
+
recordOutputs?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Agent name — used in the root span name and attributes.
|
|
21
|
+
* Falls back to `"agent"`.
|
|
22
|
+
*/
|
|
23
|
+
agentName?: string;
|
|
24
|
+
/** Stable agent identifier — recorded as `gen_ai.agent.id` when provided. */
|
|
25
|
+
agentId?: string;
|
|
26
|
+
/** Agent description — recorded as `gen_ai.agent.description`. */
|
|
27
|
+
agentDescription?: string;
|
|
28
|
+
/** Agent version — recorded as `gen_ai.agent.version` when provided. */
|
|
29
|
+
agentVersion?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Additional attributes applied to agent and tool spans.
|
|
32
|
+
*
|
|
33
|
+
* Use this for deployment, tenant, or vendor-specific dimensions that should
|
|
34
|
+
* flow on every span. Built-in semantic attributes take precedence.
|
|
35
|
+
*/
|
|
36
|
+
spanAttributes?: Record<string, SpanAttributeValue>;
|
|
37
|
+
/**
|
|
38
|
+
* Whether to emit `execute_tool` spans for tool calls.
|
|
39
|
+
* Defaults to `true`.
|
|
40
|
+
*/
|
|
41
|
+
emitToolSpans?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* TTL in milliseconds for orphaned spans.
|
|
44
|
+
* Defaults to 5 minutes.
|
|
45
|
+
*/
|
|
46
|
+
spanTimeoutMs?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Promise that resolves once the TracerProvider is registered.
|
|
49
|
+
* `ensureTracer()` waits on this before calling `trace.getTracer()`.
|
|
50
|
+
*/
|
|
51
|
+
providerReady?: Promise<unknown>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Configuration for `createTelemetryConfig()`.
|
|
55
|
+
*/
|
|
56
|
+
export interface TelemetryConfig {
|
|
57
|
+
/** Agent name — used in span names and `gen_ai.agent.name`. */
|
|
58
|
+
agentName: string;
|
|
59
|
+
/** Stable agent identifier — recorded as `gen_ai.agent.id` when provided. */
|
|
60
|
+
agentId?: string;
|
|
61
|
+
/** Agent description — recorded as `gen_ai.agent.description`. */
|
|
62
|
+
agentDescription?: string;
|
|
63
|
+
/** Agent version — recorded as `gen_ai.agent.version` when provided. */
|
|
64
|
+
agentVersion?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Additional attributes applied to agent and tool spans.
|
|
67
|
+
*
|
|
68
|
+
* Built-in semantic attributes take precedence.
|
|
69
|
+
*/
|
|
70
|
+
spanAttributes?: Record<string, SpanAttributeValue>;
|
|
71
|
+
/**
|
|
72
|
+
* Enable the AI SDK v7 GenAI OpenTelemetry integration.
|
|
73
|
+
*
|
|
74
|
+
* Defaults to `true`. Set to `false` to use only custom/global AI SDK
|
|
75
|
+
* telemetry integrations, or to disable AI SDK model spans entirely.
|
|
76
|
+
*/
|
|
77
|
+
useGenAIOpenTelemetry?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Additional AI SDK v7 telemetry integrations.
|
|
80
|
+
*
|
|
81
|
+
* These are passed to `streamText({ telemetry: { integrations } })` together
|
|
82
|
+
* with the default `GenAIOpenTelemetry` integration unless that default is
|
|
83
|
+
* disabled via `useGenAIOpenTelemetry: false`.
|
|
84
|
+
*/
|
|
85
|
+
telemetryIntegrations?: TelemetryOptions["integrations"];
|
|
86
|
+
/**
|
|
87
|
+
* Use globally registered AI SDK telemetry integrations when no local
|
|
88
|
+
* integrations are configured.
|
|
89
|
+
*
|
|
90
|
+
* Defaults to `false` because `agent-core` installs a local GenAI integration
|
|
91
|
+
* by default.
|
|
92
|
+
*/
|
|
93
|
+
useGlobalTelemetryIntegrations?: boolean;
|
|
94
|
+
/** Record tool arguments and LLM prompts in spans. Defaults to `true`. */
|
|
95
|
+
recordInputs?: boolean;
|
|
96
|
+
/** Record tool results and LLM responses in spans. Defaults to `true`. */
|
|
97
|
+
recordOutputs?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Emit `execute_tool` spans from agent-core middleware.
|
|
100
|
+
*
|
|
101
|
+
* `createTelemetryConfig()` defaults this to `false` when local AI SDK GenAI
|
|
102
|
+
* OpenTelemetry is enabled, because AI SDK already emits tool spans for
|
|
103
|
+
* standard `streamText()` tool execution. `otelMiddleware()` used directly
|
|
104
|
+
* still defaults to `true`.
|
|
105
|
+
*/
|
|
106
|
+
emitToolSpans?: boolean;
|
|
107
|
+
/** TTL in ms for orphaned spans. Defaults to 5 minutes. */
|
|
108
|
+
spanTimeoutMs?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Additional telemetry middleware installed before the default
|
|
111
|
+
* agent-core OTel middleware.
|
|
112
|
+
*
|
|
113
|
+
* Integrations can use this to provide product-specific span lifecycles
|
|
114
|
+
* while still reusing the AI SDK telemetry settings from this config.
|
|
115
|
+
*/
|
|
116
|
+
middleware?: AgentMiddleware | AgentMiddleware[];
|
|
117
|
+
/**
|
|
118
|
+
* Whether to install agent-core's built-in OTel lifecycle middleware.
|
|
119
|
+
*
|
|
120
|
+
* Defaults to `true`. Set to `false` when an integration supplies its own
|
|
121
|
+
* middleware that creates the agent/tool parent spans and OTel context.
|
|
122
|
+
*/
|
|
123
|
+
useDefaultOtelMiddleware?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* An OTel `SpanProcessor` to auto-create and register a `NodeTracerProvider`.
|
|
126
|
+
*/
|
|
127
|
+
spanProcessor?: SpanProcessor;
|
|
128
|
+
/**
|
|
129
|
+
* OTel service name for the `NodeTracerProvider` resource.
|
|
130
|
+
* Defaults to `agentName`.
|
|
131
|
+
*/
|
|
132
|
+
serviceName?: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Result of `createTelemetryConfig()`.
|
|
136
|
+
*/
|
|
137
|
+
export interface TelemetryConfigResult {
|
|
138
|
+
/** Agent-core middleware. */
|
|
139
|
+
middleware: AgentMiddleware;
|
|
140
|
+
/** Ordered telemetry middleware stack. */
|
|
141
|
+
middlewares: AgentMiddleware[];
|
|
142
|
+
/** AI SDK telemetry settings. */
|
|
143
|
+
telemetry: TelemetryOptions;
|
|
144
|
+
/**
|
|
145
|
+
* Flush and shut down the auto-created tracer provider.
|
|
146
|
+
* No-op when no provider was auto-created.
|
|
147
|
+
*/
|
|
148
|
+
shutdown: () => Promise<void>;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/middleware/telemetry/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,EAAE,GACR,MAAM,EAAE,GACR,OAAO,EAAE,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACpD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACpD;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;IACzD;;;;;;OAMG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,eAAe,GAAG,eAAe,EAAE,CAAC;IACjD;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,6BAA6B;IAC7B,UAAU,EAAE,eAAe,CAAC;IAC5B,0CAA0C;IAC1C,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,iCAAiC;IACjC,SAAS,EAAE,gBAAgB,CAAC;IAC5B;;;OAGG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B"}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Middleware Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the composable middleware interface for agent lifecycle hooks.
|
|
5
|
+
*
|
|
6
|
+
* Middleware is just a plain object with optional hook methods — no
|
|
7
|
+
* base classes, no discovery, no installation. Pass it in code:
|
|
8
|
+
*
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const agent = createAgent({
|
|
11
|
+
* middleware: [myLoggerMiddleware, myApprovalMiddleware],
|
|
12
|
+
* });
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Hooks run in array order for "before" operations and reverse order
|
|
16
|
+
* for "after" operations (like middleware stacks everywhere).
|
|
17
|
+
*/
|
|
18
|
+
import type { LanguageModel, ModelMessage, SystemModelMessage, TelemetryOptions } from "ai";
|
|
19
|
+
import type { ProviderOptions } from "@ai-sdk/provider-utils";
|
|
20
|
+
import type { AgentEvent } from "../types/events.js";
|
|
21
|
+
import type { PromptBuildContext, PromptSection } from "../prompt/types.js";
|
|
22
|
+
import type { Message, TokenUsage } from "../types/messages.js";
|
|
23
|
+
import type { RecentMessagesOptions as SessionRecentMessagesOptions } from "../storage/manager/types.js";
|
|
24
|
+
import type { ScopeSnapshot } from "../execution/scope/types.js";
|
|
25
|
+
import type { StreamChunk, StreamProvider } from "../types/stream.js";
|
|
26
|
+
import type { ToolContext } from "../types/tool.js";
|
|
27
|
+
import type { Tool } from "../tool/tool.js";
|
|
28
|
+
import type { ReasoningLevel } from "../models/reasoning/index.js";
|
|
29
|
+
import type { ApprovalCorrection } from "../safety/types.js";
|
|
30
|
+
import type { AgentContextFragmentBuildContext, AgentContextFragmentInput } from "../context/fragments/types.js";
|
|
31
|
+
/**
|
|
32
|
+
* Action returned by `beforeToolCall` — determines whether
|
|
33
|
+
* the tool call proceeds or is blocked.
|
|
34
|
+
*/
|
|
35
|
+
export interface ToolCallDecision {
|
|
36
|
+
/** Whether to allow or deny the tool call */
|
|
37
|
+
action: "allow" | "deny";
|
|
38
|
+
/** Reason for denial — returned to the model as the tool output */
|
|
39
|
+
reason?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Structured correction metadata for denied tool calls.
|
|
42
|
+
*
|
|
43
|
+
* Hosts and runtimes can persist this even though the model still receives
|
|
44
|
+
* a string tool result.
|
|
45
|
+
*/
|
|
46
|
+
correction?: ApprovalCorrection;
|
|
47
|
+
/**
|
|
48
|
+
* Rewritten tool arguments. When present, replaces the original
|
|
49
|
+
* args for the remainder of the execution pipeline (schema validation,
|
|
50
|
+
* baseline capture, and execution).
|
|
51
|
+
*
|
|
52
|
+
* Only meaningful when `action` is `"allow"`. Use this for path
|
|
53
|
+
* rewriting, sandbox prefixing, argument sanitization, or injecting
|
|
54
|
+
* default values — without the tool knowing about the transformation.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* beforeToolCall: async (tool, args, ctx) => {
|
|
59
|
+
* if (tool === "write_file") {
|
|
60
|
+
* const a = args as { path: string };
|
|
61
|
+
* return {
|
|
62
|
+
* action: "allow",
|
|
63
|
+
* args: { ...a, path: resolveSandboxPath(a.path) },
|
|
64
|
+
* };
|
|
65
|
+
* }
|
|
66
|
+
* return { action: "allow" };
|
|
67
|
+
* },
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
args?: unknown;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Mutable model invocation payload presented to middleware before an LLM call.
|
|
74
|
+
*/
|
|
75
|
+
export interface ModelCallInput {
|
|
76
|
+
model: LanguageModel;
|
|
77
|
+
system: string[];
|
|
78
|
+
messages: ModelMessage[];
|
|
79
|
+
temperature?: number;
|
|
80
|
+
topP?: number;
|
|
81
|
+
maxOutputTokens?: number;
|
|
82
|
+
maxSteps?: number;
|
|
83
|
+
reasoningLevel?: ReasoningLevel;
|
|
84
|
+
telemetry?: TelemetryOptions;
|
|
85
|
+
customStreamProvider?: StreamProvider;
|
|
86
|
+
toolExecutionMode?: "auto" | "plan";
|
|
87
|
+
/**
|
|
88
|
+
* Provider-specific options passed through to `streamText()`.
|
|
89
|
+
*
|
|
90
|
+
* Middleware can set these to enable provider features like Anthropic
|
|
91
|
+
* prompt caching (`{ anthropic: { cacheControl: { type: "ephemeral" } } }`).
|
|
92
|
+
*
|
|
93
|
+
* When multiple sources set providerOptions (e.g. middleware + reasoning),
|
|
94
|
+
* they are shallow-merged before the LLM call.
|
|
95
|
+
*/
|
|
96
|
+
providerOptions?: ProviderOptions;
|
|
97
|
+
/**
|
|
98
|
+
* System messages with provider-specific options.
|
|
99
|
+
*
|
|
100
|
+
* When set, these take precedence over the plain `system` strings.
|
|
101
|
+
* This allows middleware to attach per-message metadata such as
|
|
102
|
+
* Anthropic `cacheControl` breakpoints on system content.
|
|
103
|
+
*
|
|
104
|
+
* Leave undefined to use the plain `system` string array.
|
|
105
|
+
*/
|
|
106
|
+
systemMessages?: SystemModelMessage[];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Context shared across model middleware hooks for a single step.
|
|
110
|
+
*/
|
|
111
|
+
export interface ModelCallContext {
|
|
112
|
+
sessionID: string;
|
|
113
|
+
turnID?: string;
|
|
114
|
+
step: number;
|
|
115
|
+
cwd: string;
|
|
116
|
+
abort: AbortSignal;
|
|
117
|
+
model: LanguageModel;
|
|
118
|
+
toolNames: string[];
|
|
119
|
+
mcpToolNames: string[];
|
|
120
|
+
scope?: ScopeSnapshot;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Return this from `model.input(...)` to stop an LLM call entirely.
|
|
124
|
+
*/
|
|
125
|
+
export interface BlockedModelCall {
|
|
126
|
+
block: true;
|
|
127
|
+
reason: string;
|
|
128
|
+
}
|
|
129
|
+
/** Type guard for `BlockedModelCall`. */
|
|
130
|
+
export declare function isBlockedModelCall(value: ModelCallInput | BlockedModelCall): value is BlockedModelCall;
|
|
131
|
+
/**
|
|
132
|
+
* Final step result exposed to model middleware after the stream is processed.
|
|
133
|
+
*/
|
|
134
|
+
export interface ModelCallOutput {
|
|
135
|
+
text: string;
|
|
136
|
+
usage?: TokenUsage;
|
|
137
|
+
finishReason?: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Context shared across chat lifecycle hooks for a single turn.
|
|
141
|
+
*/
|
|
142
|
+
export interface ChatLifecycleContext {
|
|
143
|
+
sessionId: string;
|
|
144
|
+
turnId?: string;
|
|
145
|
+
history?: HistoryAccessor;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Options for reading a bounded slice of recent visible chat messages.
|
|
149
|
+
*/
|
|
150
|
+
export type RecentMessagesOptions = Pick<SessionRecentMessagesOptions, "limit" | "roles">;
|
|
151
|
+
/**
|
|
152
|
+
* Lazy chat-history accessor exposed to lifecycle middleware.
|
|
153
|
+
*
|
|
154
|
+
* The chat loop passes this accessor by reference; messages are only read and
|
|
155
|
+
* deserialized if middleware calls it.
|
|
156
|
+
*/
|
|
157
|
+
export interface HistoryAccessor {
|
|
158
|
+
getRecentMessages(options?: RecentMessagesOptions): Message[];
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Extended tool result returned by `afterToolCall` middleware.
|
|
162
|
+
*
|
|
163
|
+
* Same shape as `Tool.ExecuteResult` with an optional `supplement` —
|
|
164
|
+
* extra text appended to the tool output for model visibility.
|
|
165
|
+
*
|
|
166
|
+
* Use this to inject warnings, guidance, lint results, or annotations
|
|
167
|
+
* that the model should see alongside the tool's own output, without
|
|
168
|
+
* modifying the tool's result directly.
|
|
169
|
+
*
|
|
170
|
+
* When multiple middleware add supplements, each one receives the
|
|
171
|
+
* previous supplement (if any) and can extend or replace it.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* afterToolCall: async (tool, args, result) => {
|
|
176
|
+
* if (tool === "write_file") {
|
|
177
|
+
* const warnings = await lintFile(args.path);
|
|
178
|
+
* return { ...result, supplement: warnings };
|
|
179
|
+
* }
|
|
180
|
+
* return result;
|
|
181
|
+
* },
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
export interface ToolCallOutput extends Tool.ExecuteResult {
|
|
185
|
+
/**
|
|
186
|
+
* Supplementary text appended to the tool output for the model.
|
|
187
|
+
*
|
|
188
|
+
* Kept separate from `output` so the original tool result stays
|
|
189
|
+
* untouched. The executor merges this into the final output string
|
|
190
|
+
* before returning it to the model.
|
|
191
|
+
*/
|
|
192
|
+
supplement?: string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Optional model-specific hooks grouped under `middleware.model`.
|
|
196
|
+
*/
|
|
197
|
+
export interface AgentModelHooks {
|
|
198
|
+
/**
|
|
199
|
+
* Review or rewrite the model request before the LLM is invoked.
|
|
200
|
+
*
|
|
201
|
+
* Return:
|
|
202
|
+
* - `undefined` to keep the current request
|
|
203
|
+
* - a `ModelCallInput` object to replace the request
|
|
204
|
+
* - `{ block: true, reason }` to cancel the model call
|
|
205
|
+
*
|
|
206
|
+
* Hooks run in middleware array order. The first block stops the call.
|
|
207
|
+
*/
|
|
208
|
+
input?(input: ModelCallInput, ctx: ModelCallContext): Promise<ModelCallInput | BlockedModelCall | void>;
|
|
209
|
+
/**
|
|
210
|
+
* Review or rewrite raw stream chunks as they arrive from the model.
|
|
211
|
+
*
|
|
212
|
+
* Return:
|
|
213
|
+
* - `undefined` to keep the current chunk
|
|
214
|
+
* - a `StreamChunk` to replace it
|
|
215
|
+
* - `null` to drop it from downstream processing
|
|
216
|
+
*
|
|
217
|
+
* Hooks run in middleware array order.
|
|
218
|
+
*/
|
|
219
|
+
chunk?(chunk: StreamChunk, ctx: ModelCallContext): Promise<StreamChunk | null | void>;
|
|
220
|
+
/**
|
|
221
|
+
* Review or rewrite the fully processed model result for the current step.
|
|
222
|
+
*
|
|
223
|
+
* Hooks run in reverse middleware order so outer middleware sees the final
|
|
224
|
+
* shaped result, matching `afterToolCall(...)`.
|
|
225
|
+
*/
|
|
226
|
+
output?(output: ModelCallOutput, ctx: ModelCallContext): Promise<ModelCallOutput | void>;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Agent middleware — composable lifecycle hooks.
|
|
230
|
+
*
|
|
231
|
+
* All methods are optional. Implement only what you need.
|
|
232
|
+
*
|
|
233
|
+
* Ordering:
|
|
234
|
+
* - `beforeToolCall`: runs in array order, first "deny" wins
|
|
235
|
+
* - `afterToolCall`: runs in reverse order (innermost first)
|
|
236
|
+
* - `model.input`: runs in array order, first block wins
|
|
237
|
+
* - `model.chunk`: runs in array order on raw stream chunks
|
|
238
|
+
* - `model.output`: runs in reverse order
|
|
239
|
+
* - `promptSections`: all run, sections merged
|
|
240
|
+
* - `onEvent`: all run synchronously, errors logged, never blocks the stream
|
|
241
|
+
* - `onChatStart` / `onChatEnd`: run in array order, awaited sequentially
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* // A simple logging middleware
|
|
246
|
+
* const logger: AgentMiddleware = {
|
|
247
|
+
* name: "logger",
|
|
248
|
+
* beforeToolCall: async (tool, args) => {
|
|
249
|
+
* console.log(`→ ${tool}`, args);
|
|
250
|
+
* return { action: "allow" };
|
|
251
|
+
* },
|
|
252
|
+
* afterToolCall: async (tool, args, result) => {
|
|
253
|
+
* console.log(`← ${tool}`, result.title);
|
|
254
|
+
* return result;
|
|
255
|
+
* },
|
|
256
|
+
* };
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
259
|
+
export interface AgentMiddleware {
|
|
260
|
+
/** Middleware name (for logging and debugging) */
|
|
261
|
+
name: string;
|
|
262
|
+
/**
|
|
263
|
+
* Optional hooks for shaping model requests, raw stream chunks,
|
|
264
|
+
* and final step outputs.
|
|
265
|
+
*/
|
|
266
|
+
model?: AgentModelHooks;
|
|
267
|
+
/**
|
|
268
|
+
* Intercept a tool call before execution.
|
|
269
|
+
*
|
|
270
|
+
* Return `{ action: "allow" }` to proceed, or `{ action: "deny", reason }` to
|
|
271
|
+
* block the call. When denied, `reason` is returned to the model as the tool
|
|
272
|
+
* output so it can adjust its approach.
|
|
273
|
+
*
|
|
274
|
+
* Runs in array order. The first middleware that returns "deny" short-circuits
|
|
275
|
+
* the chain — remaining middleware and the tool itself are skipped.
|
|
276
|
+
*
|
|
277
|
+
* @param tool - Tool name (e.g. "bash", "write_file")
|
|
278
|
+
* @param args - Parsed tool arguments
|
|
279
|
+
* @param ctx - Tool execution context (cwd, sessionID, host, etc.)
|
|
280
|
+
*/
|
|
281
|
+
beforeToolCall?(tool: string, args: unknown, ctx: ToolContext): Promise<ToolCallDecision>;
|
|
282
|
+
/**
|
|
283
|
+
* Transform or observe a tool result after execution.
|
|
284
|
+
*
|
|
285
|
+
* Receives the result and must return a result (can be the same object
|
|
286
|
+
* or a modified copy). Runs in reverse array order so the outermost
|
|
287
|
+
* middleware sees the final transformed result.
|
|
288
|
+
*
|
|
289
|
+
* @param tool - Tool name
|
|
290
|
+
* @param args - Original tool arguments
|
|
291
|
+
* @param result - Tool execution result
|
|
292
|
+
* @param ctx - Tool execution context
|
|
293
|
+
*/
|
|
294
|
+
afterToolCall?(tool: string, args: unknown, result: ToolCallOutput, ctx: ToolContext): Promise<ToolCallOutput>;
|
|
295
|
+
/**
|
|
296
|
+
* Inject dynamic prompt sections at build time.
|
|
297
|
+
*
|
|
298
|
+
* Called during `PromptBuilder.build()` for each middleware. Return one
|
|
299
|
+
* or more sections to inject into the system prompt. Return `undefined`
|
|
300
|
+
* or an empty array to inject nothing.
|
|
301
|
+
*
|
|
302
|
+
* Sections follow the same priority system as static sections — use
|
|
303
|
+
* `priority` to control placement relative to base template (10),
|
|
304
|
+
* environment (20), instructions (30), custom (50), skills (70),
|
|
305
|
+
* and per-turn overrides (90).
|
|
306
|
+
*
|
|
307
|
+
* @param ctx - Build context with cwd, model, toolNames, sessionId
|
|
308
|
+
*/
|
|
309
|
+
promptSections?(ctx: PromptBuildContext): PromptSection | PromptSection[] | undefined;
|
|
310
|
+
/**
|
|
311
|
+
* Inject typed model-visible context messages before each model step.
|
|
312
|
+
*
|
|
313
|
+
* Use this for runtime/session context that should be distinguishable from
|
|
314
|
+
* normal user conversation: environment snapshots, memory recall, workflow
|
|
315
|
+
* hints, or hook-added context. Returned context fragments are transient
|
|
316
|
+
* unless the caller also persists them through
|
|
317
|
+
* `SessionManager.addContextFragment(...)`.
|
|
318
|
+
*/
|
|
319
|
+
contextFragments?(ctx: AgentContextFragmentBuildContext): AgentContextFragmentInput | AgentContextFragmentInput[] | undefined | Promise<AgentContextFragmentInput | AgentContextFragmentInput[] | undefined>;
|
|
320
|
+
/**
|
|
321
|
+
* Observe agent events (read-only, non-blocking).
|
|
322
|
+
*
|
|
323
|
+
* Fires for every event emitted during `chat()`. Errors thrown by
|
|
324
|
+
* handlers are caught and logged — they never interrupt the stream.
|
|
325
|
+
*
|
|
326
|
+
* This is intentionally synchronous (void return) to prevent
|
|
327
|
+
* event observers from blocking the streaming pipeline.
|
|
328
|
+
*
|
|
329
|
+
* @param event - The agent event
|
|
330
|
+
*/
|
|
331
|
+
onEvent?(event: AgentEvent): void;
|
|
332
|
+
/**
|
|
333
|
+
* Called when `chat()` starts, before the LLM stream is created.
|
|
334
|
+
*
|
|
335
|
+
* Use this for setup: initializing loggers, recording start time,
|
|
336
|
+
* resetting per-turn state, etc. Runs in array order, awaited
|
|
337
|
+
* sequentially.
|
|
338
|
+
*
|
|
339
|
+
* @param sessionId - Session identifier
|
|
340
|
+
* @param message - The user message being sent
|
|
341
|
+
*/
|
|
342
|
+
onChatStart?(sessionId: string, message: string, ctx?: ChatLifecycleContext): Promise<void>;
|
|
343
|
+
/**
|
|
344
|
+
* Called when `chat()` completes (or errors), after all events
|
|
345
|
+
* have been yielded.
|
|
346
|
+
*
|
|
347
|
+
* Use this for teardown: flushing logs, recording metrics, etc.
|
|
348
|
+
* Runs in array order, awaited sequentially. Always called, even
|
|
349
|
+
* if the stream errored.
|
|
350
|
+
*
|
|
351
|
+
* Turn-scoped tool cleanup runs after `onChatEnd`, so middleware can still
|
|
352
|
+
* inspect the just-resolved turn tool objects during this hook.
|
|
353
|
+
*
|
|
354
|
+
* @param sessionId - Session identifier
|
|
355
|
+
* @param result - Completion info (usage stats and optional error)
|
|
356
|
+
*/
|
|
357
|
+
onChatEnd?(sessionId: string, result: {
|
|
358
|
+
usage?: TokenUsage;
|
|
359
|
+
error?: Error;
|
|
360
|
+
output?: string;
|
|
361
|
+
}, ctx?: ChatLifecycleContext): Promise<void>;
|
|
362
|
+
/**
|
|
363
|
+
* Get the active OTel context for a session.
|
|
364
|
+
*
|
|
365
|
+
* Used internally by the LLM layer to wrap `streamText()` so that
|
|
366
|
+
* AI SDK spans are nested under the middleware's parent span.
|
|
367
|
+
* Only implemented by the `otelMiddleware`.
|
|
368
|
+
*/
|
|
369
|
+
getOtelContext?(sessionId: string, ctx?: ChatLifecycleContext): unknown;
|
|
370
|
+
}
|
|
371
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/middleware/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,IAAI,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AACzG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;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