@wrongstack/core 0.272.2 → 0.273.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 (71) hide show
  1. package/dist/{agent-bridge-DFQYEeXf.d.ts → agent-bridge-DpKIxHhE.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-BZa_IEcd.d.ts → agent-subagent-runner-Dx7fZ1bE.d.ts} +14 -7
  3. package/dist/{brain-etbcbRwV.d.ts → brain-BDcQaku-.d.ts} +112 -5
  4. package/dist/{compactor-72ug-ZRB.d.ts → compactor-BuSdj3fq.d.ts} +1 -1
  5. package/dist/{config-rRS8yorV.d.ts → config-CR2yoG8c.d.ts} +61 -4
  6. package/dist/{context-Dw55zZ_Q.d.ts → context-DulAr8Zo.d.ts} +24 -0
  7. package/dist/coordination/index.d.ts +23 -16
  8. package/dist/coordination/index.js +192 -38
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/{default-config-B0cj-Hry.d.ts → default-config-BbX4ojZs.d.ts} +1 -0
  11. package/dist/defaults/index.d.ts +29 -28
  12. package/dist/defaults/index.js +3238 -234
  13. package/dist/defaults/index.js.map +1 -1
  14. package/dist/execution/index.d.ts +16 -16
  15. package/dist/execution/index.js +83 -3
  16. package/dist/execution/index.js.map +1 -1
  17. package/dist/execution/prompt-enhancer.d.ts +1 -1
  18. package/dist/extension/index.d.ts +6 -6
  19. package/dist/{global-mailbox-DJ4EoRr0.d.ts → global-mailbox-CwcubDkA.d.ts} +1 -1
  20. package/dist/{goal-preamble-hM8BH7TK.d.ts → goal-preamble-Bu0a2uCG.d.ts} +10 -10
  21. package/dist/{goal-store-CWlbT0TO.d.ts → goal-store-CTmFuZ8J.d.ts} +1 -1
  22. package/dist/hq/index.d.ts +5 -5
  23. package/dist/hq/index.js +1 -0
  24. package/dist/hq/index.js.map +1 -1
  25. package/dist/{index-DWm_PE9L.d.ts → index-CTq5wU3m.d.ts} +14 -6
  26. package/dist/{index-2Lhk5v0o.d.ts → index-CxP-HBhX.d.ts} +8 -2
  27. package/dist/index.d.ts +230 -48
  28. package/dist/index.js +3731 -648
  29. package/dist/index.js.map +1 -1
  30. package/dist/infrastructure/index.d.ts +6 -6
  31. package/dist/kernel/index.d.ts +94 -14
  32. package/dist/kernel/index.js.map +1 -1
  33. package/dist/{mcp-servers-BpWHTKlE.d.ts → mcp-servers-BQaOE71z.d.ts} +3 -3
  34. package/dist/models/index.d.ts +5 -5
  35. package/dist/{models-registry-CXQFUn5t.d.ts → models-registry-BEcny4kP.d.ts} +1 -1
  36. package/dist/{multi-agent-coordinator-jyimfo7D.d.ts → multi-agent-coordinator-Bx8EFkv2.d.ts} +1 -1
  37. package/dist/{null-fleet-bus-DOGQcvrY.d.ts → null-fleet-bus-BC5ZXCQw.d.ts} +16 -6
  38. package/dist/observability/index.d.ts +2 -2
  39. package/dist/{parallel-eternal-engine-rItJBYp9.d.ts → parallel-eternal-engine-C345TI3n.d.ts} +10 -9
  40. package/dist/{path-resolver-DrpF5MGK.d.ts → path-resolver-C-W_wzkF.d.ts} +3 -3
  41. package/dist/{permission-CC7XFYWG.d.ts → permission-CsBGZkxp.d.ts} +1 -1
  42. package/dist/{permission-policy-cYR4RJmw.d.ts → permission-policy-g3Sg0GdZ.d.ts} +2 -2
  43. package/dist/{pipeline-Ckkn3AOA.d.ts → pipeline-xnw_24Z8.d.ts} +2 -2
  44. package/dist/{plan-templates-BvHw5Znw.d.ts → plan-templates-DGaiYEcS.d.ts} +32 -6
  45. package/dist/{provider-model-resolve-nZqnCeaR.d.ts → provider-model-resolve-Cz6OlIOp.d.ts} +3 -3
  46. package/dist/{provider-runner-zVOn1p67.d.ts → provider-runner-7J0HqF6B.d.ts} +3 -3
  47. package/dist/{retry-policy-BV7nzeAd.d.ts → retry-policy-kqXJOVkX.d.ts} +1 -1
  48. package/dist/sdd/index.d.ts +1114 -14
  49. package/dist/sdd/index.js +5516 -2949
  50. package/dist/sdd/index.js.map +1 -1
  51. package/dist/{secret-vault-eMBKfheR.d.ts → secret-vault-CMQUr-eB.d.ts} +1 -1
  52. package/dist/security/index.d.ts +5 -5
  53. package/dist/security/index.js +6 -0
  54. package/dist/security/index.js.map +1 -1
  55. package/dist/{selector-C4ORTOid.d.ts → selector-B4r34PWR.d.ts} +1 -1
  56. package/dist/{session-event-bridge-CeNpUL9w.d.ts → session-event-bridge-BD3LoyLC.d.ts} +1 -1
  57. package/dist/{session-reader-BepLSnGL.d.ts → session-reader-DjrKGD9c.d.ts} +1 -1
  58. package/dist/storage/index.d.ts +12 -12
  59. package/dist/storage/index.js +380 -13
  60. package/dist/storage/index.js.map +1 -1
  61. package/dist/tools/index.d.ts +2 -2
  62. package/dist/tools/index.js.map +1 -1
  63. package/dist/types/index.d.ts +20 -20
  64. package/dist/types/index.js +31 -0
  65. package/dist/types/index.js.map +1 -1
  66. package/dist/utils/index.d.ts +30 -4
  67. package/dist/utils/index.js +110 -1
  68. package/dist/utils/index.js.map +1 -1
  69. package/dist/{index-DqW4o62H.d.ts → worktree-manager-DHdrWQ_7.d.ts} +48 -90
  70. package/dist/{wstack-paths-hOpNLmvf.d.ts → wstack-paths-BqkDAkoh.d.ts} +2 -0
  71. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-BZa_IEcd.js';
1
+ import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-Dx7fZ1bE.js';
2
2
 
3
3
  /**
4
4
  * In-memory pub/sub transport for agent-to-agent messaging.
@@ -1,12 +1,12 @@
1
- import { c as ToolCallPipelinePayload, d as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, e as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, g as AgentInit, h as AgentInput, R as RunResult } from './index-DWm_PE9L.js';
2
- import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-Ckkn3AOA.js';
3
- import { E as EventBus, a as EventName, L as Listener } from './brain-etbcbRwV.js';
4
- import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-BV7nzeAd.js';
1
+ import { c as ToolCallPipelinePayload, d as ToolWrapper, E as ExtensionRegistry, S as SystemPromptContributor, e as ToolRegistry, P as ProviderRegistry, A as AgentPipelines, f as ToolExecutorLike, g as AgentInit, h as AgentInput, R as RunResult } from './index-CTq5wU3m.js';
2
+ import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-xnw_24Z8.js';
3
+ import { E as EventBus, a as EventName, L as Listener } from './brain-BDcQaku-.js';
4
+ import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-kqXJOVkX.js';
5
5
  import { L as Logger } from './logger-B63L5bTg.js';
6
6
  import { T as Tracer } from './observability-D-HZN_mF.js';
7
- import { P as PermissionPolicy } from './permission-CC7XFYWG.js';
8
- import { U as Usage, C as Context, J as JSONSchema, c as Request, d as Response, i as ContentBlock, q as TextBlock, T as Tool, P as Provider, t as RunOptions } from './context-Dw55zZ_Q.js';
9
- import { W as WireFamily, H as HookEvent, f as HookMatcher, I as InProcessHook, i as Config } from './config-rRS8yorV.js';
7
+ import { P as PermissionPolicy } from './permission-CsBGZkxp.js';
8
+ import { U as Usage, C as Context, J as JSONSchema, c as Request, d as Response, i as ContentBlock, q as TextBlock, T as Tool, P as Provider, t as RunOptions } from './context-DulAr8Zo.js';
9
+ import { W as WireFamily, H as HookEvent, f as HookMatcher, I as InProcessHook, C as Config } from './config-CR2yoG8c.js';
10
10
 
11
11
  /**
12
12
  * Single fleet-wide event with subagent attribution. Whatever a child
@@ -539,6 +539,13 @@ interface SubagentConfig {
539
539
  * single-provider behavior.
540
540
  */
541
541
  provider?: string | undefined;
542
+ /**
543
+ * Ordered fallback model chain for THIS subagent (entries: `model` or
544
+ * `provider/model`). When the subagent's primary model 429s or stream-hangs,
545
+ * the factory's fallback extension rotates to the next entry. Empty/undefined
546
+ * → the factory's own default fallback behavior (usually the leader's config).
547
+ */
548
+ fallbackModels?: string[] | undefined;
542
549
  /**
543
550
  * Per-subagent session JSONL path. When omitted the orchestrator-
544
551
  * supplied factory derives a path under `<sessionRoot>/<runId>/`.
@@ -1,4 +1,4 @@
1
- import { U as Usage, C as Context, l as ToolProgressEvent, T as Tool, m as ToolOutputMetadata } from './context-Dw55zZ_Q.js';
1
+ import { U as Usage, C as Context, l as ToolProgressEvent, T as Tool, m as ToolOutputMetadata } from './context-DulAr8Zo.js';
2
2
 
3
3
  type MemoryScope = 'project-agents' | 'project-memory' | 'user-memory';
4
4
  type MemoryType = 'fact' | 'decision' | 'convention' | 'preference' | 'reference' | 'anti_pattern';
@@ -503,13 +503,16 @@ interface EventMap {
503
503
  };
504
504
  /**
505
505
  * Fired on every `iteration.completed`. UIs subscribe to render a live
506
- * context-window fill bar per agent (e.g. "67% ████████░░"). The
507
- * `load` fraction matches the threshold levels: 0–0.6 green, 0.6–0.75
508
- * yellow, 0.75+ red.
506
+ * context-window fill bar per agent (e.g. "67% ████████░░"). `load` is
507
+ * clamped to 0..1 so every live surface renders at most 100%; diagnostics
508
+ * can still detect over-budget states from `tokens > maxContext` or
509
+ * `rawLoad`.
509
510
  */
510
511
  'ctx.pct': {
511
- /** Fraction of maxContext currently in use (0–1+. Can exceed 1 when over budget). */
512
+ /** Fraction of maxContext currently in use, clamped to 0..1 for display. */
512
513
  load: number;
514
+ /** Unclamped fraction when available. Can exceed 1 when over budget. */
515
+ rawLoad?: number | undefined;
513
516
  /** Estimated total tokens (system + tools + messages). */
514
517
  tokens: number;
515
518
  /** Provider's max context window. */
@@ -781,10 +784,114 @@ interface EventMap {
781
784
  */
782
785
  'subagent.ctx_pct': {
783
786
  subagentId: string;
787
+ /** Fraction of maxContext currently in use, clamped to 0..1 for display. */
784
788
  load: number;
789
+ /** Unclamped fraction when available. Can exceed 1 when over budget. */
790
+ rawLoad?: number | undefined;
785
791
  tokens: number;
786
792
  maxContext: number;
787
793
  };
794
+ /** A parallel SDD run started. */
795
+ 'sdd.run.started': {
796
+ runId: string;
797
+ graphId: string;
798
+ specId?: string | undefined;
799
+ total: number;
800
+ /** Base branch the run's squash commits will land on (worktree runs only). */
801
+ baseBranch?: string | undefined;
802
+ };
803
+ /** A parallel SDD run reached a terminal state. */
804
+ 'sdd.run.finished': {
805
+ runId: string;
806
+ deadlocked: boolean;
807
+ completed: number;
808
+ failed: number;
809
+ stopped: boolean;
810
+ };
811
+ /** A task began executing on a worker (carries who + which worktree). */
812
+ 'sdd.task.started': {
813
+ runId: string;
814
+ taskId: string;
815
+ subagentId: string;
816
+ agentName: string;
817
+ worktreeBranch?: string | undefined;
818
+ };
819
+ /** A task finished successfully. */
820
+ 'sdd.task.completed': {
821
+ runId: string;
822
+ taskId: string;
823
+ subagentId: string;
824
+ durationMs: number;
825
+ };
826
+ /** A task failed terminally (retries exhausted). */
827
+ 'sdd.task.failed': {
828
+ runId: string;
829
+ taskId: string;
830
+ subagentId: string;
831
+ error: string;
832
+ };
833
+ /** A failed task was requeued for another attempt. */
834
+ 'sdd.task.retrying': {
835
+ runId: string;
836
+ taskId: string;
837
+ attempt: number;
838
+ maxRetries: number;
839
+ };
840
+ /** A task's worker reported success but the post-task verification gate rejected it. */
841
+ 'sdd.task.verification_failed': {
842
+ runId: string;
843
+ taskId: string;
844
+ reason: string;
845
+ };
846
+ /** A completed task's worktree could not be merged back into the base branch. */
847
+ 'sdd.task.conflict': {
848
+ runId: string;
849
+ taskId: string;
850
+ conflictFiles: string[];
851
+ };
852
+ /** A completed task's worktree was squash-merged onto the base branch (sha = the run commit). */
853
+ 'sdd.task.merged': {
854
+ runId: string;
855
+ taskId: string;
856
+ sha: string;
857
+ };
858
+ /** A task was split into sub-tasks (the parent becomes a completed container). */
859
+ 'sdd.task.split': {
860
+ runId: string;
861
+ taskId: string;
862
+ subtaskIds: string[];
863
+ };
864
+ /** The supervisor made a decision about a failing/stuck task. */
865
+ 'sdd.supervisor.decision': {
866
+ runId: string;
867
+ taskId: string;
868
+ action: 'retry' | 'reassign' | 'split' | 'fail';
869
+ rationale?: string | undefined;
870
+ };
871
+ /** A new wave of dependency-ready tasks began. */
872
+ 'sdd.wave': {
873
+ runId: string;
874
+ wave: number;
875
+ batchSize: number;
876
+ };
877
+ /** No runnable tasks remain but some are still blocked — with the blocking chains. */
878
+ 'sdd.deadlock': {
879
+ runId: string;
880
+ chains: Array<{
881
+ blocked: string;
882
+ blockedBy: string[];
883
+ }>;
884
+ };
885
+ /**
886
+ * Throttled full board snapshot composed by SddBoardProjector. `snapshot` is
887
+ * an `SddBoardSnapshot` (sdd/board-types) — typed `unknown` here so the kernel
888
+ * layer never imports from the higher `sdd/` layer (it sits below it in the
889
+ * DAG); consumers cast it back. The producer (SddBoardProjector) is typed.
890
+ */
891
+ 'sdd.board.snapshot': {
892
+ runId: string;
893
+ snapshot: unknown;
894
+ };
788
895
  'mcp.server.connected': {
789
896
  name: string;
790
897
  toolCount: number;
@@ -1,4 +1,4 @@
1
- import { C as Context } from './context-Dw55zZ_Q.js';
1
+ import { C as Context } from './context-DulAr8Zo.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-Dw55zZ_Q.js';
1
+ import { a as ReasoningConfig, n as Capabilities, h as Permission, o as ReasoningEffort, p as CacheTtl } from './context-DulAr8Zo.js';
2
2
 
3
3
  type ContextWindowModeId = 'balanced' | 'frugal' | 'deep' | 'archival';
4
4
  type ContextWindowAggressiveOn = 'hard' | 'soft' | 'warn';
@@ -430,6 +430,11 @@ interface ToolsConfig {
430
430
  iterationTimeoutMs: number;
431
431
  sessionTimeoutMs: number;
432
432
  perIterationOutputCapBytes: number;
433
+ /**
434
+ * Per-tool prose budget for the tool's top-level description and usage hint.
435
+ * Missing entries default to "extend".
436
+ */
437
+ descriptionMode?: ToolDescriptionModeConfig | undefined;
433
438
  /**
434
439
  * When true (default), the agent automatically extends its iteration
435
440
  * limit by 100 when hit. Set to false to require user confirmation.
@@ -443,7 +448,33 @@ interface ToolsConfig {
443
448
  * `/settings` ("Filesystem access").
444
449
  */
445
450
  restrictToProjectRoot?: boolean | undefined;
451
+ /**
452
+ * Per-command policy for the `exec` tool's allowlist. The tool ships a
453
+ * curated default allowlist of dev/build commands; this extends or trims it.
454
+ *
455
+ * SECURITY: `allow` EXPANDS what the agent may execute, so it is honored only
456
+ * from TRUSTED config (`~/.wrongstack/config.json`) — the config loader
457
+ * strips `tools.exec.allow` from the untrusted, repo-committed
458
+ * `<project>/.wrongstack/config.json`. `deny` only ever REMOVES commands, so
459
+ * it is honored from any source.
460
+ */
461
+ exec?: ExecToolConfig | undefined;
446
462
  }
463
+ /** Allow/deny extension of the `exec` tool's built-in command allowlist. */
464
+ interface ExecToolConfig {
465
+ /**
466
+ * Extra command names to add to the allowlist (e.g. `["make", "dotnet"]`).
467
+ * Trusted sources only — stripped from in-project repo config.
468
+ */
469
+ allow?: string[] | undefined;
470
+ /**
471
+ * Command names to remove from the allowlist. Honored from any source —
472
+ * removing a command can only narrow what runs, so it is always safe.
473
+ */
474
+ deny?: string[] | undefined;
475
+ }
476
+ type ToolDescriptionMode = 'extend' | 'simple';
477
+ type ToolDescriptionModeConfig = Record<string, ToolDescriptionMode | undefined>;
447
478
  interface ProviderApiKey {
448
479
  /** Short human-readable label (e.g. "personal", "work", "rate-limit-backup"). */
449
480
  label: string;
@@ -633,8 +664,34 @@ interface FeaturesConfig {
633
664
  allowOutsideProjectRoot?: boolean | undefined;
634
665
  }
635
666
  interface AutonomyConfig {
667
+ /** Default autonomy mode at startup. Default: "off". */
668
+ defaultMode?: 'off' | 'suggest' | 'auto' | undefined;
636
669
  /** ms to wait before auto-proceeding in 'auto' mode. Default: 45000. */
637
670
  autoProceedDelayMs?: number | undefined;
671
+ /** Maximum consecutive auto-proceed turns before pausing. 0 = unlimited. Default: 50. */
672
+ autoProceedMaxIterations?: number | undefined;
673
+ /** Template used for YOLO+auto suggestions. Must include {{suggestion}}. */
674
+ autonomyNextPrompt?: string | undefined;
675
+ /** Animate the terminal/window title while the agent is active. Default: true. */
676
+ terminalTitleAnimation?: boolean | undefined;
677
+ /** Persisted YOLO preference mirrored into top-level config.yolo at runtime. Default: false. */
678
+ yolo?: boolean | undefined;
679
+ /** Stream fleet/subagent output into the main TUI chat. Default: true. */
680
+ streamFleet?: boolean | undefined;
681
+ /** Ring terminal bell when an agent run completes. Default: false. */
682
+ chime?: boolean | undefined;
683
+ /** Ask for confirmation before interrupt/exit. Default: true. */
684
+ confirmExit?: boolean | undefined;
685
+ /** Terminal mouse tracking preference. Default: false. */
686
+ mouseMode?: boolean | undefined;
687
+ /** Enable prompt refinement before sending. Default: true. */
688
+ enhance?: boolean | undefined;
689
+ /** Prompt-refinement preview countdown in ms. Default: 60000. */
690
+ enhanceDelayMs?: number | undefined;
691
+ /** Prompt-refinement language mode. Default: "original". */
692
+ enhanceLanguage?: 'original' | 'english' | undefined;
693
+ /** TUI statusline density. Default: "detailed". */
694
+ statuslineMode?: 'minimum' | 'detailed' | undefined;
638
695
  /** Single short word shown in the TUI rainbow working-state chip. Default: "thinking". */
639
696
  thinkingWord?: string | undefined;
640
697
  }
@@ -802,8 +859,8 @@ interface Config {
802
859
  debugStream?: boolean | undefined;
803
860
  /**
804
861
  * Where settings are persisted. 'global' → ~/.wrongstack/config.json
805
- * (default). 'project' → ~/.wrongstack/projects/<slug>/config.local.json.
806
- * When 'project', provider/model/autonomy/ux settings are saved per-project.
862
+ * (default). 'project' → <project>/.wrongstack/config.json.
863
+ * When 'project', safe settings are saved per-project.
807
864
  */
808
865
  configScope?: 'global' | 'project' | undefined;
809
866
  /** Automatic codebase symbol-index maintenance (session-start + live updates). */
@@ -896,4 +953,4 @@ interface ConfigStore {
896
953
  watch(cb: (next: Readonly<Config>, prev: Readonly<Config>) => void): () => void;
897
954
  }
898
955
 
899
- export { isContextWindowModeId as $, type AdaptiveConcurrencyConfig as A, type LogConfig as B, type ContextWindowAggressiveOn as C, DEFAULT_CONTEXT_WINDOW_MODE_ID as D, MAX_TUI_THINKING_WORD_LENGTH as E, type FeaturesConfig as F, type ModelRuntimeCacheConfig as G, type HookEvent as H, type InProcessHook as I, type ModelRuntimeConfig as J, type ModelRuntimeParametersConfig as K, type LaunchConfig as L, type ModelsRegistry as M, type ModelRuntimeReasoningConfig as N, type ModelsDevProvider as O, type ProviderConfig as P, type PluginConfig as Q, type ResolvedProvider as R, type ShellHook as S, type TokenSavingTier as T, type ProviderApiKey as U, type SessionLoggingConfig as V, type WireFamily as W, type SyncCategory as X, type ToolsConfig as Y, formatContextWindowModeList as Z, getContextWindowMode as _, type ModelsDevPayload as a, listContextWindowModes as a0, normalizeTokenSavingTier as a1, normalizeTuiThinkingWord as a2, resolveContextWindowPolicy as a3, type ResolvedModel as b, type MCPServerConfig as c, type ModelMatrixEntry as d, type ModelsDevModel as e, type HookMatcher as f, type HookEntry as g, type ContextWindowPolicy as h, type Config as i, type ConfigStore as j, type ConfigLoader as k, type SyncConfig as l, type HookInput as m, type HookOutcome as n, type AutonomyConfig as o, CONTEXT_WINDOW_MODES as p, type CircuitBreakerRuntimeConfig as q, type ContextConfig as r, type ContextWindowConfigLike as s, type ContextWindowMode as t, type ContextWindowModeId as u, type ContextWindowThresholds as v, type CustomModelDefinition as w, DEFAULT_TUI_THINKING_WORD as x, type HqClientConfig as y, type IndexingConfig as z };
956
+ export { type ToolsConfig as $, type AdaptiveConcurrencyConfig as A, type LogConfig as B, type Config as C, DEFAULT_CONTEXT_WINDOW_MODE_ID as D, type ExecToolConfig as E, type FeaturesConfig as F, MAX_TUI_THINKING_WORD_LENGTH as G, type HookEvent as H, type InProcessHook as I, type ModelRuntimeCacheConfig as J, type ModelRuntimeConfig as K, type LaunchConfig as L, type ModelsRegistry as M, type ModelRuntimeParametersConfig as N, type ModelRuntimeReasoningConfig as O, type ProviderConfig as P, type ModelsDevProvider as Q, type ResolvedProvider as R, type ShellHook as S, type TokenSavingTier as T, type PluginConfig as U, type ProviderApiKey as V, type WireFamily as W, type SessionLoggingConfig as X, type SyncCategory as Y, type ToolDescriptionMode as Z, type ToolDescriptionModeConfig as _, type ModelsDevPayload as a, formatContextWindowModeList as a0, getContextWindowMode as a1, isContextWindowModeId as a2, listContextWindowModes as a3, normalizeTokenSavingTier as a4, normalizeTuiThinkingWord as a5, resolveContextWindowPolicy as a6, type ResolvedModel as b, type MCPServerConfig as c, type ModelMatrixEntry as d, type ModelsDevModel as e, type HookMatcher as f, type HookEntry as g, type ContextWindowAggressiveOn as h, type ContextWindowPolicy as i, type ConfigStore as j, type ConfigLoader as k, type SyncConfig as l, type HookInput as m, type HookOutcome as n, type AutonomyConfig as o, CONTEXT_WINDOW_MODES as p, type CircuitBreakerRuntimeConfig as q, type ContextConfig as r, type ContextWindowConfigLike as s, type ContextWindowMode as t, type ContextWindowModeId as u, type ContextWindowThresholds as v, type CustomModelDefinition as w, DEFAULT_TUI_THINKING_WORD as x, type HqClientConfig as y, type IndexingConfig as z };
@@ -1190,6 +1190,30 @@ interface SessionStore {
1190
1190
  * number of sessions indexed.
1191
1191
  */
1192
1192
  rebuildIndex?(): Promise<number>;
1193
+ /**
1194
+ * Streaming event-level search. Walks the JSONL once without buffering
1195
+ * the whole file, calling `predicate(event, eventIndex, ts)` for each
1196
+ * parsed event. Stops as soon as `limit` matches are collected (when
1197
+ * provided) and yields only the matching events back to the caller.
1198
+ *
1199
+ * Implementations that don't support streaming MUST omit this method;
1200
+ * the SessionReader fallback path will then call `load()` instead. The
1201
+ * method is intentionally non-throwing for missing files — a missing
1202
+ * session yields an empty array, matching `load()` semantics for ENOENT.
1203
+ *
1204
+ * @param id Session id (with or without the `.jsonl` suffix).
1205
+ * @param predicate Returns true to keep the event in the result set.
1206
+ * @param opts.limit Maximum number of hits to keep. Omit for unbounded.
1207
+ * @param opts.signal Optional AbortSignal for early termination.
1208
+ */
1209
+ searchEvents?(id: string, predicate: (event: SessionEvent, eventIndex: number, ts: string) => boolean, opts?: {
1210
+ limit?: number | undefined;
1211
+ signal?: AbortSignal | undefined;
1212
+ }): Promise<Array<{
1213
+ event: SessionEvent;
1214
+ eventIndex: number;
1215
+ ts: string;
1216
+ }>>;
1193
1217
  }
1194
1218
  interface SessionWriter {
1195
1219
  readonly id: string;
@@ -1,25 +1,25 @@
1
- import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../brain-etbcbRwV.js';
2
- export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../brain-etbcbRwV.js';
3
- import { H as FleetManager, s as Director } from '../null-fleet-bus-DOGQcvrY.js';
4
- export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-DOGQcvrY.js';
5
- import { b as AgentDefinition } from '../multi-agent-coordinator-jyimfo7D.js';
6
- export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-jyimfo7D.js';
7
- import { F as FleetBus } from '../agent-subagent-runner-BZa_IEcd.js';
8
- export { h as AgentFactory, v as AgentFactoryResult, w as AgentRunnerOptions, x as BudgetExceededError, y as BudgetKind, z as BudgetLimits, E as BudgetNegotiationMode, G as BudgetThresholdDecision, H as BudgetThresholdHandler, I as BudgetThresholdSignal, J as BudgetUsage, L as DECISION_TIMEOUT_MS, N as FleetEvent, O as FleetHandler, i as FleetUsage, j as FleetUsageAggregator, Q as SubagentBudget, Y as SubagentUsageSnapshot, Z as TIMEOUT_PREEMPT_FRACTION, $ as makeAgentSubagentRunner, a0 as withDisabledToolFiltering } from '../agent-subagent-runner-BZa_IEcd.js';
9
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-DFQYEeXf.js';
1
+ import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../brain-BDcQaku-.js';
2
+ export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../brain-BDcQaku-.js';
3
+ import { H as FleetManager, s as Director } from '../null-fleet-bus-BC5ZXCQw.js';
4
+ export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-BC5ZXCQw.js';
5
+ import { b as AgentDefinition } from '../multi-agent-coordinator-Bx8EFkv2.js';
6
+ export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-Bx8EFkv2.js';
7
+ import { F as FleetBus } from '../agent-subagent-runner-Dx7fZ1bE.js';
8
+ export { h as AgentFactory, v as AgentFactoryResult, w as AgentRunnerOptions, x as BudgetExceededError, y as BudgetKind, z as BudgetLimits, E as BudgetNegotiationMode, G as BudgetThresholdDecision, H as BudgetThresholdHandler, I as BudgetThresholdSignal, J as BudgetUsage, L as DECISION_TIMEOUT_MS, N as FleetEvent, O as FleetHandler, i as FleetUsage, j as FleetUsageAggregator, Q as SubagentBudget, Y as SubagentUsageSnapshot, Z as TIMEOUT_PREEMPT_FRACTION, $ as makeAgentSubagentRunner, a0 as withDisabledToolFiltering } from '../agent-subagent-runner-Dx7fZ1bE.js';
9
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-DpKIxHhE.js';
10
10
  import { b as Mailbox, c as MailboxSendInput, M as MailboxMessage, d as MailboxQuery, e as MailboxAckInput, f as MailboxAckBatchInput, a as MailboxAgentStatus, A as AgentRegistrationInput, g as AgentHeartbeatInput, P as PurgeOptions, j as PurgeResult, C as ClientRegistrationInput, h as ClientHeartbeatInput, i as ClientStatus } from '../mailbox-types-Ct2hJq0P.js';
11
11
  export { k as MailboxMessageType, l as MailboxTaskContext, R as ReadReceipts, m as RegisteredAgent, n as normalizeRecipient } from '../mailbox-types-Ct2hJq0P.js';
12
- export { G as GlobalMailbox, aw as resolveProjectDir } from '../global-mailbox-DJ4EoRr0.js';
13
- import { C as Context, T as Tool } from '../context-Dw55zZ_Q.js';
14
- import { A as AdaptiveConcurrencyConfig } from '../config-rRS8yorV.js';
12
+ export { G as GlobalMailbox, aw as resolveProjectDir } from '../global-mailbox-CwcubDkA.js';
13
+ import { C as Context, T as Tool } from '../context-DulAr8Zo.js';
14
+ import { A as AdaptiveConcurrencyConfig } from '../config-CR2yoG8c.js';
15
15
  import 'node:events';
16
16
  import '../logger-B63L5bTg.js';
17
17
  import '../director-state-BfeCUbmk.js';
18
- import '../index-DWm_PE9L.js';
19
- import '../pipeline-Ckkn3AOA.js';
18
+ import '../index-CTq5wU3m.js';
19
+ import '../pipeline-xnw_24Z8.js';
20
20
  import '../observability-D-HZN_mF.js';
21
- import '../permission-CC7XFYWG.js';
22
- import '../retry-policy-BV7nzeAd.js';
21
+ import '../permission-CsBGZkxp.js';
22
+ import '../retry-policy-kqXJOVkX.js';
23
23
 
24
24
  /** Phase 1 · Discovery — map the territory before any work begins. */
25
25
  declare const DISCOVERY_AGENTS: AgentDefinition[];
@@ -94,6 +94,13 @@ declare class DefaultMailbox implements Mailbox {
94
94
  private _readNewMessagesOnly;
95
95
  /** Parse a JSONL string into MailboxMessage[], including migration. */
96
96
  private _parseLines;
97
+ /**
98
+ * Stat the mailbox file under the assumption that we are holding the
99
+ * file lock, and that a write to the file has just completed. Returns
100
+ * the (mtimeMs, size) pair, or (-1, -1) if the file does not exist
101
+ * (e.g. ackMany/purgeStale on a session that has never sent a message).
102
+ */
103
+ private _statUnderLockOrAbsent;
97
104
  private _readAllCached;
98
105
  private _setMessageCache;
99
106
  private _pushToCache;