@wrongstack/core 0.273.0 → 0.274.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/{agent-bridge-BZ2enORi.d.ts → agent-bridge-DFo21wmY.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-ehb4xGvd.d.ts → agent-subagent-runner-BwmkIDEd.d.ts} +7 -7
  3. package/dist/{brain-BxN2k2HP.d.ts → brain-gfZX3the.d.ts} +11 -5
  4. package/dist/{provider-model-resolve-DFd3IPpw.d.ts → codex-catalog-CooZ6mOl.d.ts} +47 -4
  5. package/dist/{compactor-72ug-ZRB.d.ts → compactor-riTOds0f.d.ts} +1 -1
  6. package/dist/{config-C8IYxlO8.d.ts → config-BxcrDzri.d.ts} +60 -4
  7. package/dist/{context-Dw55zZ_Q.d.ts → context-DERiLofu.d.ts} +60 -1
  8. package/dist/coordination/index.d.ts +27 -16
  9. package/dist/coordination/index.js +1641 -1398
  10. package/dist/coordination/index.js.map +1 -1
  11. package/dist/defaults/index.d.ts +26 -26
  12. package/dist/defaults/index.js +2154 -1466
  13. package/dist/defaults/index.js.map +1 -1
  14. package/dist/execution/index.d.ts +15 -15
  15. package/dist/execution/index.js +77 -9
  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-C9dsc9Y_.d.ts → global-mailbox-Cr8TW4t_.d.ts} +1 -1
  20. package/dist/{goal-preamble-NhflDjYb.d.ts → goal-preamble-CEhROp1e.d.ts} +9 -9
  21. package/dist/{goal-store-Cx363x7Z.d.ts → goal-store-xNSVxmpV.d.ts} +1 -1
  22. package/dist/hq/index.d.ts +5 -5
  23. package/dist/{index-B7fHDt0B.d.ts → index-00KPKAlm.d.ts} +5 -5
  24. package/dist/{index-BbVprU-9.d.ts → index-pDBSBE1r.d.ts} +2 -2
  25. package/dist/index.d.ts +72 -45
  26. package/dist/index.js +2840 -1769
  27. package/dist/index.js.map +1 -1
  28. package/dist/infrastructure/index.d.ts +6 -6
  29. package/dist/kernel/index.d.ts +11 -11
  30. package/dist/kernel/index.js.map +1 -1
  31. package/dist/{mcp-servers-B6fSRNC1.d.ts → mcp-servers-BIwRiOxe.d.ts} +3 -3
  32. package/dist/models/index.d.ts +5 -5
  33. package/dist/models/index.js +40 -2
  34. package/dist/models/index.js.map +1 -1
  35. package/dist/{models-registry-4C6Wr91w.d.ts → models-registry-8OorW51H.d.ts} +1 -1
  36. package/dist/{multi-agent-coordinator-q1skFeNP.d.ts → multi-agent-coordinator-CNx48Zoz.d.ts} +1 -1
  37. package/dist/{null-fleet-bus-C9rrgQwc.d.ts → null-fleet-bus-B4ZUJYL6.d.ts} +6 -6
  38. package/dist/observability/index.d.ts +2 -2
  39. package/dist/{parallel-eternal-engine-CtXly2Sf.d.ts → parallel-eternal-engine-rsIclDqO.d.ts} +9 -9
  40. package/dist/{path-resolver-Bim6G5Jz.d.ts → path-resolver-BqU-fwzD.d.ts} +3 -3
  41. package/dist/{permission-CC7XFYWG.d.ts → permission-Dgs3v-Xq.d.ts} +1 -1
  42. package/dist/{permission-policy-cYR4RJmw.d.ts → permission-policy-Dtht2k0e.d.ts} +2 -2
  43. package/dist/{pipeline-CNVKuQDQ.d.ts → pipeline-B-dpCFYS.d.ts} +2 -2
  44. package/dist/{plan-templates-C4wXMmiM.d.ts → plan-templates-B7MxyY2o.d.ts} +58 -5
  45. package/dist/{provider-runner-BpM0mdBE.d.ts → provider-runner-DrmpBE5l.d.ts} +3 -3
  46. package/dist/{retry-policy-BV7nzeAd.d.ts → retry-policy-hYxsm10a.d.ts} +1 -1
  47. package/dist/sdd/index.d.ts +12 -10
  48. package/dist/sdd/index.js +7 -0
  49. package/dist/sdd/index.js.map +1 -1
  50. package/dist/{secret-vault-eMBKfheR.d.ts → secret-vault-DnqIFhPF.d.ts} +1 -1
  51. package/dist/security/index.d.ts +5 -5
  52. package/dist/{selector-C4ORTOid.d.ts → selector-D21RjDIg.d.ts} +1 -1
  53. package/dist/{session-event-bridge-CeNpUL9w.d.ts → session-event-bridge-Dt54CTvq.d.ts} +1 -1
  54. package/dist/{session-reader-BepLSnGL.d.ts → session-reader-CceH13Kq.d.ts} +5 -4
  55. package/dist/storage/index.d.ts +46 -12
  56. package/dist/storage/index.js +2281 -1476
  57. package/dist/storage/index.js.map +1 -1
  58. package/dist/tools/index.d.ts +2 -2
  59. package/dist/types/index.d.ts +19 -19
  60. package/dist/types/index.js +162 -42
  61. package/dist/types/index.js.map +1 -1
  62. package/dist/utils/index.d.ts +2 -2
  63. package/dist/{worktree-manager-BDuXTaWL.d.ts → worktree-manager-DUfBbKzk.d.ts} +1 -1
  64. 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-ehb4xGvd.js';
1
+ import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-BwmkIDEd.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-B7fHDt0B.js';
2
- import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-CNVKuQDQ.js';
3
- import { E as EventBus, a as EventName, L as Listener } from './brain-BxN2k2HP.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-00KPKAlm.js';
2
+ import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-B-dpCFYS.js';
3
+ import { E as EventBus, a as EventName, L as Listener } from './brain-gfZX3the.js';
4
+ import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-hYxsm10a.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, C as Config } from './config-C8IYxlO8.js';
7
+ import { P as PermissionPolicy } from './permission-Dgs3v-Xq.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-DERiLofu.js';
9
+ import { W as WireFamily, H as HookEvent, f as HookMatcher, I as InProcessHook, C as Config } from './config-BxcrDzri.js';
10
10
 
11
11
  /**
12
12
  * Single fleet-wide event with subagent attribution. Whatever a child
@@ -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-DERiLofu.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,7 +784,10 @@ 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
  };
@@ -1,7 +1,7 @@
1
1
  import { M as ModeStore, a as ModeConfig, b as Mode } from './mode-CZlO9iU1.js';
2
- import { P as Provider, M as Message } from './context-Dw55zZ_Q.js';
3
- import { M as MessageSelector, S as SelectorResult } from './selector-C4ORTOid.js';
4
- import { e as ModelsDevModel, R as ResolvedProvider } from './config-C8IYxlO8.js';
2
+ import { P as Provider, M as Message } from './context-DERiLofu.js';
3
+ import { M as MessageSelector, S as SelectorResult } from './selector-D21RjDIg.js';
4
+ import { e as ModelsDevModel, R as ResolvedProvider } from './config-BxcrDzri.js';
5
5
 
6
6
  declare class DefaultModeStore implements ModeStore {
7
7
  private activeModeId;
@@ -76,6 +76,8 @@ declare class LLMSelector implements MessageSelector {
76
76
  interface ProviderModelDescriptor {
77
77
  id: string;
78
78
  name: string;
79
+ /** One-line capability blurb, when known (e.g. the Codex subscription models). */
80
+ description?: string | undefined;
79
81
  releaseDate?: string | undefined;
80
82
  contextWindow?: number | undefined;
81
83
  inputCost?: number | undefined;
@@ -104,4 +106,45 @@ declare function describeCatalogModel(m: ModelsDevModel): ProviderModelDescripto
104
106
  */
105
107
  declare function resolveProviderModelList(savedModels: string[] | undefined, catalog: ResolvedProvider | undefined): ProviderModelDescriptor[];
106
108
 
107
- export { DefaultModeStore as D, LLMSelector as L, type ModeLoaderOptions as M, type ProviderModelDescriptor as P, type LLMSelectorOptions as a, loadUserModes as b, describeCatalogModel as d, loadProjectModes as l, resolveProviderModelList as r };
109
+ /**
110
+ * Offline **floor** for the ChatGPT "Sign in with ChatGPT" (`openai-codex`)
111
+ * models, mirroring what the official Codex CLI / ChatGPT model picker shows.
112
+ *
113
+ * Source-of-truth precedence (live path wins):
114
+ * 1. The curated overlay `packages/cli/data/providers.json` — provider
115
+ * `openai-codex` — which is **synced from raw GitHub** + cached + bundled
116
+ * offline by `DefaultModelsRegistry` (overlayUrl/overlayFile). Editing that
117
+ * JSON and pushing updates every client without a code release; this is the
118
+ * authoritative list whenever the registry overlay is wired (the CLI path).
119
+ * 2. This hardcoded table — the last-resort floor used where no overlay is
120
+ * available (a standalone registry without the bundled file) and by the CLI
121
+ * auth-menu login flow, which needs a synchronous id list.
122
+ *
123
+ * Keep this in lockstep with the `openai-codex` block in `providers.json`; the
124
+ * drift-guard test `packages/cli/tests/codex-catalog-overlay-sync.test.ts`
125
+ * asserts they agree.
126
+ *
127
+ * Layer note: this lives in `core` (not the CLI auth-menu) so the model-list
128
+ * resolver can read it without `core` depending on `cli`. The CLI's
129
+ * `FALLBACK_CODEX_MODELS` is derived from this list.
130
+ */
131
+ interface CodexModelMeta {
132
+ /** The wire id sent to the backend and stored in config (e.g. `gpt-5.5`). */
133
+ id: string;
134
+ /** Human-readable display name shown in pickers. */
135
+ name: string;
136
+ /** One-line capability blurb, matching the official Codex picker copy. */
137
+ description: string;
138
+ /** The recommended / latest model — tagged "(current)" in the official UI. */
139
+ current?: boolean;
140
+ }
141
+ /**
142
+ * Current ChatGPT sign-in models, newest first. The first entry is the
143
+ * recommended default (`current`). Order is significant: callers that need a
144
+ * default model id use `CODEX_MODELS[0]`.
145
+ */
146
+ declare const CODEX_MODELS: ReadonlyArray<CodexModelMeta>;
147
+ /** Look up the canonical metadata for a Codex model id, or `undefined`. */
148
+ declare function codexModelMeta(id: string): CodexModelMeta | undefined;
149
+
150
+ export { CODEX_MODELS as C, DefaultModeStore as D, LLMSelector as L, type ModeLoaderOptions as M, type ProviderModelDescriptor as P, type CodexModelMeta as a, type LLMSelectorOptions as b, codexModelMeta as c, describeCatalogModel as d, loadUserModes as e, loadProjectModes as l, resolveProviderModelList as r };
@@ -1,4 +1,4 @@
1
- import { C as Context } from './context-Dw55zZ_Q.js';
1
+ import { C as Context } from './context-DERiLofu.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-DERiLofu.js';
2
2
 
3
3
  type ContextWindowModeId = 'balanced' | 'frugal' | 'deep' | 'archival';
4
4
  type ContextWindowAggressiveOn = 'hard' | 'soft' | 'warn';
@@ -139,6 +139,12 @@ interface ModelsDevModel {
139
139
  id: string;
140
140
  name: string;
141
141
  family?: string | undefined;
142
+ /**
143
+ * One-line capability blurb. Not part of the upstream models.dev schema —
144
+ * carried by our curated overlay (`packages/cli/data/providers.json`, synced
145
+ * from raw GitHub) for subscription models like openai-codex.
146
+ */
147
+ description?: string | undefined;
142
148
  attachment?: boolean | undefined;
143
149
  reasoning?: boolean | undefined;
144
150
  reasoningConfig?: ReasoningConfig | undefined;
@@ -448,6 +454,30 @@ interface ToolsConfig {
448
454
  * `/settings` ("Filesystem access").
449
455
  */
450
456
  restrictToProjectRoot?: boolean | undefined;
457
+ /**
458
+ * Per-command policy for the `exec` tool's allowlist. The tool ships a
459
+ * curated default allowlist of dev/build commands; this extends or trims it.
460
+ *
461
+ * SECURITY: `allow` EXPANDS what the agent may execute, so it is honored only
462
+ * from TRUSTED config (`~/.wrongstack/config.json`) — the config loader
463
+ * strips `tools.exec.allow` from the untrusted, repo-committed
464
+ * `<project>/.wrongstack/config.json`. `deny` only ever REMOVES commands, so
465
+ * it is honored from any source.
466
+ */
467
+ exec?: ExecToolConfig | undefined;
468
+ }
469
+ /** Allow/deny extension of the `exec` tool's built-in command allowlist. */
470
+ interface ExecToolConfig {
471
+ /**
472
+ * Extra command names to add to the allowlist (e.g. `["make", "dotnet"]`).
473
+ * Trusted sources only — stripped from in-project repo config.
474
+ */
475
+ allow?: string[] | undefined;
476
+ /**
477
+ * Command names to remove from the allowlist. Honored from any source —
478
+ * removing a command can only narrow what runs, so it is always safe.
479
+ */
480
+ deny?: string[] | undefined;
451
481
  }
452
482
  type ToolDescriptionMode = 'extend' | 'simple';
453
483
  type ToolDescriptionModeConfig = Record<string, ToolDescriptionMode | undefined>;
@@ -640,8 +670,34 @@ interface FeaturesConfig {
640
670
  allowOutsideProjectRoot?: boolean | undefined;
641
671
  }
642
672
  interface AutonomyConfig {
673
+ /** Default autonomy mode at startup. Default: "off". */
674
+ defaultMode?: 'off' | 'suggest' | 'auto' | undefined;
643
675
  /** ms to wait before auto-proceeding in 'auto' mode. Default: 45000. */
644
676
  autoProceedDelayMs?: number | undefined;
677
+ /** Maximum consecutive auto-proceed turns before pausing. 0 = unlimited. Default: 50. */
678
+ autoProceedMaxIterations?: number | undefined;
679
+ /** Template used for YOLO+auto suggestions. Must include {{suggestion}}. */
680
+ autonomyNextPrompt?: string | undefined;
681
+ /** Animate the terminal/window title while the agent is active. Default: true. */
682
+ terminalTitleAnimation?: boolean | undefined;
683
+ /** Persisted YOLO preference mirrored into top-level config.yolo at runtime. Default: false. */
684
+ yolo?: boolean | undefined;
685
+ /** Stream fleet/subagent output into the main TUI chat. Default: true. */
686
+ streamFleet?: boolean | undefined;
687
+ /** Ring terminal bell when an agent run completes. Default: false. */
688
+ chime?: boolean | undefined;
689
+ /** Ask for confirmation before interrupt/exit. Default: true. */
690
+ confirmExit?: boolean | undefined;
691
+ /** Terminal mouse tracking preference. Default: false. */
692
+ mouseMode?: boolean | undefined;
693
+ /** Enable prompt refinement before sending. Default: true. */
694
+ enhance?: boolean | undefined;
695
+ /** Prompt-refinement preview countdown in ms. Default: 60000. */
696
+ enhanceDelayMs?: number | undefined;
697
+ /** Prompt-refinement language mode. Default: "original". */
698
+ enhanceLanguage?: 'original' | 'english' | undefined;
699
+ /** TUI statusline density. Default: "detailed". */
700
+ statuslineMode?: 'minimum' | 'detailed' | undefined;
645
701
  /** Single short word shown in the TUI rainbow working-state chip. Default: "thinking". */
646
702
  thinkingWord?: string | undefined;
647
703
  }
@@ -809,8 +865,8 @@ interface Config {
809
865
  debugStream?: boolean | undefined;
810
866
  /**
811
867
  * Where settings are persisted. 'global' → ~/.wrongstack/config.json
812
- * (default). 'project' → ~/.wrongstack/projects/<slug>/config.local.json.
813
- * When 'project', provider/model/autonomy/ux settings are saved per-project.
868
+ * (default). 'project' → <project>/.wrongstack/config.json.
869
+ * When 'project', safe settings are saved per-project.
814
870
  */
815
871
  configScope?: 'global' | 'project' | undefined;
816
872
  /** Automatic codebase symbol-index maintenance (session-start + live updates). */
@@ -903,4 +959,4 @@ interface ConfigStore {
903
959
  watch(cb: (next: Readonly<Config>, prev: Readonly<Config>) => void): () => void;
904
960
  }
905
961
 
906
- export { formatContextWindowModeList as $, type AdaptiveConcurrencyConfig as A, type LogConfig as B, type Config 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 ToolDescriptionMode as Y, type ToolDescriptionModeConfig as Z, type ToolsConfig as _, type ModelsDevPayload as a, getContextWindowMode as a0, isContextWindowModeId as a1, listContextWindowModes as a2, normalizeTokenSavingTier as a3, normalizeTuiThinkingWord as a4, resolveContextWindowPolicy as a5, 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 };
962
+ 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 };
@@ -606,6 +606,15 @@ interface Capabilities {
606
606
  jsonMode: boolean;
607
607
  reasoning: boolean;
608
608
  maxContext: number;
609
+ /**
610
+ * Maximum output tokens the model can produce in a single response.
611
+ * Used as the default for `Request.maxTokens` when the caller doesn't
612
+ * supply an explicit value — letting subagents run up to the model's
613
+ * native ceiling instead of a fixed 8192 cap. Omit (undefined) to fall
614
+ * back to a conservative default; populate per family in
615
+ * `family-capabilities.ts` once you know the spec.
616
+ */
617
+ maxOutput?: number | undefined;
609
618
  cacheControl: 'native' | 'auto' | 'none';
610
619
  /** Model accepts `top_k` / `topK` sampling parameter. */
611
620
  topK?: boolean | undefined;
@@ -633,7 +642,16 @@ interface Request {
633
642
  system?: TextBlock[] | undefined;
634
643
  messages: Message[];
635
644
  tools?: Tool[] | undefined;
636
- maxTokens: number;
645
+ /**
646
+ * Cap on output tokens for this single response. Optional — when
647
+ * omitted, the provider adapter falls back to its own
648
+ * `capabilities.maxOutput` (which the catalog populates from
649
+ * `ModelsDevModel.limit.output`). If neither is available, the
650
+ * adapter applies a conservative 8192 safety net. Letting this stay
651
+ * undefined at the call site means callers like Chimera can hand the
652
+ * model its native output ceiling without hard-coding a number.
653
+ */
654
+ maxTokens?: number | undefined;
637
655
  temperature?: number | undefined;
638
656
  topP?: number | undefined;
639
657
  topK?: number | undefined;
@@ -1190,6 +1208,30 @@ interface SessionStore {
1190
1208
  * number of sessions indexed.
1191
1209
  */
1192
1210
  rebuildIndex?(): Promise<number>;
1211
+ /**
1212
+ * Streaming event-level search. Walks the JSONL once without buffering
1213
+ * the whole file, calling `predicate(event, eventIndex, ts)` for each
1214
+ * parsed event. Stops as soon as `limit` matches are collected (when
1215
+ * provided) and yields only the matching events back to the caller.
1216
+ *
1217
+ * Implementations that don't support streaming MUST omit this method;
1218
+ * the SessionReader fallback path will then call `load()` instead. The
1219
+ * method is intentionally non-throwing for missing files — a missing
1220
+ * session yields an empty array, matching `load()` semantics for ENOENT.
1221
+ *
1222
+ * @param id Session id (with or without the `.jsonl` suffix).
1223
+ * @param predicate Returns true to keep the event in the result set.
1224
+ * @param opts.limit Maximum number of hits to keep. Omit for unbounded.
1225
+ * @param opts.signal Optional AbortSignal for early termination.
1226
+ */
1227
+ searchEvents?(id: string, predicate: (event: SessionEvent, eventIndex: number, ts: string) => boolean, opts?: {
1228
+ limit?: number | undefined;
1229
+ signal?: AbortSignal | undefined;
1230
+ }): Promise<Array<{
1231
+ event: SessionEvent;
1232
+ eventIndex: number;
1233
+ ts: string;
1234
+ }>>;
1193
1235
  }
1194
1236
  interface SessionWriter {
1195
1237
  readonly id: string;
@@ -1383,6 +1425,10 @@ type StateChange = {
1383
1425
  } | {
1384
1426
  kind: 'messages_replaced';
1385
1427
  messages: readonly Message[];
1428
+ } | {
1429
+ kind: 'message_updated';
1430
+ index: number;
1431
+ message: Message;
1386
1432
  } | {
1387
1433
  kind: 'todos_replaced';
1388
1434
  todos: readonly TodoItem[];
@@ -1421,6 +1467,19 @@ declare class ConversationState {
1421
1467
  */
1422
1468
  snapshot(): ReadonlyConversationState;
1423
1469
  appendMessage(message: Message): void;
1470
+ /**
1471
+ * Append a content block to the trailing user message's content array.
1472
+ * Mutates only that one message (a single indexed assignment) — avoids
1473
+ * the O(n) array copy + token-cache re-walk that `replaceMessages()`
1474
+ * would do for a single-message edit. Used by the agent loop to fold
1475
+ * btw-notes / queued-mailbox blocks into the conversation.
1476
+ *
1477
+ * The block is folded only into a *user* message (preserves
1478
+ * user/assistant alternation between tool batches). Returns false when
1479
+ * there is no trailing user message to fold into — callers should
1480
+ * `appendMessage({ role: 'user', content: [block] })` instead.
1481
+ */
1482
+ appendBlockToLastUserMessage(block: ContentBlock): boolean;
1424
1483
  replaceMessages(messages: Message[]): void;
1425
1484
  replaceTodos(todos: TodoItem[]): void;
1426
1485
  setMeta(key: string, value: unknown): void;
@@ -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-BxN2k2HP.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-BxN2k2HP.js';
3
- import { H as FleetManager, s as Director } from '../null-fleet-bus-C9rrgQwc.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-C9rrgQwc.js';
5
- import { b as AgentDefinition } from '../multi-agent-coordinator-q1skFeNP.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-q1skFeNP.js';
7
- import { F as FleetBus } from '../agent-subagent-runner-ehb4xGvd.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-ehb4xGvd.js';
9
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-BZ2enORi.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-gfZX3the.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-gfZX3the.js';
3
+ import { H as FleetManager, s as Director } from '../null-fleet-bus-B4ZUJYL6.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-B4ZUJYL6.js';
5
+ import { b as AgentDefinition } from '../multi-agent-coordinator-CNx48Zoz.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-CNx48Zoz.js';
7
+ import { F as FleetBus } from '../agent-subagent-runner-BwmkIDEd.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-BwmkIDEd.js';
9
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-DFo21wmY.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-C9dsc9Y_.js';
13
- import { C as Context, T as Tool } from '../context-Dw55zZ_Q.js';
14
- import { A as AdaptiveConcurrencyConfig } from '../config-C8IYxlO8.js';
12
+ export { G as GlobalMailbox, aw as resolveProjectDir } from '../global-mailbox-Cr8TW4t_.js';
13
+ import { C as Context, T as Tool } from '../context-DERiLofu.js';
14
+ import { A as AdaptiveConcurrencyConfig } from '../config-BxcrDzri.js';
15
15
  import 'node:events';
16
16
  import '../logger-B63L5bTg.js';
17
17
  import '../director-state-BfeCUbmk.js';
18
- import '../index-B7fHDt0B.js';
19
- import '../pipeline-CNVKuQDQ.js';
18
+ import '../index-00KPKAlm.js';
19
+ import '../pipeline-B-dpCFYS.js';
20
20
  import '../observability-D-HZN_mF.js';
21
- import '../permission-CC7XFYWG.js';
22
- import '../retry-policy-BV7nzeAd.js';
21
+ import '../permission-Dgs3v-Xq.js';
22
+ import '../retry-policy-hYxsm10a.js';
23
23
 
24
24
  /** Phase 1 · Discovery — map the territory before any work begins. */
25
25
  declare const DISCOVERY_AGENTS: AgentDefinition[];
@@ -69,8 +69,12 @@ declare class DefaultMailbox implements Mailbox {
69
69
  private _byTo;
70
70
  /** Secondary index: sender → Set of messages (points into _messageCache). */
71
71
  private _byFrom;
72
+ /** Counts malformed JSONL lines skipped during parsing for observability. */
73
+ private _corruptionCount;
72
74
  constructor(sessionDir: string);
73
75
  get mailboxPath(): string;
76
+ /** Returns the count of malformed JSONL lines encountered during reads. */
77
+ get corruptionCount(): number;
74
78
  send(input: MailboxSendInput): Promise<MailboxMessage>;
75
79
  query(q: MailboxQuery): Promise<MailboxMessage[]>;
76
80
  ack(input: MailboxAckInput): Promise<MailboxMessage | null>;
@@ -94,6 +98,13 @@ declare class DefaultMailbox implements Mailbox {
94
98
  private _readNewMessagesOnly;
95
99
  /** Parse a JSONL string into MailboxMessage[], including migration. */
96
100
  private _parseLines;
101
+ /**
102
+ * Stat the mailbox file under the assumption that we are holding the
103
+ * file lock, and that a write to the file has just completed. Returns
104
+ * the (mtimeMs, size) pair, or (-1, -1) if the file does not exist
105
+ * (e.g. ackMany/purgeStale on a session that has never sent a message).
106
+ */
107
+ private _statUnderLockOrAbsent;
97
108
  private _readAllCached;
98
109
  private _setMessageCache;
99
110
  private _pushToCache;