@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
package/dist/team/index.d.ts
CHANGED
|
@@ -1,546 +1,24 @@
|
|
|
1
|
-
import { aI as CoordinatorNotification, d3 as TaskCompletion, du as TokenUsage, A as AgentEvent, e4 as CoordinatorCtx, C as Agent, bF as MemberRuntime, d0 as TaskBoard, bB as Mailbox, d7 as TaskDispatchMode, c2 as PermissionHandler, dh as TeamCoordinatorConfig, d8 as TaskExecutor, di as TeamEvent, dj as TeamMember, cf as QueueTaskInput, dr as TeamTask, dk as TeamMessage, dm as TeamPlan, cY as SynthesisResult, dn as TeamSnapshot, db as TaskListFilter, bO as MessageListFilter, ca as PreparedExternalTask, dc as TaskResult, de as TaskTransition, bG as MemberStats, bH as MemberStatus, N as AgentMiddleware, dv as ToolCallDecision } from '../instance-Bg61WSyz.js';
|
|
2
|
-
export { aJ as CoordinatorNotificationKind, aK as CoordinatorRoundEvent, be as ExternalTaskControl, bg as GuidancePayload, bt as IdleNotificationPayload, bu as InMemoryMailboxStore, bv as InMemoryTaskBoardStore, bC as MailboxStore, bD as MailboxSubscriber, bE as MemberRegisteredEvent, bI as MemberStatusChangedEvent, bM as MessageInput, bN as MessageKind, bP as MessagePayload, bR as MessageSentEvent, bX as NotificationPriority, c1 as PermissionForwardedEvent, c3 as PermissionRequestPayload, c4 as PermissionResolvedEvent, c5 as PermissionResponsePayload, c6 as PlanCreatedEvent, c7 as PlannedTask, cz as ShutdownRequestPayload, cA as ShutdownRequestedEvent, cB as ShutdownResolvedEvent, cC as ShutdownResponsePayload, cX as SynthesisCompleteEvent, c_ as TERMINAL_STATUSES, c$ as TaskAbortedEvent, d1 as TaskBoardStore, d2 as TaskCompletedEvent, d4 as TaskConflictError, d5 as TaskCreateInput, d6 as TaskCreatedEvent, d9 as TaskExecutorInput, da as TaskFailedEvent, dd as TaskStatus, df as TaskTransitionEvent, dg as TaskTransitionReason, dl as TeamNotificationEvent, dp as TeamStartedEvent, dq as TeamStoppedEvent, dJ as WorkerReportPayload, dN as buildCoordinatorNotificationEvent } from '../instance-Bg61WSyz.js';
|
|
3
|
-
import { R as ReasoningLevel } from '../types-CQaXbRsS.js';
|
|
4
|
-
import '../types-C_LCeYNg.js';
|
|
5
|
-
import 'ai';
|
|
6
|
-
import '../types-RSCv7nQ4.js';
|
|
7
|
-
import 'zod';
|
|
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
|
-
interface CoordinatorInboxItem {
|
|
16
|
-
id: string;
|
|
17
|
-
kind: "user-message" | "notification";
|
|
18
|
-
createdAt: string;
|
|
19
|
-
body: string;
|
|
20
|
-
notification?: CoordinatorNotification;
|
|
21
|
-
}
|
|
22
|
-
interface CoordinatorRuntimeStatus {
|
|
23
|
-
phase: "ready" | "running" | "waiting" | "error";
|
|
24
|
-
message: string;
|
|
25
|
-
pendingInboxCount: number;
|
|
26
|
-
activeTaskCount: number;
|
|
27
|
-
}
|
|
28
|
-
interface CoordinatorStatus {
|
|
29
|
-
phase: "thinking" | "waiting" | "done";
|
|
30
|
-
round: number;
|
|
31
|
-
message: string;
|
|
32
|
-
}
|
|
33
|
-
interface WorkerReport {
|
|
34
|
-
messageId: string;
|
|
35
|
-
memberId: string;
|
|
36
|
-
taskId?: string;
|
|
37
|
-
createdAt?: string;
|
|
38
|
-
message: string;
|
|
39
|
-
}
|
|
40
|
-
interface CoordinatorRound {
|
|
41
|
-
number: number;
|
|
42
|
-
assigned: Array<{
|
|
43
|
-
taskId: string;
|
|
44
|
-
memberId: string;
|
|
45
|
-
title: string;
|
|
46
|
-
}>;
|
|
47
|
-
messaged: Array<{
|
|
48
|
-
memberId: string;
|
|
49
|
-
}>;
|
|
50
|
-
stopped: string[];
|
|
51
|
-
completions: TaskCompletion[];
|
|
52
|
-
reports: WorkerReport[];
|
|
53
|
-
response: string;
|
|
54
|
-
usage: TokenUsage;
|
|
55
|
-
}
|
|
56
|
-
interface CoordinatorLoopOptions {
|
|
57
|
-
maxRounds?: number;
|
|
58
|
-
waitTimeoutMs?: number;
|
|
59
|
-
onRound?: (round: CoordinatorRound) => void | Promise<void>;
|
|
60
|
-
onStatus?: (status: CoordinatorStatus) => void;
|
|
61
|
-
onCoordinatorEvent?: (event: AgentEvent) => void;
|
|
62
|
-
onLog?: (message: string) => void;
|
|
63
|
-
coordinatorReasoningLevel?: ReasoningLevel;
|
|
64
|
-
}
|
|
65
|
-
interface CoordinatorLoopResult {
|
|
66
|
-
response: string;
|
|
67
|
-
rounds: CoordinatorRound[];
|
|
68
|
-
usage: TokenUsage;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
1
|
/**
|
|
72
|
-
* Team
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
* - Event-driven via TeamEvent emitter instead of mailbox system messages
|
|
96
|
-
* - Members tracked as `{ agent, member, role }` tuples
|
|
97
|
-
* - `guide()` method for mid-task interventions via InterventionController
|
|
98
|
-
* - Configurable `onEvent` callback instead of coupling to a specific event bus
|
|
99
|
-
*
|
|
100
|
-
* Execution, work-loop, and shutdown logic are extracted into
|
|
101
|
-
* focused modules to keep this file manageable:
|
|
102
|
-
* - `execution.ts` — task dispatch and Agent.run() lifecycle
|
|
103
|
-
* - `work-loop.ts` — persistent idle loop and auto-claim
|
|
104
|
-
* - `shutdown.ts` — two-phase graceful shutdown protocol
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Team coordinator — manages a team of agents working in parallel.
|
|
109
|
-
*
|
|
110
|
-
* ```typescript
|
|
111
|
-
* const team = createTeamCoordinator({
|
|
112
|
-
* lead: agent,
|
|
113
|
-
* leadSessionId: "main",
|
|
114
|
-
* roles: [explorerRole, coderRole, reviewerRole],
|
|
115
|
-
* });
|
|
116
|
-
*
|
|
117
|
-
* await team.start();
|
|
118
|
-
* await team.registerAll();
|
|
119
|
-
* await team.queue({ title: "Explore codebase", prompt: "...", memberId: "explorer" });
|
|
120
|
-
* await team.queue({ title: "Implement feature", prompt: "...", dependsOn: [task1.id] });
|
|
121
|
-
* await team.waitForAll();
|
|
122
|
-
* const result = await team.synthesize("Build a REST API");
|
|
123
|
-
* await team.stop();
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
declare class TeamCoordinator implements CoordinatorCtx {
|
|
127
|
-
readonly teamId: string;
|
|
128
|
-
/** @internal */ readonly lead: Agent;
|
|
129
|
-
/** @internal */ readonly leadSessionId: string;
|
|
130
|
-
/** @internal */ readonly createId: () => string;
|
|
131
|
-
private readonly roles;
|
|
132
|
-
/** @internal */ readonly members: Map<string, MemberRuntime>;
|
|
133
|
-
/** @internal */ readonly taskBoard: TaskBoard;
|
|
134
|
-
/** @internal */ readonly mailbox: Mailbox;
|
|
135
|
-
private readonly onEvent?;
|
|
136
|
-
private readonly eventListeners;
|
|
137
|
-
private readonly signal?;
|
|
138
|
-
/** @internal */ readonly workLoopEnabled: boolean;
|
|
139
|
-
/** @internal */ readonly taskDispatchMode: TaskDispatchMode;
|
|
140
|
-
/** @internal */ readonly pollIntervalMs: number;
|
|
141
|
-
/** @internal */ readonly onPermissionRequest?: PermissionHandler;
|
|
142
|
-
/** @internal */ readonly beforeIteration?: TeamCoordinatorConfig["beforeIteration"];
|
|
143
|
-
/** @internal */ readonly sharedPermissions?: TeamCoordinatorConfig["sharedPermissions"];
|
|
144
|
-
/** @internal */ readonly taskExecutor?: TaskExecutor;
|
|
145
|
-
private readonly externalTaskControl?;
|
|
146
|
-
/** @internal */ started: boolean;
|
|
147
|
-
private readonly onLog?;
|
|
148
|
-
private readonly logger?;
|
|
149
|
-
private activeCoordinatorTurn?;
|
|
150
|
-
private mailboxUnsubscribe?;
|
|
151
|
-
private coordinatorAgent?;
|
|
152
|
-
private coordinatorSessionId?;
|
|
153
|
-
/** @internal */ coordinatorInbox: CoordinatorInboxItem[];
|
|
154
|
-
/** @internal */ coordinatorProcessing: boolean;
|
|
155
|
-
/** @internal */ coordinatorReschedule: boolean;
|
|
156
|
-
private coordinatorStatus;
|
|
157
|
-
private readonly coordinatorEventListeners;
|
|
158
|
-
private readonly coordinatorStatusListeners;
|
|
159
|
-
private coordinatorIdleResolvers;
|
|
160
|
-
/** @internal */ coordinatorRoundNumber: number;
|
|
161
|
-
private coordinatorRunSequence;
|
|
162
|
-
private coordinatorTurnState;
|
|
163
|
-
/** @internal Structured log output — writes to both logger and onLog when provided. */
|
|
164
|
-
log(msg: string): void;
|
|
165
|
-
private dispatchEvent;
|
|
166
|
-
subscribeTeamEvents(listener: (event: TeamEvent) => void | Promise<void>): () => void;
|
|
167
|
-
/** @internal */
|
|
168
|
-
publishCoordinatorEvent(event: AgentEvent): void;
|
|
169
|
-
/** @internal */
|
|
170
|
-
publishCoordinatorStatus(status: Partial<CoordinatorRuntimeStatus>): void;
|
|
171
|
-
/** @internal */
|
|
172
|
-
resolveCoordinatorIdleWaiters(): void;
|
|
173
|
-
constructor(config: TeamCoordinatorConfig);
|
|
174
|
-
start(): Promise<void>;
|
|
175
|
-
stop(): Promise<void>;
|
|
176
|
-
/**
|
|
177
|
-
* Register a team member from a role.
|
|
178
|
-
* Forks the lead agent with the role's specialization.
|
|
179
|
-
*/
|
|
180
|
-
register(roleName: string, memberId?: string): Promise<TeamMember>;
|
|
181
|
-
/**
|
|
182
|
-
* Register all roles (or a subset) as team members.
|
|
183
|
-
*/
|
|
184
|
-
registerAll(roleNames?: string[]): Promise<TeamMember[]>;
|
|
185
|
-
/**
|
|
186
|
-
* List available role names.
|
|
187
|
-
*/
|
|
188
|
-
listRoles(): string[];
|
|
189
|
-
/**
|
|
190
|
-
* Queue a task. If dependencies are met and a member is idle,
|
|
191
|
-
* the task is dispatched immediately.
|
|
192
|
-
*/
|
|
193
|
-
queue(input: QueueTaskInput): Promise<TeamTask>;
|
|
194
|
-
/**
|
|
195
|
-
* Dispatch all pending tasks to idle members.
|
|
196
|
-
* Called automatically after queue/complete/fail/cancel.
|
|
197
|
-
*/
|
|
198
|
-
dispatchReady(): Promise<TeamTask[]>;
|
|
199
|
-
/**
|
|
200
|
-
* Wait for a specific task to reach a terminal state.
|
|
201
|
-
*/
|
|
202
|
-
waitForTask(taskId: string, timeoutMs?: number): Promise<TaskCompletion>;
|
|
203
|
-
/**
|
|
204
|
-
* Wait for all tasks to reach terminal states.
|
|
205
|
-
*/
|
|
206
|
-
waitForAll(timeoutMs?: number): Promise<TaskCompletion[]>;
|
|
207
|
-
/**
|
|
208
|
-
* Cancel a task. If it's running, the task's AbortController fires.
|
|
209
|
-
* Cascades to dependent tasks.
|
|
210
|
-
*/
|
|
211
|
-
cancel(taskId: string, reason?: string): Promise<TeamTask>;
|
|
212
|
-
/**
|
|
213
|
-
* Abort a running task. The member returns to idle and can pick up
|
|
214
|
-
* new work. Unlike `cancel()`, abort preserves downstream tasks by
|
|
215
|
-
* leaving them blocked on the aborted prerequisite.
|
|
216
|
-
*/
|
|
217
|
-
abort(taskId: string, reason?: string): Promise<void>;
|
|
218
|
-
/**
|
|
219
|
-
* Send a guidance message to a running member via intervention.
|
|
220
|
-
* If the member is idle, queues a direct-message task instead.
|
|
221
|
-
*/
|
|
222
|
-
guide(memberId: string, message: string): Promise<void>;
|
|
223
|
-
/**
|
|
224
|
-
* Broadcast a message to all members. Active members receive it
|
|
225
|
-
* as an intervention; idle members see it on their next task.
|
|
226
|
-
*/
|
|
227
|
-
broadcast(message: string): Promise<TeamMessage>;
|
|
228
|
-
/**
|
|
229
|
-
* Request graceful shutdown of a specific member.
|
|
230
|
-
*
|
|
231
|
-
* - If member is idle, auto-accepts and goes offline immediately
|
|
232
|
-
* - If member is busy, marks as shutting-down and waits for current
|
|
233
|
-
* task to finish before going offline
|
|
234
|
-
* - Returns true if shutdown succeeded within the timeout
|
|
235
|
-
*/
|
|
236
|
-
requestShutdown(memberId: string, reason?: string, timeoutMs?: number): Promise<boolean>;
|
|
237
|
-
/**
|
|
238
|
-
* Gracefully shut down all members.
|
|
239
|
-
*/
|
|
240
|
-
shutdown(reason?: string, timeoutMs?: number): Promise<void>;
|
|
241
|
-
/**
|
|
242
|
-
* Handle a permission request forwarded from a team member.
|
|
243
|
-
* Called by the `teamPermissionPolicy` middleware when it has
|
|
244
|
-
* a `forwardApproval` callback pointing at the coordinator.
|
|
245
|
-
*/
|
|
246
|
-
handlePermissionRequest(memberId: string, tool: string, args: unknown): Promise<{
|
|
247
|
-
decision: "allow" | "deny";
|
|
248
|
-
reason?: string;
|
|
249
|
-
}>;
|
|
250
|
-
/**
|
|
251
|
-
* Create a `forwardApproval` callback for `teamPermissionPolicy`
|
|
252
|
-
* that routes through this coordinator's permission handler.
|
|
253
|
-
*/
|
|
254
|
-
createPermissionForwarder(memberId: string): (_memberId: string, tool: string, args: unknown, _ctx?: unknown) => Promise<{
|
|
255
|
-
action: "allow" | "deny";
|
|
256
|
-
reason?: string;
|
|
257
|
-
}>;
|
|
258
|
-
/** @internal */
|
|
259
|
-
beginCoordinatorTurnState(): {
|
|
260
|
-
actions: {
|
|
261
|
-
assigned: Array<{
|
|
262
|
-
taskId: string;
|
|
263
|
-
memberId: string;
|
|
264
|
-
title: string;
|
|
265
|
-
}>;
|
|
266
|
-
sentMessages: Array<{
|
|
267
|
-
memberId: string;
|
|
268
|
-
}>;
|
|
269
|
-
abortedTaskIds: string[];
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
/** @internal */
|
|
273
|
-
getActiveCoordinatorTurnState(): {
|
|
274
|
-
actions: {
|
|
275
|
-
assigned: Array<{
|
|
276
|
-
taskId: string;
|
|
277
|
-
memberId: string;
|
|
278
|
-
title: string;
|
|
279
|
-
}>;
|
|
280
|
-
sentMessages: Array<{
|
|
281
|
-
memberId: string;
|
|
282
|
-
}>;
|
|
283
|
-
abortedTaskIds: string[];
|
|
284
|
-
};
|
|
285
|
-
};
|
|
286
|
-
/** @internal */
|
|
287
|
-
endCoordinatorTurnState(): void;
|
|
288
|
-
/** @internal */
|
|
289
|
-
getCoordinatorInboxSize(): number;
|
|
290
|
-
/** @internal */
|
|
291
|
-
getActiveTaskCount(): Promise<number>;
|
|
292
|
-
/** @internal */
|
|
293
|
-
ensureCoordinatorAgent(): Agent;
|
|
294
|
-
/** @internal */
|
|
295
|
-
getCoordinatorSessionId(): string;
|
|
296
|
-
private resetCoordinatorRunSession;
|
|
297
|
-
private enqueueCoordinatorInboxItem;
|
|
298
|
-
private enqueueCoordinatorNotification;
|
|
299
|
-
/** @internal */
|
|
300
|
-
scheduleCoordinatorProcessing(): void;
|
|
301
|
-
/** @internal */ autonomousTurnCount: number;
|
|
302
|
-
waitForCoordinatorIdle(): Promise<void>;
|
|
303
|
-
submitToCoordinator(message: string): string;
|
|
304
|
-
subscribeCoordinatorEvents(listener: (event: AgentEvent) => void): () => void;
|
|
305
|
-
subscribeCoordinatorStatus(listener: (status: CoordinatorRuntimeStatus) => void): () => void;
|
|
306
|
-
getCoordinatorStatus(): CoordinatorRuntimeStatus;
|
|
307
|
-
/** @internal */
|
|
308
|
-
attachCoordinatorTurn(agent: Agent, sessionId: string): void;
|
|
309
|
-
/** @internal */
|
|
310
|
-
setCoordinatorTurnOpen(open: boolean): void;
|
|
311
|
-
/** @internal */
|
|
312
|
-
detachCoordinatorTurn(agent?: Agent): void;
|
|
313
|
-
/**
|
|
314
|
-
* Run the coordinator in an iterative loop.
|
|
315
|
-
*
|
|
316
|
-
* The lead agent is forked with delegation tools and a coordinator
|
|
317
|
-
* system prompt. It reasons about the request, assigns tasks to
|
|
318
|
-
* teammates, receives results, and continues until all work is done.
|
|
319
|
-
*
|
|
320
|
-
* This replaces the plan → fan-out → synthesize pipeline with a
|
|
321
|
-
* dynamic multi-round conversation where the coordinator decides
|
|
322
|
-
* what to delegate, how to react to results, and when it's done.
|
|
323
|
-
*
|
|
324
|
-
* Members must be registered before calling this method.
|
|
325
|
-
*
|
|
326
|
-
* @param prompt - The user's request
|
|
327
|
-
* @param options - Loop configuration (max rounds, timeouts, progress callback)
|
|
328
|
-
*/
|
|
329
|
-
run(prompt: string, options?: CoordinatorLoopOptions): Promise<CoordinatorLoopResult>;
|
|
330
|
-
plan(prompt: string, memberIds?: string[]): Promise<TeamPlan>;
|
|
331
|
-
planAndExecute(prompt: string, memberIds?: string[]): Promise<{
|
|
332
|
-
plan: TeamPlan;
|
|
333
|
-
tasks: TeamTask[];
|
|
334
|
-
}>;
|
|
335
|
-
/**
|
|
336
|
-
* Use the lead agent to synthesize all completed task results
|
|
337
|
-
* into a single coherent response.
|
|
338
|
-
*
|
|
339
|
-
* @param originalPrompt - The original task/prompt
|
|
340
|
-
* @param taskIds - Optional subset of task IDs to synthesize (defaults to all terminal tasks)
|
|
341
|
-
*/
|
|
342
|
-
synthesize(originalPrompt: string, taskIds?: string[]): Promise<SynthesisResult>;
|
|
343
|
-
snapshot(): Promise<TeamSnapshot>;
|
|
344
|
-
listMembers(): Promise<TeamMember[]>;
|
|
345
|
-
listTasks(filter?: TaskListFilter): Promise<TeamTask[]>;
|
|
346
|
-
listMessages(filter?: Omit<MessageListFilter, "teamId">): Promise<TeamMessage[]>;
|
|
347
|
-
getMemberSessionId(memberId: string): string;
|
|
348
|
-
getMemberRole(memberId: string): string;
|
|
349
|
-
prepareTaskForExternalExecution(taskId: string, runId: string): Promise<PreparedExternalTask | undefined>;
|
|
350
|
-
completeExternalTask(taskId: string, result: TaskResult): Promise<{
|
|
351
|
-
task: TeamTask;
|
|
352
|
-
transitions: TaskTransition[];
|
|
353
|
-
} | undefined>;
|
|
354
|
-
failExternalTask(taskId: string, error: string): Promise<{
|
|
355
|
-
task: TeamTask;
|
|
356
|
-
transitions: TaskTransition[];
|
|
357
|
-
} | undefined>;
|
|
358
|
-
abortExternalTask(taskId: string, reason: string): Promise<{
|
|
359
|
-
task: TeamTask;
|
|
360
|
-
transitions: TaskTransition[];
|
|
361
|
-
} | undefined>;
|
|
362
|
-
getTask(taskId: string): Promise<TeamTask | undefined>;
|
|
363
|
-
/**
|
|
364
|
-
* Get aggregate stats for a member.
|
|
365
|
-
* Returns undefined if the member is not registered.
|
|
366
|
-
*/
|
|
367
|
-
getMemberStats(memberId: string): MemberStats | undefined;
|
|
368
|
-
/**
|
|
369
|
-
* Subscribe to a member's agent events (text-delta, tool-start, etc.).
|
|
370
|
-
* Returns an unsubscribe function. Throws if the member is not registered.
|
|
371
|
-
*/
|
|
372
|
-
onMemberEvent(memberId: string, handler: (event: AgentEvent) => void): () => void;
|
|
373
|
-
/**
|
|
374
|
-
* Serialize the coordinator state for persistence / resume.
|
|
375
|
-
* Returns snapshot + member stats, enough to reconstruct state.
|
|
376
|
-
*/
|
|
377
|
-
toJSON(): Promise<{
|
|
378
|
-
teamId: string;
|
|
379
|
-
snapshot: TeamSnapshot;
|
|
380
|
-
memberStats: Record<string, MemberStats>;
|
|
381
|
-
}>;
|
|
382
|
-
/** @internal */
|
|
383
|
-
updateMemberStatus(memberId: string, status: MemberStatus, activeTaskId: string | undefined): Promise<void>;
|
|
384
|
-
private requireMember;
|
|
385
|
-
/** @internal */
|
|
386
|
-
emit(event: TeamEvent): Promise<void>;
|
|
387
|
-
/** @internal */
|
|
388
|
-
emitTransitions(transitions: TaskTransition[]): Promise<void>;
|
|
389
|
-
private finalizeExternallyTerminatedTask;
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* Create a team coordinator.
|
|
393
|
-
*
|
|
394
|
-
* ```typescript
|
|
395
|
-
* const team = createTeamCoordinator({
|
|
396
|
-
* lead: agent,
|
|
397
|
-
* leadSessionId: "main",
|
|
398
|
-
* roles: [explorerRole, reviewerRole],
|
|
399
|
-
* onEvent: (event) => console.log(event.type),
|
|
400
|
-
* });
|
|
401
|
-
* ```
|
|
402
|
-
*/
|
|
403
|
-
declare function createTeamCoordinator(config: TeamCoordinatorConfig): TeamCoordinator;
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Team Permission Policy
|
|
407
|
-
*
|
|
408
|
-
* Extends the existing approval middleware to support team-wide
|
|
409
|
-
* permission delegation. When a coordinator creates team members,
|
|
410
|
-
* it can install a `teamPermissionPolicy` middleware that:
|
|
411
|
-
*
|
|
412
|
-
* 1. Applies team-wide allow/deny rules to all member tool calls
|
|
413
|
-
* 2. Forwards unresolved approvals to the coordinator (lead agent)
|
|
414
|
-
* 3. Propagates "remember" decisions to all team members
|
|
415
|
-
*
|
|
416
|
-
* This is layered ON TOP of the existing `approvalMiddleware` —
|
|
417
|
-
* it doesn't replace it. Members inherit the lead's approval rules
|
|
418
|
-
* via fork(), and the team policy adds team-specific delegation.
|
|
419
|
-
*
|
|
420
|
-
* Design choices vs ccsource:
|
|
421
|
-
* - No filesystem polling for permission responses — uses callbacks
|
|
422
|
-
* - No separate sandbox permission path — uses standard approval pipeline
|
|
423
|
-
* - Team rules are typed objects, not mailbox message payloads
|
|
424
|
-
* - Integrates with existing `beforeToolCall` middleware contract
|
|
425
|
-
*/
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* A team-wide permission rule.
|
|
429
|
-
*
|
|
430
|
-
* Rules are evaluated in order — first match wins.
|
|
431
|
-
*/
|
|
432
|
-
interface TeamPermissionRule {
|
|
433
|
-
/** Tool name to match (exact or glob-style with `*`) */
|
|
434
|
-
tool: string;
|
|
435
|
-
/** Optional approval pattern to match against the tool input */
|
|
436
|
-
pattern?: string;
|
|
437
|
-
/** Member IDs this rule applies to (undefined = all members) */
|
|
438
|
-
members?: string[];
|
|
439
|
-
/** Whether to allow or deny */
|
|
440
|
-
action: "allow" | "deny";
|
|
441
|
-
/** Optional reason (shown to model on deny) */
|
|
442
|
-
reason?: string;
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Callback for forwarding approval requests to the coordinator.
|
|
446
|
-
* Returns the coordinator's decision.
|
|
447
|
-
*/
|
|
448
|
-
type ApprovalForwarder = (memberId: string, tool: string, args: unknown, ctx: Parameters<NonNullable<AgentMiddleware["beforeToolCall"]>>[2]) => Promise<ToolCallDecision>;
|
|
449
|
-
/**
|
|
450
|
-
* Configuration for the team permission policy middleware.
|
|
451
|
-
*/
|
|
452
|
-
interface TeamPermissionPolicyConfig {
|
|
453
|
-
/** The member ID this middleware is installed on */
|
|
454
|
-
memberId: string;
|
|
455
|
-
/** Team-wide rules (evaluated first, before forwarding) */
|
|
456
|
-
rules?: TeamPermissionRule[];
|
|
457
|
-
/**
|
|
458
|
-
* Forward unresolved approvals to this callback.
|
|
459
|
-
* If not provided, unresolved tools are allowed (fall through
|
|
460
|
-
* to the member's own approval middleware).
|
|
461
|
-
*/
|
|
462
|
-
forwardApproval?: ApprovalForwarder;
|
|
463
|
-
/**
|
|
464
|
-
* Callback when a "remember" decision is made — the coordinator
|
|
465
|
-
* can propagate it to all members by updating their rule sets.
|
|
466
|
-
*/
|
|
467
|
-
onRemember?: (rule: TeamPermissionRule) => void | Promise<void>;
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* Create a team permission policy middleware.
|
|
471
|
-
*
|
|
472
|
-
* Install this on forked member agents to enforce team-wide
|
|
473
|
-
* permission rules and optionally forward approvals to the
|
|
474
|
-
* coordinator.
|
|
475
|
-
*
|
|
476
|
-
* ```typescript
|
|
477
|
-
* const memberAgent = lead.fork({
|
|
478
|
-
* name: "explorer",
|
|
479
|
-
* additionalMiddleware: [
|
|
480
|
-
* teamPermissionPolicy({
|
|
481
|
-
* memberId: "explorer",
|
|
482
|
-
* rules: [
|
|
483
|
-
* { tool: "read_*", action: "allow" },
|
|
484
|
-
* { tool: "write_*", action: "deny", reason: "Explorer is read-only" },
|
|
485
|
-
* ],
|
|
486
|
-
* }),
|
|
487
|
-
* ],
|
|
488
|
-
* });
|
|
489
|
-
* ```
|
|
490
|
-
*/
|
|
491
|
-
declare function teamPermissionPolicy(config: TeamPermissionPolicyConfig): AgentMiddleware;
|
|
492
|
-
|
|
493
|
-
interface CoordinatorRosterMember {
|
|
494
|
-
id: string;
|
|
495
|
-
role: string;
|
|
496
|
-
description?: string;
|
|
497
|
-
}
|
|
498
|
-
interface CoordinatorTaskNotificationLike {
|
|
499
|
-
taskId: string;
|
|
500
|
-
memberId: string;
|
|
501
|
-
title: string;
|
|
502
|
-
status: string;
|
|
503
|
-
result?: TaskResult;
|
|
504
|
-
error?: string;
|
|
505
|
-
}
|
|
506
|
-
interface CoordinatorWorkerReportLike {
|
|
507
|
-
messageId?: string;
|
|
508
|
-
memberId: string;
|
|
509
|
-
taskId?: string;
|
|
510
|
-
createdAt?: string;
|
|
511
|
-
message: string;
|
|
512
|
-
}
|
|
513
|
-
declare const coordinatorToolDescriptions: {
|
|
514
|
-
readonly assignTask: (memberList: string) => string;
|
|
515
|
-
readonly sendMessage: string;
|
|
516
|
-
readonly abortTask: string;
|
|
517
|
-
};
|
|
518
|
-
declare function buildCoordinatorSystemPrompt(members: CoordinatorRosterMember[]): string;
|
|
519
|
-
declare function formatCoordinatorTaskNotifications(notifications: CoordinatorTaskNotificationLike[]): string;
|
|
520
|
-
declare function formatCoordinatorWorkerReports(reports: CoordinatorWorkerReportLike[]): string;
|
|
521
|
-
declare function formatCoordinatorRoundMessage(notifications: CoordinatorTaskNotificationLike[], reports: CoordinatorWorkerReportLike[]): string;
|
|
522
|
-
|
|
523
|
-
interface CoordinatorRoundTransitionInput {
|
|
524
|
-
reasonAssignmentsCount: number;
|
|
525
|
-
activeTaskCount: number;
|
|
526
|
-
terminalAfterEvent: boolean;
|
|
527
|
-
notifications: CoordinatorTaskNotificationLike[];
|
|
528
|
-
reports: CoordinatorWorkerReportLike[];
|
|
529
|
-
reasonResponse: string;
|
|
530
|
-
roundResponse: string;
|
|
531
|
-
blockedMessage: string;
|
|
532
|
-
}
|
|
533
|
-
type CoordinatorRoundTransition = {
|
|
534
|
-
kind: "done";
|
|
535
|
-
finalResponse: string;
|
|
536
|
-
} | {
|
|
537
|
-
kind: "wait";
|
|
538
|
-
nextMessage: string;
|
|
539
|
-
} | {
|
|
540
|
-
kind: "continue";
|
|
541
|
-
nextMessage: string;
|
|
542
|
-
};
|
|
543
|
-
declare function addTokenUsage(total: TokenUsage, usage?: TokenUsage): TokenUsage;
|
|
544
|
-
declare function evaluateCoordinatorRoundTransition(input: CoordinatorRoundTransitionInput): CoordinatorRoundTransition;
|
|
545
|
-
|
|
546
|
-
export { type ApprovalForwarder, type CoordinatorInboxItem, type CoordinatorLoopOptions, type CoordinatorLoopResult, CoordinatorNotification, type CoordinatorRosterMember, type CoordinatorRound, type CoordinatorRoundTransition, type CoordinatorRoundTransitionInput, type CoordinatorRuntimeStatus, type CoordinatorStatus, type CoordinatorTaskNotificationLike, type CoordinatorWorkerReportLike, Mailbox, MemberRuntime, MemberStats, MemberStatus, MessageListFilter, PermissionHandler, PreparedExternalTask, QueueTaskInput, SynthesisResult, TaskBoard, TaskCompletion, TaskDispatchMode, TaskExecutor, TaskListFilter, TaskResult, TaskTransition, TeamCoordinator, TeamCoordinatorConfig, TeamEvent, TeamMember, TeamMessage, type TeamPermissionPolicyConfig, type TeamPermissionRule, TeamPlan, TeamSnapshot, TeamTask, type WorkerReport, addTokenUsage, buildCoordinatorSystemPrompt, coordinatorToolDescriptions, createTeamCoordinator, evaluateCoordinatorRoundTransition, formatCoordinatorRoundMessage, formatCoordinatorTaskNotifications, formatCoordinatorWorkerReports, teamPermissionPolicy };
|
|
2
|
+
* Team — Multi-agent coordination for @cuylabs/agent-core
|
|
3
|
+
*
|
|
4
|
+
* Available via:
|
|
5
|
+
* import { createTeamCoordinator, TaskBoard, Mailbox } from "@cuylabs/agent-core";
|
|
6
|
+
* import { ... } from "@cuylabs/agent-core/team";
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
export type { MemberStatus, MessageKind, MessagePayload, ShutdownRequestPayload, ShutdownResponsePayload, PermissionRequestPayload, PermissionResponsePayload, IdleNotificationPayload, GuidancePayload, WorkerReportPayload, TaskResult, TaskStatus, TaskTransition, TaskTransitionReason, TeamMember, TeamMessage, TeamSnapshot, TeamTask, } from "./types.js";
|
|
11
|
+
export { TERMINAL_STATUSES } from "./types.js";
|
|
12
|
+
export { TaskBoard, InMemoryTaskBoardStore, TaskConflictError, type TaskBoardStore, type TaskCreateInput, type TaskListFilter, } from "./task-board.js";
|
|
13
|
+
export { Mailbox, InMemoryMailboxStore, type MailboxStore, type MailboxSubscriber, type MessageInput, type MessageListFilter, } from "./mailbox.js";
|
|
14
|
+
export { TeamCoordinator, createTeamCoordinator, } from "./coordinator/coordinator.js";
|
|
15
|
+
export type { TeamCoordinatorConfig, QueueTaskInput, TaskCompletion, SynthesisResult, PlannedTask, TeamPlan, MemberRuntime, MemberStats, PermissionHandler, TaskExecutor, TaskDispatchMode, ExternalTaskControl, PreparedExternalTask, TaskExecutorInput, } from "./coordinator/types.js";
|
|
16
|
+
export type { CoordinatorLoopOptions, CoordinatorLoopResult, CoordinatorRound, CoordinatorStatus, WorkerReport, } from "./coordinator/turn.js";
|
|
17
|
+
export { teamPermissionPolicy, type TeamPermissionPolicyConfig, type TeamPermissionRule, type ApprovalForwarder, } from "./permissions.js";
|
|
18
|
+
export type { TeamEvent, TeamStartedEvent, TeamStoppedEvent, MemberRegisteredEvent, MemberStatusChangedEvent, PlanCreatedEvent, CoordinatorRoundEvent, TaskCreatedEvent, TaskTransitionEvent, TaskCompletedEvent, TaskFailedEvent, TaskAbortedEvent, MessageSentEvent, SynthesisCompleteEvent, ShutdownRequestedEvent, ShutdownResolvedEvent, PermissionForwardedEvent, PermissionResolvedEvent, TeamNotificationEvent, } from "./events.js";
|
|
19
|
+
export type { NotificationPriority, CoordinatorNotificationKind, CoordinatorNotification, } from "./notifications.js";
|
|
20
|
+
export { buildCoordinatorNotificationEvent } from "./notifications.js";
|
|
21
|
+
export type { CoordinatorInboxItem, CoordinatorRuntimeStatus, } from "./coordinator/turn.js";
|
|
22
|
+
export { buildCoordinatorSystemPrompt, coordinatorToolDescriptions, formatCoordinatorTaskNotifications, formatCoordinatorWorkerReports, formatCoordinatorRoundMessage, type CoordinatorRosterMember, type CoordinatorTaskNotificationLike, type CoordinatorWorkerReportLike, } from "./coordinator/policy.js";
|
|
23
|
+
export { addTokenUsage, evaluateCoordinatorRoundTransition, type CoordinatorRoundTransitionInput, type CoordinatorRoundTransition, } from "./coordinator/round-engine.js";
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/team/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,YAAY,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,eAAe,EACf,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,eAAe,EACf,WAAW,EACX,QAAQ,EACR,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iCAAiC,EAAE,MAAM,oBAAoB,CAAC;AACvE,YAAY,EACV,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,kCAAkC,EAClC,8BAA8B,EAC9B,6BAA6B,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,GACjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,kCAAkC,EAClC,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,GAChC,MAAM,+BAA+B,CAAC"}
|
package/dist/team/index.js
CHANGED
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
formatCoordinatorTaskNotifications,
|
|
17
17
|
formatCoordinatorWorkerReports,
|
|
18
18
|
teamPermissionPolicy
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-UEEHZ4QH.js";
|
|
20
20
|
import "../chunk-SZ2XBPTW.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-MJML3A2F.js";
|
|
22
22
|
import "../chunk-FII65CN7.js";
|
|
23
23
|
export {
|
|
24
24
|
InMemoryMailboxStore,
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team Mailbox
|
|
3
|
+
*
|
|
4
|
+
* Typed message bus for intra-team communication.
|
|
5
|
+
*
|
|
6
|
+
* `MailboxStore` is the persistence contract. `Mailbox` wraps it with
|
|
7
|
+
* input normalization, auto-derived kind, subscriber fan-out, and
|
|
8
|
+
* defensive cloning. Hosts swap in whatever store fits their deployment
|
|
9
|
+
* (in-memory for single-process, Redis/DB for distributed teams).
|
|
10
|
+
*
|
|
11
|
+
* Design choices:
|
|
12
|
+
* - Messages are immutable once sent — no edits, no deletes
|
|
13
|
+
* - Subscribers are notified via Promise.allSettled (one failure ≠ all fail)
|
|
14
|
+
* - `from` / `to` instead of `senderId` / `recipientId` (more readable)
|
|
15
|
+
* - `teamId` scoped filters so one store can serve multiple teams
|
|
16
|
+
*/
|
|
17
|
+
import type { MessageKind, MessagePayload, TeamMessage } from "./types.js";
|
|
18
|
+
/**
|
|
19
|
+
* Filter options for listing messages.
|
|
20
|
+
*/
|
|
21
|
+
export interface MessageListFilter {
|
|
22
|
+
teamId?: string;
|
|
23
|
+
from?: string;
|
|
24
|
+
to?: string;
|
|
25
|
+
taskId?: string;
|
|
26
|
+
kind?: MessageKind | MessageKind[];
|
|
27
|
+
limit?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Input for sending a new message.
|
|
31
|
+
*/
|
|
32
|
+
export interface MessageInput {
|
|
33
|
+
/** Optional ID (auto-generated if omitted) */
|
|
34
|
+
id?: string;
|
|
35
|
+
teamId: string;
|
|
36
|
+
from: string;
|
|
37
|
+
to?: string;
|
|
38
|
+
kind?: MessageKind;
|
|
39
|
+
body: string;
|
|
40
|
+
payload?: MessagePayload;
|
|
41
|
+
taskId?: string;
|
|
42
|
+
metadata?: Record<string, string>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Subscriber callback — invoked when a new message is sent.
|
|
46
|
+
*/
|
|
47
|
+
export type MailboxSubscriber = (message: TeamMessage) => void | Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Persistence contract for team messages.
|
|
50
|
+
*/
|
|
51
|
+
export interface MailboxStore {
|
|
52
|
+
start?(): Promise<void>;
|
|
53
|
+
stop?(): Promise<void>;
|
|
54
|
+
append(message: TeamMessage): Promise<TeamMessage>;
|
|
55
|
+
list(filter?: MessageListFilter): Promise<TeamMessage[]>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Simple in-memory store — suitable for single-process teams.
|
|
59
|
+
*/
|
|
60
|
+
export declare class InMemoryMailboxStore implements MailboxStore {
|
|
61
|
+
private readonly messages;
|
|
62
|
+
append(message: TeamMessage): Promise<TeamMessage>;
|
|
63
|
+
list(filter?: MessageListFilter): Promise<TeamMessage[]>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Team mailbox — typed message bus with subscriber notifications.
|
|
67
|
+
*/
|
|
68
|
+
export declare class Mailbox {
|
|
69
|
+
private readonly store;
|
|
70
|
+
private readonly subscribers;
|
|
71
|
+
private readonly createId;
|
|
72
|
+
constructor(options?: {
|
|
73
|
+
store?: MailboxStore;
|
|
74
|
+
createId?: () => string;
|
|
75
|
+
});
|
|
76
|
+
start(): Promise<void>;
|
|
77
|
+
stop(): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Send a message. Notifies subscribers after persistence.
|
|
80
|
+
*/
|
|
81
|
+
send(input: MessageInput): Promise<TeamMessage>;
|
|
82
|
+
/**
|
|
83
|
+
* List messages matching the filter.
|
|
84
|
+
*/
|
|
85
|
+
list(filter?: MessageListFilter): Promise<TeamMessage[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Subscribe to new messages. Returns an unsubscribe function.
|
|
88
|
+
*/
|
|
89
|
+
subscribe(subscriber: MailboxSubscriber): () => void;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=mailbox.d.ts.map
|