@cuylabs/agent-core 4.9.0 → 5.0.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 +33 -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 +42 -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 +182 -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 +76 -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 +45 -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 +18 -0
- package/dist/agent/turn-context/compaction/memory.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/results.d.ts +25 -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 +30 -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 +206 -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-346FIYKT.js +960 -0
- package/dist/{chunk-HSUPTXNV.js → chunk-556CPZ3J.js} +13 -10
- package/dist/chunk-AHDCR7SX.js +83 -0
- package/dist/{chunk-CSR75JVC.js → chunk-ASXF5AC6.js} +1 -1
- package/dist/{chunk-BJC46FIF.js → chunk-BKHWKKSG.js} +2 -2
- package/dist/{chunk-2TTOLHBT.js → chunk-CFBSQLP5.js} +1 -1
- package/dist/chunk-CGP6UNCQ.js +554 -0
- package/dist/{chunk-GJFP5L2V.js → chunk-CNM6OROH.js} +15 -3
- package/dist/chunk-DD7S7ZG4.js +274 -0
- package/dist/chunk-DYZGHHDB.js +1458 -0
- package/dist/chunk-E66PKKDL.js +772 -0
- package/dist/{chunk-H3GRHFFG.js → chunk-EDKZOPUV.js} +63 -306
- package/dist/{chunk-GEBFHREI.js → chunk-GHVW7L4P.js} +71 -5
- 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-MJRZ2ZRI.js +498 -0
- package/dist/{chunk-UMIVJDEJ.js → chunk-SAWRDGBE.js} +30 -7
- package/dist/chunk-TYQWH6XH.js +88 -0
- 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-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 +64 -0
- package/dist/context/assembly/types.d.ts.map +1 -0
- package/dist/context/config.d.ts +20 -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 +12 -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 +96 -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 +135 -0
- package/dist/context/window/budget.d.ts.map +1 -0
- package/dist/context/window/compactor.d.ts +89 -0
- package/dist/context/window/compactor.d.ts.map +1 -0
- package/dist/context/window/cut-planner.d.ts +67 -0
- package/dist/context/window/cut-planner.d.ts.map +1 -0
- package/dist/context/window/decision.d.ts +50 -0
- package/dist/context/window/decision.d.ts.map +1 -0
- package/dist/context/window/estimation.d.ts +60 -0
- package/dist/context/window/estimation.d.ts.map +1 -0
- package/dist/context/window/index.d.ts +28 -0
- package/dist/context/window/index.d.ts.map +1 -0
- package/dist/context/window/manager.d.ts +113 -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 +65 -0
- package/dist/context/window/summary.d.ts.map +1 -0
- package/dist/context/window/tool-pruning.d.ts +73 -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 +2681 -1859
- 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 +251 -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 +25 -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 +115 -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 +426 -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/sessions/index.d.ts +13 -0
- package/dist/sessions/index.d.ts.map +1 -0
- package/dist/{storage → sessions}/index.js +6 -17
- package/dist/sessions/manager/default.d.ts +11 -0
- package/dist/sessions/manager/default.d.ts.map +1 -0
- package/dist/sessions/manager/index.d.ts +12 -0
- package/dist/sessions/manager/index.d.ts.map +1 -0
- package/dist/sessions/manager/session-manager.d.ts +67 -0
- package/dist/sessions/manager/session-manager.d.ts.map +1 -0
- package/dist/sessions/manager/types.d.ts +42 -0
- package/dist/sessions/manager/types.d.ts.map +1 -0
- package/dist/sessions/store/lock.d.ts +18 -0
- package/dist/sessions/store/lock.d.ts.map +1 -0
- package/dist/sessions/store/memory.d.ts +22 -0
- package/dist/sessions/store/memory.d.ts.map +1 -0
- package/dist/sessions/types.d.ts +215 -0
- package/dist/sessions/types.d.ts.map +1 -0
- package/dist/sessions/utils.d.ts +77 -0
- package/dist/sessions/utils.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/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 +191 -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 +196 -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 +49 -12
- 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/storage/index.d.ts +0 -191
- 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
package/dist/events/index.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signal — typed multi-consumer event dispatch for agent-core.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { createAgent, LocalSignal } from "@cuylabs/agent-core";
|
|
7
|
+
*
|
|
8
|
+
* const agent = createAgent({ model, signal: new LocalSignal() });
|
|
9
|
+
*
|
|
10
|
+
* // Subscribe before kicking off a chat
|
|
11
|
+
* const off = agent.signal.on("text-delta", (e) => process.stdout.write(e.text));
|
|
12
|
+
* await agent.send("s1", "hello");
|
|
13
|
+
* off();
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export type { AgentSignal } from "./types.js";
|
|
17
|
+
export { LocalSignal } from "./local.js";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/signal/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalSignal — in-process event dispatch.
|
|
3
|
+
*
|
|
4
|
+
* Dispatches events synchronously via direct function calls.
|
|
5
|
+
* Zero dependencies, zero serialization, zero network.
|
|
6
|
+
*
|
|
7
|
+
* Handler errors are caught silently — a broken listener must never
|
|
8
|
+
* interrupt the agent's streaming pipeline.
|
|
9
|
+
*/
|
|
10
|
+
import type { AgentEvent } from "../../types/events.js";
|
|
11
|
+
import type { AgentSignal, TypedHandler, Unsubscribe, WildcardHandler } from "./types.js";
|
|
12
|
+
export declare class LocalSignal implements AgentSignal {
|
|
13
|
+
/** type → Set<handler> for typed subscriptions */
|
|
14
|
+
private readonly typed;
|
|
15
|
+
/** handlers that receive every event */
|
|
16
|
+
private readonly wildcard;
|
|
17
|
+
on<T extends AgentEvent["type"]>(type: T, handler: TypedHandler<T>): Unsubscribe;
|
|
18
|
+
onAny(handler: WildcardHandler): Unsubscribe;
|
|
19
|
+
emit(event: AgentEvent): void;
|
|
20
|
+
clear(): void;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/events/signal/local.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EACV,WAAW,EAEX,YAAY,EACZ,WAAW,EACX,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,WAAY,YAAW,WAAW;IAC7C,kDAAkD;IAClD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuD;IAC7E,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8B;IAEvD,EAAE,CAAC,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,EAC7B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,WAAW;IAiBd,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,WAAW;IAO5C,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAuB7B,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Signal — typed event dispatch interface.
|
|
3
|
+
*
|
|
4
|
+
* Defines how consumers subscribe to {@link AgentEvent}s without being
|
|
5
|
+
* part of the middleware stack. Each Agent owns a signal; events are
|
|
6
|
+
* scoped to that agent instance.
|
|
7
|
+
*
|
|
8
|
+
* The default implementation (`LocalSignal`) dispatches in-process via
|
|
9
|
+
* plain function calls. A distributed runtime can supply its own
|
|
10
|
+
* implementation that bridges to external infrastructure.
|
|
11
|
+
*/
|
|
12
|
+
import type { AgentEvent } from "../../types/events.js";
|
|
13
|
+
/**
|
|
14
|
+
* Extract a single variant from the AgentEvent union by its `type` tag.
|
|
15
|
+
*/
|
|
16
|
+
export type EventOf<T extends AgentEvent["type"]> = Extract<AgentEvent, {
|
|
17
|
+
type: T;
|
|
18
|
+
}>;
|
|
19
|
+
/** Handler for a specific event type. */
|
|
20
|
+
export type TypedHandler<T extends AgentEvent["type"]> = (event: EventOf<T>) => void;
|
|
21
|
+
/** Handler that receives every event regardless of type. */
|
|
22
|
+
export type WildcardHandler = (event: AgentEvent) => void;
|
|
23
|
+
/** Call to remove a previously registered handler. */
|
|
24
|
+
export type Unsubscribe = () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Typed, multi-consumer event dispatch.
|
|
27
|
+
*
|
|
28
|
+
* Subscribe to agent events from anywhere — SSE routes, TUI renderers,
|
|
29
|
+
* plugins, tests. The interface is deliberately minimal so that backend
|
|
30
|
+
* implementations (in-process, Dapr, Redis, …) have a small contract to
|
|
31
|
+
* fulfil.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Subscribe to a specific event
|
|
36
|
+
* const off = agent.signal.on("text-delta", (e) => process.stdout.write(e.text));
|
|
37
|
+
*
|
|
38
|
+
* // Subscribe to everything
|
|
39
|
+
* const off2 = agent.signal.onAny((e) => logger.info(e.type));
|
|
40
|
+
*
|
|
41
|
+
* // Clean up
|
|
42
|
+
* off();
|
|
43
|
+
* off2();
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export interface AgentSignal {
|
|
47
|
+
/**
|
|
48
|
+
* Subscribe to a specific event type.
|
|
49
|
+
*
|
|
50
|
+
* @returns An unsubscribe function.
|
|
51
|
+
*/
|
|
52
|
+
on<T extends AgentEvent["type"]>(type: T, handler: TypedHandler<T>): Unsubscribe;
|
|
53
|
+
/**
|
|
54
|
+
* Subscribe to all events.
|
|
55
|
+
*
|
|
56
|
+
* @returns An unsubscribe function.
|
|
57
|
+
*/
|
|
58
|
+
onAny(handler: WildcardHandler): Unsubscribe;
|
|
59
|
+
/**
|
|
60
|
+
* Dispatch an event to every matching handler.
|
|
61
|
+
*
|
|
62
|
+
* Called internally by the Agent — but nothing prevents external code
|
|
63
|
+
* from injecting a synthetic event (useful for testing or bridging).
|
|
64
|
+
*/
|
|
65
|
+
emit(event: AgentEvent): void;
|
|
66
|
+
/** Remove all handlers. Called during agent disposal. */
|
|
67
|
+
clear(): void;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/events/signal/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAMxD;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,IAAI,OAAO,CACzD,UAAU,EACV;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CACZ,CAAC;AAEF,yCAAyC;AACzC,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,IAAI,CACvD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KACd,IAAI,CAAC;AAEV,4DAA4D;AAC5D,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;AAE1D,sDAAsD;AACtD,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC;AAMrC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,EAAE,CAAC,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,EAC7B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,WAAW,CAAC;IAEf;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,WAAW,CAAC;IAE7C;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IAE9B,0DAA0D;IAC1D,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -1,482 +1,34 @@
|
|
|
1
|
-
import { e as AnyInferenceResult, cO as StepProcessingOptions, cP as StepProcessingOutput, a9 as AgentTurnStepCommitSnapshot, aM as CreateAgentTurnStepCommitBatchOptions, $ as AgentTurnCommitBatch, c8 as PrepareModelStepOptions, c9 as PreparedAgentModelStep, cm as RunModelStepOptions, A as AgentEvent, cn as RunToolBatchOptions, co as RunToolBatchResult, aC as CommitOutputOptions, aD as CommitStepOptions, du as TokenUsage, x as ScopeSnapshot, a7 as AgentTurnState, dB as ToolMetadata, ab as AgentTurnStepCommitToolResult, aa as AgentTurnStepCommitToolCall, M as Message, dI as UserMessage, ay as AssistantMessage, dA as ToolMessage, cZ as SystemMessage } from '../instance-Bg61WSyz.js';
|
|
2
|
-
export { V as AgentTurnActiveToolCall, Y as AgentTurnBoundaryMetadata, Z as AgentTurnBoundarySnapshot, _ as AgentTurnCommitApplier, a0 as AgentTurnCommitOptions, a1 as AgentTurnEngine, a2 as AgentTurnEngineOptions, a3 as AgentTurnPhase, a4 as AgentTurnResolvedToolCall, a8 as AgentTurnStateAdvanceOptions, ac as AgentTurnStepRuntimeConfig, aL as CreateAgentTurnStateOptions, dL as advanceAgentTurnState, dP as createAgentTurnEngine, dQ as createAgentTurnState, dX as failAgentTurnState } from '../instance-Bg61WSyz.js';
|
|
3
|
-
import { L as Logger } from '../types-RSCv7nQ4.js';
|
|
4
|
-
export { c as convertAgentMessagesToModelMessages } from '../model-messages-n_ZMZwIm.js';
|
|
5
|
-
import '../types-C_LCeYNg.js';
|
|
6
|
-
import 'ai';
|
|
7
|
-
import 'zod';
|
|
8
|
-
import '../types-CQaXbRsS.js';
|
|
9
|
-
import '../types-DMjoFKKv.js';
|
|
10
|
-
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
11
|
-
import '@modelcontextprotocol/sdk/types.js';
|
|
12
|
-
import '@ai-sdk/provider-utils';
|
|
13
|
-
import '../sandbox/index.js';
|
|
14
|
-
import '../llm-error-D93FNNLY.js';
|
|
15
|
-
|
|
16
1
|
/**
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
declare function runModelStep(options: RunModelStepOptions): AsyncGenerator<AgentEvent, StepProcessingOutput>;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Execute planned tool calls outside the AI SDK loop.
|
|
54
|
-
*
|
|
55
|
-
* When multiple tool calls are pending, the batch is partitioned:
|
|
56
|
-
* - Tools that declare `capabilities.parallelSafe` run concurrently
|
|
57
|
-
* - All other tools run serially (in original order)
|
|
58
|
-
*
|
|
59
|
-
* Serial tools always run after the parallel batch completes, preserving
|
|
60
|
-
* the invariant that non-parallel-safe tools never overlap with anything.
|
|
61
|
-
*/
|
|
62
|
-
declare function runToolBatch(options: RunToolBatchOptions): Promise<RunToolBatchResult>;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Persist the assistant tool-call message and tool-result messages for a step.
|
|
66
|
-
*/
|
|
67
|
-
declare function commitStep(options: CommitStepOptions): AsyncGenerator<AgentEvent, boolean>;
|
|
68
|
-
/**
|
|
69
|
-
* Persist the final assistant output for a turn.
|
|
70
|
-
*/
|
|
71
|
-
declare function commitOutput(options: CommitOutputOptions): AsyncGenerator<AgentEvent, boolean>;
|
|
72
|
-
|
|
73
|
-
interface AgentTaskPayload {
|
|
74
|
-
/** Prompt/message passed to the agent. */
|
|
75
|
-
message: string;
|
|
76
|
-
/** Optional explicit session id. If omitted, a runtime session id is generated. */
|
|
77
|
-
sessionId?: string;
|
|
78
|
-
/** Optional per-run system override forwarded to agent.chat(). */
|
|
79
|
-
system?: string;
|
|
80
|
-
}
|
|
81
|
-
interface AgentTaskExecutionContext {
|
|
82
|
-
/** Abort signal propagated to agent.chat(). */
|
|
83
|
-
signal?: AbortSignal;
|
|
84
|
-
/** Stable identifier for this task execution when supplied by the caller. */
|
|
85
|
-
executionId?: string;
|
|
86
|
-
/** Optional trigger descriptor from caller (for logging/routing). */
|
|
87
|
-
trigger?: string;
|
|
88
|
-
/**
|
|
89
|
-
* Optional stable key used when auto-generating session ids.
|
|
90
|
-
* For scheduled jobs, a job ID is a good candidate.
|
|
91
|
-
*/
|
|
92
|
-
fallbackSessionKey?: string;
|
|
93
|
-
/**
|
|
94
|
-
* Optional prior execution state to resume from. When provided, the task
|
|
95
|
-
* runner restores accumulated response, usage, tool results, and step
|
|
96
|
-
* counter from this snapshot before streaming the next agent.chat() turn.
|
|
97
|
-
*
|
|
98
|
-
* This enables runtime providers (e.g. Dapr) to implement crash recovery
|
|
99
|
-
* on the direct (non-workflow) execution path: load the last checkpoint
|
|
100
|
-
* from the execution store, then re-run with `restoreFrom` so the turn
|
|
101
|
-
* continues from where it left off rather than starting fresh.
|
|
102
|
-
*
|
|
103
|
-
* The snapshot only provides accumulated bookkeeping — the actual
|
|
104
|
-
* conversation context is recovered through the session storage layer
|
|
105
|
-
* (same sessionId → same persisted messages).
|
|
106
|
-
*/
|
|
107
|
-
restoreFrom?: AgentTaskResumeSnapshot;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Portable snapshot of prior execution state used for resume.
|
|
111
|
-
*
|
|
112
|
-
* This is intentionally a minimal subset — just enough for the task runner
|
|
113
|
-
* to restore its accumulators. The full `AgentTaskExecutionSnapshot` (with
|
|
114
|
-
* turn state, events, scope) lives in the runtime provider's execution store.
|
|
115
|
-
*/
|
|
116
|
-
interface AgentTaskResumeSnapshot {
|
|
117
|
-
/** Accumulated response text from prior execution. */
|
|
118
|
-
response: string;
|
|
119
|
-
/** Accumulated token usage from prior execution. */
|
|
120
|
-
usage: TokenUsage;
|
|
121
|
-
/** Tool calls completed in the prior execution. */
|
|
122
|
-
toolCalls: Array<{
|
|
123
|
-
name: string;
|
|
124
|
-
result: unknown;
|
|
125
|
-
}>;
|
|
126
|
-
/** Step counter to resume from. */
|
|
127
|
-
step: number;
|
|
128
|
-
/** Event counter to resume from. */
|
|
129
|
-
eventCount: number;
|
|
130
|
-
/** ISO timestamp of the original execution start. */
|
|
131
|
-
startedAt: string;
|
|
132
|
-
}
|
|
133
|
-
interface AgentTaskResult {
|
|
134
|
-
response: string;
|
|
135
|
-
sessionId: string;
|
|
136
|
-
usage: TokenUsage;
|
|
137
|
-
toolCalls: Array<{
|
|
138
|
-
name: string;
|
|
139
|
-
result: unknown;
|
|
140
|
-
}>;
|
|
141
|
-
}
|
|
142
|
-
type AgentTaskRunner<TPayload extends AgentTaskPayload = AgentTaskPayload> = (payload: TPayload, context?: AgentTaskExecutionContext) => Promise<AgentTaskResult>;
|
|
143
|
-
/**
|
|
144
|
-
* Minimal chat surface required by `createAgentTaskRunner(...)`.
|
|
145
|
-
*
|
|
146
|
-
* The concrete `Agent` class already satisfies this contract. Keeping the
|
|
147
|
-
* requirement this small makes runtime integration easier to test and reuse.
|
|
148
|
-
*/
|
|
149
|
-
interface AgentTaskChatAdapter {
|
|
150
|
-
chat(sessionId: string, message: string, options?: {
|
|
151
|
-
abort?: AbortSignal;
|
|
152
|
-
system?: string;
|
|
153
|
-
}): AsyncIterable<AgentEvent>;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
type AgentTaskCheckpointReason = "task-start" | "input-commit-start" | "input-commit-finish" | "intervention-commit-start" | "intervention-commit-finish" | "step-finish" | "step-commit-start" | "step-commit-finish" | "tool-result" | "tool-error" | "output-commit-start" | "output-commit-finish" | "task-complete" | "task-error";
|
|
157
|
-
interface AgentTaskExecutionRun<TPayload extends AgentTaskPayload = AgentTaskPayload> {
|
|
158
|
-
payload: Readonly<TPayload>;
|
|
159
|
-
context: Readonly<AgentTaskExecutionContext>;
|
|
160
|
-
sessionId: string;
|
|
161
|
-
executionId: string;
|
|
162
|
-
startedAt: string;
|
|
163
|
-
scope?: ScopeSnapshot;
|
|
164
|
-
}
|
|
165
|
-
interface AgentTaskExecutionSnapshot {
|
|
166
|
-
sessionId: string;
|
|
167
|
-
response: string;
|
|
168
|
-
usage: TokenUsage;
|
|
169
|
-
toolCalls: Array<{
|
|
170
|
-
name: string;
|
|
171
|
-
result: unknown;
|
|
172
|
-
}>;
|
|
173
|
-
eventCount: number;
|
|
174
|
-
activeStep?: number;
|
|
175
|
-
lastEvent?: AgentEvent;
|
|
176
|
-
error?: string;
|
|
177
|
-
startedAt: string;
|
|
178
|
-
updatedAt: string;
|
|
179
|
-
turnState: AgentTurnState;
|
|
180
|
-
scope?: ScopeSnapshot;
|
|
181
|
-
}
|
|
182
|
-
interface AgentTaskExecutionCheckpoint<TPayload extends AgentTaskPayload = AgentTaskPayload> {
|
|
183
|
-
run: AgentTaskExecutionRun<TPayload>;
|
|
184
|
-
reason: AgentTaskCheckpointReason;
|
|
185
|
-
snapshot: AgentTaskExecutionSnapshot;
|
|
186
|
-
event?: AgentEvent;
|
|
187
|
-
createdAt: string;
|
|
188
|
-
}
|
|
189
|
-
interface AgentTaskObserver<TPayload extends AgentTaskPayload = AgentTaskPayload> {
|
|
190
|
-
onTaskStart?(run: AgentTaskExecutionRun<TPayload>, snapshot: AgentTaskExecutionSnapshot): void | Promise<void>;
|
|
191
|
-
onTaskEvent?(run: AgentTaskExecutionRun<TPayload>, event: AgentEvent, snapshot: AgentTaskExecutionSnapshot): void | Promise<void>;
|
|
192
|
-
onCheckpoint?(checkpoint: AgentTaskExecutionCheckpoint<TPayload>): void | Promise<void>;
|
|
193
|
-
onTaskComplete?(run: AgentTaskExecutionRun<TPayload>, result: AgentTaskResult, snapshot: AgentTaskExecutionSnapshot): void | Promise<void>;
|
|
194
|
-
onTaskError?(run: AgentTaskExecutionRun<TPayload>, error: Error, snapshot: AgentTaskExecutionSnapshot): void | Promise<void>;
|
|
195
|
-
/**
|
|
196
|
-
* Get the active OTel context for a session.
|
|
197
|
-
*
|
|
198
|
-
* Used for trace context propagation between layers — e.g. the
|
|
199
|
-
* workflow bridge retrieves the observer's span context and injects
|
|
200
|
-
* it into activities so child spans (AI SDK, tool calls) are
|
|
201
|
-
* correlated under the observer's root span.
|
|
202
|
-
*/
|
|
203
|
-
getOtelContext?(sessionId: string, executionId?: string): unknown;
|
|
204
|
-
/**
|
|
205
|
-
* Activate the OTel context for a session around a function call.
|
|
206
|
-
*
|
|
207
|
-
* Used by the task runner to ensure child spans (from middleware,
|
|
208
|
-
* AI SDK) are parented under the observer's root span in direct
|
|
209
|
-
* execution mode. The observer wraps `fn` in `context.with()` so
|
|
210
|
-
* that `context.active()` returns the session's trace context.
|
|
211
|
-
*/
|
|
212
|
-
activateContext?<T>(sessionId: string, executionId: string, fn: () => T): T;
|
|
213
|
-
}
|
|
214
|
-
interface AgentTaskCheckpointStrategyInput<TPayload extends AgentTaskPayload = AgentTaskPayload> {
|
|
215
|
-
run: AgentTaskExecutionRun<TPayload>;
|
|
216
|
-
event: AgentEvent;
|
|
217
|
-
snapshot: AgentTaskExecutionSnapshot;
|
|
218
|
-
}
|
|
219
|
-
type AgentTaskCheckpointStrategy<TPayload extends AgentTaskPayload = AgentTaskPayload> = (input: AgentTaskCheckpointStrategyInput<TPayload>) => AgentTaskCheckpointReason | undefined;
|
|
220
|
-
/**
|
|
221
|
-
* Default checkpoint strategy for runtime integrations.
|
|
222
|
-
*
|
|
223
|
-
* This intentionally checkpoints at coarse-grained boundaries that are useful
|
|
224
|
-
* for external runtimes and durable adapters without creating excessive churn:
|
|
225
|
-
* - step completion
|
|
226
|
-
* - tool results/errors
|
|
227
|
-
* - task completion
|
|
228
|
-
*/
|
|
229
|
-
declare function defaultAgentTaskCheckpointStrategy<TPayload extends AgentTaskPayload = AgentTaskPayload>(input: AgentTaskCheckpointStrategyInput<TPayload>): AgentTaskCheckpointReason | undefined;
|
|
230
|
-
|
|
231
|
-
interface AgentTaskRunnerOptions<TPayload extends AgentTaskPayload = AgentTaskPayload> {
|
|
232
|
-
/** Prefix used for generated runtime session IDs. Defaults to "runtime". */
|
|
233
|
-
sessionPrefix?: string;
|
|
234
|
-
/**
|
|
235
|
-
* Optional callback for resolving session IDs from payload/context.
|
|
236
|
-
* Ignored when payload.sessionId is provided.
|
|
237
|
-
*/
|
|
238
|
-
resolveSessionId?: (payload: TPayload, context: AgentTaskExecutionContext) => string | undefined;
|
|
239
|
-
/**
|
|
240
|
-
* Optional execution observers. These are generic lifecycle hooks that can be
|
|
241
|
-
* consumed by runtime adapters (in-memory, Dapr, queues, etc.) without
|
|
242
|
-
* introducing infrastructure dependencies into `@cuylabs/agent-core`.
|
|
243
|
-
*/
|
|
244
|
-
observers?: AgentTaskObserver<TPayload>[];
|
|
245
|
-
/**
|
|
246
|
-
* Optional checkpoint strategy for converting streamed agent events into
|
|
247
|
-
* coarse-grained execution checkpoints. Defaults to
|
|
248
|
-
* `defaultAgentTaskCheckpointStrategy(...)`.
|
|
249
|
-
*/
|
|
250
|
-
checkpointStrategy?: AgentTaskCheckpointStrategy<TPayload>;
|
|
251
|
-
/** Logger for diagnostic output. Defaults to silent. */
|
|
252
|
-
logger?: Logger;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Create a reusable task runner that maps generic task payloads to `agent.chat()`.
|
|
256
|
-
*
|
|
257
|
-
* This helper is intentionally infrastructure-agnostic. It can be used by any
|
|
258
|
-
* runtime/orchestration package (in-memory, Dapr, queues, cron, etc.) without
|
|
259
|
-
* introducing infrastructure dependencies into `@cuylabs/agent-core`.
|
|
260
|
-
*
|
|
261
|
-
* The runner also exposes a neutral execution observer/checkpoint surface so
|
|
262
|
-
* external runtimes can persist progress, react to lifecycle events, or map
|
|
263
|
-
* streamed execution milestones into their own durability layer.
|
|
264
|
-
*/
|
|
265
|
-
declare function createAgentTaskRunner<TPayload extends AgentTaskPayload = AgentTaskPayload>(agent: AgentTaskChatAdapter, options?: AgentTaskRunnerOptions<TPayload>): AgentTaskRunner<TPayload>;
|
|
266
|
-
|
|
267
|
-
interface AgentWorkflowToolCallSnapshot {
|
|
268
|
-
toolCallId: string;
|
|
269
|
-
toolName: string;
|
|
270
|
-
args: unknown;
|
|
271
|
-
}
|
|
272
|
-
interface AgentWorkflowUserMessageSnapshot {
|
|
273
|
-
id: string;
|
|
274
|
-
role: "user";
|
|
275
|
-
createdAt: string;
|
|
276
|
-
content: string;
|
|
277
|
-
system?: string;
|
|
278
|
-
}
|
|
279
|
-
interface AgentWorkflowAssistantMessageSnapshot {
|
|
280
|
-
id: string;
|
|
281
|
-
role: "assistant";
|
|
282
|
-
createdAt: string;
|
|
283
|
-
content: string;
|
|
284
|
-
finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
285
|
-
tokens?: TokenUsage;
|
|
286
|
-
cost?: number;
|
|
287
|
-
error?: {
|
|
288
|
-
name: string;
|
|
289
|
-
message: string;
|
|
290
|
-
code?: string;
|
|
291
|
-
status?: number;
|
|
292
|
-
};
|
|
293
|
-
toolCalls?: AgentWorkflowToolCallSnapshot[];
|
|
294
|
-
}
|
|
295
|
-
interface AgentWorkflowToolMessageSnapshot {
|
|
296
|
-
id: string;
|
|
297
|
-
role: "tool";
|
|
298
|
-
createdAt: string;
|
|
299
|
-
content: string;
|
|
300
|
-
toolCallId: string;
|
|
301
|
-
toolName: string;
|
|
302
|
-
result: unknown;
|
|
303
|
-
metadata?: ToolMetadata;
|
|
304
|
-
compactedAt?: number;
|
|
305
|
-
}
|
|
306
|
-
interface AgentWorkflowSystemMessageSnapshot {
|
|
307
|
-
id: string;
|
|
308
|
-
role: "system";
|
|
309
|
-
createdAt: string;
|
|
310
|
-
content: string;
|
|
311
|
-
}
|
|
312
|
-
type AgentWorkflowMessageSnapshot = AgentWorkflowUserMessageSnapshot | AgentWorkflowAssistantMessageSnapshot | AgentWorkflowToolMessageSnapshot | AgentWorkflowSystemMessageSnapshot;
|
|
313
|
-
type AgentWorkflowTurnPhase = "input-commit" | "model-step" | "tool-batch" | "step-commit" | "output-commit" | "completed" | "failed";
|
|
314
|
-
interface AgentWorkflowReplayDecision {
|
|
315
|
-
toolCallId: string;
|
|
316
|
-
toolName: string;
|
|
317
|
-
action: "replay" | "skip";
|
|
318
|
-
source: "policy" | "runtime" | "operator";
|
|
319
|
-
decidedAt: string;
|
|
320
|
-
reason?: string;
|
|
321
|
-
}
|
|
322
|
-
interface AgentWorkflowModelStepResult {
|
|
323
|
-
text: string;
|
|
324
|
-
usage?: TokenUsage;
|
|
325
|
-
finishReason?: string;
|
|
326
|
-
turnState: AgentTurnState;
|
|
327
|
-
stepCommit?: AgentTurnStepCommitSnapshot;
|
|
328
|
-
}
|
|
329
|
-
interface AgentWorkflowCommitResult {
|
|
330
|
-
messages: AgentWorkflowMessageSnapshot[];
|
|
331
|
-
}
|
|
332
|
-
interface AgentWorkflowToolBatchResult {
|
|
333
|
-
stepCommit: AgentTurnStepCommitSnapshot;
|
|
334
|
-
turnState?: AgentTurnState;
|
|
335
|
-
}
|
|
336
|
-
interface AgentWorkflowToolCallResult {
|
|
337
|
-
toolResult: AgentTurnStepCommitToolResult;
|
|
338
|
-
turnState?: AgentTurnState;
|
|
339
|
-
}
|
|
340
|
-
interface AgentWorkflowInterventionSnapshot {
|
|
341
|
-
id: string;
|
|
342
|
-
message: string;
|
|
343
|
-
createdAt: string;
|
|
344
|
-
}
|
|
345
|
-
interface AgentWorkflowTurnState {
|
|
346
|
-
sessionId: string;
|
|
347
|
-
systemPrompts: string[];
|
|
348
|
-
messages: AgentWorkflowMessageSnapshot[];
|
|
349
|
-
phase: AgentWorkflowTurnPhase;
|
|
350
|
-
pendingInput?: AgentWorkflowUserMessageSnapshot;
|
|
351
|
-
step: number;
|
|
352
|
-
maxSteps: number;
|
|
353
|
-
usage?: TokenUsage;
|
|
354
|
-
turnState?: AgentTurnState;
|
|
355
|
-
lastModelStep?: AgentWorkflowModelStepResult;
|
|
356
|
-
replayDecisions: Record<string, AgentWorkflowReplayDecision>;
|
|
357
|
-
finalResponse?: string;
|
|
358
|
-
error?: string;
|
|
359
|
-
startedAt: string;
|
|
360
|
-
updatedAt: string;
|
|
361
|
-
/**
|
|
362
|
-
* Pending steering messages injected by an external client.
|
|
363
|
-
* In direct execution, the `InterventionController` handles this.
|
|
364
|
-
* In durable execution, pending messages are drained at each
|
|
365
|
-
* model-step boundary and injected as user messages.
|
|
366
|
-
*/
|
|
367
|
-
pendingInterventions?: AgentWorkflowInterventionSnapshot[];
|
|
368
|
-
/**
|
|
369
|
-
* Deferred follow-up messages queued by an external client.
|
|
370
|
-
* These are held until the current turn completes and can then be
|
|
371
|
-
* surfaced by the host as candidate next-turn messages.
|
|
372
|
-
*/
|
|
373
|
-
queuedFollowUps?: AgentWorkflowInterventionSnapshot[];
|
|
374
|
-
}
|
|
375
|
-
interface CreateAgentWorkflowTurnStateOptions {
|
|
376
|
-
sessionId: string;
|
|
377
|
-
startedAt: string;
|
|
378
|
-
maxSteps: number;
|
|
379
|
-
systemPrompts?: string[];
|
|
380
|
-
initialMessages?: AgentWorkflowMessageSnapshot[];
|
|
381
|
-
initialInput?: AgentWorkflowUserMessageSnapshot;
|
|
382
|
-
initialStep?: number;
|
|
383
|
-
}
|
|
384
|
-
declare function createAgentWorkflowTurnState(options: CreateAgentWorkflowTurnStateOptions): AgentWorkflowTurnState;
|
|
385
|
-
declare function cloneAgentWorkflowTurnState(state: AgentWorkflowTurnState): AgentWorkflowTurnState;
|
|
386
|
-
declare function applyWorkflowInterventions(state: AgentWorkflowTurnState, interventions: readonly AgentWorkflowInterventionSnapshot[], updatedAt: string): AgentWorkflowTurnState;
|
|
387
|
-
/**
|
|
388
|
-
* Drain pending intervention messages from the workflow state,
|
|
389
|
-
* injecting each as a user message into `state.messages`.
|
|
390
|
-
*
|
|
391
|
-
* Returns the updated state with `pendingInterventions` cleared.
|
|
392
|
-
* If there are no pending interventions, returns the state unchanged.
|
|
393
|
-
*
|
|
394
|
-
* This is the durable-execution equivalent of
|
|
395
|
-
* `InterventionController.drainImmediate()` in the direct path.
|
|
396
|
-
*/
|
|
397
|
-
declare function drainWorkflowInterventions(state: AgentWorkflowTurnState, updatedAt: string): AgentWorkflowTurnState;
|
|
398
|
-
declare function queueWorkflowFollowUps(state: AgentWorkflowTurnState, followUps: readonly AgentWorkflowInterventionSnapshot[], updatedAt: string): AgentWorkflowTurnState;
|
|
399
|
-
|
|
400
|
-
interface AgentWorkflowInputCommitPlan {
|
|
401
|
-
kind: "input-commit";
|
|
402
|
-
sessionId: string;
|
|
403
|
-
messages: AgentWorkflowMessageSnapshot[];
|
|
404
|
-
}
|
|
405
|
-
interface AgentWorkflowModelStepPlan {
|
|
406
|
-
kind: "model-step";
|
|
407
|
-
sessionId: string;
|
|
408
|
-
step: number;
|
|
409
|
-
maxSteps: number;
|
|
410
|
-
systemPrompts: string[];
|
|
411
|
-
messages: AgentWorkflowMessageSnapshot[];
|
|
412
|
-
}
|
|
413
|
-
interface AgentWorkflowStepCommitPlan {
|
|
414
|
-
kind: "step-commit";
|
|
415
|
-
sessionId: string;
|
|
416
|
-
step: number;
|
|
417
|
-
snapshot: AgentTurnStepCommitSnapshot;
|
|
418
|
-
}
|
|
419
|
-
interface AgentWorkflowToolCallPlan {
|
|
420
|
-
kind: "tool-call";
|
|
421
|
-
step: number;
|
|
422
|
-
sessionId: string;
|
|
423
|
-
toolCall: AgentTurnStepCommitToolCall;
|
|
424
|
-
turnState: AgentWorkflowTurnState["turnState"];
|
|
425
|
-
replayDecision?: AgentWorkflowReplayDecision;
|
|
426
|
-
}
|
|
427
|
-
interface AgentWorkflowToolBatchPlan {
|
|
428
|
-
kind: "tool-batch";
|
|
429
|
-
step: number;
|
|
430
|
-
sessionId: string;
|
|
431
|
-
toolCalls: AgentTurnStepCommitToolCall[];
|
|
432
|
-
turnState: AgentWorkflowTurnState["turnState"];
|
|
433
|
-
replayDecisions: Record<string, AgentWorkflowReplayDecision>;
|
|
434
|
-
}
|
|
435
|
-
interface AgentWorkflowOutputCommitPlan {
|
|
436
|
-
kind: "output-commit";
|
|
437
|
-
sessionId: string;
|
|
438
|
-
text: string;
|
|
439
|
-
usage?: TokenUsage;
|
|
440
|
-
}
|
|
441
|
-
type AgentWorkflowOperationPlan = AgentWorkflowInputCommitPlan | AgentWorkflowModelStepPlan | AgentWorkflowToolCallPlan | AgentWorkflowToolBatchPlan | AgentWorkflowStepCommitPlan | AgentWorkflowOutputCommitPlan;
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Decide which deterministic workflow operation should run next.
|
|
445
|
-
*/
|
|
446
|
-
declare function planNextAgentWorkflowOperation(state: AgentWorkflowTurnState): AgentWorkflowOperationPlan | undefined;
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Advance serializable workflow state after the model-step activity completes.
|
|
450
|
-
*/
|
|
451
|
-
declare function applyAgentWorkflowModelStepResult(state: AgentWorkflowTurnState, result: AgentWorkflowModelStepResult, updatedAt: string): AgentWorkflowTurnState;
|
|
452
|
-
/**
|
|
453
|
-
* Advance serializable workflow state after a separate tool-batch activity.
|
|
454
|
-
*/
|
|
455
|
-
declare function applyAgentWorkflowToolBatchResult(state: AgentWorkflowTurnState, result: AgentWorkflowToolBatchResult, updatedAt: string): AgentWorkflowTurnState;
|
|
456
|
-
/**
|
|
457
|
-
* Advance serializable workflow state after a single tool-call activity.
|
|
458
|
-
*/
|
|
459
|
-
declare function applyAgentWorkflowToolCallResult(state: AgentWorkflowTurnState, result: AgentWorkflowToolCallResult, updatedAt: string): AgentWorkflowTurnState;
|
|
460
|
-
/**
|
|
461
|
-
* Advance serializable workflow state after a commit activity persists messages.
|
|
462
|
-
*/
|
|
463
|
-
declare function applyAgentWorkflowCommitResult(state: AgentWorkflowTurnState, result: AgentWorkflowCommitResult, updatedAt: string): AgentWorkflowTurnState;
|
|
464
|
-
/**
|
|
465
|
-
* Record a concrete replay decision chosen by a runtime or operator.
|
|
466
|
-
*/
|
|
467
|
-
declare function recordAgentWorkflowReplayDecision(state: AgentWorkflowTurnState, decision: AgentWorkflowReplayDecision, updatedAt: string): AgentWorkflowTurnState;
|
|
468
|
-
/**
|
|
469
|
-
* Mark the workflow-side turn state as failed.
|
|
470
|
-
*/
|
|
471
|
-
declare function failAgentWorkflowTurnState(state: AgentWorkflowTurnState, error: Error, updatedAt: string): AgentWorkflowTurnState;
|
|
472
|
-
|
|
473
|
-
declare function snapshotAgentWorkflowMessage(message: UserMessage): AgentWorkflowUserMessageSnapshot;
|
|
474
|
-
declare function snapshotAgentWorkflowMessage(message: AssistantMessage): AgentWorkflowAssistantMessageSnapshot;
|
|
475
|
-
declare function snapshotAgentWorkflowMessage(message: ToolMessage): AgentWorkflowToolMessageSnapshot;
|
|
476
|
-
declare function snapshotAgentWorkflowMessage(message: SystemMessage): AgentWorkflowSystemMessageSnapshot;
|
|
477
|
-
declare function snapshotAgentWorkflowMessage(message: Message): AgentWorkflowMessageSnapshot;
|
|
478
|
-
declare function snapshotAgentWorkflowMessages(messages: Message[]): AgentWorkflowMessageSnapshot[];
|
|
479
|
-
declare function restoreAgentWorkflowMessage(snapshot: AgentWorkflowMessageSnapshot): Message;
|
|
480
|
-
declare function restoreAgentWorkflowMessages(snapshots: AgentWorkflowMessageSnapshot[]): Message[];
|
|
481
|
-
|
|
482
|
-
export { type AgentTaskChatAdapter, type AgentTaskCheckpointReason, type AgentTaskCheckpointStrategy, type AgentTaskCheckpointStrategyInput, type AgentTaskExecutionCheckpoint, type AgentTaskExecutionContext, type AgentTaskExecutionRun, type AgentTaskExecutionSnapshot, type AgentTaskObserver, type AgentTaskPayload, type AgentTaskResult, type AgentTaskResumeSnapshot, type AgentTaskRunner, type AgentTaskRunnerOptions, AgentTurnCommitBatch, AgentTurnState, AgentTurnStepCommitSnapshot, AgentTurnStepCommitToolCall, AgentTurnStepCommitToolResult, type AgentWorkflowAssistantMessageSnapshot, type AgentWorkflowCommitResult, type AgentWorkflowInputCommitPlan, type AgentWorkflowInterventionSnapshot, type AgentWorkflowMessageSnapshot, type AgentWorkflowModelStepPlan, type AgentWorkflowModelStepResult, type AgentWorkflowOperationPlan, type AgentWorkflowOutputCommitPlan, type AgentWorkflowReplayDecision, type AgentWorkflowStepCommitPlan, type AgentWorkflowSystemMessageSnapshot, type AgentWorkflowToolBatchPlan, type AgentWorkflowToolBatchResult, type AgentWorkflowToolCallPlan, type AgentWorkflowToolCallResult, type AgentWorkflowToolCallSnapshot, type AgentWorkflowToolMessageSnapshot, type AgentWorkflowTurnPhase, type AgentWorkflowTurnState, type AgentWorkflowUserMessageSnapshot, CommitOutputOptions, CommitStepOptions, ContextOverflowError, CreateAgentTurnStepCommitBatchOptions, type CreateAgentWorkflowTurnStateOptions, DoomLoopError, PrepareModelStepOptions, PreparedAgentModelStep, RunModelStepOptions, RunToolBatchOptions, RunToolBatchResult, StepProcessingOptions, StepProcessingOutput, applyAgentWorkflowCommitResult, applyAgentWorkflowModelStepResult, applyAgentWorkflowToolBatchResult, applyAgentWorkflowToolCallResult, applyWorkflowInterventions, cloneAgentWorkflowTurnState, commitOutput, commitStep, createAgentTaskRunner, createAgentTurnStepCommitBatch, createAgentWorkflowTurnState, defaultAgentTaskCheckpointStrategy, drainWorkflowInterventions, failAgentWorkflowTurnState, planNextAgentWorkflowOperation, prepareModelStep, processStepStream, queueWorkflowFollowUps, recordAgentWorkflowReplayDecision, restoreAgentWorkflowMessage, restoreAgentWorkflowMessages, runModelStep, runToolBatch, snapshotAgentWorkflowMessage, snapshotAgentWorkflowMessages };
|
|
2
|
+
* Execution Integration Module
|
|
3
|
+
*
|
|
4
|
+
* This subpath groups the infrastructure-facing execution surface in four
|
|
5
|
+
* layers:
|
|
6
|
+
* - `task` adapts an `Agent` into a resumable task boundary
|
|
7
|
+
* - `scope` captures ambient execution lineage across async boundaries
|
|
8
|
+
* - `turn` decomposes one agent turn into replayable state, engine, runner,
|
|
9
|
+
* and step-processing units
|
|
10
|
+
* - `workflow` snapshots and advances durable workflow turns
|
|
11
|
+
*
|
|
12
|
+
* Tool execution itself now lives in `@cuylabs/agent-core/tool`, so this
|
|
13
|
+
* module stays focused on execution orchestration rather than tool ownership.
|
|
14
|
+
*/
|
|
15
|
+
export type { AgentTaskChatAdapter, AgentTaskPayload, AgentTaskExecutionContext, AgentTaskResumeSnapshot, AgentTaskResult, AgentTaskRunner, } from "./task/index.js";
|
|
16
|
+
export type { AgentTaskCheckpointReason, AgentTaskCheckpointStrategy, AgentTaskCheckpointStrategyInput, AgentTaskExecutionCheckpoint, AgentTaskExecutionRun, AgentTaskExecutionSnapshot, AgentTaskObserver, } from "./task/index.js";
|
|
17
|
+
export type { AgentTaskRunnerOptions } from "./task/index.js";
|
|
18
|
+
export type { ScopeSnapshot } from "./scope/index.js";
|
|
19
|
+
export type { AgentTurnActiveToolCall, AgentTurnBoundaryMetadata, AgentTurnBoundarySnapshot, AgentTurnCommitApplier, AgentTurnCommitBatch, AgentTurnCommitOptions, AgentTurnEngineOptions, AgentTurnPhase, AgentTurnResolvedToolCall, AgentTurnState, AgentTurnStateAdvanceOptions, AgentTurnStateConflict, AgentTurnStepCommitKind, AgentTurnStepCommitRecord, AgentTurnStepCommitSnapshot, AgentTurnStepCommitStatus, AgentTurnStepCommitToolCall, AgentTurnStepCommitToolResult, AgentTurnStepRuntimeConfig, AgentTurnStepRecord, AgentTurnStepStatus, AgentTurnStepToolRecord, AgentTurnStepToolResultCaptureMode, AgentTurnStepToolResultCaptureOptions, AgentTurnStepToolResultFormat, AgentTurnStepToolResultSummary, AgentTurnStepToolStatus, CommitOutputOptions, CommitStepOptions, CreateAgentTurnStateOptions, CreateAgentTurnStepCommitBatchOptions, PreparedAgentModelStep, PrepareModelStepOptions, RunModelStepOptions, RunToolBatchOptions, RunToolBatchResult, StepProcessingOptions, StepProcessingOutput, } from "./turn/index.js";
|
|
20
|
+
export type { AgentWorkflowAssistantMessageSnapshot, AgentWorkflowCommitResult, AgentWorkflowContextCompactionResult, AgentWorkflowInterventionSnapshot, AgentWorkflowMessageSnapshot, AgentWorkflowModelStepResult, AgentWorkflowReplayDecision, AgentWorkflowSystemMessageSnapshot, AgentWorkflowToolBatchResult, AgentWorkflowToolCallResult, AgentWorkflowToolCallSnapshot, AgentWorkflowToolMessageSnapshot, AgentWorkflowTurnPhase, AgentWorkflowTurnState, AgentWorkflowUserMessageSnapshot, CreateAgentWorkflowTurnStateOptions, AgentWorkflowInputCommitPlan, AgentWorkflowModelStepPlan, AgentWorkflowOperationPlan, AgentWorkflowOutputCommitPlan, AgentWorkflowStepCommitPlan, AgentWorkflowToolBatchPlan, AgentWorkflowToolCallPlan, } from "./workflow/index.js";
|
|
21
|
+
export { defaultAgentTaskCheckpointStrategy } from "./task/index.js";
|
|
22
|
+
export { createAgentTaskRunner } from "./task/index.js";
|
|
23
|
+
export { convertAgentMessagesToModelMessages } from "../inference/model-messages.js";
|
|
24
|
+
export { currentScope, restoreScope, snapshotScope, withinScope, } from "./scope/index.js";
|
|
25
|
+
export { advanceAgentTurnState, createAgentTurnState, failAgentTurnState, mergeAgentTurnStateProgress, } from "./turn/index.js";
|
|
26
|
+
export { AgentTurnStateConflictError, getCurrentAgentTurnStepRecord, } from "./turn/index.js";
|
|
27
|
+
export { AgentTurnEngine, createAgentTurnEngine } from "./turn/index.js";
|
|
28
|
+
export { createAgentTurnStepCommitBatch } from "./turn/index.js";
|
|
29
|
+
export { commitOutput, commitStep, prepareModelStep, runToolBatch, runModelStep, } from "./turn/index.js";
|
|
30
|
+
export { processStepStream, DoomLoopError, ContextOverflowError, } from "./turn/index.js";
|
|
31
|
+
export { applyWorkflowInterventions, cloneAgentWorkflowTurnState, createAgentWorkflowTurnState, drainWorkflowInterventions, queueWorkflowFollowUps, } from "./workflow/index.js";
|
|
32
|
+
export { restoreAgentWorkflowMessage, restoreAgentWorkflowMessages, snapshotAgentWorkflowMessage, snapshotAgentWorkflowMessages, } from "./workflow/index.js";
|
|
33
|
+
export { applyAgentWorkflowCommitResult, applyAgentWorkflowContextCompactionResult, applyAgentWorkflowModelStepResult, applyAgentWorkflowToolCallResult, applyAgentWorkflowToolBatchResult, failAgentWorkflowTurnState, planNextAgentWorkflowOperation, recordAgentWorkflowReplayDecision, } from "./workflow/index.js";
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|