@wrongstack/core 0.281.1 → 0.282.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.
Files changed (55) hide show
  1. package/dist/{agent-subagent-runner-DyOSK2Wy.d.ts → agent-subagent-runner-Dksf0QVU.d.ts} +15 -4
  2. package/dist/{config-CN-vdDEI.d.ts → config-BCAEJicb.d.ts} +33 -1
  3. package/dist/coordination/index.d.ts +147 -48
  4. package/dist/coordination/index.js +1244 -274
  5. package/dist/coordination/index.js.map +1 -1
  6. package/dist/defaults/index.d.ts +18 -18
  7. package/dist/defaults/index.js +991 -173
  8. package/dist/defaults/index.js.map +1 -1
  9. package/dist/{director-state-BfeCUbmk.d.ts → director-state-B_GPa78Q.d.ts} +14 -0
  10. package/dist/{events-C5hLU0AT.d.ts → events-CovDylaH.d.ts} +2 -1
  11. package/dist/execution/index.d.ts +10 -10
  12. package/dist/execution/index.js +69 -3
  13. package/dist/execution/index.js.map +1 -1
  14. package/dist/extension/index.d.ts +4 -4
  15. package/dist/{global-mailbox-CHM1QkCi.d.ts → global-mailbox-CNfgvRw3.d.ts} +1 -1
  16. package/dist/{goal-store-BLGZq16t.d.ts → goal-store-CBd749M4.d.ts} +1 -1
  17. package/dist/hq/index.d.ts +4 -4
  18. package/dist/{index-C1E-_71T.d.ts → index-D5HB7WkV.d.ts} +4 -3
  19. package/dist/index.d.ts +3005 -2704
  20. package/dist/index.js +51869 -49930
  21. package/dist/index.js.map +1 -1
  22. package/dist/infrastructure/index.d.ts +3 -3
  23. package/dist/kernel/index.d.ts +7 -7
  24. package/dist/kernel/index.js.map +1 -1
  25. package/dist/{mcp-servers-EKRAcJDi.d.ts → mcp-servers-DJYwZXyH.d.ts} +1 -1
  26. package/dist/models/index.d.ts +2 -2
  27. package/dist/models/index.js +111 -21
  28. package/dist/models/index.js.map +1 -1
  29. package/dist/{multi-agent-coordinator-IpHCuHUa.d.ts → multi-agent-coordinator-4DC31QWu.d.ts} +1 -1
  30. package/dist/{null-fleet-bus-ZBkKGR9j.d.ts → null-fleet-bus-DuvA8PIR.d.ts} +74 -6
  31. package/dist/observability/index.d.ts +1 -1
  32. package/dist/{parallel-eternal-engine-Cc2CNgmv.d.ts → parallel-eternal-engine-BwcA0bAt.d.ts} +4 -4
  33. package/dist/{pipeline-E7_jqGyV.d.ts → pipeline-DM-CPTUs.d.ts} +1 -1
  34. package/dist/{provider-model-resolve-KgIdiEQ6.d.ts → provider-model-resolve-hNUbewMd.d.ts} +1 -1
  35. package/dist/{provider-runner-DxWXNHL1.d.ts → provider-runner-Bz4GyUqo.d.ts} +1 -1
  36. package/dist/sdd/index.d.ts +6 -6
  37. package/dist/sdd/index.js +76 -2
  38. package/dist/sdd/index.js.map +1 -1
  39. package/dist/{session-event-bridge-vA2fLV58.d.ts → session-event-bridge-Bkp7ORfc.d.ts} +2 -2
  40. package/dist/skills/index.d.ts +84 -84
  41. package/dist/storage/index.d.ts +168 -168
  42. package/dist/storage/index.js +19 -7
  43. package/dist/storage/index.js.map +1 -1
  44. package/dist/{todos-checkpoint-B1QVkoa8.d.ts → todos-checkpoint-addCdQ9f.d.ts} +2 -2
  45. package/dist/{tool-executor-BWtYwuPI.d.ts → tool-executor-B3spV_Q6.d.ts} +7 -7
  46. package/dist/tools/index.d.ts +1 -1
  47. package/dist/types/index.d.ts +33 -33
  48. package/dist/types/index.js.map +1 -1
  49. package/dist/utils/index.d.ts +113 -113
  50. package/dist/{worktree-manager-C6CIilTT.d.ts → worktree-manager-BBXdJq-Y.d.ts} +1 -1
  51. package/instructions/agents/reviewer.md +25 -0
  52. package/instructions/agents/verifier.md +24 -0
  53. package/instructions/coordination/director-preamble.md +24 -2
  54. package/instructions/coordination/subagent-baseline.md +8 -1
  55. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- import { T as ToolCallPipelinePayload, a as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, b as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, c as ToolExecutorLike, d as AgentInit, e as AgentInput, R as RunResult } from './index-C1E-_71T.js';
2
- import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-E7_jqGyV.js';
3
- import { E as EventBus, a as EventName, L as Listener } from './events-C5hLU0AT.js';
1
+ import { T as ToolCallPipelinePayload, a as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, b as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, c as ToolExecutorLike, d as AgentInit, e as AgentInput, R as RunResult } from './index-D5HB7WkV.js';
2
+ import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-DM-CPTUs.js';
3
+ import { E as EventBus, a as EventName, L as Listener } from './events-CovDylaH.js';
4
4
  import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-V67lBOJz.js';
5
5
  import { L as Logger } from './logger-B63L5bTg.js';
6
6
  import { T as Tracer } from './observability-D-HZN_mF.js';
7
7
  import { P as PermissionPolicy } from './permission-B6YAtNFz.js';
8
8
  import { d as Context, J as JSONSchema, c as Request, e as Response, i as ContentBlock, s as TextBlock, g as Tool, P as Provider, t as RunOptions, U as Usage } from './tool-LVSLiE1s.js';
9
- import { W as WireFamily, H as HookEvent, f as HookMatcher, I as InProcessHook, C as Config, M as ModelsRegistry, h as ModelRuntimeConfig } from './config-CN-vdDEI.js';
9
+ import { W as WireFamily, H as HookEvent, f as HookMatcher, I as InProcessHook, C as Config, M as ModelsRegistry, h as ModelRuntimeConfig } from './config-BCAEJicb.js';
10
10
  import { b as Mailbox } from './mailbox-types-BGZWrYTJ.js';
11
11
 
12
12
  type BridgeMessageType = 'task' | 'result' | 'progress' | 'error' | 'heartbeat' | 'stop' | 'delegate' | 'budget_threshold';
@@ -844,6 +844,17 @@ interface SubagentConfig {
844
844
  * worktree's `.git` gitlink from `cwd` while staying bounded to the repo.
845
845
  */
846
846
  cwd?: string | undefined;
847
+ /**
848
+ * Git-worktree isolation override for this subagent.
849
+ *
850
+ * - `undefined` / `'auto'`: follow the fleet policy. Mutating/build-capable
851
+ * agents get isolated worktrees; read-only review agents can stay on the
852
+ * shared checkout.
853
+ * - `true` / `'required'`: require an isolated worktree. If allocation fails,
854
+ * the task fails instead of falling back to the shared cwd.
855
+ * - `false` / `'off'`: never allocate a worktree for this subagent.
856
+ */
857
+ worktree?: boolean | 'auto' | 'required' | 'off' | undefined;
847
858
  /**
848
859
  * Provider registry id (e.g. `'anthropic'`, `'openai'`, `'google'`).
849
860
  * Allows a director to mix providers across siblings — one subagent on
@@ -99,6 +99,13 @@ interface HookOutcome {
99
99
  * (SessionStart).
100
100
  */
101
101
  additionalContext?: string | undefined;
102
+ /**
103
+ * Where the additionalContext should appear. `inline` (default) appends it
104
+ * to the tool_result / user message content so it renders as part of that
105
+ * block. `separate` appends it as a new user message, keeping plugin notices
106
+ * visually separated from the actual tool output.
107
+ */
108
+ contextAs?: 'inline' | 'separate' | undefined;
102
109
  }
103
110
  /** An in-process hook function (registered via the plugin API). */
104
111
  type InProcessHook = (input: HookInput) => HookOutcome | void | Promise<HookOutcome | void>;
@@ -1004,6 +1011,31 @@ interface FleetConfig {
1004
1011
  /** Global cap on broadcasts per minute (excess dropped + counted). Default 20. */
1005
1012
  globalPerMinuteCap?: number | undefined;
1006
1013
  } | undefined;
1014
+ /**
1015
+ * Per-subagent git-worktree isolation for Director fleets. The default is
1016
+ * `auto`: mutating/build-capable subagents run in isolated checkouts and are
1017
+ * squash-merged back on success; read-only review agents usually stay on the
1018
+ * shared checkout. Set `enabled:false` or `mode:'off'` when a workflow cannot
1019
+ * use worktrees.
1020
+ */
1021
+ worktrees?: {
1022
+ /** Kill switch. Default true. */
1023
+ enabled?: boolean | undefined;
1024
+ /**
1025
+ * `auto` (default): isolate only side-effectful subagents.
1026
+ * `required`: side-effectful subagents must get a worktree or fail.
1027
+ * `off`: never allocate worktrees.
1028
+ */
1029
+ mode?: 'auto' | 'required' | 'off' | undefined;
1030
+ /**
1031
+ * Merge successful task branches back into the base checkout. Default
1032
+ * true. When false, successful worktrees are committed and kept for
1033
+ * manual `/worktree merge`.
1034
+ */
1035
+ autoMerge?: boolean | undefined;
1036
+ /** Keep failed/timeout worktrees when they contain changes. Default true. */
1037
+ keepFailed?: boolean | undefined;
1038
+ } | undefined;
1007
1039
  /** Brain-gated fleet supervisor (rebalance/steer/spawn-helper). */
1008
1040
  supervisor?: FleetSupervisorConfig | undefined;
1009
1041
  }
@@ -1245,4 +1277,4 @@ interface ConfigStore {
1245
1277
  watch(cb: (next: Readonly<Config>, prev: Readonly<Config>) => void): () => void;
1246
1278
  }
1247
1279
 
1248
- export { type ProviderApiKey as $, type AdaptiveConcurrencyConfig as A, type ExecToolConfig as B, type Config as C, DEFAULT_CONTEXT_WINDOW_MODE_ID as D, type ExecDangerConfig as E, type FeaturesConfig as F, type FleetConfig as G, type HookEvent as H, type InProcessHook as I, type FleetSupervisorConfig as J, type HqClientConfig as K, type IndexingConfig as L, type ModelsRegistry as M, type InputHistoryConfig as N, type LaunchConfig as O, type ProviderConfig as P, type LogConfig as Q, type ResolvedModel as R, type ShellHook as S, type ToolResultRenderMode as T, MAX_TUI_THINKING_WORD_LENGTH as U, type ModelRuntimeCacheConfig as V, type WireFamily as W, type ModelRuntimeParametersConfig as X, type ModelRuntimeReasoningConfig as Y, type ModelsDevProvider as Z, type PluginConfig as _, type ModelMatrixEntry as a, type SessionLoggingConfig as a0, type SkillsConfig as a1, type SyncCategory as a2, type ToolDescriptionMode as a3, type ToolDescriptionModeConfig as a4, type ToolResultRenderModeConfig as a5, type ToolsConfig as a6, formatContextWindowModeList as a7, getContextWindowMode as a8, isContextWindowModeId as a9, listContextWindowModes as aa, normalizeTokenSavingTier as ab, normalizeTuiThinkingWord as ac, resolveContextWindowPolicy as ad, type MCPServerConfig as b, type ModelsDevPayload as c, type ResolvedProvider as d, type ModelsDevModel as e, type HookMatcher as f, type HookEntry as g, type ModelRuntimeConfig as h, type ConfigLoader as i, type SyncConfig as j, type ConfigStore as k, type ContextWindowAggressiveOn as l, type ContextWindowPolicy as m, type HookInput as n, type HookOutcome as o, type TokenSavingTier as p, type AutonomyConfig as q, CONTEXT_WINDOW_MODES as r, type CircuitBreakerRuntimeConfig as s, type ContextConfig as t, type ContextWindowConfigLike as u, type ContextWindowMode as v, type ContextWindowModeId as w, type ContextWindowThresholds as x, type CustomModelDefinition as y, DEFAULT_TUI_THINKING_WORD as z };
1280
+ export { type ProviderApiKey as $, type AdaptiveConcurrencyConfig as A, type ExecToolConfig as B, type Config as C, DEFAULT_CONTEXT_WINDOW_MODE_ID as D, type ExecDangerConfig as E, type FleetConfig as F, type FeaturesConfig as G, type HookEvent as H, type InProcessHook as I, type FleetSupervisorConfig as J, type HqClientConfig as K, type IndexingConfig as L, type ModelsRegistry as M, type InputHistoryConfig as N, type LaunchConfig as O, type ProviderConfig as P, type LogConfig as Q, type ResolvedModel as R, type ShellHook as S, type ToolResultRenderMode as T, MAX_TUI_THINKING_WORD_LENGTH as U, type ModelRuntimeCacheConfig as V, type WireFamily as W, type ModelRuntimeParametersConfig as X, type ModelRuntimeReasoningConfig as Y, type ModelsDevProvider as Z, type PluginConfig as _, type ModelMatrixEntry as a, type SessionLoggingConfig as a0, type SkillsConfig as a1, type SyncCategory as a2, type ToolDescriptionMode as a3, type ToolDescriptionModeConfig as a4, type ToolResultRenderModeConfig as a5, type ToolsConfig as a6, formatContextWindowModeList as a7, getContextWindowMode as a8, isContextWindowModeId as a9, listContextWindowModes as aa, normalizeTokenSavingTier as ab, normalizeTuiThinkingWord as ac, resolveContextWindowPolicy as ad, type MCPServerConfig as b, type ModelsDevPayload as c, type ResolvedProvider as d, type ModelsDevModel as e, type HookMatcher as f, type HookEntry as g, type ModelRuntimeConfig as h, type ConfigLoader as i, type SyncConfig as j, type ConfigStore as k, type ContextWindowAggressiveOn as l, type ContextWindowPolicy as m, type TokenSavingTier as n, type HookInput as o, type HookOutcome as p, type AutonomyConfig as q, CONTEXT_WINDOW_MODES as r, type CircuitBreakerRuntimeConfig as s, type ContextConfig as t, type ContextWindowConfigLike as u, type ContextWindowMode as v, type ContextWindowModeId as w, type ContextWindowThresholds as x, type CustomModelDefinition as y, DEFAULT_TUI_THINKING_WORD as z };
@@ -1,23 +1,24 @@
1
- import { H as FleetManager, s as Director } from '../null-fleet-bus-ZBkKGR9j.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, 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 InMemoryAgentBridge, O as InMemoryBridgeTransport, P as LargeAnswerStore, Q as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as RefactorPhase, T as RefactorPlan, U as SECURITY_SCANNER_AGENT, V as SharedFileEntry, W as SharedFileSnapshot, X as SubagentPromptParts, Y as TaskResultNotification, Z as applyRosterBudget, _ as attachAutoExtend, $ as composeDirectorPrompt, a0 as composeSubagentPrompt, a1 as createDelegateTool, a2 as createMessage, a3 as getAgentDefinition, a4 as makeAskResultTool, a5 as makeAskTool, a6 as makeAssignTool, a7 as makeAwaitTasksTool, a8 as makeCollabDebugTool, a9 as makeDirectorSessionFactory, aa as makeFleetEmitTool, ab as makeFleetHealthTool, ab as makeFleetSessionTool, ab as makeFleetTool, ab as makeFleetUsageTool, ac as makeRollUpTool, ad as makeSpawnTool, ae as makeTerminateAllTool, af as makeTerminateTool, ag as makeWorkCompleteTool, ah as rosterSummaryFromConfigs } from '../null-fleet-bus-ZBkKGR9j.js';
3
- import { F as FleetBus, T as TaskSpec } from '../agent-subagent-runner-DyOSK2Wy.js';
4
- export { a as AgentFactory, y as AgentFactoryResult, z as AgentRunnerOptions, E as BudgetExceededError, G as BudgetKind, H as BudgetLimits, I as BudgetNegotiationMode, J as BudgetThresholdDecision, K as BudgetThresholdHandler, L as BudgetThresholdSignal, N as BudgetUsage, Q as DECISION_TIMEOUT_MS, R as FleetEvent, U as FleetHandler, k as FleetUsage, l as FleetUsageAggregator, X as SubagentBudget, a1 as SubagentUsageSnapshot, a2 as TIMEOUT_PREEMPT_FRACTION, a4 as makeAgentSubagentRunner, a5 as withDisabledToolFiltering } from '../agent-subagent-runner-DyOSK2Wy.js';
5
- import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../events-C5hLU0AT.js';
6
- export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../events-C5hLU0AT.js';
1
+ import { H as FleetManager, s as Director } from '../null-fleet-bus-DuvA8PIR.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, 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 FleetWorktreePolicy, M as ICoordinator, N as IFleetManager, O as InMemoryAgentBridge, P as InMemoryBridgeTransport, Q as LargeAnswerStore, R as NULL_FLEET_BUS, S as REFACTOR_PLANNER_AGENT, T as RefactorPhase, U as RefactorPlan, V as SECURITY_SCANNER_AGENT, W as SharedFileEntry, X as SharedFileSnapshot, Y as SubagentPromptParts, Z as TaskResultNotification, _ as WorktreeIntegrationError, $ as WorktreeIsolationDecision, a0 as WorktreeTaskRunnerOptions, a1 as WorktreeTaskStateUpdate, a2 as applyRosterBudget, a3 as attachAutoExtend, a4 as composeDirectorPrompt, a5 as composeSubagentPrompt, a6 as createDelegateTool, a7 as createMessage, a8 as getAgentDefinition, a9 as makeAskResultTool, aa as makeAskTool, ab as makeAssignTool, ac as makeAwaitTasksTool, ad as makeCollabDebugTool, ae as makeDirectorSessionFactory, af as makeFleetEmitTool, ag as makeFleetHealthTool, ag as makeFleetSessionTool, ag as makeFleetTool, ag as makeFleetUsageTool, ah as makeQualityGateTool, ai as makeRollUpTool, aj as makeSpawnTool, ak as makeTerminateAllTool, al as makeTerminateTool, am as makeWorkCompleteTool, an as resolveSubagentWorktreeDecision, ao as rosterSummaryFromConfigs, ap as subagentNeedsWorktree, aq as wrapSubagentRunnerWithWorktrees } from '../null-fleet-bus-DuvA8PIR.js';
3
+ import { F as FleetBus, T as TaskSpec } from '../agent-subagent-runner-Dksf0QVU.js';
4
+ export { a as AgentFactory, y as AgentFactoryResult, z as AgentRunnerOptions, E as BudgetExceededError, G as BudgetKind, H as BudgetLimits, I as BudgetNegotiationMode, J as BudgetThresholdDecision, K as BudgetThresholdHandler, L as BudgetThresholdSignal, N as BudgetUsage, Q as DECISION_TIMEOUT_MS, R as FleetEvent, U as FleetHandler, k as FleetUsage, l as FleetUsageAggregator, X as SubagentBudget, a1 as SubagentUsageSnapshot, a2 as TIMEOUT_PREEMPT_FRACTION, a4 as makeAgentSubagentRunner, a5 as withDisabledToolFiltering } from '../agent-subagent-runner-Dksf0QVU.js';
5
+ import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../events-CovDylaH.js';
6
+ export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../events-CovDylaH.js';
7
7
  import { b as Mailbox, c as MailboxSendInput, M as MailboxMessage, d as MailboxQuery, e as MailboxAckInput, f as MailboxAckBatchInput, a as MailboxAgentStatus, A as AgentRegistrationInput, g as AgentHeartbeatInput, P as PurgeOptions, j as PurgeResult, C as ClientRegistrationInput, h as ClientHeartbeatInput, i as ClientStatus } from '../mailbox-types-BGZWrYTJ.js';
8
8
  export { k as ClientSource, l as MailboxMessageType, m as MailboxTaskContext, R as ReadReceipts, n as RegisteredAgent, o as normalizeRecipient } from '../mailbox-types-BGZWrYTJ.js';
9
- import { b as AgentDefinition } from '../multi-agent-coordinator-IpHCuHUa.js';
10
- 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-IpHCuHUa.js';
11
- import { G as GlobalMailbox } from '../global-mailbox-CHM1QkCi.js';
12
- export { aA as resolveProjectDir } from '../global-mailbox-CHM1QkCi.js';
13
- import { d as Context, g as Tool } from '../tool-LVSLiE1s.js';
9
+ import { b as AgentDefinition } from '../multi-agent-coordinator-4DC31QWu.js';
10
+ 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-4DC31QWu.js';
14
11
  import { A as AgentEntry } from '../session-registry-Dvg7i_IA.js';
15
- import { J as FleetSupervisorConfig, A as AdaptiveConcurrencyConfig } from '../config-CN-vdDEI.js';
12
+ import { d as Context, g as Tool } from '../tool-LVSLiE1s.js';
13
+ import { J as FleetSupervisorConfig, a as ModelMatrixEntry, C as Config, A as AdaptiveConcurrencyConfig } from '../config-BCAEJicb.js';
14
+ import { G as GlobalMailbox } from '../global-mailbox-CNfgvRw3.js';
15
+ export { aA as resolveProjectDir } from '../global-mailbox-CNfgvRw3.js';
16
16
  import { L as Logger } from '../logger-B63L5bTg.js';
17
17
  import 'node:events';
18
- import '../director-state-BfeCUbmk.js';
19
- import '../index-C1E-_71T.js';
20
- import '../pipeline-E7_jqGyV.js';
18
+ import '../director-state-B_GPa78Q.js';
19
+ import '../worktree-manager-BBXdJq-Y.js';
20
+ import '../index-D5HB7WkV.js';
21
+ import '../pipeline-DM-CPTUs.js';
21
22
  import '../permission-B6YAtNFz.js';
22
23
  import '../observability-D-HZN_mF.js';
23
24
  import '../secret-scrubber-3MHDDAtm.js';
@@ -314,38 +315,6 @@ declare function resolveMailboxIdentity(ctx: Context, fallbackBase?: string): {
314
315
  };
315
316
  declare function makeMailboxTool(opts?: MailboxToolOptions): Tool;
316
317
 
317
- /**
318
- * mail-tools — thin, high-affordance wrappers over the project mailbox.
319
- *
320
- * These are the PREFERRED mailbox tools for agents. The multi-action `mailbox`
321
- * tool is the low-level power surface for advanced queries and agent status;
322
- * `mail_send` and `mail_inbox` exist because explicit verbs ("send a mail",
323
- * "read my inbox") are what makes agents USE the mailbox autonomously — a model
324
- * reaches for `mail_send` mid-task far more readily than for
325
- * `mailbox action=send ...`.
326
- *
327
- * mail_send — message one agent (`to: "leader@a1b2c3d4"`), every leader
328
- * (`to: "leader"`), or everyone (`to: "*"`)
329
- * mail_inbox — read unread mail (unique id + base alias + broadcasts),
330
- * marking it read so it isn't re-injected next iteration
331
- *
332
- * Both share the identity convention with the agent-loop checker
333
- * (`<base>@<sessionTag>`, see mailbox-attach) via `resolveMailboxIdentity`.
334
- *
335
- * @module mail-tools
336
- */
337
-
338
- interface MailToolsOptions {
339
- /** How to obtain a Mailbox given the execution Context (tests). */
340
- resolveMailbox?: MailboxResolver | undefined;
341
- /** Project dir for the shared mailbox. Prefer wpaths.projectDir. */
342
- projectDir?: string | undefined;
343
- /** EventBus for mailbox.agent_registered / heartbeat surface events. */
344
- events?: EventBus | undefined;
345
- }
346
- declare function makeMailSendTool(opts?: MailToolsOptions): Tool;
347
- declare function makeMailInboxTool(opts?: MailToolsOptions): Tool;
348
-
349
318
  /**
350
319
  * fleet-status-tool — read-only live peer snapshot for any agent.
351
320
  *
@@ -529,6 +498,38 @@ declare class FleetSupervisor {
529
498
  private engageIdleWithWork;
530
499
  }
531
500
 
501
+ /**
502
+ * mail-tools — thin, high-affordance wrappers over the project mailbox.
503
+ *
504
+ * These are the PREFERRED mailbox tools for agents. The multi-action `mailbox`
505
+ * tool is the low-level power surface for advanced queries and agent status;
506
+ * `mail_send` and `mail_inbox` exist because explicit verbs ("send a mail",
507
+ * "read my inbox") are what makes agents USE the mailbox autonomously — a model
508
+ * reaches for `mail_send` mid-task far more readily than for
509
+ * `mailbox action=send ...`.
510
+ *
511
+ * mail_send — message one agent (`to: "leader@a1b2c3d4"`), every leader
512
+ * (`to: "leader"`), or everyone (`to: "*"`)
513
+ * mail_inbox — read unread mail (unique id + base alias + broadcasts),
514
+ * marking it read so it isn't re-injected next iteration
515
+ *
516
+ * Both share the identity convention with the agent-loop checker
517
+ * (`<base>@<sessionTag>`, see mailbox-attach) via `resolveMailboxIdentity`.
518
+ *
519
+ * @module mail-tools
520
+ */
521
+
522
+ interface MailToolsOptions {
523
+ /** How to obtain a Mailbox given the execution Context (tests). */
524
+ resolveMailbox?: MailboxResolver | undefined;
525
+ /** Project dir for the shared mailbox. Prefer wpaths.projectDir. */
526
+ projectDir?: string | undefined;
527
+ /** EventBus for mailbox.agent_registered / heartbeat surface events. */
528
+ events?: EventBus | undefined;
529
+ }
530
+ declare function makeMailSendTool(opts?: MailToolsOptions): Tool;
531
+ declare function makeMailInboxTool(opts?: MailToolsOptions): Tool;
532
+
532
533
  /**
533
534
  * DefaultMailbox — append-only JSONL inter-agent mailbox (per-session).
534
535
  *
@@ -851,6 +852,104 @@ declare function createMailboxHooks(opts: MailboxHooksOptions): {
851
852
  reset(): void;
852
853
  };
853
854
 
855
+ /**
856
+ * Per-task model matrix resolution.
857
+ *
858
+ * The matrix (Config.modelMatrix) maps a catalog **role**, a **phase** name, or
859
+ * the `*` default to a {@link ModelMatrixEntry} (model + optional provider).
860
+ * At subagent spawn time we resolve the most specific match so different task
861
+ * types can run on different models — e.g. `security-scanner` on one model,
862
+ * `documentation` on another — while the leader keeps its own model.
863
+ *
864
+ * Resolution precedence (most → least specific):
865
+ * 1. exact role (matrix["security-scanner"])
866
+ * 2. the role's phase (matrix["review"])
867
+ * 3. the `*` default (matrix["*"])
868
+ * 4. undefined (caller falls back to the leader model)
869
+ *
870
+ * Set via the `/setmodel` slash command; this module is the single source of
871
+ * truth both that command and the spawn path use to validate + resolve keys.
872
+ */
873
+
874
+ /** All valid phase keys, in catalog order. */
875
+ declare const MATRIX_PHASE_KEYS: readonly string[];
876
+ /** The phase a catalog role belongs to, or undefined for unknown roles. */
877
+ declare function phaseForRole(role: string | undefined): string | undefined;
878
+ type ModelMatrixResolutionSource = 'role' | 'phase' | 'default';
879
+ interface ModelMatrixResolution {
880
+ entry: ModelMatrixEntry;
881
+ source: ModelMatrixResolutionSource;
882
+ key: string;
883
+ }
884
+ /**
885
+ * Resolve the matrix entry plus the key tier it came from. Use this when the
886
+ * caller needs to distinguish an explicit role/phase pin from the global `*`
887
+ * default.
888
+ */
889
+ declare function resolveModelMatrixResolution(matrix: Record<string, ModelMatrixEntry> | undefined, role: string | undefined): ModelMatrixResolution | undefined;
890
+ /**
891
+ * Resolve the matrix entry for a subagent role. Returns the most specific
892
+ * match (role → phase → `*`), or undefined when nothing matches.
893
+ */
894
+ declare function resolveModelMatrix(matrix: Record<string, ModelMatrixEntry> | undefined, role: string | undefined): ModelMatrixEntry | undefined;
895
+ interface ResolvedModelTarget {
896
+ provider?: string | undefined;
897
+ model?: string | undefined;
898
+ modelRuntime?: Config['modelRuntime'] | undefined;
899
+ fallbackModels?: string[] | undefined;
900
+ fallbackProfile?: string | undefined;
901
+ }
902
+ interface ResolvedSubagentModelTarget extends ResolvedModelTarget {
903
+ /** Where the concrete provider/model came from. */
904
+ source: 'matrix' | 'diversity' | 'none';
905
+ /** Matrix tier used before any reviewer diversity adjustment. */
906
+ matrixSource?: ModelMatrixResolutionSource | undefined;
907
+ /** True when a reviewer model was shifted away from the implementation model. */
908
+ diversified?: boolean | undefined;
909
+ }
910
+ /**
911
+ * Expand a matrix entry into a concrete primary model plus optional fallback
912
+ * chain. A profile-only matrix entry treats the first profile model as primary
913
+ * and the remaining profile entries as that subagent's fallback chain.
914
+ */
915
+ declare function resolveModelTargetFromEntry(config: Config, entry: ModelMatrixEntry | undefined): ResolvedModelTarget | undefined;
916
+ interface ModelReference {
917
+ provider?: string | undefined;
918
+ model?: string | undefined;
919
+ }
920
+ /**
921
+ * Roles whose output is meant to challenge an implementer. When these roles
922
+ * would otherwise use the same provider/model as the implementation path,
923
+ * WrongStack tries to pick a different available model to reduce correlated
924
+ * model-family mistakes. Exact role/phase `/setmodel` entries still win.
925
+ */
926
+ declare function roleNeedsIndependentReviewModel(role: string | undefined): boolean;
927
+ /**
928
+ * Resolve a subagent's matrix target with the reviewer diversity rule applied.
929
+ *
930
+ * Precedence:
931
+ * 1. Exact role or phase matrix entry.
932
+ * 2. Global `*` matrix entry when it is already different from the
933
+ * implementation model.
934
+ * 3. A different configured provider/model for review roles.
935
+ * 4. The matrix/leader fallback.
936
+ */
937
+ declare function resolveSubagentModelTarget(config: Config, role: string | undefined, opts?: {
938
+ implementationTarget?: ModelReference | undefined;
939
+ }): ResolvedSubagentModelTarget | undefined;
940
+ /**
941
+ * Resolve the default implementation lane. The generic Executor is the closest
942
+ * stable proxy for "the implementer" when a reviewer is spawned without a
943
+ * concrete sibling id.
944
+ */
945
+ declare function resolveImplementationModelTarget(config: Config): ModelReference;
946
+ declare function sameModelReference(a: ModelReference | undefined, b: ModelReference | undefined): boolean;
947
+ type MatrixKeyKind = 'role' | 'phase' | 'default' | 'unknown';
948
+ /** Classify a matrix key so `/setmodel` can reject typos before persisting. */
949
+ declare function matrixKeyKind(key: string): MatrixKeyKind;
950
+ /** True when `key` is a usable matrix key (role, phase, or `*`). */
951
+ declare function isValidMatrixKey(key: string): boolean;
952
+
854
953
  /**
855
954
  * package-author-tracker — Tracks which agent added which package to which manifest.
856
955
  *
@@ -2462,4 +2561,4 @@ declare class AutonomousCoordinator {
2462
2561
  private _emit;
2463
2562
  }
2464
2563
 
2465
- 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_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, 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, 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 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 RollbackResult, type RunOptions, type RunnablesHandler, 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, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, mailboxSessionTag, makeDependencyWatcherConfig, makeFleetStatusTool, makeMailInboxTool, makeMailSendTool, makeMailboxTool, readLiveLock, recordPackageAction, release, resolveMailboxIdentity, startPackageOutdatedWatcher, updatePackageOutdatedStatus, validateWatchdogOptions };
2564
+ 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_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, 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, 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, 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, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, isValidMatrixKey, mailboxSessionTag, makeDependencyWatcherConfig, makeFleetStatusTool, makeMailInboxTool, makeMailSendTool, makeMailboxTool, matrixKeyKind, phaseForRole, readLiveLock, recordPackageAction, release, resolveImplementationModelTarget, resolveMailboxIdentity, resolveModelMatrix, resolveModelMatrixResolution, resolveModelTargetFromEntry, resolveSubagentModelTarget, roleNeedsIndependentReviewModel, sameModelReference, startPackageOutdatedWatcher, updatePackageOutdatedStatus, validateWatchdogOptions };