@wrongstack/core 0.264.0 → 0.267.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 (90) hide show
  1. package/dist/{agent-bridge-D8sa1vtv.d.ts → agent-bridge-STJ3JwwK.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-c9DLkaas.d.ts → agent-subagent-runner-CzPGP3jA.d.ts} +131 -11
  3. package/dist/{brain-O1IdKPaK.d.ts → brain-Cdg77tVN.d.ts} +103 -2
  4. package/dist/{compactor-BBy0rCtB.d.ts → compactor-iMZ84CXq.d.ts} +19 -1
  5. package/dist/{config-Dz2F3H2K.d.ts → config-Du3pYYln.d.ts} +132 -13
  6. package/dist/{context-BGSpZNSE.d.ts → context-dT5Ueund.d.ts} +90 -12
  7. package/dist/coordination/index.d.ts +78 -22
  8. package/dist/coordination/index.js +695 -273
  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 +2327 -965
  13. package/dist/defaults/index.js.map +1 -1
  14. package/dist/execution/index.d.ts +16 -16
  15. package/dist/execution/index.js +1500 -371
  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-SulMTowG.d.ts} +33 -12
  22. package/dist/{goal-store-CxWmCGbH.d.ts → goal-store-CABDwdFE.d.ts} +1 -1
  23. package/dist/{index-CbLSI66_.d.ts → index-Bms0m4oy.d.ts} +5 -5
  24. package/dist/{index-CYIQrXVF.d.ts → index-DtCVWel4.d.ts} +8 -8
  25. package/dist/index-IEuxQd-E.d.ts +82 -0
  26. package/dist/index.d.ts +261 -57
  27. package/dist/index.js +4799 -2212
  28. package/dist/index.js.map +1 -1
  29. package/dist/infrastructure/index.d.ts +6 -6
  30. package/dist/infrastructure/index.js +84 -9
  31. package/dist/infrastructure/index.js.map +1 -1
  32. package/dist/kernel/index.d.ts +9 -9
  33. package/dist/kernel/index.js +1 -1
  34. package/dist/kernel/index.js.map +1 -1
  35. package/dist/{mcp-servers-DC4QRPUI.d.ts → mcp-servers-C2cBTxUR.d.ts} +3 -3
  36. package/dist/models/index.d.ts +5 -5
  37. package/dist/models/index.js +104 -31
  38. package/dist/models/index.js.map +1 -1
  39. package/dist/{models-registry-B_siPxqN.d.ts → models-registry-BqGZNJQ-.d.ts} +1 -1
  40. package/dist/{multi-agent-coordinator-CK5Jdj9K.d.ts → multi-agent-coordinator-B8R43uPz.d.ts} +1 -1
  41. package/dist/{null-fleet-bus-DgvD4SCO.d.ts → null-fleet-bus-CnXa5oTH.d.ts} +14 -9
  42. package/dist/observability/index.d.ts +2 -2
  43. package/dist/{parallel-eternal-engine-bK0JQBR_.d.ts → parallel-eternal-engine-DdNnw9BQ.d.ts} +11 -9
  44. package/dist/{path-resolver-BPEDlN38.d.ts → path-resolver-COIMLCQL.d.ts} +3 -3
  45. package/dist/{permission-4yvGmMRB.d.ts → permission-B75JAi3-.d.ts} +1 -1
  46. package/dist/{permission-policy-C6XpsBOy.d.ts → permission-policy-DlR9eJAM.d.ts} +2 -2
  47. package/dist/{pipeline-CXCeMz8J.d.ts → pipeline-BfD2k1rT.d.ts} +3 -3
  48. package/dist/{plan-templates-BvzRBkJc.d.ts → plan-templates-DSIKCXZN.d.ts} +32 -8
  49. package/dist/provider-model-resolve-BNRsNuJx.d.ts +107 -0
  50. package/dist/{provider-runner-C5aQpDWE.d.ts → provider-runner-CX7iIvox.d.ts} +3 -3
  51. package/dist/{retry-policy-CFhdtRzz.d.ts → retry-policy-BilV1ujH.d.ts} +1 -1
  52. package/dist/sdd/index.d.ts +8 -8
  53. package/dist/sdd/index.js +286 -105
  54. package/dist/sdd/index.js.map +1 -1
  55. package/dist/secret-vault-BAKpgFw_.d.ts +57 -0
  56. package/dist/{secret-vault-CxiVLbt1.d.ts → secret-vault-gkvEZZfE.d.ts} +43 -4
  57. package/dist/security/index.d.ts +6 -68
  58. package/dist/security/index.js +296 -95
  59. package/dist/security/index.js.map +1 -1
  60. package/dist/{selector-gIuhRTkN.d.ts → selector-Bc7eWtT3.d.ts} +1 -1
  61. package/dist/{session-event-bridge-DkvvrpDt.d.ts → session-event-bridge-D-araDEz.d.ts} +1 -1
  62. package/dist/{session-reader-KdfVwkKP.d.ts → session-reader-D7Dapswh.d.ts} +1 -1
  63. package/dist/storage/index.d.ts +112 -15
  64. package/dist/storage/index.js +491 -156
  65. package/dist/storage/index.js.map +1 -1
  66. package/dist/tools/index.d.ts +4 -2
  67. package/dist/tools/index.js.map +1 -1
  68. package/dist/types/index.d.ts +21 -21
  69. package/dist/types/index.js +1523 -450
  70. package/dist/types/index.js.map +1 -1
  71. package/dist/utils/index.d.ts +455 -407
  72. package/dist/utils/index.js +2191 -1203
  73. package/dist/utils/index.js.map +1 -1
  74. package/dist/{wstack-paths-CJjEwPXn.d.ts → wstack-paths-hOpNLmvf.d.ts} +2 -0
  75. package/package.json +1 -1
  76. package/skills/api-design/SKILL.md +1 -1
  77. package/skills/audit-log/SKILL.md +6 -6
  78. package/skills/bug-hunter/SKILL.md +5 -5
  79. package/skills/chimera/SKILL.md +4 -4
  80. package/skills/docker-deploy/SKILL.md +1 -1
  81. package/skills/git-flow/SKILL.md +3 -3
  82. package/skills/multi-agent/SKILL.md +3 -3
  83. package/skills/node-modern/SKILL.md +1 -0
  84. package/skills/observability/SKILL.md +2 -2
  85. package/skills/output-standards/SKILL.md +51 -28
  86. package/skills/refactor-planner/SKILL.md +3 -3
  87. package/skills/security-scanner/SKILL.md +4 -3
  88. package/skills/tech-stack/SKILL.md +1 -2
  89. package/dist/llm-selector-DzxuZnNz.d.ts +0 -58
  90. package/dist/secret-vault-BJDY28ev.d.ts +0 -25
@@ -309,6 +309,11 @@ type Permission = 'auto' | 'confirm' | 'deny';
309
309
  * - `destructive` — irreversible or broadside effects (recursive deletes, db drops, etc.)
310
310
  */
311
311
  type RiskTier = 'safe' | 'standard' | 'destructive';
312
+ /**
313
+ * Icon identifiers for tools — each UI (WebUI/TUI/REPL) maps these to its own icon library.
314
+ * Add the icon directly on each Tool so all UIs consume the same canonical value.
315
+ */
316
+ type ToolIconId = 'file' | 'edit' | 'search' | 'folder' | 'terminal' | 'web' | 'git' | 'tree' | 'code' | 'test' | 'package' | 'document' | 'scaffold' | 'todo' | 'plan' | 'task' | 'meta' | 'index' | 'json' | 'diff' | 'logs' | 'settings' | 'fallback';
312
317
  interface JSONSchema {
313
318
  type?: string | undefined;
314
319
  properties?: Record<string, JSONSchema>;
@@ -405,6 +410,12 @@ interface Tool<I = unknown, O = unknown> {
405
410
  * treated conservatively by guards.
406
411
  */
407
412
  capabilities?: readonly string[] | undefined;
413
+ /**
414
+ * Icon identifier for this tool — consumed by all UIs (WebUI/TUI/REPL) to
415
+ * render a tool-specific icon instead of a generic fallback.
416
+ * Each UI maps this id to its own icon library.
417
+ */
418
+ icon?: ToolIconId | undefined;
408
419
  execute(input: I, ctx: Context, opts: {
409
420
  signal: AbortSignal;
410
421
  }): Promise<O>;
@@ -764,6 +775,21 @@ type SessionEvent = {
764
775
  phase: string;
765
776
  saved: number;
766
777
  }>;
778
+ /** Context budget snapshot used to trigger this compaction. */
779
+ budget?: {
780
+ maxContext: number;
781
+ inputTokens: number;
782
+ availableInputTokens: number;
783
+ remainingInputTokens: number;
784
+ reservedOutputTokens: number;
785
+ reservedSafetyTokens: number;
786
+ load: number;
787
+ overflowTokens: number;
788
+ } | undefined;
789
+ /** Adaptive trigger signals observed alongside token pressure. */
790
+ signals?: {
791
+ repeatedReadCount?: number | undefined;
792
+ } | undefined;
767
793
  /**
768
794
  * Lossless digest of the range collapsed during this compaction (text
769
795
  * content preserved; raw tool I/O omitted). Captures *what* was collapsed
@@ -1104,6 +1130,54 @@ interface SessionWriter {
1104
1130
  clearInFlightMarker(reason: 'clean' | 'aborted' | 'recovered'): Promise<void>;
1105
1131
  }
1106
1132
 
1133
+ type ToolEvidenceStatus = 'seen' | 'referenced';
1134
+ interface ToolOutputMetadata {
1135
+ toolUseId: string;
1136
+ toolName: string;
1137
+ ok: boolean;
1138
+ inputSummary?: string | undefined;
1139
+ summary: string;
1140
+ files: string[];
1141
+ symbols: string[];
1142
+ commands: string[];
1143
+ errors: string[];
1144
+ status: ToolEvidenceStatus;
1145
+ referenceCount: number;
1146
+ seenAt: number;
1147
+ referencedAt?: number | undefined;
1148
+ outputBytes?: number | undefined;
1149
+ outputTokens?: number | undefined;
1150
+ outputLines?: number | undefined;
1151
+ }
1152
+ interface ContextFileEvidence {
1153
+ path: string;
1154
+ reads: number;
1155
+ writes: number;
1156
+ tools: string[];
1157
+ referenced: boolean;
1158
+ lastToolUseId?: string | undefined;
1159
+ }
1160
+ interface ContextIntentEvidence {
1161
+ text: string;
1162
+ updatedAt: number;
1163
+ }
1164
+ interface ContextRepeatedReadEvidence {
1165
+ file: string;
1166
+ count: number;
1167
+ lastToolUseId: string;
1168
+ }
1169
+ interface ContextEvidenceState {
1170
+ currentIntent?: ContextIntentEvidence | undefined;
1171
+ sessionGoals: string[];
1172
+ implicitFacts: string[];
1173
+ activeErrors: string[];
1174
+ toolCalls: ToolOutputMetadata[];
1175
+ fileGraph: Record<string, ContextFileEvidence>;
1176
+ repeatedReads: ContextRepeatedReadEvidence[];
1177
+ lastReadPath?: string | undefined;
1178
+ updatedAt: number;
1179
+ }
1180
+
1107
1181
  interface CacheStats {
1108
1182
  /** Tokens served from cache (cheaper). */
1109
1183
  readTokens: number;
@@ -1285,6 +1359,13 @@ interface ContextInit {
1285
1359
  projectRoot: string;
1286
1360
  /** Mutable working directory. Defaults to `cwd`. Must stay within `projectRoot`. */
1287
1361
  workingDir?: string | undefined;
1362
+ /**
1363
+ * When false, file tools and `setWorkingDir()` are confined to `projectRoot`.
1364
+ * Defaults to `false` (restrictive) when omitted so directly-constructed
1365
+ * contexts (tests, embedded callers) keep the safe behavior; the runtime
1366
+ * passes the config-derived value (default `true` — permissive) explicitly.
1367
+ */
1368
+ allowOutsideProjectRoot?: boolean | undefined;
1288
1369
  model: string;
1289
1370
  tools?: Tool[] | undefined;
1290
1371
  /** Agent id performing this run (e.g. 'leader', 'executor', 'tech-stack'). */
@@ -1299,12 +1380,6 @@ interface ContextInit {
1299
1380
  * `session.traceId` automatically.
1300
1381
  */
1301
1382
  traceId?: string | undefined;
1302
- /**
1303
- * Allow tools to read/write paths outside the project root directory.
1304
- * When true, tools can access any path on the filesystem.
1305
- * When false or undefined, tools are restricted to the project root.
1306
- */
1307
- allowOutsideProjectRoot?: boolean | undefined;
1308
1383
  }
1309
1384
  /**
1310
1385
  * L1-A: `Context` is the live agent-run object. Its read-only environment
@@ -1328,6 +1403,7 @@ declare class Context implements RunEnv {
1328
1403
  todos: TodoItem[];
1329
1404
  readFiles: Set<string>;
1330
1405
  fileMtimes: Map<string, number>;
1406
+ contextEvidence: ContextEvidenceState;
1331
1407
  systemPrompt: TextBlock[];
1332
1408
  provider: Provider;
1333
1409
  session: SessionWriter;
@@ -1337,6 +1413,13 @@ declare class Context implements RunEnv {
1337
1413
  projectRoot: string;
1338
1414
  /** Mutable working directory — starts as `cwd`. Change via `setWorkingDir()`. */
1339
1415
  workingDir: string;
1416
+ /**
1417
+ * When true, file tools (via `_util.ts`) and `setWorkingDir()` reject paths
1418
+ * outside `projectRoot`. When false, those boundary checks are bypassed so
1419
+ * tools may reach paths outside the project (still gated by permission
1420
+ * tiers). Mutable so `/settings` can toggle it live on the running session.
1421
+ */
1422
+ allowOutsideProjectRoot: boolean;
1340
1423
  model: string;
1341
1424
  tools: Tool[];
1342
1425
  meta: Record<string, unknown>;
@@ -1350,11 +1433,6 @@ declare class Context implements RunEnv {
1350
1433
  * so storage operations can include it in `storage.*` events.
1351
1434
  */
1352
1435
  traceId: string | undefined;
1353
- /**
1354
- * When true, tools can access any path on the filesystem.
1355
- * When false or undefined, tools are restricted to the project root.
1356
- */
1357
- allowOutsideProjectRoot: boolean;
1358
1436
  /** Callbacks fired when `setWorkingDir()` changes the working directory. */
1359
1437
  private _onWorkingDirChanged;
1360
1438
  /**
@@ -1425,4 +1503,4 @@ declare class Context implements RunEnv {
1425
1503
  usage(): Usage;
1426
1504
  }
1427
1505
 
1428
- export { ToolError as $, AgentError as A, type MessageRole as B, Context as C, PluginError as D, ERROR_CODES as E, type FileSnapshot as F, type ProviderErrorBody as G, type ReadonlyConversationState as H, type ImageBlock as I, type JSONSchema as J, type RiskTier as K, type RunEnv as L, type Message as M, SddError as N, SessionError as O, type Provider as P, type StateChange as Q, type Request as R, type SessionEvent as S, type Tool as T, type Usage as U, type StateChangeHandler as V, type StopReason as W, type StreamEvent as X, StreamHangError as Y, type ThinkingBlock as Z, type ToolCallContext as _, type SessionWriter as a, type ToolFinalEvent as a0, type ToolStreamEvent as a1, WrongStackError as a2, asBlocks as a3, asText as a4, extractRunEnv as a5, isAgentError as a6, isConfigError as a7, isFsError as a8, isImageBlock as a9, isPluginError as aa, isSddError as ab, isSessionError as ac, isTextBlock as ad, isThinkingBlock as ae, isToolError as af, isToolResultBlock as ag, isToolUseBlock as ah, isWrongStackError as ai, toWrongStackError as aj, wrapAsState as ak, type Response as b, type TokenCounter as c, type CacheStats as d, ProviderError as e, type Permission as f, type ContentBlock as g, type SessionMetadata as h, type SessionStore as i, type ToolProgressEvent as j, type Capabilities as k, type ToolUseBlock as l, type ToolResultBlock as m, type TextBlock as n, type RunOptions as o, type ResumedSession as p, type SessionData as q, type SessionSummary as r, type TodoItem as s, ConversationState as t, ConfigError as u, type ContextInit as v, type ErrorCode as w, type ErrorSeverity as x, type ErrorSubsystem as y, FsError as z };
1506
+ export { type StopReason as $, AgentError as A, type ContextRepeatedReadEvidence as B, Context as C, type ErrorCode as D, ERROR_CODES as E, type ErrorSeverity as F, type ErrorSubsystem as G, type FileSnapshot as H, FsError as I, type JSONSchema as J, type ImageBlock as K, type MessageRole as L, type Message as M, PluginError as N, type ProviderErrorBody as O, type Provider as P, type ReadonlyConversationState as Q, type Request as R, type SessionEvent as S, type Tool as T, type Usage as U, type RiskTier as V, type RunEnv as W, SddError as X, SessionError as Y, type StateChange as Z, type StateChangeHandler as _, type SessionWriter as a, type StreamEvent as a0, StreamHangError as a1, type ThinkingBlock as a2, type ToolCallContext as a3, ToolError as a4, type ToolEvidenceStatus as a5, type ToolFinalEvent as a6, type ToolIconId as a7, type ToolStreamEvent as a8, WrongStackError as a9, asBlocks as aa, asText as ab, extractRunEnv as ac, isAgentError as ad, isConfigError as ae, isFsError as af, isImageBlock as ag, isPluginError as ah, isSddError as ai, isSessionError as aj, isTextBlock as ak, isThinkingBlock as al, isToolError as am, isToolResultBlock as an, isToolUseBlock as ao, isWrongStackError as ap, toWrongStackError as aq, wrapAsState as ar, type Response as b, type TokenCounter as c, type CacheStats as d, ProviderError as e, type Permission as f, type ContentBlock as g, type SessionMetadata as h, type SessionStore as i, type ToolProgressEvent as j, type ToolOutputMetadata as k, type Capabilities as l, type ToolUseBlock as m, type ToolResultBlock as n, type TextBlock as o, type RunOptions as p, type ResumedSession as q, type SessionData as r, type SessionSummary as s, type TodoItem as t, ConversationState as u, ConfigError as v, type ContextEvidenceState as w, type ContextFileEvidence as x, type ContextInit as y, type ContextIntentEvidence as z };
@@ -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-Cdg77tVN.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-Cdg77tVN.js';
3
+ import { H as FleetManager, s as Director } from '../null-fleet-bus-CnXa5oTH.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-CnXa5oTH.js';
5
+ import { b as AgentDefinition } from '../multi-agent-coordinator-B8R43uPz.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-B8R43uPz.js';
7
+ import { F as FleetBus } from '../agent-subagent-runner-CzPGP3jA.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-CzPGP3jA.js';
9
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-STJ3JwwK.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-BfD2k1rT.js';
11
+ export { i as MailboxMessageType, l as MailboxTaskContext, o as ReadReceipts, p as RegisteredAgent, r as normalizeRecipient } from '../pipeline-BfD2k1rT.js';
12
+ import { C as Context, T as Tool } from '../context-dT5Ueund.js';
13
13
  import 'node:events';
14
- import '../director-state-BfeCUbmk.js';
15
- import '../config-Dz2F3H2K.js';
16
- import '../index-CbLSI66_.js';
17
14
  import '../logger-B63L5bTg.js';
15
+ import '../director-state-BfeCUbmk.js';
16
+ import '../config-Du3pYYln.js';
17
+ import '../index-Bms0m4oy.js';
18
18
  import '../observability-D-HZN_mF.js';
19
- import '../permission-4yvGmMRB.js';
20
- import '../retry-policy-CFhdtRzz.js';
19
+ import '../permission-B75JAi3-.js';
20
+ import '../retry-policy-BilV1ujH.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 };