@wrongstack/core 0.275.0 → 0.276.2

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 (83) hide show
  1. package/dist/{agent-bridge-D9JkPvJ0.d.ts → agent-bridge-D7A-eu3C.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-CArSFKFl.d.ts → agent-subagent-runner-CEuw4ATz.d.ts} +16 -10
  3. package/dist/{brain-DCkB5_e7.d.ts → brain-BLOyN5ZP.d.ts} +127 -1
  4. package/dist/{compactor-CzSvxM1g.d.ts → compactor-DcBpaJsI.d.ts} +1 -1
  5. package/dist/{config-BzFRKkg7.d.ts → config-Bf5mj-ad.d.ts} +20 -2
  6. package/dist/{context-BrLe8pJy.d.ts → context-CLnUMW5g.d.ts} +40 -2
  7. package/dist/coordination/index.d.ts +43 -24
  8. package/dist/coordination/index.js +849 -648
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +28 -28
  11. package/dist/defaults/index.js +1636 -845
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +16 -16
  14. package/dist/execution/index.js +218 -49
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/execution/prompt-enhancer.d.ts +1 -1
  17. package/dist/extension/index.d.ts +7 -7
  18. package/dist/extension/index.js.map +1 -1
  19. package/dist/{global-mailbox-CXkugtNQ.d.ts → global-mailbox-Iqfkgmwu.d.ts} +3 -3
  20. package/dist/{goal-store-DUwdbdoY.d.ts → goal-store-DGb6b5Ed.d.ts} +1 -1
  21. package/dist/hq/index.d.ts +6 -6
  22. package/dist/hq/index.js +178 -75
  23. package/dist/hq/index.js.map +1 -1
  24. package/dist/{index-CtlizLTK.d.ts → index-Cn0NOshr.d.ts} +10 -5
  25. package/dist/{index-neOCEy6q.d.ts → index-L4RZN9jJ.d.ts} +2 -2
  26. package/dist/index.d.ts +56 -48
  27. package/dist/index.js +2789 -1546
  28. package/dist/index.js.map +1 -1
  29. package/dist/infrastructure/index.d.ts +6 -6
  30. package/dist/infrastructure/index.js +26 -7
  31. package/dist/infrastructure/index.js.map +1 -1
  32. package/dist/kernel/index.d.ts +20 -12
  33. package/dist/kernel/index.js +55 -9
  34. package/dist/kernel/index.js.map +1 -1
  35. package/dist/{mailbox-types-_7gaY0Rl.d.ts → mailbox-types-DTl7bRH3.d.ts} +3 -1
  36. package/dist/{mcp-servers-MLL6bMlv.d.ts → mcp-servers-CuZGf9fI.d.ts} +4 -4
  37. package/dist/models/index.d.ts +5 -5
  38. package/dist/models/index.js +223 -139
  39. package/dist/models/index.js.map +1 -1
  40. package/dist/{models-registry-CrkcxQ-g.d.ts → models-registry-8XOdxWQu.d.ts} +16 -1
  41. package/dist/{multi-agent-coordinator-Dc_HuG9p.d.ts → multi-agent-coordinator-CiRtKVTk.d.ts} +8 -1
  42. package/dist/{null-fleet-bus-BMZwMin7.d.ts → null-fleet-bus-d9G-bVy9.d.ts} +26 -22
  43. package/dist/observability/index.d.ts +2 -2
  44. package/dist/{path-resolver-uVK4BatM.d.ts → path-resolver-BhIb6mtd.d.ts} +8 -3
  45. package/dist/{permission-CJR1qfOi.d.ts → permission-BCbQDR2s.d.ts} +1 -1
  46. package/dist/{permission-policy-DLVKKk4w.d.ts → permission-policy-C0ikndX_.d.ts} +2 -18
  47. package/dist/{pipeline-BYR-Vdau.d.ts → pipeline-Dl6XbfE7.d.ts} +10 -6
  48. package/dist/{provider-model-resolve-iREK_1lG.d.ts → provider-model-resolve-B70epO19.d.ts} +3 -3
  49. package/dist/{provider-runner-i7SQXZuC.d.ts → provider-runner-DZ808MSM.d.ts} +3 -3
  50. package/dist/{retry-policy-BmY5ooh3.d.ts → retry-policy-Dt3_z8Aj.d.ts} +1 -1
  51. package/dist/sdd/index.d.ts +19 -10
  52. package/dist/sdd/index.js +411 -240
  53. package/dist/sdd/index.js.map +1 -1
  54. package/dist/{secret-vault-C9leEMzr.d.ts → secret-vault-BUJ2d1gB.d.ts} +1 -1
  55. package/dist/security/index.d.ts +5 -5
  56. package/dist/security/index.js +30 -6
  57. package/dist/security/index.js.map +1 -1
  58. package/dist/{selector-qjpee9BF.d.ts → selector-BCkWgdwy.d.ts} +1 -1
  59. package/dist/{session-event-bridge-m7y--I-H.d.ts → session-event-bridge-CMvIO59_.d.ts} +1 -1
  60. package/dist/{session-reader-BjLH4V9n.d.ts → session-reader-C8aiChUu.d.ts} +1 -1
  61. package/dist/skills/index.js +1 -0
  62. package/dist/skills/index.js.map +1 -1
  63. package/dist/storage/index.d.ts +68 -30
  64. package/dist/storage/index.js +839 -528
  65. package/dist/storage/index.js.map +1 -1
  66. package/dist/{strategy-compactor-C2bmlWYg.d.ts → strategy-compactor-DI1OHVbB.d.ts} +10 -10
  67. package/dist/{todos-checkpoint-oDS9IBNS.d.ts → todos-checkpoint-Ddd2CGr0.d.ts} +56 -9
  68. package/dist/{tool-executor-D4YdaJ-M.d.ts → tool-executor-Bmd5Ygoo.d.ts} +45 -10
  69. package/dist/tools/index.d.ts +2 -2
  70. package/dist/tools/index.js.map +1 -1
  71. package/dist/types/index.d.ts +20 -20
  72. package/dist/types/index.js +331 -98
  73. package/dist/types/index.js.map +1 -1
  74. package/dist/utils/index.d.ts +16 -3
  75. package/dist/utils/index.js +159 -83
  76. package/dist/utils/index.js.map +1 -1
  77. package/dist/{worktree-manager-A1Efnvs0.d.ts → worktree-manager-DBdl_5rs.d.ts} +4 -1
  78. package/instructions/agents/shadow-agent.md +3 -3
  79. package/instructions/coordination/director-preamble.md +3 -3
  80. package/instructions/modes/research-web.md +4 -4
  81. package/package.json +1 -1
  82. package/skills/research-web/SKILL.md +26 -26
  83. package/skills/research-web/SKILL.save.md +1 -1
@@ -1,4 +1,4 @@
1
- import { U as Usage, C as Context, l as ToolProgressEvent, T as Tool, m as ToolOutputMetadata } from './context-BrLe8pJy.js';
1
+ import { U as Usage, C as Context, l as ToolErrorCategory, m as ToolProgressEvent, T as Tool, n as ToolOutputMetadata } from './context-CLnUMW5g.js';
2
2
 
3
3
  type MemoryScope = 'project-agents' | 'project-memory' | 'user-memory';
4
4
  type MemoryType = 'fact' | 'decision' | 'convention' | 'preference' | 'reference' | 'anti_pattern';
@@ -118,20 +118,24 @@ interface TrackedAgentSnapshot {
118
118
  }
119
119
  interface EventMap {
120
120
  'brain.decision_requested': {
121
+ sessionId?: string | undefined;
121
122
  request: BrainDecisionRequest;
122
123
  at: number;
123
124
  };
124
125
  'brain.decision_answered': {
126
+ sessionId?: string | undefined;
125
127
  request: BrainDecisionRequest;
126
128
  decision: BrainDecision;
127
129
  at: number;
128
130
  };
129
131
  'brain.decision_ask_human': {
132
+ sessionId?: string | undefined;
130
133
  request: BrainDecisionRequest;
131
134
  decision: BrainDecision;
132
135
  at: number;
133
136
  };
134
137
  'brain.human_answered': {
138
+ sessionId?: string | undefined;
135
139
  id: string;
136
140
  optionId?: string | undefined;
137
141
  deny?: boolean | undefined;
@@ -139,6 +143,7 @@ interface EventMap {
139
143
  at: number;
140
144
  };
141
145
  'brain.decision_denied': {
146
+ sessionId?: string | undefined;
142
147
  request: BrainDecisionRequest;
143
148
  decision: BrainDecision;
144
149
  at: number;
@@ -150,6 +155,7 @@ interface EventMap {
150
155
  * it — a corrective steer was delivered to the working agent.
151
156
  */
152
157
  'brain.intervention': {
158
+ sessionId?: string | undefined;
153
159
  kind: 'tool_failure_streak' | 'error_storm';
154
160
  request: BrainDecisionRequest;
155
161
  decision: BrainDecision;
@@ -159,9 +165,11 @@ interface EventMap {
159
165
  };
160
166
  'session.started': {
161
167
  id: string;
168
+ sessionId?: string | undefined;
162
169
  };
163
170
  'session.ended': {
164
171
  id: string;
172
+ sessionId?: string | undefined;
165
173
  usage: Usage;
166
174
  };
167
175
  'session.damaged': {
@@ -175,6 +183,7 @@ interface EventMap {
175
183
  * session-registry file.
176
184
  */
177
185
  'session.agents_updated': {
186
+ sessionId?: string | undefined;
178
187
  agents: readonly TrackedAgentSnapshot[];
179
188
  };
180
189
  /**
@@ -182,11 +191,13 @@ interface EventMap {
182
191
  * measure active-run elapsed time instead of inferring it from iterations.
183
192
  */
184
193
  'agent.run.started': {
194
+ sessionId?: string | undefined;
185
195
  ctx: Context;
186
196
  model: string;
187
197
  at: string;
188
198
  };
189
199
  'agent.run.completed': {
200
+ sessionId?: string | undefined;
190
201
  ctx: Context;
191
202
  status: 'done' | 'failed' | 'max_iterations' | 'aborted';
192
203
  iterations: number;
@@ -194,16 +205,19 @@ interface EventMap {
194
205
  durationMs: number;
195
206
  };
196
207
  'agent.run.error': {
208
+ sessionId?: string | undefined;
197
209
  ctx: Context;
198
210
  err: Error;
199
211
  at: string;
200
212
  durationMs: number;
201
213
  };
202
214
  'iteration.started': {
215
+ sessionId?: string | undefined;
203
216
  ctx: Context;
204
217
  index: number;
205
218
  };
206
219
  'iteration.completed': {
220
+ sessionId?: string | undefined;
207
221
  ctx: Context;
208
222
  index: number;
209
223
  };
@@ -213,30 +227,36 @@ interface EventMap {
213
227
  * If no listener responds within 30s the run ends with 'max_iterations'.
214
228
  */
215
229
  'iteration.limit_reached': {
230
+ sessionId?: string | undefined;
216
231
  currentIterations: number;
217
232
  currentLimit: number;
218
233
  grant: (extraIterations: number) => void;
219
234
  deny: () => void;
220
235
  };
221
236
  'provider.response': {
237
+ sessionId?: string | undefined;
222
238
  ctx: Context;
223
239
  usage: Usage;
224
240
  stopReason: string;
225
241
  };
226
242
  'provider.text_delta': {
243
+ sessionId?: string | undefined;
227
244
  ctx: Context;
228
245
  text: string;
229
246
  };
230
247
  'provider.thinking_delta': {
248
+ sessionId?: string | undefined;
231
249
  ctx: Context;
232
250
  text: string;
233
251
  };
234
252
  'provider.tool_use_start': {
253
+ sessionId?: string | undefined;
235
254
  ctx: Context;
236
255
  id: string;
237
256
  name: string;
238
257
  };
239
258
  'provider.tool_use_stop': {
259
+ sessionId?: string | undefined;
240
260
  ctx: Context;
241
261
  id: string;
242
262
  name: string;
@@ -248,6 +268,7 @@ interface EventMap {
248
268
  * event's `type`; `msg` is the handler error message.
249
269
  */
250
270
  'provider.stream_error': {
271
+ sessionId?: string | undefined;
251
272
  ctx: Context;
252
273
  eventType: string;
253
274
  msg: string;
@@ -259,6 +280,7 @@ interface EventMap {
259
280
  * instead of grepping logger output for the raw JSON body.
260
281
  */
261
282
  'provider.retry': {
283
+ sessionId?: string | undefined;
262
284
  providerId: string;
263
285
  attempt: number;
264
286
  delayMs: number;
@@ -270,6 +292,7 @@ interface EventMap {
270
292
  * non-retryable error). Same shape as `provider.retry` minus the delay.
271
293
  */
272
294
  'provider.error': {
295
+ sessionId?: string | undefined;
273
296
  providerId: string;
274
297
  status: number;
275
298
  description: string;
@@ -283,6 +306,7 @@ interface EventMap {
283
306
  * render this as a notice: "⚠ opus overloaded — falling back to sonnet".
284
307
  */
285
308
  'provider.fallback': {
309
+ sessionId?: string | undefined;
286
310
  from: {
287
311
  providerId: string;
288
312
  model: string;
@@ -295,16 +319,48 @@ interface EventMap {
295
319
  providerSwitched: boolean;
296
320
  };
297
321
  'tool.started': {
322
+ sessionId?: string | undefined;
298
323
  name: string;
299
324
  id: string;
300
325
  input?: unknown | undefined;
301
326
  };
327
+ /**
328
+ * Fired when a tool call finishes successfully. Metrics collectors can count
329
+ * calls and build latency histograms without parsing renderer output.
330
+ */
331
+ 'tool.completed': {
332
+ name: string;
333
+ id: string;
334
+ sessionId: string;
335
+ traceId?: string | undefined;
336
+ agentId: string;
337
+ durationMs: number;
338
+ outputChars: number;
339
+ };
340
+ /**
341
+ * Fired when a tool call throws. Does not include raw tool input/output.
342
+ */
343
+ 'tool.failed': {
344
+ name: string;
345
+ id: string;
346
+ sessionId: string;
347
+ traceId?: string | undefined;
348
+ agentId: string;
349
+ durationMs: number;
350
+ category: ToolErrorCategory;
351
+ retryable: boolean;
352
+ detail?: string | undefined;
353
+ errorCode?: string | undefined;
354
+ errorSubsystem?: string | undefined;
355
+ errorSeverity?: string | undefined;
356
+ };
302
357
  /**
303
358
  * Fired for each ToolProgressEvent yielded by `Tool.executeStream`. UIs
304
359
  * subscribe to render incremental progress (streaming bash output, file
305
360
  * tree counts, etc.) without the tool having to know about the UI.
306
361
  */
307
362
  'tool.progress': {
363
+ sessionId?: string | undefined;
308
364
  name: string;
309
365
  id: string;
310
366
  event: ToolProgressEvent;
@@ -324,6 +380,7 @@ interface EventMap {
324
380
  * passed in the payload with a decision string ('yes' | 'no' | 'always' | 'deny').
325
381
  */
326
382
  'tool.confirm_needed': {
383
+ sessionId?: string | undefined;
327
384
  tool: Tool;
328
385
  input: unknown;
329
386
  toolUseId: string;
@@ -336,6 +393,7 @@ interface EventMap {
336
393
  * persisted to the trust file (e.g. "✓ always allowed popo.txt" / "✗ denied popo.txt").
337
394
  */
338
395
  'trust.persisted': {
396
+ sessionId?: string | undefined;
339
397
  tool: string;
340
398
  pattern: string;
341
399
  decision: 'always' | 'deny';
@@ -362,6 +420,7 @@ interface EventMap {
362
420
  * subscribers that only read `tools` continue to work.
363
421
  */
364
422
  'tool.loop_detected': {
423
+ sessionId?: string | undefined;
365
424
  ctx: Context;
366
425
  /** Comma-separated tool names involved in the loop, or empty string for pure message loops. */
367
426
  tools: string;
@@ -383,6 +442,7 @@ interface EventMap {
383
442
  * tool history line without re-fetching from the session log.
384
443
  */
385
444
  'tool.executed': {
445
+ sessionId?: string | undefined;
386
446
  /**
387
447
  * The tool_use id (e.g. "toolu_…") issued by the provider for this call.
388
448
  * Pairs with `tool.started.id` so subscribers can correlate start/finish
@@ -431,6 +491,8 @@ interface EventMap {
431
491
  * of the subagent. Paired with `delegate.completed`.
432
492
  */
433
493
  'delegate.started': {
494
+ /** Parent/host session id for the delegation lifecycle. */
495
+ sessionId?: string | undefined;
434
496
  /** Resolved roster role or free-form subagent name. */
435
497
  target: string;
436
498
  /** The task instruction handed to the subagent (untruncated — UIs trim). */
@@ -444,6 +506,8 @@ interface EventMap {
444
506
  * preview.
445
507
  */
446
508
  'delegate.completed': {
509
+ /** Parent/host session id for the delegation lifecycle. */
510
+ sessionId?: string | undefined;
447
511
  /** Resolved roster role or free-form subagent name. */
448
512
  target: string;
449
513
  /** The task instruction handed to the subagent. */
@@ -468,6 +532,8 @@ interface EventMap {
468
532
  * and the iteration index so UIs can render a threaded timeline.
469
533
  */
470
534
  'agent.timeline.message': {
535
+ /** Parent/host session id this subagent timeline belongs to. */
536
+ sessionId?: string | undefined;
471
537
  /** Subagent id (e.g. "bug-hunter@abc123"). */
472
538
  subagentId: string;
473
539
  /** Human-readable name or role label. */
@@ -491,6 +557,8 @@ interface EventMap {
491
557
  * and add status-change entries to the timeline.
492
558
  */
493
559
  'agent.status_changed': {
560
+ /** Parent/host session id this subagent status belongs to. */
561
+ sessionId?: string | undefined;
494
562
  subagentId: string;
495
563
  agentName: string;
496
564
  status: 'spawned' | 'running' | 'completed' | 'failed' | 'timeout' | 'stopped' | 'budget_exhausted';
@@ -509,6 +577,7 @@ interface EventMap {
509
577
  * `rawLoad`.
510
578
  */
511
579
  'ctx.pct': {
580
+ sessionId?: string | undefined;
512
581
  /** Fraction of maxContext currently in use, clamped to 0..1 for display. */
513
582
  load: number;
514
583
  /** Unclamped fraction when available. Can exceed 1 when over budget. */
@@ -520,11 +589,13 @@ interface EventMap {
520
589
  };
521
590
  /** Fired when the active model's resolved context window changes. */
522
591
  'ctx.max_context': {
592
+ sessionId?: string | undefined;
523
593
  providerId: string;
524
594
  modelId: string;
525
595
  maxContext: number;
526
596
  };
527
597
  'token.threshold': {
598
+ sessionId?: string | undefined;
528
599
  used: number;
529
600
  limit: number;
530
601
  };
@@ -538,6 +609,7 @@ interface EventMap {
538
609
  * by `token.cost_estimate_unavailable`.
539
610
  */
540
611
  'token.accounted': {
612
+ sessionId?: string | undefined;
541
613
  usage: Usage;
542
614
  cost: {
543
615
  input: number;
@@ -557,6 +629,7 @@ interface EventMap {
557
629
  * runner/budget classes.
558
630
  */
559
631
  'budget.threshold_reached': {
632
+ sessionId?: string | undefined;
560
633
  kind: 'iterations' | 'tool_calls' | 'tokens' | 'cost' | 'timeout' | 'idle_timeout';
561
634
  used: number;
562
635
  limit: number;
@@ -578,6 +651,7 @@ interface EventMap {
578
651
  timeoutMs: number;
579
652
  };
580
653
  'context.repaired': {
654
+ sessionId?: string | undefined;
581
655
  ctx: Context;
582
656
  changed: boolean;
583
657
  removedToolUses: string[];
@@ -585,6 +659,7 @@ interface EventMap {
585
659
  removedMessages: number;
586
660
  };
587
661
  'compaction.fired': {
662
+ sessionId?: string | undefined;
588
663
  /** Threshold level that triggered compaction (warn / soft / hard). */
589
664
  level: 'warn' | 'soft' | 'hard';
590
665
  /** Tokens estimated before compaction ran. */
@@ -628,6 +703,7 @@ interface EventMap {
628
703
  * layers / dashboards subscribe to this to surface the silent regression.
629
704
  */
630
705
  'compaction.failed': {
706
+ sessionId?: string | undefined;
631
707
  err: Error;
632
708
  aggressive: boolean;
633
709
  level: 'warn' | 'soft' | 'hard';
@@ -657,6 +733,8 @@ interface EventMap {
657
733
  * and director-orchestrated work.
658
734
  */
659
735
  'subagent.spawned': {
736
+ /** Parent/host session id. Subagents remain children of this session. */
737
+ sessionId?: string | undefined;
660
738
  subagentId: string;
661
739
  taskId: string;
662
740
  name?: string | undefined;
@@ -673,6 +751,8 @@ interface EventMap {
673
751
  transcriptPath?: string | undefined;
674
752
  };
675
753
  'subagent.task_started': {
754
+ /** Parent/host session id. */
755
+ sessionId?: string | undefined;
676
756
  subagentId: string;
677
757
  taskId: string;
678
758
  description?: string | undefined;
@@ -685,6 +765,8 @@ interface EventMap {
685
765
  * denies the extension and the task ends with 'budget_exhausted'.
686
766
  */
687
767
  'subagent.budget_warning': {
768
+ /** Parent/host session id. */
769
+ sessionId?: string | undefined;
688
770
  subagentId: string;
689
771
  kind: string;
690
772
  used: number;
@@ -700,6 +782,8 @@ interface EventMap {
700
782
  * all kinds; `newLimit` is the patched value for `kind`.
701
783
  */
702
784
  'subagent.budget_extended': {
785
+ /** Parent/host session id. */
786
+ sessionId?: string | undefined;
703
787
  subagentId: string;
704
788
  kind: string;
705
789
  newLimit: number;
@@ -714,6 +798,8 @@ interface EventMap {
714
798
  * multiple parallel subagents are distinguishable.
715
799
  */
716
800
  'subagent.tool_executed': {
801
+ /** Parent/host session id. */
802
+ sessionId?: string | undefined;
717
803
  subagentId: string;
718
804
  taskId?: string | undefined;
719
805
  name: string;
@@ -731,6 +817,8 @@ interface EventMap {
731
817
  * the 25-iteration window passes while the agent is between tool calls.
732
818
  */
733
819
  'subagent.iteration_summary': {
820
+ /** Parent/host session id. */
821
+ sessionId?: string | undefined;
734
822
  subagentId: string;
735
823
  iteration: number;
736
824
  toolCalls: number;
@@ -739,6 +827,8 @@ interface EventMap {
739
827
  partialText?: string | undefined;
740
828
  };
741
829
  'subagent.task_completed': {
830
+ /** Parent/host session id. */
831
+ sessionId?: string | undefined;
742
832
  subagentId: string;
743
833
  taskId: string;
744
834
  status: 'success' | 'failed' | 'timeout' | 'stopped';
@@ -773,6 +863,7 @@ interface EventMap {
773
863
  * so the CLI/TUI can render flashy completion banners.
774
864
  */
775
865
  'subagent.done': {
866
+ sessionId?: string | undefined;
776
867
  summary: string;
777
868
  ok: boolean;
778
869
  };
@@ -783,6 +874,8 @@ interface EventMap {
783
874
  * TUI uses this to render live context fill bars per agent.
784
875
  */
785
876
  'subagent.ctx_pct': {
877
+ /** Parent/host session id. */
878
+ sessionId?: string | undefined;
786
879
  subagentId: string;
787
880
  /** Fraction of maxContext currently in use, clamped to 0..1 for display. */
788
881
  load: number;
@@ -793,6 +886,7 @@ interface EventMap {
793
886
  };
794
887
  /** A parallel SDD run started. */
795
888
  'sdd.run.started': {
889
+ sessionId?: string | undefined;
796
890
  runId: string;
797
891
  graphId: string;
798
892
  specId?: string | undefined;
@@ -802,6 +896,7 @@ interface EventMap {
802
896
  };
803
897
  /** A parallel SDD run reached a terminal state. */
804
898
  'sdd.run.finished': {
899
+ sessionId?: string | undefined;
805
900
  runId: string;
806
901
  deadlocked: boolean;
807
902
  completed: number;
@@ -810,6 +905,7 @@ interface EventMap {
810
905
  };
811
906
  /** A task began executing on a worker (carries who + which worktree). */
812
907
  'sdd.task.started': {
908
+ sessionId?: string | undefined;
813
909
  runId: string;
814
910
  taskId: string;
815
911
  subagentId: string;
@@ -818,6 +914,7 @@ interface EventMap {
818
914
  };
819
915
  /** A task finished successfully. */
820
916
  'sdd.task.completed': {
917
+ sessionId?: string | undefined;
821
918
  runId: string;
822
919
  taskId: string;
823
920
  subagentId: string;
@@ -825,6 +922,7 @@ interface EventMap {
825
922
  };
826
923
  /** A task failed terminally (retries exhausted). */
827
924
  'sdd.task.failed': {
925
+ sessionId?: string | undefined;
828
926
  runId: string;
829
927
  taskId: string;
830
928
  subagentId: string;
@@ -832,6 +930,7 @@ interface EventMap {
832
930
  };
833
931
  /** A failed task was requeued for another attempt. */
834
932
  'sdd.task.retrying': {
933
+ sessionId?: string | undefined;
835
934
  runId: string;
836
935
  taskId: string;
837
936
  attempt: number;
@@ -839,30 +938,35 @@ interface EventMap {
839
938
  };
840
939
  /** A task's worker reported success but the post-task verification gate rejected it. */
841
940
  'sdd.task.verification_failed': {
941
+ sessionId?: string | undefined;
842
942
  runId: string;
843
943
  taskId: string;
844
944
  reason: string;
845
945
  };
846
946
  /** A completed task's worktree could not be merged back into the base branch. */
847
947
  'sdd.task.conflict': {
948
+ sessionId?: string | undefined;
848
949
  runId: string;
849
950
  taskId: string;
850
951
  conflictFiles: string[];
851
952
  };
852
953
  /** A completed task's worktree was squash-merged onto the base branch (sha = the run commit). */
853
954
  'sdd.task.merged': {
955
+ sessionId?: string | undefined;
854
956
  runId: string;
855
957
  taskId: string;
856
958
  sha: string;
857
959
  };
858
960
  /** A task was split into sub-tasks (the parent becomes a completed container). */
859
961
  'sdd.task.split': {
962
+ sessionId?: string | undefined;
860
963
  runId: string;
861
964
  taskId: string;
862
965
  subtaskIds: string[];
863
966
  };
864
967
  /** The supervisor made a decision about a failing/stuck task. */
865
968
  'sdd.supervisor.decision': {
969
+ sessionId?: string | undefined;
866
970
  runId: string;
867
971
  taskId: string;
868
972
  action: 'retry' | 'reassign' | 'split' | 'fail';
@@ -870,12 +974,14 @@ interface EventMap {
870
974
  };
871
975
  /** A new wave of dependency-ready tasks began. */
872
976
  'sdd.wave': {
977
+ sessionId?: string | undefined;
873
978
  runId: string;
874
979
  wave: number;
875
980
  batchSize: number;
876
981
  };
877
982
  /** No runnable tasks remain but some are still blocked — with the blocking chains. */
878
983
  'sdd.deadlock': {
984
+ sessionId?: string | undefined;
879
985
  runId: string;
880
986
  chains: Array<{
881
987
  blocked: string;
@@ -889,6 +995,7 @@ interface EventMap {
889
995
  * DAG); consumers cast it back. The producer (SddBoardProjector) is typed.
890
996
  */
891
997
  'sdd.board.snapshot': {
998
+ sessionId?: string | undefined;
892
999
  runId: string;
893
1000
  snapshot: unknown;
894
1001
  };
@@ -905,10 +1012,12 @@ interface EventMap {
905
1012
  reason: string;
906
1013
  };
907
1014
  'token.cost_estimate_unavailable': {
1015
+ sessionId?: string | undefined;
908
1016
  model: string;
909
1017
  };
910
1018
  /** Fired by SessionWriter.writeCheckpoint() after the checkpoint event is appended to JSONL. */
911
1019
  'checkpoint.written': {
1020
+ sessionId?: string | undefined;
912
1021
  promptIndex: number;
913
1022
  promptPreview: string;
914
1023
  ts: string;
@@ -921,11 +1030,13 @@ interface EventMap {
921
1030
  * (Idea #1 from IDEAS.md — Stateful Session Recovery.)
922
1031
  */
923
1032
  'in_flight.started': {
1033
+ sessionId?: string | undefined;
924
1034
  context: string;
925
1035
  ts: string;
926
1036
  };
927
1037
  /** Fired by SessionWriter.clearInFlightMarker() — operation completed cleanly. */
928
1038
  'in_flight.ended': {
1039
+ sessionId?: string | undefined;
929
1040
  reason: 'clean' | 'aborted' | 'recovered';
930
1041
  ts: string;
931
1042
  };
@@ -935,6 +1046,7 @@ interface EventMap {
935
1046
  * list and clear history entries that are now invalid.
936
1047
  */
937
1048
  'session.rewound': {
1049
+ sessionId?: string | undefined;
938
1050
  toPromptIndex: number;
939
1051
  revertedFiles: string[];
940
1052
  removedEvents: number;
@@ -945,6 +1057,7 @@ interface EventMap {
945
1057
  * live fleet counters without polling.
946
1058
  */
947
1059
  'coordinator.stats': {
1060
+ sessionId?: string | undefined;
948
1061
  total: number;
949
1062
  running: number;
950
1063
  idle: number;
@@ -965,6 +1078,7 @@ interface EventMap {
965
1078
  * TUI/WebUI reflect the updated limit without polling the host.
966
1079
  */
967
1080
  'concurrency.changed': {
1081
+ sessionId?: string | undefined;
968
1082
  n: number;
969
1083
  };
970
1084
  /**
@@ -973,6 +1087,7 @@ interface EventMap {
973
1087
  * back sequentially. The WebUI/TUI subscribe to render live swim-lanes/DAG.
974
1088
  */
975
1089
  'worktree.allocated': {
1090
+ sessionId?: string | undefined;
976
1091
  handleId: string;
977
1092
  ownerId: string;
978
1093
  ownerLabel: string;
@@ -982,6 +1097,7 @@ interface EventMap {
982
1097
  baseBranch: string;
983
1098
  };
984
1099
  'worktree.committed': {
1100
+ sessionId?: string | undefined;
985
1101
  handleId: string;
986
1102
  ownerId: string;
987
1103
  branch: string;
@@ -992,6 +1108,7 @@ interface EventMap {
992
1108
  sha?: string | undefined;
993
1109
  };
994
1110
  'worktree.merged': {
1111
+ sessionId?: string | undefined;
995
1112
  handleId: string;
996
1113
  ownerId: string;
997
1114
  branch: string;
@@ -999,18 +1116,21 @@ interface EventMap {
999
1116
  squash: boolean;
1000
1117
  };
1001
1118
  'worktree.conflict': {
1119
+ sessionId?: string | undefined;
1002
1120
  handleId: string;
1003
1121
  ownerId: string;
1004
1122
  branch: string;
1005
1123
  conflictFiles: string[];
1006
1124
  };
1007
1125
  'worktree.released': {
1126
+ sessionId?: string | undefined;
1008
1127
  handleId: string;
1009
1128
  ownerId: string;
1010
1129
  branch: string;
1011
1130
  kept: boolean;
1012
1131
  };
1013
1132
  'worktree.failed': {
1133
+ sessionId?: string | undefined;
1014
1134
  handleId: string;
1015
1135
  ownerId: string;
1016
1136
  branch?: string | undefined;
@@ -1024,6 +1144,7 @@ interface EventMap {
1024
1144
  * derive behavior from it (the REPL owns the actual timer).
1025
1145
  */
1026
1146
  'countdown.tick': {
1147
+ sessionId?: string | undefined;
1027
1148
  remaining: number;
1028
1149
  };
1029
1150
  'memory.remembered': MemoryRememberedPayload;
@@ -1088,6 +1209,8 @@ interface EventMap {
1088
1209
  * external watchers.
1089
1210
  */
1090
1211
  'client.status': {
1212
+ /** Active session represented by this client status update. */
1213
+ sessionId?: string | undefined;
1091
1214
  clientType: string;
1092
1215
  clientId: string;
1093
1216
  projectHash: string;
@@ -1103,6 +1226,7 @@ interface EventMap {
1103
1226
  projectSlug: string;
1104
1227
  };
1105
1228
  error: {
1229
+ sessionId?: string | undefined;
1106
1230
  err: Error;
1107
1231
  phase: string;
1108
1232
  _original?: Error | undefined;
@@ -1277,6 +1401,8 @@ interface BrainDecisionOption {
1277
1401
  }
1278
1402
  interface BrainDecisionRequest {
1279
1403
  id: string;
1404
+ /** Active host session id for surfaces that multiplex multiple sessions. */
1405
+ sessionId?: string | undefined;
1280
1406
  source: BrainDecisionSource;
1281
1407
  question: string;
1282
1408
  context?: string | undefined;
@@ -1,4 +1,4 @@
1
- import { C as Context } from './context-BrLe8pJy.js';
1
+ import { C as Context } from './context-CLnUMW5g.js';
2
2
 
3
3
  interface CompactRepairReport {
4
4
  removedToolUses: string[];
@@ -1,4 +1,4 @@
1
- import { a as ReasoningConfig, n as Capabilities, h as Permission, o as ReasoningEffort, p as CacheTtl } from './context-BrLe8pJy.js';
1
+ import { a as ReasoningConfig, o as Capabilities, h as Permission, p as ReasoningEffort, q as CacheTtl } from './context-CLnUMW5g.js';
2
2
 
3
3
  type ContextWindowModeId = 'balanced' | 'frugal' | 'deep' | 'archival';
4
4
  type ContextWindowAggressiveOn = 'hard' | 'soft' | 'warn';
@@ -580,6 +580,14 @@ interface ProviderConfig {
580
580
  envVars?: string[] | undefined;
581
581
  /** Optional list of models the user wants visible for this provider. */
582
582
  models?: string[] | undefined;
583
+ /**
584
+ * Fetch this provider's model list + per-model capabilities from its
585
+ * `{baseUrl}/models` endpoint at startup and inject them into the catalog.
586
+ * For openai-compatible gateways/proxies (omniroute, LiteLLM, vLLM, …) that
587
+ * expose rich metadata there. Defaults on for presets that set it (omniroute).
588
+ * Discovery is best-effort: a down server or missing key is a no-op.
589
+ */
590
+ autoDiscoverModels?: boolean | undefined;
583
591
  /**
584
592
  * Provider-relative custom model definitions (maps modelId → definition).
585
593
  * Each entry adds/overrides a model for this provider with optional
@@ -707,6 +715,16 @@ interface FeaturesConfig {
707
715
  * Configure via: `features.tokenSavingMode: "minimal"` in config.
708
716
  */
709
717
  tokenSavingMode?: TokenSavingTier | boolean | undefined;
718
+ /**
719
+ * Enable the autonomous-coordination toolkit (AutonomousCoordinator +
720
+ * KnowledgeGraph + ConsensusProtocol + TaskAuctioneer + ChangeManager +
721
+ * TaskDAG). When true (the default), the TUI boot wires the coordinator
722
+ * lazily on the first Director spawn. When false, the coordinator is
723
+ * never constructed and the `/coordinator` slash command reports it
724
+ * unavailable — reducing the coordination domain's runtime surface for
725
+ * users who only use the simpler Director/Fleet path.
726
+ */
727
+ autonomousCoordination?: boolean | undefined;
710
728
  /**
711
729
  * Allow tools to read/write paths outside the project root directory.
712
730
  * When true (default), tools can access any path on the filesystem.
@@ -799,7 +817,7 @@ interface LaunchConfig {
799
817
  }
800
818
  /**
801
819
  * Controls how much detail is persisted to the per-session JSONL log
802
- * (`~/.wrongstack/projects/<hash>/sessions/<id>.jsonl`).
820
+ * (`~/.wrongstack/projects/<hash>/sessions/<date>/sess_<ULID>.jsonl`).
803
821
  */
804
822
  interface SessionLoggingConfig {
805
823
  /**