@wrongstack/core 0.77.0 → 0.84.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/{agent-bridge-EWdqs8v6.d.ts → agent-bridge-C9P_HPez.d.ts} +2 -2
  2. package/dist/{agent-subagent-runner-D8qW8OSC.d.ts → agent-subagent-runner-2Aq0jOSj.d.ts} +107 -102
  3. package/dist/{compactor-D_ExJajC.d.ts → compactor-CJq7LQev.d.ts} +3 -3
  4. package/dist/{config-Dy0CK_o6.d.ts → config-_DZ7dN-T.d.ts} +77 -75
  5. package/dist/{context-y87Jc5ei.d.ts → context-ToHAp4-U.d.ts} +119 -90
  6. package/dist/coordination/index.d.ts +16 -16
  7. package/dist/coordination/index.js +318 -37
  8. package/dist/coordination/index.js.map +1 -1
  9. package/dist/defaults/index.d.ts +32 -32
  10. package/dist/defaults/index.js +433 -81
  11. package/dist/defaults/index.js.map +1 -1
  12. package/dist/{director-state-BmYi3DGA.d.ts → director-state-CgIc30qi.d.ts} +19 -19
  13. package/dist/{events-CYaoLN5_.d.ts → events-DnRqXaZ3.d.ts} +43 -42
  14. package/dist/execution/index.d.ts +53 -53
  15. package/dist/execution/index.js +72 -29
  16. package/dist/execution/index.js.map +1 -1
  17. package/dist/extension/index.d.ts +9 -9
  18. package/dist/extension/index.js +8 -1
  19. package/dist/extension/index.js.map +1 -1
  20. package/dist/{goal-store-C7jcumEh.d.ts → goal-store-DvWLNu52.d.ts} +4 -4
  21. package/dist/{index-DIxjTOga.d.ts → index-BNOLadHw.d.ts} +28 -28
  22. package/dist/{index-Dsda0uCn.d.ts → index-N0_c4bHQ.d.ts} +45 -45
  23. package/dist/index.d.ts +167 -167
  24. package/dist/index.js +617 -155
  25. package/dist/index.js.map +1 -1
  26. package/dist/infrastructure/index.d.ts +9 -9
  27. package/dist/infrastructure/index.js +13 -5
  28. package/dist/infrastructure/index.js.map +1 -1
  29. package/dist/kernel/index.d.ts +14 -14
  30. package/dist/kernel/index.js +7 -0
  31. package/dist/kernel/index.js.map +1 -1
  32. package/dist/logger-B72yyPc6.d.ts +12 -0
  33. package/dist/{logger-BppKxDqZ.d.ts → logger-C_27pj9i.d.ts} +6 -7
  34. package/dist/{mcp-servers-T0O6UN_w.d.ts → mcp-servers-Dck3T85_.d.ts} +20 -20
  35. package/dist/{mode-BO4SEUIv.d.ts → mode-CHo2XtHs.d.ts} +4 -4
  36. package/dist/models/index.d.ts +10 -10
  37. package/dist/models/index.js +8 -2
  38. package/dist/models/index.js.map +1 -1
  39. package/dist/{models-registry-BcYJDKLm.d.ts → models-registry-Be3osGt5.d.ts} +28 -28
  40. package/dist/{models-registry-Cuq1C8V9.d.ts → models-registry-Boz639EI.d.ts} +12 -12
  41. package/dist/{multi-agent-coordinator-DpbG3wiy.d.ts → multi-agent-coordinator-DllpCVkF.d.ts} +12 -12
  42. package/dist/{null-fleet-bus-u5ys3lW_.d.ts → null-fleet-bus-BY0AN-sr.d.ts} +121 -121
  43. package/dist/observability/index.d.ts +41 -41
  44. package/dist/observability/index.js.map +1 -1
  45. package/dist/{observability-BhnVLBLS.d.ts → observability-CoSNZdhX.d.ts} +4 -4
  46. package/dist/{parallel-eternal-engine-Dn0P8Pbj.d.ts → parallel-eternal-engine-D402RASp.d.ts} +49 -49
  47. package/dist/{path-resolver-B32v2JIq.d.ts → path-resolver-UPFTsDyD.d.ts} +6 -6
  48. package/dist/{permission-V5BLOrY6.d.ts → permission-14CChMmO.d.ts} +10 -8
  49. package/dist/{permission-policy-CBVx-d-8.d.ts → permission-policy-gW5htOo1.d.ts} +7 -7
  50. package/dist/{plan-templates-BcUwLlMQ.d.ts → plan-templates-DRvPgkfZ.d.ts} +65 -32
  51. package/dist/{provider-runner-CSi_7l0h.d.ts → provider-runner-COAJM8tC.d.ts} +6 -6
  52. package/dist/{retry-policy-CG3qvH_e.d.ts → retry-policy-DSu6O6rD.d.ts} +4 -4
  53. package/dist/sdd/index.d.ts +47 -47
  54. package/dist/sdd/index.js +47 -22
  55. package/dist/sdd/index.js.map +1 -1
  56. package/dist/{secret-scrubber-7rSC_emZ.d.ts → secret-scrubber-yGBFQYju.d.ts} +10 -2
  57. package/dist/security/index.d.ts +7 -7
  58. package/dist/security/index.js +15 -8
  59. package/dist/security/index.js.map +1 -1
  60. package/dist/{selector-RvBR_YRW.d.ts → selector-11-fm95U.d.ts} +2 -2
  61. package/dist/{session-event-bridge-CDHxcmQU.d.ts → session-event-bridge-D0u-x576.d.ts} +7 -7
  62. package/dist/{session-reader-BIpwM60D.d.ts → session-reader-BQU-toaN.d.ts} +23 -23
  63. package/dist/{skill-CxuWrsKK.d.ts → skill-BJeF2DwY.d.ts} +1 -1
  64. package/dist/skills/index.d.ts +9 -9
  65. package/dist/skills/index.js +15 -3
  66. package/dist/skills/index.js.map +1 -1
  67. package/dist/storage/index.d.ts +15 -15
  68. package/dist/storage/index.js +378 -76
  69. package/dist/storage/index.js.map +1 -1
  70. package/dist/{system-prompt-CA11g6Jo.d.ts → system-prompt-C0rLCeyn.d.ts} +16 -11
  71. package/dist/{task-graph-D1YQbpxF.d.ts → task-graph-CikNdRTG.d.ts} +22 -22
  72. package/dist/types/index.d.ts +26 -26
  73. package/dist/types/index.js +53 -17
  74. package/dist/types/index.js.map +1 -1
  75. package/dist/utils/index.d.ts +57 -45
  76. package/dist/utils/index.js +66 -12
  77. package/dist/utils/index.js.map +1 -1
  78. package/dist/{wstack-paths-D7evAFWM.d.ts → wstack-paths-BQMvEllz.d.ts} +2 -2
  79. package/package.json +1 -1
  80. package/dist/logger-DDd5C--Z.d.ts +0 -12
@@ -1,5 +1,5 @@
1
- import { l as HookEvent, n as HookMatcher, I as InProcessHook, u as ShellHook, H as HookEntry } from './config-Dy0CK_o6.js';
2
- import { T as TextBlock, c as ContentBlock, Q as Tool } from './context-y87Jc5ei.js';
1
+ import { l as HookEvent, n as HookMatcher, I as InProcessHook, u as ShellHook, H as HookEntry } from './config-_DZ7dN-T.js';
2
+ import { T as TextBlock, c as ContentBlock, Q as Tool } from './context-ToHAp4-U.js';
3
3
 
4
4
  /**
5
5
  * Container — dependency injection with explicit bind / override / decorate.
@@ -15,8 +15,8 @@ type Token<T> = symbol & {
15
15
  type Factory<T> = (c: Container) => T;
16
16
  type Decorator<T> = (inner: T, c: Container) => T;
17
17
  interface BindOptions {
18
- singleton?: boolean;
19
- owner?: string;
18
+ singleton?: boolean | undefined;
19
+ owner?: string | undefined;
20
20
  }
21
21
  declare class Container {
22
22
  private readonly entries;
@@ -43,6 +43,11 @@ declare class Container {
43
43
  */
44
44
  private describeCycle;
45
45
  has<T>(token: Token<T>): boolean;
46
+ /**
47
+ * Resolve a token if it is bound, otherwise return undefined.
48
+ * Unlike resolve(), this does not throw if the token is unbound.
49
+ */
50
+ safeResolve<T>(token: Token<T>): T | undefined;
46
51
  ownerOf<T>(token: Token<T>): string | undefined;
47
52
  /**
48
53
  * Remove a token's binding (along with any decorators stacked on it).
@@ -93,18 +98,18 @@ type MiddlewareHandler<T> = (value: T, next: NextFn<T>) => Promise<T>;
93
98
  type PipelineErrorPolicy = 'rethrow' | 'swallow';
94
99
  interface PipelineErrorEvent {
95
100
  middleware: string;
96
- owner?: string;
101
+ owner?: string | undefined;
97
102
  err: unknown;
98
103
  }
99
104
  type PipelineErrorHandler = (ev: PipelineErrorEvent) => PipelineErrorPolicy | Promise<PipelineErrorPolicy>;
100
105
  interface Middleware<T> {
101
106
  name: string;
102
107
  handler: MiddlewareHandler<T>;
103
- owner?: string;
108
+ owner?: string | undefined;
104
109
  }
105
110
  interface PipelineOptions {
106
111
  /** When true and the target middleware is not found, operations silently no-op instead of throwing. */
107
- optional?: boolean;
112
+ optional?: boolean | undefined;
108
113
  }
109
114
  /**
110
115
  * Read-only view of a pipeline. Returned to consumers (plugins, hooks)
@@ -170,7 +175,7 @@ declare class Pipeline<T> {
170
175
  declare class HookRegistry {
171
176
  private readonly entries;
172
177
  /** Register an in-process hook. Returns an unsubscribe function. */
173
- registerInProcess(event: HookEvent, matcher: HookMatcher | undefined, hook: InProcessHook, owner?: string): () => void;
178
+ registerInProcess(event: HookEvent, matcher: HookMatcher | undefined, hook: InProcessHook, owner?: string | undefined): () => void;
174
179
  /** Register a single shell hook. Returns an unsubscribe function. */
175
180
  registerShell(event: HookEvent, hook: ShellHook): () => void;
176
181
  /** Bulk-load shell hooks from a `config.hooks` map. */
@@ -215,9 +220,9 @@ interface BuildContext {
215
220
  projectRoot: string;
216
221
  tools: Tool[];
217
222
  /** Provider id (e.g. "anthropic", "minimax-coding-plan"). */
218
- provider?: string;
223
+ provider?: string | undefined;
219
224
  /** Model id (e.g. "claude-sonnet-4-6", "MiniMax-M2.7"). */
220
- model?: string;
225
+ model?: string | undefined;
221
226
  /**
222
227
  * True when the prompt is being built for a SUBAGENT, not the host
223
228
  * agent. Subagents are scoped to a single task — they should NOT see
@@ -225,7 +230,7 @@ interface BuildContext {
225
230
  * turns, not steering individual subtasks). The plan-injection
226
231
  * layer short-circuits when this flag is set.
227
232
  */
228
- subagent?: boolean;
233
+ subagent?: boolean | undefined;
229
234
  }
230
235
  interface SystemPromptBuilder {
231
236
  build(ctx: BuildContext): Promise<TextBlock[]>;
@@ -5,7 +5,7 @@ interface SpecSection {
5
5
  title: string;
6
6
  content: string;
7
7
  level: number;
8
- children?: SpecSection[];
8
+ children?: SpecSection[] | undefined;
9
9
  }
10
10
  interface SpecRequirement {
11
11
  id: string;
@@ -13,8 +13,8 @@ interface SpecRequirement {
13
13
  priority: 'critical' | 'high' | 'medium' | 'low';
14
14
  description: string;
15
15
  acceptanceCriteria: string[];
16
- blockedBy?: string[];
17
- implements?: string[];
16
+ blockedBy?: string[] | undefined;
17
+ implements?: string[] | undefined;
18
18
  }
19
19
  interface SpecApiEndpoint {
20
20
  method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
@@ -22,7 +22,7 @@ interface SpecApiEndpoint {
22
22
  description: string;
23
23
  request?: Record<string, unknown>;
24
24
  response?: Record<string, unknown>;
25
- auth?: boolean;
25
+ auth?: boolean | undefined;
26
26
  }
27
27
  interface Specification {
28
28
  id: string;
@@ -32,8 +32,8 @@ interface Specification {
32
32
  overview: string;
33
33
  sections: SpecSection[];
34
34
  requirements: SpecRequirement[];
35
- apiEndpoints?: SpecApiEndpoint[];
36
- dependencies?: string[];
35
+ apiEndpoints?: SpecApiEndpoint[] | undefined;
36
+ dependencies?: string[] | undefined;
37
37
  createdAt: number;
38
38
  updatedAt: number;
39
39
  metadata?: Record<string, unknown>;
@@ -85,17 +85,17 @@ interface TaskNode {
85
85
  type: TaskType;
86
86
  priority: TaskPriority;
87
87
  status: TaskStatus;
88
- assignee?: string;
89
- estimateHours?: number;
90
- actualHours?: number;
91
- tags?: string[];
92
- specRequirementId?: string;
93
- parentId?: string;
94
- children?: string[];
88
+ assignee?: string | undefined;
89
+ estimateHours?: number | undefined;
90
+ actualHours?: number | undefined;
91
+ tags?: string[] | undefined;
92
+ specRequirementId?: string | undefined;
93
+ parentId?: string | undefined;
94
+ children?: string[] | undefined;
95
95
  createdAt: number;
96
96
  updatedAt: number;
97
- startedAt?: number;
98
- completedAt?: number;
97
+ startedAt?: number | undefined;
98
+ completedAt?: number | undefined;
99
99
  metadata?: Record<string, unknown>;
100
100
  }
101
101
  interface TaskEdge {
@@ -103,7 +103,7 @@ interface TaskEdge {
103
103
  from: string;
104
104
  to: string;
105
105
  type: 'blocks' | 'depends_on' | 'relates_to' | 'implements';
106
- weight?: number;
106
+ weight?: number | undefined;
107
107
  }
108
108
  interface TaskGraph {
109
109
  id: string;
@@ -138,12 +138,12 @@ interface TaskProgress {
138
138
  actualHours: number;
139
139
  }
140
140
  interface TaskFilter {
141
- status?: TaskStatus[];
142
- priority?: TaskPriority[];
143
- type?: TaskType[];
144
- assignee?: string[];
145
- tags?: string[];
146
- specRequirementId?: string;
141
+ status?: TaskStatus[] | undefined;
142
+ priority?: TaskPriority[] | undefined;
143
+ type?: TaskType[] | undefined;
144
+ assignee?: string[] | undefined;
145
+ tags?: string[] | undefined;
146
+ specRequirementId?: string | undefined;
147
147
  }
148
148
  interface TaskSort {
149
149
  field: 'priority' | 'createdAt' | 'updatedAt' | 'status';
@@ -1,36 +1,36 @@
1
- export { A as AgentError, a as Capabilities, b as ConfigError, c as ContentBlock, 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, m as Provider, n as ProviderError, o as ProviderErrorBody, p as Request, q as Response, r as ResumedSession, s as RiskTier, S as SessionData, v as SessionError, w as SessionEvent, x as SessionMetadata, y as SessionStore, z as SessionSummary, B as SessionWriter, H as StopReason, K as StreamEvent, T as TextBlock, L as ThinkingBlock, Q as Tool, 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, 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 } from '../context-y87Jc5ei.js';
2
- export { P as ProviderRunner, R as RunProviderOptions } from '../provider-runner-CSi_7l0h.js';
3
- export { A as AutonomyConfig, C as CONTEXT_WINDOW_MODES, a as Config, b as ConfigLoader, c as ConfigStore, 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 HookEvent, m as HookInput, n as HookMatcher, o as HookOutcome, I as InProcessHook, p as IndexingConfig, L as LaunchConfig, q as LogConfig, M as MCPServerConfig, r as ModelMatrixEntry, 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';
4
- export { C as CompactReport, a as Compactor } from '../compactor-D_ExJajC.js';
5
- export { P as PermissionDecision, a as PermissionPolicy, T as TrustPolicy } from '../permission-V5BLOrY6.js';
1
+ export { A as AgentError, a as Capabilities, b as ConfigError, c as ContentBlock, 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, m as Provider, n as ProviderError, o as ProviderErrorBody, p as Request, q as Response, r as ResumedSession, s as RiskTier, S as SessionData, v as SessionError, w as SessionEvent, x as SessionMetadata, y as SessionStore, z as SessionSummary, B as SessionWriter, H as StopReason, K as StreamEvent, T as TextBlock, L as ThinkingBlock, Q as Tool, 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, 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 } from '../context-ToHAp4-U.js';
2
+ export { P as ProviderRunner, R as RunProviderOptions } from '../provider-runner-COAJM8tC.js';
3
+ export { A as AutonomyConfig, C as CONTEXT_WINDOW_MODES, a as Config, b as ConfigLoader, c as ConfigStore, 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 HookEvent, m as HookInput, n as HookMatcher, o as HookOutcome, I as InProcessHook, p as IndexingConfig, L as LaunchConfig, q as LogConfig, M as MCPServerConfig, r as ModelMatrixEntry, 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-_DZ7dN-T.js';
4
+ export { C as CompactReport, a as Compactor } from '../compactor-CJq7LQev.js';
5
+ export { P as PermissionDecision, a as PermissionPolicy, T as TrustPolicy } from '../permission-14CChMmO.js';
6
6
  export { C as CheckpointInfo, R as RewindResult, a as RewindResultExtended, S as SessionRewinder } from '../session-rewinder-C9HnMkhP.js';
7
- export { A as AddAttachmentInput, a as Attachment, b as AttachmentKind, c as AttachmentMeta, d as AttachmentRef, e as AttachmentStore, D as DefaultSessionReader } from '../session-reader-BIpwM60D.js';
7
+ export { A as AddAttachmentInput, a as Attachment, b as AttachmentKind, c as AttachmentMeta, d as AttachmentRef, e as AttachmentStore, D as DefaultSessionReader } from '../session-reader-BQU-toaN.js';
8
8
  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';
9
- export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from '../secret-scrubber-7rSC_emZ.js';
10
- export { D as DefaultLogger, a as DefaultLoggerOptions } from '../logger-BppKxDqZ.js';
11
- export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-B32v2JIq.js';
9
+ export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from '../secret-scrubber-yGBFQYju.js';
10
+ export { D as DefaultLogger, a as DefaultLoggerOptions } from '../logger-C_27pj9i.js';
11
+ export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-UPFTsDyD.js';
12
12
  export { M as MemoryEntry, a as MemoryScope, b as MemoryStore } from '../memory-CEXuo7sz.js';
13
- import { I as IterationStage, g as ParallelIterationStage } from '../parallel-eternal-engine-Dn0P8Pbj.js';
14
- export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, h as buildRecoveryStrategies } from '../parallel-eternal-engine-Dn0P8Pbj.js';
15
- export { S as SkillEntry, a as SkillLoader, b as SkillManifest } from '../skill-CxuWrsKK.js';
16
- export { a as BuildContext, c as ModelCapabilities, e as Renderer, S as SystemPromptBuilder } from '../system-prompt-CA11g6Jo.js';
13
+ import { I as IterationStage, g as ParallelIterationStage } from '../parallel-eternal-engine-D402RASp.js';
14
+ export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, h as buildRecoveryStrategies } from '../parallel-eternal-engine-D402RASp.js';
15
+ export { S as SkillEntry, a as SkillLoader, b as SkillManifest } from '../skill-BJeF2DwY.js';
16
+ export { a as BuildContext, c as ModelCapabilities, e as Renderer, S as SystemPromptBuilder } from '../system-prompt-C0rLCeyn.js';
17
17
  export { I as InputReader, P as PromptOption } from '../input-reader-E-ffP2ee.js';
18
- export { C as CoordinatorEvents, o as CoordinatorStatus, D as DoneCondition, M as MCPRegistryView, t as MetricsSinkView, u as MultiAgentConfig, v as MultiAgentCoordinator, P as Plugin, w as PluginAPI, x as PluginCapabilities, y as PluginDependency, z as PluginPipelines, E as ProviderFactory, G as ProviderRegistryView, S as SessionWriterView, H as SlashCommand, I as SlashCommandRegistryView, J as SpawnResult, L as SubagentConfig, N as SubagentContext, O as SubagentError, Q as SubagentErrorKind, R as SubagentRunContext, T as SubagentRunOutcome, U as SubagentRunner, W as TaskDelegation, X as TaskResult, Y as TaskSpec, Z as ToolRegistryView } from '../agent-subagent-runner-D8qW8OSC.js';
19
- export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from '../models-registry-Cuq1C8V9.js';
20
- export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest, c as ModeStore } from '../mode-BO4SEUIv.js';
21
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-EWdqs8v6.js';
22
- 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, l as TaskGraph, m as TaskNode, n as TaskPriority, o as TaskProgress, p as TaskSort, q as TaskStatus, r as TaskType, s as computeTaskProgress, t as findCriticalPath, u as topologicalSort } from '../task-graph-D1YQbpxF.js';
23
- export { A as AggregateHealth, H as HealthCheck, a as HealthCheckResult, b as HealthRegistry, c as HealthStatus, M as MetricLabels, d as MetricSeries, e as MetricsSink, f as MetricsSnapshot, S as Span, T as Tracer } from '../observability-BhnVLBLS.js';
24
- export { S as SystemPromptContributor } from '../index-Dsda0uCn.js';
25
- import '../events-CYaoLN5_.js';
26
- import '../logger-DDd5C--Z.js';
27
- import '../retry-policy-CG3qvH_e.js';
28
- import '../models-registry-BcYJDKLm.js';
18
+ export { C as CoordinatorEvents, o as CoordinatorStatus, D as DoneCondition, M as MCPRegistryView, t as MetricsSinkView, u as MultiAgentConfig, v as MultiAgentCoordinator, P as Plugin, w as PluginAPI, x as PluginCapabilities, y as PluginDependency, z as PluginPipelines, E as ProviderFactory, G as ProviderRegistryView, S as SessionWriterView, H as SlashCommand, I as SlashCommandRegistryView, J as SpawnResult, L as SubagentConfig, N as SubagentContext, O as SubagentError, Q as SubagentErrorKind, R as SubagentRunContext, T as SubagentRunOutcome, U as SubagentRunner, W as TaskDelegation, X as TaskResult, Y as TaskSpec, Z as ToolRegistryView } from '../agent-subagent-runner-2Aq0jOSj.js';
19
+ export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from '../models-registry-Boz639EI.js';
20
+ export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest, c as ModeStore } from '../mode-CHo2XtHs.js';
21
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-C9P_HPez.js';
22
+ 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, l as TaskGraph, m as TaskNode, n as TaskPriority, o as TaskProgress, p as TaskSort, q as TaskStatus, r as TaskType, s as computeTaskProgress, t as findCriticalPath, u as topologicalSort } from '../task-graph-CikNdRTG.js';
23
+ export { A as AggregateHealth, H as HealthCheck, a as HealthCheckResult, b as HealthRegistry, c as HealthStatus, M as MetricLabels, d as MetricSeries, e as MetricsSink, f as MetricsSnapshot, S as Span, T as Tracer } from '../observability-CoSNZdhX.js';
24
+ export { S as SystemPromptContributor } from '../index-N0_c4bHQ.js';
25
+ import '../events-DnRqXaZ3.js';
26
+ import '../logger-B72yyPc6.js';
27
+ import '../retry-policy-DSu6O6rD.js';
28
+ import '../models-registry-Be3osGt5.js';
29
29
  import '../secret-vault-DoISxaKO.js';
30
30
  import '../secret-scrubber-3MHDDAtm.js';
31
31
  import '../path-resolver-CPRj4bFY.js';
32
- import '../goal-store-C7jcumEh.js';
33
- import '../multi-agent-coordinator-DpbG3wiy.js';
32
+ import '../goal-store-DvWLNu52.js';
33
+ import '../multi-agent-coordinator-DllpCVkF.js';
34
34
  import 'node:events';
35
35
 
36
36
  /** Union of serial and parallel autonomy engine stage types (from EternalAutonomyEngine / ParallelEternalEngine). */
@@ -466,20 +466,20 @@ var DefaultSecretVault = class {
466
466
  return key;
467
467
  }
468
468
  };
469
- function decryptConfigSecrets(cfg, vault) {
469
+ function decryptConfigSecrets(cfg, vault, opts) {
470
+ const warn = opts?.warn ?? ((msg) => console.warn(msg));
470
471
  return walk(cfg, vault, (v, key) => {
471
472
  try {
472
473
  return vault.decrypt(v);
473
474
  } catch (err) {
474
- console.warn(
475
- `[secret-vault] Failed to decrypt "${key}":`,
476
- err instanceof Error ? err.message : err
475
+ warn(
476
+ `[secret-vault] Failed to decrypt "${key}": ${err instanceof Error ? err.message : err}`
477
477
  );
478
478
  return "";
479
479
  }
480
480
  });
481
481
  }
482
- function encryptConfigSecrets(cfg, vault) {
482
+ function encryptConfigSecrets(cfg, vault, _opts) {
483
483
  return walk(cfg, vault, (v) => vault.encrypt(v));
484
484
  }
485
485
  function walk(node, vault, transform) {
@@ -540,7 +540,8 @@ async function migratePlaintextSecrets(configPath, vault) {
540
540
  await restrictFilePermissions(configPath);
541
541
  return { migrated: counter.n, file: configPath };
542
542
  }
543
- async function restrictFilePermissions(filePath) {
543
+ async function restrictFilePermissions(filePath, opts) {
544
+ const warn = ((msg) => console.warn(msg));
544
545
  if (process.platform === "win32") {
545
546
  try {
546
547
  const { execFile } = await import('child_process');
@@ -548,7 +549,7 @@ async function restrictFilePermissions(filePath) {
548
549
  const execFileAsync = promisify(execFile);
549
550
  await execFileAsync("icacls", [filePath, "/inheritance:r", "/grant:r", `${process.env.USERNAME}:(F)`]);
550
551
  } catch {
551
- console.warn(`[secret-vault] Could not restrict permissions on ${filePath} \u2014 config file may be readable by other users on this system.`);
552
+ warn(`[secret-vault] Could not restrict permissions on ${filePath} \u2014 config file may be readable by other users on this system.`);
552
553
  }
553
554
  } else {
554
555
  try {
@@ -606,8 +607,10 @@ function isStdoutTTY() {
606
607
  }
607
608
  function writeTo(s, stream) {
608
609
  if (!stream || typeof stream.write !== "function") return false;
609
- stream.write(s);
610
- return true;
610
+ {
611
+ stream.write(s);
612
+ return true;
613
+ }
611
614
  }
612
615
  function writeErr(s, stream = process.stderr) {
613
616
  return writeTo(s, stream);
@@ -771,7 +774,7 @@ var DefaultTokenCounter = class {
771
774
  } else if (this.registry && this.providerId && model) {
772
775
  if (this.priceCache.size >= PRICE_CACHE_MAX_SIZE) {
773
776
  const keys = [...this.priceCache.keys()];
774
- this.priceCache.delete(keys[0]);
777
+ this.priceCache.delete(keys[0] ?? "");
775
778
  }
776
779
  void this.registry.getModel(this.providerId, model).then((m) => {
777
780
  if (m) {
@@ -796,7 +799,7 @@ var DefaultTokenCounter = class {
796
799
  const price = priceFromModel(resolved);
797
800
  if (this.priceCache.size >= PRICE_CACHE_MAX_SIZE) {
798
801
  const keys = [...this.priceCache.keys()];
799
- this.priceCache.delete(keys[0]);
802
+ this.priceCache.delete(keys[0] ?? "");
800
803
  }
801
804
  this.priceCache.set(resolved.modelId, price);
802
805
  this.applyPrice(usage, price);
@@ -864,6 +867,12 @@ function round4(n) {
864
867
  }
865
868
 
866
869
  // src/utils/token-estimate.ts
870
+ function expectDefined(value) {
871
+ if (value === null || value === void 0) {
872
+ throw new Error("Expected value to be defined");
873
+ }
874
+ return value;
875
+ }
867
876
  var RoughTokenEstimate = (text, charsPerToken = 3.5) => Math.max(1, Math.ceil(text.length / charsPerToken));
868
877
  var ESTIMATE_CACHE = /* @__PURE__ */ new Map();
869
878
  var ESTIMATE_CACHE_MAX_SIZE = 1e4;
@@ -873,7 +882,7 @@ function getCachedEstimate(key, compute) {
873
882
  if (ESTIMATE_CACHE.size >= ESTIMATE_CACHE_MAX_SIZE) {
874
883
  const keys = [...ESTIMATE_CACHE.keys()];
875
884
  for (let i = 0; i < Math.floor(ESTIMATE_CACHE_MAX_SIZE / 4); i++) {
876
- ESTIMATE_CACHE.delete(keys[i]);
885
+ ESTIMATE_CACHE.delete(expectDefined(keys[i]));
877
886
  }
878
887
  }
879
888
  const estimate = compute();
@@ -947,6 +956,12 @@ function estimateRequestTokens(messages, systemPrompt, tools) {
947
956
  }
948
957
 
949
958
  // src/utils/message-invariants.ts
959
+ function expectDefined2(value) {
960
+ if (value === null || value === void 0) {
961
+ throw new Error("Expected value to be defined");
962
+ }
963
+ return value;
964
+ }
950
965
  function repairToolUseAdjacency(messages) {
951
966
  const removedToolUses = [];
952
967
  const removedToolResults = [];
@@ -954,7 +969,7 @@ function repairToolUseAdjacency(messages) {
954
969
  let changed = false;
955
970
  const out = [];
956
971
  for (let i = 0; i < messages.length; i++) {
957
- const original = messages[i];
972
+ const original = expectDefined2(messages[i]);
958
973
  let msg = original;
959
974
  if (hasToolUse(msg)) {
960
975
  const nextIds = toolResultIds(messages[i + 1]);
@@ -2109,6 +2124,12 @@ Remember: your job is to make the user a better developer, not just to complete
2109
2124
  ];
2110
2125
 
2111
2126
  // src/types/context-window.ts
2127
+ function expectDefined3(value) {
2128
+ if (value === null || value === void 0) {
2129
+ throw new Error("Expected value to be defined");
2130
+ }
2131
+ return value;
2132
+ }
2112
2133
  var DEFAULT_CONTEXT_WINDOW_MODE_ID = "balanced";
2113
2134
  var CONTEXT_WINDOW_MODES = Object.freeze([
2114
2135
  {
@@ -2165,7 +2186,7 @@ function isContextWindowModeId(id) {
2165
2186
  }
2166
2187
  function resolveContextWindowPolicy(config = {}, overrideMode) {
2167
2188
  const requested = overrideMode ?? config.mode ?? DEFAULT_CONTEXT_WINDOW_MODE_ID;
2168
- const mode = getContextWindowMode(requested) ?? getContextWindowMode(DEFAULT_CONTEXT_WINDOW_MODE_ID);
2189
+ const mode = getContextWindowMode(requested) ?? expectDefined3(getContextWindowMode(DEFAULT_CONTEXT_WINDOW_MODE_ID));
2169
2190
  if (mode.id !== DEFAULT_CONTEXT_WINDOW_MODE_ID) {
2170
2191
  return mode;
2171
2192
  }
@@ -2216,7 +2237,7 @@ var InMemoryBridgeTransport = class {
2216
2237
  }
2217
2238
  subscribe(agentId, handler) {
2218
2239
  if (!this.subs.has(agentId)) this.subs.set(agentId, /* @__PURE__ */ new Set());
2219
- this.subs.get(agentId).add(handler);
2240
+ this.subs.get(agentId)?.add(handler);
2220
2241
  return () => this.subs.get(agentId)?.delete(handler);
2221
2242
  }
2222
2243
  close(agentId) {
@@ -2622,6 +2643,12 @@ function createToolOutputSerializer(opts = {}) {
2622
2643
  }
2623
2644
 
2624
2645
  // src/execution/tool-executor.ts
2646
+ function expectDefined4(value) {
2647
+ if (value === null || value === void 0) {
2648
+ throw new Error("Expected value to be defined");
2649
+ }
2650
+ return value;
2651
+ }
2625
2652
  var ToolExecutor = class {
2626
2653
  constructor(registry, opts) {
2627
2654
  this.registry = registry;
@@ -2910,6 +2937,9 @@ ${post.additionalContext}` };
2910
2937
  async runStreamedTool(tool, input, ctx, signal, toolUseId) {
2911
2938
  let finalOutput;
2912
2939
  let sawFinal = false;
2940
+ if (!tool.executeStream) {
2941
+ throw new Error(`Tool "${tool.name}" does not support streaming execution`);
2942
+ }
2913
2943
  const stream = tool.executeStream(input, ctx, { signal });
2914
2944
  for await (const ev of stream) {
2915
2945
  if (ev.type === "final") {
@@ -3014,7 +3044,7 @@ function hasMalformedArguments(input) {
3014
3044
  function extractMalformedRaw(input) {
3015
3045
  if (!hasMalformedArguments(input)) return void 0;
3016
3046
  const obj = input;
3017
- const value = obj[Object.keys(obj)[0]];
3047
+ const value = obj[expectDefined4(Object.keys(obj)[0])];
3018
3048
  if (value === void 0 || value === null) return void 0;
3019
3049
  if (typeof value === "string") return value;
3020
3050
  try {
@@ -3061,6 +3091,12 @@ function compileUserRegex(pattern, flags) {
3061
3091
  }
3062
3092
 
3063
3093
  // src/storage/session-reader.ts
3094
+ function expectDefined5(value) {
3095
+ if (value === null || value === void 0) {
3096
+ throw new Error("Expected value to be defined");
3097
+ }
3098
+ return value;
3099
+ }
3064
3100
  var DefaultSessionReader = class {
3065
3101
  store;
3066
3102
  constructor(opts) {
@@ -3122,7 +3158,7 @@ var DefaultSessionReader = class {
3122
3158
  continue;
3123
3159
  }
3124
3160
  for (let i = 0; i < data.events.length; i++) {
3125
- const ev = data.events[i];
3161
+ const ev = expectDefined5(data.events[i]);
3126
3162
  if (allowedTypes && !allowedTypes.has(ev.type)) continue;
3127
3163
  const text = eventText(ev);
3128
3164
  if (text === null) continue;