@wrongstack/core 0.284.0 → 0.285.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/dist/agent-status-tracker.d.ts +74 -0
- package/dist/agent-status-tracker.d.ts.map +1 -0
- package/dist/autophase/auto-phase-planner.d.ts +79 -0
- package/dist/autophase/auto-phase-planner.d.ts.map +1 -0
- package/dist/autophase/auto-phase-runner.d.ts +79 -0
- package/dist/autophase/auto-phase-runner.d.ts.map +1 -0
- package/dist/autophase/checkpoint.d.ts +49 -0
- package/dist/autophase/checkpoint.d.ts.map +1 -0
- package/dist/autophase/index.d.ts +9 -0
- package/dist/autophase/index.d.ts.map +1 -0
- package/dist/autophase/phase-graph-builder.d.ts +46 -0
- package/dist/autophase/phase-graph-builder.d.ts.map +1 -0
- package/dist/autophase/phase-orchestrator.d.ts +150 -0
- package/dist/autophase/phase-orchestrator.d.ts.map +1 -0
- package/dist/autophase/phase-store.d.ts +29 -0
- package/dist/autophase/phase-store.d.ts.map +1 -0
- package/dist/autophase/types.d.ts +329 -0
- package/dist/autophase/types.d.ts.map +1 -0
- package/dist/boot.d.ts +73 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/coordination/adaptive-concurrency.d.ts +63 -0
- package/dist/coordination/adaptive-concurrency.d.ts.map +1 -0
- package/dist/coordination/agent-bridge.d.ts +24 -0
- package/dist/coordination/agent-bridge.d.ts.map +1 -0
- package/dist/coordination/agent-monitor.d.ts +100 -0
- package/dist/coordination/agent-monitor.d.ts.map +1 -0
- package/dist/coordination/agent-subagent-runner.d.ts +74 -0
- package/dist/coordination/agent-subagent-runner.d.ts.map +1 -0
- package/dist/coordination/agents/agent-prompts.d.ts +2 -0
- package/dist/coordination/agents/agent-prompts.d.ts.map +1 -0
- package/dist/coordination/agents/index.d.ts +35 -0
- package/dist/coordination/agents/index.d.ts.map +1 -0
- package/dist/coordination/agents/phase1-discovery.d.ts +4 -0
- package/dist/coordination/agents/phase1-discovery.d.ts.map +1 -0
- package/dist/coordination/agents/phase2-planning.d.ts +4 -0
- package/dist/coordination/agents/phase2-planning.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-build.d.ts +4 -0
- package/dist/coordination/agents/phase3-build.d.ts.map +1 -0
- package/dist/coordination/agents/phase3-techstack.d.ts +13 -0
- package/dist/coordination/agents/phase3-techstack.d.ts.map +1 -0
- package/dist/coordination/agents/phase4-verify.d.ts +4 -0
- package/dist/coordination/agents/phase4-verify.d.ts.map +1 -0
- package/dist/coordination/agents/phase5-review.d.ts +4 -0
- package/dist/coordination/agents/phase5-review.d.ts.map +1 -0
- package/dist/coordination/agents/phase6-domain.d.ts +4 -0
- package/dist/coordination/agents/phase6-domain.d.ts.map +1 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts +4 -0
- package/dist/coordination/agents/phase7-knowledge.d.ts.map +1 -0
- package/dist/coordination/agents/phase8-delivery.d.ts +4 -0
- package/dist/coordination/agents/phase8-delivery.d.ts.map +1 -0
- package/dist/coordination/agents/phase9-meta.d.ts +4 -0
- package/dist/coordination/agents/phase9-meta.d.ts.map +1 -0
- package/dist/coordination/agents/types.d.ts +79 -0
- package/dist/coordination/agents/types.d.ts.map +1 -0
- package/dist/coordination/agents.d.ts +8 -0
- package/dist/coordination/agents.d.ts.map +1 -0
- package/dist/coordination/auto-extend.d.ts +46 -0
- package/dist/coordination/auto-extend.d.ts.map +1 -0
- package/dist/coordination/autonomous-brain.d.ts +154 -0
- package/dist/coordination/autonomous-brain.d.ts.map +1 -0
- package/dist/coordination/autonomous-coordinator.d.ts +239 -0
- package/dist/coordination/autonomous-coordinator.d.ts.map +1 -0
- package/dist/coordination/brain-monitor.d.ts +74 -0
- package/dist/coordination/brain-monitor.d.ts.map +1 -0
- package/dist/coordination/brain.d.ts +104 -0
- package/dist/coordination/brain.d.ts.map +1 -0
- package/dist/coordination/change-manager.d.ts +151 -0
- package/dist/coordination/change-manager.d.ts.map +1 -0
- package/dist/coordination/checkpoint-wiring.d.ts +61 -0
- package/dist/coordination/checkpoint-wiring.d.ts.map +1 -0
- package/dist/coordination/collab-bus.d.ts +132 -0
- package/dist/coordination/collab-bus.d.ts.map +1 -0
- package/dist/coordination/collab-debug.d.ts +302 -0
- package/dist/coordination/collab-debug.d.ts.map +1 -0
- package/dist/coordination/commit-safety.d.ts +72 -0
- package/dist/coordination/commit-safety.d.ts.map +1 -0
- package/dist/coordination/consensus-protocol.d.ts +106 -0
- package/dist/coordination/consensus-protocol.d.ts.map +1 -0
- package/dist/coordination/coordinator/error-classifier.d.ts +15 -0
- package/dist/coordination/coordinator/error-classifier.d.ts.map +1 -0
- package/dist/coordination/delegate-tool.d.ts +101 -0
- package/dist/coordination/delegate-tool.d.ts.map +1 -0
- package/dist/coordination/dep-watcher-bridge.d.ts +47 -0
- package/dist/coordination/dep-watcher-bridge.d.ts.map +1 -0
- package/dist/coordination/dep-watcher.d.ts +74 -0
- package/dist/coordination/dep-watcher.d.ts.map +1 -0
- package/dist/coordination/director/director-errors.d.ts +29 -0
- package/dist/coordination/director/director-errors.d.ts.map +1 -0
- package/dist/coordination/director-construction.d.ts +90 -0
- package/dist/coordination/director-construction.d.ts.map +1 -0
- package/dist/coordination/director-prompts.d.ts +119 -0
- package/dist/coordination/director-prompts.d.ts.map +1 -0
- package/dist/coordination/director-session.d.ts +68 -0
- package/dist/coordination/director-session.d.ts.map +1 -0
- package/dist/coordination/director-tools.d.ts +65 -0
- package/dist/coordination/director-tools.d.ts.map +1 -0
- package/dist/coordination/director.d.ts +802 -0
- package/dist/coordination/director.d.ts.map +1 -0
- package/dist/coordination/dispatcher.d.ts +82 -0
- package/dist/coordination/dispatcher.d.ts.map +1 -0
- package/dist/coordination/file-author-tracker.d.ts +76 -0
- package/dist/coordination/file-author-tracker.d.ts.map +1 -0
- package/dist/coordination/fleet-bus.d.ts +122 -0
- package/dist/coordination/fleet-bus.d.ts.map +1 -0
- package/dist/coordination/fleet-event-validation.d.ts +10 -0
- package/dist/coordination/fleet-event-validation.d.ts.map +1 -0
- package/dist/coordination/fleet-manager.d.ts +234 -0
- package/dist/coordination/fleet-manager.d.ts.map +1 -0
- package/dist/coordination/fleet-spawn.d.ts +102 -0
- package/dist/coordination/fleet-spawn.d.ts.map +1 -0
- package/dist/coordination/fleet-status-tool.d.ts +36 -0
- package/dist/coordination/fleet-status-tool.d.ts.map +1 -0
- package/dist/coordination/fleet-supervisor.d.ts +157 -0
- package/dist/coordination/fleet-supervisor.d.ts.map +1 -0
- package/dist/coordination/fleet.d.ts +96 -0
- package/dist/coordination/fleet.d.ts.map +1 -0
- package/dist/coordination/global-mailbox.d.ts +234 -0
- package/dist/coordination/global-mailbox.d.ts.map +1 -0
- package/dist/coordination/icoordinator.d.ts +97 -0
- package/dist/coordination/icoordinator.d.ts.map +1 -0
- package/dist/coordination/ifleet-manager.d.ts +177 -0
- package/dist/coordination/ifleet-manager.d.ts.map +1 -0
- package/dist/coordination/in-memory-transport.d.ts +12 -0
- package/dist/coordination/in-memory-transport.d.ts.map +1 -0
- package/dist/coordination/index.d.ts +78 -2587
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +739 -254
- package/dist/coordination/index.js.map +7 -1
- package/dist/coordination/knowledge-graph.d.ts +217 -0
- package/dist/coordination/knowledge-graph.d.ts.map +1 -0
- package/dist/coordination/large-answer-store.d.ts +61 -0
- package/dist/coordination/large-answer-store.d.ts.map +1 -0
- package/dist/coordination/mail-tools.d.ts +34 -0
- package/dist/coordination/mail-tools.d.ts.map +1 -0
- package/dist/coordination/mailbox-actions.d.ts +68 -0
- package/dist/coordination/mailbox-actions.d.ts.map +1 -0
- package/dist/coordination/mailbox-health.d.ts +131 -0
- package/dist/coordination/mailbox-health.d.ts.map +1 -0
- package/dist/coordination/mailbox-hooks.d.ts +55 -0
- package/dist/coordination/mailbox-hooks.d.ts.map +1 -0
- package/dist/coordination/mailbox-tool.d.ts +75 -0
- package/dist/coordination/mailbox-tool.d.ts.map +1 -0
- package/dist/{mailbox-types-BGZWrYTJ.d.ts → coordination/mailbox-types.d.ts} +37 -22
- package/dist/coordination/mailbox-types.d.ts.map +1 -0
- package/dist/coordination/mailbox.d.ts +69 -0
- package/dist/coordination/mailbox.d.ts.map +1 -0
- package/dist/coordination/model-matrix.d.ts +98 -0
- package/dist/coordination/model-matrix.d.ts.map +1 -0
- package/dist/coordination/multi-agent-coordinator.d.ts +202 -0
- package/dist/coordination/multi-agent-coordinator.d.ts.map +1 -0
- package/dist/coordination/null-fleet-bus.d.ts +10 -0
- package/dist/coordination/null-fleet-bus.d.ts.map +1 -0
- package/dist/coordination/package-author-tracker.d.ts +87 -0
- package/dist/coordination/package-author-tracker.d.ts.map +1 -0
- package/dist/coordination/package-outdated-watcher.d.ts +83 -0
- package/dist/coordination/package-outdated-watcher.d.ts.map +1 -0
- package/dist/coordination/single-instance-mailbox.d.ts +154 -0
- package/dist/coordination/single-instance-mailbox.d.ts.map +1 -0
- package/dist/coordination/spawn-budget.d.ts +6 -0
- package/dist/coordination/spawn-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-budget.d.ts +323 -0
- package/dist/coordination/subagent-budget.d.ts.map +1 -0
- package/dist/coordination/subagent-nicknames.d.ts +42 -0
- package/dist/coordination/subagent-nicknames.d.ts.map +1 -0
- package/dist/coordination/subagent-result-tool.d.ts +20 -0
- package/dist/coordination/subagent-result-tool.d.ts.map +1 -0
- package/dist/coordination/task-auctioneer.d.ts +143 -0
- package/dist/coordination/task-auctioneer.d.ts.map +1 -0
- package/dist/coordination/task-dag.d.ts +147 -0
- package/dist/coordination/task-dag.d.ts.map +1 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts +50 -0
- package/dist/coordination/techstack-mailbox-consumer.d.ts.map +1 -0
- package/dist/coordination/transport.d.ts +2 -0
- package/dist/coordination/transport.d.ts.map +1 -0
- package/dist/coordination/worktree-task-runner.d.ts +45 -0
- package/dist/coordination/worktree-task-runner.d.ts.map +1 -0
- package/dist/core/agent-internals.d.ts +41 -0
- package/dist/core/agent-internals.d.ts.map +1 -0
- package/dist/core/agent-loop.d.ts +18 -0
- package/dist/core/agent-loop.d.ts.map +1 -0
- package/dist/core/agent-response.d.ts +21 -0
- package/dist/core/agent-response.d.ts.map +1 -0
- package/dist/core/agent-tools.d.ts +21 -0
- package/dist/core/agent-tools.d.ts.map +1 -0
- package/dist/core/agent-types.d.ts +95 -0
- package/dist/core/agent-types.d.ts.map +1 -0
- package/dist/core/agent.d.ts +54 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/btw.d.ts +40 -0
- package/dist/core/btw.d.ts.map +1 -0
- package/dist/core/context.d.ts +269 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/continue-intent.d.ts +92 -0
- package/dist/core/continue-intent.d.ts.map +1 -0
- package/dist/core/continue-to-next-iteration.d.ts +96 -0
- package/dist/core/continue-to-next-iteration.d.ts.map +1 -0
- package/dist/core/conversation-state.d.ts +96 -0
- package/dist/core/conversation-state.d.ts.map +1 -0
- package/dist/core/fallback-model.d.ts +94 -0
- package/dist/core/fallback-model.d.ts.map +1 -0
- package/dist/core/fleet-pulse.d.ts +42 -0
- package/dist/core/fleet-pulse.d.ts.map +1 -0
- package/dist/core/input-builder.d.ts +95 -0
- package/dist/core/input-builder.d.ts.map +1 -0
- package/dist/core/instruction-bundle.d.ts +22 -0
- package/dist/core/instruction-bundle.d.ts.map +1 -0
- package/dist/core/iteration-limit.d.ts +35 -0
- package/dist/core/iteration-limit.d.ts.map +1 -0
- package/dist/core/mailbox-loop.d.ts +63 -0
- package/dist/core/mailbox-loop.d.ts.map +1 -0
- package/dist/core/modes/brief.d.ts +2 -0
- package/dist/core/modes/brief.d.ts.map +1 -0
- package/dist/core/modes/default.d.ts +8 -0
- package/dist/core/modes/default.d.ts.map +1 -0
- package/dist/core/modes/teach.d.ts +2 -0
- package/dist/core/modes/teach.d.ts.map +1 -0
- package/dist/core/provider-runner.d.ts +24 -0
- package/dist/core/provider-runner.d.ts.map +1 -0
- package/dist/core/queued-messages.d.ts +55 -0
- package/dist/core/queued-messages.d.ts.map +1 -0
- package/dist/core/run-env.d.ts +49 -0
- package/dist/core/run-env.d.ts.map +1 -0
- package/dist/core/streaming-response-builder.d.ts +78 -0
- package/dist/core/streaming-response-builder.d.ts.map +1 -0
- package/dist/core/system-prompt-builder.d.ts +213 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -0
- package/dist/defaults/index.d.ts +68 -158
- package/dist/defaults/index.d.ts.map +1 -0
- package/dist/defaults/index.js +1257 -819
- package/dist/defaults/index.js.map +7 -1
- package/dist/execution/auto-compaction-middleware.d.ts +123 -0
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -0
- package/dist/execution/autonomous-runner.d.ts +55 -0
- package/dist/execution/autonomous-runner.d.ts.map +1 -0
- package/dist/execution/autonomy-brain.d.ts +90 -0
- package/dist/execution/autonomy-brain.d.ts.map +1 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts +39 -0
- package/dist/execution/autonomy-prompt-contributor.d.ts.map +1 -0
- package/dist/execution/compaction-core.d.ts +103 -0
- package/dist/execution/compaction-core.d.ts.map +1 -0
- package/dist/execution/compactor.d.ts +56 -0
- package/dist/execution/compactor.d.ts.map +1 -0
- package/dist/execution/design-color.d.ts +31 -0
- package/dist/execution/design-color.d.ts.map +1 -0
- package/dist/execution/design-detect.d.ts +96 -0
- package/dist/execution/design-detect.d.ts.map +1 -0
- package/dist/execution/design-kit-loader.d.ts +53 -0
- package/dist/execution/design-kit-loader.d.ts.map +1 -0
- package/dist/execution/design-materialize.d.ts +32 -0
- package/dist/execution/design-materialize.d.ts.map +1 -0
- package/dist/execution/design-project-store.d.ts +57 -0
- package/dist/execution/design-project-store.d.ts.map +1 -0
- package/dist/execution/design-verify.d.ts +44 -0
- package/dist/execution/design-verify.d.ts.map +1 -0
- package/dist/execution/error-handler.d.ts +34 -0
- package/dist/execution/error-handler.d.ts.map +1 -0
- package/dist/{parallel-eternal-engine-HUrtePLd.d.ts → execution/eternal-autonomy.d.ts} +10 -225
- package/dist/execution/eternal-autonomy.d.ts.map +1 -0
- package/dist/execution/goal-preamble.d.ts +2 -0
- package/dist/execution/goal-preamble.d.ts.map +1 -0
- package/dist/execution/index.d.ts +21 -180
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +465 -180
- package/dist/execution/index.js.map +7 -1
- package/dist/execution/intelligent-compactor.d.ts +85 -0
- package/dist/execution/intelligent-compactor.d.ts.map +1 -0
- package/dist/execution/model-runtime.d.ts +75 -0
- package/dist/execution/model-runtime.d.ts.map +1 -0
- package/dist/execution/parallel-eternal-engine.d.ts +130 -0
- package/dist/execution/parallel-eternal-engine.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.d.ts +12 -13
- package/dist/execution/prompt-enhancer.d.ts.map +1 -0
- package/dist/execution/prompt-enhancer.js +13 -7
- package/dist/execution/prompt-enhancer.js.map +7 -1
- package/dist/execution/prompt-loader.d.ts +52 -0
- package/dist/execution/prompt-loader.d.ts.map +1 -0
- package/dist/execution/provider-runner-impl.d.ts +14 -0
- package/dist/execution/provider-runner-impl.d.ts.map +1 -0
- package/dist/execution/regex-patterns.d.ts +7 -0
- package/dist/execution/regex-patterns.d.ts.map +1 -0
- package/dist/execution/retry-policy.d.ts +35 -0
- package/dist/execution/retry-policy.d.ts.map +1 -0
- package/dist/execution/selective-compactor.d.ts +94 -0
- package/dist/execution/selective-compactor.d.ts.map +1 -0
- package/dist/execution/skill-loader.d.ts +43 -0
- package/dist/execution/skill-loader.d.ts.map +1 -0
- package/dist/execution/strategy-compactor.d.ts +43 -0
- package/dist/execution/strategy-compactor.d.ts.map +1 -0
- package/dist/execution/tool-executor.d.ts +112 -0
- package/dist/execution/tool-executor.d.ts.map +1 -0
- package/dist/extension/extension-points.d.ts +121 -0
- package/dist/extension/extension-points.d.ts.map +1 -0
- package/dist/extension/index.d.ts +3 -10
- package/dist/extension/index.d.ts.map +1 -0
- package/dist/extension/index.js +59 -5
- package/dist/extension/index.js.map +7 -1
- package/dist/extension/registry.d.ts +86 -0
- package/dist/extension/registry.d.ts.map +1 -0
- package/dist/fleet-notifier.d.ts +28 -0
- package/dist/fleet-notifier.d.ts.map +1 -0
- package/dist/hooks/http-executor.d.ts +11 -0
- package/dist/hooks/http-executor.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/registry.d.ts +71 -0
- package/dist/hooks/registry.d.ts.map +1 -0
- package/dist/hooks/runner.d.ts +65 -0
- package/dist/hooks/runner.d.ts.map +1 -0
- package/dist/hooks/shell-executor.d.ts +33 -0
- package/dist/hooks/shell-executor.d.ts.map +1 -0
- package/dist/hooks/shell-hooks-equal.d.ts +15 -0
- package/dist/hooks/shell-hooks-equal.d.ts.map +1 -0
- package/dist/hq/agent-bridge.d.ts +27 -0
- package/dist/hq/agent-bridge.d.ts.map +1 -0
- package/dist/hq/alerts.d.ts +67 -0
- package/dist/hq/alerts.d.ts.map +1 -0
- package/dist/hq/auth-store.d.ts +161 -0
- package/dist/hq/auth-store.d.ts.map +1 -0
- package/dist/hq/brain-bridge.d.ts +37 -0
- package/dist/hq/brain-bridge.d.ts.map +1 -0
- package/dist/hq/commands.d.ts +122 -0
- package/dist/hq/commands.d.ts.map +1 -0
- package/dist/hq/cost-bridge.d.ts +36 -0
- package/dist/hq/cost-bridge.d.ts.map +1 -0
- package/dist/hq/factory.d.ts +66 -0
- package/dist/hq/factory.d.ts.map +1 -0
- package/dist/hq/fleet-bridge.d.ts +39 -0
- package/dist/hq/fleet-bridge.d.ts.map +1 -0
- package/dist/hq/index.d.ts +18 -816
- package/dist/hq/index.d.ts.map +1 -0
- package/dist/hq/index.js +417 -122
- package/dist/hq/index.js.map +7 -1
- package/dist/hq/mailbox-mapper.d.ts +27 -0
- package/dist/hq/mailbox-mapper.d.ts.map +1 -0
- package/dist/hq/persistence.d.ts +121 -0
- package/dist/hq/persistence.d.ts.map +1 -0
- package/dist/hq/protocol.d.ts +560 -0
- package/dist/hq/protocol.d.ts.map +1 -0
- package/dist/hq/publisher.d.ts +177 -0
- package/dist/hq/publisher.d.ts.map +1 -0
- package/dist/hq/redaction.d.ts +30 -0
- package/dist/hq/redaction.d.ts.map +1 -0
- package/dist/hq/session-bridge.d.ts +29 -0
- package/dist/hq/session-bridge.d.ts.map +1 -0
- package/dist/hq/tool-bridge.d.ts +41 -0
- package/dist/hq/tool-bridge.d.ts.map +1 -0
- package/dist/hq/transcript-mapper.d.ts +36 -0
- package/dist/hq/transcript-mapper.d.ts.map +1 -0
- package/dist/hq/worktree-bridge.d.ts +34 -0
- package/dist/hq/worktree-bridge.d.ts.map +1 -0
- package/dist/index.d.ts +108 -2872
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2724 -1344
- package/dist/index.js.map +7 -1
- package/dist/infrastructure/context-manager.d.ts +92 -0
- package/dist/infrastructure/context-manager.d.ts.map +1 -0
- package/dist/infrastructure/index.d.ts +6 -64
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +39 -12
- package/dist/infrastructure/index.js.map +7 -1
- package/dist/infrastructure/logger.d.ts +99 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/mcp-servers.d.ts +83 -0
- package/dist/infrastructure/mcp-servers.d.ts.map +1 -0
- package/dist/{path-resolver-CMS5307d.d.ts → infrastructure/path-resolver.d.ts} +3 -5
- package/dist/infrastructure/path-resolver.d.ts.map +1 -0
- package/dist/infrastructure/token-counter.d.ts +57 -0
- package/dist/infrastructure/token-counter.d.ts.map +1 -0
- package/dist/kernel/container.d.ts +84 -0
- package/dist/kernel/container.d.ts.map +1 -0
- package/dist/{events-Bgnh43r9.d.ts → kernel/events.d.ts} +112 -206
- package/dist/kernel/events.d.ts.map +1 -0
- package/dist/kernel/index.d.ts +6 -107
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +56 -4
- package/dist/kernel/index.js.map +7 -1
- package/dist/kernel/pipeline.d.ts +105 -0
- package/dist/kernel/pipeline.d.ts.map +1 -0
- package/dist/kernel/run-controller.d.ts +55 -0
- package/dist/kernel/run-controller.d.ts.map +1 -0
- package/dist/kernel/tokens.d.ts +53 -0
- package/dist/kernel/tokens.d.ts.map +1 -0
- package/dist/mailbox-attach.d.ts +27 -0
- package/dist/mailbox-attach.d.ts.map +1 -0
- package/dist/middleware/collab-pause.d.ts +73 -0
- package/dist/middleware/collab-pause.d.ts.map +1 -0
- package/dist/models/codex-catalog.d.ts +41 -0
- package/dist/models/codex-catalog.d.ts.map +1 -0
- package/dist/models/index.d.ts +8 -163
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +150 -51
- package/dist/models/index.js.map +7 -1
- package/dist/models/llm-selector.d.ts +47 -0
- package/dist/models/llm-selector.d.ts.map +1 -0
- package/dist/models/mode-store.d.ts +22 -0
- package/dist/models/mode-store.d.ts.map +1 -0
- package/dist/models/model-intelligence.d.ts +56 -0
- package/dist/models/model-intelligence.d.ts.map +1 -0
- package/dist/models/model-router.d.ts +100 -0
- package/dist/models/model-router.d.ts.map +1 -0
- package/dist/models/models-registry.d.ts +106 -0
- package/dist/models/models-registry.d.ts.map +1 -0
- package/dist/models/provider-model-resolve.d.ts +69 -0
- package/dist/models/provider-model-resolve.d.ts.map +1 -0
- package/dist/observability/event-bridge.d.ts +10 -0
- package/dist/observability/event-bridge.d.ts.map +1 -0
- package/dist/observability/health.d.ts +18 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/index.d.ts +9 -354
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +21 -8
- package/dist/observability/index.js.map +7 -1
- package/dist/observability/metrics.d.ts +26 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/otel-tracer.d.ts +41 -0
- package/dist/observability/otel-tracer.d.ts.map +1 -0
- package/dist/observability/otlp-metrics.d.ts +111 -0
- package/dist/observability/otlp-metrics.d.ts.map +1 -0
- package/dist/observability/otlp-traces.d.ts +95 -0
- package/dist/observability/otlp-traces.d.ts.map +1 -0
- package/dist/observability/prometheus.d.ts +49 -0
- package/dist/observability/prometheus.d.ts.map +1 -0
- package/dist/observability/tracer.d.ts +9 -0
- package/dist/observability/tracer.d.ts.map +1 -0
- package/dist/plugin/api.d.ts +226 -0
- package/dist/plugin/api.d.ts.map +1 -0
- package/dist/plugin/loader.d.ts +73 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/plugins/chimera-plugin.d.ts +37 -0
- package/dist/plugins/chimera-plugin.d.ts.map +1 -0
- package/dist/plugins/git-plugin.d.ts +15 -0
- package/dist/plugins/git-plugin.d.ts.map +1 -0
- package/dist/plugins/observability-plugin.d.ts +19 -0
- package/dist/plugins/observability-plugin.d.ts.map +1 -0
- package/dist/plugins/plan-plugin.d.ts +16 -0
- package/dist/plugins/plan-plugin.d.ts.map +1 -0
- package/dist/plugins/prompts-plugin.d.ts +26 -0
- package/dist/plugins/prompts-plugin.d.ts.map +1 -0
- package/dist/plugins/security-plugin.d.ts +19 -0
- package/dist/plugins/security-plugin.d.ts.map +1 -0
- package/dist/plugins/skills-plugin.d.ts +42 -0
- package/dist/plugins/skills-plugin.d.ts.map +1 -0
- package/dist/plugins/sync-plugin.d.ts +22 -0
- package/dist/plugins/sync-plugin.d.ts.map +1 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/prompt-installer.d.ts +50 -0
- package/dist/prompts/prompt-installer.d.ts.map +1 -0
- package/dist/prompts/prompt-manifest-store.d.ts +18 -0
- package/dist/prompts/prompt-manifest-store.d.ts.map +1 -0
- package/dist/registry/provider-registry.d.ts +51 -0
- package/dist/registry/provider-registry.d.ts.map +1 -0
- package/dist/registry/slash-command-registry.d.ts +61 -0
- package/dist/registry/slash-command-registry.d.ts.map +1 -0
- package/dist/registry/tool-registry.d.ts +154 -0
- package/dist/registry/tool-registry.d.ts.map +1 -0
- package/dist/replay/hash.d.ts +31 -0
- package/dist/replay/hash.d.ts.map +1 -0
- package/dist/replay/replay-provider-runner.d.ts +53 -0
- package/dist/replay/replay-provider-runner.d.ts.map +1 -0
- package/dist/{index-CbyuOE5y.d.ts → security/capabilities.d.ts} +31 -34
- package/dist/security/capabilities.d.ts.map +1 -0
- package/dist/security/config-secrets.d.ts +25 -0
- package/dist/security/config-secrets.d.ts.map +1 -0
- package/dist/security/index.d.ts +6 -8
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +102 -381
- package/dist/security/index.js.map +7 -1
- package/dist/security/permission-policy.d.ts +153 -0
- package/dist/security/permission-policy.d.ts.map +1 -0
- package/dist/security/secret-scrubber.d.ts +14 -0
- package/dist/security/secret-scrubber.d.ts.map +1 -0
- package/dist/security/secret-vault.d.ts +87 -0
- package/dist/security/secret-vault.d.ts.map +1 -0
- package/dist/security/yolo-risk.d.ts +11 -0
- package/dist/security/yolo-risk.d.ts.map +1 -0
- package/dist/{session-registry-Dvg7i_IA.d.ts → session-registry.d.ts} +8 -9
- package/dist/session-registry.d.ts.map +1 -0
- package/dist/skills/foreign-sources.d.ts +59 -0
- package/dist/skills/foreign-sources.d.ts.map +1 -0
- package/dist/skills/frontmatter.d.ts +44 -0
- package/dist/skills/frontmatter.d.ts.map +1 -0
- package/dist/skills/github-fetcher.d.ts +38 -0
- package/dist/skills/github-fetcher.d.ts.map +1 -0
- package/dist/skills/index.d.ts +11 -582
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +81 -43
- package/dist/skills/index.js.map +7 -1
- package/dist/skills/limits.d.ts +92 -0
- package/dist/skills/limits.d.ts.map +1 -0
- package/dist/skills/manifest-store.d.ts +42 -0
- package/dist/skills/manifest-store.d.ts.map +1 -0
- package/dist/skills/registry/github-direct-adapter.d.ts +17 -0
- package/dist/skills/registry/github-direct-adapter.d.ts.map +1 -0
- package/dist/skills/registry/registry-adapter.d.ts +84 -0
- package/dist/skills/registry/registry-adapter.d.ts.map +1 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts +13 -0
- package/dist/skills/registry/skills-sh-adapter.d.ts.map +1 -0
- package/dist/skills/skill-generator.d.ts +82 -0
- package/dist/skills/skill-generator.d.ts.map +1 -0
- package/dist/skills/skill-installer.d.ts +124 -0
- package/dist/skills/skill-installer.d.ts.map +1 -0
- package/dist/storage/annotations-store.d.ts +118 -0
- package/dist/storage/annotations-store.d.ts.map +1 -0
- package/dist/storage/attachment-store.d.ts +31 -0
- package/dist/storage/attachment-store.d.ts.map +1 -0
- package/dist/storage/cloud-sync.d.ts +44 -0
- package/dist/storage/cloud-sync.d.ts.map +1 -0
- package/dist/storage/completed-work-checkpoint.d.ts +11 -0
- package/dist/storage/completed-work-checkpoint.d.ts.map +1 -0
- package/dist/storage/config-loader.d.ts +104 -0
- package/dist/storage/config-loader.d.ts.map +1 -0
- package/dist/storage/config-migration.d.ts +87 -0
- package/dist/storage/config-migration.d.ts.map +1 -0
- package/dist/storage/config-store.d.ts +22 -0
- package/dist/storage/config-store.d.ts.map +1 -0
- package/dist/{director-state-CMS_bMs4.d.ts → storage/director-state.d.ts} +28 -8
- package/dist/storage/director-state.d.ts.map +1 -0
- package/dist/storage/file-session-writer.d.ts +169 -0
- package/dist/storage/file-session-writer.d.ts.map +1 -0
- package/dist/{goal-store-Datpp-ar.d.ts → storage/goal-store.d.ts} +26 -19
- package/dist/storage/goal-store.d.ts.map +1 -0
- package/dist/storage/index.d.ts +39 -1031
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +655 -300
- package/dist/storage/index.js.map +7 -1
- package/dist/storage/input-history-store.d.ts +56 -0
- package/dist/storage/input-history-store.d.ts.map +1 -0
- package/dist/storage/memory-backend.d.ts +66 -0
- package/dist/storage/memory-backend.d.ts.map +1 -0
- package/dist/storage/memory-consolidator.d.ts +50 -0
- package/dist/storage/memory-consolidator.d.ts.map +1 -0
- package/dist/storage/memory-graph-backend.d.ts +117 -0
- package/dist/storage/memory-graph-backend.d.ts.map +1 -0
- package/dist/storage/memory-store.d.ts +119 -0
- package/dist/storage/memory-store.d.ts.map +1 -0
- package/dist/storage/plan-store.d.ts +78 -0
- package/dist/storage/plan-store.d.ts.map +1 -0
- package/dist/storage/plan-templates.d.ts +21 -0
- package/dist/storage/plan-templates.d.ts.map +1 -0
- package/dist/storage/prompt-store.d.ts +37 -0
- package/dist/storage/prompt-store.d.ts.map +1 -0
- package/dist/storage/prompt-usage-store.d.ts +29 -0
- package/dist/storage/prompt-usage-store.d.ts.map +1 -0
- package/dist/storage/provider-config-watcher.d.ts +34 -0
- package/dist/storage/provider-config-watcher.d.ts.map +1 -0
- package/dist/storage/queue-store.d.ts +37 -0
- package/dist/storage/queue-store.d.ts.map +1 -0
- package/dist/storage/recovery-lock.d.ts +79 -0
- package/dist/storage/recovery-lock.d.ts.map +1 -0
- package/dist/storage/replay-log-store.d.ts +97 -0
- package/dist/storage/replay-log-store.d.ts.map +1 -0
- package/dist/storage/session-analyzer.d.ts +48 -0
- package/dist/storage/session-analyzer.d.ts.map +1 -0
- package/dist/storage/session-checkpoint-cas.d.ts +37 -0
- package/dist/storage/session-checkpoint-cas.d.ts.map +1 -0
- package/dist/{session-event-bridge-D_z_mBwk.d.ts → storage/session-event-bridge.d.ts} +14 -15
- package/dist/storage/session-event-bridge.d.ts.map +1 -0
- package/dist/storage/session-helpers.d.ts +9 -0
- package/dist/storage/session-helpers.d.ts.map +1 -0
- package/dist/storage/session-id.d.ts +18 -0
- package/dist/storage/session-id.d.ts.map +1 -0
- package/dist/storage/session-reader.d.ts +21 -0
- package/dist/storage/session-reader.d.ts.map +1 -0
- package/dist/storage/session-recovery.d.ts +93 -0
- package/dist/storage/session-recovery.d.ts.map +1 -0
- package/dist/storage/session-resume-validation.d.ts +6 -0
- package/dist/storage/session-resume-validation.d.ts.map +1 -0
- package/dist/storage/session-rewinder.d.ts +21 -0
- package/dist/storage/session-rewinder.d.ts.map +1 -0
- package/dist/storage/session-store.d.ts +210 -0
- package/dist/storage/session-store.d.ts.map +1 -0
- package/dist/storage/session-summary.d.ts +12 -0
- package/dist/storage/session-summary.d.ts.map +1 -0
- package/dist/storage/session-tool-call-ends.d.ts +5 -0
- package/dist/storage/session-tool-call-ends.d.ts.map +1 -0
- package/dist/storage/storage-concurrency.d.ts +2 -0
- package/dist/storage/storage-concurrency.d.ts.map +1 -0
- package/dist/storage/task-store.d.ts +33 -0
- package/dist/storage/task-store.d.ts.map +1 -0
- package/dist/storage/todos-checkpoint.d.ts +39 -0
- package/dist/storage/todos-checkpoint.d.ts.map +1 -0
- package/dist/storage/tool-audit-log.d.ts +141 -0
- package/dist/storage/tool-audit-log.d.ts.map +1 -0
- package/dist/tasking/index.d.ts +3 -124
- package/dist/tasking/index.d.ts.map +1 -0
- package/dist/tasking/index.js +57 -4
- package/dist/tasking/index.js.map +7 -1
- package/dist/tasking/task-store.d.ts +22 -0
- package/dist/tasking/task-store.d.ts.map +1 -0
- package/dist/tasking/task-tracker.d.ts +102 -0
- package/dist/tasking/task-tracker.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -59
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +93 -14
- package/dist/tools/index.js.map +7 -1
- package/dist/tools/mcp-control.d.ts +53 -0
- package/dist/tools/mcp-control.d.ts.map +1 -0
- package/dist/tools/mcp-use.d.ts +24 -0
- package/dist/tools/mcp-use.d.ts.map +1 -0
- package/dist/types/agent-bridge.d.ts +42 -0
- package/dist/types/agent-bridge.d.ts.map +1 -0
- package/dist/types/attachment.d.ts +54 -0
- package/dist/types/attachment.d.ts.map +1 -0
- package/dist/types/autonomy.d.ts +5 -0
- package/dist/types/autonomy.d.ts.map +1 -0
- package/dist/types/blocks.d.ts +76 -0
- package/dist/types/blocks.d.ts.map +1 -0
- package/dist/{compactor-DQLL4HTo.d.ts → types/compactor.d.ts} +5 -7
- package/dist/types/compactor.d.ts.map +1 -0
- package/dist/{config-MRqn1V-u.d.ts → types/config.d.ts} +135 -354
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/context-evidence.d.ts +68 -0
- package/dist/types/context-evidence.d.ts.map +1 -0
- package/dist/types/context-window.d.ts +35 -0
- package/dist/types/context-window.d.ts.map +1 -0
- package/dist/{default-config-B79_gJYv.d.ts → types/default-config.d.ts} +10 -11
- package/dist/types/default-config.d.ts.map +1 -0
- package/dist/types/design-kit.d.ts +91 -0
- package/dist/types/design-kit.d.ts.map +1 -0
- package/dist/{retry-policy-CQ7KwXJa.d.ts → types/error-handler.d.ts} +5 -12
- package/dist/types/error-handler.d.ts.map +1 -0
- package/dist/types/errors.d.ts +277 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +167 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +40 -244
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +90 -12
- package/dist/types/index.js.map +7 -1
- package/dist/{input-reader-E-ffP2ee.d.ts → types/input-reader.d.ts} +3 -4
- package/dist/types/input-reader.d.ts.map +1 -0
- package/dist/{logger-B63L5bTg.d.ts → types/logger.d.ts} +3 -4
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/memory.d.ts +89 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/messages.d.ts +24 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/mode-prompts.d.ts +2 -0
- package/dist/types/mode-prompts.d.ts.map +1 -0
- package/dist/{mode-CZlO9iU1.d.ts → types/mode.d.ts} +6 -7
- package/dist/types/mode.d.ts.map +1 -0
- package/dist/types/models-registry.d.ts +105 -0
- package/dist/types/models-registry.d.ts.map +1 -0
- package/dist/types/multi-agent.d.ts +435 -0
- package/dist/types/multi-agent.d.ts.map +1 -0
- package/dist/{observability-D-HZN_mF.d.ts → types/observability.d.ts} +12 -13
- package/dist/types/observability.d.ts.map +1 -0
- package/dist/{path-resolver-CPRj4bFY.d.ts → types/path-resolver.d.ts} +2 -3
- package/dist/types/path-resolver.d.ts.map +1 -0
- package/dist/{permission-ByDKXEcG.d.ts → types/permission.d.ts} +8 -9
- package/dist/types/permission.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +385 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/prompt-registry.d.ts +81 -0
- package/dist/types/prompt-registry.d.ts.map +1 -0
- package/dist/{prompt-DLd35n4Q.d.ts → types/prompt.d.ts} +14 -15
- package/dist/types/prompt.d.ts.map +1 -0
- package/dist/{provider-runner-ChL-kVg6.d.ts → types/provider-runner.d.ts} +9 -10
- package/dist/types/provider-runner.d.ts.map +1 -0
- package/dist/types/provider.d.ts +387 -0
- package/dist/types/provider.d.ts.map +1 -0
- package/dist/types/renderer.d.ts +23 -0
- package/dist/types/renderer.d.ts.map +1 -0
- package/dist/types/retry-policy.d.ts +7 -0
- package/dist/types/retry-policy.d.ts.map +1 -0
- package/dist/types/secret-scrubber.d.ts +5 -0
- package/dist/types/secret-scrubber.d.ts.map +1 -0
- package/dist/{secret-vault-BAKpgFw_.d.ts → types/secret-vault.d.ts} +13 -7
- package/dist/types/secret-vault.d.ts.map +1 -0
- package/dist/{selector-D8O6B_Rm.d.ts → types/selector.d.ts} +4 -6
- package/dist/types/selector.d.ts.map +1 -0
- package/dist/types/session-reader.d.ts +81 -0
- package/dist/types/session-reader.d.ts.map +1 -0
- package/dist/{session-rewinder-C9HnMkhP.d.ts → types/session-rewinder.d.ts} +5 -6
- package/dist/types/session-rewinder.d.ts.map +1 -0
- package/dist/types/session.d.ts +650 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/side-effect.d.ts +34 -0
- package/dist/types/side-effect.d.ts.map +1 -0
- package/dist/{skill-DHniprNl.d.ts → types/skill.d.ts} +4 -5
- package/dist/types/skill.d.ts.map +1 -0
- package/dist/types/slash-command.d.ts +59 -0
- package/dist/types/slash-command.d.ts.map +1 -0
- package/dist/types/spec.d.ts +77 -0
- package/dist/types/spec.d.ts.map +1 -0
- package/dist/types/system-prompt-contributor.d.ts +20 -0
- package/dist/types/system-prompt-contributor.d.ts.map +1 -0
- package/dist/types/system-prompt.d.ts +51 -0
- package/dist/types/system-prompt.d.ts.map +1 -0
- package/dist/{task-graph-CH3acNQ7.d.ts → types/task-graph.d.ts} +21 -22
- package/dist/types/task-graph.d.ts.map +1 -0
- package/dist/types/token-counter.d.ts +42 -0
- package/dist/types/token-counter.d.ts.map +1 -0
- package/dist/types/tool-executor.d.ts +133 -0
- package/dist/types/tool-executor.d.ts.map +1 -0
- package/dist/types/tool-markers.d.ts +23 -0
- package/dist/types/tool-markers.d.ts.map +1 -0
- package/dist/types/tool.d.ts +245 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/utility-types.d.ts +31 -0
- package/dist/types/utility-types.d.ts.map +1 -0
- package/dist/utils/assert-never.d.ts +14 -0
- package/dist/utils/assert-never.d.ts.map +1 -0
- package/dist/utils/atomic-write.d.ts +12 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/child-env.d.ts +67 -0
- package/dist/utils/child-env.d.ts.map +1 -0
- package/dist/utils/color.d.ts +20 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/config-json.d.ts +14 -0
- package/dist/utils/config-json.d.ts.map +1 -0
- package/dist/utils/context-evidence.d.ts +47 -0
- package/dist/utils/context-evidence.d.ts.map +1 -0
- package/dist/utils/deep-merge.d.ts +64 -0
- package/dist/utils/deep-merge.d.ts.map +1 -0
- package/dist/utils/diff.d.ts +11 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/error.d.ts +2 -3
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +3 -3
- package/dist/utils/error.js.map +7 -1
- package/dist/utils/expect-defined.d.ts +2 -3
- package/dist/utils/expect-defined.d.ts.map +1 -0
- package/dist/utils/expect-defined.js +3 -3
- package/dist/utils/expect-defined.js.map +7 -1
- package/dist/utils/glob-expand.d.ts +10 -0
- package/dist/utils/glob-expand.d.ts.map +1 -0
- package/dist/utils/glob-match.d.ts +4 -0
- package/dist/utils/glob-match.d.ts.map +1 -0
- package/dist/utils/index.d.ts +37 -920
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +242 -33
- package/dist/utils/index.js.map +7 -1
- package/dist/utils/instruction-file.d.ts +3 -0
- package/dist/utils/instruction-file.d.ts.map +1 -0
- package/dist/utils/ip-guard.d.ts +34 -0
- package/dist/utils/ip-guard.d.ts.map +1 -0
- package/dist/utils/json-repair.d.ts +23 -0
- package/dist/utils/json-repair.d.ts.map +1 -0
- package/dist/utils/json-schema-validate.d.ts +42 -0
- package/dist/utils/json-schema-validate.d.ts.map +1 -0
- package/dist/utils/lru-cache.d.ts +29 -0
- package/dist/utils/lru-cache.d.ts.map +1 -0
- package/dist/utils/merge-custom-models.d.ts +12 -0
- package/dist/utils/merge-custom-models.d.ts.map +1 -0
- package/dist/utils/merge-models-payload.d.ts +20 -0
- package/dist/utils/merge-models-payload.d.ts.map +1 -0
- package/dist/utils/message-invariants.d.ts +22 -0
- package/dist/utils/message-invariants.d.ts.map +1 -0
- package/dist/utils/newline-normalize.d.ts +5 -0
- package/dist/utils/newline-normalize.d.ts.map +1 -0
- package/dist/utils/regex-guard.d.ts +21 -0
- package/dist/utils/regex-guard.d.ts.map +1 -0
- package/dist/utils/safe-json.d.ts +31 -0
- package/dist/utils/safe-json.d.ts.map +1 -0
- package/dist/utils/session-scoped-path.d.ts +13 -0
- package/dist/utils/session-scoped-path.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/slug.d.ts +13 -0
- package/dist/utils/slug.d.ts.map +1 -0
- package/dist/utils/string.d.ts +9 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/task-format.d.ts +22 -0
- package/dist/utils/task-format.d.ts.map +1 -0
- package/dist/utils/term.d.ts +133 -0
- package/dist/utils/term.d.ts.map +1 -0
- package/dist/utils/todos-format.d.ts +30 -0
- package/dist/utils/todos-format.d.ts.map +1 -0
- package/dist/utils/token-estimate.d.ts +112 -0
- package/dist/utils/token-estimate.d.ts.map +1 -0
- package/dist/utils/tool-description-mode.d.ts +28 -0
- package/dist/utils/tool-description-mode.d.ts.map +1 -0
- package/dist/utils/tool-output-serializer.d.ts +40 -0
- package/dist/utils/tool-output-serializer.d.ts.map +1 -0
- package/dist/utils/tool-result-render-mode.d.ts +55 -0
- package/dist/utils/tool-result-render-mode.d.ts.map +1 -0
- package/dist/utils/tool-subject.d.ts +5 -0
- package/dist/utils/tool-subject.d.ts.map +1 -0
- package/dist/utils/tool-wire-compact.d.ts +28 -0
- package/dist/utils/tool-wire-compact.d.ts.map +1 -0
- package/dist/utils/ulid.d.ts +11 -0
- package/dist/utils/ulid.d.ts.map +1 -0
- package/dist/{wstack-paths-C3K40Qst.d.ts → utils/wstack-paths.d.ts} +7 -8
- package/dist/utils/wstack-paths.d.ts.map +1 -0
- package/dist/worktree/index.d.ts +2 -0
- package/dist/worktree/index.d.ts.map +1 -0
- package/dist/{worktree-manager-DzwxKE35.d.ts → worktree/worktree-manager.d.ts} +19 -13
- package/dist/worktree/worktree-manager.d.ts.map +1 -0
- package/instructions/autonomy/active-mission.md +2 -4
- package/instructions/sections/tool/delegation-full.md +1 -1
- package/package.json +4 -5
- package/skills/node-modern/SKILL.md +2 -2
- package/skills/plugin-author/SKILL.md +9 -16
- package/dist/dispatcher-types.d-BBeXBQgS.d.ts +0 -66
- package/dist/global-mailbox-sZwyI6CS.d.ts +0 -959
- package/dist/index--Gm41aBJ.d.ts +0 -671
- package/dist/mcp-servers-DEV4s6Ks.d.ts +0 -259
- package/dist/multi-agent-coordinator-4RCRZKjN.d.ts +0 -1770
- package/dist/null-fleet-bus-CFoNVQEK.d.ts +0 -2127
- package/dist/pipeline-DGDyIohT.d.ts +0 -331
- package/dist/provider-model-resolve-o2hHLs79.d.ts +0 -263
- package/dist/secret-scrubber-3MHDDAtm.d.ts +0 -6
- package/dist/secret-vault-DxohkUBc.d.ts +0 -272
- package/dist/session-reader-7Esxrkpw.d.ts +0 -155
- package/dist/task-format-GX0B1mMC.d.ts +0 -23
- package/dist/todos-checkpoint-FY7PjmMx.d.ts +0 -850
- package/dist/tool-BNlnIJvo.d.ts +0 -2190
- package/dist/tool-executor-CckSCM5E.d.ts +0 -906
|
@@ -1,2587 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*
|
|
80
|
-
* @module brain-monitor
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
interface BrainInterventionInput {
|
|
84
|
-
subject: string;
|
|
85
|
-
body: string;
|
|
86
|
-
}
|
|
87
|
-
interface BrainMonitorOptions {
|
|
88
|
-
events: EventBus;
|
|
89
|
-
brain: BrainArbiter;
|
|
90
|
-
/** Active host session id, read lazily so resume/new-session switches are reflected. */
|
|
91
|
-
sessionId?: (() => string | undefined) | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* Deliver a corrective steer to the working agent(s). Hosts typically
|
|
94
|
-
* send a `steer` mail to this session's leader via the project
|
|
95
|
-
* GlobalMailbox — the agent loop injects it before the next LLM call.
|
|
96
|
-
*/
|
|
97
|
-
intervene: (input: BrainInterventionInput) => Promise<void>;
|
|
98
|
-
/** Consecutive failures of the SAME tool before engaging. Default 3. */
|
|
99
|
-
toolFailureStreak?: number | undefined;
|
|
100
|
-
/** Number of `error` events within the window before engaging. Default 4. */
|
|
101
|
-
errorStormCount?: number | undefined;
|
|
102
|
-
/** Sliding window for the error storm signal (ms). Default 60_000. */
|
|
103
|
-
errorStormWindowMs?: number | undefined;
|
|
104
|
-
/** Minimum gap between engagements of the same signal kind (ms). Default 120_000. */
|
|
105
|
-
cooldownMs?: number | undefined;
|
|
106
|
-
}
|
|
107
|
-
declare class BrainMonitor {
|
|
108
|
-
private readonly opts;
|
|
109
|
-
private readonly failStreaks;
|
|
110
|
-
private errorTimestamps;
|
|
111
|
-
private readonly lastEngagedAt;
|
|
112
|
-
private readonly unsubscribers;
|
|
113
|
-
private engaging;
|
|
114
|
-
private readonly toolFailureStreak;
|
|
115
|
-
private readonly errorStormCount;
|
|
116
|
-
private readonly errorStormWindowMs;
|
|
117
|
-
private readonly cooldownMs;
|
|
118
|
-
constructor(opts: BrainMonitorOptions);
|
|
119
|
-
start(): void;
|
|
120
|
-
stop(): void;
|
|
121
|
-
private engage;
|
|
122
|
-
private maybeIntervene;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* dep-watcher — File-change → Mailbox bridge for dependency monitoring.
|
|
127
|
-
*
|
|
128
|
-
* Watches dependency manifest files (package.json, go.mod, Cargo.toml, etc.)
|
|
129
|
-
* and when they change (create/update), posts a message to the inter-agent
|
|
130
|
-
* mailbox. A tech-stack analysis agent can then pick up the message and
|
|
131
|
-
* run a full tech-stack validation, feeding results back to the coding LLM.
|
|
132
|
-
*
|
|
133
|
-
* This module is a *config factory*, not a watcher itself. It produces
|
|
134
|
-
* configuration that the file-watcher plugin (`watch_start`) can consume,
|
|
135
|
-
* plus a callback that posts to a Mailbox instance.
|
|
136
|
-
*
|
|
137
|
-
* Usage:
|
|
138
|
-
* const cfg = makeDependencyWatcherConfig({
|
|
139
|
-
* projectRoot: '/path/to/project',
|
|
140
|
-
* mailbox,
|
|
141
|
-
* targetAgent: 'tech-stack-agent',
|
|
142
|
-
* });
|
|
143
|
-
* // cfg.watchPaths → pass to watch_start
|
|
144
|
-
* // cfg.onChange → call on file-watcher:changed events
|
|
145
|
-
*
|
|
146
|
-
* @module dep-watcher
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Files that declare project dependencies. When any of these change
|
|
151
|
-
* (create/update), a mailbox message triggers a tech-stack audit.
|
|
152
|
-
*/
|
|
153
|
-
declare const DEPENDENCY_FILE_PATTERNS: ReadonlyArray<string>;
|
|
154
|
-
interface DepWatchEntry {
|
|
155
|
-
/** Relative path from project root that changed. */
|
|
156
|
-
path: string;
|
|
157
|
-
/** Event type from the file watcher: 'change', 'add', 'delete' (rare). */
|
|
158
|
-
event: string;
|
|
159
|
-
/** ISO8601 timestamp of when the change was detected. */
|
|
160
|
-
timestamp: string;
|
|
161
|
-
}
|
|
162
|
-
interface DependencyWatcherConfig {
|
|
163
|
-
/** Paths to pass to `watch_start` — the project-root-relative dependency files. */
|
|
164
|
-
watchPaths: string[];
|
|
165
|
-
/** Callback to invoke when a dependency file changes. Posts to mailbox. */
|
|
166
|
-
onChange: (entry: DepWatchEntry) => Promise<void>;
|
|
167
|
-
/** Debounce window in ms — multiple changes to the same file within this window are collapsed. */
|
|
168
|
-
debounceMs: number;
|
|
169
|
-
/** Cancel all in-flight debounce timers. Call when the file watcher is
|
|
170
|
-
* stopped (session end / project switch) so pending setTimeouts — each
|
|
171
|
-
* holding a closure over the mailbox + entry — don't leak. */
|
|
172
|
-
dispose: () => void;
|
|
173
|
-
}
|
|
174
|
-
interface DependencyWatcherOptions {
|
|
175
|
-
/** Absolute path to the project root. */
|
|
176
|
-
projectRoot: string;
|
|
177
|
-
/** The mailbox instance where messages will be posted. */
|
|
178
|
-
mailbox: Mailbox;
|
|
179
|
-
/** Agent id that should receive the tech-stack audit task. */
|
|
180
|
-
targetAgent?: string | undefined;
|
|
181
|
-
/** Agent id of the watcher (sender). */
|
|
182
|
-
watcherAgentId?: string | undefined;
|
|
183
|
-
/** Debounce window in ms. Default: 3000 (3 seconds). */
|
|
184
|
-
debounceMs?: number | undefined;
|
|
185
|
-
/** Only watch these specific patterns. Defaults to DEPENDENCY_FILE_PATTERNS. */
|
|
186
|
-
patterns?: string[] | undefined;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Build a dependency watcher configuration. The returned `watchPaths` can be
|
|
190
|
-
* passed directly to the `watch_start` tool, and `onChange` should be wired
|
|
191
|
-
* to the `file-watcher:changed` custom event.
|
|
192
|
-
*
|
|
193
|
-
* When a dependency file changes, `onChange` posts a high-priority `assign`
|
|
194
|
-
* message to the mailbox targeting the tech-stack agent, with the changed
|
|
195
|
-
* file path and event type in the body.
|
|
196
|
-
*/
|
|
197
|
-
declare function makeDependencyWatcherConfig(opts: DependencyWatcherOptions): DependencyWatcherConfig;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* dep-watcher-bridge — Bridges the file-watcher plugin's custom events
|
|
201
|
-
* to the dependency watcher → mailbox pipeline.
|
|
202
|
-
*
|
|
203
|
-
* The file-watcher plugin emits `file-watcher:changed` custom events
|
|
204
|
-
* when files change. This module subscribes to those events, filters
|
|
205
|
-
* for dependency manifests (package.json, go.mod, etc.), and posts
|
|
206
|
-
* assign messages to the inter-agent mailbox for tech-stack audit.
|
|
207
|
-
*
|
|
208
|
-
* Returns a dispose function that unsubscribes from the event bus.
|
|
209
|
-
*
|
|
210
|
-
* @module dep-watcher-bridge
|
|
211
|
-
*/
|
|
212
|
-
|
|
213
|
-
interface DepWatcherBridgeOptions {
|
|
214
|
-
/** The event bus to subscribe to (same bus the file-watcher plugin emits on). */
|
|
215
|
-
events: EventBus;
|
|
216
|
-
/** The mailbox instance where dep-change notifications will be posted. */
|
|
217
|
-
mailbox: Mailbox;
|
|
218
|
-
/** Absolute project root — used to build watch paths and match file patterns. */
|
|
219
|
-
projectRoot: string;
|
|
220
|
-
/** Agent id the tech-stack audit tasks should target. Default: 'tech-stack'. */
|
|
221
|
-
targetAgent?: string | undefined;
|
|
222
|
-
/** Agent id of the watcher/sender. Default: 'dep-watcher'. */
|
|
223
|
-
watcherAgentId?: string | undefined;
|
|
224
|
-
/** Debounce window in ms. Default: 3000 (3 seconds). */
|
|
225
|
-
debounceMs?: number | undefined;
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Wire the file-watcher's `file-watcher:changed` events into the
|
|
229
|
-
* dependency watcher → mailbox pipeline.
|
|
230
|
-
*
|
|
231
|
-
* Returns a dispose function. Call it to unsubscribe when the
|
|
232
|
-
* session ends or the watcher is no longer needed.
|
|
233
|
-
*
|
|
234
|
-
* Usage:
|
|
235
|
-
* const dispose = attachDepWatcherBridge({
|
|
236
|
-
* events: ctx.events,
|
|
237
|
-
* mailbox: new DefaultMailbox(sessionDir),
|
|
238
|
-
* projectRoot: ctx.projectRoot,
|
|
239
|
-
* });
|
|
240
|
-
* // ... session runs ...
|
|
241
|
-
* dispose(); // clean up on exit
|
|
242
|
-
*/
|
|
243
|
-
declare function attachDepWatcherBridge(opts: DepWatcherBridgeOptions): () => void;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* mailbox-tool — Tool that exposes the inter-agent mailbox to agents.
|
|
247
|
-
*
|
|
248
|
-
* Sub-commands: check, send, ack, query, status, online, unread
|
|
249
|
-
*
|
|
250
|
-
* Uses the project-level GlobalMailbox for cross-session communication.
|
|
251
|
-
* Agents are auto-registered on first use with heartbeat tracking.
|
|
252
|
-
* Read receipts track who read each message and when.
|
|
253
|
-
*
|
|
254
|
-
* @module mailbox-tool
|
|
255
|
-
*/
|
|
256
|
-
|
|
257
|
-
type MailboxResolver = (ctx: Context) => Mailbox;
|
|
258
|
-
interface MailboxToolOptions {
|
|
259
|
-
/**
|
|
260
|
-
* How to obtain a Mailbox instance given the execution Context.
|
|
261
|
-
* Default: derives project dir from ctx and creates a GlobalMailbox.
|
|
262
|
-
*/
|
|
263
|
-
resolveMailbox?: MailboxResolver | undefined;
|
|
264
|
-
/**
|
|
265
|
-
* Agent id of the caller — used as default "from" on send.
|
|
266
|
-
* Default: 'leader' for the main agent, or derived from ctx.meta.
|
|
267
|
-
*/
|
|
268
|
-
agentId?: string | undefined;
|
|
269
|
-
/** Session id for cross-session communication. Default: derived from ctx. */
|
|
270
|
-
sessionId?: string | undefined;
|
|
271
|
-
/**
|
|
272
|
-
* Project directory where the mailbox is stored.
|
|
273
|
-
* Default: derived from ctx.projectRoot (may differ from wpaths.projectDir).
|
|
274
|
-
* For correct cross-session sharing, pass `wpaths.projectDir` from the caller.
|
|
275
|
-
*/
|
|
276
|
-
projectDir?: string | undefined;
|
|
277
|
-
/**
|
|
278
|
-
* EventBus for emitting mailbox.agent_registered and mailbox.agent_heartbeat
|
|
279
|
-
* events so the TUI/WebUI can update the online agent count in the status bar.
|
|
280
|
-
* When omitted, events are not emitted and the status bar count stays at 0.
|
|
281
|
-
*/
|
|
282
|
-
events?: EventBus | undefined;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Compact, deterministic tag for a session id — 8 hex chars of its sha256.
|
|
286
|
-
* Session ids are date-sharded paths ("2026-06-11/sess_<ULID>");
|
|
287
|
-
* the tag keeps mailbox identities short, filesystem-safe, and stable for
|
|
288
|
-
* the lifetime of the session (including across process restarts/resumes).
|
|
289
|
-
*/
|
|
290
|
-
declare function mailboxSessionTag(sessionId: string): string;
|
|
291
|
-
/**
|
|
292
|
-
* Resolve the caller's mailbox identity from the execution Context.
|
|
293
|
-
*
|
|
294
|
-
* Shared by the `mailbox` power-tool, the thin `mail_send`/`mail_inbox`
|
|
295
|
-
* tools, the agent-loop checker, and the /mailbox slash command so every
|
|
296
|
-
* surface agrees on who is talking:
|
|
297
|
-
* - base id: ctx.meta.agentId → ctx.agentId field (subagents) → fallback
|
|
298
|
-
* - unique id: `<base>@<sessionTag>` — SESSION-bound, not pid-bound. Every
|
|
299
|
-
* session has its own id, so two leader sessions on the same project
|
|
300
|
-
* never collide (pids can be recycled by the OS), and a resumed session
|
|
301
|
-
* keeps its identity: read state survives a restart instead of
|
|
302
|
-
* re-flooding old broadcasts. Derived LIVE from ctx.session.id so an
|
|
303
|
-
* in-process session swap (resume / session.new / project switch) moves
|
|
304
|
-
* the identity with it. `ctx.meta.globalAgentId` remains an explicit
|
|
305
|
-
* override for hosts that manage identity themselves.
|
|
306
|
-
*/
|
|
307
|
-
declare function resolveMailboxIdentity(ctx: Context, fallbackBase?: string): {
|
|
308
|
-
baseId: string;
|
|
309
|
-
callerId: string;
|
|
310
|
-
name: string;
|
|
311
|
-
role?: string | undefined;
|
|
312
|
-
sessionId: string;
|
|
313
|
-
};
|
|
314
|
-
declare function makeMailboxTool(opts?: MailboxToolOptions): Tool;
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* fleet-status-tool — read-only live peer snapshot for any agent.
|
|
318
|
-
*
|
|
319
|
-
* The pull half of peer awareness (the push half is the fleet-pulse
|
|
320
|
-
* digest): any agent — leader or fleet subagent — can ask "who else is
|
|
321
|
-
* working on this project right now, and on what?" before starting work
|
|
322
|
-
* that might overlap, or when deciding whether to wait or proceed.
|
|
323
|
-
*
|
|
324
|
-
* Data source: the project mailbox registry (`getAgentStatuses`), which is
|
|
325
|
-
* cross-process by construction. When the host passes `getLocalAgents`
|
|
326
|
-
* (an AgentStatusTracker view), same-process entries are enriched with the
|
|
327
|
-
* richer live fields the registry doesn't carry (ctxPct, costUsd,
|
|
328
|
-
* partialText tail).
|
|
329
|
-
*
|
|
330
|
-
* @module fleet-status-tool
|
|
331
|
-
*/
|
|
332
|
-
|
|
333
|
-
interface FleetStatusToolOptions {
|
|
334
|
-
/** How to obtain a Mailbox given the execution Context (tests). */
|
|
335
|
-
resolveMailbox?: MailboxResolver | undefined;
|
|
336
|
-
/** Project dir for the shared mailbox. Prefer wpaths.projectDir. */
|
|
337
|
-
projectDir?: string | undefined;
|
|
338
|
-
/** EventBus for mailbox registration surface events. */
|
|
339
|
-
events?: EventBus | undefined;
|
|
340
|
-
/**
|
|
341
|
-
* Same-process rich agent state (AgentStatusTracker snapshot). Merged
|
|
342
|
-
* into registry rows by name when provided — cross-process peers keep
|
|
343
|
-
* registry-only fields.
|
|
344
|
-
*/
|
|
345
|
-
getLocalAgents?: (() => AgentEntry[]) | undefined;
|
|
346
|
-
}
|
|
347
|
-
declare function makeFleetStatusTool(opts?: FleetStatusToolOptions): Tool;
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* FleetSupervisor — brain-gated shadow watcher over the generic fleet.
|
|
351
|
-
*
|
|
352
|
-
* The Director gives a leader agent orchestration TOOLS; this module gives
|
|
353
|
-
* the fleet a SUPERVISOR that works even while the leader is deep in its
|
|
354
|
-
* own task: it continuously watches queue shape + worker activity, detects
|
|
355
|
-
* imbalance (a pending task starving behind a busy worker while a sibling
|
|
356
|
-
* idles, a deep backlog, a stuck or repeatedly-failing worker), and — after
|
|
357
|
-
* clearing every proposal through the tiered BrainArbiter (policy → LLM →
|
|
358
|
-
* human, honoring the /brain risk ceiling) — acts: retargets pending
|
|
359
|
-
* tasks ("I'm reducing your workload"), spawns a helper, steers an agent
|
|
360
|
-
* by mail, notifies the leader, or (opt-in) terminates.
|
|
361
|
-
*
|
|
362
|
-
* Design lineage: BrainMonitor (watch bus → decide → intervene, cooldowns,
|
|
363
|
-
* single engagement in flight) generalized from "steer the leader" to the
|
|
364
|
-
* full fleet action set; SddSupervisor's brain-verdict contract reused for
|
|
365
|
-
* the decision step. The SDD subsystem itself is untouched.
|
|
366
|
-
*
|
|
367
|
-
* Non-interference guarantees (also pinned by tests):
|
|
368
|
-
* - never calls extend/deny on budget negotiations — the Director's
|
|
369
|
-
* budgetFilter remains the sole negotiator; we only OBSERVE events
|
|
370
|
-
* - never preempts a RUNNING task — only still-pending tasks move
|
|
371
|
-
* - never flips autonomy mode
|
|
372
|
-
* - dormant once the director declares work complete
|
|
373
|
-
*
|
|
374
|
-
* @module fleet-supervisor
|
|
375
|
-
*/
|
|
376
|
-
|
|
377
|
-
/** One subagent row of the snapshot the supervisor reasons over. */
|
|
378
|
-
interface SupervisedSubagent {
|
|
379
|
-
id: string;
|
|
380
|
-
name: string;
|
|
381
|
-
status: 'running' | 'idle' | 'stopped' | 'error';
|
|
382
|
-
currentTask?: string | undefined;
|
|
383
|
-
}
|
|
384
|
-
/** Read port — implemented over Director/coordinator state by the host. */
|
|
385
|
-
interface FleetSupervisorSource {
|
|
386
|
-
subagents(): SupervisedSubagent[];
|
|
387
|
-
listPendingTasks(): readonly TaskSpec[];
|
|
388
|
-
isWorkComplete(): boolean;
|
|
389
|
-
}
|
|
390
|
-
/** Action port — every mutation the supervisor may perform, brain-gated. */
|
|
391
|
-
interface FleetSupervisorActions {
|
|
392
|
-
/** Move a still-pending task to another (or any idle) worker. */
|
|
393
|
-
retargetPendingTask(taskId: string, subagentId: string | undefined): boolean | Promise<boolean>;
|
|
394
|
-
/** Spawn an additional helper worker. Return {error} to degrade gracefully. */
|
|
395
|
-
spawnHelper(input: {
|
|
396
|
-
reason: string;
|
|
397
|
-
/** Oldest queued task used to route the helper's role/tool profile. */
|
|
398
|
-
task?: TaskSpec | undefined;
|
|
399
|
-
}): Promise<{
|
|
400
|
-
subagentId: string;
|
|
401
|
-
} | {
|
|
402
|
-
error: string;
|
|
403
|
-
}>;
|
|
404
|
-
/** High-priority steer mail to one agent. */
|
|
405
|
-
steerAgent(subagentId: string, subject: string, body: string): Promise<void>;
|
|
406
|
-
/** Status/steer mail to the session leader. */
|
|
407
|
-
notifyLeader(subject: string, body: string): Promise<void>;
|
|
408
|
-
/** Abort a subagent (only used when config.allowTerminate). */
|
|
409
|
-
terminate(subagentId: string): Promise<void>;
|
|
410
|
-
}
|
|
411
|
-
interface FleetSupervisorOptions {
|
|
412
|
-
events: EventBus;
|
|
413
|
-
fleet: FleetBus;
|
|
414
|
-
brain: BrainArbiter;
|
|
415
|
-
source: FleetSupervisorSource;
|
|
416
|
-
actions: FleetSupervisorActions;
|
|
417
|
-
/** Active host session id, read lazily (resume/session-swap safe). */
|
|
418
|
-
sessionId?: (() => string | undefined) | undefined;
|
|
419
|
-
config?: FleetSupervisorConfig | undefined;
|
|
420
|
-
/** Injectable clock for tests. Default Date.now. */
|
|
421
|
-
now?: (() => number) | undefined;
|
|
422
|
-
}
|
|
423
|
-
interface SupervisorLogEntry {
|
|
424
|
-
at: number;
|
|
425
|
-
kind: string;
|
|
426
|
-
subagentId?: string | undefined;
|
|
427
|
-
taskId?: string | undefined;
|
|
428
|
-
proposedAction: string;
|
|
429
|
-
outcome: 'approved' | 'denied' | 'escalated' | 'skipped' | 'error';
|
|
430
|
-
detail: string;
|
|
431
|
-
}
|
|
432
|
-
interface ResolvedSupervisorConfig {
|
|
433
|
-
enabled: boolean;
|
|
434
|
-
intervalMs: number;
|
|
435
|
-
cooldownMs: number;
|
|
436
|
-
maxInterventionsPerSubagent: number;
|
|
437
|
-
pinnedWaitMs: number;
|
|
438
|
-
overloadPinnedThreshold: number;
|
|
439
|
-
backlogFactor: number;
|
|
440
|
-
stuckMs: number;
|
|
441
|
-
failureStreak: number;
|
|
442
|
-
allowSpawn: boolean;
|
|
443
|
-
allowTerminate: boolean;
|
|
444
|
-
}
|
|
445
|
-
declare class FleetSupervisor {
|
|
446
|
-
private readonly opts;
|
|
447
|
-
private readonly cfg;
|
|
448
|
-
private readonly now;
|
|
449
|
-
private timer;
|
|
450
|
-
private readonly offHandles;
|
|
451
|
-
private engaging;
|
|
452
|
-
private stopped;
|
|
453
|
-
/** taskId → first tick timestamp we saw it pending. */
|
|
454
|
-
private readonly pendingSince;
|
|
455
|
-
/** subagentId → last observable fleet event timestamp. */
|
|
456
|
-
private readonly lastActivityAt;
|
|
457
|
-
/** subagentId → consecutive non-success completions. */
|
|
458
|
-
private readonly failStreaks;
|
|
459
|
-
/** Consecutive ticks the backlog condition held. */
|
|
460
|
-
private backlogTicks;
|
|
461
|
-
/** `${kind}|${subject}` → last engagement ts. */
|
|
462
|
-
private readonly lastEngagedAt;
|
|
463
|
-
private readonly interventionsBySubagent;
|
|
464
|
-
/** Tasks already retargeted once — never bounced twice. */
|
|
465
|
-
private readonly retargetedTasks;
|
|
466
|
-
private readonly log;
|
|
467
|
-
constructor(opts: FleetSupervisorOptions);
|
|
468
|
-
/** Idempotent; also re-arms after a stop() so `/supervisor on` works. */
|
|
469
|
-
start(): void;
|
|
470
|
-
stop(): void;
|
|
471
|
-
history(): readonly SupervisorLogEntry[];
|
|
472
|
-
/** True while the evaluation loop is armed. */
|
|
473
|
-
isRunning(): boolean;
|
|
474
|
-
/** Resolved (defaulted) configuration — for status surfaces. */
|
|
475
|
-
configSnapshot(): Readonly<ResolvedSupervisorConfig>;
|
|
476
|
-
private nudgeTimer;
|
|
477
|
-
private scheduleNudge;
|
|
478
|
-
private isCollab;
|
|
479
|
-
/** One evaluation pass. Public for tests; production runs it on the tick. */
|
|
480
|
-
evaluate(): Promise<void>;
|
|
481
|
-
private cooldownOk;
|
|
482
|
-
private interventionBudgetOk;
|
|
483
|
-
private recordIntervention;
|
|
484
|
-
private emitSignal;
|
|
485
|
-
private record;
|
|
486
|
-
private emitAction;
|
|
487
|
-
/**
|
|
488
|
-
* Ask the brain to approve a proposal. Same contract as BrainMonitor:
|
|
489
|
-
* `source:'system'`, the rule's proposal `recommended:true`, fallback
|
|
490
|
-
* 'ask_human' (routes to the LLM tier under the risk ceiling before any
|
|
491
|
-
* human). Returns the chosen option id, or null for deny/escalate.
|
|
492
|
-
*/
|
|
493
|
-
private decide;
|
|
494
|
-
private engageRebalance;
|
|
495
|
-
private engageBacklog;
|
|
496
|
-
private engageStuck;
|
|
497
|
-
private engageFailureStreak;
|
|
498
|
-
private engageIdleWithWork;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
/** Absolute recursion ceiling. Configuration may narrow this, never widen it. */
|
|
502
|
-
declare const HARD_MAX_SPAWN_DEPTH = 2;
|
|
503
|
-
/** CLI fleet default; core embedders retain their historical Infinity default. */
|
|
504
|
-
declare const DEFAULT_MAX_FLEET_SPAWNS = 64;
|
|
505
|
-
declare function resolveMaxSpawnDepth(requested?: number | undefined): number;
|
|
506
|
-
|
|
507
|
-
/** Context metadata key used to hand the submitted report to the task runner. */
|
|
508
|
-
declare const SUBAGENT_STRUCTURED_REPORT_META_KEY = "subagentStructuredReport";
|
|
509
|
-
declare const MAX_SUBAGENT_STRUCTURED_REPORT_CHARS = 8000;
|
|
510
|
-
/**
|
|
511
|
-
* Validate and normalize a model-supplied structured result. The tool executor
|
|
512
|
-
* already applies JSON Schema validation, but this guard keeps direct callers,
|
|
513
|
-
* custom executors, and data read back from Context metadata honest too.
|
|
514
|
-
*/
|
|
515
|
-
declare function normalizeSubagentStructuredReport(value: unknown): SubagentStructuredReport | undefined;
|
|
516
|
-
declare function readSubagentStructuredReport(ctx: Pick<Context, 'meta'> | {
|
|
517
|
-
meta?: Record<string, unknown>;
|
|
518
|
-
} | undefined): SubagentStructuredReport | undefined;
|
|
519
|
-
/** Stable compact text form for mailbox/roll-up surfaces. */
|
|
520
|
-
declare function formatSubagentStructuredReport(report: SubagentStructuredReport): string;
|
|
521
|
-
/** Safe, task-local handoff channel from a subagent to its Director. */
|
|
522
|
-
declare function makeSubagentResultTool(): Tool;
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* mail-tools — thin, high-affordance wrappers over the project mailbox.
|
|
526
|
-
*
|
|
527
|
-
* These are the PREFERRED mailbox tools for agents. The multi-action `mailbox`
|
|
528
|
-
* tool is the low-level power surface for advanced queries and agent status;
|
|
529
|
-
* `mail_send` and `mail_inbox` exist because explicit verbs ("send a mail",
|
|
530
|
-
* "read my inbox") are what makes agents USE the mailbox autonomously — a model
|
|
531
|
-
* reaches for `mail_send` mid-task far more readily than for
|
|
532
|
-
* `mailbox action=send ...`.
|
|
533
|
-
*
|
|
534
|
-
* mail_send — message one agent (`to: "leader@a1b2c3d4"`), every leader
|
|
535
|
-
* (`to: "leader"`), or everyone (`to: "*"`)
|
|
536
|
-
* mail_inbox — read unread mail (unique id + base alias + broadcasts),
|
|
537
|
-
* marking it read so it isn't re-injected next iteration
|
|
538
|
-
*
|
|
539
|
-
* Both share the identity convention with the agent-loop checker
|
|
540
|
-
* (`<base>@<sessionTag>`, see mailbox-attach) via `resolveMailboxIdentity`.
|
|
541
|
-
*
|
|
542
|
-
* @module mail-tools
|
|
543
|
-
*/
|
|
544
|
-
|
|
545
|
-
interface MailToolsOptions {
|
|
546
|
-
/** How to obtain a Mailbox given the execution Context (tests). */
|
|
547
|
-
resolveMailbox?: MailboxResolver | undefined;
|
|
548
|
-
/** Project dir for the shared mailbox. Prefer wpaths.projectDir. */
|
|
549
|
-
projectDir?: string | undefined;
|
|
550
|
-
/** EventBus for mailbox.agent_registered / heartbeat surface events. */
|
|
551
|
-
events?: EventBus | undefined;
|
|
552
|
-
}
|
|
553
|
-
declare function makeMailSendTool(opts?: MailToolsOptions): Tool;
|
|
554
|
-
declare function makeMailInboxTool(opts?: MailToolsOptions): Tool;
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* DefaultMailbox — append-only JSONL inter-agent mailbox (per-session).
|
|
558
|
-
*
|
|
559
|
-
* Stores messages under `<sessionDir>/_mailbox.jsonl`. Every send appends
|
|
560
|
-
* one line. Query reads and filters all lines. Ack rewrites changed
|
|
561
|
-
* messages in-place via atomic write.
|
|
562
|
-
*
|
|
563
|
-
* For cross-session communication, use GlobalMailbox instead.
|
|
564
|
-
*
|
|
565
|
-
* @module DefaultMailbox
|
|
566
|
-
*/
|
|
567
|
-
|
|
568
|
-
declare class DefaultMailbox implements Mailbox {
|
|
569
|
-
private readonly filePath;
|
|
570
|
-
private _messageCache;
|
|
571
|
-
private _messageCacheMtime;
|
|
572
|
-
private _messageCacheSize;
|
|
573
|
-
/** Primary index: recipient → Set of messages (points into _messageCache). */
|
|
574
|
-
private _byTo;
|
|
575
|
-
/** Secondary index: sender → Set of messages (points into _messageCache). */
|
|
576
|
-
private _byFrom;
|
|
577
|
-
/** Counts malformed JSONL lines skipped during parsing for observability. */
|
|
578
|
-
private _corruptionCount;
|
|
579
|
-
constructor(sessionDir: string);
|
|
580
|
-
get mailboxPath(): string;
|
|
581
|
-
/** Returns the count of malformed JSONL lines encountered during reads. */
|
|
582
|
-
get corruptionCount(): number;
|
|
583
|
-
send(input: MailboxSendInput): Promise<MailboxMessage>;
|
|
584
|
-
query(q: MailboxQuery): Promise<MailboxMessage[]>;
|
|
585
|
-
ack(input: MailboxAckInput): Promise<MailboxMessage | null>;
|
|
586
|
-
softDelete(_mailId: string, _by: string): Promise<MailboxMessage | null>;
|
|
587
|
-
restore(_mailId: string): Promise<MailboxMessage | null>;
|
|
588
|
-
ackMany(input: MailboxAckBatchInput): Promise<MailboxMessage[]>;
|
|
589
|
-
getAgentStatuses(): Promise<MailboxAgentStatus[]>;
|
|
590
|
-
getOnlineAgents(): Promise<MailboxAgentStatus[]>;
|
|
591
|
-
registerAgent(_input: AgentRegistrationInput): Promise<void>;
|
|
592
|
-
deregisterAgent(_agentId: string): Promise<void>;
|
|
593
|
-
heartbeat(_input: AgentHeartbeatInput): Promise<void>;
|
|
594
|
-
unreadCount(forAgentId: string): Promise<number>;
|
|
595
|
-
close(): Promise<void>;
|
|
596
|
-
clearAll(): Promise<void>;
|
|
597
|
-
purgeStale(opts?: PurgeOptions): Promise<PurgeResult>;
|
|
598
|
-
registerClient(_input: ClientRegistrationInput): Promise<void>;
|
|
599
|
-
clientHeartbeat(_input: ClientHeartbeatInput): Promise<void>;
|
|
600
|
-
getClientStatuses(): Promise<ClientStatus[]>;
|
|
601
|
-
private _readAll;
|
|
602
|
-
/**
|
|
603
|
-
* Read only newly-appended bytes from the file and append them to the
|
|
604
|
-
* in-memory cache, avoiding a full re-read when the file only grew.
|
|
605
|
-
*/
|
|
606
|
-
private _readNewMessagesOnly;
|
|
607
|
-
/** Parse a JSONL string into MailboxMessage[], including migration. */
|
|
608
|
-
private _parseLines;
|
|
609
|
-
/**
|
|
610
|
-
* Stat the mailbox file under the assumption that we are holding the
|
|
611
|
-
* file lock, and that a write to the file has just completed. Returns
|
|
612
|
-
* the (mtimeMs, size) pair, or (-1, -1) if the file does not exist
|
|
613
|
-
* (e.g. ackMany/purgeStale on a session that has never sent a message).
|
|
614
|
-
*/
|
|
615
|
-
private _statUnderLockOrAbsent;
|
|
616
|
-
private _readAllCached;
|
|
617
|
-
private _setMessageCache;
|
|
618
|
-
private _pushToCache;
|
|
619
|
-
/** Rebuild both indexes from a full message list. */
|
|
620
|
-
private _buildIndexes;
|
|
621
|
-
/** Add a single message to both indexes. */
|
|
622
|
-
private _indexMsg;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* Mailbox message action helpers (skeleton).
|
|
627
|
-
*
|
|
628
|
-
* Phase 1 skeleton: declares the {@link MailboxMessageAction} union
|
|
629
|
-
* (the verb that a user or agent issues against a single message) and
|
|
630
|
-
* the per-action input shapes. The actual implementations
|
|
631
|
-
* ({@link GlobalMailbox.markRead}, {@link GlobalMailbox.acknowledge},
|
|
632
|
-
* {@link GlobalMailbox.softDelete}, {@link GlobalMailbox.restore}) are
|
|
633
|
-
* added in Phase 2 alongside the corresponding `GlobalMailbox`
|
|
634
|
-
* methods.
|
|
635
|
-
*
|
|
636
|
-
* Keeping the verb+input types in their own file means the WebUI
|
|
637
|
-
* client (Phase 3) and the server route handlers (Phase 4) can
|
|
638
|
-
* import them independently of the `GlobalMailbox` implementation,
|
|
639
|
-
* and a future "message actions" CLI subcommand only has to add
|
|
640
|
-
* one verb to a single place.
|
|
641
|
-
*/
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* High-level verbs the WebUI/server route handlers expose. The
|
|
645
|
-
* mapping to underlying `MailboxAckInput` is straightforward:
|
|
646
|
-
* - `mark-read` → `ack({ read: true, completed: false })`
|
|
647
|
-
* - `acknowledge`→ `ack({ read: true, completed: true })`
|
|
648
|
-
* - `reopen` → `ack({ read: false, completed: false })`
|
|
649
|
-
* - `soft-delete`→ not an `ack` — a separate `Mailbox.softDelete()`
|
|
650
|
-
* that flips `deletedAt` to "now" (recoverable) and is filtered
|
|
651
|
-
* out of the default `query()`.
|
|
652
|
-
* - `restore` → the inverse of `soft-delete`. Undoes a
|
|
653
|
-
* `softDelete` by clearing `deletedAt`.
|
|
654
|
-
*/
|
|
655
|
-
type MailboxMessageAction = 'mark-read' | 'acknowledge' | 'reopen' | 'soft-delete' | 'restore';
|
|
656
|
-
/** Per-action request body sent from the WebUI → server route. */
|
|
657
|
-
interface MailboxActionInput {
|
|
658
|
-
action: MailboxMessageAction;
|
|
659
|
-
mailId: string;
|
|
660
|
-
/** Acting agent / user. Required by the server to stamp
|
|
661
|
-
* `readBy` / `completedBy`. */
|
|
662
|
-
readerId: string;
|
|
663
|
-
/** Optional human note (e.g. "triaged — will follow up"). */
|
|
664
|
-
note?: string | undefined;
|
|
665
|
-
/** Optional idempotency key so retried requests don't double-apply
|
|
666
|
-
* the action. Phase 4 wires this through to the CLI. */
|
|
667
|
-
requestId?: string | undefined;
|
|
668
|
-
}
|
|
669
|
-
/** Per-action response. Echoes the action + the resulting message
|
|
670
|
-
* state so the UI can reconcile optimistic updates. */
|
|
671
|
-
interface MailboxActionResult {
|
|
672
|
-
action: MailboxMessageAction;
|
|
673
|
-
mailId: string;
|
|
674
|
-
/** Updated message snapshot. `null` if the message was already in
|
|
675
|
-
* the target state (e.g. `mark-read` on a message the user has
|
|
676
|
-
* already read) — the WebUI can ignore the result in that case. */
|
|
677
|
-
message: MailboxMessage | null;
|
|
678
|
-
/** True if the action actually mutated state; false if it was a
|
|
679
|
-
* no-op. Lets the WebUI decide whether to update its local copy. */
|
|
680
|
-
changed: boolean;
|
|
681
|
-
}
|
|
682
|
-
/**
|
|
683
|
-
* Convert a high-level action into the underlying
|
|
684
|
-
* {@link MailboxAckInput} the existing `GlobalMailbox.ack` already
|
|
685
|
-
* supports. `soft-delete` and `restore` do NOT go through `ack` —
|
|
686
|
-
* the caller must dispatch them to `GlobalMailbox.softDelete` /
|
|
687
|
-
* `GlobalMailbox.restore` instead. This helper returns `null` for
|
|
688
|
-
* those two so the type signature forces the caller to handle them
|
|
689
|
-
* separately.
|
|
690
|
-
*/
|
|
691
|
-
declare function actionToAckInput(action: Exclude<MailboxMessageAction, 'soft-delete' | 'restore'>, input: MailboxActionInput): MailboxAckInput;
|
|
692
|
-
|
|
693
|
-
/**
|
|
694
|
-
* MailboxHealthWatchdog — probes the mailbox HTTP bridge and posts a
|
|
695
|
-
* status message when it goes down.
|
|
696
|
-
*
|
|
697
|
-
* Designed to be embedded inside the WrongStack REPL/TUI/WebUI process —
|
|
698
|
-
* NOT a standalone agent. WrongStack has its own cross-agent
|
|
699
|
-
* coordination channel, so the cheapest reliable signal is "ask the
|
|
700
|
-
* bridge if it's alive, and if it's not, tell the rest of the team
|
|
701
|
-
* via the same channel the bridge exposes."
|
|
702
|
-
*
|
|
703
|
-
* Usage:
|
|
704
|
-
*
|
|
705
|
-
* const mailbox = new GlobalMailbox(projectDir);
|
|
706
|
-
* const watchdog = new MailboxHealthWatchdog({
|
|
707
|
-
* mailbox,
|
|
708
|
-
* url: 'http://127.0.0.1:7788',
|
|
709
|
-
* probeIntervalMs: 15_000,
|
|
710
|
-
* onAlert: (event) => console.warn(event),
|
|
711
|
-
* });
|
|
712
|
-
* await watchdog.start();
|
|
713
|
-
* // ...later...
|
|
714
|
-
* await watchdog.stop();
|
|
715
|
-
*
|
|
716
|
-
* The watchdog is a passive observer: it does NOT start the bridge.
|
|
717
|
-
* Starting the bridge is the user's job (`wstack mailbox serve` or
|
|
718
|
-
* `/mailbox-serve`). The watchdog then reports on what the user did.
|
|
719
|
-
*/
|
|
720
|
-
|
|
721
|
-
interface MailboxHealthWatchdogOptions {
|
|
722
|
-
/** Project mailbox to probe-and-report on. Required. */
|
|
723
|
-
mailbox: GlobalMailbox;
|
|
724
|
-
/** URL of the mailbox bridge (no trailing slash). Required. */
|
|
725
|
-
url: string;
|
|
726
|
-
/** Probe interval in milliseconds. Default: 15_000. */
|
|
727
|
-
probeIntervalMs?: number;
|
|
728
|
-
/** Per-probe timeout in milliseconds. Default: 3_000. */
|
|
729
|
-
probeTimeoutMs?: number;
|
|
730
|
-
/**
|
|
731
|
-
* After this many consecutive failures the watchdog posts an alert.
|
|
732
|
-
* Default: 2 (so a single transient timeout doesn't trigger spam).
|
|
733
|
-
*/
|
|
734
|
-
failureThreshold?: number;
|
|
735
|
-
/**
|
|
736
|
-
* Optional callback for local observability — fired on every state
|
|
737
|
-
* transition. The mailbox post is independent of this callback.
|
|
738
|
-
*/
|
|
739
|
-
onAlert?: ((event: MailboxHealthEvent) => void) | undefined;
|
|
740
|
-
/**
|
|
741
|
-
* Agent id used to post the alert message. Default: 'mailbox-bridge-watchdog'.
|
|
742
|
-
*/
|
|
743
|
-
from?: string;
|
|
744
|
-
}
|
|
745
|
-
type MailboxHealthEvent = {
|
|
746
|
-
kind: 'probe-failed';
|
|
747
|
-
status?: number;
|
|
748
|
-
error?: string;
|
|
749
|
-
} | {
|
|
750
|
-
kind: 'alert-posted';
|
|
751
|
-
consecutiveFailures: number;
|
|
752
|
-
} | {
|
|
753
|
-
kind: 'recovery-posted';
|
|
754
|
-
downtimeMs: number;
|
|
755
|
-
} | {
|
|
756
|
-
kind: 'started';
|
|
757
|
-
intervalMs: number;
|
|
758
|
-
} | {
|
|
759
|
-
kind: 'stopped';
|
|
760
|
-
};
|
|
761
|
-
declare const MAILBOX_HEALTH_DEFAULT_INTERVAL_MS = 15000;
|
|
762
|
-
declare const MAILBOX_HEALTH_DEFAULT_TIMEOUT_MS = 3000;
|
|
763
|
-
declare const MAILBOX_HEALTH_DEFAULT_FAILURE_THRESHOLD = 2;
|
|
764
|
-
declare const MAILBOX_HEALTH_DEFAULT_FROM = "mailbox-bridge-watchdog";
|
|
765
|
-
declare class MailboxHealthWatchdog {
|
|
766
|
-
private readonly mailbox;
|
|
767
|
-
private readonly url;
|
|
768
|
-
private readonly intervalMs;
|
|
769
|
-
private readonly timeoutMs;
|
|
770
|
-
private readonly failureThreshold;
|
|
771
|
-
private readonly from;
|
|
772
|
-
private readonly onAlert?;
|
|
773
|
-
private timer;
|
|
774
|
-
private consecutiveFailures;
|
|
775
|
-
private downSince;
|
|
776
|
-
private alerting;
|
|
777
|
-
private inFlight;
|
|
778
|
-
private aborted;
|
|
779
|
-
constructor(opts: MailboxHealthWatchdogOptions);
|
|
780
|
-
/** Start probing on `intervalMs`. Idempotent — second call is a no-op. */
|
|
781
|
-
start(): Promise<void>;
|
|
782
|
-
/** Stop probing. Safe to call multiple times. */
|
|
783
|
-
stop(): Promise<void>;
|
|
784
|
-
/** True between start() and stop(). */
|
|
785
|
-
isRunning(): boolean;
|
|
786
|
-
/** Number of consecutive failed probes since the last successful probe. */
|
|
787
|
-
get currentFailureStreak(): number;
|
|
788
|
-
/** True iff the watchdog currently considers the bridge down. */
|
|
789
|
-
isBridgeDown(): boolean;
|
|
790
|
-
private emit;
|
|
791
|
-
private tick;
|
|
792
|
-
private probe;
|
|
793
|
-
private recordSuccess;
|
|
794
|
-
private recordFailure;
|
|
795
|
-
private postDown;
|
|
796
|
-
private postRecovery;
|
|
797
|
-
}
|
|
798
|
-
interface DownAlertInput {
|
|
799
|
-
from: string;
|
|
800
|
-
url: string;
|
|
801
|
-
consecutiveFailures: number;
|
|
802
|
-
}
|
|
803
|
-
declare function buildDownAlert(input: DownAlertInput): MailboxSendInput;
|
|
804
|
-
interface RecoveryAlertInput {
|
|
805
|
-
from: string;
|
|
806
|
-
url: string;
|
|
807
|
-
downtimeMs: number;
|
|
808
|
-
consecutiveFailures: number;
|
|
809
|
-
}
|
|
810
|
-
declare function buildRecoveryAlert(input: RecoveryAlertInput): MailboxSendInput;
|
|
811
|
-
interface WatchdogConfig {
|
|
812
|
-
probeIntervalMs: number;
|
|
813
|
-
probeTimeoutMs: number;
|
|
814
|
-
failureThreshold: number;
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* Throws if the watchdog config is invalid. Called from the
|
|
818
|
-
* MailboxHealthWatchdog constructor so misconfiguration fails fast
|
|
819
|
-
* (at startup), not silently after the first probe.
|
|
820
|
-
*/
|
|
821
|
-
declare function validateWatchdogOptions(cfg: WatchdogConfig): void;
|
|
822
|
-
|
|
823
|
-
/**
|
|
824
|
-
* mailbox-hooks — Tool-execution hooks for mailbox integration.
|
|
825
|
-
*
|
|
826
|
-
* 1. Before each tool call, checks the mailbox for unread high-priority
|
|
827
|
-
* steer messages and emits a `mailbox.unread_count` event.
|
|
828
|
-
* 2. After each tool call, updates the agent heartbeat so other agents
|
|
829
|
-
* know this one is still alive.
|
|
830
|
-
*
|
|
831
|
-
* This gives near-real-time mailbox checking (every tool call, not just
|
|
832
|
-
* iteration boundaries) and powers the "new mail" badge in the WebUI/TUI.
|
|
833
|
-
*
|
|
834
|
-
* @module mailbox-hooks
|
|
835
|
-
*/
|
|
836
|
-
|
|
837
|
-
interface MailboxHooksOptions {
|
|
838
|
-
/** The mailbox instance. */
|
|
839
|
-
mailbox: Mailbox;
|
|
840
|
-
/** Agent id for read-receipt and unread-check purposes. */
|
|
841
|
-
agentId: string;
|
|
842
|
-
/** Whether to emit new-mail notifications. Default: true. */
|
|
843
|
-
notifyNewMail?: boolean | undefined;
|
|
844
|
-
/** Whether to update heartbeat. Default: true. */
|
|
845
|
-
heartbeat?: boolean | undefined;
|
|
846
|
-
}
|
|
847
|
-
/**
|
|
848
|
-
* Create a pair of hooks for the tool execution pipeline.
|
|
849
|
-
*
|
|
850
|
-
* Usage:
|
|
851
|
-
* const hooks = createMailboxHooks({ mailbox, agentId });
|
|
852
|
-
* // In the tool executor, before each tool call:
|
|
853
|
-
* await hooks.beforeTool({ events });
|
|
854
|
-
* // After each tool call:
|
|
855
|
-
* await hooks.afterTool();
|
|
856
|
-
*
|
|
857
|
-
* The `beforeTool` hook checks for unread messages and emits
|
|
858
|
-
* `mailbox.unread_count` events. The `afterTool` hook updates
|
|
859
|
-
* the agent heartbeat.
|
|
860
|
-
*/
|
|
861
|
-
declare function createMailboxHooks(opts: MailboxHooksOptions): {
|
|
862
|
-
/**
|
|
863
|
-
* Call before each tool execution. Checks mailbox and emits events.
|
|
864
|
-
* @param events — EventBus-like object with emit method.
|
|
865
|
-
*/
|
|
866
|
-
beforeTool(events: {
|
|
867
|
-
emit: (type: string, payload: unknown) => void;
|
|
868
|
-
}): Promise<void>;
|
|
869
|
-
/**
|
|
870
|
-
* Call after each tool execution. Updates heartbeat and optionally
|
|
871
|
-
* current tool status.
|
|
872
|
-
*/
|
|
873
|
-
afterTool(toolName?: string): Promise<void>;
|
|
874
|
-
/** Reset the cached unread count (e.g., after the agent checks manually). */
|
|
875
|
-
reset(): void;
|
|
876
|
-
};
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* Per-task model matrix resolution.
|
|
880
|
-
*
|
|
881
|
-
* The matrix (Config.modelMatrix) maps a catalog **role**, a **phase** name, or
|
|
882
|
-
* the `*` default to a {@link ModelMatrixEntry} (model + optional provider).
|
|
883
|
-
* At subagent spawn time we resolve the most specific match so different task
|
|
884
|
-
* types can run on different models — e.g. `security-scanner` on one model,
|
|
885
|
-
* `documentation` on another — while the leader keeps its own model.
|
|
886
|
-
*
|
|
887
|
-
* Resolution precedence (most → least specific):
|
|
888
|
-
* 1. exact role (matrix["security-scanner"])
|
|
889
|
-
* 2. the role's phase (matrix["review"])
|
|
890
|
-
* 3. the `*` default (matrix["*"])
|
|
891
|
-
* 4. undefined (caller falls back to the leader model)
|
|
892
|
-
*
|
|
893
|
-
* Set via the `/setmodel` slash command; this module is the single source of
|
|
894
|
-
* truth both that command and the spawn path use to validate + resolve keys.
|
|
895
|
-
*/
|
|
896
|
-
|
|
897
|
-
/** All valid phase keys, in catalog order. */
|
|
898
|
-
declare const MATRIX_PHASE_KEYS: readonly string[];
|
|
899
|
-
/** The phase a catalog role belongs to, or undefined for unknown roles. */
|
|
900
|
-
declare function phaseForRole(role: string | undefined): string | undefined;
|
|
901
|
-
type ModelMatrixResolutionSource = 'role' | 'phase' | 'default';
|
|
902
|
-
interface ModelMatrixResolution {
|
|
903
|
-
entry: ModelMatrixEntry;
|
|
904
|
-
source: ModelMatrixResolutionSource;
|
|
905
|
-
key: string;
|
|
906
|
-
}
|
|
907
|
-
/**
|
|
908
|
-
* Resolve the matrix entry plus the key tier it came from. Use this when the
|
|
909
|
-
* caller needs to distinguish an explicit role/phase pin from the global `*`
|
|
910
|
-
* default.
|
|
911
|
-
*/
|
|
912
|
-
declare function resolveModelMatrixResolution(matrix: Record<string, ModelMatrixEntry> | undefined, role: string | undefined): ModelMatrixResolution | undefined;
|
|
913
|
-
/**
|
|
914
|
-
* Resolve the matrix entry for a subagent role. Returns the most specific
|
|
915
|
-
* match (role → phase → `*`), or undefined when nothing matches.
|
|
916
|
-
*/
|
|
917
|
-
declare function resolveModelMatrix(matrix: Record<string, ModelMatrixEntry> | undefined, role: string | undefined): ModelMatrixEntry | undefined;
|
|
918
|
-
interface ResolvedModelTarget {
|
|
919
|
-
provider?: string | undefined;
|
|
920
|
-
model?: string | undefined;
|
|
921
|
-
modelRuntime?: Config['modelRuntime'] | undefined;
|
|
922
|
-
fallbackModels?: string[] | undefined;
|
|
923
|
-
fallbackProfile?: string | undefined;
|
|
924
|
-
}
|
|
925
|
-
interface ResolvedSubagentModelTarget extends ResolvedModelTarget {
|
|
926
|
-
/** Where the concrete provider/model came from. */
|
|
927
|
-
source: 'matrix' | 'diversity' | 'none';
|
|
928
|
-
/** Matrix tier used before any reviewer diversity adjustment. */
|
|
929
|
-
matrixSource?: ModelMatrixResolutionSource | undefined;
|
|
930
|
-
/** True when a reviewer model was shifted away from the implementation model. */
|
|
931
|
-
diversified?: boolean | undefined;
|
|
932
|
-
}
|
|
933
|
-
/**
|
|
934
|
-
* Expand a matrix entry into a concrete primary model plus optional fallback
|
|
935
|
-
* chain. A profile-only matrix entry treats the first profile model as primary
|
|
936
|
-
* and the remaining profile entries as that subagent's fallback chain.
|
|
937
|
-
*/
|
|
938
|
-
declare function resolveModelTargetFromEntry(config: Config, entry: ModelMatrixEntry | undefined): ResolvedModelTarget | undefined;
|
|
939
|
-
interface ModelReference {
|
|
940
|
-
provider?: string | undefined;
|
|
941
|
-
model?: string | undefined;
|
|
942
|
-
}
|
|
943
|
-
/**
|
|
944
|
-
* Roles whose output is meant to challenge an implementer. When these roles
|
|
945
|
-
* would otherwise use the same provider/model as the implementation path,
|
|
946
|
-
* WrongStack tries to pick a different available model to reduce correlated
|
|
947
|
-
* model-family mistakes. Exact role/phase `/setmodel` entries still win.
|
|
948
|
-
*/
|
|
949
|
-
declare function roleNeedsIndependentReviewModel(role: string | undefined): boolean;
|
|
950
|
-
/**
|
|
951
|
-
* Resolve a subagent's matrix target with the reviewer diversity rule applied.
|
|
952
|
-
*
|
|
953
|
-
* Precedence:
|
|
954
|
-
* 1. Exact role or phase matrix entry.
|
|
955
|
-
* 2. Global `*` matrix entry when it is already different from the
|
|
956
|
-
* implementation model.
|
|
957
|
-
* 3. A different configured provider/model for review roles.
|
|
958
|
-
* 4. The matrix/leader fallback.
|
|
959
|
-
*/
|
|
960
|
-
declare function resolveSubagentModelTarget(config: Config, role: string | undefined, opts?: {
|
|
961
|
-
implementationTarget?: ModelReference | undefined;
|
|
962
|
-
}): ResolvedSubagentModelTarget | undefined;
|
|
963
|
-
/**
|
|
964
|
-
* Resolve the default implementation lane. The generic Executor is the closest
|
|
965
|
-
* stable proxy for "the implementer" when a reviewer is spawned without a
|
|
966
|
-
* concrete sibling id.
|
|
967
|
-
*/
|
|
968
|
-
declare function resolveImplementationModelTarget(config: Config): ModelReference;
|
|
969
|
-
declare function sameModelReference(a: ModelReference | undefined, b: ModelReference | undefined): boolean;
|
|
970
|
-
type MatrixKeyKind = 'role' | 'phase' | 'default' | 'unknown';
|
|
971
|
-
/** Classify a matrix key so `/setmodel` can reject typos before persisting. */
|
|
972
|
-
declare function matrixKeyKind(key: string): MatrixKeyKind;
|
|
973
|
-
/** True when `key` is a usable matrix key (role, phase, or `*`). */
|
|
974
|
-
declare function isValidMatrixKey(key: string): boolean;
|
|
975
|
-
|
|
976
|
-
/**
|
|
977
|
-
* package-author-tracker — Tracks which agent added which package to which manifest.
|
|
978
|
-
*
|
|
979
|
-
* Stores a per-project JSON log in the global project directory:
|
|
980
|
-
* ~/.wrongstack/projects/<slug-hash>/package-authors.json
|
|
981
|
-
*
|
|
982
|
-
* Each entry records: manifest path, package name, version range at time of add,
|
|
983
|
-
* agent id/name, timestamp, and session id.
|
|
984
|
-
*
|
|
985
|
-
* Used by the tech-stack agent and outdated-watcher to route outdated-package
|
|
986
|
-
* notifications back to the agent that originally added the package.
|
|
987
|
-
*
|
|
988
|
-
* @module package-author-tracker
|
|
989
|
-
*/
|
|
990
|
-
interface PackageAuthorEntry {
|
|
991
|
-
/** Absolute or relative path to the manifest (package.json, go.mod, etc.). */
|
|
992
|
-
manifestPath: string;
|
|
993
|
-
/** Exact package name as it appears in the manifest. */
|
|
994
|
-
packageName: string;
|
|
995
|
-
/** Version specifier at time of install (e.g. "^1.2.0", "latest", "file:..."). */
|
|
996
|
-
versionSpec: string;
|
|
997
|
-
/** Ecosystem: 'npm', 'cargo', 'go', 'pip', 'gem', 'composer', 'nuget', etc. */
|
|
998
|
-
ecosystem: string;
|
|
999
|
-
/** Agent id that performed the install (e.g. 'leader', 'executor', 'tech-stack'). */
|
|
1000
|
-
agentId: string;
|
|
1001
|
-
/** Human-readable agent name. */
|
|
1002
|
-
agentName?: string | undefined;
|
|
1003
|
-
/** Session that performed the install. */
|
|
1004
|
-
sessionId?: string | undefined;
|
|
1005
|
-
/** ISO8601 timestamp. */
|
|
1006
|
-
timestamp: string;
|
|
1007
|
-
/** Whether this package is currently flagged as outdated. */
|
|
1008
|
-
outdated?: boolean | undefined;
|
|
1009
|
-
/** Latest version available (set by outdated checker). */
|
|
1010
|
-
latestVersion?: string | undefined;
|
|
1011
|
-
}
|
|
1012
|
-
interface PackageAuthorLog {
|
|
1013
|
-
/** Project root this log belongs to. */
|
|
1014
|
-
projectRoot: string;
|
|
1015
|
-
/** All entries, newest last. */
|
|
1016
|
-
entries: PackageAuthorEntry[];
|
|
1017
|
-
/** Last time the log was compacted. */
|
|
1018
|
-
lastCompactedAt?: string | undefined;
|
|
1019
|
-
}
|
|
1020
|
-
interface PackageAuthorTrackerOptions {
|
|
1021
|
-
/** Directory where the JSON log is stored. Usually the global project dir. */
|
|
1022
|
-
storageDir: string;
|
|
1023
|
-
/** Project root for reference. */
|
|
1024
|
-
projectRoot: string;
|
|
1025
|
-
/** Max entries before auto-compaction. Default: 10000. */
|
|
1026
|
-
maxEntries?: number | undefined;
|
|
1027
|
-
}
|
|
1028
|
-
/**
|
|
1029
|
-
* Detect the ecosystem from a manifest filename.
|
|
1030
|
-
*/
|
|
1031
|
-
declare function detectEcosystem(manifestPath: string): string;
|
|
1032
|
-
/**
|
|
1033
|
-
* Record that an agent added (or updated) a package to a manifest file.
|
|
1034
|
-
*
|
|
1035
|
-
* If the same (manifestPath, packageName) entry already exists, the previous
|
|
1036
|
-
* entry is kept (for audit trail) and a new entry is appended.
|
|
1037
|
-
*/
|
|
1038
|
-
declare function recordPackageAction(opts: PackageAuthorTrackerOptions, entry: Omit<PackageAuthorEntry, 'timestamp'>): Promise<void>;
|
|
1039
|
-
/**
|
|
1040
|
-
* Get the most recent author entry for a given (manifest, package) pair.
|
|
1041
|
-
* Returns undefined if no entry exists.
|
|
1042
|
-
*/
|
|
1043
|
-
declare function getPackageAuthor(opts: Pick<PackageAuthorTrackerOptions, 'storageDir' | 'projectRoot'>, manifestPath: string, packageName: string): Promise<PackageAuthorEntry | undefined>;
|
|
1044
|
-
/**
|
|
1045
|
-
* Get all packages in a manifest that have an author on record.
|
|
1046
|
-
*/
|
|
1047
|
-
declare function getManifestPackages(opts: Pick<PackageAuthorTrackerOptions, 'storageDir' | 'projectRoot'>, manifestPath: string): Promise<PackageAuthorEntry[]>;
|
|
1048
|
-
/**
|
|
1049
|
-
* Get all packages last tracked by a specific agent.
|
|
1050
|
-
* Returns a Map from (manifestPath, packageName) → entry.
|
|
1051
|
-
*/
|
|
1052
|
-
declare function getPackagesByAgent(opts: Pick<PackageAuthorTrackerOptions, 'storageDir' | 'projectRoot'>, agentId: string): Promise<Map<string, PackageAuthorEntry>>;
|
|
1053
|
-
/**
|
|
1054
|
-
* Update the outdated status of a package entry (adds or replaces the entry
|
|
1055
|
-
* for the given manifest+package, appending to the log for audit).
|
|
1056
|
-
*/
|
|
1057
|
-
declare function updatePackageOutdatedStatus(opts: PackageAuthorTrackerOptions, manifestPath: string, packageName: string, outdated: boolean, latestVersion?: string | undefined): Promise<void>;
|
|
1058
|
-
/**
|
|
1059
|
-
* Return the full log (for debugging/auditing).
|
|
1060
|
-
*/
|
|
1061
|
-
declare function getFullPackageLog(opts: Pick<PackageAuthorTrackerOptions, 'storageDir' | 'projectRoot'>): Promise<PackageAuthorLog>;
|
|
1062
|
-
|
|
1063
|
-
/**
|
|
1064
|
-
* package-outdated-watcher — Periodically checks installed packages for outdated
|
|
1065
|
-
* versions and notifies the agent that originally added each package.
|
|
1066
|
-
*
|
|
1067
|
-
* Architecture:
|
|
1068
|
-
* 1. Polls the mailbox for `assign` messages from the tech-stack agent
|
|
1069
|
-
* containing outdated package results.
|
|
1070
|
-
* 2. For each outdated package, looks up the original author via
|
|
1071
|
-
* `package-author-tracker`.
|
|
1072
|
-
* 3. Sends a high-priority `note` message to the original author (or
|
|
1073
|
-
* broadcasts to `*` if the author is unknown or no longer online).
|
|
1074
|
-
*
|
|
1075
|
-
* The watcher can also be triggered directly via `checkOutdated` for
|
|
1076
|
-
* on-demand checks (e.g. on a timer, or when the user requests it).
|
|
1077
|
-
*
|
|
1078
|
-
* Usage:
|
|
1079
|
-
* const dispose = startPackageOutdatedWatcher({
|
|
1080
|
-
* mailbox,
|
|
1081
|
-
* storageDir: wpaths.globalDir,
|
|
1082
|
-
* projectRoot,
|
|
1083
|
-
* pollIntervalMs: 60 * 60 * 1000, // 1 hour
|
|
1084
|
-
* onNotify: async (msg) => mailbox.send(msg),
|
|
1085
|
-
* onLog: (m) => console.log(`[pkg-outdated-watcher] ${m}`),
|
|
1086
|
-
* });
|
|
1087
|
-
*
|
|
1088
|
-
* @module package-outdated-watcher
|
|
1089
|
-
*/
|
|
1090
|
-
|
|
1091
|
-
interface PackageOutdatedEntry {
|
|
1092
|
-
/** Package name. */
|
|
1093
|
-
name: string;
|
|
1094
|
-
/** Currently installed version. */
|
|
1095
|
-
currentVersion: string;
|
|
1096
|
-
/** Latest stable version available. */
|
|
1097
|
-
latestVersion: string;
|
|
1098
|
-
/** semver major.minor.patch wanted range (from lockfile). */
|
|
1099
|
-
wantedVersion: string;
|
|
1100
|
-
/** Manifest file this package belongs to. */
|
|
1101
|
-
manifestPath: string;
|
|
1102
|
-
/** Ecosystem: 'npm', 'cargo', 'go', etc. */
|
|
1103
|
-
ecosystem: string;
|
|
1104
|
-
}
|
|
1105
|
-
interface PackageOutdatedResult {
|
|
1106
|
-
/** All outdated entries. */
|
|
1107
|
-
outdated: PackageOutdatedEntry[];
|
|
1108
|
-
/** Packages that are up-to-date. */
|
|
1109
|
-
upToDate: string[];
|
|
1110
|
-
/** Whether the check failed. */
|
|
1111
|
-
checkFailed: boolean;
|
|
1112
|
-
}
|
|
1113
|
-
interface PackageOutdatedWatcherOptions {
|
|
1114
|
-
/** The mailbox for sending notifications and receiving tech-stack results. */
|
|
1115
|
-
mailbox: Mailbox;
|
|
1116
|
-
/** Package-author-tracker options. */
|
|
1117
|
-
packageTrackerOpts: Pick<PackageAuthorTrackerOptions, 'storageDir' | 'projectRoot'>;
|
|
1118
|
-
/** Polling interval in ms. Default: 60 * 60 * 1000 (1 hour). */
|
|
1119
|
-
pollIntervalMs?: number | undefined;
|
|
1120
|
-
/** Agent id that runs this watcher. Default: 'pkg-outdated-watcher'. */
|
|
1121
|
-
watcherAgentId?: string | undefined;
|
|
1122
|
-
/** Agent id of the tech-stack agent to watch for results. Default: 'tech-stack'. */
|
|
1123
|
-
techStackAgentId?: string | undefined;
|
|
1124
|
-
/** Called to send a notification to an agent. */
|
|
1125
|
-
onNotify: (msg: OutdatedNotifyMessage) => Promise<void>;
|
|
1126
|
-
/** Called for log output. */
|
|
1127
|
-
onLog?: ((msg: string) => void) | undefined;
|
|
1128
|
-
/** Called on errors. */
|
|
1129
|
-
onError?: ((err: unknown) => void) | undefined;
|
|
1130
|
-
}
|
|
1131
|
-
interface OutdatedNotifyMessage {
|
|
1132
|
-
from: string;
|
|
1133
|
-
to: string;
|
|
1134
|
-
subject: string;
|
|
1135
|
-
body: string;
|
|
1136
|
-
priority: 'high' | 'normal' | 'low';
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* Start the package outdated watcher.
|
|
1140
|
-
*
|
|
1141
|
-
* Returns a dispose function that stops polling and cleans up.
|
|
1142
|
-
*/
|
|
1143
|
-
declare function startPackageOutdatedWatcher(opts: PackageOutdatedWatcherOptions): () => void;
|
|
1144
|
-
|
|
1145
|
-
/**
|
|
1146
|
-
* Single-instance mailbox-bridge lock.
|
|
1147
|
-
*
|
|
1148
|
-
* Per-project isolation: each project (resolved via
|
|
1149
|
-
* `resolveProjectDir`) gets its own lock file under
|
|
1150
|
-
* `<projectDir>/.mailbox-bridge.lock`. Two projects on the same
|
|
1151
|
-
* machine never collide — different slugs, different lock files,
|
|
1152
|
-
* and (with default port 0) different OS-assigned ports.
|
|
1153
|
-
*
|
|
1154
|
-
* The lock holds:
|
|
1155
|
-
* - pid process id of the owning `wstack mailbox serve`
|
|
1156
|
-
* - host, port what the owner actually bound (port may be OS-assigned)
|
|
1157
|
-
* - url convenience copy for callers
|
|
1158
|
-
* - token the bearer token (so external agents don't have to
|
|
1159
|
-
* re-read it from .mailbox.token separately)
|
|
1160
|
-
* - generation monotonically increasing counter; bumped on every
|
|
1161
|
-
* acquire. Lets a release() call identify whether the
|
|
1162
|
-
* current lock file still belongs to *this* process
|
|
1163
|
-
* (e.g. after a stale cleanup raced with us).
|
|
1164
|
-
* - spawnedAt ISO timestamp — for observability, not load-bearing.
|
|
1165
|
-
*
|
|
1166
|
-
* Concurrency model:
|
|
1167
|
-
* - `acquireOrJoin` is atomic via rename(2). Two concurrent spawns
|
|
1168
|
-
* race to write a tmpfile then rename; one wins, the other reads
|
|
1169
|
-
* the winner's lock and joins.
|
|
1170
|
-
* - PID liveness is checked via `process.kill(pid, 0)` (POSIX) or
|
|
1171
|
-
* `tasklist` (Windows). A live PID means another instance owns
|
|
1172
|
-
* this project; a dead PID means the lock is stale and gets cleaned.
|
|
1173
|
-
* - `release` is best-effort: a missing lock file at shutdown is
|
|
1174
|
-
* fine (someone else already took over). A generation mismatch means
|
|
1175
|
-
* we lost the race and another instance owns it now — also fine.
|
|
1176
|
-
*
|
|
1177
|
-
* Token persistence: the token in the lock always matches the token in
|
|
1178
|
-
* `.mailbox.token`, so an external agent that reads either file gets the
|
|
1179
|
-
* same value. While an instance stays alive, every joining caller
|
|
1180
|
-
* (`kind: 'joined'`) reuses that one token. A cold (re)start — no lock,
|
|
1181
|
-
* or a lock whose owner PID is dead/unhealthy — mints a FRESH token and
|
|
1182
|
-
* rewrites both files atomically. External agents must therefore re-read
|
|
1183
|
-
* `.mailbox.token` after a bridge restart (a stale token returns 401).
|
|
1184
|
-
*/
|
|
1185
|
-
declare const MAILBOX_BRIDGE_LOCK_FILENAME = ".mailbox-bridge.lock";
|
|
1186
|
-
declare const MAILBOX_BRIDGE_TOKEN_FILENAME = ".mailbox.token";
|
|
1187
|
-
interface MailboxBridgeLock {
|
|
1188
|
-
pid: number;
|
|
1189
|
-
host: string;
|
|
1190
|
-
port: number;
|
|
1191
|
-
url: string;
|
|
1192
|
-
token: string;
|
|
1193
|
-
generation: number;
|
|
1194
|
-
spawnedAt: string;
|
|
1195
|
-
}
|
|
1196
|
-
type AcquireResult = {
|
|
1197
|
-
kind: 'acquired';
|
|
1198
|
-
lock: MailboxBridgeLock;
|
|
1199
|
-
tokenPath: string;
|
|
1200
|
-
} | {
|
|
1201
|
-
kind: 'joined';
|
|
1202
|
-
lock: MailboxBridgeLock;
|
|
1203
|
-
tokenPath: string;
|
|
1204
|
-
} | {
|
|
1205
|
-
kind: 'port-conflict';
|
|
1206
|
-
existing: MailboxBridgeLock;
|
|
1207
|
-
};
|
|
1208
|
-
interface AcquireOptions {
|
|
1209
|
-
/** Project dir (already resolved by caller via resolveProjectDir). */
|
|
1210
|
-
projectDir: string;
|
|
1211
|
-
/** Bind host. Required when acquiring. */
|
|
1212
|
-
host: string;
|
|
1213
|
-
/** Explicit port. Pass null/undefined to mean "OS-assigned" (read it after listen). */
|
|
1214
|
-
requestedPort: number | null;
|
|
1215
|
-
/** When true, fail loud on EADDRINUSE. When false, fall back to OS-assigned. */
|
|
1216
|
-
strictPort: boolean;
|
|
1217
|
-
}
|
|
1218
|
-
/**
|
|
1219
|
-
* Try to acquire the mailbox-bridge lock for `projectDir`. If another
|
|
1220
|
-
* instance is already alive and healthy, join it. Otherwise claim
|
|
1221
|
-
* the slot for ourselves.
|
|
1222
|
-
*
|
|
1223
|
-
* Two-phase contract:
|
|
1224
|
-
* 1. Caller invokes `acquireOrJoin(...)` BEFORE calling
|
|
1225
|
-
* `server.listen()`. The returned lock either:
|
|
1226
|
-
* - `kind: 'joined'` → another instance is alive, the caller
|
|
1227
|
-
* should NOT bind; just print the URL/token
|
|
1228
|
-
* and exit cleanly (return 0).
|
|
1229
|
-
* - `kind: 'acquired'` → caller is the owner, proceeds to bind.
|
|
1230
|
-
* - `kind: 'port-conflict'` → caller asked for an explicit port
|
|
1231
|
-
* that's already taken by an unrelated
|
|
1232
|
-
* process; we return the existing owner
|
|
1233
|
-
* but the caller decides what to do
|
|
1234
|
-
* (loud-fail).
|
|
1235
|
-
* 2. After `server.listen()` resolves with a real port, the caller
|
|
1236
|
-
* invokes `finalize(lock, boundPort)` to atomically write the
|
|
1237
|
-
* final lock + token file with the OS-assigned port.
|
|
1238
|
-
*
|
|
1239
|
-
* The two-phase split keeps the listen() call out of the lock module —
|
|
1240
|
-
* the caller owns the HTTP server instance; the lock module owns
|
|
1241
|
-
* the on-disk contract.
|
|
1242
|
-
*/
|
|
1243
|
-
declare function acquireOrJoin(opts: AcquireOptions): Promise<AcquireResult>;
|
|
1244
|
-
/**
|
|
1245
|
-
* Phase 2 — after server.listen() resolves, write the final lock
|
|
1246
|
-
* with the actually-bound port and the same token. Also writes the
|
|
1247
|
-
* .mailbox.token file with mode 0600 so external agents can read it.
|
|
1248
|
-
*
|
|
1249
|
-
* Returns the finalized lock so the caller can use the resolved URL.
|
|
1250
|
-
*/
|
|
1251
|
-
declare function finalize(projectDir: string, tentative: MailboxBridgeLock, boundPort: number): Promise<MailboxBridgeLock>;
|
|
1252
|
-
/**
|
|
1253
|
-
* Phase 3 — best-effort cleanup on shutdown. Removes the lock + token
|
|
1254
|
-
* files IF this process is still the recorded owner (generation match).
|
|
1255
|
-
*
|
|
1256
|
-
* If the generation doesn't match, another acquire() has already
|
|
1257
|
-
* superseded us — we must NOT delete their lock.
|
|
1258
|
-
*/
|
|
1259
|
-
declare function release(projectDir: string, generation: number): Promise<void>;
|
|
1260
|
-
/**
|
|
1261
|
-
* Read the lock file and return it, with enough information for the
|
|
1262
|
-
* caller to distinguish:
|
|
1263
|
-
* - 'live' — PID alive, /healthz reachable; safe to use.
|
|
1264
|
-
* - 'probe-failed' — PID alive (or recently was) but /healthz
|
|
1265
|
-
* unreachable. Caller can still return the URL
|
|
1266
|
-
* + token to the host so its request layer can
|
|
1267
|
-
* retry; the host's fetch timeout will surface
|
|
1268
|
-
* the real error if the bridge is truly dead.
|
|
1269
|
-
* - 'absent' — no lock file existed, or it was malformed
|
|
1270
|
-
* (cleaned up best-effort).
|
|
1271
|
-
*
|
|
1272
|
-
* Distinguishing 'probe-failed' from 'absent' matters for the
|
|
1273
|
-
* "joined vs spawned" decision in tryAcquireMailboxBridge — we
|
|
1274
|
-
* don't want to spawn a second bridge just because /healthz flaked.
|
|
1275
|
-
*/
|
|
1276
|
-
type LiveLockResult = {
|
|
1277
|
-
kind: 'live';
|
|
1278
|
-
lock: MailboxBridgeLock;
|
|
1279
|
-
}
|
|
1280
|
-
/**
|
|
1281
|
-
* The lock exists but isn't usable. `pidAlive` tells the caller
|
|
1282
|
-
* which recovery to pick:
|
|
1283
|
-
* - `pidAlive: false` — the owning process is dead (stale lock).
|
|
1284
|
-
* Callers should treat this like `absent` and spawn a fresh
|
|
1285
|
-
* bridge rather than surfacing a dead URL.
|
|
1286
|
-
* - `pidAlive: true` — the process is alive but /healthz didn't
|
|
1287
|
-
* respond (booting/wedged/PID-reuse). Callers may return the
|
|
1288
|
-
* recorded URL/token and let a real request confirm liveness.
|
|
1289
|
-
*/
|
|
1290
|
-
| {
|
|
1291
|
-
kind: 'probe-failed';
|
|
1292
|
-
lock: MailboxBridgeLock;
|
|
1293
|
-
pidAlive: boolean;
|
|
1294
|
-
} | {
|
|
1295
|
-
kind: 'absent';
|
|
1296
|
-
};
|
|
1297
|
-
declare function readLiveLock(projectDir: string): Promise<LiveLockResult>;
|
|
1298
|
-
|
|
1299
|
-
/**
|
|
1300
|
-
* Adaptive Concurrency Controller
|
|
1301
|
-
*
|
|
1302
|
-
* Automatically adjusts `maxConcurrent` based on:
|
|
1303
|
-
* - Rate limit (429) errors → decrease concurrency
|
|
1304
|
-
* - Sustained successful requests → increase concurrency
|
|
1305
|
-
*
|
|
1306
|
-
* This provides automatic backpressure without manual tuning.
|
|
1307
|
-
*/
|
|
1308
|
-
|
|
1309
|
-
interface AdaptiveConcurrencyState {
|
|
1310
|
-
current: number;
|
|
1311
|
-
min: number;
|
|
1312
|
-
max: number;
|
|
1313
|
-
consecutiveSuccesses: number;
|
|
1314
|
-
consecutiveFailures: number;
|
|
1315
|
-
totalDecreases: number;
|
|
1316
|
-
totalIncreases: number;
|
|
1317
|
-
enabled: boolean;
|
|
1318
|
-
}
|
|
1319
|
-
/**
|
|
1320
|
-
* Adaptive Concurrency Controller
|
|
1321
|
-
*
|
|
1322
|
-
* Monitors fleet events for rate-limit (429) errors and adjusts concurrency
|
|
1323
|
-
* automatically to prevent overwhelming the API provider.
|
|
1324
|
-
*/
|
|
1325
|
-
declare class AdaptiveConcurrencyController {
|
|
1326
|
-
private readonly config;
|
|
1327
|
-
private state;
|
|
1328
|
-
private readonly disposers;
|
|
1329
|
-
private stateChangeHandlers;
|
|
1330
|
-
private readonly logger;
|
|
1331
|
-
constructor(fleetBus: FleetBus, setMaxConcurrent: (n: number) => void, config?: Partial<AdaptiveConcurrencyConfig>, onStateChange?: (state: AdaptiveConcurrencyState) => void, logger?: Pick<Logger, 'warn'>);
|
|
1332
|
-
private setupEventHandlers;
|
|
1333
|
-
/**
|
|
1334
|
-
* Handle a rate limit (429) error - decrease concurrency
|
|
1335
|
-
*/
|
|
1336
|
-
private handleRateLimit;
|
|
1337
|
-
/**
|
|
1338
|
-
* Force a decrease (e.g., manual trigger or other error types)
|
|
1339
|
-
*/
|
|
1340
|
-
decrease(target?: number): void;
|
|
1341
|
-
/**
|
|
1342
|
-
* Get the current state
|
|
1343
|
-
*/
|
|
1344
|
-
getState(): AdaptiveConcurrencyState;
|
|
1345
|
-
/**
|
|
1346
|
-
* Update configuration at runtime
|
|
1347
|
-
*/
|
|
1348
|
-
updateConfig(config: Partial<AdaptiveConcurrencyConfig>): void;
|
|
1349
|
-
/**
|
|
1350
|
-
* Dispose of the controller and clean up event listeners
|
|
1351
|
-
*/
|
|
1352
|
-
dispose(): void;
|
|
1353
|
-
private notifyStateChange;
|
|
1354
|
-
/**
|
|
1355
|
-
* Register a state change handler
|
|
1356
|
-
*/
|
|
1357
|
-
onStateChange(handler: (state: AdaptiveConcurrencyState) => void): () => void;
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
interface AgentTimelineEntry {
|
|
1361
|
-
/** Unique entry id (ULID or timestamp-based). */
|
|
1362
|
-
id: string;
|
|
1363
|
-
/** Subagent id this entry belongs to. */
|
|
1364
|
-
subagentId: string;
|
|
1365
|
-
/** Human-readable agent name/role. */
|
|
1366
|
-
agentName: string;
|
|
1367
|
-
/** ISO 8601 timestamp. */
|
|
1368
|
-
ts: string;
|
|
1369
|
-
/** Content type. */
|
|
1370
|
-
kind: 'text' | 'thinking' | 'tool_use' | 'tool_result' | 'error' | 'status' | 'system';
|
|
1371
|
-
/** The message content (text, tool summary, error message, status text). */
|
|
1372
|
-
content: string;
|
|
1373
|
-
/** Iteration index within the subagent's run. */
|
|
1374
|
-
iteration: number;
|
|
1375
|
-
/** For tool entries: tool name. */
|
|
1376
|
-
toolName?: string | undefined;
|
|
1377
|
-
/** For tool entries: whether the tool succeeded. */
|
|
1378
|
-
toolOk?: boolean | undefined;
|
|
1379
|
-
/** Running cost estimate. */
|
|
1380
|
-
costUsd?: number | undefined;
|
|
1381
|
-
}
|
|
1382
|
-
interface AgentVirtualSession {
|
|
1383
|
-
subagentId: string;
|
|
1384
|
-
agentName: string;
|
|
1385
|
-
createdAt: string;
|
|
1386
|
-
status: string;
|
|
1387
|
-
task?: string | undefined;
|
|
1388
|
-
/** Ordered transcript entries (newest last). */
|
|
1389
|
-
transcript: AgentTimelineEntry[];
|
|
1390
|
-
}
|
|
1391
|
-
interface AgentMonitorOptions {
|
|
1392
|
-
/** Parent/host session id for emitted agent timeline/status events. */
|
|
1393
|
-
sessionId?: string | undefined;
|
|
1394
|
-
/** The FleetBus to listen on for subagent events. Optional — set via `setFleetBus()` before `start()`. */
|
|
1395
|
-
fleetBus?: FleetBus | undefined;
|
|
1396
|
-
/** Local EventBus for emitting agent.timeline.* and agent.status_changed events. */
|
|
1397
|
-
events: EventBus;
|
|
1398
|
-
/** Directory where per-subagent JSONL transcripts will be written. */
|
|
1399
|
-
transcriptsDir: string;
|
|
1400
|
-
/** Maximum in-memory entries per subagent (ring buffer). Default 500. */
|
|
1401
|
-
maxEntriesPerAgent?: number;
|
|
1402
|
-
/** Whether agent stream is initially enabled. Default false. */
|
|
1403
|
-
streamEnabled?: boolean;
|
|
1404
|
-
/** Called for each new timeline entry — used by HQ publisher bridge. */
|
|
1405
|
-
onEntry?: ((entry: AgentTimelineEntry) => void) | undefined;
|
|
1406
|
-
}
|
|
1407
|
-
declare class AgentMonitorService {
|
|
1408
|
-
private _fleetBus;
|
|
1409
|
-
private readonly _events;
|
|
1410
|
-
private readonly _sessionId;
|
|
1411
|
-
private readonly _transcriptsDir;
|
|
1412
|
-
private readonly _maxEntries;
|
|
1413
|
-
private _streamEnabled;
|
|
1414
|
-
private _onEntry;
|
|
1415
|
-
/** Per-subagent virtual sessions. */
|
|
1416
|
-
private readonly _sessions;
|
|
1417
|
-
/** Disposers for FleetBus subscriptions, keyed by subagentId. */
|
|
1418
|
-
private readonly _subscriptions;
|
|
1419
|
-
/** Generic fleet-wide subscription disposer. */
|
|
1420
|
-
private _fleetDisposer;
|
|
1421
|
-
/** Track whether service is running. */
|
|
1422
|
-
private _started;
|
|
1423
|
-
constructor(opts: AgentMonitorOptions);
|
|
1424
|
-
/** Set the FleetBus to listen on. Must be called before `start()`. */
|
|
1425
|
-
setFleetBus(bus: FleetBus): void;
|
|
1426
|
-
get streamEnabled(): boolean;
|
|
1427
|
-
/** Enable/disable streaming agent conversations to the main chat timeline. */
|
|
1428
|
-
setStreamEnabled(enabled: boolean): void;
|
|
1429
|
-
/** Get a snapshot of all known agent sessions. */
|
|
1430
|
-
getAllSessions(): AgentVirtualSession[];
|
|
1431
|
-
/** Get a specific agent's virtual session, or undefined. */
|
|
1432
|
-
getSession(subagentId: string): AgentVirtualSession | undefined;
|
|
1433
|
-
/** Get transcript entries for a specific agent, newest first. */
|
|
1434
|
-
getTranscript(subagentId: string, limit?: number): AgentTimelineEntry[];
|
|
1435
|
-
/** Set a callback for each new timeline entry (HQ bridge). */
|
|
1436
|
-
setOnEntry(handler: ((entry: AgentTimelineEntry) => void) | undefined): void;
|
|
1437
|
-
/** Start listening to FleetBus events. */
|
|
1438
|
-
start(): void;
|
|
1439
|
-
/** Stop listening and clean up all subscriptions. */
|
|
1440
|
-
stop(): void;
|
|
1441
|
-
/** Ensure a subagent is being tracked. Called when a subagent spawns. */
|
|
1442
|
-
trackSubagent(subagentId: string, agentName: string, task?: string): void;
|
|
1443
|
-
/** Mark a subagent as completed/failed/etc. Called on subagent finish. */
|
|
1444
|
-
completeSubagent(subagentId: string, status: 'completed' | 'failed' | 'timeout' | 'stopped' | 'budget_exhausted', summary?: string): void;
|
|
1445
|
-
private _routeEvent;
|
|
1446
|
-
private _addEntry;
|
|
1447
|
-
private _appendToFile;
|
|
1448
|
-
private _uid;
|
|
1449
|
-
private _formatToolUse;
|
|
1450
|
-
private _formatToolResult;
|
|
1451
|
-
private _stringifyForTimeline;
|
|
1452
|
-
private _capTimelineText;
|
|
1453
|
-
}
|
|
1454
|
-
declare function createAgentMonitorService(opts: AgentMonitorOptions): AgentMonitorService;
|
|
1455
|
-
|
|
1456
|
-
type NodeType = 'fact' | 'goal' | 'decision' | 'change' | 'vote';
|
|
1457
|
-
type FactCategory = 'bug' | 'refactor' | 'security' | 'test' | 'perf' | 'deps' | 'architecture' | 'quality';
|
|
1458
|
-
type GoalStatus = 'pending' | 'in_progress' | 'blocked' | 'done' | 'failed';
|
|
1459
|
-
type GoalPriority = 'critical' | 'high' | 'medium' | 'low';
|
|
1460
|
-
type ChangeStatus = 'proposed' | 'approved' | 'rejected' | 'applied' | 'rolled_back';
|
|
1461
|
-
type VoteValue = 'approve' | 'reject' | 'abstain';
|
|
1462
|
-
type DecisionType = 'spawn' | 'assign' | 'approve_change' | 'reject_change' | 'escalate' | 'rollback' | 'merge_results';
|
|
1463
|
-
interface FactNode {
|
|
1464
|
-
id: string;
|
|
1465
|
-
type: 'fact';
|
|
1466
|
-
category: FactCategory;
|
|
1467
|
-
subject: string;
|
|
1468
|
-
detail: string;
|
|
1469
|
-
file?: string;
|
|
1470
|
-
line?: number;
|
|
1471
|
-
severity?: 'critical' | 'high' | 'medium' | 'low';
|
|
1472
|
-
discoveredBy: string;
|
|
1473
|
-
discoveredAt: string;
|
|
1474
|
-
tags: string[];
|
|
1475
|
-
/** Stable key — dedup facts about the same subject */
|
|
1476
|
-
key: string;
|
|
1477
|
-
/** References to other nodes this fact relates to */
|
|
1478
|
-
related: string[];
|
|
1479
|
-
}
|
|
1480
|
-
interface GoalNode {
|
|
1481
|
-
id: string;
|
|
1482
|
-
type: 'goal';
|
|
1483
|
-
title: string;
|
|
1484
|
-
description: string;
|
|
1485
|
-
status: GoalStatus;
|
|
1486
|
-
priority: GoalPriority;
|
|
1487
|
-
assignee?: string;
|
|
1488
|
-
blockedBy: string[];
|
|
1489
|
-
dependsOn: string[];
|
|
1490
|
-
createdBy: string;
|
|
1491
|
-
createdAt: string;
|
|
1492
|
-
updatedAt: string;
|
|
1493
|
-
tags: string[];
|
|
1494
|
-
/** Sub-goals spawned from this goal */
|
|
1495
|
-
children: string[];
|
|
1496
|
-
/** The top-level goal this belongs to (for hierarchy) */
|
|
1497
|
-
parentGoal?: string;
|
|
1498
|
-
result?: string;
|
|
1499
|
-
}
|
|
1500
|
-
interface DecisionNode {
|
|
1501
|
-
id: string;
|
|
1502
|
-
type: 'decision';
|
|
1503
|
-
decisionType: DecisionType;
|
|
1504
|
-
question: string;
|
|
1505
|
-
options: {
|
|
1506
|
-
id: string;
|
|
1507
|
-
label: string;
|
|
1508
|
-
risk?: string;
|
|
1509
|
-
}[];
|
|
1510
|
-
chosen: string;
|
|
1511
|
-
rationale: string;
|
|
1512
|
-
madeBy: string;
|
|
1513
|
-
madeAt: string;
|
|
1514
|
-
context?: string;
|
|
1515
|
-
}
|
|
1516
|
-
interface ChangeNode {
|
|
1517
|
-
id: string;
|
|
1518
|
-
type: 'change';
|
|
1519
|
-
title: string;
|
|
1520
|
-
description: string;
|
|
1521
|
-
files: {
|
|
1522
|
-
path: string;
|
|
1523
|
-
action: 'create' | 'modify' | 'delete';
|
|
1524
|
-
}[];
|
|
1525
|
-
status: ChangeStatus;
|
|
1526
|
-
proposedBy: string;
|
|
1527
|
-
proposedAt: string;
|
|
1528
|
-
approvedBy: string[];
|
|
1529
|
-
rejectedBy: string[];
|
|
1530
|
-
appliedAt?: string;
|
|
1531
|
-
rolledBackAt?: string;
|
|
1532
|
-
rollbackReason?: string;
|
|
1533
|
-
votes: VoteRecord[];
|
|
1534
|
-
qualityGate: QualityGateResult;
|
|
1535
|
-
/** Goals satisfied by this change */
|
|
1536
|
-
satisfiesGoals: string[];
|
|
1537
|
-
}
|
|
1538
|
-
interface VoteRecord {
|
|
1539
|
-
agentId: string;
|
|
1540
|
-
agentName: string;
|
|
1541
|
-
value: VoteValue;
|
|
1542
|
-
rationale?: string | undefined;
|
|
1543
|
-
votedAt: string;
|
|
1544
|
-
}
|
|
1545
|
-
interface QualityGateResult {
|
|
1546
|
-
passed: boolean;
|
|
1547
|
-
checks: QualityCheck[];
|
|
1548
|
-
}
|
|
1549
|
-
interface QualityCheck {
|
|
1550
|
-
name: string;
|
|
1551
|
-
passed: boolean;
|
|
1552
|
-
detail?: string;
|
|
1553
|
-
}
|
|
1554
|
-
interface VoteNode {
|
|
1555
|
-
id: string;
|
|
1556
|
-
type: 'vote';
|
|
1557
|
-
changeId: string;
|
|
1558
|
-
voterId: string;
|
|
1559
|
-
voterName: string;
|
|
1560
|
-
value: VoteValue;
|
|
1561
|
-
rationale?: string;
|
|
1562
|
-
votedAt: string;
|
|
1563
|
-
}
|
|
1564
|
-
type GraphNode = FactNode | GoalNode | DecisionNode | ChangeNode | VoteNode;
|
|
1565
|
-
interface GraphSubscription {
|
|
1566
|
-
id: string;
|
|
1567
|
-
agentId: string;
|
|
1568
|
-
/** JSONPath-like filter */
|
|
1569
|
-
filter: NodeFilter;
|
|
1570
|
-
/** Channel for this specific subscription */
|
|
1571
|
-
channel: string;
|
|
1572
|
-
}
|
|
1573
|
-
interface NodeFilter {
|
|
1574
|
-
type?: NodeType;
|
|
1575
|
-
category?: FactCategory;
|
|
1576
|
-
status?: GoalStatus | ChangeStatus;
|
|
1577
|
-
tags?: string[];
|
|
1578
|
-
assignee?: string;
|
|
1579
|
-
discoveredBy?: string;
|
|
1580
|
-
proposedBy?: string;
|
|
1581
|
-
/** Only nodes added after this timestamp */
|
|
1582
|
-
since?: string;
|
|
1583
|
-
}
|
|
1584
|
-
declare class KnowledgeGraph {
|
|
1585
|
-
private readonly nodes;
|
|
1586
|
-
private readonly index;
|
|
1587
|
-
private readonly subs;
|
|
1588
|
-
private readonly pendingDeliveries;
|
|
1589
|
-
private readonly filePath;
|
|
1590
|
-
private readonly graphFilePath;
|
|
1591
|
-
/**
|
|
1592
|
-
* Stable per-node insertion sequence. `nodes` (a Map) preserves insertion
|
|
1593
|
-
* order even across `update()` (Map.set on an existing key keeps its slot),
|
|
1594
|
-
* but the type index's `Set<string>` does NOT — `update()` removes then
|
|
1595
|
-
* re-adds a node's id, moving it to the set's tail. Index-routed queries sort
|
|
1596
|
-
* by this sequence so they return nodes in creation order, matching the old
|
|
1597
|
-
* `nodes.values()` scan that callers like decision-history `slice(-10)` rely on.
|
|
1598
|
-
*/
|
|
1599
|
-
private readonly seq;
|
|
1600
|
-
private seqCounter;
|
|
1601
|
-
/** Assign a stable insertion sequence the first time a node id is seen. */
|
|
1602
|
-
private _trackSeq;
|
|
1603
|
-
/** Exposed for unit-testing only: read current index contents. */
|
|
1604
|
-
getIndex(): ReadonlyMap<string, ReadonlySet<string>>;
|
|
1605
|
-
constructor(sessionDir: string);
|
|
1606
|
-
/**
|
|
1607
|
-
* Add a node. Fires to all matching subscriptions synchronously.
|
|
1608
|
-
* Returns the node with its assigned id.
|
|
1609
|
-
*/
|
|
1610
|
-
add(node: Omit<GraphNode, 'id'>): Promise<GraphNode>;
|
|
1611
|
-
/** Update an existing node by id. Returns updated node or null if not found. */
|
|
1612
|
-
update(id: string, patch: Partial<GraphNode>): Promise<GraphNode | null>;
|
|
1613
|
-
get(id: string): GraphNode | undefined;
|
|
1614
|
-
getAll(filter?: NodeFilter): GraphNode[];
|
|
1615
|
-
getGoals(filter?: Partial<{
|
|
1616
|
-
status: GoalStatus;
|
|
1617
|
-
assignee: string;
|
|
1618
|
-
priority: GoalPriority;
|
|
1619
|
-
}>): GoalNode[];
|
|
1620
|
-
getFacts(filter?: Partial<{
|
|
1621
|
-
category: FactCategory;
|
|
1622
|
-
severity: string;
|
|
1623
|
-
}>): FactNode[];
|
|
1624
|
-
getChanges(filter?: Partial<{
|
|
1625
|
-
status: ChangeStatus;
|
|
1626
|
-
}>): ChangeNode[];
|
|
1627
|
-
getOpenGoals(): GoalNode[];
|
|
1628
|
-
getTopLevelGoals(): GoalNode[];
|
|
1629
|
-
getBlockedGoals(): GoalNode[];
|
|
1630
|
-
getPendingChanges(): ChangeNode[];
|
|
1631
|
-
getDecisions(since?: string): DecisionNode[];
|
|
1632
|
-
searchFacts(query: string): FactNode[];
|
|
1633
|
-
getRelatedFacts(factId: string): FactNode[];
|
|
1634
|
-
/**
|
|
1635
|
-
* Subscribe to nodes matching a filter. Returns a channel id that can be
|
|
1636
|
-
* used to poll for new nodes since the last check.
|
|
1637
|
-
*/
|
|
1638
|
-
subscribe(agentId: string, filter: NodeFilter): string;
|
|
1639
|
-
/**
|
|
1640
|
-
* Poll for new nodes delivered to a channel since last check.
|
|
1641
|
-
* Clears the delivery buffer after reading.
|
|
1642
|
-
*/
|
|
1643
|
-
poll(channel: string): GraphNode[];
|
|
1644
|
-
unsubscribe(channel: string): void;
|
|
1645
|
-
/**
|
|
1646
|
-
* Create a quality gate result. Call this when a change is being proposed
|
|
1647
|
-
* so the change node carries the gate result.
|
|
1648
|
-
*/
|
|
1649
|
-
static makeQualityGate(checks: {
|
|
1650
|
-
name: string;
|
|
1651
|
-
passed: boolean;
|
|
1652
|
-
detail?: string;
|
|
1653
|
-
}[]): QualityGateResult;
|
|
1654
|
-
/** Pure: compute the set of index keys a node would belong to. */
|
|
1655
|
-
private _indexKeys;
|
|
1656
|
-
/** Mutate the index: add a node's id to every set for the given keys. */
|
|
1657
|
-
private _addToIndex;
|
|
1658
|
-
/** Remove a node's id from all index sets for the given keys. */
|
|
1659
|
-
private _removeFromIndex;
|
|
1660
|
-
private _matches;
|
|
1661
|
-
private _deliver;
|
|
1662
|
-
private _persist;
|
|
1663
|
-
private _append;
|
|
1664
|
-
/** Rebuild in-memory state from the log file. Call on startup. */
|
|
1665
|
-
load(): Promise<void>;
|
|
1666
|
-
/** Snapshot for serialization. */
|
|
1667
|
-
snapshot(): {
|
|
1668
|
-
nodes: GraphNode[];
|
|
1669
|
-
subs: number;
|
|
1670
|
-
};
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
type AutonomousDecisionType = 'spawn' | 'approve_change' | 'reject_change' | 'prioritize_goals' | 'escalate_task' | 'rollback_change' | 'retry_task' | 'merge_results' | 'decompose_goal' | 'assign_task';
|
|
1674
|
-
interface AutonomousDecisionRequest {
|
|
1675
|
-
id: string;
|
|
1676
|
-
source: BrainDecisionSource;
|
|
1677
|
-
decisionType: AutonomousDecisionType;
|
|
1678
|
-
question: string;
|
|
1679
|
-
context: {
|
|
1680
|
-
/** Relevant facts from the knowledge graph */
|
|
1681
|
-
facts?: FactNode[];
|
|
1682
|
-
/** Goals relevant to this decision */
|
|
1683
|
-
goals?: GoalNode[];
|
|
1684
|
-
/** Change being reviewed (for approval decisions) */
|
|
1685
|
-
change?: ChangeNode;
|
|
1686
|
-
/** Current fleet status */
|
|
1687
|
-
fleetStatus?: {
|
|
1688
|
-
running: number;
|
|
1689
|
-
idle: number;
|
|
1690
|
-
total: number;
|
|
1691
|
-
costSoFar: number;
|
|
1692
|
-
};
|
|
1693
|
-
/** Task that triggered this decision */
|
|
1694
|
-
taskDescription?: string;
|
|
1695
|
-
/** Error that triggered escalation, if any */
|
|
1696
|
-
error?: string;
|
|
1697
|
-
/** Number of times this task has been attempted */
|
|
1698
|
-
attempts?: number;
|
|
1699
|
-
};
|
|
1700
|
-
options: BrainDecisionOption[];
|
|
1701
|
-
risk: BrainRisk;
|
|
1702
|
-
/** Whether this decision requires consensus */
|
|
1703
|
-
requiresConsensus: boolean;
|
|
1704
|
-
}
|
|
1705
|
-
interface SpawnDecision {
|
|
1706
|
-
role: string;
|
|
1707
|
-
budget: {
|
|
1708
|
-
timeoutMs?: number;
|
|
1709
|
-
maxIterations?: number;
|
|
1710
|
-
maxToolCalls?: number;
|
|
1711
|
-
maxCostUsd?: number;
|
|
1712
|
-
};
|
|
1713
|
-
rationale: string;
|
|
1714
|
-
}
|
|
1715
|
-
interface ApprovalDecision {
|
|
1716
|
-
approved: boolean;
|
|
1717
|
-
rationale: string;
|
|
1718
|
-
waivers?: string[];
|
|
1719
|
-
conditions?: string[];
|
|
1720
|
-
}
|
|
1721
|
-
interface PrioritizationDecision {
|
|
1722
|
-
orderedGoals: string[];
|
|
1723
|
-
rationale: string;
|
|
1724
|
-
}
|
|
1725
|
-
interface EscalationDecision {
|
|
1726
|
-
action: 'retry' | 'delegate' | 'mark_failed' | 'ask_for_help';
|
|
1727
|
-
rationale: string;
|
|
1728
|
-
budgetAdjustment?: {
|
|
1729
|
-
increaseFactor?: number;
|
|
1730
|
-
newTimeoutMs?: number;
|
|
1731
|
-
addModel?: string;
|
|
1732
|
-
};
|
|
1733
|
-
}
|
|
1734
|
-
interface AutonomousBrainOptions {
|
|
1735
|
-
/** The LLM provider for making decisions */
|
|
1736
|
-
llmProvider: LLMProvider;
|
|
1737
|
-
graph: KnowledgeGraph;
|
|
1738
|
-
fleet?: FleetBus | undefined;
|
|
1739
|
-
/** Maximum retries before a task is marked failed. Default: 3. */
|
|
1740
|
-
maxRetries?: number | undefined;
|
|
1741
|
-
/** Risk threshold above which consensus is required. Default: 'high'. */
|
|
1742
|
-
consensusRiskThreshold?: BrainRisk | undefined;
|
|
1743
|
-
/** Self-improve: track decision history for learning. Default: true. */
|
|
1744
|
-
selfImprove?: boolean | undefined;
|
|
1745
|
-
}
|
|
1746
|
-
interface LLMProvider {
|
|
1747
|
-
/**
|
|
1748
|
-
* Generate a decision. Receives the full context as a structured prompt.
|
|
1749
|
-
* Returns the chosen option id and rationale.
|
|
1750
|
-
*/
|
|
1751
|
-
decide(prompt: DecisionPrompt): Promise<{
|
|
1752
|
-
optionId: string;
|
|
1753
|
-
rationale: string;
|
|
1754
|
-
}>;
|
|
1755
|
-
}
|
|
1756
|
-
interface DecisionPrompt {
|
|
1757
|
-
decisionType: AutonomousDecisionType;
|
|
1758
|
-
question: string;
|
|
1759
|
-
context: string;
|
|
1760
|
-
options: BrainDecisionOption[];
|
|
1761
|
-
risk: BrainRisk;
|
|
1762
|
-
decisionHistory: DecisionNode[];
|
|
1763
|
-
/** Hints derived from self-improvement data */
|
|
1764
|
-
selfImproveHints?: string[];
|
|
1765
|
-
}
|
|
1766
|
-
declare class AutonomousBrain implements BrainArbiter {
|
|
1767
|
-
private readonly graph;
|
|
1768
|
-
private readonly fleetBus?;
|
|
1769
|
-
private readonly llmProvider;
|
|
1770
|
-
private readonly maxRetries;
|
|
1771
|
-
private readonly consensusRiskThreshold;
|
|
1772
|
-
private readonly selfImprove;
|
|
1773
|
-
/** Decision history for self-improvement and audit. */
|
|
1774
|
-
private decisionHistory;
|
|
1775
|
-
/** Tracks failure patterns for self-improvement. */
|
|
1776
|
-
private failurePatterns;
|
|
1777
|
-
private readonly RISK_ORDER;
|
|
1778
|
-
private _emit;
|
|
1779
|
-
constructor(opts: AutonomousBrainOptions);
|
|
1780
|
-
/** Implements BrainArbiter — bridges standard brain.ts interface to autonomous engine. */
|
|
1781
|
-
decide(request: BrainDecisionRequest): Promise<BrainDecision>;
|
|
1782
|
-
/**
|
|
1783
|
-
* Primary autonomous decision engine — receives AutonomousDecisionRequest,
|
|
1784
|
-
* queries the LLM, records the decision, and returns a BrainDecision.
|
|
1785
|
-
*
|
|
1786
|
-
* Specialized methods (decideSpawn, decideApproval, etc.) should call this
|
|
1787
|
-
* directly with a pre-built AutonomousDecisionRequest.
|
|
1788
|
-
*/
|
|
1789
|
-
decideAuto(request: AutonomousDecisionRequest): Promise<BrainDecision>;
|
|
1790
|
-
/**
|
|
1791
|
-
* Decide whether to spawn a subagent, which role to use, and what budget.
|
|
1792
|
-
*/
|
|
1793
|
-
decideSpawn(source: BrainDecisionSource, taskDescription: string, availableFacts: FactNode[], fleetStatus: {
|
|
1794
|
-
running: number;
|
|
1795
|
-
idle: number;
|
|
1796
|
-
total: number;
|
|
1797
|
-
costSoFar: number;
|
|
1798
|
-
}): Promise<BrainDecision>;
|
|
1799
|
-
/**
|
|
1800
|
-
* Decide whether to approve a proposed change.
|
|
1801
|
-
*/
|
|
1802
|
-
decideApproval(source: BrainDecisionSource, change: ChangeNode, relevantFacts: FactNode[]): Promise<BrainDecision>;
|
|
1803
|
-
/**
|
|
1804
|
-
* Decide how to handle a failed task.
|
|
1805
|
-
*/
|
|
1806
|
-
decideEscalation(source: BrainDecisionSource, taskId: string, error: string, attempts: number): Promise<BrainDecision>;
|
|
1807
|
-
/**
|
|
1808
|
-
* Record the outcome of a decision for self-improvement.
|
|
1809
|
-
* Call this after a spawned agent completes or a change is applied.
|
|
1810
|
-
*/
|
|
1811
|
-
recordOutcome(decisionId: string, outcome: 'success' | 'failure', _detail?: string): void;
|
|
1812
|
-
private _getSelfImproveHints;
|
|
1813
|
-
private _toAutonomous;
|
|
1814
|
-
private _inferDecisionType;
|
|
1815
|
-
private _serializeContext;
|
|
1816
|
-
private _loadHistory;
|
|
1817
|
-
private _recordDecision;
|
|
1818
|
-
private _inferRoles;
|
|
1819
|
-
private _changeRisk;
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
/**
|
|
1823
|
-
* TaskDAG — Directed Acyclic Graph of tasks with fork/join semantics.
|
|
1824
|
-
*
|
|
1825
|
-
* Replaces the Director's flat `awaitTasks()` with a proper dependency graph.
|
|
1826
|
-
* Each task has explicit dependencies; the DAG resolves which tasks are
|
|
1827
|
-
* runnable at any moment and manages blocking/unblocking as tasks complete.
|
|
1828
|
-
*
|
|
1829
|
-
* Key features:
|
|
1830
|
-
* - Fork: one parent spawns multiple children that run in parallel
|
|
1831
|
-
* - Join: a task can wait for multiple children before continuing
|
|
1832
|
-
* - Dynamic: tasks can be added dynamically; the graph re-evaluates runnable set
|
|
1833
|
-
* - Cycle detection: inserting a dependency that would create a cycle throws
|
|
1834
|
-
* - Priority queue: within a "runnable" set, tasks are ordered by priority
|
|
1835
|
-
* - Deadlock detection: if no tasks are runnable and no tasks are complete,
|
|
1836
|
-
* the DAG is in deadlock — agents are notified
|
|
1837
|
-
*
|
|
1838
|
-
* @module task-dag
|
|
1839
|
-
*/
|
|
1840
|
-
/** Represents a node in the DAG. */
|
|
1841
|
-
interface DAGNode {
|
|
1842
|
-
id: string;
|
|
1843
|
-
description: string;
|
|
1844
|
-
role?: string;
|
|
1845
|
-
priority: number;
|
|
1846
|
-
status: DAGNodeStatus;
|
|
1847
|
-
deps: string[];
|
|
1848
|
-
dependents: string[];
|
|
1849
|
-
result?: unknown;
|
|
1850
|
-
error?: string;
|
|
1851
|
-
spawnedAt?: string;
|
|
1852
|
-
completedAt?: string;
|
|
1853
|
-
assignedTo?: string;
|
|
1854
|
-
tags: string[];
|
|
1855
|
-
}
|
|
1856
|
-
type DAGNodeStatus = 'pending' | 'ready' | 'running' | 'done' | 'failed' | 'skipped';
|
|
1857
|
-
/** Event emitted by the DAG on state changes. */
|
|
1858
|
-
type DAGEdgeEvent = {
|
|
1859
|
-
type: 'node:ready';
|
|
1860
|
-
nodeId: string;
|
|
1861
|
-
deps: string[];
|
|
1862
|
-
} | {
|
|
1863
|
-
type: 'node:started';
|
|
1864
|
-
nodeId: string;
|
|
1865
|
-
assignedTo: string;
|
|
1866
|
-
} | {
|
|
1867
|
-
type: 'node:completed';
|
|
1868
|
-
nodeId: string;
|
|
1869
|
-
result: unknown;
|
|
1870
|
-
blockers: string[];
|
|
1871
|
-
} | {
|
|
1872
|
-
type: 'node:failed';
|
|
1873
|
-
nodeId: string;
|
|
1874
|
-
error: string;
|
|
1875
|
-
blockers: string[];
|
|
1876
|
-
} | {
|
|
1877
|
-
type: 'node:skipped';
|
|
1878
|
-
nodeId: string;
|
|
1879
|
-
reason: string;
|
|
1880
|
-
} | {
|
|
1881
|
-
type: 'deadlock';
|
|
1882
|
-
blocked: string[];
|
|
1883
|
-
} | {
|
|
1884
|
-
type: 'graph:done';
|
|
1885
|
-
allDone: boolean;
|
|
1886
|
-
};
|
|
1887
|
-
type DAGEdgeHandler = (event: DAGEdgeEvent) => void;
|
|
1888
|
-
/** Callback invoked when the DAG produces a set of runnable tasks. */
|
|
1889
|
-
type RunnablesHandler = (nodes: DAGNode[]) => void;
|
|
1890
|
-
declare class TaskDAG {
|
|
1891
|
-
private readonly nodes;
|
|
1892
|
-
private readonly handlers;
|
|
1893
|
-
private readonly runnablesHandlers;
|
|
1894
|
-
private runnableCache;
|
|
1895
|
-
/**
|
|
1896
|
-
* Add a task node. Dependencies are validated for cycles.
|
|
1897
|
-
* Throws if adding a dep would create a cycle.
|
|
1898
|
-
*/
|
|
1899
|
-
addNode(id: string, description: string, deps?: string[], opts?: {
|
|
1900
|
-
role?: string;
|
|
1901
|
-
priority?: number;
|
|
1902
|
-
tags?: string[];
|
|
1903
|
-
}): void;
|
|
1904
|
-
/**
|
|
1905
|
-
* Remove a node and all edges to/from it.
|
|
1906
|
-
* Skips any dependents that would become dangling.
|
|
1907
|
-
*/
|
|
1908
|
-
removeNode(id: string): void;
|
|
1909
|
-
/**
|
|
1910
|
-
* Mark a task as running. Returns true if the transition was valid
|
|
1911
|
-
* (task was in 'ready' state), false otherwise.
|
|
1912
|
-
*/
|
|
1913
|
-
start(id: string, assignedTo: string): boolean;
|
|
1914
|
-
/**
|
|
1915
|
-
* Mark a task as completed. Unblocks all dependents; they become 'ready'
|
|
1916
|
-
* if all their deps are done.
|
|
1917
|
-
*/
|
|
1918
|
-
complete(id: string, result: unknown): void;
|
|
1919
|
-
/**
|
|
1920
|
-
* Mark a task as failed. Unblocks dependents but they remain 'pending'
|
|
1921
|
-
* (they may still be runnable if other deps succeeded).
|
|
1922
|
-
*/
|
|
1923
|
-
fail(id: string, error: string): void;
|
|
1924
|
-
/**
|
|
1925
|
-
* Skip a task (e.g., it was deemed unnecessary by an earlier step).
|
|
1926
|
-
* Treats it as done for dependency purposes.
|
|
1927
|
-
*/
|
|
1928
|
-
skip(id: string, reason: string): void;
|
|
1929
|
-
getNode(id: string): DAGNode | undefined;
|
|
1930
|
-
getAll(): DAGNode[];
|
|
1931
|
-
getReady(): DAGNode[];
|
|
1932
|
-
getRunning(): DAGNode[];
|
|
1933
|
-
getPending(): DAGNode[];
|
|
1934
|
-
getDone(): DAGNode[];
|
|
1935
|
-
getFailed(): DAGNode[];
|
|
1936
|
-
getCompleted(): DAGNode[];
|
|
1937
|
-
isDone(): boolean;
|
|
1938
|
-
isFailed(): boolean;
|
|
1939
|
-
/** All tasks that are currently blocked (pending but not ready). */
|
|
1940
|
-
getBlocked(): DAGNode[];
|
|
1941
|
-
/** Topological sort — tasks in dependency order. */
|
|
1942
|
-
getTopologicalOrder(): DAGNode[];
|
|
1943
|
-
/** Check for deadlock: no runnable tasks but not done. */
|
|
1944
|
-
hasDeadlock(): boolean;
|
|
1945
|
-
/** Stats snapshot for reporting. */
|
|
1946
|
-
stats(): {
|
|
1947
|
-
total: number;
|
|
1948
|
-
pending: number;
|
|
1949
|
-
ready: number;
|
|
1950
|
-
running: number;
|
|
1951
|
-
done: number;
|
|
1952
|
-
failed: number;
|
|
1953
|
-
skipped: number;
|
|
1954
|
-
progress: number;
|
|
1955
|
-
};
|
|
1956
|
-
onEvent(handler: DAGEdgeHandler): () => void;
|
|
1957
|
-
onRunnable(handler: RunnablesHandler): () => void;
|
|
1958
|
-
private _transition;
|
|
1959
|
-
private _emit;
|
|
1960
|
-
private _emitReady;
|
|
1961
|
-
private invalidateCache;
|
|
1962
|
-
/**
|
|
1963
|
-
* DFS cycle detection. Adding edge (id → dep) creates a cycle if
|
|
1964
|
-
* there already exists a path from dep to id.
|
|
1965
|
-
*/
|
|
1966
|
-
private _wouldCycle;
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
interface TaskBid {
|
|
1970
|
-
id: string;
|
|
1971
|
-
taskId: string;
|
|
1972
|
-
agentId: string;
|
|
1973
|
-
agentName: string;
|
|
1974
|
-
agentRole: string;
|
|
1975
|
-
/** Dispatcher score for this task */
|
|
1976
|
-
score: number;
|
|
1977
|
-
/** Why this agent is a good fit */
|
|
1978
|
-
rationale: string;
|
|
1979
|
-
submittedAt: string;
|
|
1980
|
-
}
|
|
1981
|
-
interface TaskAuctionOptions {
|
|
1982
|
-
graph: KnowledgeGraph;
|
|
1983
|
-
fleet?: FleetBus | undefined;
|
|
1984
|
-
mailbox?: Mailbox | undefined;
|
|
1985
|
-
selfAgentId?: string | undefined;
|
|
1986
|
-
/** How long a bid window stays open before auto-awarding. Default: 30s */
|
|
1987
|
-
bidWindowMs?: number | undefined;
|
|
1988
|
-
/** Maximum concurrent tasks per agent. Default: 3 */
|
|
1989
|
-
maxTasksPerAgent?: number | undefined;
|
|
1990
|
-
/** Minimum confidence threshold for dispatcher scoring. Default: 0.3 */
|
|
1991
|
-
minConfidence?: number | undefined;
|
|
1992
|
-
/**
|
|
1993
|
-
* Maximum times a task can be republished when no bids are received.
|
|
1994
|
-
* After this, the task is marked as 'failed' with reason 'no_bids'.
|
|
1995
|
-
* Default: 3.
|
|
1996
|
-
*/
|
|
1997
|
-
maxBidRetries?: number | undefined;
|
|
1998
|
-
}
|
|
1999
|
-
declare class TaskAuctioneer {
|
|
2000
|
-
private readonly graph;
|
|
2001
|
-
private readonly fleet?;
|
|
2002
|
-
private readonly mailbox?;
|
|
2003
|
-
private readonly selfAgentId;
|
|
2004
|
-
private readonly bidWindowMs;
|
|
2005
|
-
private readonly maxTasksPerAgent;
|
|
2006
|
-
private readonly minConfidence;
|
|
2007
|
-
private readonly maxBidRetries;
|
|
2008
|
-
/** Pending bids keyed by taskId. */
|
|
2009
|
-
private readonly pendingBids;
|
|
2010
|
-
/** Active bid windows keyed by taskId. */
|
|
2011
|
-
private readonly bidTimers;
|
|
2012
|
-
/** FleetBus subscription disposers, detached in dispose(). */
|
|
2013
|
-
private readonly unsubs;
|
|
2014
|
-
/** How many times a task has been republished with no bids received. */
|
|
2015
|
-
private readonly bidRetryCounts;
|
|
2016
|
-
/** Agent → current task count (from graph + in-flight). */
|
|
2017
|
-
private readonly agentTaskCounts;
|
|
2018
|
-
constructor(opts: TaskAuctionOptions);
|
|
2019
|
-
/**
|
|
2020
|
-
* Detach all FleetBus subscriptions and cancel any open bid-window timers.
|
|
2021
|
-
* Call when the owning coordinator stops/restarts so handlers and timers
|
|
2022
|
-
* don't accumulate across cycles.
|
|
2023
|
-
*/
|
|
2024
|
-
dispose(): void;
|
|
2025
|
-
/**
|
|
2026
|
-
* Publish a new task to the auction. Creates a GoalNode and broadcasts
|
|
2027
|
-
* it to all online agents. Returns the goal id.
|
|
2028
|
-
*
|
|
2029
|
-
* If `targetAgent` is specified, the task is assigned directly without auction.
|
|
2030
|
-
*/
|
|
2031
|
-
publishTask(input: {
|
|
2032
|
-
title: string;
|
|
2033
|
-
description: string;
|
|
2034
|
-
priority?: GoalPriority;
|
|
2035
|
-
tags?: string[];
|
|
2036
|
-
targetAgent?: string;
|
|
2037
|
-
parentGoal?: string;
|
|
2038
|
-
satisfiesGoals?: string[];
|
|
2039
|
-
/** Goal ids that must reach 'done' before this goal becomes workable. */
|
|
2040
|
-
blockedBy?: string[];
|
|
2041
|
-
deadline?: string;
|
|
2042
|
-
reward?: string;
|
|
2043
|
-
}): Promise<string>;
|
|
2044
|
-
/**
|
|
2045
|
-
* Submit a bid for a task. Called by agents who want to work on it.
|
|
2046
|
-
* Returns true if the bid was accepted, false if the task was already claimed.
|
|
2047
|
-
*/
|
|
2048
|
-
bid(taskId: string, agent: {
|
|
2049
|
-
agentId: string;
|
|
2050
|
-
agentName: string;
|
|
2051
|
-
agentRole: string;
|
|
2052
|
-
}, rationale: string): Promise<boolean>;
|
|
2053
|
-
/**
|
|
2054
|
-
* Award a task to a specific agent. Called internally by the bid window
|
|
2055
|
-
* expiry, or can be called directly to force an award.
|
|
2056
|
-
*/
|
|
2057
|
-
claim(taskId: string, agentId: string, agentName: string): Promise<boolean>;
|
|
2058
|
-
/**
|
|
2059
|
-
* Mark a task as done. Called by the agent when it finishes.
|
|
2060
|
-
*/
|
|
2061
|
-
complete(taskId: string, _result?: string): Promise<void>;
|
|
2062
|
-
/**
|
|
2063
|
-
* Mark a task as failed. Optionally spawn a retry.
|
|
2064
|
-
*/
|
|
2065
|
-
fail(taskId: string, error: string): Promise<void>;
|
|
2066
|
-
/**
|
|
2067
|
-
* Find the best available tasks for an agent based on its capabilities.
|
|
2068
|
-
* Returns tasks sorted by match score (best first).
|
|
2069
|
-
*/
|
|
2070
|
-
findWork(_agentId: string, agentRole: string, limit?: number): Promise<{
|
|
2071
|
-
task: GoalNode;
|
|
2072
|
-
score: number;
|
|
2073
|
-
bids: number;
|
|
2074
|
-
}[]>;
|
|
2075
|
-
/** Get all pending tasks (available for bidding). */
|
|
2076
|
-
getPendingTasks(): GoalNode[];
|
|
2077
|
-
/** Get tasks assigned to a specific agent. */
|
|
2078
|
-
getTasksForAgent(agentId: string): GoalNode[];
|
|
2079
|
-
/** Get the current bid count for a task. */
|
|
2080
|
-
getBidCount(taskId: string): number;
|
|
2081
|
-
/** Get bids for a task. */
|
|
2082
|
-
getBids(taskId: string): TaskBid[];
|
|
2083
|
-
/** Get task stats for a project-wide dashboard. */
|
|
2084
|
-
getStats(): {
|
|
2085
|
-
total: number;
|
|
2086
|
-
pending: number;
|
|
2087
|
-
in_progress: number;
|
|
2088
|
-
done: number;
|
|
2089
|
-
failed: number;
|
|
2090
|
-
totalBids: number;
|
|
2091
|
-
avgBidsPerTask: number;
|
|
2092
|
-
};
|
|
2093
|
-
private _emit;
|
|
2094
|
-
private _broadcastTask;
|
|
2095
|
-
private _mailboxPublish;
|
|
2096
|
-
private _notifyAgent;
|
|
2097
|
-
private _startBidWindow;
|
|
2098
|
-
private _cancelBidWindow;
|
|
2099
|
-
private _evaluateBids;
|
|
2100
|
-
private _assignDirect;
|
|
2101
|
-
private _onBidEvent;
|
|
2102
|
-
private _onClaimedEvent;
|
|
2103
|
-
private _getAgentTaskCount;
|
|
2104
|
-
private agentTaskCount;
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
/**
|
|
2108
|
-
* ConsensusProtocol — agent voting on proposed changes.
|
|
2109
|
-
*
|
|
2110
|
-
* Enables autonomous approval of code changes without a human. Agents register
|
|
2111
|
-
* as voters with a role weight; changes gather votes; the protocol resolves
|
|
2112
|
-
* the outcome based on configured quorum rules.
|
|
2113
|
-
*
|
|
2114
|
-
* Voting rules (configurable):
|
|
2115
|
-
* - Quorum: minimum fraction of eligible voters required (default: 0.5)
|
|
2116
|
-
* - Approval threshold: minimum fraction of cast votes that must be approve (default: 0.6)
|
|
2117
|
-
* - Veto roles: roles whose 'reject' vote is fatal regardless of count
|
|
2118
|
-
* - Auto-approve: changes with severity=critical bypass voting if the proposer is trusted
|
|
2119
|
-
*
|
|
2120
|
-
* The protocol is stateless — it reads from the KnowledgeGraph and writes results
|
|
2121
|
-
* back to it. This makes it naturally consistent with the shared knowledge model.
|
|
2122
|
-
*
|
|
2123
|
-
* @module consensus-protocol
|
|
2124
|
-
*/
|
|
2125
|
-
|
|
2126
|
-
interface VoterConfig {
|
|
2127
|
-
agentId: string;
|
|
2128
|
-
agentName: string;
|
|
2129
|
-
role: string;
|
|
2130
|
-
/** Weight multiplier for this voter's vote. Default: 1. */
|
|
2131
|
-
weight: number;
|
|
2132
|
-
/** If true, a 'reject' vote from this role is a hard veto. Default: false. */
|
|
2133
|
-
veto?: boolean;
|
|
2134
|
-
/**
|
|
2135
|
-
* @deprecated Not yet implemented. Auto-approve of low-risk changes is planned
|
|
2136
|
-
* but not wired up in the vote resolution logic.
|
|
2137
|
-
*/
|
|
2138
|
-
autoApprovesLowRisk?: boolean;
|
|
2139
|
-
}
|
|
2140
|
-
interface QuorumRule {
|
|
2141
|
-
/** Fraction of eligible voters required (0-1). Default: 0.5. */
|
|
2142
|
-
quorumFraction: number;
|
|
2143
|
-
/** Fraction of cast votes that must be approve (0-1). Default: 0.6. */
|
|
2144
|
-
approvalFraction: number;
|
|
2145
|
-
/** Roles whose reject vote is a hard veto regardless of count. */
|
|
2146
|
-
vetoRoles: string[];
|
|
2147
|
-
/** Minimum total weight of approve votes to pass (0-1 of total eligible weight). */
|
|
2148
|
-
approvalWeightFraction?: number | undefined;
|
|
2149
|
-
}
|
|
2150
|
-
interface ConsensusResult {
|
|
2151
|
-
changeId: string;
|
|
2152
|
-
outcome: 'approved' | 'rejected' | 'pending' | 'vetoed' | 'quorum_not_met';
|
|
2153
|
-
votes: VoteRecord[];
|
|
2154
|
-
approveCount: number;
|
|
2155
|
-
rejectCount: number;
|
|
2156
|
-
abstainCount: number;
|
|
2157
|
-
totalWeightApprove: number;
|
|
2158
|
-
totalWeightReject: number;
|
|
2159
|
-
eligibleVoters: string[];
|
|
2160
|
-
quorumMet: boolean;
|
|
2161
|
-
approvalMet: boolean;
|
|
2162
|
-
vetoedBy?: string;
|
|
2163
|
-
rationale: string;
|
|
2164
|
-
}
|
|
2165
|
-
interface ConsensusOptions {
|
|
2166
|
-
rules?: Partial<QuorumRule>;
|
|
2167
|
-
voters: VoterConfig[];
|
|
2168
|
-
graph: KnowledgeGraph;
|
|
2169
|
-
fleet?: FleetBus | undefined;
|
|
2170
|
-
}
|
|
2171
|
-
/**
|
|
2172
|
-
* ConsensusProtocol manages voting on ChangeNodes in the KnowledgeGraph.
|
|
2173
|
-
* It is instantiated once per autonomous session and used to initiate votes,
|
|
2174
|
-
* cast votes, and resolve outcomes.
|
|
2175
|
-
*/
|
|
2176
|
-
declare class ConsensusProtocol {
|
|
2177
|
-
private readonly graph;
|
|
2178
|
-
private readonly fleet?;
|
|
2179
|
-
private readonly rules;
|
|
2180
|
-
private readonly voters;
|
|
2181
|
-
constructor(opts: ConsensusOptions);
|
|
2182
|
-
/**
|
|
2183
|
-
* Initiate a vote on a proposed change. Updates the change node's status
|
|
2184
|
-
* to 'proposed' and notifies eligible voters via FleetBus.
|
|
2185
|
-
*/
|
|
2186
|
-
initiateVote(changeId: string): Promise<void>;
|
|
2187
|
-
/**
|
|
2188
|
-
* Cast a vote. Updates the change node in the graph and re-evaluates
|
|
2189
|
-
* consensus. If the vote triggers a resolution, updates the change status.
|
|
2190
|
-
*/
|
|
2191
|
-
castVote(changeId: string, voterId: string, value: VoteValue, rationale?: string): Promise<ConsensusResult>;
|
|
2192
|
-
/**
|
|
2193
|
-
* Resolve the current vote without waiting for all eligible voters.
|
|
2194
|
-
* Useful when a timeout fires or an agent decides to finalize early.
|
|
2195
|
-
*/
|
|
2196
|
-
resolveNow(changeId: string): Promise<ConsensusResult>;
|
|
2197
|
-
/**
|
|
2198
|
-
* Register or update a voter's configuration.
|
|
2199
|
-
*/
|
|
2200
|
-
registerVoter(config: VoterConfig): void;
|
|
2201
|
-
/**
|
|
2202
|
-
* Get the current vote status for a change.
|
|
2203
|
-
*/
|
|
2204
|
-
getStatus(changeId: string): ConsensusResult | null;
|
|
2205
|
-
private _eligibleVoters;
|
|
2206
|
-
private _resolve;
|
|
2207
|
-
private _toChangeStatus;
|
|
2208
|
-
private _notifyVoters;
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
|
-
/**
|
|
2212
|
-
* ChangeManager — autonomous code change lifecycle management.
|
|
2213
|
-
*
|
|
2214
|
-
* Manages the full lifecycle of proposed code changes:
|
|
2215
|
-
* PROPOSE → REVIEW (consensus) → APPLY → VERIFY → (ROLLBACK on failure)
|
|
2216
|
-
*
|
|
2217
|
-
* The manager does NOT write files directly — it publishes change nodes to the
|
|
2218
|
-
* KnowledgeGraph and uses the ConsensusProtocol for approvals. File mutations
|
|
2219
|
-
* are performed by agents acting on approved change nodes.
|
|
2220
|
-
*
|
|
2221
|
-
* Quality gates run automatically before approval:
|
|
2222
|
-
* - Tests must pass (or be explicitly waived)
|
|
2223
|
-
* - TypeScript must compile
|
|
2224
|
-
* - No new critical/high security findings
|
|
2225
|
-
* - Lint must pass (or be explicitly ignored)
|
|
2226
|
-
*
|
|
2227
|
-
* Rollback: on failure detection, the manager can propose a rollback change
|
|
2228
|
-
* that reverses the applied change. Rollback changes also go through consensus.
|
|
2229
|
-
*
|
|
2230
|
-
* @module change-manager
|
|
2231
|
-
*/
|
|
2232
|
-
|
|
2233
|
-
interface ChangeFile {
|
|
2234
|
-
path: string;
|
|
2235
|
-
action: 'create' | 'modify' | 'delete';
|
|
2236
|
-
/** For modify: unified diff string */
|
|
2237
|
-
diff?: string;
|
|
2238
|
-
/** For create/modify: full file content */
|
|
2239
|
-
content?: string;
|
|
2240
|
-
}
|
|
2241
|
-
interface ChangeProposal {
|
|
2242
|
-
title: string;
|
|
2243
|
-
description: string;
|
|
2244
|
-
files: ChangeFile[];
|
|
2245
|
-
proposedBy: string;
|
|
2246
|
-
satisfiesGoals: string[];
|
|
2247
|
-
tags: string[];
|
|
2248
|
-
/** Quality gate waivers (e.g., ['no-tests', 'lint-errors']) */
|
|
2249
|
-
waivers?: string[];
|
|
2250
|
-
/** Skip consensus vote (for automated/internal refactors only) */
|
|
2251
|
-
skipVote?: boolean;
|
|
2252
|
-
}
|
|
2253
|
-
interface ApplyResult {
|
|
2254
|
-
changeId: string;
|
|
2255
|
-
success: boolean;
|
|
2256
|
-
appliedAt: string;
|
|
2257
|
-
filesTouched: string[];
|
|
2258
|
-
verificationResult?: QualityGateResult;
|
|
2259
|
-
rollbackChangeId?: string | undefined;
|
|
2260
|
-
error?: string | undefined;
|
|
2261
|
-
}
|
|
2262
|
-
interface RollbackResult {
|
|
2263
|
-
originalChangeId: string;
|
|
2264
|
-
rollbackChangeId: string;
|
|
2265
|
-
success: boolean;
|
|
2266
|
-
rolledBackAt: string;
|
|
2267
|
-
error?: string;
|
|
2268
|
-
}
|
|
2269
|
-
/** Quality checks performed before applying a change. */
|
|
2270
|
-
interface QualityGateChecks {
|
|
2271
|
-
runTests: boolean;
|
|
2272
|
-
runTypecheck: boolean;
|
|
2273
|
-
runLint: boolean;
|
|
2274
|
-
runSecurityScan: boolean;
|
|
2275
|
-
checkTestCoverage: boolean;
|
|
2276
|
-
minCoveragePercent?: number;
|
|
2277
|
-
}
|
|
2278
|
-
interface ChangeManagerOptions {
|
|
2279
|
-
graph: KnowledgeGraph;
|
|
2280
|
-
consensus: ConsensusProtocol;
|
|
2281
|
-
fleet?: FleetBus | undefined;
|
|
2282
|
-
checks?: Partial<QualityGateChecks> | undefined;
|
|
2283
|
-
}
|
|
2284
|
-
/**
|
|
2285
|
-
* Default quality gate: tests + typecheck + security scan.
|
|
2286
|
-
* Lint and coverage are informational warnings, not blockers.
|
|
2287
|
-
*/
|
|
2288
|
-
declare const DEFAULT_QUALITY_CHECKS: QualityGateChecks;
|
|
2289
|
-
/**
|
|
2290
|
-
* ChangeManager orchestrates the full change lifecycle.
|
|
2291
|
-
*
|
|
2292
|
-
* ## Workflow
|
|
2293
|
-
* ```
|
|
2294
|
-
* propose() → knowledge graph (proposed)
|
|
2295
|
-
* → consensus.vote() (approved/rejected)
|
|
2296
|
-
* → apply() → knowledge graph (applied)
|
|
2297
|
-
* → verify() → on failure: proposeRollback()
|
|
2298
|
-
* ```
|
|
2299
|
-
*/
|
|
2300
|
-
declare class ChangeManager {
|
|
2301
|
-
private readonly graph;
|
|
2302
|
-
private readonly consensus;
|
|
2303
|
-
private readonly fleet?;
|
|
2304
|
-
private readonly checks;
|
|
2305
|
-
/** Track applied changes for rollback lookup. */
|
|
2306
|
-
private readonly appliedChanges;
|
|
2307
|
-
constructor(opts: ChangeManagerOptions);
|
|
2308
|
-
/**
|
|
2309
|
-
* Propose a new code change. Creates a ChangeNode in the knowledge graph.
|
|
2310
|
-
* Does NOT automatically initiate voting — call `submitForReview()` for that.
|
|
2311
|
-
*/
|
|
2312
|
-
propose(input: ChangeProposal): Promise<ChangeNode>;
|
|
2313
|
-
/**
|
|
2314
|
-
* Submit an approved change for application.
|
|
2315
|
-
* Returns the change node — actual file mutations are performed by agents
|
|
2316
|
-
* acting on this node's data from the knowledge graph.
|
|
2317
|
-
*/
|
|
2318
|
-
submitForReview(changeId: string): Promise<void>;
|
|
2319
|
-
/**
|
|
2320
|
-
* Apply an approved change. Updates the change node to 'applied'.
|
|
2321
|
-
* Agents should watch for 'applied' status and perform the actual file mutations.
|
|
2322
|
-
*/
|
|
2323
|
-
markApplied(changeId: string, appliedAt: string): Promise<ChangeNode | null>;
|
|
2324
|
-
/**
|
|
2325
|
-
* Mark a change as applied and trigger rollback for any satisfied goal
|
|
2326
|
-
* that turns out to be broken.
|
|
2327
|
-
*/
|
|
2328
|
-
markAppliedWithVerification(changeId: string, verify: () => Promise<QualityGateResult>): Promise<ApplyResult>;
|
|
2329
|
-
/**
|
|
2330
|
-
* Propose a rollback for an applied change. Creates a new change that
|
|
2331
|
-
* reverses the original. Goes through full consensus.
|
|
2332
|
-
*/
|
|
2333
|
-
proposeRollback(appliedChangeId: string, reason: string): Promise<ChangeNode | null>;
|
|
2334
|
-
/**
|
|
2335
|
-
* Mark a change as rolled back.
|
|
2336
|
-
*/
|
|
2337
|
-
markRolledBack(changeId: string, rolledBackAt: string): Promise<ChangeNode | null>;
|
|
2338
|
-
getPendingReviews(): ChangeNode[];
|
|
2339
|
-
getAppliedChanges(): ChangeNode[];
|
|
2340
|
-
getChange(id: string): ChangeNode | undefined;
|
|
2341
|
-
getChangesForGoal(goalId: string): ChangeNode[];
|
|
2342
|
-
/**
|
|
2343
|
-
* Run quality gate checks. This is informational — actual test/lint/typecheck
|
|
2344
|
-
* execution is done by agents spawned for this purpose. This method stores
|
|
2345
|
-
* the result in the change node.
|
|
2346
|
-
*/
|
|
2347
|
-
private _runQualityGate;
|
|
2348
|
-
/**
|
|
2349
|
-
* Update quality gate result for a change. Called by verify agents
|
|
2350
|
-
* after running their checks.
|
|
2351
|
-
*/
|
|
2352
|
-
updateQualityGate(changeId: string, checkName: string, result: {
|
|
2353
|
-
passed: boolean;
|
|
2354
|
-
detail?: string;
|
|
2355
|
-
}): Promise<void>;
|
|
2356
|
-
private _emit;
|
|
2357
|
-
}
|
|
2358
|
-
|
|
2359
|
-
/**
|
|
2360
|
-
* CoordinatorEvent — union of all event types emitted by the AutonomousCoordinator.
|
|
2361
|
-
* Consumed by the TUI to drive coordinator panel state and the reducer.
|
|
2362
|
-
*/
|
|
2363
|
-
type CoordinatorEvent = {
|
|
2364
|
-
type: 'goal:added';
|
|
2365
|
-
goalId: string;
|
|
2366
|
-
title?: string;
|
|
2367
|
-
text?: string;
|
|
2368
|
-
participants?: string[];
|
|
2369
|
-
} | {
|
|
2370
|
-
type: 'goal:completed';
|
|
2371
|
-
goalId: string;
|
|
2372
|
-
text?: string;
|
|
2373
|
-
participants?: string[];
|
|
2374
|
-
} | {
|
|
2375
|
-
type: 'goal:failed';
|
|
2376
|
-
goalId: string;
|
|
2377
|
-
text?: string;
|
|
2378
|
-
} | {
|
|
2379
|
-
type: 'task:ready';
|
|
2380
|
-
goalId: string;
|
|
2381
|
-
taskId: string;
|
|
2382
|
-
title?: string;
|
|
2383
|
-
assignedTo?: string;
|
|
2384
|
-
text?: string;
|
|
2385
|
-
} | {
|
|
2386
|
-
type: 'task:completed';
|
|
2387
|
-
goalId: string;
|
|
2388
|
-
taskId: string;
|
|
2389
|
-
text?: string;
|
|
2390
|
-
} | {
|
|
2391
|
-
type: 'knowledge:added';
|
|
2392
|
-
knowledgeId: string;
|
|
2393
|
-
title?: string;
|
|
2394
|
-
text?: string;
|
|
2395
|
-
} | {
|
|
2396
|
-
type: 'consensus:reached';
|
|
2397
|
-
goalId: string;
|
|
2398
|
-
text?: string;
|
|
2399
|
-
participants?: string[];
|
|
2400
|
-
} | {
|
|
2401
|
-
type: 'deadlock:detected';
|
|
2402
|
-
goalId: string;
|
|
2403
|
-
text?: string;
|
|
2404
|
-
} | {
|
|
2405
|
-
type: 'coordinator:mode';
|
|
2406
|
-
mode: 'standalone' | 'fleet';
|
|
2407
|
-
};
|
|
2408
|
-
|
|
2409
|
-
interface AutonomousCoordinatorOptions {
|
|
2410
|
-
sessionDir: string;
|
|
2411
|
-
selfAgentId: string;
|
|
2412
|
-
selfAgentName: string;
|
|
2413
|
-
fleet?: FleetBus | undefined;
|
|
2414
|
-
fleetManager?: FleetManager | undefined;
|
|
2415
|
-
director?: Director | undefined;
|
|
2416
|
-
mailbox?: Mailbox | undefined;
|
|
2417
|
-
events?: EventBus | undefined;
|
|
2418
|
-
llmProvider: LLMProvider;
|
|
2419
|
-
/** Disable self-improvement. Default: false. */
|
|
2420
|
-
disableSelfImprove?: boolean;
|
|
2421
|
-
/** Max concurrent subagents. Default: 5. */
|
|
2422
|
-
maxConcurrentAgents?: number;
|
|
2423
|
-
/**
|
|
2424
|
-
* Called with every CoordinatorEvent so the caller (e.g. execution.ts)
|
|
2425
|
-
* can forward it to the TUI coordinator panel timeline.
|
|
2426
|
-
*/
|
|
2427
|
-
onCoordinatorEvent?: (event: CoordinatorEvent) => void;
|
|
2428
|
-
}
|
|
2429
|
-
interface RunOptions {
|
|
2430
|
-
/** Top-level goal description. Default: "Improve the codebase". */
|
|
2431
|
-
goal?: string;
|
|
2432
|
-
/** If true, the loop runs until all goals are done (no timeout). Default: false. */
|
|
2433
|
-
runUntilComplete?: boolean;
|
|
2434
|
-
/** Max iterations. Default: 100. */
|
|
2435
|
-
maxIterations?: number;
|
|
2436
|
-
/** Stop if cost exceeds this. Default: no limit. */
|
|
2437
|
-
maxCostUsd?: number;
|
|
2438
|
-
}
|
|
2439
|
-
interface CoordinatorStats {
|
|
2440
|
-
goals: {
|
|
2441
|
-
total: number;
|
|
2442
|
-
done: number;
|
|
2443
|
-
pending: number;
|
|
2444
|
-
failed: number;
|
|
2445
|
-
progress: number;
|
|
2446
|
-
};
|
|
2447
|
-
dag: ReturnType<TaskDAG['stats']>;
|
|
2448
|
-
auction: ReturnType<TaskAuctioneer['getStats']>;
|
|
2449
|
-
changes: {
|
|
2450
|
-
proposed: number;
|
|
2451
|
-
approved: number;
|
|
2452
|
-
applied: number;
|
|
2453
|
-
rejected: number;
|
|
2454
|
-
};
|
|
2455
|
-
decisions: number;
|
|
2456
|
-
costSoFar?: number | undefined;
|
|
2457
|
-
}
|
|
2458
|
-
/**
|
|
2459
|
-
* AutonomousCoordinator — wires all coordination components into one engine.
|
|
2460
|
-
*
|
|
2461
|
-
* ## Quick start
|
|
2462
|
-
*
|
|
2463
|
-
* ```typescript
|
|
2464
|
-
* const coord = new AutonomousCoordinator({
|
|
2465
|
-
* sessionDir: '/tmp/session',
|
|
2466
|
-
* selfAgentId: 'director-1',
|
|
2467
|
-
* selfAgentName: 'Director',
|
|
2468
|
-
* llmProvider: myLLMProvider,
|
|
2469
|
-
* fleet: myFleetBus,
|
|
2470
|
-
* mailbox: myMailbox,
|
|
2471
|
-
* });
|
|
2472
|
-
*
|
|
2473
|
-
* // Run a self-directing session
|
|
2474
|
-
* await coord.run({ goal: 'Audit and fix all security issues in the auth module' });
|
|
2475
|
-
* ```
|
|
2476
|
-
*/
|
|
2477
|
-
declare class AutonomousCoordinator {
|
|
2478
|
-
readonly graph: KnowledgeGraph;
|
|
2479
|
-
readonly dag: TaskDAG;
|
|
2480
|
-
readonly auction: TaskAuctioneer;
|
|
2481
|
-
readonly consensus: ConsensusProtocol;
|
|
2482
|
-
readonly changes: ChangeManager;
|
|
2483
|
-
readonly brain: AutonomousBrain;
|
|
2484
|
-
private readonly selfAgentId;
|
|
2485
|
-
private readonly fleet?;
|
|
2486
|
-
private readonly fleetManager?;
|
|
2487
|
-
private readonly director?;
|
|
2488
|
-
private readonly mailbox?;
|
|
2489
|
-
private readonly events?;
|
|
2490
|
-
private readonly onCoordinatorEvent?;
|
|
2491
|
-
private running;
|
|
2492
|
-
private iterationCount;
|
|
2493
|
-
private lastSyncAt;
|
|
2494
|
-
private static readonly SYNC_INTERVAL_MS;
|
|
2495
|
-
/** Tasks already handled by _onSubagentTerminated (to avoid double goal:failed on fleet event). */
|
|
2496
|
-
private readonly _handledBySubagent;
|
|
2497
|
-
/** FleetBus subscription disposers, detached in dispose(). */
|
|
2498
|
-
private readonly unsubs;
|
|
2499
|
-
constructor(opts: AutonomousCoordinatorOptions);
|
|
2500
|
-
/**
|
|
2501
|
-
* Run the autonomous loop until the goal is satisfied or max iterations reached.
|
|
2502
|
-
* This is the main entry point for a fully autonomous session.
|
|
2503
|
-
*/
|
|
2504
|
-
run(opts?: RunOptions): Promise<CoordinatorStats>;
|
|
2505
|
-
/** Stop the autonomous loop. */
|
|
2506
|
-
stop(): void;
|
|
2507
|
-
/**
|
|
2508
|
-
* Report that a terminal worker (not a Director subagent) completed a claimed
|
|
2509
|
-
* task. This updates the auction, DAG, publishes a task-result fact, and
|
|
2510
|
-
* extracts follow-up goals — the same path as subagent completion.
|
|
2511
|
-
*/
|
|
2512
|
-
reportTaskCompletion(taskId: string, result: string): Promise<void>;
|
|
2513
|
-
/**
|
|
2514
|
-
* Report that a terminal worker failed a claimed task.
|
|
2515
|
-
*/
|
|
2516
|
-
reportTaskFailure(taskId: string, error: string): Promise<void>;
|
|
2517
|
-
/**
|
|
2518
|
-
* Reload the KnowledgeGraph from disk and sync the in-memory DAG with any
|
|
2519
|
-
* changes published by other terminal sessions. New goals are added to the
|
|
2520
|
-
* DAG; existing goals whose status changed (e.g. completed by another
|
|
2521
|
-
* terminal) are transitioned accordingly.
|
|
2522
|
-
*
|
|
2523
|
-
* Safe to call at any time — also used internally by the run loop.
|
|
2524
|
-
*/
|
|
2525
|
-
syncFromGraph(): Promise<void>;
|
|
2526
|
-
private _syncDagStatuses;
|
|
2527
|
-
private _maybeSyncFromGraph;
|
|
2528
|
-
/**
|
|
2529
|
-
* Tear down the coordinator for good: stop the loop and detach all FleetBus
|
|
2530
|
-
* subscriptions (this coordinator's + the auctioneer's) plus any open bid
|
|
2531
|
-
* timers. Call this when discarding the instance (e.g. `/coordinator stop`
|
|
2532
|
-
* that recreates a fresh coordinator on the next start) so handlers and
|
|
2533
|
-
* timers don't accumulate across cycles. `stop()` only pauses the loop.
|
|
2534
|
-
*/
|
|
2535
|
-
dispose(): void;
|
|
2536
|
-
/** Get a stats snapshot. */
|
|
2537
|
-
getStats(): CoordinatorStats;
|
|
2538
|
-
/**
|
|
2539
|
-
* Publish a fact discovered by an agent. Facts are immutable and form
|
|
2540
|
-
* the basis for other agents' decisions.
|
|
2541
|
-
*/
|
|
2542
|
-
publishFact(input: {
|
|
2543
|
-
category: FactCategory;
|
|
2544
|
-
subject: string;
|
|
2545
|
-
detail: string;
|
|
2546
|
-
file?: string;
|
|
2547
|
-
line?: number;
|
|
2548
|
-
severity?: 'critical' | 'high' | 'medium' | 'low';
|
|
2549
|
-
tags?: string[];
|
|
2550
|
-
}): Promise<FactNode>;
|
|
2551
|
-
/**
|
|
2552
|
-
* Publish a goal and add it to the DAG.
|
|
2553
|
-
*/
|
|
2554
|
-
createGoal(input: {
|
|
2555
|
-
title: string;
|
|
2556
|
-
description: string;
|
|
2557
|
-
priority?: 'critical' | 'high' | 'medium' | 'low';
|
|
2558
|
-
deps?: string[];
|
|
2559
|
-
tags?: string[];
|
|
2560
|
-
}): Promise<GoalNode>;
|
|
2561
|
-
private _waitForDagProgress;
|
|
2562
|
-
private _dagProgressKey;
|
|
2563
|
-
private _rebuildDagFromGraph;
|
|
2564
|
-
private _rebuildDagNode;
|
|
2565
|
-
private _decomposeGoal;
|
|
2566
|
-
private _inferCategory;
|
|
2567
|
-
private _processGoal;
|
|
2568
|
-
private _stringifyTaskResult;
|
|
2569
|
-
private _completeTask;
|
|
2570
|
-
private _publishTaskResultFact;
|
|
2571
|
-
private _createFollowUpGoalsFromResult;
|
|
2572
|
-
private _extractFollowUps;
|
|
2573
|
-
private _failTask;
|
|
2574
|
-
private _recordTaskFailed;
|
|
2575
|
-
private _handlePendingChange;
|
|
2576
|
-
private _onDagEvent;
|
|
2577
|
-
private _onSubagentTerminated;
|
|
2578
|
-
private _fleetStatus;
|
|
2579
|
-
private _buildVoters;
|
|
2580
|
-
private _goalToOptions;
|
|
2581
|
-
private _optionToGoal;
|
|
2582
|
-
private _mailboxBroadcast;
|
|
2583
|
-
/** Emit a CoordinatorEvent to the subscriber (e.g. TUI panel timeline). */
|
|
2584
|
-
private _emit;
|
|
2585
|
-
}
|
|
2586
|
-
|
|
2587
|
-
export { type AcquireOptions, type AcquireResult, AdaptiveConcurrencyController, type AdaptiveConcurrencyState, AgentDefinition, AgentHeartbeatInput, type AgentMonitorOptions, AgentMonitorService, AgentRegistrationInput, type AgentTimelineEntry, type AgentVirtualSession, type ApplyResult, type ApprovalDecision, AutonomousBrain, type AutonomousBrainOptions, AutonomousCoordinator, type AutonomousCoordinatorOptions, type AutonomousDecisionRequest, type AutonomousDecisionType, BUILD_AGENTS, BrainArbiter, BrainDecision, BrainDecisionOption, BrainDecisionRequest, BrainDecisionSource, type BrainInterventionInput, BrainMonitor, type BrainMonitorOptions, BrainRisk, type ChangeFile, ChangeManager, type ChangeManagerOptions, type ChangeNode, type ChangeProposal, type ChangeStatus, ClientHeartbeatInput, ClientRegistrationInput, ClientStatus, type ConsensusOptions, ConsensusProtocol, type ConsensusResult, type CoordinatorEvent, type CoordinatorStats, type DAGEdgeEvent, type DAGEdgeHandler, type DAGNode, type DAGNodeStatus, DEFAULT_MAX_FLEET_SPAWNS, DEFAULT_QUALITY_CHECKS, DELIVERY_AGENTS, DEPENDENCY_FILE_PATTERNS, DISCOVERY_AGENTS, DOMAIN_AGENTS, type DecisionNode, type DecisionPrompt, DefaultMailbox, type DepWatchEntry, type DepWatcherBridgeOptions, type DependencyWatcherConfig, Director, type DownAlertInput, type EscalationDecision, type FactCategory, type FactNode, FleetBus, FleetManager, type FleetStatusToolOptions, FleetSupervisor, type FleetSupervisorActions, FleetSupervisorConfig, type FleetSupervisorOptions, type FleetSupervisorSource, GlobalMailbox, type GoalNode, type GoalPriority, type GoalStatus, type GraphSubscription, HARD_MAX_SPAWN_DEPTH, KNOWLEDGE_AGENTS, KnowledgeGraph, type LLMProvider, type LiveLockResult, MAILBOX_BRIDGE_LOCK_FILENAME, MAILBOX_BRIDGE_TOKEN_FILENAME, MAILBOX_HEALTH_DEFAULT_FAILURE_THRESHOLD, MAILBOX_HEALTH_DEFAULT_FROM, MAILBOX_HEALTH_DEFAULT_INTERVAL_MS, MAILBOX_HEALTH_DEFAULT_TIMEOUT_MS, MATRIX_PHASE_KEYS, MAX_SUBAGENT_STRUCTURED_REPORT_CHARS, META_AGENTS, type MailToolsOptions, Mailbox, MailboxAckBatchInput, MailboxAckInput, type MailboxActionInput, type MailboxActionResult, MailboxAgentStatus, type MailboxBridgeLock, type MailboxHealthEvent, MailboxHealthWatchdog, type MailboxHealthWatchdogOptions, type MailboxHooksOptions, MailboxMessage, type MailboxMessageAction, MailboxQuery, type MailboxResolver, MailboxSendInput, type MailboxToolOptions, type MatrixKeyKind, type ModelMatrixResolution, type ModelMatrixResolutionSource, type ModelReference, type NodeFilter, type NodeType, type OutdatedNotifyMessage, PLANNING_AGENTS, type PackageAuthorEntry, type PackageAuthorLog, type PackageAuthorTrackerOptions, type PackageOutdatedEntry, type PackageOutdatedResult, type PackageOutdatedWatcherOptions, type PrioritizationDecision, PurgeOptions, PurgeResult, type QualityCheck, type QualityGateChecks, type QualityGateResult, type QuorumRule, REVIEW_AGENTS, type RecoveryAlertInput, type ResolvedModelTarget, type ResolvedSubagentModelTarget, type RollbackResult, type RunOptions, type RunnablesHandler, SUBAGENT_STRUCTURED_REPORT_META_KEY, type SpawnDecision, type SupervisedSubagent, type SupervisorLogEntry, type TaskAuctionOptions, TaskAuctioneer, type TaskBid, TaskDAG, VERIFY_AGENTS, type VoteNode, type VoteRecord, type VoteValue, type VoterConfig, type WatchdogConfig, acquireOrJoin, actionToAckInput, attachDepWatcherBridge, buildDownAlert, buildRecoveryAlert, createAgentMonitorService, createMailboxHooks, detectEcosystem, finalize, formatSubagentStructuredReport, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, isValidMatrixKey, mailboxSessionTag, makeDependencyWatcherConfig, makeFleetStatusTool, makeMailInboxTool, makeMailSendTool, makeMailboxTool, makeSubagentResultTool, matrixKeyKind, normalizeSubagentStructuredReport, phaseForRole, readLiveLock, readSubagentStructuredReport, recordPackageAction, release, resolveImplementationModelTarget, resolveMailboxIdentity, resolveMaxSpawnDepth, resolveModelMatrix, resolveModelMatrixResolution, resolveModelTargetFromEntry, resolveSubagentModelTarget, roleNeedsIndependentReviewModel, sameModelReference, startPackageOutdatedWatcher, updatePackageOutdatedStatus, validateWatchdogOptions };
|
|
1
|
+
export { createMessage, InMemoryAgentBridge, InMemoryBridgeTransport, } from './agent-bridge.js';
|
|
2
|
+
export { type AgentFactory, type AgentFactoryResult, type AgentRunnerOptions, makeAgentSubagentRunner, withDisabledToolFiltering, } from './agent-subagent-runner.js';
|
|
3
|
+
export { AGENT_CATALOG, AGENTS_BY_PHASE, type AgentBudgetTier, type AgentCapability, type AgentDefinition, type AgentPhase, ALL_AGENT_DEFINITIONS, BUILD_AGENTS, DELIVERY_AGENTS, DISCOVERY_AGENTS, DOMAIN_AGENTS, getAgentDefinition, HEAVY_BUDGET, KNOWLEDGE_AGENTS, LIGHT_BUDGET, MEDIUM_BUDGET, META_AGENTS, PLANNING_AGENTS, REVIEW_AGENTS, TOOLS as AGENT_TOOL_PRESETS, VERIFY_AGENTS, } from './agents/index.js';
|
|
4
|
+
export { type AutoExtendCeiling, type AutoExtendPolicy, attachAutoExtend, } from './auto-extend.js';
|
|
5
|
+
export { type BrainArbiter, type BrainDecision, type BrainDecisionOption, BrainDecisionQueue, type BrainDecisionRequest, type BrainDecisionSource, type BrainFallback, type BrainRisk, DefaultBrainArbiter, type DefaultBrainArbiterOptions, formatHumanPrompt, HumanEscalatingBrainArbiter, ObservableBrainArbiter, } from './brain.js';
|
|
6
|
+
export { type BrainInterventionInput, BrainMonitor, type BrainMonitorOptions, } from './brain-monitor.js';
|
|
7
|
+
export { type BugFinding, type CollabBudgetConfig, type CollabBudgetOverrides, type CollabBudgetWarningPayload, type CollabDebugReport, CollabSession, type CollabSessionOptions, type CriticConcern, type CriticEvaluation, type DirectorAlert, DirectorAlertLevel, type DirectorCancelCollabPayload, type RefactorPhase, type RefactorPlan, type SharedFileEntry, type SharedFileSnapshot, } from './collab-debug.js';
|
|
8
|
+
export { type CreateDelegateToolOptions, createDelegateTool, type DelegateHost, } from './delegate-tool.js';
|
|
9
|
+
export { DEPENDENCY_FILE_PATTERNS, type DependencyWatcherConfig, type DepWatchEntry, makeDependencyWatcherConfig, } from './dep-watcher.js';
|
|
10
|
+
export { attachDepWatcherBridge, type DepWatcherBridgeOptions, } from './dep-watcher-bridge.js';
|
|
11
|
+
export { Director, FleetCostCapError, FleetSpawnBudgetError, FleetTokenCapError, type TaskResultNotification, } from './director.js';
|
|
12
|
+
export { composeDirectorPrompt, composeSubagentPrompt, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_SUBAGENT_BASELINE, type DirectorPromptParts, rosterSummaryFromConfigs, type SubagentPromptParts, } from './director-prompts.js';
|
|
13
|
+
export { type DirectorSessionFactory, type DirectorSessionFactoryOptions, makeDirectorSessionFactory, } from './director-session.js';
|
|
14
|
+
export { makeAskResultTool, makeAskTool, makeAssignTool, makeAwaitTasksTool, makeCollabDebugTool, makeFleetEmitTool, makeFleetTool, makeFleetTool as makeFleetUsageTool, makeFleetTool as makeFleetSessionTool, makeFleetTool as makeFleetHealthTool, makeKanbanQueueTool, makeQualityGateTool, makeRollUpTool, makeSpawnTool, makeTerminateAllTool, makeTerminateTool, makeWorkCompleteTool, } from './director-tools.js';
|
|
15
|
+
export { DEFAULT_DISPATCH_ROLE, type DispatchCandidate, type DispatchClassifier, type DispatchMethod, type DispatchOptions, type DispatchResult, dispatchAgent, makeLLMClassifier, scoreAgents, } from './dispatcher.js';
|
|
16
|
+
export { ACP_AGENTS, ALL_FLEET_AGENTS, AUDIT_LOG_AGENT, applyRosterBudget, BUG_HUNTER_AGENT, FLEET_ROSTER, FLEET_ROSTER_BUDGETS, FLEET_ROSTER_WITHACP, type FleetRosterBudget, REFACTOR_PLANNER_AGENT, SECURITY_SCANNER_AGENT, } from './fleet.js';
|
|
17
|
+
export { FleetBus, type FleetEvent, type FleetHandler, type FleetUsage, FleetUsageAggregator, type SubagentUsageSnapshot, } from './fleet-bus.js';
|
|
18
|
+
export { FleetManager, type FleetManagerOptions, } from './fleet-manager.js';
|
|
19
|
+
export { type FleetStatusToolOptions, makeFleetStatusTool } from './fleet-status-tool.js';
|
|
20
|
+
export { FleetSupervisor, type FleetSupervisorActions, type FleetSupervisorConfig, type FleetSupervisorOptions, type FleetSupervisorSource, type SupervisedSubagent, type SupervisorLogEntry, } from './fleet-supervisor.js';
|
|
21
|
+
export { DEFAULT_MAX_FLEET_SPAWNS, HARD_MAX_SPAWN_DEPTH, resolveMaxSpawnDepth, } from './spawn-budget.js';
|
|
22
|
+
export { GlobalMailbox, resolveProjectDir } from './global-mailbox.js';
|
|
23
|
+
export type { ICoordinator } from './icoordinator.js';
|
|
24
|
+
export type { IFleetManager } from './ifleet-manager.js';
|
|
25
|
+
export { LargeAnswerStore } from './large-answer-store.js';
|
|
26
|
+
export { formatSubagentStructuredReport, MAX_SUBAGENT_STRUCTURED_REPORT_CHARS, makeSubagentResultTool, normalizeSubagentStructuredReport, readSubagentStructuredReport, SUBAGENT_STRUCTURED_REPORT_META_KEY, } from './subagent-result-tool.js';
|
|
27
|
+
export { type MailToolsOptions, makeMailInboxTool, makeMailSendTool } from './mail-tools.js';
|
|
28
|
+
export { DefaultMailbox } from './mailbox.js';
|
|
29
|
+
export type { MailboxActionInput, MailboxActionResult, MailboxMessageAction, } from './mailbox-actions.js';
|
|
30
|
+
export { actionToAckInput } from './mailbox-actions.js';
|
|
31
|
+
export { buildDownAlert, buildRecoveryAlert, type DownAlertInput, MAILBOX_HEALTH_DEFAULT_FAILURE_THRESHOLD, MAILBOX_HEALTH_DEFAULT_FROM, MAILBOX_HEALTH_DEFAULT_INTERVAL_MS, MAILBOX_HEALTH_DEFAULT_TIMEOUT_MS, type MailboxHealthEvent, MailboxHealthWatchdog, type MailboxHealthWatchdogOptions, type RecoveryAlertInput, validateWatchdogOptions, type WatchdogConfig, } from './mailbox-health.js';
|
|
32
|
+
export { createMailboxHooks, type MailboxHooksOptions, } from './mailbox-hooks.js';
|
|
33
|
+
export { type MailboxResolver, type MailboxToolOptions, mailboxSessionTag, makeMailboxTool, resolveMailboxIdentity, } from './mailbox-tool.js';
|
|
34
|
+
export type { AgentHeartbeatInput, AgentRegistrationInput, ClientHeartbeatInput, ClientRegistrationInput, ClientSource, ClientStatus, Mailbox, MailboxAckBatchInput, MailboxAckInput, MailboxAgentStatus, MailboxMessage, MailboxMessageType, MailboxQuery, MailboxSendInput, MailboxTaskContext, PurgeOptions, PurgeResult, ReadReceipts, RegisteredAgent, } from './mailbox-types.js';
|
|
35
|
+
export { normalizeRecipient } from './mailbox-types.js';
|
|
36
|
+
export { isValidMatrixKey, MATRIX_PHASE_KEYS, type MatrixKeyKind, type ModelMatrixResolution, type ModelMatrixResolutionSource, type ModelReference, matrixKeyKind, phaseForRole, type ResolvedModelTarget, type ResolvedSubagentModelTarget, resolveImplementationModelTarget, resolveModelMatrix, resolveModelMatrixResolution, resolveModelTargetFromEntry, resolveSubagentModelTarget, roleNeedsIndependentReviewModel, sameModelReference, } from './model-matrix.js';
|
|
37
|
+
export { DefaultMultiAgentCoordinator, type MultiAgentCoordinatorOptions, } from './multi-agent-coordinator.js';
|
|
38
|
+
export { NULL_FLEET_BUS } from './null-fleet-bus.js';
|
|
39
|
+
export { detectEcosystem, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, type PackageAuthorEntry, type PackageAuthorLog, type PackageAuthorTrackerOptions, recordPackageAction, updatePackageOutdatedStatus, } from './package-author-tracker.js';
|
|
40
|
+
export { type OutdatedNotifyMessage, type PackageOutdatedEntry, type PackageOutdatedResult, type PackageOutdatedWatcherOptions, startPackageOutdatedWatcher, } from './package-outdated-watcher.js';
|
|
41
|
+
export { type AcquireOptions, type AcquireResult, acquireOrJoin, finalize, type LiveLockResult, MAILBOX_BRIDGE_LOCK_FILENAME, MAILBOX_BRIDGE_TOKEN_FILENAME, type MailboxBridgeLock, readLiveLock, release, } from './single-instance-mailbox.js';
|
|
42
|
+
export type { BudgetKind, BudgetLimits, BudgetNegotiationMode, BudgetThresholdDecision, BudgetThresholdHandler, BudgetUsage, } from './subagent-budget.js';
|
|
43
|
+
export { BudgetExceededError, BudgetThresholdSignal,
|
|
44
|
+
/** 60 000 ms — hard safety net for budget negotiation decisions. Both the
|
|
45
|
+
* coordinator watchdog and SubagentBudget._negotiateExtension use this value
|
|
46
|
+
* so they agree on the decision window. Re-exported here so consumers of
|
|
47
|
+
* the coordination module can reference it without a sub-module import. */
|
|
48
|
+
DECISION_TIMEOUT_MS, SubagentBudget,
|
|
49
|
+
/** 0.85 — fraction of wall-clock `timeoutMs` at which the coordinator watchdog
|
|
50
|
+
* fires a PROACTIVE pre-empt (before deadline). Canonical source:
|
|
51
|
+
* `coordination/subagent-budget.ts`. Re-exported here so all budget symbols
|
|
52
|
+
* are accessible from one import path. */
|
|
53
|
+
TIMEOUT_PREEMPT_FRACTION, } from './subagent-budget.js';
|
|
54
|
+
export { type FleetWorktreePolicy, resolveSubagentWorktreeDecision, subagentNeedsWorktree, WorktreeIntegrationError, type WorktreeIsolationDecision, type WorktreeTaskRunnerOptions, type WorktreeTaskStateUpdate, wrapSubagentRunnerWithWorktrees, } from './worktree-task-runner.js';
|
|
55
|
+
export { AdaptiveConcurrencyController, type AdaptiveConcurrencyState, } from './adaptive-concurrency.js';
|
|
56
|
+
/** Agent Monitor — virtual chat history, timeline streaming, HQ bridge */
|
|
57
|
+
export { type AgentMonitorOptions, AgentMonitorService, type AgentTimelineEntry, type AgentVirtualSession, createAgentMonitorService, } from './agent-monitor.js';
|
|
58
|
+
export type { ApprovalDecision, AutonomousBrainOptions, AutonomousDecisionRequest, AutonomousDecisionType, DecisionPrompt, EscalationDecision, LLMProvider, PrioritizationDecision, SpawnDecision, } from './autonomous-brain.js';
|
|
59
|
+
/** Autonomous brain — LLM-backed decision-making engine */
|
|
60
|
+
export { AutonomousBrain } from './autonomous-brain.js';
|
|
61
|
+
export type { AutonomousCoordinatorOptions, CoordinatorEvent, CoordinatorStats, RunOptions, } from './autonomous-coordinator.js';
|
|
62
|
+
/** Autonomous coordinator — wires all coordination components */
|
|
63
|
+
export { AutonomousCoordinator } from './autonomous-coordinator.js';
|
|
64
|
+
/** Change manager — autonomous code change lifecycle */
|
|
65
|
+
export { type ApplyResult, type ChangeFile, ChangeManager, type ChangeManagerOptions, type ChangeProposal, DEFAULT_QUALITY_CHECKS, type QualityGateChecks, type RollbackResult, } from './change-manager.js';
|
|
66
|
+
export type { ConsensusOptions, ConsensusResult, QuorumRule, VoterConfig, } from './consensus-protocol.js';
|
|
67
|
+
/** Consensus protocol — agent voting on proposed changes */
|
|
68
|
+
export { ConsensusProtocol } from './consensus-protocol.js';
|
|
69
|
+
export type { ChangeNode, ChangeStatus, DecisionNode, FactCategory, FactNode, GoalNode, GoalPriority, GoalStatus, GraphSubscription, NodeFilter, NodeType, QualityCheck, QualityGateResult, VoteNode, VoteRecord, VoteValue, } from './knowledge-graph.js';
|
|
70
|
+
/** Shared knowledge graph — facts, goals, decisions, changes */
|
|
71
|
+
export { KnowledgeGraph } from './knowledge-graph.js';
|
|
72
|
+
export type { TaskAuctionOptions, TaskBid, } from './task-auctioneer.js';
|
|
73
|
+
/** Task auctioneer — project-wide task marketplace */
|
|
74
|
+
export { TaskAuctioneer } from './task-auctioneer.js';
|
|
75
|
+
export type { DAGEdgeEvent, DAGEdgeHandler, DAGNode, DAGNodeStatus, RunnablesHandler, } from './task-dag.js';
|
|
76
|
+
/** Task DAG — dependency graph with fork/join semantics */
|
|
77
|
+
export { TaskDAG } from './task-dag.js';
|
|
78
|
+
//# sourceMappingURL=index.d.ts.map
|