@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,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compaction summary generation.
|
|
3
|
+
*
|
|
4
|
+
* This module is intentionally limited to serializing messages and asking a
|
|
5
|
+
* model for a summary. Boundary planning and persistence live elsewhere.
|
|
6
|
+
*/
|
|
7
|
+
import type { LanguageModel } from "ai";
|
|
8
|
+
import type { Message } from "../../types/messages.js";
|
|
9
|
+
/**
|
|
10
|
+
* Options for summary generation.
|
|
11
|
+
*/
|
|
12
|
+
export interface SummarizationOptions {
|
|
13
|
+
/** Model used to generate the summary */
|
|
14
|
+
model: LanguageModel;
|
|
15
|
+
/** Max estimated input tokens for serialized messages */
|
|
16
|
+
maxInputTokens?: number;
|
|
17
|
+
/** Max tokens for the summary output */
|
|
18
|
+
maxTokens?: number;
|
|
19
|
+
/** Custom summarization system prompt */
|
|
20
|
+
customPrompt?: string;
|
|
21
|
+
/** Existing handoff summary to update instead of summarizing from scratch */
|
|
22
|
+
previousSummary?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SplitTurnSummarizationOptions extends SummarizationOptions {
|
|
25
|
+
/** Older conversation messages removed before the active turn */
|
|
26
|
+
historyMessages: Message[];
|
|
27
|
+
/** Early active-turn messages removed while keeping the later suffix */
|
|
28
|
+
currentTurnPrefixMessages: Message[];
|
|
29
|
+
}
|
|
30
|
+
export interface SummarySerializationOptions {
|
|
31
|
+
/** Max estimated tokens across the whole serialized transcript */
|
|
32
|
+
maxInputTokens?: number;
|
|
33
|
+
/** Max estimated tokens per message before middle truncation */
|
|
34
|
+
maxMessageTokens?: number;
|
|
35
|
+
}
|
|
36
|
+
export declare function createCompactionSummaryContent(summary: string): string;
|
|
37
|
+
export declare function extractCompactionSummaryText(message: Message): string | undefined;
|
|
38
|
+
export declare function redactSummaryText(text: string): string;
|
|
39
|
+
export declare function serializeMessagesForSummary(messages: Message[], options?: SummarySerializationOptions): string;
|
|
40
|
+
/**
|
|
41
|
+
* Generate a natural-language summary of a message sequence.
|
|
42
|
+
*
|
|
43
|
+
* @param messages - Messages to summarize
|
|
44
|
+
* @param options - Model and prompt configuration
|
|
45
|
+
* @returns Summary text
|
|
46
|
+
*/
|
|
47
|
+
export declare function generateSummary(messages: Message[], options: SummarizationOptions): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Generate a summary for a cut that splits the active turn.
|
|
50
|
+
*
|
|
51
|
+
* This keeps the later active-turn suffix verbatim while summarizing the
|
|
52
|
+
* removed prefix with different instructions from normal completed-history
|
|
53
|
+
* compaction.
|
|
54
|
+
*/
|
|
55
|
+
export declare function generateSplitTurnSummary(options: SplitTurnSummarizationOptions): Promise<string>;
|
|
56
|
+
//# sourceMappingURL=summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/context/window/summary.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAExC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AASvD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,KAAK,EAAE,aAAa,CAAC;IACrB,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,6BAA8B,SAAQ,oBAAoB;IACzE,iEAAiE;IACjE,eAAe,EAAE,OAAO,EAAE,CAAC;IAC3B,wEAAwE;IACxE,yBAAyB,EAAE,OAAO,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,2BAA2B;IAC1C,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAmCD,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,GACf,MAAM,GAAG,SAAS,CAIpB;AAsBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQtD;AA2CD,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,GAAE,2BAAgC,GACxC,MAAM,CAiCR;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAsBjB;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,CAiCjB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool context pruning.
|
|
3
|
+
*
|
|
4
|
+
* Performs the cheap compaction pass that does not require an LLM call:
|
|
5
|
+
* old, large tool outputs and old, large tool-call arguments outside the
|
|
6
|
+
* protected suffix are replaced with compact previews while preserving
|
|
7
|
+
* tool-call/result shape.
|
|
8
|
+
*/
|
|
9
|
+
import type { Message } from "../../types/index.js";
|
|
10
|
+
export interface ToolContextPruneReport {
|
|
11
|
+
/** Number of tool result messages compacted. */
|
|
12
|
+
outputCompactedCount: number;
|
|
13
|
+
/** Number of assistant tool-call argument payloads compacted. */
|
|
14
|
+
argumentCompactedCount: number;
|
|
15
|
+
/** Estimated message tokens before the tool context pass. */
|
|
16
|
+
tokensBefore: number;
|
|
17
|
+
/** Estimated message tokens after the tool context pass. */
|
|
18
|
+
tokensAfter: number;
|
|
19
|
+
/** Estimated tokens removed by the tool context pass. */
|
|
20
|
+
tokensRemoved: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ToolContextPruneResult {
|
|
23
|
+
messages: Message[];
|
|
24
|
+
report: ToolContextPruneReport;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Prune old, large tool context from the conversation.
|
|
28
|
+
*
|
|
29
|
+
* Prune strategy:
|
|
30
|
+
* - Walks backwards through messages
|
|
31
|
+
* - Protects recent outputs within `protectedTokens`
|
|
32
|
+
* - Skips protected tools such as `skill`
|
|
33
|
+
* - Stamps pruned messages with a `compactedAt` timestamp
|
|
34
|
+
*
|
|
35
|
+
* @param messages - Messages to prune
|
|
36
|
+
* @param protectedTokens - Recent tokens protected from pruning
|
|
37
|
+
* @param options - Extra tool names to protect
|
|
38
|
+
* @returns New message array with large tool context replaced
|
|
39
|
+
*/
|
|
40
|
+
export declare function pruneToolContextWithReport(messages: Message[], protectedTokens?: number, options?: {
|
|
41
|
+
/** Additional tools to protect from pruning */
|
|
42
|
+
protectedTools?: string[];
|
|
43
|
+
}): ToolContextPruneResult;
|
|
44
|
+
/**
|
|
45
|
+
* Prune old, large tool context from the conversation.
|
|
46
|
+
*
|
|
47
|
+
* Prune strategy:
|
|
48
|
+
* - Walks backwards through messages
|
|
49
|
+
* - Protects recent outputs within `protectedTokens`
|
|
50
|
+
* - Skips protected tools such as `skill`
|
|
51
|
+
* - Stamps pruned tool-result messages with a `compactedAt` timestamp
|
|
52
|
+
*
|
|
53
|
+
* @param messages - Messages to prune
|
|
54
|
+
* @param protectedTokens - Recent tokens protected from pruning
|
|
55
|
+
* @param options - Extra tool names to protect
|
|
56
|
+
* @returns New message array with large tool context replaced
|
|
57
|
+
*/
|
|
58
|
+
export declare function pruneToolContext(messages: Message[], protectedTokens?: number, options?: {
|
|
59
|
+
/** Additional tools to protect from pruning */
|
|
60
|
+
protectedTools?: string[];
|
|
61
|
+
}): Message[];
|
|
62
|
+
//# sourceMappingURL=tool-pruning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-pruning.d.ts","sourceRoot":"","sources":["../../../src/context/window/tool-pruning.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAEV,OAAO,EAER,MAAM,sBAAsB,CAAC;AAkB9B,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iEAAiE;IACjE,sBAAsB,EAAE,MAAM,CAAC;IAC/B,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,sBAAsB,CAAC;CAChC;AA0ND;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,OAAO,EAAE,EACnB,eAAe,GAAE,MAA+C,EAChE,OAAO,CAAC,EAAE;IACR,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,GACA,sBAAsB,CA+FxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,OAAO,EAAE,EACnB,eAAe,GAAE,MAA+C,EAChE,OAAO,CAAC,EAAE;IACR,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,GACA,OAAO,EAAE,CAGX"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ExternalTaskControl, MemberRuntime, TaskExecutor, TaskExecutorInput } from "../team/coordinator/types.js";
|
|
2
|
+
import type { TeamTask } from "../team/types.js";
|
|
3
|
+
import type { DispatchRecord, DispatchRuntime, DispatchTarget, DispatchTargetInspection, DispatchTargetStartResult, DispatchTargetSummary } from "./types.js";
|
|
4
|
+
export interface DispatchTaskExecutorOptions<RecordT extends DispatchRecord = DispatchRecord, InspectionT extends DispatchTargetInspection = DispatchTargetInspection> {
|
|
5
|
+
targets: readonly DispatchTarget<RecordT, InspectionT>[];
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
pollIntervalMs?: number;
|
|
8
|
+
now?: () => string;
|
|
9
|
+
resolveTargetName?: (input: TaskExecutorInput) => string;
|
|
10
|
+
createRecord?: (input: {
|
|
11
|
+
taskInput: TaskExecutorInput;
|
|
12
|
+
target: DispatchTarget<RecordT, InspectionT>;
|
|
13
|
+
dispatchId: string;
|
|
14
|
+
startedAt: string;
|
|
15
|
+
startResult: DispatchTargetStartResult;
|
|
16
|
+
}) => RecordT;
|
|
17
|
+
}
|
|
18
|
+
export interface DispatchExternalTaskControlOptions<RecordT extends DispatchRecord = DispatchRecord, InspectionT extends DispatchTargetInspection = DispatchTargetInspection> {
|
|
19
|
+
targets: readonly DispatchTarget<RecordT, InspectionT>[];
|
|
20
|
+
now?: () => string;
|
|
21
|
+
resolveTargetName?: (input: {
|
|
22
|
+
task: TeamTask;
|
|
23
|
+
runtime: MemberRuntime;
|
|
24
|
+
}) => string;
|
|
25
|
+
createRecord?: (input: {
|
|
26
|
+
task: TeamTask;
|
|
27
|
+
runtime: MemberRuntime;
|
|
28
|
+
target: DispatchTarget<RecordT, InspectionT>;
|
|
29
|
+
dispatchId: string;
|
|
30
|
+
startedAt: string;
|
|
31
|
+
}) => RecordT;
|
|
32
|
+
}
|
|
33
|
+
export interface DispatchTaskExecutorRoute {
|
|
34
|
+
matches(input: TaskExecutorInput): boolean;
|
|
35
|
+
executor: TaskExecutor;
|
|
36
|
+
}
|
|
37
|
+
export interface CompositeDispatchTaskExecutorOptions {
|
|
38
|
+
routes: readonly DispatchTaskExecutorRoute[];
|
|
39
|
+
fallback?: TaskExecutor;
|
|
40
|
+
}
|
|
41
|
+
export interface RuntimeDispatchTargetOptions {
|
|
42
|
+
runtime: DispatchRuntime;
|
|
43
|
+
filter?: (target: DispatchTargetSummary) => boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface RuntimeDispatchExecutorOptions extends Omit<DispatchTaskExecutorOptions, "targets"> {
|
|
46
|
+
runtime: DispatchRuntime;
|
|
47
|
+
filter?: (target: DispatchTargetSummary) => boolean;
|
|
48
|
+
}
|
|
49
|
+
export declare function ensureNonEmpty(input: string, label: string): string;
|
|
50
|
+
export declare function mergeInspection<RecordT extends DispatchRecord, InspectionT extends DispatchTargetInspection>(record: RecordT, inspection: InspectionT | undefined, fallbackNow: string): RecordT;
|
|
51
|
+
export declare function createRuntimeDispatchTargets(options: RuntimeDispatchTargetOptions): DispatchTarget[];
|
|
52
|
+
export declare function createDispatchTaskExecutor<RecordT extends DispatchRecord = DispatchRecord, InspectionT extends DispatchTargetInspection = DispatchTargetInspection>(options: DispatchTaskExecutorOptions<RecordT, InspectionT>): TaskExecutor;
|
|
53
|
+
export declare function createCompositeDispatchTaskExecutor(options: CompositeDispatchTaskExecutorOptions): TaskExecutor;
|
|
54
|
+
export declare function createRuntimeDispatchExecutor(options: RuntimeDispatchExecutorOptions): TaskExecutor;
|
|
55
|
+
export declare function createDispatchExternalTaskControl<RecordT extends DispatchRecord = DispatchRecord, InspectionT extends DispatchTargetInspection = DispatchTargetInspection>(options: DispatchExternalTaskControlOptions<RecordT, InspectionT>): ExternalTaskControl;
|
|
56
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/dispatch/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAc,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAEV,cAAc,EAEd,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,2BAA2B,CAC1C,OAAO,SAAS,cAAc,GAAG,cAAc,EAC/C,WAAW,SAAS,wBAAwB,GAAG,wBAAwB;IAEvE,OAAO,EAAE,SAAS,cAAc,CAAC,OAAO,EAAE,WAAW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CHANGED
|
@@ -1,95 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import '../types-DMjoFKKv.js';
|
|
9
|
-
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
10
|
-
import '@modelcontextprotocol/sdk/types.js';
|
|
11
|
-
import '@ai-sdk/provider-utils';
|
|
12
|
-
import '../sandbox/index.js';
|
|
13
|
-
import '../llm-error-D93FNNLY.js';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Local in-process DispatchRuntime.
|
|
17
|
-
*
|
|
18
|
-
* Launches child agents as background async tasks, tracks them in a Map,
|
|
19
|
-
* and supports redirect (via `agent.intervene()`), cancel (via
|
|
20
|
-
* AbortController), and status polling.
|
|
21
|
-
*
|
|
22
|
-
* @packageDocumentation
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Create a local in-process `DispatchRuntime`.
|
|
27
|
-
*
|
|
28
|
-
* This is the simplest runtime — child agents are forked from the parent
|
|
29
|
-
* and run as background Promise tasks in the same process. Use
|
|
30
|
-
* `createDaprDispatchRuntime()` for durable distributed dispatch.
|
|
31
|
-
*/
|
|
32
|
-
declare function createLocalDispatchRuntime(options: LocalDispatchRuntimeOptions): DispatchRuntime;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Create the standard dispatch tools from a `DispatchRuntime`.
|
|
36
|
-
*
|
|
37
|
-
* Returns `start_dispatch`, `check_dispatch`, `redirect_dispatch`,
|
|
38
|
-
* `cancel_dispatch`, and `list_dispatches`.
|
|
39
|
-
*/
|
|
40
|
-
declare function createDispatchTools(runtime: DispatchRuntime): Tool.AnyInfo[];
|
|
41
|
-
|
|
42
|
-
interface DispatchTaskExecutorOptions<RecordT extends DispatchRecord = DispatchRecord, InspectionT extends DispatchTargetInspection = DispatchTargetInspection> {
|
|
43
|
-
targets: readonly DispatchTarget<RecordT, InspectionT>[];
|
|
44
|
-
timeoutMs?: number;
|
|
45
|
-
pollIntervalMs?: number;
|
|
46
|
-
now?: () => string;
|
|
47
|
-
resolveTargetName?: (input: TaskExecutorInput) => string;
|
|
48
|
-
createRecord?: (input: {
|
|
49
|
-
taskInput: TaskExecutorInput;
|
|
50
|
-
target: DispatchTarget<RecordT, InspectionT>;
|
|
51
|
-
dispatchId: string;
|
|
52
|
-
startedAt: string;
|
|
53
|
-
startResult: DispatchTargetStartResult;
|
|
54
|
-
}) => RecordT;
|
|
55
|
-
}
|
|
56
|
-
interface DispatchExternalTaskControlOptions<RecordT extends DispatchRecord = DispatchRecord, InspectionT extends DispatchTargetInspection = DispatchTargetInspection> {
|
|
57
|
-
targets: readonly DispatchTarget<RecordT, InspectionT>[];
|
|
58
|
-
now?: () => string;
|
|
59
|
-
resolveTargetName?: (input: {
|
|
60
|
-
task: TeamTask;
|
|
61
|
-
runtime: MemberRuntime;
|
|
62
|
-
}) => string;
|
|
63
|
-
createRecord?: (input: {
|
|
64
|
-
task: TeamTask;
|
|
65
|
-
runtime: MemberRuntime;
|
|
66
|
-
target: DispatchTarget<RecordT, InspectionT>;
|
|
67
|
-
dispatchId: string;
|
|
68
|
-
startedAt: string;
|
|
69
|
-
}) => RecordT;
|
|
70
|
-
}
|
|
71
|
-
interface DispatchTaskExecutorRoute {
|
|
72
|
-
matches(input: TaskExecutorInput): boolean;
|
|
73
|
-
executor: TaskExecutor;
|
|
74
|
-
}
|
|
75
|
-
interface CompositeDispatchTaskExecutorOptions {
|
|
76
|
-
routes: readonly DispatchTaskExecutorRoute[];
|
|
77
|
-
fallback?: TaskExecutor;
|
|
78
|
-
}
|
|
79
|
-
interface RuntimeDispatchTargetOptions {
|
|
80
|
-
runtime: DispatchRuntime;
|
|
81
|
-
filter?: (target: DispatchTargetSummary) => boolean;
|
|
82
|
-
}
|
|
83
|
-
interface RuntimeDispatchExecutorOptions extends Omit<DispatchTaskExecutorOptions, "targets"> {
|
|
84
|
-
runtime: DispatchRuntime;
|
|
85
|
-
filter?: (target: DispatchTargetSummary) => boolean;
|
|
86
|
-
}
|
|
87
|
-
declare function ensureNonEmpty(input: string, label: string): string;
|
|
88
|
-
declare function mergeInspection<RecordT extends DispatchRecord, InspectionT extends DispatchTargetInspection>(record: RecordT, inspection: InspectionT | undefined, fallbackNow: string): RecordT;
|
|
89
|
-
declare function createRuntimeDispatchTargets(options: RuntimeDispatchTargetOptions): DispatchTarget[];
|
|
90
|
-
declare function createDispatchTaskExecutor<RecordT extends DispatchRecord = DispatchRecord, InspectionT extends DispatchTargetInspection = DispatchTargetInspection>(options: DispatchTaskExecutorOptions<RecordT, InspectionT>): TaskExecutor;
|
|
91
|
-
declare function createCompositeDispatchTaskExecutor(options: CompositeDispatchTaskExecutorOptions): TaskExecutor;
|
|
92
|
-
declare function createRuntimeDispatchExecutor(options: RuntimeDispatchExecutorOptions): TaskExecutor;
|
|
93
|
-
declare function createDispatchExternalTaskControl<RecordT extends DispatchRecord = DispatchRecord, InspectionT extends DispatchTargetInspection = DispatchTargetInspection>(options: DispatchExternalTaskControlOptions<RecordT, InspectionT>): ExternalTaskControl;
|
|
94
|
-
|
|
95
|
-
export { type CompositeDispatchTaskExecutorOptions, type DispatchExternalTaskControlOptions, DispatchRecord, DispatchRuntime, DispatchTarget, DispatchTargetInspection, DispatchTargetStartResult, DispatchTargetSummary, type DispatchTaskExecutorOptions, type DispatchTaskExecutorRoute, LocalDispatchRuntimeOptions, type RuntimeDispatchExecutorOptions, type RuntimeDispatchTargetOptions, createCompositeDispatchTaskExecutor, createDispatchExternalTaskControl, createDispatchTaskExecutor, createDispatchTools, createLocalDispatchRuntime, createRuntimeDispatchExecutor, createRuntimeDispatchTargets, ensureNonEmpty, mergeInspection };
|
|
1
|
+
export type { DispatchCheckOptions, DispatchListOptions, DispatchRole, DispatchRecord, DispatchResult, DispatchRuntime, DispatchStartInput, DispatchState, DispatchTarget, DispatchTargetInspection, DispatchTargetStartInput, DispatchTargetStartResult, DispatchTargetSummary, DispatchUsage, LocalDispatchRuntimeOptions, } from "./types.js";
|
|
2
|
+
export { DISPATCH_STATES, DEFAULT_DISPATCH_TOOL_IDS, DEFAULT_LOCAL_DISPATCH_CONCURRENCY, DEFAULT_LOCAL_DISPATCH_DEPTH, DEFAULT_LOCAL_DISPATCH_TITLE_PREFIX, } from "./types.js";
|
|
3
|
+
export { createLocalDispatchRuntime } from "./runtime.js";
|
|
4
|
+
export { createDispatchTools } from "./tools.js";
|
|
5
|
+
export type { CompositeDispatchTaskExecutorOptions, DispatchExternalTaskControlOptions, DispatchTaskExecutorOptions, DispatchTaskExecutorRoute, RuntimeDispatchExecutorOptions, RuntimeDispatchTargetOptions, } from "./executor.js";
|
|
6
|
+
export { createCompositeDispatchTaskExecutor, createDispatchExternalTaskControl, createDispatchTaskExecutor, createRuntimeDispatchExecutor, createRuntimeDispatchTargets, ensureNonEmpty, mergeInspection, } from "./executor.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dispatch/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,aAAa,EACb,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,GACpC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EACV,oCAAoC,EACpC,kCAAkC,EAClC,2BAA2B,EAC3B,yBAAyB,EACzB,8BAA8B,EAC9B,4BAA4B,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mCAAmC,EACnC,iCAAiC,EACjC,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,cAAc,EACd,eAAe,GAChB,MAAM,eAAe,CAAC"}
|
package/dist/dispatch/index.js
CHANGED
|
@@ -15,10 +15,11 @@ import {
|
|
|
15
15
|
DISPATCH_STATES,
|
|
16
16
|
createDispatchTools,
|
|
17
17
|
createLocalDispatchRuntime
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-EBVSPHXA.js";
|
|
19
|
+
import "../chunk-VMGZKIFT.js";
|
|
19
20
|
import "../chunk-SZ2XBPTW.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-MJML3A2F.js";
|
|
22
|
+
import "../chunk-AAGKWUXR.js";
|
|
22
23
|
export {
|
|
23
24
|
DEFAULT_DISPATCH_TOOL_IDS,
|
|
24
25
|
DEFAULT_LOCAL_DISPATCH_CONCURRENCY,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Tool } from "../tool/tool.js";
|
|
2
|
+
import type { DispatchRecord } from "./types.js";
|
|
3
|
+
export declare function formatDispatchStarted(record: DispatchRecord): Tool.ExecuteResult;
|
|
4
|
+
export declare function formatDispatchChecked(record: DispatchRecord): Tool.ExecuteResult;
|
|
5
|
+
export declare function formatDispatchRedirected(record: DispatchRecord): Tool.ExecuteResult;
|
|
6
|
+
export declare function formatDispatchCancelled(record: DispatchRecord): Tool.ExecuteResult;
|
|
7
|
+
export declare function formatDispatchList(records: DispatchRecord[]): Tool.ExecuteResult;
|
|
8
|
+
export declare function formatDispatchError(label: string, error: unknown): Tool.ExecuteResult;
|
|
9
|
+
//# sourceMappingURL=results.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../src/dispatch/results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA0BjD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,GACrB,IAAI,CAAC,aAAa,CAapB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,GACrB,IAAI,CAAC,aAAa,CAUpB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,cAAc,GACrB,IAAI,CAAC,aAAa,CAWpB;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,cAAc,GACrB,IAAI,CAAC,aAAa,CAUpB;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,cAAc,EAAE,GACxB,IAAI,CAAC,aAAa,CAmBpB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,GACb,IAAI,CAAC,aAAa,CAOpB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local in-process DispatchRuntime.
|
|
3
|
+
*
|
|
4
|
+
* Launches child agents as background async tasks, tracks them in a Map,
|
|
5
|
+
* and supports redirect (via `agent.intervene()`), cancel (via
|
|
6
|
+
* AbortController), and status polling.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import type { DispatchRuntime, LocalDispatchRuntimeOptions } from "./types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Create a local in-process `DispatchRuntime`.
|
|
13
|
+
*
|
|
14
|
+
* This is the simplest runtime — child agents are forked from the parent
|
|
15
|
+
* and run as background Promise tasks in the same process. Use
|
|
16
|
+
* `createDaprDispatchRuntime()` for durable distributed dispatch.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createLocalDispatchRuntime(options: LocalDispatchRuntimeOptions): DispatchRuntime;
|
|
19
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/dispatch/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAKV,eAAe,EAIf,2BAA2B,EAC5B,MAAM,YAAY,CAAC;AAgDpB;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,GACnC,eAAe,CA2PjB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tool } from "../tool/tool.js";
|
|
2
|
+
import type { DispatchRuntime } from "./types.js";
|
|
3
|
+
export declare function createDispatchStartTool(runtime: DispatchRuntime): Tool.AnyInfo;
|
|
4
|
+
export declare function createDispatchCheckTool(runtime: DispatchRuntime): Tool.AnyInfo;
|
|
5
|
+
export declare function createDispatchRedirectTool(runtime: DispatchRuntime): Tool.AnyInfo;
|
|
6
|
+
export declare function createDispatchCancelTool(runtime: DispatchRuntime): Tool.AnyInfo;
|
|
7
|
+
export declare function createDispatchListTool(runtime: DispatchRuntime): Tool.AnyInfo;
|
|
8
|
+
//# sourceMappingURL=tool-factories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-factories.d.ts","sourceRoot":"","sources":["../../src/dispatch/tool-factories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,YAAY,CAAC;AAmBzE,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,eAAe,GACvB,IAAI,CAAC,OAAO,CAsCd;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,eAAe,GACvB,IAAI,CAAC,OAAO,CA6Bd;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,eAAe,GACvB,IAAI,CAAC,OAAO,CAkBd;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,eAAe,GACvB,IAAI,CAAC,OAAO,CAiBd;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC,OAAO,CA8B7E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Tool } from "../tool/tool.js";
|
|
2
|
+
import type { DispatchRuntime } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create the standard dispatch tools from a `DispatchRuntime`.
|
|
5
|
+
*
|
|
6
|
+
* Returns `start_dispatch`, `check_dispatch`, `redirect_dispatch`,
|
|
7
|
+
* `cancel_dispatch`, and `list_dispatches`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDispatchTools(runtime: DispatchRuntime): Tool.AnyInfo[];
|
|
10
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/dispatch/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AASlD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,CAQ5E"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { LanguageModel } from "ai";
|
|
2
|
+
import type { Agent } from "../agent/instance/index.js";
|
|
3
|
+
import type { AgentMiddleware } from "../middleware/types.js";
|
|
4
|
+
import type { Profile } from "../profiles/types.js";
|
|
5
|
+
import type { Tool } from "../tool/tool.js";
|
|
6
|
+
export declare const DISPATCH_STATES: readonly ["running", "completed", "failed", "cancelled"];
|
|
7
|
+
export type DispatchState = (typeof DISPATCH_STATES)[number];
|
|
8
|
+
export declare const DEFAULT_DISPATCH_TOOL_IDS: readonly ["start_dispatch", "check_dispatch", "redirect_dispatch", "cancel_dispatch", "list_dispatches"];
|
|
9
|
+
export interface DispatchRole {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
profile?: Profile;
|
|
13
|
+
systemPrompt?: string;
|
|
14
|
+
model?: LanguageModel;
|
|
15
|
+
maxSteps?: number;
|
|
16
|
+
additionalMiddleware?: AgentMiddleware[];
|
|
17
|
+
additionalTools?: Tool.AnyInfo[];
|
|
18
|
+
/**
|
|
19
|
+
* When false (default), the standard dispatch tools are removed from the
|
|
20
|
+
* child so background work does not recurse by accident.
|
|
21
|
+
*/
|
|
22
|
+
allowFurtherDispatch?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface DispatchTargetSummary {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DispatchTargetStartInput {
|
|
29
|
+
id: string;
|
|
30
|
+
brief: string;
|
|
31
|
+
title: string;
|
|
32
|
+
parentSessionId?: string;
|
|
33
|
+
sessionId?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface DispatchTargetStartResult {
|
|
36
|
+
sessionId?: string;
|
|
37
|
+
executionId?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface DispatchUsage {
|
|
40
|
+
inputTokens: number;
|
|
41
|
+
outputTokens: number;
|
|
42
|
+
totalTokens: number;
|
|
43
|
+
}
|
|
44
|
+
export interface DispatchResult {
|
|
45
|
+
response: string;
|
|
46
|
+
usage: DispatchUsage;
|
|
47
|
+
toolCalls: Array<{
|
|
48
|
+
name: string;
|
|
49
|
+
result: unknown;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export interface DispatchRecord {
|
|
53
|
+
id: string;
|
|
54
|
+
targetType: string;
|
|
55
|
+
title: string;
|
|
56
|
+
brief: string;
|
|
57
|
+
status: DispatchState;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
parentSessionId?: string;
|
|
61
|
+
sessionId?: string;
|
|
62
|
+
executionId?: string;
|
|
63
|
+
redirectCount: number;
|
|
64
|
+
lastRedirect?: string;
|
|
65
|
+
result?: DispatchResult;
|
|
66
|
+
error?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface DispatchTargetInspection {
|
|
69
|
+
status?: DispatchRecord["status"];
|
|
70
|
+
sessionId?: string;
|
|
71
|
+
executionId?: string;
|
|
72
|
+
updatedAt?: string;
|
|
73
|
+
result?: DispatchResult;
|
|
74
|
+
error?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface DispatchTarget<RecordT extends DispatchRecord = DispatchRecord, InspectionT extends DispatchTargetInspection = DispatchTargetInspection> {
|
|
77
|
+
name: string;
|
|
78
|
+
description: string;
|
|
79
|
+
start(input: DispatchTargetStartInput): Promise<DispatchTargetStartResult>;
|
|
80
|
+
redirect(input: {
|
|
81
|
+
record: RecordT;
|
|
82
|
+
message: string;
|
|
83
|
+
}): Promise<void>;
|
|
84
|
+
cancel(input: {
|
|
85
|
+
record: RecordT;
|
|
86
|
+
reason?: string;
|
|
87
|
+
}): Promise<void>;
|
|
88
|
+
check?(input: {
|
|
89
|
+
record: RecordT;
|
|
90
|
+
}): Promise<InspectionT | undefined>;
|
|
91
|
+
}
|
|
92
|
+
export interface DispatchStartInput {
|
|
93
|
+
targetType: string;
|
|
94
|
+
brief: string;
|
|
95
|
+
title?: string;
|
|
96
|
+
parentSessionId?: string;
|
|
97
|
+
abort?: AbortSignal;
|
|
98
|
+
}
|
|
99
|
+
export interface DispatchCheckOptions {
|
|
100
|
+
waitMs?: number;
|
|
101
|
+
}
|
|
102
|
+
export interface DispatchListOptions {
|
|
103
|
+
status?: DispatchState | readonly DispatchState[];
|
|
104
|
+
targetType?: string;
|
|
105
|
+
parentSessionId?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface DispatchRuntime {
|
|
108
|
+
describeTargets(): readonly DispatchTargetSummary[];
|
|
109
|
+
start(input: DispatchStartInput): Promise<DispatchRecord>;
|
|
110
|
+
check(id: string, options?: DispatchCheckOptions): Promise<DispatchRecord | undefined>;
|
|
111
|
+
redirect(id: string, message: string): Promise<DispatchRecord>;
|
|
112
|
+
cancel(id: string, reason?: string): Promise<DispatchRecord>;
|
|
113
|
+
list(options?: DispatchListOptions): Promise<DispatchRecord[]>;
|
|
114
|
+
}
|
|
115
|
+
export interface LocalDispatchRuntimeOptions {
|
|
116
|
+
parent: Agent;
|
|
117
|
+
roles: readonly DispatchRole[];
|
|
118
|
+
maxConcurrent?: number;
|
|
119
|
+
maxDepth?: number;
|
|
120
|
+
currentDepth?: number;
|
|
121
|
+
sessionTitlePrefix?: string;
|
|
122
|
+
now?: () => string;
|
|
123
|
+
createId?: () => string;
|
|
124
|
+
childToolIds?: readonly string[];
|
|
125
|
+
createChildTools?: (runtime: DispatchRuntime) => readonly Tool.AnyInfo[];
|
|
126
|
+
buildChild?: (parent: Agent, role: DispatchRole) => Agent;
|
|
127
|
+
}
|
|
128
|
+
export declare const DEFAULT_LOCAL_DISPATCH_CONCURRENCY = 6;
|
|
129
|
+
export declare const DEFAULT_LOCAL_DISPATCH_DEPTH = 2;
|
|
130
|
+
export declare const DEFAULT_LOCAL_DISPATCH_TITLE_PREFIX = "Dispatch";
|
|
131
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dispatch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,eAAe,0DAKlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7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,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC;IACzE,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,KAAK,KAAK,CAAC;CAC3D;AAED,eAAO,MAAM,kCAAkC,IAAI,CAAC;AACpD,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,mCAAmC,aAAa,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventBus — channel-based event streaming for agent runtimes.
|
|
3
|
+
*
|
|
4
|
+
* Available via:
|
|
5
|
+
* import { createEventBus, type EventBus } from "@cuylabs/agent-core";
|
|
6
|
+
* import { createEventBus, type EventBus } from "@cuylabs/agent-core/events";
|
|
7
|
+
* import { createEventBus, type EventBus } from "@cuylabs/agent-core/events/event-bus";
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
export type { EventBus, EventBusMessage, EventBusOptions, EventBusSubscribeOptions, EventBusSubscription, } from "./types.js";
|
|
12
|
+
export { createEventBus } from "./local.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/event-bus/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EACV,QAAQ,EACR,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-process EventBus implementation.
|
|
3
|
+
*
|
|
4
|
+
* Events are published by producers and consumed by subscribers via
|
|
5
|
+
* async iterators. Each channel maintains a history buffer for replay
|
|
6
|
+
* (e.g. SSE `Last-Event-ID` resume). Channels are automatically
|
|
7
|
+
* cleaned up after a configurable retention period with no subscribers.
|
|
8
|
+
*/
|
|
9
|
+
import type { EventBus, EventBusOptions } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Create a new in-process event bus.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createEventBus(options?: EventBusOptions): EventBus;
|
|
14
|
+
//# sourceMappingURL=local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/events/event-bus/local.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAmB,eAAe,EAAE,MAAM,YAAY,CAAC;AAuB7E;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,eAAoB,GAAG,QAAQ,CA6NtE"}
|