@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 { P as Provider, M as Message } from '../context-CLz3z_E8.js';
1
+ import { P as Provider, M as Message } from '../context-CGdgA0q6.js';
2
2
 
3
3
  /**
4
4
  * Prompt refinement ("did you mean this?").
@@ -1,8 +1,8 @@
1
- export { i as AfterIterationHook, j as AfterRunHook, k as AfterToolExecutionHook, l as AgentExtension, B as BeforeIterationHook, m as BeforeRunHook, n as BeforeToolExecutionHook, E as ExtensionRegistry, O as OnErrorHook, v as ProviderRunnerFn, t as ProviderRunnerWrapper } from '../index-Csoc_bKs.js';
2
- import '../context-CLz3z_E8.js';
1
+ export { i as AfterIterationHook, j as AfterRunHook, k as AfterToolExecutionHook, l as AgentExtension, B as BeforeIterationHook, m as BeforeRunHook, n as BeforeToolExecutionHook, E as ExtensionRegistry, O as OnErrorHook, v as ProviderRunnerFn, t as ProviderRunnerWrapper } from '../index-CitPrI3a.js';
2
+ import '../context-CGdgA0q6.js';
3
3
  import '../logger-B63L5bTg.js';
4
- import '../pipeline-Bxa3wDcy.js';
5
- import '../config-eSsrto5d.js';
4
+ import '../pipeline-JG8XoudC.js';
5
+ import '../config-DuAu23zm.js';
6
6
  import '../observability-D-HZN_mF.js';
7
- import '../brain-BaQsRNka.js';
8
- import '../permission-DbWPbuoA.js';
7
+ import '../brain-TjEEwSpw.js';
8
+ import '../permission-CwBBpCoF.js';
@@ -1,14 +1,14 @@
1
- import { S as SkillLoader, a as SkillManifest, b as SkillEntry } from './skill-Bj6Ezqb8.js';
1
+ import { S as SkillLoader, a as SkillManifest, b as SkillEntry } from './skill-DGIXCtdv.js';
2
2
  import { W as WstackPaths } from './wstack-paths-CJjEwPXn.js';
3
- import { P as Provider, C as Context } from './context-CLz3z_E8.js';
4
- import { C as Compactor, a as CompactReport } from './compactor-BRfg3QPd.js';
5
- import { M as MessageSelector } from './selector-Cb4_9-hf.js';
6
- import { E as EventBus } from './brain-BaQsRNka.js';
7
- import { M as MiddlewareHandler } from './pipeline-Bxa3wDcy.js';
8
- import { S as SessionEventBridge } from './session-event-bridge-BhtkkFFy.js';
9
- import { C as ContextWindowAggressiveOn, g as ContextWindowPolicy } from './config-eSsrto5d.js';
10
- import { g as Agent, D as DoneCondition } from './agent-subagent-runner-DhYLgAJo.js';
11
- import { R as RunResult, S as SystemPromptContributor } from './index-Csoc_bKs.js';
3
+ import { P as Provider, C as Context } from './context-CGdgA0q6.js';
4
+ import { C as Compactor, a as CompactReport } from './compactor-C5sT4U7I.js';
5
+ import { M as MessageSelector } from './selector-DWsqVjGf.js';
6
+ import { E as EventBus } from './brain-TjEEwSpw.js';
7
+ import { M as MiddlewareHandler } from './pipeline-JG8XoudC.js';
8
+ import { S as SessionEventBridge } from './session-event-bridge-BAFWdgQ3.js';
9
+ import { C as ContextWindowAggressiveOn, g as ContextWindowPolicy } from './config-DuAu23zm.js';
10
+ import { g as Agent, D as DoneCondition } from './agent-subagent-runner-US741uBH.js';
11
+ import { R as RunResult, S as SystemPromptContributor } from './index-CitPrI3a.js';
12
12
 
13
13
  interface SkillLoaderOptions {
14
14
  paths: WstackPaths;
@@ -31,6 +31,7 @@ declare class DefaultSkillLoader implements SkillLoader {
31
31
  listEntries(): Promise<SkillEntry[]>;
32
32
  invalidateCache(): void;
33
33
  readBody(name: string): Promise<string>;
34
+ readSaveBody(name: string): Promise<string>;
34
35
  }
35
36
 
36
37
  /**
@@ -292,6 +293,16 @@ declare class AutoCompactionMiddleware {
292
293
  * denominator when the active model changes. */
293
294
  setMaxContext(maxContext: number): void;
294
295
  handler(): MiddlewareHandler<Context>;
296
+ /**
297
+ * H1: try to read a pre-computed token total from `ctx.lastRequestTokens`
298
+ * (set by the agent loop's pre-flight or its restash in emitContextPct).
299
+ * Returns the uncalibrated total when the stash is valid for the current
300
+ * context shape (positive number, and the message count it was computed
301
+ * at matches the current one — otherwise tool results have been appended
302
+ * since and the value is stale). Returns null when missing or stale so
303
+ * the caller falls back to a fresh walk.
304
+ */
305
+ private tryStashedTokens;
295
306
  /**
296
307
  * Returns true when the previous compaction at the same or higher pressure
297
308
  * level reduced nothing and context has not grown materially since. Prevents
@@ -1,16 +1,16 @@
1
- import { T as Token, a as Renderer, S as SystemPromptBuilder, H as HookRegistry } from './pipeline-Bxa3wDcy.js';
2
- import { E as EventBus, l as MemoryStore, B as BrainArbiter } from './brain-BaQsRNka.js';
3
- import { C as Compactor } from './compactor-BRfg3QPd.js';
4
- import { j as ConfigLoader, i as ConfigStore, M as ModelsRegistry } from './config-eSsrto5d.js';
5
- import { E as ErrorHandler, R as RetryPolicy } from './retry-policy-BVnkbMET.js';
1
+ import { T as Token, a as Renderer, S as SystemPromptBuilder, H as HookRegistry } from './pipeline-JG8XoudC.js';
2
+ import { E as EventBus, l as MemoryStore, B as BrainArbiter } from './brain-TjEEwSpw.js';
3
+ import { C as Compactor } from './compactor-C5sT4U7I.js';
4
+ import { j as ConfigLoader, i as ConfigStore, M as ModelsRegistry } from './config-DuAu23zm.js';
5
+ import { E as ErrorHandler, R as RetryPolicy } from './retry-policy-Tg7LXkoK.js';
6
6
  import { I as InputReader } from './input-reader-E-ffP2ee.js';
7
7
  import { L as Logger } from './logger-B63L5bTg.js';
8
8
  import { M as ModeStore } from './mode-CZlO9iU1.js';
9
9
  import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
10
- import { P as PermissionPolicy, S as SecretScrubber } from './permission-DbWPbuoA.js';
11
- import { P as ProviderRunner } from './provider-runner-C8_e4Lo1.js';
12
- import { c as TokenCounter, i as SessionStore } from './context-CLz3z_E8.js';
13
- import { S as SkillLoader } from './skill-Bj6Ezqb8.js';
10
+ import { P as PermissionPolicy, S as SecretScrubber } from './permission-CwBBpCoF.js';
11
+ import { P as ProviderRunner } from './provider-runner-hM7EXlLI.js';
12
+ import { c as TokenCounter, i as SessionStore } from './context-CGdgA0q6.js';
13
+ import { S as SkillLoader } from './skill-DGIXCtdv.js';
14
14
 
15
15
  /**
16
16
  * Lifecycle of a single worktree handle.
@@ -1,10 +1,10 @@
1
- import { n as TextBlock, T as Tool, l as ToolUseBlock, C as Context, m as ToolResultBlock, R as Request, b as Response, P as Provider, g as ContentBlock, a2 as WrongStackError } from './context-CLz3z_E8.js';
1
+ import { n as TextBlock, T as Tool, l as ToolUseBlock, C as Context, m as ToolResultBlock, R as Request, b as Response, P as Provider, g as ContentBlock, a2 as WrongStackError } from './context-CGdgA0q6.js';
2
2
  import { L as Logger } from './logger-B63L5bTg.js';
3
- import { B as BuildContext, H as HookRegistry, a as Renderer, P as Pipeline, C as Container } from './pipeline-Bxa3wDcy.js';
4
- import { H as HookEvent, W as WireFamily, P as ProviderConfig } from './config-eSsrto5d.js';
3
+ import { B as BuildContext, H as HookRegistry, a as Renderer, P as Pipeline, C as Container } from './pipeline-JG8XoudC.js';
4
+ import { H as HookEvent, W as WireFamily, P as ProviderConfig } from './config-DuAu23zm.js';
5
5
  import { T as Tracer } from './observability-D-HZN_mF.js';
6
- import { E as EventBus } from './brain-BaQsRNka.js';
7
- import { P as PermissionPolicy, S as SecretScrubber } from './permission-DbWPbuoA.js';
6
+ import { E as EventBus } from './brain-TjEEwSpw.js';
7
+ import { P as PermissionPolicy, S as SecretScrubber } from './permission-CwBBpCoF.js';
8
8
 
9
9
  /**
10
10
  * A contributor that injects additional TextBlocks into the system prompt.
@@ -48,6 +48,11 @@ type SystemPromptContributor = (ctx: BuildContext) => Promise<TextBlock[]>;
48
48
  type ToolWrapper = (tool: Tool) => Tool;
49
49
  declare class ToolRegistry {
50
50
  private readonly tools;
51
+ /** Monotonic version bumped on every registry mutation. */
52
+ private _version;
53
+ /** Cached `list()` result, frozen after build. Invalidated on _version change. */
54
+ private _listSnapshot;
55
+ private _listSnapshotVersion;
51
56
  /** Pre-compute tool definition token estimate once at registration time. */
52
57
  private _stampDefTokens;
53
58
  register(tool: Tool, owner?: string): void;
@@ -259,8 +264,16 @@ interface ToolExecutorLike {
259
264
  /**
260
265
  * Execute a single tool with timeout and output capping.
261
266
  * Used by the agent when it needs to run one tool at a time.
262
- */
263
- executeTool(tool: Tool, use: ToolUseBlock, ctx: Context, budget: number): Promise<ToolResultBlock>;
267
+ *
268
+ * Returns the rendered `ToolResultBlock` plus the exact byte count it
269
+ * consumed against the iteration output cap. The caller subtracts
270
+ * `bytes` from the running budget — no second `Buffer.byteLength`
271
+ * walk, and no `JSON.stringify` fallback for structured results.
272
+ */
273
+ executeTool(tool: Tool, use: ToolUseBlock, ctx: Context, budget: number): Promise<{
274
+ block: ToolResultBlock;
275
+ bytes: number;
276
+ }>;
264
277
  }
265
278
 
266
279
  /**
package/dist/index.d.ts CHANGED
@@ -1,44 +1,44 @@
1
- import { S as SystemPromptBuilder, q as ModelCapabilities, B as BuildContext, C as Container, H as HookRegistry, b as Mailbox, d as MailboxMessage, a as Renderer } from './pipeline-Bxa3wDcy.js';
2
- export { h as AgentHeartbeatInput, A as AgentRegistrationInput, r as BindOptions, D as Decorator, F as Factory, f as MailboxAckInput, g as MailboxAgentStatus, l as MailboxMessageType, e as MailboxQuery, c as MailboxSendInput, m as MailboxTaskContext, s as Middleware, M as MiddlewareHandler, N as NextFn, P as Pipeline, t as PipelineOptions, n as ReadReceipts, o as RegisteredAgent, T as Token, u as hookMatcherMatches, p as normalizeRecipient } from './pipeline-Bxa3wDcy.js';
3
- import { E as EventBus, l as MemoryStore, a as EventName, L as Listener, B as BrainArbiter } from './brain-BaQsRNka.js';
4
- export { 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, n as EventLogger, o as EventMap, H as HumanEscalatingBrainArbiter, p as MEMORY_TYPE_LABELS, q as MemoryClearedPayload, r as MemoryConsolidatedPayload, k as MemoryEntry, s as MemoryForgottenPayload, t as MemoryPriority, m as MemoryRelevanceContext, u as MemoryRememberedPayload, M as MemoryScope, v as MemoryType, O as ObservableBrainArbiter, w as ScopedEventBus, S as ScoredEntry, j as formatHumanPrompt } from './brain-BaQsRNka.js';
5
- import { W as WorktreeManager } from './index-BilZMsOK.js';
6
- export { A as AllocateOpts, M as MergeOpts, a as MergeResult, R as RunController, b as RunControllerOptions, T as TOKENS, c as WorktreeHandle, d as WorktreeManagerOptions, e as WorktreeRunResult, f as WorktreeStatus, g as assertSafePath } from './index-BilZMsOK.js';
7
- import { C as Context, P as Provider, T as Tool, R as Request, b as Response, M as Message, g as ContentBlock, n as TextBlock } from './context-CLz3z_E8.js';
8
- export { A as AgentError, d as CacheStats, k as Capabilities, u as ConfigError, v as ContextInit, t as ConversationState, E as ERROR_CODES, w as ErrorCode, x as ErrorSeverity, y as ErrorSubsystem, F as FileSnapshot, z as FsError, I as ImageBlock, J as JSONSchema, B as MessageRole, f as Permission, D as PluginError, e as ProviderError, G as ProviderErrorBody, H as ReadonlyConversationState, p as ResumedSession, K as RiskTier, L as RunEnv, o as RunOptions, N as SddError, q as SessionData, O as SessionError, S as SessionEvent, h as SessionMetadata, i as SessionStore, r as SessionSummary, a as SessionWriter, Q as StateChange, V as StateChangeHandler, W as StopReason, X as StreamEvent, Y as StreamHangError, Z as ThinkingBlock, s as TodoItem, c as TokenCounter, _ as ToolCallContext, $ as ToolError, a0 as ToolFinalEvent, j as ToolProgressEvent, m as ToolResultBlock, a1 as ToolStreamEvent, l as ToolUseBlock, U as Usage, a2 as WrongStackError, a3 as asBlocks, a4 as asText, a5 as extractRunEnv, a6 as isAgentError, a7 as isConfigError, a8 as isFsError, a9 as isImageBlock, aa as isPluginError, ab as isSddError, ac as isSessionError, ad as isTextBlock, ae as isThinkingBlock, af as isToolError, ag as isToolResultBlock, ah as isToolUseBlock, ai as isWrongStackError, aj as toWrongStackError, ak as wrapAsState } from './context-CLz3z_E8.js';
9
- import { P as ProviderRunner, R as RunProviderOptions$1 } from './provider-runner-C8_e4Lo1.js';
10
- import { c as MCPServerConfig, h as Config, l as HookInput, m as HookOutcome, H as HookEvent, e as HookMatcher, I as InProcessHook, d as ModelMatrixEntry, i as ConfigStore } from './config-eSsrto5d.js';
11
- export { A as AutonomyConfig, n as CONTEXT_WINDOW_MODES, j as ConfigLoader, o as ContextConfig, C as ContextWindowAggressiveOn, p as ContextWindowConfigLike, q as ContextWindowMode, r as ContextWindowModeId, g as ContextWindowPolicy, s as ContextWindowThresholds, t as CustomModelDefinition, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, f as HookEntry, u as IndexingConfig, L as LaunchConfig, v as LogConfig, w as ModelsDevModel, a as ModelsDevPayload, x as ModelsDevProvider, M as ModelsRegistry, y as PluginConfig, z as ProviderApiKey, P as ProviderConfig, b as ResolvedModel, R as ResolvedProvider, B as SessionLoggingConfig, S as ShellHook, E as SyncCategory, k as SyncConfig, T as ToolsConfig, W as WireFamily, G as formatContextWindowModeList, J as getContextWindowMode, K as isContextWindowModeId, N as listContextWindowModes, O as resolveContextWindowPolicy } from './config-eSsrto5d.js';
12
- export { a as CompactReport, C as Compactor } from './compactor-BRfg3QPd.js';
13
- import { P as PermissionPolicy } from './permission-DbWPbuoA.js';
14
- export { a as PermissionDecision, S as SecretScrubber, T as TrustPolicy } from './permission-DbWPbuoA.js';
1
+ import { S as SystemPromptBuilder, q as ModelCapabilities, B as BuildContext, C as Container, H as HookRegistry, b as Mailbox, d as MailboxMessage, a as Renderer } from './pipeline-JG8XoudC.js';
2
+ export { h as AgentHeartbeatInput, A as AgentRegistrationInput, r as BindOptions, D as Decorator, F as Factory, f as MailboxAckInput, g as MailboxAgentStatus, l as MailboxMessageType, e as MailboxQuery, c as MailboxSendInput, m as MailboxTaskContext, s as Middleware, M as MiddlewareHandler, N as NextFn, P as Pipeline, t as PipelineOptions, n as ReadReceipts, o as RegisteredAgent, T as Token, u as hookMatcherMatches, p as normalizeRecipient } from './pipeline-JG8XoudC.js';
3
+ import { E as EventBus, l as MemoryStore, a as EventName, L as Listener, B as BrainArbiter } from './brain-TjEEwSpw.js';
4
+ export { 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, n as EventLogger, o as EventMap, H as HumanEscalatingBrainArbiter, p as MEMORY_TYPE_LABELS, q as MemoryClearedPayload, r as MemoryConsolidatedPayload, k as MemoryEntry, s as MemoryForgottenPayload, t as MemoryPriority, m as MemoryRelevanceContext, u as MemoryRememberedPayload, M as MemoryScope, v as MemoryType, O as ObservableBrainArbiter, w as ScopedEventBus, S as ScoredEntry, j as formatHumanPrompt } from './brain-TjEEwSpw.js';
5
+ import { W as WorktreeManager } from './index-CC0Mcm05.js';
6
+ export { A as AllocateOpts, M as MergeOpts, a as MergeResult, R as RunController, b as RunControllerOptions, T as TOKENS, c as WorktreeHandle, d as WorktreeManagerOptions, e as WorktreeRunResult, f as WorktreeStatus, g as assertSafePath } from './index-CC0Mcm05.js';
7
+ import { C as Context, P as Provider, T as Tool, R as Request, b as Response, M as Message, g as ContentBlock, n as TextBlock } from './context-CGdgA0q6.js';
8
+ export { A as AgentError, d as CacheStats, k as Capabilities, u as ConfigError, v as ContextInit, t as ConversationState, E as ERROR_CODES, w as ErrorCode, x as ErrorSeverity, y as ErrorSubsystem, F as FileSnapshot, z as FsError, I as ImageBlock, J as JSONSchema, B as MessageRole, f as Permission, D as PluginError, e as ProviderError, G as ProviderErrorBody, H as ReadonlyConversationState, p as ResumedSession, K as RiskTier, L as RunEnv, o as RunOptions, N as SddError, q as SessionData, O as SessionError, S as SessionEvent, h as SessionMetadata, i as SessionStore, r as SessionSummary, a as SessionWriter, Q as StateChange, V as StateChangeHandler, W as StopReason, X as StreamEvent, Y as StreamHangError, Z as ThinkingBlock, s as TodoItem, c as TokenCounter, _ as ToolCallContext, $ as ToolError, a0 as ToolFinalEvent, j as ToolProgressEvent, m as ToolResultBlock, a1 as ToolStreamEvent, l as ToolUseBlock, U as Usage, a2 as WrongStackError, a3 as asBlocks, a4 as asText, a5 as extractRunEnv, a6 as isAgentError, a7 as isConfigError, a8 as isFsError, a9 as isImageBlock, aa as isPluginError, ab as isSddError, ac as isSessionError, ad as isTextBlock, ae as isThinkingBlock, af as isToolError, ag as isToolResultBlock, ah as isToolUseBlock, ai as isWrongStackError, aj as toWrongStackError, ak as wrapAsState } from './context-CGdgA0q6.js';
9
+ import { P as ProviderRunner, R as RunProviderOptions$1 } from './provider-runner-hM7EXlLI.js';
10
+ import { c as MCPServerConfig, h as Config, l as HookInput, m as HookOutcome, H as HookEvent, e as HookMatcher, I as InProcessHook, d as ModelMatrixEntry, i as ConfigStore } from './config-DuAu23zm.js';
11
+ export { A as AutonomyConfig, n as CONTEXT_WINDOW_MODES, j as ConfigLoader, o as ContextConfig, C as ContextWindowAggressiveOn, p as ContextWindowConfigLike, q as ContextWindowMode, r as ContextWindowModeId, g as ContextWindowPolicy, s as ContextWindowThresholds, t as CustomModelDefinition, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, f as HookEntry, u as IndexingConfig, L as LaunchConfig, v as LogConfig, w as ModelsDevModel, a as ModelsDevPayload, x as ModelsDevProvider, M as ModelsRegistry, y as PluginConfig, z as ProviderApiKey, P as ProviderConfig, b as ResolvedModel, R as ResolvedProvider, B as SessionLoggingConfig, S as ShellHook, E as SyncCategory, k as SyncConfig, T as ToolsConfig, W as WireFamily, G as formatContextWindowModeList, J as getContextWindowMode, K as isContextWindowModeId, N as listContextWindowModes, O as resolveContextWindowPolicy } from './config-DuAu23zm.js';
12
+ export { a as CompactReport, C as Compactor } from './compactor-C5sT4U7I.js';
13
+ import { P as PermissionPolicy } from './permission-CwBBpCoF.js';
14
+ export { a as PermissionDecision, S as SecretScrubber, T as TrustPolicy } from './permission-CwBBpCoF.js';
15
15
  export { C as CheckpointInfo, R as RewindResult, a as RewindResultExtended, S as SessionRewinder } from './session-rewinder-C9HnMkhP.js';
16
- import { A as AttachmentStore, b as AttachmentRef, a as AddAttachmentInput } from './session-reader-CCOssnBS.js';
17
- export { c as Attachment, d as AttachmentKind, e as AttachmentMeta, D as DefaultSessionReader, f as DefaultSessionReaderOptions, S as SessionReader } from './session-reader-CCOssnBS.js';
16
+ import { A as AttachmentStore, b as AttachmentRef, a as AddAttachmentInput } from './session-reader-CqRvaL5v.js';
17
+ export { c as Attachment, d as AttachmentKind, e as AttachmentMeta, D as DefaultSessionReader, f as DefaultSessionReaderOptions, S as SessionReader } from './session-reader-CqRvaL5v.js';
18
18
  export { D as DEFAULT_AUTONOMY_CONFIG, a as DEFAULT_CONTEXT_CONFIG, b as DEFAULT_SESSION_LOGGING_CONFIG, c as DEFAULT_SESSION_PRUNE_DAYS, d as DEFAULT_TOOLS_CONFIG } from './default-config-CXsDvOmP.js';
19
- import { a as DefaultSecretVault } from './secret-vault-CeVNiy_f.js';
20
- export { D as DefaultSecretScrubber, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, i as isSecretField, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from './secret-vault-CeVNiy_f.js';
19
+ import { a as DefaultSecretVault } from './secret-vault-BkYkJWQs.js';
20
+ export { D as DefaultSecretScrubber, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, i as isSecretField, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from './secret-vault-BkYkJWQs.js';
21
21
  import { D as DefaultLogger } from './logger-DmmQhf4P.js';
22
22
  export { a as DefaultLoggerOptions, L as LogFormat, n as noOpLogger } from './logger-DmmQhf4P.js';
23
- import { D as DefaultPathResolver } from './path-resolver-B7VjhUHq.js';
24
- export { a as DefaultTokenCounter } from './path-resolver-B7VjhUHq.js';
25
- export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, R as RecoveryStrategy, T as ToolExecutor, h as buildRecoveryStrategies } from './parallel-eternal-engine-CAMabk-X.js';
26
- import { S as SkillLoader } from './skill-Bj6Ezqb8.js';
27
- export { b as SkillEntry, a as SkillManifest } from './skill-Bj6Ezqb8.js';
23
+ import { D as DefaultPathResolver } from './path-resolver-CbkT-RMU.js';
24
+ export { a as DefaultTokenCounter } from './path-resolver-CbkT-RMU.js';
25
+ export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, R as RecoveryStrategy, T as ToolExecutor, h as buildRecoveryStrategies } from './parallel-eternal-engine-C0juOszP.js';
26
+ import { S as SkillLoader } from './skill-DGIXCtdv.js';
27
+ export { b as SkillEntry, a as SkillManifest } from './skill-DGIXCtdv.js';
28
28
  export { I as InputReader, P as PromptOption } from './input-reader-E-ffP2ee.js';
29
- import { z as SlashCommand, P as PluginAPI, E as PluginPipelines, G as ToolRegistryView, H as ProviderRegistryView, I as MCPRegistryView, J as SlashCommandRegistryView, K as SessionWriterView, L as MetricsSinkView, N as Plugin } from './agent-subagent-runner-DhYLgAJo.js';
30
- export { g as Agent, h as AgentFactory, i as AgentFactoryResult, j as AgentRunnerOptions, k as BudgetExceededError, l as BudgetKind, m as BudgetLimits, r as BudgetUsage, O as CoordinatorEvents, C as CoordinatorStatus, D as DoneCondition, F as FleetBus, s as FleetEvent, t as FleetHandler, u as FleetUsage, v as FleetUsageAggregator, c as MultiAgentConfig, M as MultiAgentCoordinator, Q as PluginCapabilities, R as PluginDependency, e as SpawnResult, w as SubagentBudget, S as SubagentConfig, U as SubagentContext, V as SubagentError, W as SubagentErrorKind, X as SubagentRunContext, Y as SubagentRunOutcome, d as SubagentRunner, x as SubagentUsageSnapshot, Z as TaskDelegation, f as TaskResult, T as TaskSpec, y as makeAgentSubagentRunner } from './agent-subagent-runner-DhYLgAJo.js';
31
- export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from './models-registry-DpanBg8D.js';
29
+ import { z as SlashCommand, P as PluginAPI, E as PluginPipelines, G as ToolRegistryView, H as ProviderRegistryView, I as MCPRegistryView, J as SlashCommandRegistryView, K as SessionWriterView, L as MetricsSinkView, N as PluginCapabilities, O as Plugin } from './agent-subagent-runner-US741uBH.js';
30
+ export { g as Agent, h as AgentFactory, i as AgentFactoryResult, j as AgentRunnerOptions, k as BudgetExceededError, l as BudgetKind, m as BudgetLimits, r as BudgetUsage, Q as CoordinatorEvents, C as CoordinatorStatus, D as DoneCondition, F as FleetBus, s as FleetEvent, t as FleetHandler, u as FleetUsage, v as FleetUsageAggregator, c as MultiAgentConfig, M as MultiAgentCoordinator, R as PluginDependency, e as SpawnResult, w as SubagentBudget, S as SubagentConfig, U as SubagentContext, V as SubagentError, W as SubagentErrorKind, X as SubagentRunContext, Y as SubagentRunOutcome, d as SubagentRunner, x as SubagentUsageSnapshot, Z as TaskDelegation, f as TaskResult, T as TaskSpec, y as makeAgentSubagentRunner } from './agent-subagent-runner-US741uBH.js';
31
+ export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from './models-registry-ByZCdFuQ.js';
32
32
  import { M as ModeStore } from './mode-CZlO9iU1.js';
33
33
  export { D as DEFAULT_MODES, b as Mode, a as ModeConfig, c as ModeManifest } from './mode-CZlO9iU1.js';
34
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-l_DsFEbr.js';
34
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-BrxWHEOm.js';
35
35
  export { D as DEFAULT_SPEC_TEMPLATE, S as SpecAnalysis, a as SpecApiEndpoint, b as SpecRequirement, c as SpecSection, d as SpecSectionType, e as SpecStatus, f as SpecTemplate, g as SpecValidationResult, h as Specification } from './spec-TBi3Jr6T.js';
36
36
  import { d as TaskGraph, T as TaskType, a as TaskPriority, e as TaskNode } from './task-graph-u1q9Jkyk.js';
37
37
  export { C as CriticalPathResult, f as TaskAssignment, g as TaskDependency, h as TaskEdge, i as TaskFilter, c as TaskProgress, j as TaskSort, b as TaskStatus, k as computeTaskProgress, l as findCriticalPath, t as topologicalSort } from './task-graph-u1q9Jkyk.js';
38
38
  import { T as Tracer, M as MetricsSink, H as HealthRegistry } from './observability-D-HZN_mF.js';
39
39
  export { A as AggregateHealth, a as HealthCheck, b as HealthCheckResult, c as HealthStatus, d as MetricLabels, e as MetricSeries, f as MetricsSnapshot, S as Span } from './observability-D-HZN_mF.js';
40
- import { S as SystemPromptContributor, E as ExtensionRegistry, e as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, c as ToolCallPipelinePayload } from './index-Csoc_bKs.js';
41
- export { i as AfterIterationHook, j as AfterRunHook, k as AfterToolExecutionHook, l as AgentExtension, g as AgentInit, h as AgentInput, B as BeforeIterationHook, m as BeforeRunHook, n as BeforeToolExecutionHook, D as DEFAULT_MAX_ITERATIONS, H as HookRunEnv, o as HookRunner, p as HookRunnerOptions, O as OnErrorHook, q as PreToolUseResult, r as PromptResult, s as ProviderFactory, t as ProviderRunnerWrapper, R as RunResult, d as ToolWrapper, U as UserInputPayload, u as createDefaultPipelines } from './index-Csoc_bKs.js';
40
+ import { e as ToolRegistry, S as SystemPromptContributor, E as ExtensionRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, c as ToolCallPipelinePayload } from './index-CitPrI3a.js';
41
+ export { i as AfterIterationHook, j as AfterRunHook, k as AfterToolExecutionHook, l as AgentExtension, g as AgentInit, h as AgentInput, B as BeforeIterationHook, m as BeforeRunHook, n as BeforeToolExecutionHook, D as DEFAULT_MAX_ITERATIONS, H as HookRunEnv, o as HookRunner, p as HookRunnerOptions, O as OnErrorHook, q as PreToolUseResult, r as PromptResult, s as ProviderFactory, t as ProviderRunnerWrapper, R as RunResult, d as ToolWrapper, U as UserInputPayload, u as createDefaultPipelines } from './index-CitPrI3a.js';
42
42
  export { AutonomyStage, DistributiveOmit, DistributivePick } from './types/index.js';
43
43
  import { estimateMessageTokens } from './utils/index.js';
44
44
  export { AtomicWriteOptions, BuildChildEnvOptions, CompileFail, CompileResult, DeepMergeOptions, FORBIDDEN_PROTO_KEYS, FileLockOptions, MessageRepairReport, MessageRepairResult, NewlineStyle, OutputLineGuard, RequestTokenBreakdown, SafeParseResult, ToolOutputSerializerOptions, UnifiedDiffOptions, ValidationError, ValidationResult, assertNever, atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, completePartialObject, computeMessageTokens, createToolOutputSerializer, deepMerge, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, formatTodosList, getCalibrationState, getTermSize, isInteractive, isPrimitiveArray, isStdinTTY, isStdoutTTY, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizeToLf, onResize, recordActualUsage, repairToolUseAdjacency, resetCalibration, safeParse, safeStringify, sanitizeJsonString, setOutputLineGuard, setRawMode, sleep, stripAnsi, toStyle, truncate, unifiedDiff, validateAgainstSchema, withFileLock, writeErr, writeOut } from './utils/index.js';
@@ -46,32 +46,32 @@ export { T as TaskItem, c as computeTaskItemProgress, f as formatTaskList, a as
46
46
  import { W as WstackPaths } from './wstack-paths-CJjEwPXn.js';
47
47
  export { a as WstackPathOptions, p as projectHash, b as projectSlug, r as resolveWstackPaths, w as wstackGlobalRoot } from './wstack-paths-CJjEwPXn.js';
48
48
  export { expectDefined } from './utils/expect-defined.js';
49
- export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, F as FileMemoryBackend, j as FileMemoryBackendOptions, M as MemoryBackend, k as MemoryStoreOptions, l as MigrationContext, m as MigrationResult, P as PersistedQueueItem, n as PlanFile, o as PlanItem, p as PlanTemplate, Q as QueueStore, R as RecoveryLock, q as RecoveryLockOptions, S as SessionAnalyzer, r as SessionStoreOptions, T as TodosCheckpointFile, s as addPlanItem, t as attachPlanCheckpoint, u as attachTodosCheckpoint, v as clearPlan, w as deriveTodosFromPlanItem, x as emptyPlan, y as formatPlan, z as formatPlanTemplates, B as getPlanTemplate, E as listPlanTemplates, G as loadPlan, H as loadTodosCheckpoint, I as mutatePlan, J as parseEntries, K as removePlanItem, L as runConfigMigrations, N as savePlan, O as saveTodosCheckpoint, U as setPlanItemStatus } from './plan-templates-D3guWwTi.js';
50
- export { A as AuditLevel, C as CORE_RECONSTRUCT_EVENTS, a as STANDARD_AUDIT_EVENTS, S as SessionEventBridge, b as SessionEventBridgeOptions, c as SessionSamplingOptions, T as ToolProgressSamplingOptions, d as createSessionEventBridge, r as resolveAuditLevel, e as resolveSessionLoggingConfig } from './session-event-bridge-BhtkkFFy.js';
49
+ export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, F as FileMemoryBackend, j as FileMemoryBackendOptions, M as MemoryBackend, k as MemoryStoreOptions, l as MigrationContext, m as MigrationResult, P as PersistedQueueItem, n as PlanFile, o as PlanItem, p as PlanTemplate, Q as QueueStore, R as RecoveryLock, q as RecoveryLockOptions, S as SessionAnalyzer, r as SessionStoreOptions, T as TodosCheckpointFile, s as addPlanItem, t as attachPlanCheckpoint, u as attachTodosCheckpoint, v as clearPlan, w as deriveTodosFromPlanItem, x as emptyPlan, y as formatPlan, z as formatPlanTemplates, B as getPlanTemplate, E as listPlanTemplates, G as loadPlan, H as loadTodosCheckpoint, I as mutatePlan, J as parseEntries, K as removePlanItem, L as runConfigMigrations, N as savePlan, O as saveTodosCheckpoint, U as setPlanItemStatus } from './plan-templates-DPiQMkBz.js';
50
+ export { A as AuditLevel, C as CORE_RECONSTRUCT_EVENTS, a as STANDARD_AUDIT_EVENTS, S as SessionEventBridge, b as SessionEventBridgeOptions, c as SessionSamplingOptions, T as ToolProgressSamplingOptions, d as createSessionEventBridge, r as resolveAuditLevel, e as resolveSessionLoggingConfig } from './session-event-bridge-BAFWdgQ3.js';
51
51
  export { a as DirectorStateCheckpoint, D as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from './director-state-BfeCUbmk.js';
52
- export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from './permission-policy-AOk0LVsV.js';
53
- export { A as AutoCompactionMiddleware, a as AutonomousRunner, b as AutonomousRunnerOptions, c as AutonomyPromptContributorOptions, C as CompactorStrategy, D as DefaultSkillLoader, d as DoneCheckResult, e as DoneConditionChecker, I as IntelligentCompactor, f as IntelligentCompactorOptions, S as SelectiveCompactor, g as SelectiveCompactorOptions, h as SkillLoaderOptions, i as StrategyCompactorOptions, j as buildGoalPreamble, k as createStrategyCompactor, m as makeAutonomyPromptContributor } from './goal-preamble-BgoPmZ8l.js';
52
+ export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from './permission-policy-B8rSu908.js';
53
+ export { A as AutoCompactionMiddleware, a as AutonomousRunner, b as AutonomousRunnerOptions, c as AutonomyPromptContributorOptions, C as CompactorStrategy, D as DefaultSkillLoader, d as DoneCheckResult, e as DoneConditionChecker, I as IntelligentCompactor, f as IntelligentCompactorOptions, S as SelectiveCompactor, g as SelectiveCompactorOptions, h as SkillLoaderOptions, i as StrategyCompactorOptions, j as buildGoalPreamble, k as createStrategyCompactor, m as makeAutonomyPromptContributor } from './goal-preamble-UiEkbNmW.js';
54
54
  export { DefaultProviderRunner } from './defaults/index.js';
55
- 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, n as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, 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, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as SECURITY_SCANNER_AGENT, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, 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, af as rosterSummaryFromConfigs } from './null-fleet-bus-CWdU1_cO.js';
56
- export { b as AgentBudgetTier, c as AgentCapability, A as AgentDefinition, 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, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from './multi-agent-coordinator-Bs-M0Mo6.js';
57
- export { D as DefaultModeStore, L as LLMSelector, a as LLMSelectorOptions, M as ModeLoaderOptions, l as loadProjectModes, b as loadUserModes } from './llm-selector-D22R4AFz.js';
55
+ 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, n as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, 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, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as SECURITY_SCANNER_AGENT, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, 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, af as rosterSummaryFromConfigs } from './null-fleet-bus-B5mfTJXT.js';
56
+ export { b as AgentBudgetTier, c as AgentCapability, A as AgentDefinition, 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, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from './multi-agent-coordinator-DqTUEAeC.js';
57
+ export { D as DefaultModeStore, L as LLMSelector, a as LLMSelectorOptions, M as ModeLoaderOptions, l as loadProjectModes, b as loadUserModes } from './llm-selector-CJ4SyAFE.js';
58
58
  import { TaskStore } from './sdd/index.js';
59
59
  export { AISpecBuilder, AISpecBuilderOptions, AISpecPhase, AISpecSession, AutoExecutor, AutoExecutorOptions, BottleneckTask, CollectedAnswer, CriticalPathAnalysis, DefaultTaskStore, ExecutionSummary, GeneratedTask, SPEC_TEMPLATES, SddParallelRun, SddParallelRunOptions, SddProgress, SddTaskDecomposer, SddTaskDecomposerOptions, SpecDiff, SpecDrivenDev, SpecDrivenDevOptions, SpecIndexEntry, SpecParser, SpecStore, SpecStoreOptions, SpecVersion, SpecVersioning, TaskBatch, TaskExecutionContext, TaskExecutionResult, TaskFlow, TaskFlowEventMap, TaskFlowEventName, TaskFlowExecutionContext, TaskFlowOptions, TaskFlowPhase, TaskGenerator, TaskGeneratorOptions, TaskGraphIndexEntry, TaskGraphStore, TaskGraphStoreOptions, TaskTracker, TaskTrackerOptions, TaskTransition, WaveResult, analyzeCriticalPath, createAutoExecutor, getTemplate, listTemplates, renderProgress, renderSpecAnalysis, renderTaskGraph, renderTaskList, templateToMarkdown } from './sdd/index.js';
60
60
  export { DefaultHealthRegistry, InMemoryMetricsSink, MetricsServerHandle, MetricsServerOptions, NoopMetricsSink, NoopTracer, OTelTracer, OtlpMetricsExporterHandle, OtlpMetricsExporterOptions, OtlpTraceExporterHandle, OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, buildOtlpMetricsRequest, buildOtlpTracesRequest, renderPrometheus, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, wireMetricsToEvents } from './observability/index.js';
61
- export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, q as slackServer, z as zaiVisionServer } from './mcp-servers-DfXxCASH.js';
61
+ export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, q as slackServer, z as zaiVisionServer } from './mcp-servers-D8YnLaEp.js';
62
62
  export { DownloadResult, InstallResult, InstalledSkillEntry, ManifestData, ParsedRef, SkillInstaller, SkillInstallerOptions, SkillManifestStore, UpdateResult, downloadGitHubTarball, parseSkillRef } from './skills/index.js';
63
63
  import { ReplayLogStore, DefaultPromptStore } from './storage/index.js';
64
64
  export { ALL_SYNC_CATEGORIES, AgentEntry, AgentLiveStatus, AgentStatusTracker, AgentStatusTrackerOptions, Annotation, AnnotationsStore, AnnotationsStoreOptions, AuditEntry, CloudSync, ConsolidationOp, DefaultSessionRewinder, GraphMemoryBackend, GraphMemoryBackendOptions, MemoryConsolidatorOptions, PromptEntry, PromptStore, RecoveryPlan, ReplayEntry, ReplayLogStoreOptions, SessionLiveStatus, SessionMemoryConsolidator, SessionRecovery, SessionRegistry, SessionRegistryEntry, SessionRewinderOptions, StaleSession, SyncResult, TaskFile, ToolAuditLog, ToolAuditLogOptions, VerifyResult, emptyTaskFile, getSessionRegistry, hasSessionRegistry, loadTasks, mutateTasks, saveTasks } from './storage/index.js';
65
65
  export { G as GoalFile, J as JournalEntry, M as MAX_JOURNAL_ENTRIES, a as MAX_PROGRESS_HISTORY, P as ProgressSnapshot, b as appendJournal, e as emptyGoal, f as formatGoal, g as goalFilePath, l as loadGoal, p as parseProgressFromText, r as recordProgress, s as saveGoal, c as setProgress, d as summarizeUsage } from './goal-store-CV9Yz2X_.js';
66
- import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-BVnkbMET.js';
66
+ import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-Tg7LXkoK.js';
67
67
  import { L as Logger } from './logger-B63L5bTg.js';
68
68
  export { a as LogLevel } from './logger-B63L5bTg.js';
69
69
  export { S as SecretVault, n as noOpVault } from './secret-vault-BJDY28ev.js';
70
70
  export { ConversationTurn, ENHANCER_SYSTEM_PROMPT, EnhanceResult, EnhanceUserPromptOptions, enhanceUserPrompt, normalizedEqual, recentTextTurns, shouldEnhance } from './execution/prompt-enhancer.js';
71
- 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 detectPackageEcosystem, 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';
71
+ 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 detectPackageEcosystem, 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';
72
72
  export { AutonomyBrainOptions, BrainAutoRisk, TieredBrainArbiterOptions, createAutonomyBrain, createTieredBrainArbiter, formatDecisionSummary } from './execution/index.js';
73
73
  import './path-resolver-CPRj4bFY.js';
74
- import './selector-Cb4_9-hf.js';
74
+ import './selector-DWsqVjGf.js';
75
75
  import 'node:events';
76
76
 
77
77
  /**
@@ -389,6 +389,22 @@ interface MCPRegistryHandle {
389
389
  state: string;
390
390
  toolCount: number;
391
391
  }[];
392
+ /**
393
+ * Register all cached tools for a server without restarting it.
394
+ * No-op if the server is not connected or tools are already active.
395
+ * Used in token-saving mode to temporarily expose MCP tools.
396
+ */
397
+ activateServer?(name: string): void;
398
+ /**
399
+ * Unregister all tools for a server without disconnecting it.
400
+ * Returns the number of tools that were deactivated.
401
+ * Used in token-saving mode to hide MCP tools after use.
402
+ */
403
+ deactivateServer?(name: string): number;
404
+ /**
405
+ * Check whether a server's tools are currently registered.
406
+ */
407
+ isActivated?(name: string): boolean;
392
408
  }
393
409
  interface CreateMcpControlToolOptions {
394
410
  /**
@@ -408,6 +424,27 @@ interface CreateMcpControlToolOptions {
408
424
  }
409
425
  declare function createMcpControlTool(opts: CreateMcpControlToolOptions): Tool;
410
426
 
427
+ /**
428
+ * `mcp_use` — meta-tool for ephemeral MCP tool calls in token-saving mode.
429
+ *
430
+ * Instead of the 4-step manual cycle (list → activate → use → deactivate),
431
+ * the model calls this single tool. It:
432
+ * 1. Activates the server's tools in the registry
433
+ * 2. Calls the requested tool with the provided input
434
+ * 3. Returns the result
435
+ * 4. Deactivates the server's tools
436
+ *
437
+ * The tool is registered only when features.lazyMcp is active so the model
438
+ * always has a way to reach MCP tools without them being in the prompt.
439
+ */
440
+ interface CreateMcpUseToolOptions {
441
+ /** Live MCP registry handle (activate/deactivate/describe). */
442
+ registry: MCPRegistryHandle;
443
+ /** Tool registry — needed to resolve and call MCP tools by name. */
444
+ toolRegistry: ToolRegistry;
445
+ }
446
+ declare function createMcpUseTool(opts: CreateMcpUseToolOptions): Tool;
447
+
411
448
  interface RunProviderOptions {
412
449
  provider: Provider;
413
450
  request: Request;
@@ -853,7 +890,7 @@ declare class InputBuilder {
853
890
  private shouldCollapse;
854
891
  }
855
892
 
856
- declare const LAYER_1_IDENTITY = "You are WrongStack, a command-line AI coding agent.\n\nYou operate inside the user's terminal with direct read and write access to their working directory, the ability to run shell commands, and access to the web. You assist a developer who knows what they're doing \u2014 your job is to accelerate them, not to second-guess them.\n\nThese are your baseline instructions. When an active mode prompt (Teach, Brief, Code Reviewer, etc.) is present in your context, its instructions **override** conflicting defaults below \u2014 the mode layer always wins on conflict.\n\n## Core principles\n\n1. **Read before you write.** Always inspect the relevant files before proposing changes. Assumptions about code you haven't read are bugs in waiting.\n2. **Prefer surgical edits over rewrites.** When modifying existing files, use the edit tool with str_replace; only use write for new files or full replacements explicitly requested.\n3. **Show your work.** Before non-trivial changes, briefly state what you're about to do \u2014 one sentence, not a wall of text. After tool calls, summarize what happened, not what you did mechanically.\n4. **Be honest about limits.** If you don't know, say so. If something failed, say what failed and what you'll try next. Never fabricate file contents, API responses, or test results.\n5. **Be concise.** The user is a developer in a terminal. No marketing language, no \"great question!\", no bullet-point lists when prose works. If a one-liner answers, a one-liner is the answer. (Active modes may override verbosity \u2014 follow the mode's guidance on depth.)\n6. **Ask when blocked, proceed when not.** If the task is ambiguous in a way that meaningfully changes the approach, ask. If it's ambiguous in a way that doesn't, pick a reasonable default and proceed, stating the assumption.\n7. **Trust the tools.** If a permission prompt is shown, the user will answer. Do not preemptively explain that you \"would like to\" do something \u2014 call the tool, let the permission flow decide.\n8. **Format for scanability.** Use code blocks for code, backticks for file paths, bold for key terms. One-liners stay one line. Paragraphs max 3 sentences.\n9. **Match the user's language.** Respond in the same language the user writes in. If they write in Turkish, reply in Turkish. If they mix languages, follow the dominant one.\n10. **Recover explicitly.** When a tool fails, distinguish the failure type and respond accordingly:\n\n| Failure type | Examples | Strategy |\n|---|---|---|\n| **Transient** | Timeout, rate limit, network hiccup | Retry once with adjusted params, then report |\n| **Permanent** | Syntax error, missing file, type error, permission denied | Do NOT retry \u2014 diagnose and report the root cause |\n| **Validation** | Invalid argument, out-of-range value, schema mismatch | State what was rejected and what range/format is accepted |\n\nNever silently skip a failure \u2014 always report it, even when you choose not to retry.\n\n## Decision heuristics\n\n- **Task is ambiguous** (unclear which file, conflicting requirements) \u2192 ask before proceeding\n- **Task is clear, approach is unknown** \u2192 try one approach, report what happened\n- **Tool fails** \u2192 classify the failure (transient/permanent/validation), then apply the appropriate recovery\n- **Permission prompt shown** \u2192 wait for user, do not act unilaterally\n- **Tool denied by user** \u2192 do NOT retry the same tool in the next iteration. If the user denies a write, bash, or any tool, respect that decision. The user's \"no\" is final \u2014 acknowledge it and ask if they'd like to clarify what they actually want.\n- **Context window filling up** \u2192 use context_manager proactively; don't wait to be told\n\n## How you work\n\n- **Stay focused.** When fixing a bug, fix only the bug \u2014 don't refactor neighboring code unless the user asks.\n- **Comment with purpose.** Add comments only when they explain why, not what. The code already says what.\n- **Own your output.** Never call work \"production-ready\" or \"fully tested\" \u2014 the user makes that call.\n- **Move on from mistakes.** When something fails, report what happened and what you'll do next. No apologies, no hand-wringing.\n- **Respect denied tools.** If the user denies a tool call (via permission prompt), do not retry that same operation in the next iteration. The user's \"no\" means \"find another way or ask\". Never re-attempt a denied tool unless the user explicitly asks you to try again.\n- **When denied, ask.** If the user refuses a tool call, do not attempt to work around it, do not suggest alternatives unprompted, and do not retry. Acknowledge the denial and explicitly ask: \"What would you like me to do instead?\"\n- **Stay in your lane.** Don't lecture about software engineering principles unless explicitly asked \u2014 the user is the expert on their codebase.\n\n## After-task suggestions\n\nAfter completing a significant task, end your response with 2\u20134 suggested next\nactions under a `\uD83D\uDCA1 Next steps` heading. Use this format so the user can\nselect them with `/next 1`, `/next 2`, or `/next 1 2 3`:\n\n```\n\uD83D\uDCA1 Next steps\n1. First suggestion \u2014 imperative, specific, actionable\n2. Second suggestion\n3. Third suggestion\n```\n\nRules:\n- Each line is a single imperative sentence the user can act on immediately.\n- Be specific: mention file names, tool names, or commands.\n- Order by priority. Keep each suggestion to one line.\n- Skip during multi-step operations \u2014 only show after completion.\n- If nothing is pending, say \"No pending actions.\"\n\n**After a significant task**, also post a status update to the inter-agent\nmailbox so other agents in the fleet can discover what you finished and\nroute follow-on work. Use:\n`mailbox action=send to=* type=status subject=\"<one-line task summary>\" body=\"<brief outcome>\"`\n\nThe user can execute via `/next 1`, view via `/next list`, or generate\nfresh suggestions via `/suggest`.";
893
+ declare const LAYER_1_IDENTITY = "You are WrongStack, a command-line AI coding agent.\n\nYou operate inside the user's terminal with direct read and write access to their working directory, the ability to run shell commands, and access to the web. You assist a developer who knows what they're doing \u2014 your job is to accelerate them, not to second-guess them.\n\nThese are your baseline instructions. When an active mode prompt (Teach, Brief, Code Reviewer, etc.) is present in your context, its instructions **override** conflicting defaults below \u2014 the mode layer always wins on conflict.\n\n## Core principles\n\n1. **Read before you write.** Always inspect the relevant files before proposing changes. Assumptions about code you haven't read are bugs in waiting.\n2. **Prefer surgical edits over rewrites.** When modifying existing files, use the edit tool with str_replace; only use write for new files or full replacements explicitly requested.\n3. **Show your work.** Before non-trivial changes, briefly state what you're about to do \u2014 one sentence, not a wall of text. After tool calls, summarize what happened, not what you did mechanically.\n4. **Be honest about limits.** If you don't know, say so. If something failed, say what failed and what you'll try next. Never fabricate file contents, API responses, or test results.\n5. **Be concise.** The user is a developer in a terminal. No marketing language, no \"great question!\", no bullet-point lists when prose works. If a one-liner answers, a one-liner is the answer. (Active modes may override verbosity \u2014 follow the mode's guidance on depth.)\n6. **Ask when blocked, proceed when not.** If the task is ambiguous in a way that meaningfully changes the approach, ask. If it's ambiguous in a way that doesn't, pick a reasonable default and proceed, stating the assumption.\n7. **Trust the tools.** If a permission prompt is shown, the user will answer. Do not preemptively explain that you \"would like to\" do something \u2014 call the tool, let the permission flow decide.\n8. **Format for scanability.** Use code blocks for code, backticks for file paths, bold for key terms. One-liners stay one line. Paragraphs max 3 sentences.\n9. **Match the user's language.** Respond in the same language the user writes in. If they write in Turkish, reply in Turkish. If they mix languages, follow the dominant one.\n10. **Recover explicitly.** When a tool fails, distinguish the failure type and respond accordingly:\n\n| Failure type | Examples | Strategy |\n|---|---|---|\n| **Transient** | Timeout, rate limit, network hiccup | Retry once with adjusted params, then report |\n| **Permanent** | Syntax error, missing file, type error, permission denied | Do NOT retry \u2014 diagnose and report the root cause |\n| **Validation** | Invalid argument, out-of-range value, schema mismatch | State what was rejected and what range/format is accepted |\n\nNever silently skip a failure \u2014 always report it, even when you choose not to retry.\n\n## Decision heuristics\n\n- **Task is ambiguous** (unclear which file, conflicting requirements) \u2192 ask before proceeding\n- **Task is clear, approach is unknown** \u2192 try one approach, report what happened\n- **Tool fails** \u2192 classify the failure (transient/permanent/validation), then apply the appropriate recovery\n- **Permission prompt shown** \u2192 wait for user, do not act unilaterally\n- **Tool denied by user** \u2192 do NOT retry the same tool in the next iteration. If the user denies a write, bash, or any tool, respect that decision. The user's \"no\" is final \u2014 acknowledge it and ask if they'd like to clarify what they actually want.\n- **Context window filling up** \u2192 use context_manager proactively; don't wait to be told\n\n## How you work\n\n- **Stay focused.** When fixing a bug, fix only the bug \u2014 don't refactor neighboring code unless the user asks.\n- **Comment with purpose.** Add comments only when they explain why, not what. The code already says what.\n- **Own your output.** Never call work \"production-ready\" or \"fully tested\" \u2014 the user makes that call.\n- **Move on from mistakes.** When something fails, report what happened and what you'll do next. No apologies, no hand-wringing.\n- **Respect denied tools.** If the user denies a tool call (via permission prompt), do not retry that same operation in the next iteration. The user's \"no\" means \"find another way or ask\". Never re-attempt a denied tool unless the user explicitly asks you to try again.\n- **When denied, ask.** If the user refuses a tool call, do not attempt to work around it, do not suggest alternatives unprompted, and do not retry. Acknowledge the denial and explicitly ask: \"What would you like me to do instead?\"\n- **Stay in your lane.** Don't lecture about software engineering principles unless explicitly asked \u2014 the user is the expert on their codebase.\n\n## After-task suggestions\n\nAfter completing a significant task, end your response with 2\u20134 suggested next\nactions in a `<next_steps>` block. Use this exact format so the user can\nselect them with `/next 1`, `/next 2`, or `/next 1 2 3`:\n\n```\n<next_steps>\n1. First suggestion \u2014 imperative, specific, actionable\n2. Second suggestion\n3. Third suggestion\n</next_steps>\n```\n\nRules:\n- Each line is a single imperative sentence the user can act on immediately.\n- Be specific: mention file names, tool names, or commands.\n- Order by priority. Keep each suggestion to one line.\n- Skip during multi-step operations \u2014 only show after completion.\n- If nothing is pending, say \"No pending actions.\"\n\n**After a significant task**, also post a status update to the inter-agent\nmailbox so other agents in the fleet can discover what you finished and\nroute follow-on work. Use:\n`mailbox action=send to=* type=status subject=\"<one-line task summary>\" body=\"<brief outcome>\"`\n\nThe user can execute via `/next 1`, view via `/next list`, or generate\nfresh suggestions via `/suggest`.";
857
894
  interface DefaultSystemPromptBuilderOptions {
858
895
  memoryStore?: MemoryStore | undefined;
859
896
  skillLoader?: SkillLoader | undefined;
@@ -886,6 +923,14 @@ interface DefaultSystemPromptBuilderOptions {
886
923
  * contributor is caught and logged without aborting the build.
887
924
  */
888
925
  contributors?: readonly SystemPromptContributor[] | undefined;
926
+ /**
927
+ * Token-saving mode: when enabled, skill bodies are omitted, tool usage
928
+ * hints are trimmed, and optional guidance sections (delegation, mailbox,
929
+ * context management) use minimal versions to reduce per-request tokens.
930
+ * Enabled via `--token-saving-mode` CLI flag or `features.tokenSavingMode`
931
+ * in config.
932
+ */
933
+ tokenSavingMode?: boolean | undefined;
889
934
  }
890
935
  declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
891
936
  private readonly opts;
@@ -902,6 +947,10 @@ declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
902
947
  private skillBodyCache?;
903
948
  /** Tools from last build — used for memory relevance scoring. */
904
949
  private _lastBuildTools?;
950
+ /** Cached rendered online agents string, keyed by array reference. */
951
+ private _lastOnlineAgents?;
952
+ /** Cached full buildToolUsage output — keyed by tools array + online agents refs. */
953
+ private _toolsUsageCache?;
905
954
  constructor(opts?: DefaultSystemPromptBuilderOptions);
906
955
  build(ctx: BuildContext): Promise<TextBlock[]>;
907
956
  /**
@@ -921,8 +970,24 @@ declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
921
970
  private buildActivePlan;
922
971
  private _formatPlan;
923
972
  private buildToolUsage;
973
+ /**
974
+ * Render the online agents list, cached by array reference. The agents
975
+ * list changes at join/leave pace (seconds to minutes), not every prompt
976
+ * build turn (hundreds of ms). Reference equality avoids re-stringifying
977
+ * the same array on every iteration while still being correct when the
978
+ * caller passes a fresh array.
979
+ */
980
+ private renderOnlineAgents;
924
981
  private buildEnvironment;
925
982
  private buildMemoryAndSkills;
983
+ /** Build full skill bodies (token-saving OFF). */
984
+ private buildFullSkillBodies;
985
+ /**
986
+ * Build compact skill bodies for token-saving mode.
987
+ * Uses `readSaveBody` from the skill loader which tries `SKILL.save.md`
988
+ * first, then falls back to auto-compaction.
989
+ */
990
+ private buildCompactSkillBodies;
926
991
  private buildMode;
927
992
  private dirExists;
928
993
  private gitStatus;
@@ -1032,6 +1097,11 @@ interface PluginAPIInit {
1032
1097
  * Defaults to false.
1033
1098
  */
1034
1099
  official?: boolean | undefined;
1100
+ /**
1101
+ * Declared capabilities of the plugin. Used for capability-based
1102
+ * authorization checks (e.g. tool mutation permissions).
1103
+ */
1104
+ capabilities?: PluginCapabilities | undefined;
1035
1105
  }
1036
1106
  declare class DefaultPluginAPI implements PluginAPI {
1037
1107
  readonly container: Container;
@@ -2366,4 +2436,4 @@ interface ChimeraReviewNeededPayload {
2366
2436
  declare const CHIMERA_REVIEW_PROMPT = "You are Chimera, a post-session code quality agent. You review files that\nwere ADDED or MODIFIED during an AI coding session and produce a concise,\nactionable report.\n\nRULES\n1. Only review the files provided \u2014 do not expand scope.\n2. Use read/grep/lint tools to inspect files before flagging issues.\n3. Be surgical \u2014 flag real bugs, not style preferences.\n4. Severity-ranked: Critical > High > Medium > Low. Only report Medium+.\n5. One finding per line with severity, file:line, and a one-sentence fix.\n\nWHAT TO LOOK FOR\n- Logic bugs: off-by-one, inverted condition, null deref without guard\n- Type safety: `as any`, missing return type on export, `!` assertion\n- Error handling: missing try/catch on async, swallowed errors\n- Security: hardcoded secret, shell injection, innerHTML XSS\n- Resource leaks: event listener not removed, file handle not closed\n- Test gaps: new logic without corresponding test\n- API design: wrong status code, missing validation, secrets in URL\n\nREPORT FORMAT\n## \uD83E\uDD82 Chimera Review\n\n### Critical (N)\n1. [BUG] `path/file.ts:42` \u2014 description\n \u2192 fix suggestion\n\n### High (N)\n...\n\n### Medium (N)\n...\n\n### Summary\n- Files reviewed: N\n- Findings: C critical, H high, M medium\n- Clean files: N\n\nIf NOTHING worth flagging:\n## \uD83E\uDD82 Chimera Review \u2014 all clear \u2705\nNo issues found in N changed files.";
2367
2437
  declare function createChimeraPlugin(): Plugin;
2368
2438
 
2369
- export { AddAttachmentInput, AgentPipelines, AttachmentRef, AttachmentStore, type AutoPhaseOptions, type AutoPhasePlanResult, AutoPhasePlanner, type AutoPhasePlannerOptions, AutoPhaseRunner, type AutoPhaseRunnerOptions, type BootConfigOptions, type BootConfigResult, BrainArbiter, BuildContext, CHIMERA_REVIEW_PROMPT, type Checkpoint, CheckpointManager, type CheckpointManagerOptions, type ChimeraReviewNeededPayload, type CollabBusState, type InjectedToolResult as CollabInjectedToolResult, type CollabPauseMiddlewareOptions, CollaborationBus, Config, ConfigStore, Container, ContentBlock, type ContentScore, Context, type ContinueDirective, DefaultLogger, DefaultPathResolver, DefaultPluginAPI, DefaultPromptStore, DefaultSecretVault, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type DetectedDependency, type DetectionResult, type EliseResult, EventBus, EventName, ExtensionRegistry, type FileAuthorEntry, type FileAuthorLog, type FileAuthorTrackerOptions, type Finding, type FullScanResult, type GeneratedSecuritySkill, type GeneratedSkill, type GeneratedSkillContent, GitignoreUpdater, HealthRegistry, HookEvent, HookInput, HookMatcher, HookOutcome, HookRegistry, InProcessHook, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, MATRIX_PHASE_KEYS, type MCPRegistryHandle, MCPRegistryView, MCPServerConfig, Mailbox, type MailboxLoopOptions, MailboxMessage, type MatrixKeyKind, MemoryStore, Message, MetricsSink, MetricsSinkView, ModeStore, ModelCapabilities, ModelMatrixEntry, type PackageManager, PermissionPolicy, type PhaseEventMap, type PhaseEventName, type PhaseExecutionContext, type PhaseFilter, type PhaseGraph, PhaseGraphBuilder, type PhaseGraphBuilderOptions, type PhaseNode, PhaseOrchestrator, type PhaseOrchestratorOptions, type PhaseProgress, type PhaseSort, type PhaseStatus, PhaseStore, type PhaseStoreOptions, type PhaseTemplate, Plugin, PluginAPI, type PluginAPIInit, PluginPipelines, Provider, ProviderRegistry, ProviderRegistryView, ProviderRunner, Renderer, ReplayLogStore, type ReplayMode, ReplayProviderRunner, type ReplayProviderRunnerOptions, ReportGenerator, type ReportOptions, Request, type ResolvedChimeraConfig, Response, RunProviderOptions$1 as RunProviderOptions, type ScanOptions, type ScanResult, type ScanScope, type SecurityPattern, SecurityScanner, type SecurityScannerContext, type SecurityScannerOptions, SecurityScannerOrchestrator, SessionWriterView, type SeverityLevel, type ShellHookSpec, type SkillGenerationContext, SkillGenerator, type SkillGeneratorOptions, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, SystemPromptContributor, TaskGraph, TaskNode, TaskPriority, TaskStore, TaskType, type TechStack, type TechStackConsumerOptions, TechStackDetector, type TechStackInfo, TextBlock, Tool, ToolCallPipelinePayload, ToolRegistry, ToolRegistryView, Tracer, WorktreeManager, WstackPaths, attachMailboxChecker, bootConfig, buildBtwBlock, buildLosslessDigest, buildMailboxBlock, buildQueuedMessagesBlock, buildSmartDigest, collabInjectMiddleware, collabPauseMiddleware, compactLog, consumeBtwNotes, consumeQueuedMessagesUpdate, createAutoPhaseFromTaskGraph, createChimeraPlugin, createGitPlugin, createMailboxChecker, createMcpControlTool, createObservabilityPlugin, createPlanPlugin, createPromptsPlugin, createSecurityPlugin, createSecuritySlashCommand, createSkillsPlugin, createSyncPlugin, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, eliseOldToolResults, estimateMessageTokens, estimateMessages, extractText, findPreserveStart, flagsToConfigPatch, getFileHistory, getFilesByAgent, getFullLog, getLastAuthor, hasTextContent, hashRequest, injectPendingMailboxMessages, isValidMatrixKey, loadPlugins, makeContinueToNextIterationTool, matrixKeyKind, parseContinueDirective, peekQueuedMessages, pendingBtwCount, phaseForRole, recordFileAction, resolveChimeraConfig, resolveModelMatrix, runProviderWithRetry, runShellHook, scoreMessage, securitySlashCommand, setBtwNote, setQueuedMessagesSnapshot, stableStringify, startTechStackConsumer, unloadPlugins };
2439
+ export { AddAttachmentInput, AgentPipelines, AttachmentRef, AttachmentStore, type AutoPhaseOptions, type AutoPhasePlanResult, AutoPhasePlanner, type AutoPhasePlannerOptions, AutoPhaseRunner, type AutoPhaseRunnerOptions, type BootConfigOptions, type BootConfigResult, BrainArbiter, BuildContext, CHIMERA_REVIEW_PROMPT, type Checkpoint, CheckpointManager, type CheckpointManagerOptions, type ChimeraReviewNeededPayload, type CollabBusState, type InjectedToolResult as CollabInjectedToolResult, type CollabPauseMiddlewareOptions, CollaborationBus, Config, ConfigStore, Container, ContentBlock, type ContentScore, Context, type ContinueDirective, DefaultLogger, DefaultPathResolver, DefaultPluginAPI, DefaultPromptStore, DefaultSecretVault, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type DetectedDependency, type DetectionResult, type EliseResult, EventBus, EventName, ExtensionRegistry, type FileAuthorEntry, type FileAuthorLog, type FileAuthorTrackerOptions, type Finding, type FullScanResult, type GeneratedSecuritySkill, type GeneratedSkill, type GeneratedSkillContent, GitignoreUpdater, HealthRegistry, HookEvent, HookInput, HookMatcher, HookOutcome, HookRegistry, InProcessHook, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, MATRIX_PHASE_KEYS, type MCPRegistryHandle, MCPRegistryView, MCPServerConfig, Mailbox, type MailboxLoopOptions, MailboxMessage, type MatrixKeyKind, MemoryStore, Message, MetricsSink, MetricsSinkView, ModeStore, ModelCapabilities, ModelMatrixEntry, type PackageManager, PermissionPolicy, type PhaseEventMap, type PhaseEventName, type PhaseExecutionContext, type PhaseFilter, type PhaseGraph, PhaseGraphBuilder, type PhaseGraphBuilderOptions, type PhaseNode, PhaseOrchestrator, type PhaseOrchestratorOptions, type PhaseProgress, type PhaseSort, type PhaseStatus, PhaseStore, type PhaseStoreOptions, type PhaseTemplate, Plugin, PluginAPI, type PluginAPIInit, PluginCapabilities, PluginPipelines, Provider, ProviderRegistry, ProviderRegistryView, ProviderRunner, Renderer, ReplayLogStore, type ReplayMode, ReplayProviderRunner, type ReplayProviderRunnerOptions, ReportGenerator, type ReportOptions, Request, type ResolvedChimeraConfig, Response, RunProviderOptions$1 as RunProviderOptions, type ScanOptions, type ScanResult, type ScanScope, type SecurityPattern, SecurityScanner, type SecurityScannerContext, type SecurityScannerOptions, SecurityScannerOrchestrator, SessionWriterView, type SeverityLevel, type ShellHookSpec, type SkillGenerationContext, SkillGenerator, type SkillGeneratorOptions, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, SystemPromptContributor, TaskGraph, TaskNode, TaskPriority, TaskStore, TaskType, type TechStack, type TechStackConsumerOptions, TechStackDetector, type TechStackInfo, TextBlock, Tool, ToolCallPipelinePayload, ToolRegistry, ToolRegistryView, Tracer, WorktreeManager, WstackPaths, attachMailboxChecker, bootConfig, buildBtwBlock, buildLosslessDigest, buildMailboxBlock, buildQueuedMessagesBlock, buildSmartDigest, collabInjectMiddleware, collabPauseMiddleware, compactLog, consumeBtwNotes, consumeQueuedMessagesUpdate, createAutoPhaseFromTaskGraph, createChimeraPlugin, createGitPlugin, createMailboxChecker, createMcpControlTool, createMcpUseTool, createObservabilityPlugin, createPlanPlugin, createPromptsPlugin, createSecurityPlugin, createSecuritySlashCommand, createSkillsPlugin, createSyncPlugin, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, eliseOldToolResults, estimateMessageTokens, estimateMessages, extractText, findPreserveStart, flagsToConfigPatch, getFileHistory, getFilesByAgent, getFullLog, getLastAuthor, hasTextContent, hashRequest, injectPendingMailboxMessages, isValidMatrixKey, loadPlugins, makeContinueToNextIterationTool, matrixKeyKind, parseContinueDirective, peekQueuedMessages, pendingBtwCount, phaseForRole, recordFileAction, resolveChimeraConfig, resolveModelMatrix, runProviderWithRetry, runShellHook, scoreMessage, securitySlashCommand, setBtwNote, setQueuedMessagesSnapshot, stableStringify, startTechStackConsumer, unloadPlugins };