@wrongstack/core 0.68.0 → 0.77.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 (59) hide show
  1. package/dist/{agent-bridge-D-j6OOBT.d.ts → agent-bridge-EWdqs8v6.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-DRZ9-NnR.d.ts → agent-subagent-runner-D8qW8OSC.d.ts} +13 -5
  3. package/dist/{config--86aHSln.d.ts → config-Dy0CK_o6.d.ts} +44 -1
  4. package/dist/coordination/index.d.ts +10 -10
  5. package/dist/coordination/index.js +74 -10
  6. package/dist/coordination/index.js.map +1 -1
  7. package/dist/defaults/index.d.ts +17 -17
  8. package/dist/defaults/index.js +160 -67
  9. package/dist/defaults/index.js.map +1 -1
  10. package/dist/{events-CIplI98R.d.ts → events-CYaoLN5_.d.ts} +45 -0
  11. package/dist/execution/index.d.ts +9 -9
  12. package/dist/execution/index.js +4 -4
  13. package/dist/execution/index.js.map +1 -1
  14. package/dist/extension/index.d.ts +5 -5
  15. package/dist/{index-b5uhfTSl.d.ts → index-DIxjTOga.d.ts} +6 -6
  16. package/dist/{index-DKUvyTvV.d.ts → index-Dsda0uCn.d.ts} +4 -4
  17. package/dist/index.d.ts +108 -33
  18. package/dist/index.js +388 -58
  19. package/dist/index.js.map +1 -1
  20. package/dist/infrastructure/index.d.ts +5 -5
  21. package/dist/infrastructure/index.js +16 -2
  22. package/dist/infrastructure/index.js.map +1 -1
  23. package/dist/kernel/index.d.ts +7 -7
  24. package/dist/kernel/index.js.map +1 -1
  25. package/dist/{logger-bOzkF5LL.d.ts → logger-BppKxDqZ.d.ts} +9 -0
  26. package/dist/{mcp-servers-DwoNBf6r.d.ts → mcp-servers-T0O6UN_w.d.ts} +1 -1
  27. package/dist/{mode-CV077NjV.d.ts → mode-BO4SEUIv.d.ts} +7 -0
  28. package/dist/models/index.d.ts +1 -1
  29. package/dist/models/index.js +18 -9
  30. package/dist/models/index.js.map +1 -1
  31. package/dist/{multi-agent-coordinator-CWnH-CiX.d.ts → multi-agent-coordinator-DpbG3wiy.d.ts} +1 -1
  32. package/dist/{null-fleet-bus-CuN0ObJr.d.ts → null-fleet-bus-u5ys3lW_.d.ts} +28 -9
  33. package/dist/observability/index.d.ts +1 -1
  34. package/dist/{parallel-eternal-engine-0UwotoSx.d.ts → parallel-eternal-engine-Dn0P8Pbj.d.ts} +3 -3
  35. package/dist/{path-resolver-DVkEcIw8.d.ts → path-resolver-B32v2JIq.d.ts} +1 -1
  36. package/dist/{permission-C1A5whY5.d.ts → permission-V5BLOrY6.d.ts} +0 -4
  37. package/dist/{permission-policy-B2dK-T5N.d.ts → permission-policy-CBVx-d-8.d.ts} +1 -5
  38. package/dist/{plan-templates-Bprrzhbu.d.ts → plan-templates-BcUwLlMQ.d.ts} +8 -3
  39. package/dist/{provider-runner-mXvXGSIw.d.ts → provider-runner-CSi_7l0h.d.ts} +1 -1
  40. package/dist/sdd/index.d.ts +6 -6
  41. package/dist/sdd/index.js +3 -3
  42. package/dist/sdd/index.js.map +1 -1
  43. package/dist/security/index.d.ts +2 -2
  44. package/dist/security/index.js +0 -8
  45. package/dist/security/index.js.map +1 -1
  46. package/dist/skills/index.js +1 -0
  47. package/dist/skills/index.js.map +1 -1
  48. package/dist/storage/index.d.ts +4 -4
  49. package/dist/storage/index.js +48 -8
  50. package/dist/storage/index.js.map +1 -1
  51. package/dist/{system-prompt-b61lOd49.d.ts → system-prompt-CA11g6Jo.d.ts} +1 -1
  52. package/dist/types/index.d.ts +14 -14
  53. package/dist/types/index.js +35 -12
  54. package/dist/types/index.js.map +1 -1
  55. package/dist/utils/index.d.ts +2 -2
  56. package/dist/utils/index.js +14 -3
  57. package/dist/utils/index.js.map +1 -1
  58. package/dist/{wstack-paths-eMXnY1_X.d.ts → wstack-paths-D7evAFWM.d.ts} +8 -1
  59. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- export { A as AfterIterationHook, a as AfterRunHook, b as AfterToolExecutionHook, c as AgentExtension, B as BeforeIterationHook, g as BeforeRunHook, h as BeforeToolExecutionHook, E as ExtensionRegistry, O as OnErrorHook, n as ProviderRunnerFn, o as ProviderRunnerWrapper } from '../index-DKUvyTvV.js';
1
+ export { A as AfterIterationHook, a as AfterRunHook, b as AfterToolExecutionHook, c as AgentExtension, B as BeforeIterationHook, g as BeforeRunHook, h as BeforeToolExecutionHook, E as ExtensionRegistry, O as OnErrorHook, n as ProviderRunnerFn, o as ProviderRunnerWrapper } from '../index-Dsda0uCn.js';
2
2
  import '../context-y87Jc5ei.js';
3
3
  import '../logger-DDd5C--Z.js';
4
- import '../system-prompt-b61lOd49.js';
5
- import '../config--86aHSln.js';
4
+ import '../system-prompt-CA11g6Jo.js';
5
+ import '../config-Dy0CK_o6.js';
6
6
  import '../models-registry-BcYJDKLm.js';
7
7
  import '../observability-BhnVLBLS.js';
8
- import '../events-CIplI98R.js';
8
+ import '../events-CYaoLN5_.js';
9
9
  import '../secret-scrubber-3MHDDAtm.js';
10
- import '../permission-C1A5whY5.js';
10
+ import '../permission-V5BLOrY6.js';
@@ -1,16 +1,16 @@
1
- import { T as Token, e as Renderer, S as SystemPromptBuilder, H as HookRegistry } from './system-prompt-b61lOd49.js';
2
- import { E as EventBus, B as BrainArbiter } from './events-CIplI98R.js';
1
+ import { T as Token, e as Renderer, S as SystemPromptBuilder, H as HookRegistry } from './system-prompt-CA11g6Jo.js';
2
+ import { E as EventBus, B as BrainArbiter } from './events-CYaoLN5_.js';
3
3
  import { a as Compactor } from './compactor-D_ExJajC.js';
4
- import { b as ConfigLoader, c as ConfigStore } from './config--86aHSln.js';
4
+ import { b as ConfigLoader, c as ConfigStore } from './config-Dy0CK_o6.js';
5
5
  import { E as ErrorHandler, a as RetryPolicy } from './retry-policy-CG3qvH_e.js';
6
6
  import { I as InputReader } from './input-reader-E-ffP2ee.js';
7
7
  import { a as Logger } from './logger-DDd5C--Z.js';
8
8
  import { b as MemoryStore } from './memory-CEXuo7sz.js';
9
- import { c as ModeStore } from './mode-CV077NjV.js';
9
+ import { c as ModeStore } from './mode-BO4SEUIv.js';
10
10
  import { b as ModelsRegistry } from './models-registry-BcYJDKLm.js';
11
11
  import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
12
- import { a as PermissionPolicy } from './permission-C1A5whY5.js';
13
- import { P as ProviderRunner } from './provider-runner-mXvXGSIw.js';
12
+ import { a as PermissionPolicy } from './permission-V5BLOrY6.js';
13
+ import { P as ProviderRunner } from './provider-runner-CSi_7l0h.js';
14
14
  import { S as SecretScrubber } from './secret-scrubber-3MHDDAtm.js';
15
15
  import { O as TokenCounter, y as SessionStore } from './context-y87Jc5ei.js';
16
16
  import { a as SkillLoader } from './skill-CxuWrsKK.js';
@@ -1,11 +1,11 @@
1
1
  import { T as TextBlock, Q as Tool, Y as ToolResultBlock, _ as ToolUseBlock, d as Context, p as Request, q as Response, m as Provider, a0 as WrongStackError, c as ContentBlock } from './context-y87Jc5ei.js';
2
2
  import { a as Logger } from './logger-DDd5C--Z.js';
3
- import { a as BuildContext, H as HookRegistry, e as Renderer, P as Pipeline, C as Container } from './system-prompt-b61lOd49.js';
4
- import { l as HookEvent, r as ProviderConfig } from './config--86aHSln.js';
3
+ import { a as BuildContext, H as HookRegistry, e as Renderer, P as Pipeline, C as Container } from './system-prompt-CA11g6Jo.js';
4
+ import { l as HookEvent, t as ProviderConfig } from './config-Dy0CK_o6.js';
5
5
  import { T as Tracer } from './observability-BhnVLBLS.js';
6
- import { E as EventBus } from './events-CIplI98R.js';
6
+ import { E as EventBus } from './events-CYaoLN5_.js';
7
7
  import { S as SecretScrubber } from './secret-scrubber-3MHDDAtm.js';
8
- import { a as PermissionPolicy } from './permission-C1A5whY5.js';
8
+ import { a as PermissionPolicy } from './permission-V5BLOrY6.js';
9
9
  import { W as WireFamily } from './models-registry-BcYJDKLm.js';
10
10
 
11
11
  /**
package/dist/index.d.ts CHANGED
@@ -1,61 +1,61 @@
1
- import { S as SystemPromptBuilder, c as ModelCapabilities, a as BuildContext, C as Container, H as HookRegistry } from './system-prompt-b61lOd49.js';
2
- export { B as BindOptions, D as Decorator, F as Factory, M as Middleware, b as MiddlewareHandler, N as NextFn, P as Pipeline, d as PipelineOptions, e as Renderer, T as Token, h as hookMatcherMatches } from './system-prompt-b61lOd49.js';
3
- import { E as EventBus, k as EventName, L as Listener, B as BrainArbiter } from './events-CIplI98R.js';
4
- export { a as BrainDecision, b as BrainDecisionOption, c as BrainDecisionQueue, d as BrainDecisionRequest, e as BrainDecisionSource, f as BrainFallback, g as BrainRisk, D as DefaultBrainArbiter, h as DefaultBrainArbiterOptions, i as EventLogger, j as EventMap, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, S as ScopedEventBus, l as formatHumanPrompt } from './events-CIplI98R.js';
5
- import { d as WorktreeManager } from './index-b5uhfTSl.js';
6
- export { A as AllocateOpts, M as MergeOpts, a as MergeResult, R as RunController, b as RunControllerOptions, T as TOKENS, W as WorktreeHandle, e as WorktreeManagerOptions, c as WorktreeRunResult, f as WorktreeStatus, g as assertSafePath } from './index-b5uhfTSl.js';
7
- import { d as Context, m as Provider, Q as Tool, p as Request, q as Response, c as ContentBlock, T as TextBlock } from './context-y87Jc5ei.js';
8
- export { A as AgentError, a as Capabilities, b as ConfigError, e as ContextInit, f as ConversationState, E as ERROR_CODES, g as ErrorCode, h as ErrorSeverity, i as ErrorSubsystem, F as FileSnapshot, j as FsError, I as ImageBlock, J as JSONSchema, M as Message, k as MessageRole, P as Permission, l as PluginError, n as ProviderError, o as ProviderErrorBody, R as ReadonlyConversationState, r as ResumedSession, s as RiskTier, t as RunEnv, u as RunOptions, S as SessionData, v as SessionError, w as SessionEvent, x as SessionMetadata, y as SessionStore, z as SessionSummary, B as SessionWriter, D as StateChange, G as StateChangeHandler, H as StopReason, K as StreamEvent, L as ThinkingBlock, N as TodoItem, O as TokenCounter, U as ToolCallContext, V as ToolError, W as ToolFinalEvent, X as ToolProgressEvent, Y as ToolResultBlock, Z as ToolStreamEvent, _ as ToolUseBlock, $ as Usage, a0 as WrongStackError, a1 as asBlocks, a2 as asText, a3 as extractRunEnv, a4 as isAgentError, a5 as isConfigError, a6 as isFsError, a7 as isImageBlock, a8 as isPluginError, a9 as isSessionError, aa as isTextBlock, ab as isThinkingBlock, ac as isToolError, ad as isToolResultBlock, ae as isToolUseBlock, af as isWrongStackError, ag as toWrongStackError, ah as wrapAsState } from './context-y87Jc5ei.js';
9
- import { P as ProviderRunner, R as RunProviderOptions$1 } from './provider-runner-mXvXGSIw.js';
10
- import { M as MCPServerConfig, a as Config, m as HookInput, o as HookOutcome, l as HookEvent, n as HookMatcher, I as InProcessHook, p as ModelMatrixEntry, c as ConfigStore } from './config--86aHSln.js';
11
- export { A as AutonomyConfig, C as CONTEXT_WINDOW_MODES, b as ConfigLoader, d as ContextConfig, e as ContextWindowAggressiveOn, f as ContextWindowConfigLike, g as ContextWindowMode, h as ContextWindowModeId, i as ContextWindowPolicy, j as ContextWindowThresholds, k as CustomModelDefinition, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, H as HookEntry, L as LogConfig, P as PluginConfig, q as ProviderApiKey, r as ProviderConfig, S as SessionLoggingConfig, s as ShellHook, t as SyncCategory, u as SyncConfig, T as ToolsConfig, v as formatContextWindowModeList, w as getContextWindowMode, x as isContextWindowModeId, y as listContextWindowModes, z as resolveContextWindowPolicy } from './config--86aHSln.js';
1
+ import { S as SystemPromptBuilder, c as ModelCapabilities, a as BuildContext, C as Container, H as HookRegistry } from './system-prompt-CA11g6Jo.js';
2
+ export { B as BindOptions, D as Decorator, F as Factory, M as Middleware, b as MiddlewareHandler, N as NextFn, P as Pipeline, d as PipelineOptions, e as Renderer, T as Token, h as hookMatcherMatches } from './system-prompt-CA11g6Jo.js';
3
+ import { E as EventBus, k as EventName, L as Listener, B as BrainArbiter } from './events-CYaoLN5_.js';
4
+ export { a as BrainDecision, b as BrainDecisionOption, c as BrainDecisionQueue, d as BrainDecisionRequest, e as BrainDecisionSource, f as BrainFallback, g as BrainRisk, D as DefaultBrainArbiter, h as DefaultBrainArbiterOptions, i as EventLogger, j as EventMap, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, S as ScopedEventBus, l as formatHumanPrompt } from './events-CYaoLN5_.js';
5
+ import { d as WorktreeManager } from './index-DIxjTOga.js';
6
+ export { A as AllocateOpts, M as MergeOpts, a as MergeResult, R as RunController, b as RunControllerOptions, T as TOKENS, W as WorktreeHandle, e as WorktreeManagerOptions, c as WorktreeRunResult, f as WorktreeStatus, g as assertSafePath } from './index-DIxjTOga.js';
7
+ import { d as Context, m as Provider, Q as Tool, p as Request, q as Response, c as ContentBlock, T as TextBlock, M as Message } from './context-y87Jc5ei.js';
8
+ export { A as AgentError, a as Capabilities, b as ConfigError, e as ContextInit, f as ConversationState, E as ERROR_CODES, g as ErrorCode, h as ErrorSeverity, i as ErrorSubsystem, F as FileSnapshot, j as FsError, I as ImageBlock, J as JSONSchema, k as MessageRole, P as Permission, l as PluginError, n as ProviderError, o as ProviderErrorBody, R as ReadonlyConversationState, r as ResumedSession, s as RiskTier, t as RunEnv, u as RunOptions, S as SessionData, v as SessionError, w as SessionEvent, x as SessionMetadata, y as SessionStore, z as SessionSummary, B as SessionWriter, D as StateChange, G as StateChangeHandler, H as StopReason, K as StreamEvent, L as ThinkingBlock, N as TodoItem, O as TokenCounter, U as ToolCallContext, V as ToolError, W as ToolFinalEvent, X as ToolProgressEvent, Y as ToolResultBlock, Z as ToolStreamEvent, _ as ToolUseBlock, $ as Usage, a0 as WrongStackError, a1 as asBlocks, a2 as asText, a3 as extractRunEnv, a4 as isAgentError, a5 as isConfigError, a6 as isFsError, a7 as isImageBlock, a8 as isPluginError, a9 as isSessionError, aa as isTextBlock, ab as isThinkingBlock, ac as isToolError, ad as isToolResultBlock, ae as isToolUseBlock, af as isWrongStackError, ag as toWrongStackError, ah as wrapAsState } from './context-y87Jc5ei.js';
9
+ import { P as ProviderRunner, R as RunProviderOptions$1 } from './provider-runner-CSi_7l0h.js';
10
+ import { M as MCPServerConfig, a as Config, m as HookInput, o as HookOutcome, l as HookEvent, n as HookMatcher, I as InProcessHook, r as ModelMatrixEntry, c as ConfigStore } from './config-Dy0CK_o6.js';
11
+ export { A as AutonomyConfig, C as CONTEXT_WINDOW_MODES, b as ConfigLoader, d as ContextConfig, e as ContextWindowAggressiveOn, f as ContextWindowConfigLike, g as ContextWindowMode, h as ContextWindowModeId, i as ContextWindowPolicy, j as ContextWindowThresholds, k as CustomModelDefinition, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, H as HookEntry, p as IndexingConfig, L as LaunchConfig, q as LogConfig, P as PluginConfig, s as ProviderApiKey, t as ProviderConfig, S as SessionLoggingConfig, u as ShellHook, v as SyncCategory, w as SyncConfig, T as ToolsConfig, x as formatContextWindowModeList, y as getContextWindowMode, z as isContextWindowModeId, B as listContextWindowModes, E as resolveContextWindowPolicy } from './config-Dy0CK_o6.js';
12
12
  export { C as CompactReport, a as Compactor } from './compactor-D_ExJajC.js';
13
- export { P as PermissionDecision, a as PermissionPolicy, T as TrustPolicy } from './permission-C1A5whY5.js';
13
+ export { P as PermissionDecision, a as PermissionPolicy, T as TrustPolicy } from './permission-V5BLOrY6.js';
14
14
  export { C as CheckpointInfo, R as RewindResult, a as RewindResultExtended, S as SessionRewinder } from './session-rewinder-C9HnMkhP.js';
15
15
  import { e as AttachmentStore, d as AttachmentRef, A as AddAttachmentInput } from './session-reader-BIpwM60D.js';
16
16
  export { a as Attachment, b as AttachmentKind, c as AttachmentMeta, D as DefaultSessionReader, f as DefaultSessionReaderOptions, S as SessionReader } from './session-reader-BIpwM60D.js';
17
17
  export { D as DEFAULT_AUTONOMY_CONFIG, a as DEFAULT_CONTEXT_CONFIG, b as DEFAULT_SESSION_LOGGING_CONFIG, c as DEFAULT_TOOLS_CONFIG } from './default-config-DEXI4jsl.js';
18
18
  import { a as DefaultSecretVault } from './secret-scrubber-7rSC_emZ.js';
19
19
  export { D as DefaultSecretScrubber, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from './secret-scrubber-7rSC_emZ.js';
20
- import { D as DefaultLogger } from './logger-bOzkF5LL.js';
21
- export { a as DefaultLoggerOptions } from './logger-bOzkF5LL.js';
22
- import { D as DefaultPathResolver } from './path-resolver-DVkEcIw8.js';
23
- export { a as DefaultTokenCounter } from './path-resolver-DVkEcIw8.js';
20
+ import { D as DefaultLogger } from './logger-BppKxDqZ.js';
21
+ export { a as DefaultLoggerOptions } from './logger-BppKxDqZ.js';
22
+ import { D as DefaultPathResolver } from './path-resolver-B32v2JIq.js';
23
+ export { a as DefaultTokenCounter } from './path-resolver-B32v2JIq.js';
24
24
  import { b as MemoryStore } from './memory-CEXuo7sz.js';
25
25
  export { M as MemoryEntry, a as MemoryScope } from './memory-CEXuo7sz.js';
26
- 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-0UwotoSx.js';
26
+ 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-Dn0P8Pbj.js';
27
27
  import { a as SkillLoader } from './skill-CxuWrsKK.js';
28
28
  export { S as SkillEntry, b as SkillManifest } from './skill-CxuWrsKK.js';
29
29
  export { I as InputReader, P as PromptOption } from './input-reader-E-ffP2ee.js';
30
- import { H as SlashCommand, w as PluginAPI, z as PluginPipelines, Z as ToolRegistryView, G as ProviderRegistryView, M as MCPRegistryView, I as SlashCommandRegistryView, S as SessionWriterView, t as MetricsSinkView, P as Plugin } from './agent-subagent-runner-DRZ9-NnR.js';
31
- export { A as Agent, c as AgentFactory, d as AgentFactoryResult, e as AgentRunnerOptions, g as BudgetExceededError, h as BudgetKind, i as BudgetLimits, n as BudgetUsage, C as CoordinatorEvents, o as CoordinatorStatus, D as DoneCondition, F as FleetBus, p as FleetEvent, q as FleetHandler, r as FleetUsage, s as FleetUsageAggregator, u as MultiAgentConfig, v as MultiAgentCoordinator, x as PluginCapabilities, y as PluginDependency, J as SpawnResult, K as SubagentBudget, L as SubagentConfig, N as SubagentContext, O as SubagentError, Q as SubagentErrorKind, R as SubagentRunContext, T as SubagentRunOutcome, U as SubagentRunner, V as SubagentUsageSnapshot, W as TaskDelegation, X as TaskResult, Y as TaskSpec, _ as makeAgentSubagentRunner } from './agent-subagent-runner-DRZ9-NnR.js';
30
+ import { H as SlashCommand, w as PluginAPI, z as PluginPipelines, Z as ToolRegistryView, G as ProviderRegistryView, M as MCPRegistryView, I as SlashCommandRegistryView, S as SessionWriterView, t as MetricsSinkView, P as Plugin } from './agent-subagent-runner-D8qW8OSC.js';
31
+ export { A as Agent, c as AgentFactory, d as AgentFactoryResult, e as AgentRunnerOptions, g as BudgetExceededError, h as BudgetKind, i as BudgetLimits, n as BudgetUsage, C as CoordinatorEvents, o as CoordinatorStatus, D as DoneCondition, F as FleetBus, p as FleetEvent, q as FleetHandler, r as FleetUsage, s as FleetUsageAggregator, u as MultiAgentConfig, v as MultiAgentCoordinator, x as PluginCapabilities, y as PluginDependency, J as SpawnResult, K as SubagentBudget, L as SubagentConfig, N as SubagentContext, O as SubagentError, Q as SubagentErrorKind, R as SubagentRunContext, T as SubagentRunOutcome, U as SubagentRunner, V as SubagentUsageSnapshot, W as TaskDelegation, X as TaskResult, Y as TaskSpec, _ as makeAgentSubagentRunner } from './agent-subagent-runner-D8qW8OSC.js';
32
32
  export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from './models-registry-Cuq1C8V9.js';
33
- import { c as ModeStore } from './mode-CV077NjV.js';
34
- export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest } from './mode-CV077NjV.js';
35
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-D-j6OOBT.js';
33
+ import { c as ModeStore } from './mode-BO4SEUIv.js';
34
+ export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest } from './mode-BO4SEUIv.js';
35
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-EWdqs8v6.js';
36
36
  import { l as TaskGraph, r as TaskType, n as TaskPriority, m as TaskNode } from './task-graph-D1YQbpxF.js';
37
37
  export { C as CriticalPathResult, 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, T as TaskAssignment, i as TaskDependency, j as TaskEdge, k as TaskFilter, o as TaskProgress, p as TaskSort, q as TaskStatus, s as computeTaskProgress, t as findCriticalPath, u as topologicalSort } from './task-graph-D1YQbpxF.js';
38
38
  import { T as Tracer, e as MetricsSink, b as HealthRegistry } from './observability-BhnVLBLS.js';
39
39
  export { A as AggregateHealth, H as HealthCheck, a as HealthCheckResult, c as HealthStatus, M as MetricLabels, d as MetricSeries, f as MetricsSnapshot, S as Span } from './observability-BhnVLBLS.js';
40
- import { S as SystemPromptContributor, E as ExtensionRegistry, t as ToolRegistry, m as ProviderRegistry, p as ToolCallPipelinePayload } from './index-DKUvyTvV.js';
41
- export { A as AfterIterationHook, a as AfterRunHook, b as AfterToolExecutionHook, c as AgentExtension, d as AgentInit, e as AgentInput, f as AgentPipelines, B as BeforeIterationHook, g as BeforeRunHook, h as BeforeToolExecutionHook, D as DEFAULT_MAX_ITERATIONS, H as HookRunEnv, i as HookRunner, j as HookRunnerOptions, O as OnErrorHook, P as PreToolUseResult, k as PromptResult, l as ProviderFactory, o as ProviderRunnerWrapper, R as RunResult, u as ToolWrapper, U as UserInputPayload, v as createDefaultPipelines } from './index-DKUvyTvV.js';
40
+ import { S as SystemPromptContributor, E as ExtensionRegistry, t as ToolRegistry, m as ProviderRegistry, p as ToolCallPipelinePayload } from './index-Dsda0uCn.js';
41
+ export { A as AfterIterationHook, a as AfterRunHook, b as AfterToolExecutionHook, c as AgentExtension, d as AgentInit, e as AgentInput, f as AgentPipelines, B as BeforeIterationHook, g as BeforeRunHook, h as BeforeToolExecutionHook, D as DEFAULT_MAX_ITERATIONS, H as HookRunEnv, i as HookRunner, j as HookRunnerOptions, O as OnErrorHook, P as PreToolUseResult, k as PromptResult, l as ProviderFactory, o as ProviderRunnerWrapper, R as RunResult, u as ToolWrapper, U as UserInputPayload, v as createDefaultPipelines } from './index-Dsda0uCn.js';
42
42
  export { AutonomyStage } from './types/index.js';
43
43
  export { AtomicWriteOptions, BuildChildEnvOptions, CompileFail, CompileResult, MessageRepairReport, MessageRepairResult, NewlineStyle, RequestTokenBreakdown, SafeParseResult, ToolOutputSerializerOptions, UnifiedDiffOptions, ValidationError, ValidationResult, atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, completePartialObject, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, formatTodosList, getCalibrationState, getTermSize, isInteractive, isStdinTTY, isStdoutTTY, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizeToLf, onResize, recordActualUsage, repairToolUseAdjacency, resetCalibration, safeParse, safeStringify, sanitizeJsonString, setRawMode, stripAnsi, toStyle, unifiedDiff, validateAgainstSchema, writeErr, writeOut } from './utils/index.js';
44
- import { a as WstackPaths } from './wstack-paths-eMXnY1_X.js';
45
- export { W as WstackPathOptions, p as projectHash, r as resolveWstackPaths } from './wstack-paths-eMXnY1_X.js';
46
- 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, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from './plan-templates-Bprrzhbu.js';
44
+ import { a as WstackPaths } from './wstack-paths-D7evAFWM.js';
45
+ export { W as WstackPathOptions, p as projectHash, b as projectSlug, r as resolveWstackPaths } from './wstack-paths-D7evAFWM.js';
46
+ 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, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from './plan-templates-BcUwLlMQ.js';
47
47
  export { A as AuditLevel, C as CORE_RECONSTRUCT_EVENTS, S as STANDARD_AUDIT_EVENTS, a as SessionEventBridge, b as SessionEventBridgeOptions, c as SessionSamplingOptions, T as ToolProgressSamplingOptions, d as createSessionEventBridge, r as resolveAuditLevel, e as resolveSessionLoggingConfig } from './session-event-bridge-CDHxcmQU.js';
48
48
  export { D as DirectorStateCheckpoint, a as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from './director-state-BmYi3DGA.js';
49
- export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from './permission-policy-B2dK-T5N.js';
49
+ export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from './permission-policy-CBVx-d-8.js';
50
50
  export { AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, AutonomyPromptContributorOptions, DefaultSkillLoader, DoneCheckResult, DoneConditionChecker, IntelligentCompactor, IntelligentCompactorOptions, SelectiveCompactor, SelectiveCompactorOptions, SkillLoaderOptions, buildGoalPreamble, makeAutonomyPromptContributor } from './execution/index.js';
51
51
  export { DefaultProviderRunner } from './defaults/index.js';
52
- 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-CuN0ObJr.js';
53
- export { A as AgentBudgetTier, a as AgentCapability, b as AgentDefinition, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f 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-CWnH-CiX.js';
52
+ 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-u5ys3lW_.js';
53
+ export { A as AgentBudgetTier, a as AgentCapability, b as AgentDefinition, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f 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-DpbG3wiy.js';
54
54
  export { DefaultModeStore, LLMSelector, LLMSelectorOptions, ModeLoaderOptions, loadProjectModes, loadUserModes } from './models/index.js';
55
55
  import { TaskStore } from './sdd/index.js';
56
56
  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';
57
57
  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';
58
- 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, p as slackServer, z as zaiVisionServer } from './mcp-servers-DwoNBf6r.js';
58
+ 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, p as slackServer, z as zaiVisionServer } from './mcp-servers-T0O6UN_w.js';
59
59
  export { DownloadResult, InstallResult, InstalledSkillEntry, ManifestData, ParsedRef, SkillInstaller, SkillInstallerOptions, SkillManifestStore, UpdateResult, downloadGitHubTarball, parseSkillRef } from './skills/index.js';
60
60
  import { ReplayLogStore, DefaultPromptStore } from './storage/index.js';
61
61
  export { ALL_SYNC_CATEGORIES, Annotation, AnnotationsStore, AnnotationsStoreOptions, AuditEntry, CloudSync, DefaultSessionRewinder, PromptEntry, PromptStore, RecoveryPlan, ReplayEntry, ReplayLogStoreOptions, SessionRecovery, SessionRewinderOptions, StaleSession, SyncResult, ToolAuditLog, ToolAuditLogOptions, VerifyResult } from './storage/index.js';
@@ -711,7 +711,7 @@ declare class InputBuilder {
711
711
  private shouldCollapse;
712
712
  }
713
713
 
714
- 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\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.\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. **Recover explicitly.** When a tool fails, state: (1) what failed, (2) what you tried, (3) what you'll attempt next. Never silently skip.\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 retry once with adjusted params, then report failure\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.";
714
+ 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.";
715
715
  interface DefaultSystemPromptBuilderOptions {
716
716
  memoryStore?: MemoryStore;
717
717
  skillLoader?: SkillLoader;
@@ -756,6 +756,8 @@ declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
756
756
  */
757
757
  private envCacheByRoot;
758
758
  private skillCache?;
759
+ /** Cached full skill bodies (after frontmatter), built once per session. */
760
+ private skillBodyCache?;
759
761
  constructor(opts?: DefaultSystemPromptBuilderOptions);
760
762
  build(ctx: BuildContext): Promise<TextBlock[]>;
761
763
  /**
@@ -966,6 +968,79 @@ declare function loadPlugins(plugins: Plugin[], opts: LoadPluginsOptions): Promi
966
968
  */
967
969
  declare function unloadPlugins(loadedPlugins: Plugin[], opts: LoadPluginsOptions): Promise<void>;
968
970
 
971
+ /**
972
+ * Prompt refinement ("did you mean this?").
973
+ *
974
+ * Runs a one-shot LLM call in a SEPARATE context (its own system prompt, no
975
+ * conversation history, no tools) that rewrites a raw user message into a
976
+ * clearer, more complete instruction BEFORE the main agent sees it. The goal
977
+ * is to make the main context start from a well-understood request rather than
978
+ * guessing intent from terse input like "fix the bug".
979
+ *
980
+ * This mirrors `IntelligentCompactor.callSummarizer` — a plain
981
+ * `provider.complete()` with a dedicated system prompt — and is deliberately
982
+ * free of React / TUI dependencies so it can be unit-tested in isolation.
983
+ */
984
+ declare const ENHANCER_SYSTEM_PROMPT = "You are a request refiner embedded in a coding agent. Your ONLY job is to rewrite the user's message into a single, clearer, unambiguous instruction that the coding agent can act on confidently.\n\nRules:\n- Preserve the user's intent and scope EXACTLY. Do not add new requirements, features, constraints, or steps the user did not ask for. Do not remove anything they did ask for.\n- Do NOT answer, solve, or perform the request. Only restate it more clearly.\n- Keep all concrete details verbatim: file paths, identifiers, code, error text, numbers, names, URLs.\n- Resolve obvious ambiguity by making the implied subject explicit, not by inventing specifics. If something is genuinely unspecified, leave it general rather than guessing.\n- Be concise: one tight instruction (a few sentences at most). No preamble, no explanation, no quotes, no markdown headers.\n- If the message is already clear and complete, return it essentially unchanged.\n- Preserve the user's language (if they wrote in Turkish, refine in Turkish).\n\nWhen earlier conversation turns are provided, they are CONTEXT ONLY. Use them to resolve references in the user's latest message \u2014 \"it\", \"that\", \"the same\", \"the other one\", \"this file\", \"again\" \u2014 so the refined instruction is self-contained. Refine ONLY the user's latest message; do not answer it, do not act on or restate earlier turns, and do not summarize the conversation.\n\nOutput ONLY the refined request text \u2014 nothing else.";
985
+ /**
986
+ * Heuristic gate: should this raw input be sent through the refiner at all?
987
+ * Pure + exported for unit testing. Returns false for inputs where refinement
988
+ * is pointless or unwanted (slash commands, one-word affirmations, trivially
989
+ * short text, bare numbers).
990
+ */
991
+ declare function shouldEnhance(text: string): boolean;
992
+ /**
993
+ * Normalize for "did the refiner actually change anything?" comparison —
994
+ * collapse whitespace and lowercase so trivial reformatting doesn't trigger
995
+ * the confirmation panel.
996
+ */
997
+ declare function normalizedEqual(a: string, b: string): boolean;
998
+ /** A single text-only conversation turn used as refiner context. */
999
+ interface ConversationTurn {
1000
+ role: 'user' | 'assistant';
1001
+ text: string;
1002
+ }
1003
+ interface EnhanceUserPromptOptions {
1004
+ provider: Provider;
1005
+ model: string;
1006
+ text: string;
1007
+ /**
1008
+ * Recent conversation turns (oldest→newest), text only, used purely as
1009
+ * CONTEXT so the refiner can resolve references in a follow-up message
1010
+ * ("it", "the same", "that file"). Without this, the refiner is blind to
1011
+ * the conversation and can only refine self-contained prompts. Build with
1012
+ * `recentTextTurns(ctx.messages)`.
1013
+ */
1014
+ history?: ConversationTurn[];
1015
+ /** Parent abort signal (e.g. the run controller / Esc). */
1016
+ signal?: AbortSignal;
1017
+ /** Hard cap on how long to wait for the refiner before giving up. Default 25s. */
1018
+ timeoutMs?: number;
1019
+ /** Max tokens for the refined output. Default 2048. */
1020
+ maxTokens?: number;
1021
+ /**
1022
+ * Called with a short reason when refinement fails (provider error, timeout,
1023
+ * empty response). NOT called when the caller cancels via `signal`. Lets the
1024
+ * UI surface *why* a refine fell through instead of a generic message.
1025
+ */
1026
+ onError?: (reason: string) => void;
1027
+ }
1028
+ /**
1029
+ * Refine a raw user prompt. Returns the refined text, or `null` when the
1030
+ * caller should fall back to the original (refiner errored, timed out, was
1031
+ * aborted, or returned nothing useful). NEVER throws — refinement is a
1032
+ * best-effort convenience and must never block the user from sending.
1033
+ */
1034
+ declare function enhanceUserPrompt(opts: EnhanceUserPromptOptions): Promise<string | null>;
1035
+ /**
1036
+ * Extract the last few user/assistant TEXT turns from a conversation, newest
1037
+ * last, for use as refiner context. Skips system messages and tool-only turns
1038
+ * (tool_use / tool_result carry no useful natural-language context and bloat
1039
+ * the call). Each turn is truncated to `maxChars`; at most `maxTurns` are
1040
+ * returned. Pure + exported for unit testing.
1041
+ */
1042
+ declare function recentTextTurns(messages: Message[], maxTurns?: number, maxChars?: number): ConversationTurn[];
1043
+
969
1044
  type PhaseStatus = 'pending' | 'ready' | 'running' | 'paused' | 'completed' | 'failed' | 'skipped';
970
1045
  interface PhaseNode {
971
1046
  id: string;
@@ -1967,4 +2042,4 @@ interface PlanPluginOptions {
1967
2042
  */
1968
2043
  declare function createPlanPlugin(opts?: PlanPluginOptions): Plugin;
1969
2044
 
1970
- export { AddAttachmentInput, AttachmentRef, AttachmentStore, type AutoPhaseOptions, type AutoPhasePlanResult, AutoPhasePlanner, type AutoPhasePlannerOptions, AutoPhaseRunner, type AutoPhaseRunnerOptions, type BootConfigOptions, type BootConfigResult, BrainArbiter, BuildContext, type Checkpoint, CheckpointManager, type CheckpointManagerOptions, type CollabBusState, type InjectedToolResult as CollabInjectedToolResult, type CollabPauseMiddlewareOptions, CollaborationBus, Config, ConfigStore, Container, ContentBlock, Context, type ContinueDirective, DefaultLogger, DefaultPathResolver, DefaultPluginAPI, DefaultPromptStore, DefaultSecretVault, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type DetectedDependency, type DetectionResult, EventBus, EventName, ExtensionRegistry, 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, type MatrixKeyKind, MemoryStore, MetricsSink, MetricsSinkView, ModeStore, ModelCapabilities, ModelMatrixEntry, type PackageManager, 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, ReplayLogStore, type ReplayMode, ReplayProviderRunner, type ReplayProviderRunnerOptions, ReportGenerator, type ReportOptions, Request, 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, TechStackDetector, type TechStackInfo, TextBlock, Tool, ToolRegistry, ToolRegistryView, Tracer, WorktreeManager, WstackPaths, bootConfig, buildBtwBlock, collabInjectMiddleware, collabPauseMiddleware, consumeBtwNotes, createAutoPhaseFromTaskGraph, createGitPlugin, createMcpControlTool, createObservabilityPlugin, createPlanPlugin, createPromptsPlugin, createSecurityPlugin, createSecuritySlashCommand, createSkillsPlugin, createSyncPlugin, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, flagsToConfigPatch, hashRequest, isValidMatrixKey, loadPlugins, makeContinueToNextIterationTool, matrixKeyKind, parseContinueDirective, pendingBtwCount, phaseForRole, resolveModelMatrix, runProviderWithRetry, runShellHook, securitySlashCommand, setBtwNote, stableStringify, unloadPlugins };
2045
+ export { AddAttachmentInput, AttachmentRef, AttachmentStore, type AutoPhaseOptions, type AutoPhasePlanResult, AutoPhasePlanner, type AutoPhasePlannerOptions, AutoPhaseRunner, type AutoPhaseRunnerOptions, type BootConfigOptions, type BootConfigResult, BrainArbiter, BuildContext, type Checkpoint, CheckpointManager, type CheckpointManagerOptions, type CollabBusState, type InjectedToolResult as CollabInjectedToolResult, type CollabPauseMiddlewareOptions, CollaborationBus, Config, ConfigStore, Container, ContentBlock, Context, type ContinueDirective, type ConversationTurn, DefaultLogger, DefaultPathResolver, DefaultPluginAPI, DefaultPromptStore, DefaultSecretVault, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type DetectedDependency, type DetectionResult, ENHANCER_SYSTEM_PROMPT, type EnhanceUserPromptOptions, EventBus, EventName, ExtensionRegistry, 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, type MatrixKeyKind, MemoryStore, Message, MetricsSink, MetricsSinkView, ModeStore, ModelCapabilities, ModelMatrixEntry, type PackageManager, 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, ReplayLogStore, type ReplayMode, ReplayProviderRunner, type ReplayProviderRunnerOptions, ReportGenerator, type ReportOptions, Request, 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, TechStackDetector, type TechStackInfo, TextBlock, Tool, ToolCallPipelinePayload, ToolRegistry, ToolRegistryView, Tracer, WorktreeManager, WstackPaths, bootConfig, buildBtwBlock, collabInjectMiddleware, collabPauseMiddleware, consumeBtwNotes, createAutoPhaseFromTaskGraph, createGitPlugin, createMcpControlTool, createObservabilityPlugin, createPlanPlugin, createPromptsPlugin, createSecurityPlugin, createSecuritySlashCommand, createSkillsPlugin, createSyncPlugin, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, enhanceUserPrompt, flagsToConfigPatch, hashRequest, isValidMatrixKey, loadPlugins, makeContinueToNextIterationTool, matrixKeyKind, normalizedEqual, parseContinueDirective, pendingBtwCount, phaseForRole, recentTextTurns, resolveModelMatrix, runProviderWithRetry, runShellHook, securitySlashCommand, setBtwNote, shouldEnhance, stableStringify, unloadPlugins };