@wrongstack/core 0.77.0 → 0.82.6

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 (79) 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 +31 -31
  10. package/dist/defaults/index.js +419 -67
  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 +67 -23
  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 +165 -165
  24. package/dist/index.js +593 -137
  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/security/index.d.ts +6 -6
  57. package/dist/security/index.js +7 -1
  58. package/dist/security/index.js.map +1 -1
  59. package/dist/{selector-RvBR_YRW.d.ts → selector-11-fm95U.d.ts} +2 -2
  60. package/dist/{session-event-bridge-CDHxcmQU.d.ts → session-event-bridge-D0u-x576.d.ts} +7 -7
  61. package/dist/{session-reader-BIpwM60D.d.ts → session-reader-BQU-toaN.d.ts} +23 -23
  62. package/dist/{skill-CxuWrsKK.d.ts → skill-BJeF2DwY.d.ts} +1 -1
  63. package/dist/skills/index.d.ts +9 -9
  64. package/dist/skills/index.js +15 -3
  65. package/dist/skills/index.js.map +1 -1
  66. package/dist/storage/index.d.ts +15 -15
  67. package/dist/storage/index.js +378 -76
  68. package/dist/storage/index.js.map +1 -1
  69. package/dist/{system-prompt-CA11g6Jo.d.ts → system-prompt-C0rLCeyn.d.ts} +16 -11
  70. package/dist/{task-graph-D1YQbpxF.d.ts → task-graph-CikNdRTG.d.ts} +22 -22
  71. package/dist/types/index.d.ts +25 -25
  72. package/dist/types/index.js +45 -10
  73. package/dist/types/index.js.map +1 -1
  74. package/dist/utils/index.d.ts +46 -45
  75. package/dist/utils/index.js +53 -12
  76. package/dist/utils/index.js.map +1 -1
  77. package/dist/{wstack-paths-D7evAFWM.d.ts → wstack-paths-BQMvEllz.d.ts} +2 -2
  78. package/package.json +1 -1
  79. package/dist/logger-DDd5C--Z.d.ts +0 -12
@@ -1,4 +1,4 @@
1
- import { f as BridgeTransport, B as BridgeMessage, a as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-D8qW8OSC.js';
1
+ import { f as BridgeTransport, B as BridgeMessage, a as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-2Aq0jOSj.js';
2
2
 
3
3
  /**
4
4
  * In-memory pub/sub transport for agent-to-agent messaging.
@@ -30,6 +30,6 @@ declare class InMemoryAgentBridge implements AgentBridge {
30
30
  request<T>(msg: BridgeMessage, timeoutMs?: number): Promise<BridgeMessage<T>>;
31
31
  stop(): Promise<void>;
32
32
  }
33
- declare function createMessage<T = unknown>(type: BridgeMessage['type'], from: string, payload: T, to?: string): BridgeMessage<T>;
33
+ declare function createMessage<T = unknown>(type: BridgeMessage['type'], from: string, payload: T, to?: string | undefined): BridgeMessage<T>;
34
34
 
35
35
  export { InMemoryAgentBridge as I, InMemoryBridgeTransport as a, createMessage as c };
@@ -1,13 +1,13 @@
1
- import { t as ToolRegistry, m as ProviderRegistry, f as AgentPipelines, q as ToolExecutorLike, E as ExtensionRegistry, d as AgentInit, e as AgentInput, R as RunResult, p as ToolCallPipelinePayload, u as ToolWrapper, S as SystemPromptContributor } from './index-Dsda0uCn.js';
2
- import { C as Container, e as Renderer, R as ReadonlyPipeline } from './system-prompt-CA11g6Jo.js';
3
- import { E as EventBus, k as EventName, L as Listener } from './events-CYaoLN5_.js';
4
- import { a as RetryPolicy, E as ErrorHandler } from './retry-policy-CG3qvH_e.js';
5
- import { a as Logger } from './logger-DDd5C--Z.js';
6
- import { T as Tracer } from './observability-BhnVLBLS.js';
7
- import { a as PermissionPolicy } from './permission-V5BLOrY6.js';
8
- import { d as Context, Q as Tool, u as RunOptions, J as JSONSchema, p as Request, q as Response, c as ContentBlock, T as TextBlock, m as Provider, $ as Usage } from './context-y87Jc5ei.js';
9
- import { l as HookEvent, n as HookMatcher, I as InProcessHook, a as Config } from './config-Dy0CK_o6.js';
10
- import { W as WireFamily } from './models-registry-BcYJDKLm.js';
1
+ import { t as ToolRegistry, m as ProviderRegistry, f as AgentPipelines, q as ToolExecutorLike, E as ExtensionRegistry, d as AgentInit, e as AgentInput, R as RunResult, p as ToolCallPipelinePayload, u as ToolWrapper, S as SystemPromptContributor } from './index-N0_c4bHQ.js';
2
+ import { C as Container, e as Renderer, R as ReadonlyPipeline } from './system-prompt-C0rLCeyn.js';
3
+ import { E as EventBus, k as EventName, L as Listener } from './events-DnRqXaZ3.js';
4
+ import { a as RetryPolicy, E as ErrorHandler } from './retry-policy-DSu6O6rD.js';
5
+ import { a as Logger } from './logger-B72yyPc6.js';
6
+ import { T as Tracer } from './observability-CoSNZdhX.js';
7
+ import { a as PermissionPolicy } from './permission-14CChMmO.js';
8
+ import { d as Context, Q as Tool, u as RunOptions, J as JSONSchema, p as Request, q as Response, c as ContentBlock, T as TextBlock, m as Provider, $ as Usage } from './context-ToHAp4-U.js';
9
+ import { l as HookEvent, n as HookMatcher, I as InProcessHook, a as Config } from './config-_DZ7dN-T.js';
10
+ import { W as WireFamily } from './models-registry-Be3osGt5.js';
11
11
 
12
12
  declare class Agent {
13
13
  readonly container: Container;
@@ -52,21 +52,26 @@ interface SlashCommand {
52
52
  /** Unique command name. For plugins: `pluginName:commandName`. */
53
53
  name: string;
54
54
  /** Short aliases — also prefixed automatically: `pluginName:alias`. */
55
- aliases?: string[];
55
+ aliases?: string[] | undefined;
56
56
  description: string;
57
+ /**
58
+ * Category used to group commands in the slash picker. Defaults to 'App'
59
+ * when omitted.
60
+ */
61
+ category?: 'Run' | 'Session' | 'Inspect' | 'Agent' | 'Config' | 'App' | undefined;
57
62
  /**
58
63
  * Optional compact argument hint for interactive menus. This is not parsed
59
64
  * by the registry; it only helps TUI/REPL surfaces show the expected shape,
60
65
  * for example `[list|install <alias>|disable <name>]`.
61
66
  */
62
- argsHint?: string;
67
+ argsHint?: string | undefined;
63
68
  /**
64
69
  * Optional detailed help shown by `/help <name>`. Use this for usage,
65
70
  * arguments, examples, side-effects — anything that doesn't fit in
66
71
  * `description`. Renders verbatim, so format with line breaks.
67
72
  * If absent, `/help <name>` falls back to `description`.
68
73
  */
69
- help?: string;
74
+ help?: string | undefined;
70
75
  /**
71
76
  * Execute the command.
72
77
  * @param args Everything after the command name (trimmed by dispatch).
@@ -80,9 +85,9 @@ interface SlashCommand {
80
85
  * structured data for the REPL/TUI to act on (e.g. SDD session state).
81
86
  */
82
87
  run(args: string, ctx: Context): Promise<{
83
- exit?: boolean;
84
- message?: string;
85
- runText?: string;
88
+ exit?: boolean | undefined;
89
+ message?: string | undefined;
90
+ runText?: string | undefined;
86
91
  metadata?: Record<string, unknown>;
87
92
  } | void>;
88
93
  }
@@ -131,7 +136,7 @@ interface SlashCommandRegistryView {
131
136
  * event types are persisted verbatim next to the built-in events.
132
137
  */
133
138
  interface SessionWriterView {
134
- readonly transcriptPath?: string;
139
+ readonly transcriptPath?: string | undefined;
135
140
  append(event: Record<string, unknown> & {
136
141
  type: string;
137
142
  ts: string;
@@ -144,7 +149,7 @@ interface SessionWriterView {
144
149
  * flow to the host's MetricsSink (Prometheus, OTLP, or noop).
145
150
  */
146
151
  interface MetricsSinkView {
147
- counter(name: string, value?: number, labels?: Record<string, string>): void;
152
+ counter(name: string, value?: number | undefined, labels?: Record<string, string>): void;
148
153
  histogram(name: string, value: number, labels?: Record<string, string>): void;
149
154
  gauge(name: string, value: number, labels?: Record<string, string>): void;
150
155
  }
@@ -229,19 +234,19 @@ interface PluginAPI {
229
234
  */
230
235
  interface PluginCapabilities {
231
236
  /** Will register tools via `api.tools.register()`. */
232
- tools?: boolean;
237
+ tools?: boolean | undefined;
233
238
  /** Will register provider factories via `api.providers.register()`. */
234
- providers?: boolean;
239
+ providers?: boolean | undefined;
235
240
  /**
236
241
  * Pipelines the plugin hooks into. Use the standard names
237
242
  * (`request | response | toolCall | userInput | assistantOutput | contextWindow`)
238
243
  * or custom pipeline names exposed by other plugins.
239
244
  */
240
- pipelines?: string[];
245
+ pipelines?: string[] | undefined;
241
246
  /** Will register slash commands via `api.slashCommands.register()`. */
242
- slashCommands?: boolean;
247
+ slashCommands?: boolean | undefined;
243
248
  /** Will start MCP servers via `api.mcp.start()`. */
244
- mcp?: boolean;
249
+ mcp?: boolean | undefined;
245
250
  }
246
251
  /**
247
252
  * Structured dependency declaration. The string form (`dependsOn: ['foo']`)
@@ -253,13 +258,13 @@ interface PluginCapabilities {
253
258
  interface PluginDependency {
254
259
  name: string;
255
260
  /** npm-style semver range. Supports `^`, `~`, exact, and unprefixed. */
256
- version?: string;
261
+ version?: string | undefined;
257
262
  }
258
263
  interface Plugin {
259
264
  name: string;
260
- version?: string;
265
+ version?: string | undefined;
261
266
  /** One-line summary for `wstack plugins list` and error messages. */
262
- description?: string;
267
+ description?: string | undefined;
263
268
  /** Semver range against the kernel API version (KERNEL_API_VERSION). */
264
269
  apiVersion: string;
265
270
  /**
@@ -267,22 +272,22 @@ interface Plugin {
267
272
  * Optional; provided for diagnostics and UX. The loader does not enforce
268
273
  * these, but mismatch is surfaced via logger at warn level.
269
274
  */
270
- capabilities?: PluginCapabilities;
275
+ capabilities?: PluginCapabilities | undefined;
271
276
  /**
272
277
  * JSON Schema for the options under `Config.plugins[<name>].options`.
273
278
  * When present, the loader validates that section before calling `setup`
274
279
  * and rejects the plugin with a clear error path on failure.
275
280
  */
276
- configSchema?: JSONSchema;
281
+ configSchema?: JSONSchema | undefined;
277
282
  /**
278
283
  * Mandatory plugin dependencies — loading fails if any are absent or
279
284
  * version-incompatible. Accepts both the legacy string-array form and
280
285
  * the structured form with version constraints.
281
286
  */
282
- dependsOn?: (string | PluginDependency)[];
287
+ dependsOn?: (string | PluginDependency)[] | undefined;
283
288
  /** Optional plugin dependencies — silently skipped if absent. */
284
- optionalDeps?: (string | PluginDependency)[];
285
- conflictsWith?: string[];
289
+ optionalDeps?: (string | PluginDependency)[] | undefined;
290
+ conflictsWith?: string[] | undefined;
286
291
  /**
287
292
  * Default configuration values, deep-merged under the plugin's options
288
293
  * key before `configSchema` validation. User-provided values take
@@ -301,7 +306,7 @@ interface Plugin {
301
306
  */
302
307
  health?(): Promise<{
303
308
  ok: boolean;
304
- message?: string;
309
+ message?: string | undefined;
305
310
  }>;
306
311
  }
307
312
 
@@ -310,16 +315,16 @@ interface BridgeMessage<T = unknown> {
310
315
  id: string;
311
316
  type: BridgeMessageType;
312
317
  from: string;
313
- to?: string;
318
+ to?: string | undefined;
314
319
  payload: T;
315
320
  timestamp: number;
316
- priority?: 'low' | 'normal' | 'high' | 'critical';
321
+ priority?: 'low' | 'normal' | 'high' | 'critical' | undefined;
317
322
  }
318
323
  interface AgentBridgeConfig {
319
324
  agentId: string;
320
325
  coordinatorId: string;
321
- timeoutMs?: number;
322
- bufferSize?: number;
326
+ timeoutMs?: number | undefined;
327
+ bufferSize?: number | undefined;
323
328
  }
324
329
  interface AgentBridge {
325
330
  readonly agentId: string;
@@ -327,7 +332,7 @@ interface AgentBridge {
327
332
  send(msg: BridgeMessage): Promise<void>;
328
333
  broadcast(msg: BridgeMessage): Promise<void>;
329
334
  subscribe(handler: (msg: BridgeMessage) => void | Promise<void>): () => void;
330
- request<T>(msg: BridgeMessage, timeoutMs?: number): Promise<BridgeMessage<T>>;
335
+ request<T>(msg: BridgeMessage, timeoutMs?: number): Promise<BridgeMessage<T>> | undefined;
331
336
  stop(): Promise<void>;
332
337
  }
333
338
  interface BridgeTransport {
@@ -344,18 +349,18 @@ declare class BudgetExceededError extends Error {
344
349
  constructor(kind: BudgetKind, limit: number, observed: number);
345
350
  }
346
351
  interface BudgetLimits {
347
- maxIterations?: number;
348
- maxToolCalls?: number;
349
- maxTokens?: number;
352
+ maxIterations?: number | undefined;
353
+ maxToolCalls?: number | undefined;
354
+ maxTokens?: number | undefined;
350
355
  /** Estimated USD cost ceiling. */
351
- maxCostUsd?: number;
356
+ maxCostUsd?: number | undefined;
352
357
  /**
353
358
  * Hard wall-clock timeout measured from `start()`. Off by default — set it
354
359
  * explicitly only when a task must finish within an absolute window. For
355
360
  * the everyday "don't kill an agent that's still working" guard, prefer
356
361
  * `idleTimeoutMs`, which resets on activity.
357
362
  */
358
- timeoutMs?: number;
363
+ timeoutMs?: number | undefined;
359
364
  /**
360
365
  * Idle timeout: the maximum gap (ms) between activity signals (iterations,
361
366
  * tool calls, token usage, streamed progress) before the subagent is
@@ -363,7 +368,7 @@ interface BudgetLimits {
363
368
  * agent continuously resets this clock via `markActivity()`, so it never
364
369
  * trips on a long-but-productive run — only on a genuine stall.
365
370
  */
366
- idleTimeoutMs?: number;
371
+ idleTimeoutMs?: number | undefined;
367
372
  }
368
373
  /**
369
374
  * Controls how the budget behaves when `onThreshold` is set and a limit is hit.
@@ -469,7 +474,7 @@ declare class SubagentBudget {
469
474
  * Injected by the runner when wiring the budget to its EventBus.
470
475
  * Used to emit `budget.threshold_reached` events in `'auto'` mode.
471
476
  */
472
- _events?: EventBus;
477
+ _events?: EventBus | undefined;
473
478
  /**
474
479
  * Negotiation mode — controls whether a threshold hit tries to emit
475
480
  * `budget.threshold_reached` and wait for a coordinator decision, or
@@ -574,26 +579,26 @@ declare class SubagentBudget {
574
579
  }
575
580
 
576
581
  interface SubagentConfig {
577
- id?: string;
582
+ id?: string | undefined;
578
583
  name: string;
579
- role?: string;
580
- prompt?: string;
581
- maxIterations?: number;
582
- maxToolCalls?: number;
583
- maxTokens?: number;
584
- maxCostUsd?: number;
584
+ role?: string | undefined;
585
+ prompt?: string | undefined;
586
+ maxIterations?: number | undefined;
587
+ maxToolCalls?: number | undefined;
588
+ maxTokens?: number | undefined;
589
+ maxCostUsd?: number | undefined;
585
590
  /** Hard wall-clock cap (ms) from start. Opt-in; prefer `idleTimeoutMs`. */
586
- timeoutMs?: number;
591
+ timeoutMs?: number | undefined;
587
592
  /**
588
593
  * Idle timeout (ms): reap the subagent only after this long with no
589
594
  * activity. Resets on every iteration / tool call / streamed progress, so
590
595
  * an actively-working agent runs until its task naturally ends. This is the
591
596
  * default reaper for delegated subagents (see `applyRosterBudget`).
592
597
  */
593
- idleTimeoutMs?: number;
594
- tools?: string[];
595
- model?: string;
596
- priority?: number;
598
+ idleTimeoutMs?: number | undefined;
599
+ tools?: string[] | undefined;
600
+ model?: string | undefined;
601
+ priority?: number | undefined;
597
602
  /**
598
603
  * Working directory for this subagent's tools. Defaults to the factory's
599
604
  * cwd. AutoPhase sets this to a per-phase git worktree so parallel phases
@@ -601,7 +606,7 @@ interface SubagentConfig {
601
606
  * `projectRoot` is intentionally left unchanged — tools resolve the
602
607
  * worktree's `.git` gitlink from `cwd` while staying bounded to the repo.
603
608
  */
604
- cwd?: string;
609
+ cwd?: string | undefined;
605
610
  /**
606
611
  * Provider registry id (e.g. `'anthropic'`, `'openai'`, `'google'`).
607
612
  * Allows a director to mix providers across siblings — one subagent on
@@ -609,20 +614,20 @@ interface SubagentConfig {
609
614
  * factory's default provider when omitted, which is the legacy
610
615
  * single-provider behavior.
611
616
  */
612
- provider?: string;
617
+ provider?: string | undefined;
613
618
  /**
614
619
  * Per-subagent session JSONL path. When omitted the orchestrator-
615
620
  * supplied factory derives a path under `<sessionRoot>/<runId>/`.
616
621
  * Override to redirect the transcript elsewhere (long-term storage,
617
622
  * a different filesystem, etc.).
618
623
  */
619
- sessionPath?: string;
624
+ sessionPath?: string | undefined;
620
625
  /**
621
626
  * Additional text appended to the role's base system prompt. Does not
622
627
  * replace it. Useful for last-mile guidance like "you may only call
623
628
  * read tools, never write" or "respond in JSON only".
624
629
  */
625
- systemPromptOverride?: string;
630
+ systemPromptOverride?: string | undefined;
626
631
  /**
627
632
  * Domain-specific knowledge injected into the subagent's system prompt
628
633
  * between the shared scratchpad and the override. Typically populated
@@ -630,7 +635,7 @@ interface SubagentConfig {
630
635
  * bug-hunter skill body for a bug-hunter subagent). Keeps subagents
631
636
  * informed of same domain patterns the host agent knows.
632
637
  */
633
- skillContent?: string;
638
+ skillContent?: string | undefined;
634
639
  /**
635
640
  * Routing for streaming output. `'director'` (default) forwards
636
641
  * text/tool events to the parent's FleetBus so the director can read
@@ -639,8 +644,8 @@ interface SubagentConfig {
639
644
  * direct to the user-facing renderer (gate this behind an explicit
640
645
  * config flag — it can confuse the chat surface).
641
646
  */
642
- textStream?: 'director' | 'silent' | 'user';
643
- toolStream?: 'director' | 'silent' | 'user';
647
+ textStream?: 'director' | 'silent' | 'user' | undefined;
648
+ toolStream?: 'director' | 'silent' | 'user' | undefined;
644
649
  }
645
650
  /**
646
651
  * Discriminator for every distinct failure mode a subagent can hit. The
@@ -698,24 +703,24 @@ interface SubagentError {
698
703
  /** True if the operation can be retried as-is (possibly with backoff). */
699
704
  retryable: boolean;
700
705
  /** Suggested backoff before retry, in ms. Set for `provider_rate_limit` and `provider_5xx`. */
701
- backoffMs?: number;
706
+ backoffMs?: number | undefined;
702
707
  /** Original cause snapshot for diagnostics — never used for control flow. */
703
708
  cause?: {
704
709
  name: string;
705
710
  message: string;
706
- stack?: string;
707
- };
711
+ stack?: string | undefined;
712
+ } | undefined;
708
713
  }
709
714
  interface TaskResult<T = unknown> {
710
715
  subagentId: string;
711
716
  taskId: string;
712
717
  status: 'success' | 'failed' | 'timeout' | 'stopped';
713
- result?: T;
718
+ result?: T | undefined;
714
719
  /**
715
720
  * Structured failure envelope. Populated whenever `status !== 'success'`.
716
721
  * Prefer reading `error.kind` over substring-matching `error.message`.
717
722
  */
718
- error?: SubagentError;
723
+ error?: SubagentError | undefined;
719
724
  iterations: number;
720
725
  toolCalls: number;
721
726
  durationMs: number;
@@ -723,18 +728,18 @@ interface TaskResult<T = unknown> {
723
728
  interface TaskSpec {
724
729
  id: string;
725
730
  description: string;
726
- subagentId?: string;
727
- priority?: number;
728
- maxToolCalls?: number;
729
- timeoutMs?: number;
731
+ subagentId?: string | undefined;
732
+ priority?: number | undefined;
733
+ maxToolCalls?: number | undefined;
734
+ timeoutMs?: number | undefined;
730
735
  context?: Record<string, unknown>;
731
736
  }
732
737
  interface DoneCondition {
733
738
  type: 'iterations' | 'tool_calls' | 'output_match' | 'custom' | 'all_tasks_done' | 'directive';
734
- maxIterations?: number;
735
- maxToolCalls?: number;
736
- pattern?: string;
737
- predicate?: string;
739
+ maxIterations?: number | undefined;
740
+ maxToolCalls?: number | undefined;
741
+ pattern?: string | undefined;
742
+ predicate?: string | undefined;
738
743
  /**
739
744
  * For `directive` type — stop when model emits [done] and keep going
740
745
  * on [continue]/[next step]/[proceed] WITHOUT returning to the outer runner.
@@ -742,27 +747,27 @@ interface DoneCondition {
742
747
  * When true, the runner passes `autonomousContinue: true` to the agent and
743
748
  * re-runs internally when the model signals continue.
744
749
  */
745
- autonomous?: boolean;
750
+ autonomous?: boolean | undefined;
746
751
  }
747
752
  interface MultiAgentConfig {
748
753
  coordinatorId: string;
749
- leaderSystemPrompt?: string;
750
- subagents?: SubagentConfig[];
751
- maxConcurrent?: number;
754
+ leaderSystemPrompt?: string | undefined;
755
+ subagents?: SubagentConfig[] | undefined;
756
+ maxConcurrent?: number | undefined;
752
757
  doneCondition: DoneCondition;
753
- timeoutMs?: number;
758
+ timeoutMs?: number | undefined;
754
759
  /**
755
760
  * Optional default budget applied to every spawned subagent. Per-subagent
756
761
  * fields in `SubagentConfig` override these. Coordinator enforces them by
757
762
  * constructing a `SubagentBudget` per spawn — see `SubagentRunContext.budget`.
758
763
  */
759
764
  defaultBudget?: {
760
- maxIterations?: number;
761
- maxToolCalls?: number;
762
- maxTokens?: number;
763
- maxCostUsd?: number;
764
- timeoutMs?: number;
765
- idleTimeoutMs?: number;
765
+ maxIterations?: number | undefined;
766
+ maxToolCalls?: number | undefined;
767
+ maxTokens?: number | undefined;
768
+ maxCostUsd?: number | undefined;
769
+ timeoutMs?: number | undefined;
770
+ idleTimeoutMs?: number | undefined;
766
771
  };
767
772
  }
768
773
  interface SpawnResult {
@@ -835,7 +840,7 @@ interface SubagentRunContext {
835
840
  bridge: AgentBridge | null;
836
841
  }
837
842
  interface SubagentRunOutcome {
838
- result?: unknown;
843
+ result?: unknown | undefined;
839
844
  iterations: number;
840
845
  toolCalls: number;
841
846
  }
@@ -845,10 +850,10 @@ interface CoordinatorStatus {
845
850
  id: string;
846
851
  name: string;
847
852
  status: 'running' | 'idle' | 'stopped' | 'error';
848
- currentTask?: string;
853
+ currentTask?: string | undefined;
849
854
  /** Cumulative budget auto-extensions granted to this subagent, when the
850
855
  * status is produced by a Director that tracks them. */
851
- extensions?: number;
856
+ extensions?: number | undefined;
852
857
  }[];
853
858
  pendingTasks: number;
854
859
  completedTasks: number;
@@ -881,7 +886,7 @@ interface SubagentContext {
881
886
  */
882
887
  interface FleetEvent {
883
888
  subagentId: string;
884
- taskId?: string;
889
+ taskId?: string | undefined;
885
890
  ts: number;
886
891
  type: string;
887
892
  payload: unknown;
@@ -939,8 +944,8 @@ interface FleetUsage {
939
944
  }
940
945
  interface SubagentUsageSnapshot {
941
946
  subagentId: string;
942
- provider?: string;
943
- model?: string;
947
+ provider?: string | undefined;
948
+ model?: string | undefined;
944
949
  input: number;
945
950
  output: number;
946
951
  cacheRead: number;
@@ -964,14 +969,14 @@ declare class FleetUsageAggregator {
964
969
  private readonly perSubagent;
965
970
  private readonly total;
966
971
  private readonly unsub;
967
- constructor(bus: FleetBus, priceLookup?: ((subagentId: string, provider?: string, model?: string) => {
968
- input?: number;
969
- output?: number;
970
- cacheRead?: number;
971
- cacheWrite?: number;
972
+ constructor(bus: FleetBus, priceLookup?: ((subagentId: string, provider?: string | undefined, model?: string | undefined) => {
973
+ input?: number | undefined;
974
+ output?: number | undefined;
975
+ cacheRead?: number | undefined;
976
+ cacheWrite?: number | undefined;
972
977
  } | undefined) | undefined, metaLookup?: ((subagentId: string) => {
973
- provider?: string;
974
- model?: string;
978
+ provider?: string | undefined;
979
+ model?: string | undefined;
975
980
  } | undefined) | undefined);
976
981
  /**
977
982
  * Remove a terminated subagent's data from the aggregator and subtract its
@@ -1011,7 +1016,7 @@ interface AgentFactoryResult {
1011
1016
  * thrown here are swallowed so a flaky cleanup can't mask the task's
1012
1017
  * real result.
1013
1018
  */
1014
- dispose?: () => Promise<void> | void;
1019
+ dispose?: ((() => Promise<void> | void)) | undefined;
1015
1020
  }
1016
1021
  interface AgentRunnerOptions {
1017
1022
  factory: AgentFactory;
@@ -1027,7 +1032,7 @@ interface AgentRunnerOptions {
1027
1032
  * injection seam that lets the TUI fleet panel observe subagent activity
1028
1033
  * live — without it, FleetBus stays empty.
1029
1034
  */
1030
- fleetBus?: FleetBus;
1035
+ fleetBus?: FleetBus | undefined;
1031
1036
  }
1032
1037
  /**
1033
1038
  * Builds a `SubagentRunner` that drives a real `Agent` per task while honoring
@@ -1,4 +1,4 @@
1
- import { d as Context } from './context-y87Jc5ei.js';
1
+ import { d as Context } from './context-ToHAp4-U.js';
2
2
 
3
3
  interface CompactRepairReport {
4
4
  removedToolUses: string[];
@@ -30,11 +30,11 @@ interface CompactReport {
30
30
  phase: 'elision' | 'summary' | 'selective';
31
31
  saved: number;
32
32
  }[];
33
- repaired?: CompactRepairReport;
33
+ repaired?: CompactRepairReport | undefined;
34
34
  }
35
35
  interface Compactor {
36
36
  compact(ctx: Context, opts?: {
37
- aggressive?: boolean;
37
+ aggressive?: boolean | undefined;
38
38
  }): Promise<CompactReport>;
39
39
  }
40
40