@wrongstack/core 0.270.0 → 0.272.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 (76) hide show
  1. package/dist/{agent-bridge-PcHQl_UQ.d.ts → agent-bridge-DFQYEeXf.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-SHJW7t8q.d.ts → agent-subagent-runner-BZa_IEcd.d.ts} +7 -7
  3. package/dist/{brain-BYcK__Ym.d.ts → brain-etbcbRwV.d.ts} +95 -2
  4. package/dist/{compactor-C2RKEBtC.d.ts → compactor-72ug-ZRB.d.ts} +1 -1
  5. package/dist/{config-C_ae2k86.d.ts → config-rRS8yorV.d.ts} +71 -2
  6. package/dist/{context-Dp87Bcaq.d.ts → context-Dw55zZ_Q.d.ts} +110 -1
  7. package/dist/coordination/index.d.ts +181 -17
  8. package/dist/coordination/index.js +1018 -166
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +25 -25
  11. package/dist/defaults/index.js +804 -222
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +23 -18
  14. package/dist/execution/index.js +136 -41
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/execution/prompt-enhancer.d.ts +36 -6
  17. package/dist/execution/prompt-enhancer.js +35 -9
  18. package/dist/execution/prompt-enhancer.js.map +1 -1
  19. package/dist/extension/index.d.ts +6 -6
  20. package/dist/{global-mailbox-Bvrz1P3f.d.ts → global-mailbox-DJ4EoRr0.d.ts} +145 -5
  21. package/dist/{goal-preamble-CA_4yiGQ.d.ts → goal-preamble-hM8BH7TK.d.ts} +9 -9
  22. package/dist/{goal-store-DhuJoUNG.d.ts → goal-store-CWlbT0TO.d.ts} +1 -1
  23. package/dist/hq/index.d.ts +95 -6
  24. package/dist/hq/index.js +628 -50
  25. package/dist/hq/index.js.map +1 -1
  26. package/dist/{index-whDfTANu.d.ts → index-2Lhk5v0o.d.ts} +2 -2
  27. package/dist/{index-W4VJCzHa.d.ts → index-DWm_PE9L.d.ts} +5 -5
  28. package/dist/{index-CZQ6Pwbs.d.ts → index-DqW4o62H.d.ts} +8 -8
  29. package/dist/index.d.ts +96 -56
  30. package/dist/index.js +2464 -519
  31. package/dist/index.js.map +1 -1
  32. package/dist/infrastructure/index.d.ts +6 -6
  33. package/dist/infrastructure/index.js +5 -3
  34. package/dist/infrastructure/index.js.map +1 -1
  35. package/dist/kernel/index.d.ts +9 -9
  36. package/dist/kernel/index.js.map +1 -1
  37. package/dist/{mcp-servers-DJdZiRcv.d.ts → mcp-servers-BpWHTKlE.d.ts} +3 -3
  38. package/dist/models/index.d.ts +5 -5
  39. package/dist/models/index.js +28 -5
  40. package/dist/models/index.js.map +1 -1
  41. package/dist/{models-registry-C3a-2-Yd.d.ts → models-registry-CXQFUn5t.d.ts} +1 -1
  42. package/dist/{multi-agent-coordinator-CJSpTe5O.d.ts → multi-agent-coordinator-jyimfo7D.d.ts} +1 -1
  43. package/dist/{null-fleet-bus-QVshIsDx.d.ts → null-fleet-bus-DOGQcvrY.d.ts} +6 -6
  44. package/dist/observability/index.d.ts +2 -2
  45. package/dist/{parallel-eternal-engine-D9y5Pkcc.d.ts → parallel-eternal-engine-rItJBYp9.d.ts} +9 -9
  46. package/dist/{path-resolver-CnQ8SIfh.d.ts → path-resolver-DrpF5MGK.d.ts} +3 -3
  47. package/dist/{permission-CvYQNUqZ.d.ts → permission-CC7XFYWG.d.ts} +1 -1
  48. package/dist/{permission-policy-D5Ss8j4B.d.ts → permission-policy-cYR4RJmw.d.ts} +2 -2
  49. package/dist/{pipeline-l_zzFRh3.d.ts → pipeline-Ckkn3AOA.d.ts} +2 -2
  50. package/dist/{plan-templates-NtPgyeJA.d.ts → plan-templates-BvHw5Znw.d.ts} +33 -9
  51. package/dist/{provider-model-resolve-d5poT5y0.d.ts → provider-model-resolve-nZqnCeaR.d.ts} +3 -3
  52. package/dist/{provider-runner-gkctlQV_.d.ts → provider-runner-zVOn1p67.d.ts} +3 -3
  53. package/dist/{retry-policy-CtFhfwa8.d.ts → retry-policy-BV7nzeAd.d.ts} +1 -1
  54. package/dist/sdd/index.d.ts +8 -8
  55. package/dist/sdd/index.js +2 -0
  56. package/dist/sdd/index.js.map +1 -1
  57. package/dist/{secret-vault-BLsVmTIK.d.ts → secret-vault-eMBKfheR.d.ts} +9 -1
  58. package/dist/security/index.d.ts +5 -5
  59. package/dist/security/index.js +137 -10
  60. package/dist/security/index.js.map +1 -1
  61. package/dist/{selector-CXl2_y9W.d.ts → selector-C4ORTOid.d.ts} +1 -1
  62. package/dist/{session-event-bridge-Ccud20CC.d.ts → session-event-bridge-CeNpUL9w.d.ts} +1 -1
  63. package/dist/{session-reader-ZeXQmsmE.d.ts → session-reader-BepLSnGL.d.ts} +1 -1
  64. package/dist/storage/index.d.ts +50 -13
  65. package/dist/storage/index.js +620 -220
  66. package/dist/storage/index.js.map +1 -1
  67. package/dist/tools/index.d.ts +2 -2
  68. package/dist/tools/index.js +9 -2
  69. package/dist/tools/index.js.map +1 -1
  70. package/dist/types/index.d.ts +19 -19
  71. package/dist/types/index.js +202 -41
  72. package/dist/types/index.js.map +1 -1
  73. package/dist/utils/index.d.ts +17 -4
  74. package/dist/utils/index.js +48 -9
  75. package/dist/utils/index.js.map +1 -1
  76. 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-SHJW7t8q.js';
1
+ import { B as BridgeTransport, a as BridgeMessage, A as AgentBridge, b as AgentBridgeConfig } from './agent-subagent-runner-BZa_IEcd.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-W4VJCzHa.js';
2
- import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-l_zzFRh3.js';
3
- import { E as EventBus, a as EventName, L as Listener } from './brain-BYcK__Ym.js';
4
- import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-CtFhfwa8.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-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';
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-CvYQNUqZ.js';
8
- import { U as Usage, C as Context, J as JSONSchema, R as Request, b as Response, g as ContentBlock, p as TextBlock, T as Tool, P as Provider, s as RunOptions } from './context-Dp87Bcaq.js';
9
- import { W as WireFamily, H as HookEvent, f as HookMatcher, I as InProcessHook, i as Config } from './config-C_ae2k86.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';
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, j as ToolProgressEvent, T as Tool, k as ToolOutputMetadata } from './context-Dp87Bcaq.js';
1
+ import { U as Usage, C as Context, l as ToolProgressEvent, T as Tool, m as ToolOutputMetadata } from './context-Dw55zZ_Q.js';
2
2
 
3
3
  type MemoryScope = 'project-agents' | 'project-memory' | 'user-memory';
4
4
  type MemoryType = 'fact' | 'decision' | 'convention' | 'preference' | 'reference' | 'anti_pattern';
@@ -94,6 +94,28 @@ interface MemoryStore {
94
94
  * Subscribers cannot modify or cancel. Subscriber exceptions are caught.
95
95
  */
96
96
 
97
+ /**
98
+ * Structural shape of a tracked agent as flushed by AgentStatusTracker. Kept
99
+ * structural (not imported from the root `session-registry` module) so the
100
+ * low-level kernel layer takes on no dependency on composition modules. The
101
+ * real `AgentEntry` is assignable to this.
102
+ */
103
+ interface TrackedAgentSnapshot {
104
+ id: string;
105
+ name: string;
106
+ startedAt?: string | undefined;
107
+ status: string;
108
+ currentTool?: string | undefined;
109
+ iterations: number;
110
+ toolCalls: number;
111
+ costUsd?: number | undefined;
112
+ tokensIn?: number | undefined;
113
+ tokensOut?: number | undefined;
114
+ ctxPct?: number | undefined;
115
+ model?: string | undefined;
116
+ partialText?: string | undefined;
117
+ lastActivityAt: string;
118
+ }
97
119
  interface EventMap {
98
120
  'brain.decision_requested': {
99
121
  request: BrainDecisionRequest;
@@ -146,6 +168,37 @@ interface EventMap {
146
168
  sessionId: string;
147
169
  detail: string;
148
170
  };
171
+ /**
172
+ * Fired by AgentStatusTracker after every flush with the full agent list
173
+ * (leader + subagents). In-process consumers (e.g. the HQ session-telemetry
174
+ * bridge) read this to build live snapshots without re-reading the shared
175
+ * session-registry file.
176
+ */
177
+ 'session.agents_updated': {
178
+ agents: readonly TrackedAgentSnapshot[];
179
+ };
180
+ /**
181
+ * Fired around a single Agent.run() call. Status trackers use these to
182
+ * measure active-run elapsed time instead of inferring it from iterations.
183
+ */
184
+ 'agent.run.started': {
185
+ ctx: Context;
186
+ model: string;
187
+ at: string;
188
+ };
189
+ 'agent.run.completed': {
190
+ ctx: Context;
191
+ status: 'done' | 'failed' | 'max_iterations' | 'aborted';
192
+ iterations: number;
193
+ at: string;
194
+ durationMs: number;
195
+ };
196
+ 'agent.run.error': {
197
+ ctx: Context;
198
+ err: Error;
199
+ at: string;
200
+ durationMs: number;
201
+ };
149
202
  'iteration.started': {
150
203
  ctx: Context;
151
204
  index: number;
@@ -408,6 +461,46 @@ interface EventMap {
408
461
  costUsd?: number | undefined;
409
462
  subagentId?: string | undefined;
410
463
  };
464
+ /**
465
+ * Fired when a subagent produces an assistant text block that should
466
+ * appear in the main chat timeline (when agent streaming is enabled).
467
+ * The payload carries the subagent's identity, the message content,
468
+ * and the iteration index so UIs can render a threaded timeline.
469
+ */
470
+ 'agent.timeline.message': {
471
+ /** Subagent id (e.g. "bug-hunter@abc123"). */
472
+ subagentId: string;
473
+ /** Human-readable name or role label. */
474
+ agentName: string;
475
+ /** The assistant text block content, or a tool-call summary. */
476
+ content: string;
477
+ /** 'text' | 'tool_use' | 'error' | 'status' */
478
+ kind: 'text' | 'tool_use' | 'error' | 'status';
479
+ /** Iteration index within the subagent's own run. */
480
+ iteration: number;
481
+ /** ISO 8601 timestamp. */
482
+ ts: string;
483
+ /** When kind='tool_use', the tool name. */
484
+ toolName?: string | undefined;
485
+ /** Running cost estimate for this subagent so far. */
486
+ costUsd?: number | undefined;
487
+ };
488
+ /**
489
+ * Fired when a subagent's status changes (started, completed, failed,
490
+ * timed out, stopped). UIs use this to update agent status indicators
491
+ * and add status-change entries to the timeline.
492
+ */
493
+ 'agent.status_changed': {
494
+ subagentId: string;
495
+ agentName: string;
496
+ status: 'spawned' | 'running' | 'completed' | 'failed' | 'timeout' | 'stopped' | 'budget_exhausted';
497
+ /** ISO 8601 timestamp. */
498
+ ts: string;
499
+ /** Human-readable summary or error message. */
500
+ summary?: string | undefined;
501
+ /** Task description when available. */
502
+ task?: string | undefined;
503
+ };
411
504
  /**
412
505
  * Fired on every `iteration.completed`. UIs subscribe to render a live
413
506
  * context-window fill bar per agent (e.g. "67% ████████░░"). The
@@ -1158,4 +1251,4 @@ declare class DefaultBrainArbiter implements BrainArbiter {
1158
1251
  }
1159
1252
  declare function formatHumanPrompt(request: BrainDecisionRequest): string;
1160
1253
 
1161
- export { type BrainArbiter as B, DefaultBrainArbiter as D, EventBus as E, HumanEscalatingBrainArbiter as H, type Listener as L, type MemoryScope as M, ObservableBrainArbiter as O, type ScoredEntry as S, type EventName as a, type MemoryEntry as b, type MemoryStore as c, type MemoryRelevanceContext as d, type BrainDecision as e, type BrainDecisionOption as f, BrainDecisionQueue as g, type BrainDecisionRequest as h, type BrainDecisionSource as i, type BrainFallback as j, type BrainRisk as k, type DefaultBrainArbiterOptions as l, type EventLogger as m, type EventMap as n, MEMORY_TYPE_LABELS as o, type MemoryClearedPayload as p, type MemoryConsolidatedPayload as q, type MemoryForgottenPayload as r, type MemoryPriority as s, type MemoryRememberedPayload as t, type MemoryType as u, ScopedEventBus as v, formatHumanPrompt as w };
1254
+ export { type BrainArbiter as B, DefaultBrainArbiter as D, EventBus as E, HumanEscalatingBrainArbiter as H, type Listener as L, type MemoryScope as M, ObservableBrainArbiter as O, type ScoredEntry as S, type TrackedAgentSnapshot as T, type EventName as a, type MemoryEntry as b, type MemoryStore as c, type MemoryRelevanceContext as d, type BrainDecision as e, type BrainDecisionOption as f, BrainDecisionQueue as g, type BrainDecisionRequest as h, type BrainDecisionSource as i, type BrainFallback as j, type BrainRisk as k, type DefaultBrainArbiterOptions as l, type EventLogger as m, type EventMap as n, MEMORY_TYPE_LABELS as o, type MemoryClearedPayload as p, type MemoryConsolidatedPayload as q, type MemoryForgottenPayload as r, type MemoryPriority as s, type MemoryRememberedPayload as t, type MemoryType as u, ScopedEventBus as v, formatHumanPrompt as w };
@@ -1,4 +1,4 @@
1
- import { C as Context } from './context-Dp87Bcaq.js';
1
+ import { C as Context } from './context-Dw55zZ_Q.js';
2
2
 
3
3
  interface CompactRepairReport {
4
4
  removedToolUses: string[];
@@ -1,4 +1,4 @@
1
- import { l as ReasoningConfig, m as Capabilities, f as Permission, n as ReasoningEffort, o as CacheTtl } from './context-Dp87Bcaq.js';
1
+ import { a as ReasoningConfig, n as Capabilities, h as Permission, o as ReasoningEffort, p as CacheTtl } from './context-Dw55zZ_Q.js';
2
2
 
3
3
  type ContextWindowModeId = 'balanced' | 'frugal' | 'deep' | 'archival';
4
4
  type ContextWindowAggressiveOn = 'hard' | 'soft' | 'warn';
@@ -264,6 +264,33 @@ interface ModelRuntimeCacheConfig {
264
264
  interface ModelRuntimeConfig {
265
265
  reasoning?: ModelRuntimeReasoningConfig | undefined;
266
266
  cache?: ModelRuntimeCacheConfig | undefined;
267
+ /**
268
+ * Generic generation parameters mapped directly onto `Request` fields.
269
+ * Only sent when the active model's `Capabilities` advertise support.
270
+ */
271
+ parameters?: ModelRuntimeParametersConfig | undefined;
272
+ }
273
+ /**
274
+ * Generic generation parameters the user can set per-session / per-project.
275
+ * Each field maps to a `Request` field of the same name and is gated by the
276
+ * corresponding `Capabilities` flag so unsupported models don't receive
277
+ * parameters they'd reject.
278
+ */
279
+ interface ModelRuntimeParametersConfig {
280
+ /** Top-K sampling (Anthropic, Gemini). Gated by `capabilities.topK`. */
281
+ topK?: number | undefined;
282
+ /** Frequency penalty (OpenAI, Gemini). Gated by `capabilities.frequencyPenalty`. */
283
+ frequencyPenalty?: number | undefined;
284
+ /** Presence penalty (OpenAI, Gemini). Gated by `capabilities.presencePenalty`. */
285
+ presencePenalty?: number | undefined;
286
+ /** Random seed (OpenAI, Gemini). Gated by `capabilities.seed`. */
287
+ seed?: number | undefined;
288
+ /** End-user identifier for abuse monitoring. */
289
+ user?: string | undefined;
290
+ /** Log probabilities (OpenAI, Gemini). Gated by `capabilities.logprobs`. */
291
+ logprobs?: boolean | undefined;
292
+ /** Number of top logprobs to return (OpenAI). Only when `logprobs` is true. */
293
+ topLogprobs?: number | undefined;
267
294
  }
268
295
  /**
269
296
  * HQ client connection settings. Same-machine clients can auto-discover the
@@ -361,6 +388,42 @@ interface CircuitBreakerRuntimeConfig {
361
388
  */
362
389
  autoKillResetMs?: number | undefined;
363
390
  }
391
+ /**
392
+ * Adaptive concurrency controller configuration. When enabled, the controller
393
+ * automatically adjusts `maxConcurrent` based on rate-limit (429) errors:
394
+ * - On 429: halves `maxConcurrent` (floor at 1)
395
+ * - On sustained success (no 429 for `recoveryIntervalMs`): increases `maxConcurrent` by 1
396
+ */
397
+ interface AdaptiveConcurrencyConfig {
398
+ /** Enable adaptive concurrency. Default: false (disabled). */
399
+ enabled?: boolean | undefined;
400
+ /**
401
+ * Minimum concurrency floor. The controller never drops below this.
402
+ * Default: 1.
403
+ */
404
+ minConcurrent?: number | undefined;
405
+ /**
406
+ * Maximum concurrency ceiling. The controller never exceeds this.
407
+ * Default: 16 (matches MultiAgentCoordinator default).
408
+ */
409
+ maxConcurrent?: number | undefined;
410
+ /**
411
+ * Multiplicative decrease factor when a 429 is hit.
412
+ * `newConcurrency = floor(currentConcurrency * decreaseFactor)`.
413
+ * Default: 0.5 (halves concurrency).
414
+ */
415
+ decreaseFactor?: number | undefined;
416
+ /**
417
+ * Number of consecutive successful requests before increasing concurrency by 1.
418
+ * Default: 10.
419
+ */
420
+ successThreshold?: number | undefined;
421
+ /**
422
+ * How often (ms) to check for recovery and bump concurrency.
423
+ * Default: 30_000 (30 seconds).
424
+ */
425
+ recoveryIntervalMs?: number | undefined;
426
+ }
364
427
  interface ToolsConfig {
365
428
  defaultExecutionStrategy: 'parallel' | 'sequential' | 'smart';
366
429
  maxIterations: number;
@@ -750,6 +813,12 @@ interface Config {
750
813
  * failures). Default off — toggle with `/settings breaker on|off`.
751
814
  */
752
815
  circuitBreaker?: CircuitBreakerRuntimeConfig | undefined;
816
+ /**
817
+ * Adaptive concurrency controller — automatically adjusts `maxConcurrent` based on
818
+ * rate-limit (429) errors. On 429: decreases concurrency. On sustained success:
819
+ * gradually increases concurrency back up. Default off.
820
+ */
821
+ adaptiveConcurrency?: AdaptiveConcurrencyConfig | undefined;
753
822
  /** Saved launch preferences — restored on next boot for one-line confirmation. */
754
823
  launch?: LaunchConfig | undefined;
755
824
  /**
@@ -827,4 +896,4 @@ interface ConfigStore {
827
896
  watch(cb: (next: Readonly<Config>, prev: Readonly<Config>) => void): () => void;
828
897
  }
829
898
 
830
- export { normalizeTokenSavingTier as $, type AutonomyConfig as A, MAX_TUI_THINKING_WORD_LENGTH as B, type ContextWindowAggressiveOn as C, DEFAULT_CONTEXT_WINDOW_MODE_ID as D, type ModelRuntimeCacheConfig as E, type FeaturesConfig as F, type ModelRuntimeConfig as G, type HookEvent as H, type InProcessHook as I, type ModelRuntimeReasoningConfig as J, type ModelsDevProvider as K, type LaunchConfig as L, type ModelsRegistry as M, type PluginConfig as N, type ProviderApiKey as O, type ProviderConfig as P, type SessionLoggingConfig as Q, type ResolvedProvider as R, type ShellHook as S, type TokenSavingTier as T, type SyncCategory as U, type ToolsConfig as V, type WireFamily as W, formatContextWindowModeList as X, getContextWindowMode as Y, isContextWindowModeId as Z, listContextWindowModes as _, type ModelsDevPayload as a, normalizeTuiThinkingWord as a0, resolveContextWindowPolicy as a1, 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, CONTEXT_WINDOW_MODES as o, type CircuitBreakerRuntimeConfig as p, type ContextConfig as q, type ContextWindowConfigLike as r, type ContextWindowMode as s, type ContextWindowModeId as t, type ContextWindowThresholds as u, type CustomModelDefinition as v, DEFAULT_TUI_THINKING_WORD as w, type HqClientConfig as x, type IndexingConfig as y, type LogConfig as z };
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 };
@@ -527,6 +527,50 @@ interface ToolErrorInfo {
527
527
  */
528
528
  type ReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
529
529
  type CacheTtl = '5m' | '1h';
530
+ /**
531
+ * Provider-agnostic response-format directive.
532
+ *
533
+ * - `{ type: 'text' }` — free-form text (default).
534
+ * - `{ type: 'json_object' }` — valid JSON without a schema constraint.
535
+ * - `{ type: 'json_schema', jsonSchema: { name, schema, strict? } }` — JSON
536
+ * constrained to the supplied JSON Schema. The `strict` flag is
537
+ * OpenAI-specific; Gemini ignores it in favour of `responseMimeType`.
538
+ *
539
+ * Each provider adapter maps this into its own wire format:
540
+ * OpenAI → `response_format`
541
+ * Gemini → `responseMimeType` + `responseSchema`
542
+ * Anthropic → (not yet supported; uses tools for structured output)
543
+ */
544
+ interface JsonSchemaSpec {
545
+ name: string;
546
+ /** OpenAI-specific: enable strict schema adherence. */
547
+ strict?: boolean | undefined;
548
+ /** The JSON Schema object describing the expected shape. */
549
+ schema: Record<string, unknown>;
550
+ /** Optional human-readable description (OpenAI). */
551
+ description?: string | undefined;
552
+ }
553
+ type ResponseFormat = {
554
+ type: 'text';
555
+ } | {
556
+ type: 'json_object';
557
+ } | {
558
+ type: 'json_schema';
559
+ jsonSchema: JsonSchemaSpec;
560
+ };
561
+ /**
562
+ * Safety category threshold pair used by Google Gemini's `safetySettings`.
563
+ *
564
+ * Categories: `HARM_CATEGORY_HARASSMENT`, `HARM_CATEGORY_HATE_SPEECH`,
565
+ * `HARM_CATEGORY_SEXUALLY_EXPLICIT`, `HARM_CATEGORY_DANGEROUS_CONTENT`.
566
+ *
567
+ * Thresholds: `BLOCK_NONE`, `BLOCK_ONLY_HIGH`, `BLOCK_MEDIUM_AND_ABOVE`,
568
+ * `BLOCK_LOW_AND_ABOVE`.
569
+ */
570
+ interface SafetySetting {
571
+ category: string;
572
+ threshold: string;
573
+ }
530
574
  interface Usage {
531
575
  input: number;
532
576
  output: number;
@@ -563,6 +607,26 @@ interface Capabilities {
563
607
  reasoning: boolean;
564
608
  maxContext: number;
565
609
  cacheControl: 'native' | 'auto' | 'none';
610
+ /** Model accepts `top_k` / `topK` sampling parameter. */
611
+ topK?: boolean | undefined;
612
+ /** Model accepts `frequency_penalty` / `frequencyPenalty` parameter. */
613
+ frequencyPenalty?: boolean | undefined;
614
+ /** Model accepts `presence_penalty` / `presencePenalty` parameter. */
615
+ presencePenalty?: boolean | undefined;
616
+ /** Model accepts `seed` parameter for deterministic generation. */
617
+ seed?: boolean | undefined;
618
+ /**
619
+ * Model accepts JSON Schema / structured-output constraints
620
+ * (OpenAI `response_format.json_schema`, Gemini `responseMimeType`+`responseSchema`).
621
+ * Distinct from `jsonMode` (which is just a system-prompt hint).
622
+ */
623
+ structuredOutput?: boolean | undefined;
624
+ /** Model supports log-probability output (`logprobs`, `top_logprobs`). */
625
+ logprobs?: boolean | undefined;
626
+ /** Model supports audio input/output modality. */
627
+ audio?: boolean | undefined;
628
+ /** Model supports the `n` parameter for multiple completions. */
629
+ multipleCompletions?: boolean | undefined;
566
630
  }
567
631
  interface Request {
568
632
  model: string;
@@ -572,6 +636,36 @@ interface Request {
572
636
  maxTokens: number;
573
637
  temperature?: number | undefined;
574
638
  topP?: number | undefined;
639
+ topK?: number | undefined;
640
+ frequencyPenalty?: number | undefined;
641
+ presencePenalty?: number | undefined;
642
+ seed?: number | undefined;
643
+ /**
644
+ * End-user identifier for abuse monitoring and per-user rate limiting.
645
+ * - Anthropic → `metadata.user_id`
646
+ * - OpenAI → `user`
647
+ * - Gemini → (not supported)
648
+ */
649
+ user?: string | undefined;
650
+ /**
651
+ * Number of response candidates to generate. Google Gemini supports
652
+ * this via `generationConfig.candidateCount`. OpenAI does not have
653
+ * an equivalent (`n` is conceptually similar but distinct).
654
+ */
655
+ candidateCount?: number | undefined;
656
+ /**
657
+ * Whether to return log probabilities for output tokens.
658
+ * - OpenAI → `logprobs: boolean` (+ `topLogprobs: number`)
659
+ * - Gemini → `generationConfig.logprobs: number` (how many top candidates)
660
+ * Default undefined = no logprobs requested.
661
+ */
662
+ logprobs?: boolean | undefined;
663
+ /**
664
+ * Number of most probable tokens to return log probabilities for
665
+ * (OpenAI `top_logprobs`). Only meaningful when `logprobs` is true.
666
+ * Range: 0-20. Gemini ignores this (uses `logprobs` as the count).
667
+ */
668
+ topLogprobs?: number | undefined;
575
669
  stopSequences?: string[] | undefined;
576
670
  toolChoice?: 'auto' | 'required' | 'none' | {
577
671
  type: 'tool' | undefined;
@@ -579,6 +673,21 @@ interface Request {
579
673
  };
580
674
  reasoning?: ReasoningRequest | undefined;
581
675
  cache?: RequestCacheControl | undefined;
676
+ /**
677
+ * Structured-output / response-format directive.
678
+ * When set, the provider adapter maps this to its native response-format
679
+ * parameter (OpenAI `response_format`, Gemini `responseMimeType`, etc.).
680
+ * The model must advertise `capabilities.structuredOutput` for this to be
681
+ * honoured; unsupported models will likely 400 or ignore it.
682
+ */
683
+ responseFormat?: ResponseFormat | undefined;
684
+ /**
685
+ * Safety category thresholds for filtering harmful content.
686
+ * - Gemini → top-level `safetySettings` array with `{ category, threshold }`
687
+ * - OpenAI → not supported (uses server-side moderation)
688
+ * - Anthropic → not supported
689
+ */
690
+ safetySettings?: SafetySetting[] | undefined;
582
691
  }
583
692
  type StopReason = 'end_turn' | 'tool_use' | 'max_tokens' | 'stop_sequence' | 'refusal';
584
693
  interface Response {
@@ -1549,4 +1658,4 @@ declare class Context implements RunEnv {
1549
1658
  usage(): Usage;
1550
1659
  }
1551
1660
 
1552
- export { type RunEnv as $, AgentError as A, type ContextFileEvidence as B, Context as C, type ContextInit as D, type ContextIntentEvidence as E, type ContextRepeatedReadEvidence as F, ERROR_CODES as G, type ErrorCode as H, type ErrorSeverity as I, type JSONSchema as J, type ErrorSubsystem as K, type FileSnapshot as L, type Message as M, FsError as N, type ImageBlock as O, type Provider as P, type MessageRole as Q, type Request as R, type SessionEvent as S, type Tool as T, type Usage as U, PluginError as V, type ProviderErrorBody as W, type ReadonlyConversationState as X, type ReasoningRequest as Y, type RequestCacheControl as Z, type RiskTier as _, type SessionWriter as a, SddError as a0, SessionError as a1, type StateChange as a2, type StateChangeHandler as a3, type StopReason as a4, type StreamEvent as a5, StreamHangError as a6, type ThinkingBlock as a7, type ToolCallContext as a8, ToolError as a9, ToolErrorCategory as aa, type ToolErrorInfo as ab, type ToolEvidenceStatus as ac, type ToolFinalEvent as ad, type ToolIconId as ae, type ToolStreamEvent as af, WrongStackError as ag, asBlocks as ah, asText as ai, extractRunEnv as aj, isAgentError as ak, isConfigError as al, isFsError as am, isImageBlock as an, isPluginError as ao, isSddError as ap, isSessionError as aq, isTextBlock as ar, isThinkingBlock as as, isToolError as at, isToolResultBlock as au, isToolUseBlock as av, isWrongStackError as aw, toWrongStackError as ax, wrapAsState as ay, type Response as b, type TokenCounter as c, type CacheStats as d, ProviderError as e, type Permission as f, type ContentBlock as g, type SessionMetadata as h, type SessionStore as i, type ToolProgressEvent as j, type ToolOutputMetadata as k, type ReasoningConfig as l, type Capabilities as m, type ReasoningEffort as n, type CacheTtl as o, type TextBlock as p, type ToolUseBlock as q, type ToolResultBlock as r, type RunOptions as s, type ResumedSession as t, type SessionData as u, type SessionSummary as v, type TodoItem as w, ConversationState as x, ConfigError as y, type ContextEvidenceState as z };
1661
+ export { type ResponseFormat as $, AgentError as A, type ContextEvidenceState as B, Context as C, type ContextFileEvidence as D, type ContextInit as E, type ContextIntentEvidence as F, type ContextRepeatedReadEvidence as G, ERROR_CODES as H, type ErrorCode as I, type JSONSchema as J, type ErrorSeverity as K, type ErrorSubsystem as L, type Message as M, type FileSnapshot as N, FsError as O, type Provider as P, type ImageBlock as Q, type ReasoningRequest as R, type SessionEvent as S, type Tool as T, type Usage as U, type JsonSchemaSpec as V, type MessageRole as W, PluginError as X, type ProviderErrorBody as Y, type ReadonlyConversationState as Z, type RequestCacheControl as _, type ReasoningConfig as a, type RiskTier as a0, type RunEnv as a1, type SafetySetting as a2, SddError as a3, SessionError as a4, type StateChange as a5, type StateChangeHandler as a6, type StopReason as a7, type StreamEvent as a8, StreamHangError as a9, toWrongStackError as aA, wrapAsState as aB, type ThinkingBlock as aa, type ToolCallContext as ab, ToolError as ac, ToolErrorCategory as ad, type ToolErrorInfo as ae, type ToolEvidenceStatus as af, type ToolFinalEvent as ag, type ToolIconId as ah, type ToolStreamEvent as ai, WrongStackError as aj, asBlocks as ak, asText as al, extractRunEnv as am, isAgentError as an, isConfigError as ao, isFsError as ap, isImageBlock as aq, isPluginError as ar, isSddError as as, isSessionError as at, isTextBlock as au, isThinkingBlock as av, isToolError as aw, isToolResultBlock as ax, isToolUseBlock as ay, isWrongStackError as az, type SessionWriter as b, type Request as c, type Response as d, type TokenCounter as e, type CacheStats as f, ProviderError as g, type Permission as h, type ContentBlock as i, type SessionMetadata as j, type SessionStore as k, type ToolProgressEvent as l, type ToolOutputMetadata as m, type Capabilities as n, type ReasoningEffort as o, type CacheTtl as p, type TextBlock as q, type ToolUseBlock as r, type ToolResultBlock as s, type RunOptions as t, type ResumedSession as u, type SessionData as v, type SessionSummary as w, type TodoItem as x, ConversationState as y, ConfigError as z };