@wrongstack/core 0.264.0 → 0.265.1

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.
Files changed (87) hide show
  1. package/dist/{agent-bridge-D8sa1vtv.d.ts → agent-bridge-DrkBxszZ.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-c9DLkaas.d.ts → agent-subagent-runner-DM2pP-B6.d.ts} +113 -11
  3. package/dist/{brain-O1IdKPaK.d.ts → brain-BXd_61kQ.d.ts} +31 -2
  4. package/dist/{compactor-BBy0rCtB.d.ts → compactor-B8pOf45Y.d.ts} +1 -1
  5. package/dist/{config-Dz2F3H2K.d.ts → config-BMCj_XDs.d.ts} +80 -12
  6. package/dist/{context-BGSpZNSE.d.ts → context-MRk5PhNv.d.ts} +26 -12
  7. package/dist/coordination/index.d.ts +77 -21
  8. package/dist/coordination/index.js +557 -159
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/{default-config-CXsDvOmP.d.ts → default-config-B0cj-Hry.d.ts} +11 -1
  11. package/dist/defaults/index.d.ts +28 -28
  12. package/dist/defaults/index.js +609 -195
  13. package/dist/defaults/index.js.map +1 -1
  14. package/dist/execution/index.d.ts +16 -16
  15. package/dist/execution/index.js +394 -155
  16. package/dist/execution/index.js.map +1 -1
  17. package/dist/execution/prompt-enhancer.d.ts +2 -2
  18. package/dist/execution/prompt-enhancer.js +1 -1
  19. package/dist/execution/prompt-enhancer.js.map +1 -1
  20. package/dist/extension/index.d.ts +6 -6
  21. package/dist/{goal-preamble-DzjFuN3p.d.ts → goal-preamble-DvHDSKSe.d.ts} +14 -10
  22. package/dist/{goal-store-CxWmCGbH.d.ts → goal-store-DtLMySNb.d.ts} +1 -1
  23. package/dist/{index-CYIQrXVF.d.ts → index-B-ch8K9C.d.ts} +8 -8
  24. package/dist/{index-CbLSI66_.d.ts → index-CEDeNodM.d.ts} +5 -5
  25. package/dist/index.d.ts +183 -52
  26. package/dist/index.js +1779 -673
  27. package/dist/index.js.map +1 -1
  28. package/dist/infrastructure/index.d.ts +6 -6
  29. package/dist/infrastructure/index.js +12 -8
  30. package/dist/infrastructure/index.js.map +1 -1
  31. package/dist/kernel/index.d.ts +9 -9
  32. package/dist/kernel/index.js +1 -1
  33. package/dist/kernel/index.js.map +1 -1
  34. package/dist/{llm-selector-DzxuZnNz.d.ts → llm-selector-C0tfTCUe.d.ts} +14 -2
  35. package/dist/{mcp-servers-DC4QRPUI.d.ts → mcp-servers-2x4w6Jn9.d.ts} +3 -3
  36. package/dist/models/index.d.ts +5 -5
  37. package/dist/models/index.js +74 -30
  38. package/dist/models/index.js.map +1 -1
  39. package/dist/{models-registry-B_siPxqN.d.ts → models-registry-DmJlKuNp.d.ts} +1 -1
  40. package/dist/{multi-agent-coordinator-CK5Jdj9K.d.ts → multi-agent-coordinator-DyCkCZnU.d.ts} +1 -1
  41. package/dist/{null-fleet-bus-DgvD4SCO.d.ts → null-fleet-bus-CG9QY2aP.d.ts} +6 -6
  42. package/dist/observability/index.d.ts +2 -2
  43. package/dist/{parallel-eternal-engine-bK0JQBR_.d.ts → parallel-eternal-engine-Jw9uhEoT.d.ts} +9 -9
  44. package/dist/{path-resolver-BPEDlN38.d.ts → path-resolver-Dy2ej-gE.d.ts} +3 -3
  45. package/dist/{permission-4yvGmMRB.d.ts → permission-B9SB45lp.d.ts} +1 -1
  46. package/dist/{permission-policy-C6XpsBOy.d.ts → permission-policy-CkjSXabK.d.ts} +2 -2
  47. package/dist/{pipeline-CXCeMz8J.d.ts → pipeline-DPDxH_7m.d.ts} +3 -3
  48. package/dist/{plan-templates-BvzRBkJc.d.ts → plan-templates-CzD9GnAU.d.ts} +32 -8
  49. package/dist/{provider-runner-C5aQpDWE.d.ts → provider-runner-DMa70ODu.d.ts} +3 -3
  50. package/dist/{retry-policy-CFhdtRzz.d.ts → retry-policy-CN0khdlj.d.ts} +1 -1
  51. package/dist/sdd/index.d.ts +8 -8
  52. package/dist/sdd/index.js +274 -93
  53. package/dist/sdd/index.js.map +1 -1
  54. package/dist/{secret-vault-CxiVLbt1.d.ts → secret-vault-B2yw84VT.d.ts} +43 -4
  55. package/dist/secret-vault-BAKpgFw_.d.ts +57 -0
  56. package/dist/security/index.d.ts +5 -5
  57. package/dist/security/index.js +204 -23
  58. package/dist/security/index.js.map +1 -1
  59. package/dist/{selector-gIuhRTkN.d.ts → selector-CzHh_igB.d.ts} +1 -1
  60. package/dist/{session-event-bridge-DkvvrpDt.d.ts → session-event-bridge-BUI6Jf-4.d.ts} +1 -1
  61. package/dist/{session-reader-KdfVwkKP.d.ts → session-reader-CMgdMSRP.d.ts} +1 -1
  62. package/dist/storage/index.d.ts +112 -15
  63. package/dist/storage/index.js +419 -81
  64. package/dist/storage/index.js.map +1 -1
  65. package/dist/tools/index.d.ts +2 -2
  66. package/dist/types/index.d.ts +21 -21
  67. package/dist/types/index.js +261 -53
  68. package/dist/types/index.js.map +1 -1
  69. package/dist/utils/index.d.ts +3 -3
  70. package/dist/utils/index.js +3 -5
  71. package/dist/utils/index.js.map +1 -1
  72. package/dist/{wstack-paths-CJjEwPXn.d.ts → wstack-paths-hOpNLmvf.d.ts} +2 -0
  73. package/package.json +1 -1
  74. package/skills/api-design/SKILL.md +1 -1
  75. package/skills/audit-log/SKILL.md +6 -6
  76. package/skills/bug-hunter/SKILL.md +5 -5
  77. package/skills/chimera/SKILL.md +4 -4
  78. package/skills/docker-deploy/SKILL.md +1 -1
  79. package/skills/git-flow/SKILL.md +3 -3
  80. package/skills/multi-agent/SKILL.md +3 -3
  81. package/skills/node-modern/SKILL.md +1 -0
  82. package/skills/observability/SKILL.md +2 -2
  83. package/skills/output-standards/SKILL.md +51 -28
  84. package/skills/refactor-planner/SKILL.md +3 -3
  85. package/skills/security-scanner/SKILL.md +4 -3
  86. package/skills/tech-stack/SKILL.md +1 -2
  87. package/dist/secret-vault-BJDY28ev.d.ts +0 -25
@@ -1,23 +1,23 @@
1
- import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../brain-O1IdKPaK.js';
2
- export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../brain-O1IdKPaK.js';
3
- import { H as FleetManager } from '../null-fleet-bus-DgvD4SCO.js';
4
- export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-DgvD4SCO.js';
5
- import { b as AgentDefinition } from '../multi-agent-coordinator-CK5Jdj9K.js';
6
- export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-CK5Jdj9K.js';
7
- import { F as FleetBus } from '../agent-subagent-runner-c9DLkaas.js';
8
- export { h as AgentFactory, u as AgentFactoryResult, v as AgentRunnerOptions, w as BudgetExceededError, x as BudgetKind, y as BudgetLimits, z as BudgetNegotiationMode, E as BudgetThresholdDecision, G as BudgetThresholdHandler, H as BudgetThresholdSignal, I as BudgetUsage, K as FleetEvent, L as FleetHandler, i as FleetUsage, j as FleetUsageAggregator, O as SubagentBudget, X as SubagentUsageSnapshot, Z as makeAgentSubagentRunner, _ as withDisabledToolFiltering } from '../agent-subagent-runner-c9DLkaas.js';
9
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-D8sa1vtv.js';
10
- import { c as Mailbox, k as MailboxSendInput, d as MailboxMessage, j as MailboxQuery, g as MailboxAckInput, s as MailboxAckBatchInput, h as MailboxAgentStatus, e as AgentRegistrationInput, A as AgentHeartbeatInput, t as PurgeOptions, u as PurgeResult, v as ClientRegistrationInput, w as ClientHeartbeatInput, x as ClientStatus } from '../pipeline-CXCeMz8J.js';
11
- export { i as MailboxMessageType, l as MailboxTaskContext, o as ReadReceipts, p as RegisteredAgent, r as normalizeRecipient } from '../pipeline-CXCeMz8J.js';
12
- import { C as Context, T as Tool } from '../context-BGSpZNSE.js';
1
+ import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../brain-BXd_61kQ.js';
2
+ export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../brain-BXd_61kQ.js';
3
+ import { H as FleetManager, s as Director } from '../null-fleet-bus-CG9QY2aP.js';
4
+ export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-CG9QY2aP.js';
5
+ import { b as AgentDefinition } from '../multi-agent-coordinator-DyCkCZnU.js';
6
+ export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-DyCkCZnU.js';
7
+ import { F as FleetBus } from '../agent-subagent-runner-DM2pP-B6.js';
8
+ export { h as AgentFactory, v as AgentFactoryResult, w as AgentRunnerOptions, x as BudgetExceededError, y as BudgetKind, z as BudgetLimits, E as BudgetNegotiationMode, G as BudgetThresholdDecision, H as BudgetThresholdHandler, I as BudgetThresholdSignal, J as BudgetUsage, L as DECISION_TIMEOUT_MS, N as FleetEvent, O as FleetHandler, i as FleetUsage, j as FleetUsageAggregator, Q as SubagentBudget, Y as SubagentUsageSnapshot, Z as TIMEOUT_PREEMPT_FRACTION, $ as makeAgentSubagentRunner, a0 as withDisabledToolFiltering } from '../agent-subagent-runner-DM2pP-B6.js';
9
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-DrkBxszZ.js';
10
+ import { c as Mailbox, k as MailboxSendInput, d as MailboxMessage, j as MailboxQuery, g as MailboxAckInput, s as MailboxAckBatchInput, h as MailboxAgentStatus, e as AgentRegistrationInput, A as AgentHeartbeatInput, t as PurgeOptions, u as PurgeResult, v as ClientRegistrationInput, w as ClientHeartbeatInput, x as ClientStatus } from '../pipeline-DPDxH_7m.js';
11
+ export { i as MailboxMessageType, l as MailboxTaskContext, o as ReadReceipts, p as RegisteredAgent, r as normalizeRecipient } from '../pipeline-DPDxH_7m.js';
12
+ import { C as Context, T as Tool } from '../context-MRk5PhNv.js';
13
13
  import 'node:events';
14
14
  import '../director-state-BfeCUbmk.js';
15
- import '../config-Dz2F3H2K.js';
16
- import '../index-CbLSI66_.js';
15
+ import '../config-BMCj_XDs.js';
16
+ import '../index-CEDeNodM.js';
17
17
  import '../logger-B63L5bTg.js';
18
18
  import '../observability-D-HZN_mF.js';
19
- import '../permission-4yvGmMRB.js';
20
- import '../retry-policy-CFhdtRzz.js';
19
+ import '../permission-B9SB45lp.js';
20
+ import '../retry-policy-CN0khdlj.js';
21
21
 
22
22
  /** Phase 1 · Discovery — map the territory before any work begins. */
23
23
  declare const DISCOVERY_AGENTS: AgentDefinition[];
@@ -435,6 +435,10 @@ interface DependencyWatcherConfig {
435
435
  onChange: (entry: DepWatchEntry) => Promise<void>;
436
436
  /** Debounce window in ms — multiple changes to the same file within this window are collapsed. */
437
437
  debounceMs: number;
438
+ /** Cancel all in-flight debounce timers. Call when the file watcher is
439
+ * stopped (session end / project switch) so pending setTimeouts — each
440
+ * holding a closure over the mailbox + entry — don't leak. */
441
+ dispose: () => void;
438
442
  }
439
443
  interface DependencyWatcherOptions {
440
444
  /** Absolute path to the project root. */
@@ -866,6 +870,8 @@ declare class KnowledgeGraph {
866
870
  private readonly pendingDeliveries;
867
871
  private readonly filePath;
868
872
  private readonly graphFilePath;
873
+ /** Exposed for unit-testing only: read current index contents. */
874
+ getIndex(): ReadonlyMap<string, ReadonlySet<string>>;
869
875
  constructor(sessionDir: string);
870
876
  /**
871
877
  * Add a node. Fires to all matching subscriptions synchronously.
@@ -915,7 +921,12 @@ declare class KnowledgeGraph {
915
921
  passed: boolean;
916
922
  detail?: string;
917
923
  }[]): QualityGateResult;
918
- private _index;
924
+ /** Pure: compute the set of index keys a node would belong to. */
925
+ private _indexKeys;
926
+ /** Mutate the index: add a node's id to every set for the given keys. */
927
+ private _addToIndex;
928
+ /** Remove a node's id from all index sets for the given keys. */
929
+ private _removeFromIndex;
919
930
  private _matches;
920
931
  private _deliver;
921
932
  private _persist;
@@ -1103,7 +1114,10 @@ interface VoterConfig {
1103
1114
  weight: number;
1104
1115
  /** If true, a 'reject' vote from this role is a hard veto. Default: false. */
1105
1116
  veto?: boolean;
1106
- /** If true, this voter auto-approves low-risk changes. Default: true. */
1117
+ /**
1118
+ * @deprecated Not yet implemented. Auto-approve of low-risk changes is planned
1119
+ * but not wired up in the vote resolution logic.
1120
+ */
1107
1121
  autoApprovesLowRisk?: boolean;
1108
1122
  }
1109
1123
  interface QuorumRule {
@@ -1497,6 +1511,12 @@ interface TaskAuctionOptions {
1497
1511
  maxTasksPerAgent?: number | undefined;
1498
1512
  /** Minimum confidence threshold for dispatcher scoring. Default: 0.3 */
1499
1513
  minConfidence?: number | undefined;
1514
+ /**
1515
+ * Maximum times a task can be republished when no bids are received.
1516
+ * After this, the task is marked as 'failed' with reason 'no_bids'.
1517
+ * Default: 3.
1518
+ */
1519
+ maxBidRetries?: number | undefined;
1500
1520
  }
1501
1521
  declare class TaskAuctioneer {
1502
1522
  private readonly graph;
@@ -1506,13 +1526,24 @@ declare class TaskAuctioneer {
1506
1526
  private readonly bidWindowMs;
1507
1527
  private readonly maxTasksPerAgent;
1508
1528
  private readonly minConfidence;
1529
+ private readonly maxBidRetries;
1509
1530
  /** Pending bids keyed by taskId. */
1510
1531
  private readonly pendingBids;
1511
1532
  /** Active bid windows keyed by taskId. */
1512
1533
  private readonly bidTimers;
1534
+ /** FleetBus subscription disposers, detached in dispose(). */
1535
+ private readonly unsubs;
1536
+ /** How many times a task has been republished with no bids received. */
1537
+ private readonly bidRetryCounts;
1513
1538
  /** Agent → current task count (from graph + in-flight). */
1514
1539
  private readonly agentTaskCounts;
1515
1540
  constructor(opts: TaskAuctionOptions);
1541
+ /**
1542
+ * Detach all FleetBus subscriptions and cancel any open bid-window timers.
1543
+ * Call when the owning coordinator stops/restarts so handlers and timers
1544
+ * don't accumulate across cycles.
1545
+ */
1546
+ dispose(): void;
1516
1547
  /**
1517
1548
  * Publish a new task to the auction. Creates a GoalNode and broadcasts
1518
1549
  * it to all online agents. Returns the goal id.
@@ -1527,6 +1558,8 @@ declare class TaskAuctioneer {
1527
1558
  targetAgent?: string;
1528
1559
  parentGoal?: string;
1529
1560
  satisfiesGoals?: string[];
1561
+ /** Goal ids that must reach 'done' before this goal becomes workable. */
1562
+ blockedBy?: string[];
1530
1563
  deadline?: string;
1531
1564
  reward?: string;
1532
1565
  }): Promise<string>;
@@ -1638,6 +1671,9 @@ type CoordinatorEvent = {
1638
1671
  type: 'deadlock:detected';
1639
1672
  goalId: string;
1640
1673
  text?: string;
1674
+ } | {
1675
+ type: 'coordinator:mode';
1676
+ mode: 'standalone' | 'fleet';
1641
1677
  };
1642
1678
 
1643
1679
  interface AutonomousCoordinatorOptions {
@@ -1646,6 +1682,7 @@ interface AutonomousCoordinatorOptions {
1646
1682
  selfAgentName: string;
1647
1683
  fleet?: FleetBus | undefined;
1648
1684
  fleetManager?: FleetManager | undefined;
1685
+ director?: Director | undefined;
1649
1686
  mailbox?: Mailbox | undefined;
1650
1687
  events?: EventBus | undefined;
1651
1688
  llmProvider: LLMProvider;
@@ -1653,6 +1690,11 @@ interface AutonomousCoordinatorOptions {
1653
1690
  disableSelfImprove?: boolean;
1654
1691
  /** Max concurrent subagents. Default: 5. */
1655
1692
  maxConcurrentAgents?: number;
1693
+ /**
1694
+ * Called with every CoordinatorEvent so the caller (e.g. execution.ts)
1695
+ * can forward it to the TUI coordinator panel timeline.
1696
+ */
1697
+ onCoordinatorEvent?: (event: CoordinatorEvent) => void;
1656
1698
  }
1657
1699
  interface RunOptions {
1658
1700
  /** Top-level goal description. Default: "Improve the codebase". */
@@ -1712,10 +1754,16 @@ declare class AutonomousCoordinator {
1712
1754
  private readonly selfAgentId;
1713
1755
  private readonly fleet?;
1714
1756
  private readonly fleetManager?;
1757
+ private readonly director?;
1715
1758
  private readonly mailbox?;
1716
1759
  private readonly events?;
1760
+ private readonly onCoordinatorEvent?;
1717
1761
  private running;
1718
1762
  private iterationCount;
1763
+ /** Tasks already handled by _onSubagentTerminated (to avoid double goal:failed on fleet event). */
1764
+ private readonly _handledBySubagent;
1765
+ /** FleetBus subscription disposers, detached in dispose(). */
1766
+ private readonly unsubs;
1719
1767
  constructor(opts: AutonomousCoordinatorOptions);
1720
1768
  /**
1721
1769
  * Run the autonomous loop until the goal is satisfied or max iterations reached.
@@ -1724,6 +1772,14 @@ declare class AutonomousCoordinator {
1724
1772
  run(opts?: RunOptions): Promise<CoordinatorStats>;
1725
1773
  /** Stop the autonomous loop. */
1726
1774
  stop(): void;
1775
+ /**
1776
+ * Tear down the coordinator for good: stop the loop and detach all FleetBus
1777
+ * subscriptions (this coordinator's + the auctioneer's) plus any open bid
1778
+ * timers. Call this when discarding the instance (e.g. `/coordinator stop`
1779
+ * that recreates a fresh coordinator on the next start) so handlers and
1780
+ * timers don't accumulate across cycles. `stop()` only pauses the loop.
1781
+ */
1782
+ dispose(): void;
1727
1783
  /** Get a stats snapshot. */
1728
1784
  getStats(): CoordinatorStats;
1729
1785
  /**
@@ -1752,7 +1808,6 @@ declare class AutonomousCoordinator {
1752
1808
  private _decomposeGoal;
1753
1809
  private _inferCategory;
1754
1810
  private _processGoal;
1755
- private _waitForClaim;
1756
1811
  private _handlePendingChange;
1757
1812
  private _onDagEvent;
1758
1813
  private _onSubagentTerminated;
@@ -1762,7 +1817,8 @@ declare class AutonomousCoordinator {
1762
1817
  private _optionToGoal;
1763
1818
  private _dagPriorityToGoal;
1764
1819
  private _mailboxBroadcast;
1765
- private _sleep;
1820
+ /** Emit a CoordinatorEvent to the subscriber (e.g. TUI panel timeline). */
1821
+ private _emit;
1766
1822
  }
1767
1823
 
1768
- export { AgentDefinition, AgentHeartbeatInput, AgentRegistrationInput, 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, type ConsensusOptions, ConsensusProtocol, type ConsensusResult, type CoordinatorEvent, type CoordinatorStats, type DAGEdgeEvent, type DAGEdgeHandler, type DAGNode, type DAGNodeStatus, DEFAULT_QUALITY_CHECKS, DELIVERY_AGENTS, DEPENDENCY_FILE_PATTERNS, DISCOVERY_AGENTS, DOMAIN_AGENTS, type DecisionNode, type DecisionPrompt, DefaultMailbox, type DepWatchEntry, type DepWatcherBridgeOptions, type DependencyWatcherConfig, type EscalationDecision, type FactCategory, type FactNode, FleetBus, FleetManager, GlobalMailbox, type GoalNode, type GoalPriority, type GoalStatus, type GraphSubscription, KNOWLEDGE_AGENTS, KnowledgeGraph, type LLMProvider, META_AGENTS, type MailToolsOptions, Mailbox, MailboxAckInput, MailboxAgentStatus, type MailboxHooksOptions, MailboxMessage, MailboxQuery, type MailboxResolver, MailboxSendInput, type MailboxToolOptions, type NodeFilter, type NodeType, type OutdatedNotifyMessage, PLANNING_AGENTS, type PackageAuthorEntry, type PackageAuthorLog, type PackageAuthorTrackerOptions, type PackageOutdatedEntry, type PackageOutdatedResult, type PackageOutdatedWatcherOptions, type PrioritizationDecision, type QualityCheck, type QualityGateChecks, type QualityGateResult, type QuorumRule, REVIEW_AGENTS, type RollbackResult, type RunOptions, type RunnablesHandler, type SpawnDecision, type TaskAuctionOptions, TaskAuctioneer, type TaskBid, TaskDAG, VERIFY_AGENTS, type VoteNode, type VoteRecord, type VoteValue, type VoterConfig, attachDepWatcherBridge, createMailboxHooks, detectEcosystem, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, mailboxSessionTag, makeDependencyWatcherConfig, makeMailInboxTool, makeMailSendTool, makeMailboxTool, recordPackageAction, resolveMailboxIdentity, resolveProjectDir, startPackageOutdatedWatcher, updatePackageOutdatedStatus };
1824
+ export { AgentDefinition, AgentHeartbeatInput, AgentRegistrationInput, 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, type ConsensusOptions, ConsensusProtocol, type ConsensusResult, type CoordinatorEvent, type CoordinatorStats, type DAGEdgeEvent, type DAGEdgeHandler, type DAGNode, type DAGNodeStatus, 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 EscalationDecision, type FactCategory, type FactNode, FleetBus, FleetManager, GlobalMailbox, type GoalNode, type GoalPriority, type GoalStatus, type GraphSubscription, KNOWLEDGE_AGENTS, KnowledgeGraph, type LLMProvider, META_AGENTS, type MailToolsOptions, Mailbox, MailboxAckInput, MailboxAgentStatus, type MailboxHooksOptions, MailboxMessage, MailboxQuery, type MailboxResolver, MailboxSendInput, type MailboxToolOptions, type NodeFilter, type NodeType, type OutdatedNotifyMessage, PLANNING_AGENTS, type PackageAuthorEntry, type PackageAuthorLog, type PackageAuthorTrackerOptions, type PackageOutdatedEntry, type PackageOutdatedResult, type PackageOutdatedWatcherOptions, type PrioritizationDecision, type QualityCheck, type QualityGateChecks, type QualityGateResult, type QuorumRule, REVIEW_AGENTS, type RollbackResult, type RunOptions, type RunnablesHandler, type SpawnDecision, type TaskAuctionOptions, TaskAuctioneer, type TaskBid, TaskDAG, VERIFY_AGENTS, type VoteNode, type VoteRecord, type VoteValue, type VoterConfig, attachDepWatcherBridge, createMailboxHooks, detectEcosystem, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, mailboxSessionTag, makeDependencyWatcherConfig, makeMailInboxTool, makeMailSendTool, makeMailboxTool, recordPackageAction, resolveMailboxIdentity, resolveProjectDir, startPackageOutdatedWatcher, updatePackageOutdatedStatus };