@wrongstack/core 0.255.0 → 0.256.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 (101) hide show
  1. package/dist/{agent-bridge-l_DsFEbr.d.ts → agent-bridge-BrxWHEOm.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-DhYLgAJo.d.ts → agent-subagent-runner-US741uBH.d.ts} +17 -8
  3. package/dist/{brain-BaQsRNka.d.ts → brain-TjEEwSpw.d.ts} +1 -1
  4. package/dist/{compactor-BRfg3QPd.d.ts → compactor-C5sT4U7I.d.ts} +1 -1
  5. package/dist/{config-eSsrto5d.d.ts → config-DuAu23zm.d.ts} +16 -1
  6. package/dist/{context-CLz3z_E8.d.ts → context-CGdgA0q6.d.ts} +13 -0
  7. package/dist/coordination/index.d.ts +14 -14
  8. package/dist/coordination/index.js +21 -2
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +25 -25
  11. package/dist/defaults/index.js +238 -42
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +15 -15
  14. package/dist/execution/index.js +121 -22
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/execution/prompt-enhancer.d.ts +1 -1
  17. package/dist/extension/index.d.ts +6 -6
  18. package/dist/{goal-preamble-BgoPmZ8l.d.ts → goal-preamble-UiEkbNmW.d.ts} +21 -10
  19. package/dist/{index-BilZMsOK.d.ts → index-CC0Mcm05.d.ts} +9 -9
  20. package/dist/{index-Csoc_bKs.d.ts → index-CitPrI3a.d.ts} +20 -7
  21. package/dist/index.d.ts +112 -42
  22. package/dist/index.js +609 -111
  23. package/dist/index.js.map +1 -1
  24. package/dist/infrastructure/index.d.ts +6 -6
  25. package/dist/kernel/index.d.ts +10 -10
  26. package/dist/{llm-selector-D22R4AFz.d.ts → llm-selector-CJ4SyAFE.d.ts} +2 -2
  27. package/dist/{mcp-servers-DfXxCASH.d.ts → mcp-servers-D8YnLaEp.d.ts} +3 -3
  28. package/dist/models/index.d.ts +5 -5
  29. package/dist/{models-registry-DpanBg8D.d.ts → models-registry-ByZCdFuQ.d.ts} +1 -1
  30. package/dist/{multi-agent-coordinator-Bs-M0Mo6.d.ts → multi-agent-coordinator-DqTUEAeC.d.ts} +1 -1
  31. package/dist/{null-fleet-bus-CWdU1_cO.d.ts → null-fleet-bus-B5mfTJXT.d.ts} +17 -6
  32. package/dist/observability/index.d.ts +2 -2
  33. package/dist/{package-outdated-watcher-Dz-eNZlQ.d.ts → package-outdated-watcher-BSgR_kK-.d.ts} +3 -3
  34. package/dist/{parallel-eternal-engine-CAMabk-X.d.ts → parallel-eternal-engine-C0juOszP.d.ts} +24 -10
  35. package/dist/{path-resolver-B7VjhUHq.d.ts → path-resolver-CbkT-RMU.d.ts} +3 -3
  36. package/dist/{permission-DbWPbuoA.d.ts → permission-CwBBpCoF.d.ts} +1 -1
  37. package/dist/{permission-policy-AOk0LVsV.d.ts → permission-policy-B8rSu908.d.ts} +39 -2
  38. package/dist/{pipeline-Bxa3wDcy.d.ts → pipeline-JG8XoudC.d.ts} +2 -2
  39. package/dist/{plan-templates-D3guWwTi.d.ts → plan-templates-DPiQMkBz.d.ts} +5 -5
  40. package/dist/{provider-runner-C8_e4Lo1.d.ts → provider-runner-hM7EXlLI.d.ts} +3 -3
  41. package/dist/{retry-policy-BVnkbMET.d.ts → retry-policy-Tg7LXkoK.d.ts} +1 -1
  42. package/dist/sdd/index.d.ts +8 -8
  43. package/dist/{secret-vault-CeVNiy_f.d.ts → secret-vault-BkYkJWQs.d.ts} +1 -1
  44. package/dist/security/index.d.ts +4 -4
  45. package/dist/security/index.js +89 -18
  46. package/dist/security/index.js.map +1 -1
  47. package/dist/{selector-Cb4_9-hf.d.ts → selector-DWsqVjGf.d.ts} +1 -1
  48. package/dist/{session-event-bridge-BhtkkFFy.d.ts → session-event-bridge-BAFWdgQ3.d.ts} +1 -1
  49. package/dist/{session-reader-CCOssnBS.d.ts → session-reader-CqRvaL5v.d.ts} +1 -1
  50. package/dist/{skill-Bj6Ezqb8.d.ts → skill-DGIXCtdv.d.ts} +6 -0
  51. package/dist/skills/index.d.ts +1 -1
  52. package/dist/storage/index.d.ts +10 -10
  53. package/dist/storage/index.js +8 -1
  54. package/dist/storage/index.js.map +1 -1
  55. package/dist/types/index.d.ts +19 -19
  56. package/dist/types/index.js +83 -25
  57. package/dist/types/index.js.map +1 -1
  58. package/dist/utils/index.d.ts +2 -2
  59. package/dist/utils/index.js +3 -0
  60. package/dist/utils/index.js.map +1 -1
  61. package/package.json +1 -1
  62. package/skills/api-design/SKILL.md +1 -0
  63. package/skills/api-design/SKILL.save.md +26 -0
  64. package/skills/audit-log/SKILL.md +9 -2
  65. package/skills/audit-log/SKILL.save.md +22 -0
  66. package/skills/bug-hunter/SKILL.md +10 -2
  67. package/skills/bug-hunter/SKILL.save.md +33 -0
  68. package/skills/chimera/SKILL.md +12 -18
  69. package/skills/chimera/SKILL.save.md +26 -0
  70. package/skills/docker-deploy/SKILL.md +1 -0
  71. package/skills/docker-deploy/SKILL.save.md +23 -0
  72. package/skills/git-flow/SKILL.md +23 -2
  73. package/skills/git-flow/SKILL.save.md +25 -0
  74. package/skills/multi-agent/SKILL.md +23 -2
  75. package/skills/multi-agent/SKILL.save.md +26 -0
  76. package/skills/node-modern/SKILL.md +2 -1
  77. package/skills/node-modern/SKILL.save.md +21 -0
  78. package/skills/observability/SKILL.md +1 -0
  79. package/skills/observability/SKILL.save.md +34 -0
  80. package/skills/output-standards/SKILL.md +133 -0
  81. package/skills/output-standards/SKILL.save.md +21 -0
  82. package/skills/prompt-engineering/SKILL.md +2 -1
  83. package/skills/prompt-engineering/SKILL.save.md +29 -0
  84. package/skills/react-modern/SKILL.md +2 -1
  85. package/skills/react-modern/SKILL.save.md +24 -0
  86. package/skills/refactor-planner/SKILL.md +9 -2
  87. package/skills/refactor-planner/SKILL.save.md +26 -0
  88. package/skills/research-web/SKILL.md +1 -0
  89. package/skills/research-web/SKILL.save.md +25 -0
  90. package/skills/sdd/SKILL.md +2 -1
  91. package/skills/sdd/SKILL.save.md +19 -0
  92. package/skills/security-scanner/SKILL.md +10 -3
  93. package/skills/security-scanner/SKILL.save.md +23 -0
  94. package/skills/skill-creator/SKILL.md +2 -1
  95. package/skills/skill-creator/SKILL.save.md +20 -0
  96. package/skills/tech-stack/SKILL.md +13 -226
  97. package/skills/tech-stack/SKILL.save.md +25 -0
  98. package/skills/testing/SKILL.md +1 -0
  99. package/skills/testing/SKILL.save.md +22 -0
  100. package/skills/typescript-strict/SKILL.md +2 -1
  101. package/skills/typescript-strict/SKILL.save.md +19 -0
@@ -1,4 +1,4 @@
1
- import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-DhYLgAJo.js';
1
+ import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-US741uBH.js';
2
2
 
3
3
  /**
4
4
  * In-memory pub/sub transport for agent-to-agent messaging.
@@ -1,12 +1,12 @@
1
- import { c as ToolCallPipelinePayload, d as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, e as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, g as AgentInit, h as AgentInput, R as RunResult } from './index-Csoc_bKs.js';
2
- import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-Bxa3wDcy.js';
3
- import { E as EventBus, a as EventName, L as Listener } from './brain-BaQsRNka.js';
4
- import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-BVnkbMET.js';
1
+ import { c as ToolCallPipelinePayload, d as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, e as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, g as AgentInit, h as AgentInput, R as RunResult } from './index-CitPrI3a.js';
2
+ import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-JG8XoudC.js';
3
+ import { E as EventBus, a as EventName, L as Listener } from './brain-TjEEwSpw.js';
4
+ import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-Tg7LXkoK.js';
5
5
  import { L as Logger } from './logger-B63L5bTg.js';
6
6
  import { T as Tracer } from './observability-D-HZN_mF.js';
7
- import { P as PermissionPolicy } from './permission-DbWPbuoA.js';
8
- import { U as Usage, C as Context, J as JSONSchema, R as Request, b as Response, g as ContentBlock, n as TextBlock, T as Tool, P as Provider, o as RunOptions } from './context-CLz3z_E8.js';
9
- import { W as WireFamily, H as HookEvent, e as HookMatcher, I as InProcessHook, h as Config } from './config-eSsrto5d.js';
7
+ import { P as PermissionPolicy } from './permission-CwBBpCoF.js';
8
+ import { U as Usage, C as Context, J as JSONSchema, R as Request, b as Response, g as ContentBlock, n as TextBlock, T as Tool, P as Provider, o as RunOptions } from './context-CGdgA0q6.js';
9
+ import { W as WireFamily, H as HookEvent, e as HookMatcher, I as InProcessHook, h as Config } from './config-DuAu23zm.js';
10
10
 
11
11
  /**
12
12
  * Single fleet-wide event with subagent attribution. Whatever a child
@@ -900,6 +900,15 @@ interface PluginCapabilities {
900
900
  slashCommands?: boolean | undefined;
901
901
  /** Will start MCP servers via `api.mcp.start()`. */
902
902
  mcp?: boolean | undefined;
903
+ /**
904
+ * Capabilities required to mutate (wrap, unregister, override) tools
905
+ * the plugin does not own. If empty or omitted, the plugin may only
906
+ * mutate its own tools. Official plugins bypass this check.
907
+ *
908
+ * Example: `['fs.read', 'net.outbound']` allows the plugin to wrap
909
+ * read-only tools, but not `fs.write` or `shell.arbitrary` tools.
910
+ */
911
+ toolMutateCapabilities?: string[] | undefined;
903
912
  }
904
913
  /**
905
914
  * Structured dependency declaration. The string form (`dependsOn: ['foo']`)
@@ -1053,4 +1062,4 @@ interface AgentRunnerOptions {
1053
1062
  */
1054
1063
  declare function makeAgentSubagentRunner(opts: AgentRunnerOptions): SubagentRunner;
1055
1064
 
1056
- export { type AgentBridge as A, type BridgeTransport as B, type CoordinatorStatus as C, type DoneCondition as D, type PluginPipelines as E, FleetBus as F, type ToolRegistryView as G, type ProviderRegistryView as H, type MCPRegistryView as I, type SlashCommandRegistryView as J, type SessionWriterView as K, type MetricsSinkView as L, type MultiAgentCoordinator as M, type Plugin as N, type CoordinatorEvents as O, type PluginAPI as P, type PluginCapabilities as Q, type PluginDependency as R, type SubagentConfig as S, type TaskSpec as T, type SubagentContext as U, type SubagentError as V, type SubagentErrorKind as W, type SubagentRunContext as X, type SubagentRunOutcome as Y, type TaskDelegation as Z, type ProviderFactory as _, type BridgeMessage as a, type AgentBridgeConfig as b, type MultiAgentConfig as c, type SubagentRunner as d, type SpawnResult as e, type TaskResult as f, Agent as g, type AgentFactory as h, type AgentFactoryResult as i, type AgentRunnerOptions as j, BudgetExceededError as k, type BudgetKind as l, type BudgetLimits as m, type BudgetNegotiationMode as n, type BudgetThresholdDecision as o, type BudgetThresholdHandler as p, BudgetThresholdSignal as q, type BudgetUsage as r, type FleetEvent as s, type FleetHandler as t, type FleetUsage as u, FleetUsageAggregator as v, SubagentBudget as w, type SubagentUsageSnapshot as x, makeAgentSubagentRunner as y, type SlashCommand as z };
1065
+ export { type AgentBridge as A, type BridgeTransport as B, type CoordinatorStatus as C, type DoneCondition as D, type PluginPipelines as E, FleetBus as F, type ToolRegistryView as G, type ProviderRegistryView as H, type MCPRegistryView as I, type SlashCommandRegistryView as J, type SessionWriterView as K, type MetricsSinkView as L, type MultiAgentCoordinator as M, type PluginCapabilities as N, type Plugin as O, type PluginAPI as P, type CoordinatorEvents as Q, type PluginDependency as R, type SubagentConfig as S, type TaskSpec as T, type SubagentContext as U, type SubagentError as V, type SubagentErrorKind as W, type SubagentRunContext as X, type SubagentRunOutcome as Y, type TaskDelegation as Z, type ProviderFactory as _, type BridgeMessage as a, type AgentBridgeConfig as b, type MultiAgentConfig as c, type SubagentRunner as d, type SpawnResult as e, type TaskResult as f, Agent as g, type AgentFactory as h, type AgentFactoryResult as i, type AgentRunnerOptions as j, BudgetExceededError as k, type BudgetKind as l, type BudgetLimits as m, type BudgetNegotiationMode as n, type BudgetThresholdDecision as o, type BudgetThresholdHandler as p, BudgetThresholdSignal as q, type BudgetUsage as r, type FleetEvent as s, type FleetHandler as t, type FleetUsage as u, FleetUsageAggregator as v, SubagentBudget as w, type SubagentUsageSnapshot as x, makeAgentSubagentRunner as y, type SlashCommand as z };
@@ -1,4 +1,4 @@
1
- import { U as Usage, C as Context, j as ToolProgressEvent, T as Tool } from './context-CLz3z_E8.js';
1
+ import { U as Usage, C as Context, j as ToolProgressEvent, T as Tool } from './context-CGdgA0q6.js';
2
2
 
3
3
  type MemoryScope = 'project-agents' | 'project-memory' | 'user-memory';
4
4
  type MemoryType = 'fact' | 'decision' | 'convention' | 'preference' | 'reference' | 'anti_pattern';
@@ -1,4 +1,4 @@
1
- import { C as Context } from './context-CLz3z_E8.js';
1
+ import { C as Context } from './context-CGdgA0q6.js';
2
2
 
3
3
  interface CompactRepairReport {
4
4
  removedToolUses: string[];
@@ -1,4 +1,4 @@
1
- import { k as Capabilities, f as Permission } from './context-CLz3z_E8.js';
1
+ import { k as Capabilities, f as Permission } from './context-CGdgA0q6.js';
2
2
 
3
3
  type ContextWindowModeId = 'balanced' | 'frugal' | 'deep' | 'archival';
4
4
  type ContextWindowAggressiveOn = 'hard' | 'soft' | 'warn';
@@ -374,6 +374,14 @@ interface FeaturesConfig {
374
374
  modelsRegistry: boolean;
375
375
  /** Discover + load skills from disk. */
376
376
  skills: boolean;
377
+ /**
378
+ * Token-saving mode: when enabled, non-essential tools are omitted,
379
+ * skill descriptions are trimmed, and the system prompt is shortened
380
+ * to reduce per-request token consumption without compromising core
381
+ * functionality. Enable with `--token-saving-mode` or
382
+ * `features.tokenSavingMode: true` in config.
383
+ */
384
+ tokenSavingMode?: boolean | undefined;
377
385
  }
378
386
  interface AutonomyConfig {
379
387
  /** ms to wait before auto-proceeding in 'auto' mode. Default: 45000. */
@@ -514,6 +522,13 @@ interface Config {
514
522
  * re-tried first at the start of every user turn. See `createFallbackModelExtension`.
515
523
  */
516
524
  fallbackModels?: string[] | undefined;
525
+ /**
526
+ * When `true` (the default) and `fallbackModels` is empty, a fallback chain
527
+ * is derived automatically from the other keyed providers/models so 429s
528
+ * recover out of the box. Set `false` to disable the smart default and only
529
+ * use an explicit `fallbackModels` list. Toggle via `/fallback auto on|off`.
530
+ */
531
+ fallbackAuto?: boolean | undefined;
517
532
  /**
518
533
  * Lifecycle shell hooks, keyed by event. Each command receives the hook
519
534
  * `HookInput` JSON on stdin; a JSON `HookOutcome` on stdout (and exit code 2
@@ -1331,6 +1331,19 @@ declare class Context implements RunEnv {
1331
1331
  * on iterations where no tool content was added (pure text responses).
1332
1332
  */
1333
1333
  toolAdjacencyDirty: boolean;
1334
+ /**
1335
+ * H1: pre-computed total-request token estimate from the most recent
1336
+ * `estimateRequestTokens()` call in the agent loop's pre-flight step.
1337
+ * The middleware that decides when to compact, the `emitContextPct`
1338
+ * helper that drives the live context-fill bar, and the pre-flight
1339
+ * itself all need this number; previously each one walked the same
1340
+ * messages/system/tools arrays independently. Stashing it here lets
1341
+ * the three call sites share a single compute per iteration.
1342
+ *
1343
+ * The value is the **uncalibrated** total. Callers that want the
1344
+ * calibrated number apply the per-(provider,model) ratio themselves.
1345
+ */
1346
+ lastRequestTokens: number | undefined;
1334
1347
  constructor(init: ContextInit);
1335
1348
  /**
1336
1349
  * Observable wrapper over the mutable conversation state. Lazy so
@@ -1,21 +1,21 @@
1
- export { B as BrainArbiter, b as BrainDecision, c as BrainDecisionOption, d as BrainDecisionQueue, e as BrainDecisionRequest, f as BrainDecisionSource, g as BrainFallback, h as BrainRisk, D as DefaultBrainArbiter, i as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, j as formatHumanPrompt } from '../brain-BaQsRNka.js';
2
- 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, H as FleetManager, 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-CWdU1_cO.js';
3
- import { A as AgentDefinition } from '../multi-agent-coordinator-Bs-M0Mo6.js';
4
- export { T as AGENT_TOOL_PRESETS, b as AgentBudgetTier, c as AgentCapability, d 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-Bs-M0Mo6.js';
5
- export { h as AgentFactory, i as AgentFactoryResult, j as AgentRunnerOptions, k as BudgetExceededError, l as BudgetKind, m as BudgetLimits, n as BudgetNegotiationMode, o as BudgetThresholdDecision, p as BudgetThresholdHandler, q as BudgetThresholdSignal, r as BudgetUsage, F as FleetBus, s as FleetEvent, t as FleetHandler, u as FleetUsage, v as FleetUsageAggregator, w as SubagentBudget, x as SubagentUsageSnapshot, y as makeAgentSubagentRunner } from '../agent-subagent-runner-DhYLgAJo.js';
6
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-l_DsFEbr.js';
7
- export { B as BrainInterventionInput, a as BrainMonitor, b as BrainMonitorOptions, D as DEPENDENCY_FILE_PATTERNS, c as DefaultMailbox, d as DepWatchEntry, e as DepWatcherBridgeOptions, f as DependencyWatcherConfig, G as GlobalMailbox, M as MailToolsOptions, g as MailboxResolver, h as MailboxToolOptions, O as OutdatedNotifyMessage, P as PackageAuthorEntry, i as PackageAuthorLog, j as PackageAuthorTrackerOptions, k as PackageOutdatedEntry, l as PackageOutdatedResult, m as PackageOutdatedWatcherOptions, n as attachDepWatcherBridge, o as detectEcosystem, p as getFullPackageLog, q as getManifestPackages, r as getPackageAuthor, s as getPackagesByAgent, t as mailboxSessionTag, u as makeDependencyWatcherConfig, v as makeMailInboxTool, w as makeMailSendTool, x as makeMailboxTool, y as recordPackageAction, z as resolveMailboxIdentity, A as resolveProjectDir, C as startPackageOutdatedWatcher, E as updatePackageOutdatedStatus } from '../package-outdated-watcher-Dz-eNZlQ.js';
8
- import { b as Mailbox } from '../pipeline-Bxa3wDcy.js';
9
- export { h as AgentHeartbeatInput, A as AgentRegistrationInput, f as MailboxAckInput, g as MailboxAgentStatus, d as MailboxMessage, l as MailboxMessageType, e as MailboxQuery, c as MailboxSendInput, m as MailboxTaskContext, n as ReadReceipts, o as RegisteredAgent, p as normalizeRecipient } from '../pipeline-Bxa3wDcy.js';
10
- import '../context-CLz3z_E8.js';
1
+ export { B as BrainArbiter, b as BrainDecision, c as BrainDecisionOption, d as BrainDecisionQueue, e as BrainDecisionRequest, f as BrainDecisionSource, g as BrainFallback, h as BrainRisk, D as DefaultBrainArbiter, i as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, j as formatHumanPrompt } from '../brain-TjEEwSpw.js';
2
+ 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, H as FleetManager, 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-B5mfTJXT.js';
3
+ import { A as AgentDefinition } from '../multi-agent-coordinator-DqTUEAeC.js';
4
+ export { T as AGENT_TOOL_PRESETS, b as AgentBudgetTier, c as AgentCapability, d 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-DqTUEAeC.js';
5
+ export { h as AgentFactory, i as AgentFactoryResult, j as AgentRunnerOptions, k as BudgetExceededError, l as BudgetKind, m as BudgetLimits, n as BudgetNegotiationMode, o as BudgetThresholdDecision, p as BudgetThresholdHandler, q as BudgetThresholdSignal, r as BudgetUsage, F as FleetBus, s as FleetEvent, t as FleetHandler, u as FleetUsage, v as FleetUsageAggregator, w as SubagentBudget, x as SubagentUsageSnapshot, y as makeAgentSubagentRunner } from '../agent-subagent-runner-US741uBH.js';
6
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-BrxWHEOm.js';
7
+ export { B as BrainInterventionInput, a as BrainMonitor, b as BrainMonitorOptions, D as DEPENDENCY_FILE_PATTERNS, c as DefaultMailbox, d as DepWatchEntry, e as DepWatcherBridgeOptions, f as DependencyWatcherConfig, G as GlobalMailbox, M as MailToolsOptions, g as MailboxResolver, h as MailboxToolOptions, O as OutdatedNotifyMessage, P as PackageAuthorEntry, i as PackageAuthorLog, j as PackageAuthorTrackerOptions, k as PackageOutdatedEntry, l as PackageOutdatedResult, m as PackageOutdatedWatcherOptions, n as attachDepWatcherBridge, o as detectEcosystem, p as getFullPackageLog, q as getManifestPackages, r as getPackageAuthor, s as getPackagesByAgent, t as mailboxSessionTag, u as makeDependencyWatcherConfig, v as makeMailInboxTool, w as makeMailSendTool, x as makeMailboxTool, y as recordPackageAction, z as resolveMailboxIdentity, A as resolveProjectDir, C as startPackageOutdatedWatcher, E as updatePackageOutdatedStatus } from '../package-outdated-watcher-BSgR_kK-.js';
8
+ import { b as Mailbox } from '../pipeline-JG8XoudC.js';
9
+ export { h as AgentHeartbeatInput, A as AgentRegistrationInput, f as MailboxAckInput, g as MailboxAgentStatus, d as MailboxMessage, l as MailboxMessageType, e as MailboxQuery, c as MailboxSendInput, m as MailboxTaskContext, n as ReadReceipts, o as RegisteredAgent, p as normalizeRecipient } from '../pipeline-JG8XoudC.js';
10
+ import '../context-CGdgA0q6.js';
11
11
  import 'node:events';
12
12
  import '../director-state-BfeCUbmk.js';
13
- import '../config-eSsrto5d.js';
14
- import '../index-Csoc_bKs.js';
13
+ import '../config-DuAu23zm.js';
14
+ import '../index-CitPrI3a.js';
15
15
  import '../logger-B63L5bTg.js';
16
16
  import '../observability-D-HZN_mF.js';
17
- import '../permission-DbWPbuoA.js';
18
- import '../retry-policy-BVnkbMET.js';
17
+ import '../permission-CwBBpCoF.js';
18
+ import '../retry-policy-Tg7LXkoK.js';
19
19
 
20
20
  /** Phase 1 · Discovery — map the territory before any work begins. */
21
21
  declare const DISCOVERY_AGENTS: AgentDefinition[];
@@ -6701,6 +6701,17 @@ var Director = class _Director {
6701
6701
  * default cap.
6702
6702
  */
6703
6703
  taskCompletedListener = null;
6704
+ /**
6705
+ * Unsub handles for the two `FleetBus.filter()` calls installed in the
6706
+ * constructor for timeout-heartbeat tracking. Without capturing these
6707
+ * and calling them in `shutdown()`, repeated Director construction
6708
+ * (tests, hot reloads, `--director` restarts) accumulates 2 dangling
6709
+ * listeners per Director on the FleetBus, slowly drifting the
6710
+ * EventEmitter past its default cap. Mirrors the rationale on
6711
+ * `taskCompletedListener` above.
6712
+ */
6713
+ toolExecFilter = null;
6714
+ budgetFilter = null;
6704
6715
  /** Optional LLM classifier for smart dispatch. Passed from options. */
6705
6716
  dispatchClassifier;
6706
6717
  /** Leader agent's current context pressure (full request tokens). */
@@ -6838,10 +6849,10 @@ var Director = class _Director {
6838
6849
  const extendCounts = /* @__PURE__ */ new Map();
6839
6850
  const progressBySubagent = /* @__PURE__ */ new Map();
6840
6851
  const lastTimeoutProgress = /* @__PURE__ */ new Map();
6841
- this.fleet.filter("tool.executed", (e) => {
6852
+ this.toolExecFilter = this.fleet.filter("tool.executed", (e) => {
6842
6853
  progressBySubagent.set(e.subagentId, (progressBySubagent.get(e.subagentId) ?? 0) + 1);
6843
6854
  });
6844
- this.fleet.filter("budget.threshold_reached", (e) => {
6855
+ this.budgetFilter = this.fleet.filter("budget.threshold_reached", (e) => {
6845
6856
  const payload = e.payload;
6846
6857
  if (e.subagentId.startsWith("bug-hunter-") || e.subagentId.startsWith("refactor-planner-") || e.subagentId.startsWith("critic-")) {
6847
6858
  return;
@@ -7372,6 +7383,14 @@ var Director = class _Director {
7372
7383
  this.coordinator.off("task.completed", this.taskCompletedListener);
7373
7384
  this.taskCompletedListener = null;
7374
7385
  }
7386
+ if (this.toolExecFilter) {
7387
+ this.toolExecFilter();
7388
+ this.toolExecFilter = null;
7389
+ }
7390
+ if (this.budgetFilter) {
7391
+ this.budgetFilter();
7392
+ this.budgetFilter = null;
7393
+ }
7375
7394
  await this.coordinator.stopAll();
7376
7395
  for (const b of this.subagentBridges.values()) {
7377
7396
  await b.stop().catch((err) => this.logShutdownError("subagent_bridge_stop", err));