@wrongstack/core 0.264.0 → 0.267.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/{agent-bridge-D8sa1vtv.d.ts → agent-bridge-STJ3JwwK.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-c9DLkaas.d.ts → agent-subagent-runner-CzPGP3jA.d.ts} +131 -11
  3. package/dist/{brain-O1IdKPaK.d.ts → brain-Cdg77tVN.d.ts} +103 -2
  4. package/dist/{compactor-BBy0rCtB.d.ts → compactor-iMZ84CXq.d.ts} +19 -1
  5. package/dist/{config-Dz2F3H2K.d.ts → config-Du3pYYln.d.ts} +132 -13
  6. package/dist/{context-BGSpZNSE.d.ts → context-dT5Ueund.d.ts} +90 -12
  7. package/dist/coordination/index.d.ts +78 -22
  8. package/dist/coordination/index.js +695 -273
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/{default-config-CXsDvOmP.d.ts → default-config-B0cj-Hry.d.ts} +11 -1
  11. package/dist/defaults/index.d.ts +28 -28
  12. package/dist/defaults/index.js +2327 -965
  13. package/dist/defaults/index.js.map +1 -1
  14. package/dist/execution/index.d.ts +16 -16
  15. package/dist/execution/index.js +1500 -371
  16. package/dist/execution/index.js.map +1 -1
  17. package/dist/execution/prompt-enhancer.d.ts +2 -2
  18. package/dist/execution/prompt-enhancer.js +1 -1
  19. package/dist/execution/prompt-enhancer.js.map +1 -1
  20. package/dist/extension/index.d.ts +6 -6
  21. package/dist/{goal-preamble-DzjFuN3p.d.ts → goal-preamble-SulMTowG.d.ts} +33 -12
  22. package/dist/{goal-store-CxWmCGbH.d.ts → goal-store-CABDwdFE.d.ts} +1 -1
  23. package/dist/{index-CbLSI66_.d.ts → index-Bms0m4oy.d.ts} +5 -5
  24. package/dist/{index-CYIQrXVF.d.ts → index-DtCVWel4.d.ts} +8 -8
  25. package/dist/index-IEuxQd-E.d.ts +82 -0
  26. package/dist/index.d.ts +261 -57
  27. package/dist/index.js +4799 -2212
  28. package/dist/index.js.map +1 -1
  29. package/dist/infrastructure/index.d.ts +6 -6
  30. package/dist/infrastructure/index.js +84 -9
  31. package/dist/infrastructure/index.js.map +1 -1
  32. package/dist/kernel/index.d.ts +9 -9
  33. package/dist/kernel/index.js +1 -1
  34. package/dist/kernel/index.js.map +1 -1
  35. package/dist/{mcp-servers-DC4QRPUI.d.ts → mcp-servers-C2cBTxUR.d.ts} +3 -3
  36. package/dist/models/index.d.ts +5 -5
  37. package/dist/models/index.js +104 -31
  38. package/dist/models/index.js.map +1 -1
  39. package/dist/{models-registry-B_siPxqN.d.ts → models-registry-BqGZNJQ-.d.ts} +1 -1
  40. package/dist/{multi-agent-coordinator-CK5Jdj9K.d.ts → multi-agent-coordinator-B8R43uPz.d.ts} +1 -1
  41. package/dist/{null-fleet-bus-DgvD4SCO.d.ts → null-fleet-bus-CnXa5oTH.d.ts} +14 -9
  42. package/dist/observability/index.d.ts +2 -2
  43. package/dist/{parallel-eternal-engine-bK0JQBR_.d.ts → parallel-eternal-engine-DdNnw9BQ.d.ts} +11 -9
  44. package/dist/{path-resolver-BPEDlN38.d.ts → path-resolver-COIMLCQL.d.ts} +3 -3
  45. package/dist/{permission-4yvGmMRB.d.ts → permission-B75JAi3-.d.ts} +1 -1
  46. package/dist/{permission-policy-C6XpsBOy.d.ts → permission-policy-DlR9eJAM.d.ts} +2 -2
  47. package/dist/{pipeline-CXCeMz8J.d.ts → pipeline-BfD2k1rT.d.ts} +3 -3
  48. package/dist/{plan-templates-BvzRBkJc.d.ts → plan-templates-DSIKCXZN.d.ts} +32 -8
  49. package/dist/provider-model-resolve-BNRsNuJx.d.ts +107 -0
  50. package/dist/{provider-runner-C5aQpDWE.d.ts → provider-runner-CX7iIvox.d.ts} +3 -3
  51. package/dist/{retry-policy-CFhdtRzz.d.ts → retry-policy-BilV1ujH.d.ts} +1 -1
  52. package/dist/sdd/index.d.ts +8 -8
  53. package/dist/sdd/index.js +286 -105
  54. package/dist/sdd/index.js.map +1 -1
  55. package/dist/secret-vault-BAKpgFw_.d.ts +57 -0
  56. package/dist/{secret-vault-CxiVLbt1.d.ts → secret-vault-gkvEZZfE.d.ts} +43 -4
  57. package/dist/security/index.d.ts +6 -68
  58. package/dist/security/index.js +296 -95
  59. package/dist/security/index.js.map +1 -1
  60. package/dist/{selector-gIuhRTkN.d.ts → selector-Bc7eWtT3.d.ts} +1 -1
  61. package/dist/{session-event-bridge-DkvvrpDt.d.ts → session-event-bridge-D-araDEz.d.ts} +1 -1
  62. package/dist/{session-reader-KdfVwkKP.d.ts → session-reader-D7Dapswh.d.ts} +1 -1
  63. package/dist/storage/index.d.ts +112 -15
  64. package/dist/storage/index.js +491 -156
  65. package/dist/storage/index.js.map +1 -1
  66. package/dist/tools/index.d.ts +4 -2
  67. package/dist/tools/index.js.map +1 -1
  68. package/dist/types/index.d.ts +21 -21
  69. package/dist/types/index.js +1523 -450
  70. package/dist/types/index.js.map +1 -1
  71. package/dist/utils/index.d.ts +455 -407
  72. package/dist/utils/index.js +2191 -1203
  73. package/dist/utils/index.js.map +1 -1
  74. package/dist/{wstack-paths-CJjEwPXn.d.ts → wstack-paths-hOpNLmvf.d.ts} +2 -0
  75. package/package.json +1 -1
  76. package/skills/api-design/SKILL.md +1 -1
  77. package/skills/audit-log/SKILL.md +6 -6
  78. package/skills/bug-hunter/SKILL.md +5 -5
  79. package/skills/chimera/SKILL.md +4 -4
  80. package/skills/docker-deploy/SKILL.md +1 -1
  81. package/skills/git-flow/SKILL.md +3 -3
  82. package/skills/multi-agent/SKILL.md +3 -3
  83. package/skills/node-modern/SKILL.md +1 -0
  84. package/skills/observability/SKILL.md +2 -2
  85. package/skills/output-standards/SKILL.md +51 -28
  86. package/skills/refactor-planner/SKILL.md +3 -3
  87. package/skills/security-scanner/SKILL.md +4 -3
  88. package/skills/tech-stack/SKILL.md +1 -2
  89. package/dist/llm-selector-DzxuZnNz.d.ts +0 -58
  90. package/dist/secret-vault-BJDY28ev.d.ts +0 -25
package/dist/index.d.ts CHANGED
@@ -1,83 +1,84 @@
1
- import { S as SystemPromptBuilder, b as ModelCapabilities, B as BuildContext, C as Container, H as HookRegistry, c as Mailbox, d as MailboxMessage, a as Renderer } from './pipeline-CXCeMz8J.js';
2
- export { A as AgentHeartbeatInput, e as AgentRegistrationInput, f as BindOptions, D as Decorator, F as Factory, g as MailboxAckInput, h as MailboxAgentStatus, i as MailboxMessageType, j as MailboxQuery, k as MailboxSendInput, l as MailboxTaskContext, m as Middleware, M as MiddlewareHandler, N as NextFn, P as Pipeline, n as PipelineOptions, o as ReadReceipts, p as RegisteredAgent, T as Token, q as hookMatcherMatches, r as normalizeRecipient } from './pipeline-CXCeMz8J.js';
3
- import { E as EventBus, c as MemoryStore, a as EventName, L as Listener, B as BrainArbiter } from './brain-O1IdKPaK.js';
4
- export { e as BrainDecision, f as BrainDecisionOption, g as BrainDecisionQueue, h as BrainDecisionRequest, i as BrainDecisionSource, j as BrainFallback, k as BrainRisk, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, m as EventLogger, n as EventMap, H as HumanEscalatingBrainArbiter, o as MEMORY_TYPE_LABELS, p as MemoryClearedPayload, q as MemoryConsolidatedPayload, b as MemoryEntry, r as MemoryForgottenPayload, s as MemoryPriority, d as MemoryRelevanceContext, t as MemoryRememberedPayload, M as MemoryScope, u as MemoryType, O as ObservableBrainArbiter, v as ScopedEventBus, S as ScoredEntry, w as formatHumanPrompt } from './brain-O1IdKPaK.js';
5
- import { W as WorktreeManager } from './index-CYIQrXVF.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-CYIQrXVF.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-BGSpZNSE.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-BGSpZNSE.js';
9
- import { P as ProviderRunner, R as RunProviderOptions$1 } from './provider-runner-C5aQpDWE.js';
10
- import { l as HookInput, m as HookOutcome, h as Config, H as HookEvent, e as HookMatcher, I as InProcessHook, d as ModelMatrixEntry, i as ConfigStore } from './config-Dz2F3H2K.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, c as MCPServerConfig, 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-Dz2F3H2K.js';
12
- export { a as CompactReport, C as Compactor } from './compactor-BBy0rCtB.js';
13
- import { P as PermissionPolicy } from './permission-4yvGmMRB.js';
14
- export { a as PermissionDecision, S as SecretScrubber, T as TrustPolicy } from './permission-4yvGmMRB.js';
1
+ import { S as SystemPromptBuilder, b as ModelCapabilities, B as BuildContext, C as Container, H as HookRegistry, c as Mailbox, d as MailboxMessage, a as Renderer } from './pipeline-BfD2k1rT.js';
2
+ export { A as AgentHeartbeatInput, e as AgentRegistrationInput, f as BindOptions, D as Decorator, F as Factory, g as MailboxAckInput, h as MailboxAgentStatus, i as MailboxMessageType, j as MailboxQuery, k as MailboxSendInput, l as MailboxTaskContext, m as Middleware, M as MiddlewareHandler, N as NextFn, P as Pipeline, n as PipelineOptions, o as ReadReceipts, p as RegisteredAgent, T as Token, q as hookMatcherMatches, r as normalizeRecipient } from './pipeline-BfD2k1rT.js';
3
+ import { E as EventBus, c as MemoryStore, a as EventName, L as Listener, B as BrainArbiter } from './brain-Cdg77tVN.js';
4
+ export { e as BrainDecision, f as BrainDecisionOption, g as BrainDecisionQueue, h as BrainDecisionRequest, i as BrainDecisionSource, j as BrainFallback, k as BrainRisk, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, m as EventLogger, n as EventMap, H as HumanEscalatingBrainArbiter, o as MEMORY_TYPE_LABELS, p as MemoryClearedPayload, q as MemoryConsolidatedPayload, b as MemoryEntry, r as MemoryForgottenPayload, s as MemoryPriority, d as MemoryRelevanceContext, t as MemoryRememberedPayload, M as MemoryScope, u as MemoryType, O as ObservableBrainArbiter, v as ScopedEventBus, S as ScoredEntry, w as formatHumanPrompt } from './brain-Cdg77tVN.js';
5
+ import { W as WorktreeManager } from './index-DtCVWel4.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-DtCVWel4.js';
7
+ import { C as Context, P as Provider, T as Tool, R as Request, b as Response, M as Message, g as ContentBlock, o as TextBlock, J as JSONSchema } from './context-dT5Ueund.js';
8
+ export { A as AgentError, d as CacheStats, l as Capabilities, v as ConfigError, w as ContextEvidenceState, x as ContextFileEvidence, y as ContextInit, z as ContextIntentEvidence, B as ContextRepeatedReadEvidence, u as ConversationState, E as ERROR_CODES, D as ErrorCode, F as ErrorSeverity, G as ErrorSubsystem, H as FileSnapshot, I as FsError, K as ImageBlock, L as MessageRole, f as Permission, N as PluginError, e as ProviderError, O as ProviderErrorBody, Q as ReadonlyConversationState, q as ResumedSession, V as RiskTier, W as RunEnv, p as RunOptions, X as SddError, r as SessionData, Y as SessionError, S as SessionEvent, h as SessionMetadata, i as SessionStore, s as SessionSummary, a as SessionWriter, Z as StateChange, _ as StateChangeHandler, $ as StopReason, a0 as StreamEvent, a1 as StreamHangError, a2 as ThinkingBlock, t as TodoItem, c as TokenCounter, a3 as ToolCallContext, a4 as ToolError, a5 as ToolEvidenceStatus, a6 as ToolFinalEvent, a7 as ToolIconId, k as ToolOutputMetadata, j as ToolProgressEvent, n as ToolResultBlock, a8 as ToolStreamEvent, m as ToolUseBlock, U as Usage, a9 as WrongStackError, aa as asBlocks, ab as asText, ac as extractRunEnv, ad as isAgentError, ae as isConfigError, af as isFsError, ag as isImageBlock, ah as isPluginError, ai as isSddError, aj as isSessionError, ak as isTextBlock, al as isThinkingBlock, am as isToolError, an as isToolResultBlock, ao as isToolUseBlock, ap as isWrongStackError, aq as toWrongStackError, ar as wrapAsState } from './context-dT5Ueund.js';
9
+ import { P as ProviderRunner, R as RunProviderOptions$1 } from './provider-runner-CX7iIvox.js';
10
+ import { m as HookInput, n as HookOutcome, i as Config, T as TokenSavingTier, H as HookEvent, f as HookMatcher, I as InProcessHook, d as ModelMatrixEntry, j as ConfigStore } from './config-Du3pYYln.js';
11
+ export { A as AutonomyConfig, o as CONTEXT_WINDOW_MODES, p as CircuitBreakerRuntimeConfig, k as ConfigLoader, q as ContextConfig, C as ContextWindowAggressiveOn, r as ContextWindowConfigLike, s as ContextWindowMode, t as ContextWindowModeId, h as ContextWindowPolicy, u as ContextWindowThresholds, v as CustomModelDefinition, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, g as HookEntry, w as IndexingConfig, L as LaunchConfig, x as LogConfig, c as MCPServerConfig, e as ModelsDevModel, a as ModelsDevPayload, y as ModelsDevProvider, M as ModelsRegistry, z as PluginConfig, B as ProviderApiKey, P as ProviderConfig, b as ResolvedModel, R as ResolvedProvider, E as SessionLoggingConfig, S as ShellHook, G as SyncCategory, l as SyncConfig, J as ToolsConfig, W as WireFamily, K as formatContextWindowModeList, N as getContextWindowMode, O as isContextWindowModeId, Q as listContextWindowModes, U as normalizeTokenSavingTier, V as resolveContextWindowPolicy } from './config-Du3pYYln.js';
12
+ export { a as CompactReport, C as Compactor } from './compactor-iMZ84CXq.js';
13
+ import { P as PermissionPolicy } from './permission-B75JAi3-.js';
14
+ export { a as PermissionDecision, S as SecretScrubber, T as TrustPolicy } from './permission-B75JAi3-.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-KdfVwkKP.js';
17
- export { c as Attachment, d as AttachmentKind, e as AttachmentMeta, D as DefaultSessionReader, f as DefaultSessionReaderOptions, S as SessionReader } from './session-reader-KdfVwkKP.js';
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-CxiVLbt1.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-CxiVLbt1.js';
16
+ import { A as AttachmentStore, b as AttachmentRef, a as AddAttachmentInput } from './session-reader-D7Dapswh.js';
17
+ export { c as Attachment, d as AttachmentKind, e as AttachmentMeta, D as DefaultSessionReader, f as DefaultSessionReaderOptions, S as SessionReader } from './session-reader-D7Dapswh.js';
18
+ export { D as DEFAULT_AUTONOMY_CONFIG, a as DEFAULT_CIRCUIT_BREAKER_CONFIG, b as DEFAULT_CONTEXT_CONFIG, c as DEFAULT_SESSION_LOGGING_CONFIG, d as DEFAULT_SESSION_PRUNE_DAYS, e as DEFAULT_TOOLS_CONFIG } from './default-config-B0cj-Hry.js';
19
+ import { D as DefaultSecretVault } from './secret-vault-gkvEZZfE.js';
20
+ export { a as DefaultSecretScrubber, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, i as isSecretField, m as migratePlaintextSecrets, r as rewriteConfigEncrypted, b as rotateConfigKeys } from './secret-vault-gkvEZZfE.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-BPEDlN38.js';
24
- export { a as DefaultTokenCounter } from './path-resolver-BPEDlN38.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-bK0JQBR_.js';
23
+ import { D as DefaultPathResolver } from './path-resolver-COIMLCQL.js';
24
+ export { a as DefaultTokenCounter } from './path-resolver-COIMLCQL.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-DdNnw9BQ.js';
26
26
  import { S as SkillLoader } from './skill-DGIXCtdv.js';
27
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 { k as SlashCommand, P as PluginAPI, l as PluginPipelines, m as ToolRegistryView, n as ProviderRegistryView, o as MCPRegistryView, p as SlashCommandRegistryView, q as SessionWriterView, r as MetricsSinkView, s as PluginCapabilities, t as Plugin } from './agent-subagent-runner-c9DLkaas.js';
30
- export { g as Agent, h as AgentFactory, u as AgentFactoryResult, v as AgentRunnerOptions, w as BudgetExceededError, x as BudgetKind, y as BudgetLimits, z as BudgetNegotiationMode, E as BudgetThresholdDecision, G as BudgetThresholdHandler, H as BudgetThresholdSignal, I as BudgetUsage, J as CoordinatorEvents, C as CoordinatorStatus, D as DoneCondition, F as FleetBus, K as FleetEvent, L as FleetHandler, i as FleetUsage, j as FleetUsageAggregator, c as MultiAgentConfig, M as MultiAgentCoordinator, N as PluginDependency, e as SpawnResult, O as SubagentBudget, S as SubagentConfig, Q as SubagentContext, R as SubagentError, U as SubagentErrorKind, V as SubagentRunContext, W as SubagentRunOutcome, d as SubagentRunner, X as SubagentUsageSnapshot, Y as TaskDelegation, f as TaskResult, T as TaskSpec, Z as makeAgentSubagentRunner, _ as withDisabledToolFiltering } from './agent-subagent-runner-c9DLkaas.js';
31
- export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from './models-registry-B_siPxqN.js';
29
+ import { k as SlashCommand, P as PluginAPI, l as PluginPipelines, m as ToolRegistryView, n as ProviderRegistryView, o as MCPRegistryView, p as SlashCommandRegistryView, q as SessionWriterView, r as MetricsSinkView, s as PluginCapabilities, t as PluginDependency, u as Plugin } from './agent-subagent-runner-CzPGP3jA.js';
30
+ export { g as Agent, h as AgentFactory, v as AgentFactoryResult, w as AgentRunnerOptions, x as BudgetExceededError, y as BudgetKind, z as BudgetLimits, E as BudgetNegotiationMode, G as BudgetThresholdDecision, H as BudgetThresholdHandler, I as BudgetThresholdSignal, J as BudgetUsage, K as CoordinatorEvents, C as CoordinatorStatus, L as DECISION_TIMEOUT_MS, D as DoneCondition, F as FleetBus, N as FleetEvent, O as FleetHandler, i as FleetUsage, j as FleetUsageAggregator, c as MultiAgentConfig, M as MultiAgentCoordinator, e as SpawnResult, Q as SubagentBudget, S as SubagentConfig, R as SubagentContext, U as SubagentError, V as SubagentErrorKind, W as SubagentRunContext, X as SubagentRunOutcome, d as SubagentRunner, Y as SubagentUsageSnapshot, Z as TIMEOUT_PREEMPT_FRACTION, _ as TaskDelegation, f as TaskResult, T as TaskSpec, $ as makeAgentSubagentRunner, a0 as withDisabledToolFiltering } from './agent-subagent-runner-CzPGP3jA.js';
31
+ export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from './models-registry-BqGZNJQ-.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-D8sa1vtv.js';
34
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-STJ3JwwK.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 { e as ToolRegistry, S as SystemPromptContributor, E as ExtensionRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, c as ToolCallPipelinePayload } from './index-CbLSI66_.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-CbLSI66_.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-Bms0m4oy.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-Bms0m4oy.js';
42
42
  export { AutonomyStage, DistributiveOmit, DistributivePick } from './types/index.js';
43
43
  import { estimateMessageTokens } from './utils/index.js';
44
- export { AtomicWriteOptions, BuildChildEnvOptions, CompileFail, CompileResult, DeepMergeOptions, FORBIDDEN_PROTO_KEYS, FileLockOptions, MessageRepairReport, MessageRepairResult, NewlineStyle, OutputLineGuard, RequestTokenBreakdown, SafeParseResult, ToolOutputSerializerOptions, UnifiedDiffOptions, ValidationError, ValidationResult, assertNever, assertNotPrivateHost, atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, completePartialObject, computeMessageTokens, createToolOutputSerializer, deepMerge, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, expandIPv6, formatTodosList, getCalibrationState, getTermSize, isInteractive, isPrimitiveArray, isPrivateIPv4, isPrivateIPv6, 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';
45
- export { T as TaskItem, c as computeTaskItemProgress, f as formatTaskList, a as formatTaskProgress } from './task-format-vGOIftmK.js';
46
- import { W as WstackPaths } from './wstack-paths-CJjEwPXn.js';
47
- export { a as WstackPathOptions, p as projectHash, b as projectSlug, r as resolveWstackPaths, w as wstackGlobalRoot } from './wstack-paths-CJjEwPXn.js';
48
- export { expectDefined } from './utils/expect-defined.js';
49
- export { toErrorMessage } from './utils/error.js';
44
+ export { AtomicWriteOptions, BuildChildEnvOptions, CompactToolDefinitionForWireOptions, CompactWireToolDefinition, CompileFail, CompileResult, DeepMergeOptions, FORBIDDEN_PROTO_KEYS, FileLockOptions, MessageRepairReport, MessageRepairResult, NewlineStyle, OutputLineGuard, RecordToolOutputEvidenceInput, RequestTokenBreakdown, SafeParseResult, ToolOutputSerializerOptions, ToolWireDefinitionLike, UnifiedDiffOptions, ValidationError, ValidationResult, assertNever, assertNotPrivateHost, atomicWrite, buildChildEnv, buildContextEvidenceDigest, color, compactSchemaDescriptions, compactToolDefinitionForWire, compileGlob, compileUserRegex, completePartialObject, computeMessageTokens, createContextEvidenceState, createToolOutputSerializer, deepMerge, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, expandIPv6, formatTodosList, getCalibrationState, getTermSize, isInteractive, isPrimitiveArray, isPrivateIPv4, isPrivateIPv6, isStdinTTY, isStdoutTTY, markAssistantReferencedEvidence, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizeToLf, onResize, recordActualUsage, recordToolOutputEvidence, recordUserIntentEvidence, repairToolUseAdjacency, repeatedReadPressure, resetCalibration, safeParse, safeStringify, sanitizeJsonString, setOutputLineGuard, setRawMode, sleep, stripAnsi, toStyle, truncate, unifiedDiff, validateAgainstSchema, withFileLock, writeErr, writeOut } from './utils/index.js';
50
45
  export { H as HttpDispatcher, a as HttpsAgentAsDispatcher } from './dispatcher-types.d-BBeXBQgS.js';
51
- 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-BvzRBkJc.js';
52
- 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-DkvvrpDt.js';
46
+ export { toErrorMessage } from './utils/error.js';
47
+ export { expectDefined } from './utils/expect-defined.js';
48
+ export { T as TaskItem, c as computeTaskItemProgress, f as formatTaskList, a as formatTaskProgress } from './task-format-vGOIftmK.js';
49
+ import { W as WstackPaths } from './wstack-paths-hOpNLmvf.js';
50
+ export { a as WstackPathOptions, p as projectHash, b as projectSlug, r as resolveWstackPaths, w as wstackGlobalRoot } from './wstack-paths-hOpNLmvf.js';
51
+ 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-DSIKCXZN.js';
52
+ 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-D-araDEz.js';
53
53
  export { a as DirectorStateCheckpoint, D as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from './director-state-BfeCUbmk.js';
54
- export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from './permission-policy-C6XpsBOy.js';
55
- 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-DzjFuN3p.js';
54
+ export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from './permission-policy-DlR9eJAM.js';
55
+ 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-SulMTowG.js';
56
56
  export { DefaultProviderRunner } from './defaults/index.js';
57
- export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, H as FleetManager, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from './null-fleet-bus-DgvD4SCO.js';
58
- export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, b as AgentDefinition, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from './multi-agent-coordinator-CK5Jdj9K.js';
59
- export { D as DefaultModeStore, L as LLMSelector, a as LLMSelectorOptions, M as ModeLoaderOptions, l as loadProjectModes, b as loadUserModes } from './llm-selector-DzxuZnNz.js';
57
+ export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, H as FleetManager, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from './null-fleet-bus-CnXa5oTH.js';
58
+ export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, b as AgentDefinition, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from './multi-agent-coordinator-B8R43uPz.js';
59
+ export { D as DefaultModeStore, L as LLMSelector, a as LLMSelectorOptions, M as ModeLoaderOptions, P as ProviderModelDescriptor, d as describeCatalogModel, l as loadProjectModes, b as loadUserModes, r as resolveProviderModelList } from './provider-model-resolve-BNRsNuJx.js';
60
60
  import { TaskStore } from './sdd/index.js';
61
61
  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';
62
62
  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';
63
- 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-DC4QRPUI.js';
63
+ 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-C2cBTxUR.js';
64
64
  export { DownloadResult, InstallResult, InstalledSkillEntry, ManifestData, ParsedRef, SkillInstaller, SkillInstallerOptions, SkillManifestStore, UpdateResult, downloadGitHubTarball, parseSkillRef } from './skills/index.js';
65
65
  import { ReplayLogStore, DefaultPromptStore } from './storage/index.js';
66
- 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';
67
- 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-CxWmCGbH.js';
68
- import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-CFhdtRzz.js';
66
+ export { ALL_SYNC_CATEGORIES, AgentEntry, AgentLiveStatus, AgentStatusTracker, AgentStatusTrackerOptions, Annotation, AnnotationsStore, AnnotationsStoreOptions, AuditEntry, CloudSync, ConsolidationOp, DefaultSessionRewinder, FleetNotifier, FleetNotifierOptions, 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';
67
+ 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-CABDwdFE.js';
68
+ import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-BilV1ujH.js';
69
69
  export { ApplyResult, ApprovalDecision, AutonomousBrain, AutonomousBrainOptions, AutonomousCoordinator, AutonomousCoordinatorOptions, AutonomousDecisionRequest, AutonomousDecisionType, BUILD_AGENTS, BrainInterventionInput, BrainMonitor, BrainMonitorOptions, ChangeFile, ChangeManager, ChangeManagerOptions, ChangeNode, ChangeProposal, ChangeStatus, ConsensusOptions, ConsensusProtocol, ConsensusResult, CoordinatorEvent, CoordinatorStats, DAGEdgeEvent, DAGEdgeHandler, DAGNode, DAGNodeStatus, DEFAULT_QUALITY_CHECKS, DELIVERY_AGENTS, DEPENDENCY_FILE_PATTERNS, DISCOVERY_AGENTS, DOMAIN_AGENTS, DecisionNode, DecisionPrompt, DefaultMailbox, DepWatchEntry, DepWatcherBridgeOptions, DependencyWatcherConfig, EscalationDecision, FactCategory, FactNode, GlobalMailbox, GoalNode, GoalPriority, GoalStatus, GraphSubscription, KNOWLEDGE_AGENTS, KnowledgeGraph, LLMProvider, META_AGENTS, MailToolsOptions, MailboxHooksOptions, MailboxResolver, MailboxToolOptions, NodeFilter, NodeType, OutdatedNotifyMessage, PLANNING_AGENTS, PackageAuthorEntry, PackageAuthorLog, PackageAuthorTrackerOptions, PackageOutdatedEntry, PackageOutdatedResult, PackageOutdatedWatcherOptions, PrioritizationDecision, QualityCheck, QualityGateChecks, QualityGateResult, QuorumRule, REVIEW_AGENTS, RollbackResult, RunnablesHandler, SpawnDecision, TaskAuctionOptions, TaskAuctioneer, TaskBid, TaskDAG, VERIFY_AGENTS, VoteNode, VoteRecord, VoteValue, VoterConfig, attachDepWatcherBridge, createMailboxHooks, detectEcosystem, detectEcosystem as detectPackageEcosystem, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, mailboxSessionTag, makeDependencyWatcherConfig, makeMailInboxTool, makeMailSendTool, makeMailboxTool, recordPackageAction, resolveMailboxIdentity, resolveProjectDir, startPackageOutdatedWatcher, updatePackageOutdatedStatus } from './coordination/index.js';
70
70
  import { MCPRegistryHandle } from './tools/index.js';
71
71
  export { createMcpControlTool } from './tools/index.js';
72
72
  import { L as Logger } from './logger-B63L5bTg.js';
73
73
  export { a as LogLevel } from './logger-B63L5bTg.js';
74
- export { S as SecretVault, n as noOpVault } from './secret-vault-BJDY28ev.js';
74
+ export { R as RotatableSecretVault, S as SecretVault, e as encryptedPrefixForVersion, n as noOpVault, p as parseEncryptedVersion } from './secret-vault-BAKpgFw_.js';
75
+ export { D as DANGEROUS_FOR_SUBAGENTS, T as ToolCapabilities, a as ToolCapability, W as WIDE_SUBAGENT_CAPABILITIES, g as getDangerousCapabilities, h as hasCapability, b as hasDangerousCapabilityForSubagents } from './index-IEuxQd-E.js';
75
76
  export { ConversationTurn, ENHANCER_SYSTEM_PROMPT, EnhanceResult, EnhanceUserPromptOptions, enhanceUserPrompt, normalizedEqual, recentTextTurns, shouldEnhance } from './execution/prompt-enhancer.js';
76
77
  export { AutonomyBrainOptions, BrainAutoRisk, TieredBrainArbiterOptions, createAutonomyBrain, createTieredBrainArbiter, formatDecisionSummary } from './execution/index.js';
77
78
  import './path-resolver-CPRj4bFY.js';
78
79
  import 'node:https';
79
80
  import 'undici';
80
- import './selector-gIuhRTkN.js';
81
+ import './selector-Bc7eWtT3.js';
81
82
  import 'node:events';
82
83
 
83
84
  /**
@@ -474,7 +475,7 @@ interface EliseResult {
474
475
  changed: boolean;
475
476
  }
476
477
  /**
477
- * Elide oversized tool_results that fall before the preserve window. Pure:
478
+ * Elide oversized tool I/O that falls before the preserve window. Pure:
478
479
  * returns a fresh array (or the same reference when unchanged). Replaces the
479
480
  * duplicate copies that lived in all three compactors.
480
481
  */
@@ -850,7 +851,7 @@ declare class InputBuilder {
850
851
  private shouldCollapse;
851
852
  }
852
853
 
853
- 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\n**You are the leader agent.** After completing a significant task, end your\nresponse with 2\u20134 suggested next actions in a `<next_steps>` block. Use this\nexact format so the user can select them with `/next 1`, `/next 2`, or\n`/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- **Concrete actions only** \u2014 never write declarations of intent (\"we should fix X\", \"consider refactoring Y\") or manual suggestions (\"manually check Z\"). Write exactly what should be done: \"Fix null deref in auth/session.ts:42\", \"Run pnpm typecheck\".\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`.";
854
+ 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**Empty results are not failures.** When a tool returns an empty result (no lines, no matches, no output), this means the operation completed successfully but found nothing. Do NOT retry the same call with the same parameters \u2014 interpret the empty result and adjust your approach. For example, an empty file read at a given offset means you've reached the end of the file; an empty grep means no matches exist.\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\n**You are the leader agent.** After completing a significant task, you MAY end your\nresponse with 2\u20134 suggested next prompt options in a `<next_steps>` block.\nThe `/next 1`, `/next 2`, `/next 1 2 3` shortcuts let the user select one\nand continue in a new agent session.\n\nFormat:\n\n```\n<next_steps>\n1. Prompt option 1 \u2014 a concrete next action phrased as what to type\n2. Prompt option 2\n3. Prompt option 3 (optional)\n</next_steps>\n```\n\nRules:\n- Each item is a **prompt the user can type** \u2014 not an instruction to a human.\n Write \"pnpm test\" not \"Run the test suite.\"\n- Human-only actions (e.g., \"open DevTools\") go outside the tag as plain text,\n not inside `<next_steps>`.\n- Items marked `auto=\"true\"` must include the exact input content for copy-paste.\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, omit the tag entirely.\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`.";
854
855
  interface DefaultSystemPromptBuilderOptions {
855
856
  memoryStore?: MemoryStore | undefined;
856
857
  skillLoader?: SkillLoader | undefined;
@@ -884,13 +885,22 @@ interface DefaultSystemPromptBuilderOptions {
884
885
  */
885
886
  contributors?: readonly SystemPromptContributor[] | undefined;
886
887
  /**
887
- * Token-saving mode: when enabled, skill bodies are omitted, tool usage
888
- * hints are trimmed, and optional guidance sections (delegation, mailbox,
889
- * context management) use minimal versions to reduce per-request tokens.
890
- * Enabled via `--token-saving-mode` CLI flag or `features.tokenSavingMode`
891
- * in config.
888
+ * Token-saving mode tier. Controls how aggressively the system prompt is
889
+ * compacted: skill bodies are omitted/trimmed, tool hints are shortened,
890
+ * and optional guidance sections (delegation, mailbox, context management)
891
+ * use minimal versions to reduce per-request tokens.
892
+ *
893
+ * - 'off' — Full guidance (no reduction)
894
+ * - 'minimal' — TIER1 tools, stripped guidance
895
+ * - 'light' — TIER1 + memory tools, minimal patterns
896
+ * - 'medium' — TIER1 + TIER2 tools, some guidance
897
+ * - 'aggressive' — Maximum reduction before tools become unusable
898
+ *
899
+ * Boolean values are accepted for backward compatibility:
900
+ * - `true` → 'medium'
901
+ * - `false` → 'off'
892
902
  */
893
- tokenSavingMode?: boolean | undefined;
903
+ tokenSavingMode?: TokenSavingTier | boolean | undefined;
894
904
  }
895
905
  declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
896
906
  private readonly opts;
@@ -912,6 +922,19 @@ declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
912
922
  /** Cached full buildToolUsage output — keyed by tools array + online agents refs. */
913
923
  private _toolsUsageCache?;
914
924
  constructor(opts?: DefaultSystemPromptBuilderOptions);
925
+ /**
926
+ * Normalizes `tokenSavingMode` to a boolean for backward-compatible boolean checks.
927
+ * - `undefined` / `false` / `'off'` → false
928
+ * - `true` / any tier string other than `'off'` → true
929
+ */
930
+ private get isCompact();
931
+ /** Exposes the normalized `TokenSavingTier` for tier-aware guidance decisions. */
932
+ private get tier();
933
+ /**
934
+ * Returns the max tool description length for the current tier.
935
+ * Per the design doc: off=80, minimal=40, light=50, medium=60, aggressive=70.
936
+ */
937
+ private toolDescLimit;
915
938
  build(ctx: BuildContext): Promise<TextBlock[]>;
916
939
  /**
917
940
  * Cached plan content keyed by (planPath, mtimeMs). The plan is read
@@ -936,6 +959,10 @@ declare class DefaultSystemPromptBuilder implements SystemPromptBuilder {
936
959
  * build turn (hundreds of ms). Reference equality avoids re-stringifying
937
960
  * the same array on every iteration while still being correct when the
938
961
  * caller passes a fresh array.
962
+ *
963
+ * Tier behaviour:
964
+ * - 'off' / 'medium' / 'aggressive' → full list with names, sessions, sources
965
+ * - 'minimal' / 'light' → count only (no list)
939
966
  */
940
967
  private renderOnlineAgents;
941
968
  private buildEnvironment;
@@ -1090,6 +1117,92 @@ declare class DefaultPluginAPI implements PluginAPI {
1090
1117
  registerSystemPromptContributor(c: SystemPromptContributor): () => void;
1091
1118
  registerHook(event: HookEvent, matcher: HookMatcher | undefined, hook: InProcessHook): () => void;
1092
1119
  }
1120
+ /**
1121
+ * Define a plugin with automatic `apiVersion` injection and optional
1122
+ * TypeScript type inference for the plugin options schema.
1123
+ *
1124
+ * The `options` generic is inferred from the `factory` function's second
1125
+ * parameter, so annotating it gives you fully-typed options throughout:
1126
+ *
1127
+ * @example
1128
+ * ```ts
1129
+ * import { definePlugin } from '@wrongstack/core';
1130
+ *
1131
+ * interface MyOptions {
1132
+ * threshold: number;
1133
+ * enabled: boolean;
1134
+ * }
1135
+ *
1136
+ * const myPlugin = definePlugin(
1137
+ * {
1138
+ * name: 'my-plugin',
1139
+ * version: '0.1.0',
1140
+ * description: 'My example plugin',
1141
+ * capabilities: { tools: true },
1142
+ * configSchema: {
1143
+ * type: 'object',
1144
+ * properties: {
1145
+ * threshold: { type: 'number', default: 100 },
1146
+ * enabled: { type: 'boolean', default: true },
1147
+ * },
1148
+ * },
1149
+ * defaultConfig: { threshold: 100, enabled: true },
1150
+ * },
1151
+ * (api, options) => {
1152
+ * // options.threshold is `number` here, not `unknown`
1153
+ * api.tools.register({
1154
+ * name: 'my-tool',
1155
+ * description: `Threshold is ${options.threshold}`,
1156
+ * // ...
1157
+ * });
1158
+ * },
1159
+ * );
1160
+ *
1161
+ * export default myPlugin;
1162
+ * ```
1163
+ *
1164
+ * Plugins that don't need typed options can omit the interface and let
1165
+ * TypeScript infer from `defaultConfig`, or omit `defaultConfig` entirely
1166
+ * (options will be `undefined` at runtime, accessible via `api.config`):
1167
+ *
1168
+ * @example
1169
+ * ```ts
1170
+ * const simplePlugin = definePlugin(
1171
+ * { name: 'simple' },
1172
+ * (api) => {
1173
+ * api.tools.register({ name: 'ping', description: 'Ping the service' });
1174
+ * },
1175
+ * );
1176
+ * ```
1177
+ *
1178
+ * The `apiVersion` is automatically set to the current `KERNEL_API_VERSION`
1179
+ * so plugins are always compatible with the kernel that loaded them.
1180
+ * Plugins that need to pin to a specific kernel version can override it
1181
+ * in the returned object before exporting.
1182
+ */
1183
+ declare function definePlugin<const TOptions extends Record<string, unknown> | undefined>(metadata: {
1184
+ name: string;
1185
+ version?: string | undefined;
1186
+ description?: string | undefined;
1187
+ capabilities?: PluginCapabilities | undefined;
1188
+ configSchema?: JSONSchema | undefined;
1189
+ defaultConfig?: TOptions | undefined;
1190
+ dependsOn?: (string | PluginDependency)[] | undefined;
1191
+ optionalDeps?: (string | PluginDependency)[] | undefined;
1192
+ conflictsWith?: string[] | undefined;
1193
+ }, factory: (api: PluginAPI, options: TOptions) => void | Promise<void>): {
1194
+ name: string;
1195
+ version?: string | undefined;
1196
+ description?: string | undefined;
1197
+ apiVersion: string;
1198
+ capabilities?: PluginCapabilities | undefined;
1199
+ configSchema?: JSONSchema | undefined;
1200
+ defaultConfig?: TOptions | undefined;
1201
+ dependsOn?: (string | PluginDependency)[] | undefined;
1202
+ optionalDeps?: (string | PluginDependency)[] | undefined;
1203
+ conflictsWith?: string[] | undefined;
1204
+ setup: (api: PluginAPI) => void | Promise<void>;
1205
+ };
1093
1206
 
1094
1207
  /**
1095
1208
  * Stable plugin API contract version. This is intentionally independent of
@@ -1131,6 +1244,18 @@ interface LoadPluginsOptions {
1131
1244
  * manifest honesty. Default: false (log-only, backward-compatible).
1132
1245
  */
1133
1246
  enforceCapabilities?: boolean | undefined;
1247
+ /**
1248
+ * Timeout in milliseconds for each plugin's `setup()` call. If the
1249
+ * plugin's setup exceeds this deadline it is treated as a failure
1250
+ * and the plugin is not loaded. Default: 30 000 ms.
1251
+ */
1252
+ setupTimeoutMs?: number | undefined;
1253
+ /**
1254
+ * Timeout in milliseconds for each plugin's `teardown()` call. If the
1255
+ * plugin's teardown exceeds this deadline it is treated as a best-effort
1256
+ * failure (logged but not propagated). Default: 10 000 ms.
1257
+ */
1258
+ teardownTimeoutMs?: number | undefined;
1134
1259
  }
1135
1260
  declare function loadPlugins(plugins: Plugin[], opts: LoadPluginsOptions): Promise<{
1136
1261
  loaded: Plugin[];
@@ -1950,6 +2075,13 @@ declare function buildMailboxBlock(messages: MailboxMessage[]): {
1950
2075
  type: 'text';
1951
2076
  text: string;
1952
2077
  };
2078
+ /** Result of an inject pass — signals an out-of-band control request. */
2079
+ interface MailboxInjectResult {
2080
+ /** A fresh `control:interrupt` message asked this agent to stop. */
2081
+ interrupt: boolean;
2082
+ /** Operator-supplied reason for the interrupt, if any. */
2083
+ interruptReason?: string | undefined;
2084
+ }
1953
2085
  declare function injectPendingMailboxMessages(checkMailbox: () => Promise<MailboxMessage[]>, foldFn: (block: {
1954
2086
  type: 'text';
1955
2087
  text: string;
@@ -1960,7 +2092,7 @@ declare function injectPendingMailboxMessages(checkMailbox: () => Promise<Mailbo
1960
2092
  logger: {
1961
2093
  debug?: (...args: unknown[]) => void;
1962
2094
  };
1963
- }): Promise<void>;
2095
+ }): Promise<MailboxInjectResult>;
1964
2096
 
1965
2097
  /**
1966
2098
  * Minimal interface exposing the Agent fields that the extracted
@@ -2079,6 +2211,78 @@ declare function compactLog(opts: Pick<FileAuthorTrackerOptions, 'storageDir' |
2079
2211
  kept: number;
2080
2212
  }>;
2081
2213
 
2214
+ /**
2215
+ * commit-safety — detect when a commit would sweep up work that this session
2216
+ * did NOT author.
2217
+ *
2218
+ * When several coding agents (or a separate wrongstack process, or a human)
2219
+ * edit the same worktree at once, a blanket `git add .` / commit-all captures
2220
+ * everyone's uncommitted changes — including half-finished work from another
2221
+ * agent. There is no way to un-bake that once it lands in a shared commit.
2222
+ *
2223
+ * This module reads the working tree and cross-references it against the
2224
+ * per-project {@link file-author-tracker} log (which records the sessionId that
2225
+ * created/edited each file). Dirty files whose latest author is a DIFFERENT
2226
+ * session are flagged as "foreign"; dirty files with no recorded author are
2227
+ * "unverified" (a concurrent non-wrongstack agent, a build/format step, or a
2228
+ * human). The result is a plain-text warning callers render before committing.
2229
+ *
2230
+ * Warn-only by design: this never blocks or rewrites what gets committed — it
2231
+ * surfaces the risk so the agent (or user) can scope the commit to its own
2232
+ * files or coordinate first.
2233
+ *
2234
+ * @module commit-safety
2235
+ */
2236
+ interface CommitSafetyOptions {
2237
+ /** Directory to run git in (the agent's cwd is fine). */
2238
+ cwd: string;
2239
+ /** Project root, used to locate the file-author log. */
2240
+ projectRoot: string;
2241
+ /**
2242
+ * The current session's id — the "self" key. Dirty files authored by a
2243
+ * different sessionId are flagged as foreign. When omitted, every authored
2244
+ * file counts as foreign (we cannot prove ownership).
2245
+ */
2246
+ sessionId?: string | undefined;
2247
+ /**
2248
+ * Directory holding the file-author log. Defaults to the resolved per-project
2249
+ * dir (`~/.wrongstack/projects/<slug>`). Mainly an injection seam for tests.
2250
+ */
2251
+ storageDir?: string | undefined;
2252
+ /** Abort signal for the git subprocesses. */
2253
+ signal?: AbortSignal | undefined;
2254
+ }
2255
+ interface ForeignFile {
2256
+ /** Repo-relative path. */
2257
+ path: string;
2258
+ /** Human-readable name of the agent that last authored it, if known. */
2259
+ agentName?: string | undefined;
2260
+ /** Session that last authored it, if known. */
2261
+ sessionId?: string | undefined;
2262
+ }
2263
+ interface CommitSafetyReport {
2264
+ /** Total uncommitted (staged + unstaged + untracked) paths. */
2265
+ dirtyCount: number;
2266
+ /** Dirty files whose latest recorded author is a DIFFERENT session. */
2267
+ foreignFiles: ForeignFile[];
2268
+ /** Dirty files with no recorded author for any session. */
2269
+ unverifiedFiles: string[];
2270
+ /** Branch names of OTHER active worktrees of this repo (excludes ours). */
2271
+ otherWorktrees: string[];
2272
+ /**
2273
+ * Pre-formatted, plain-text (no ANSI) multi-line warning, or '' when there
2274
+ * is nothing notable to surface. Callers may colorize/wrap as they see fit.
2275
+ */
2276
+ warning: string;
2277
+ }
2278
+ /**
2279
+ * Assess whether committing now risks capturing another agent's work.
2280
+ *
2281
+ * Best-effort: any git failure (not a repo, git missing, timeout) yields an
2282
+ * empty report rather than throwing — commit-safety must never break a commit.
2283
+ */
2284
+ declare function assessCommitSafety(opts: CommitSafetyOptions): Promise<CommitSafetyReport>;
2285
+
2082
2286
  /**
2083
2287
  * techstack-mailbox-consumer — Auto-spawns the tech-stack agent when
2084
2288
  * dep-watcher messages land in the mailbox.
@@ -2398,4 +2602,4 @@ interface ChimeraReviewNeededPayload {
2398
2602
  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.";
2399
2603
  declare function createChimeraPlugin(): Plugin;
2400
2604
 
2401
- 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, MCPRegistryHandle, MCPRegistryView, 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, 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 };
2605
+ 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, type CommitSafetyOptions, type CommitSafetyReport, 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 ForeignFile, type FullScanResult, type GeneratedSecuritySkill, type GeneratedSkill, type GeneratedSkillContent, GitignoreUpdater, HealthRegistry, HookEvent, HookInput, HookMatcher, HookOutcome, HookRegistry, InProcessHook, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, JSONSchema, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, MATRIX_PHASE_KEYS, MCPRegistryHandle, MCPRegistryView, 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, PluginDependency, 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, TokenSavingTier, Tool, ToolCallPipelinePayload, ToolRegistry, ToolRegistryView, Tracer, WorktreeManager, WstackPaths, assessCommitSafety, attachMailboxChecker, bootConfig, buildBtwBlock, buildLosslessDigest, buildMailboxBlock, buildQueuedMessagesBlock, buildSmartDigest, collabInjectMiddleware, collabPauseMiddleware, compactLog, consumeBtwNotes, consumeQueuedMessagesUpdate, createAutoPhaseFromTaskGraph, createChimeraPlugin, createGitPlugin, createMailboxChecker, createMcpUseTool, createObservabilityPlugin, createPlanPlugin, createPromptsPlugin, createSecurityPlugin, createSecuritySlashCommand, createSkillsPlugin, createSyncPlugin, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, definePlugin, 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 };