@wrongstack/core 0.269.0 → 0.272.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 (76) hide show
  1. package/dist/{agent-bridge-PcHQl_UQ.d.ts → agent-bridge-jVSZiygR.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-SHJW7t8q.d.ts → agent-subagent-runner-DOLIwBRo.d.ts} +7 -7
  3. package/dist/{brain-BYcK__Ym.d.ts → brain-CdbbJWi3.d.ts} +71 -1
  4. package/dist/{compactor-C2RKEBtC.d.ts → compactor-72ug-ZRB.d.ts} +1 -1
  5. package/dist/{config-C_ae2k86.d.ts → config-D2DGoGSQ.d.ts} +29 -2
  6. package/dist/{context-Dp87Bcaq.d.ts → context-Dw55zZ_Q.d.ts} +110 -1
  7. package/dist/coordination/index.d.ts +121 -17
  8. package/dist/coordination/index.js +738 -74
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +25 -25
  11. package/dist/defaults/index.js +599 -86
  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-CQj_C9Dp.d.ts} +139 -3
  21. package/dist/{goal-preamble-CA_4yiGQ.d.ts → goal-preamble-ZXDjjR1y.d.ts} +9 -9
  22. package/dist/{goal-store-DhuJoUNG.d.ts → goal-store-CcJBd-g1.d.ts} +1 -1
  23. package/dist/hq/index.d.ts +93 -6
  24. package/dist/hq/index.js +619 -49
  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-CZQ6Pwbs.d.ts → index-BL7BAx0p.d.ts} +8 -8
  28. package/dist/{index-W4VJCzHa.d.ts → index-Qo4kTzgw.d.ts} +5 -5
  29. package/dist/index.d.ts +96 -56
  30. package/dist/index.js +1941 -352
  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-DS-YUXvF.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-DP6pGHet.d.ts} +1 -1
  42. package/dist/{multi-agent-coordinator-CJSpTe5O.d.ts → multi-agent-coordinator-BvbdNQ14.d.ts} +1 -1
  43. package/dist/{null-fleet-bus-QVshIsDx.d.ts → null-fleet-bus-BxTfXBKo.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-Cf-GTegR.d.ts} +9 -9
  46. package/dist/{path-resolver-CnQ8SIfh.d.ts → path-resolver-DztfnFcv.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-sNIkhXeB.d.ts} +2 -2
  50. package/dist/{plan-templates-NtPgyeJA.d.ts → plan-templates-DYiKFmEb.d.ts} +11 -5
  51. package/dist/{provider-model-resolve-d5poT5y0.d.ts → provider-model-resolve-dYAbTs_i.d.ts} +3 -3
  52. package/dist/{provider-runner-gkctlQV_.d.ts → provider-runner-Dw8x0F7u.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 +45 -13
  65. package/dist/storage/index.js +374 -113
  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-DOLIwBRo.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-Qo4kTzgw.js';
2
+ import { C as Container, R as ReadonlyPipeline, a as Renderer } from './pipeline-sNIkhXeB.js';
3
+ import { E as EventBus, a as EventName, L as Listener } from './brain-CdbbJWi3.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-D2DGoGSQ.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,27 @@ 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
+ status: string;
107
+ currentTool?: string | undefined;
108
+ iterations: number;
109
+ toolCalls: number;
110
+ costUsd?: number | undefined;
111
+ tokensIn?: number | undefined;
112
+ tokensOut?: number | undefined;
113
+ ctxPct?: number | undefined;
114
+ model?: string | undefined;
115
+ partialText?: string | undefined;
116
+ lastActivityAt: string;
117
+ }
97
118
  interface EventMap {
98
119
  'brain.decision_requested': {
99
120
  request: BrainDecisionRequest;
@@ -146,6 +167,15 @@ interface EventMap {
146
167
  sessionId: string;
147
168
  detail: string;
148
169
  };
170
+ /**
171
+ * Fired by AgentStatusTracker after every flush with the full agent list
172
+ * (leader + subagents). In-process consumers (e.g. the HQ session-telemetry
173
+ * bridge) read this to build live snapshots without re-reading the shared
174
+ * session-registry file.
175
+ */
176
+ 'session.agents_updated': {
177
+ agents: readonly TrackedAgentSnapshot[];
178
+ };
149
179
  'iteration.started': {
150
180
  ctx: Context;
151
181
  index: number;
@@ -408,6 +438,46 @@ interface EventMap {
408
438
  costUsd?: number | undefined;
409
439
  subagentId?: string | undefined;
410
440
  };
441
+ /**
442
+ * Fired when a subagent produces an assistant text block that should
443
+ * appear in the main chat timeline (when agent streaming is enabled).
444
+ * The payload carries the subagent's identity, the message content,
445
+ * and the iteration index so UIs can render a threaded timeline.
446
+ */
447
+ 'agent.timeline.message': {
448
+ /** Subagent id (e.g. "bug-hunter@abc123"). */
449
+ subagentId: string;
450
+ /** Human-readable name or role label. */
451
+ agentName: string;
452
+ /** The assistant text block content, or a tool-call summary. */
453
+ content: string;
454
+ /** 'text' | 'tool_use' | 'error' | 'status' */
455
+ kind: 'text' | 'tool_use' | 'error' | 'status';
456
+ /** Iteration index within the subagent's own run. */
457
+ iteration: number;
458
+ /** ISO 8601 timestamp. */
459
+ ts: string;
460
+ /** When kind='tool_use', the tool name. */
461
+ toolName?: string | undefined;
462
+ /** Running cost estimate for this subagent so far. */
463
+ costUsd?: number | undefined;
464
+ };
465
+ /**
466
+ * Fired when a subagent's status changes (started, completed, failed,
467
+ * timed out, stopped). UIs use this to update agent status indicators
468
+ * and add status-change entries to the timeline.
469
+ */
470
+ 'agent.status_changed': {
471
+ subagentId: string;
472
+ agentName: string;
473
+ status: 'spawned' | 'running' | 'completed' | 'failed' | 'timeout' | 'stopped' | 'budget_exhausted';
474
+ /** ISO 8601 timestamp. */
475
+ ts: string;
476
+ /** Human-readable summary or error message. */
477
+ summary?: string | undefined;
478
+ /** Task description when available. */
479
+ task?: string | undefined;
480
+ };
411
481
  /**
412
482
  * Fired on every `iteration.completed`. UIs subscribe to render a live
413
483
  * context-window fill bar per agent (e.g. "67% ████████░░"). The
@@ -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
@@ -827,4 +854,4 @@ interface ConfigStore {
827
854
  watch(cb: (next: Readonly<Config>, prev: Readonly<Config>) => void): () => void;
828
855
  }
829
856
 
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 };
857
+ export { listContextWindowModes 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 ModelRuntimeParametersConfig as J, type ModelRuntimeReasoningConfig as K, type LaunchConfig as L, type ModelsRegistry as M, type ModelsDevProvider as N, type PluginConfig as O, type ProviderConfig as P, type ProviderApiKey as Q, type ResolvedProvider as R, type ShellHook as S, type TokenSavingTier as T, type SessionLoggingConfig as U, type SyncCategory as V, type WireFamily as W, type ToolsConfig as X, formatContextWindowModeList as Y, getContextWindowMode as Z, isContextWindowModeId as _, type ModelsDevPayload as a, normalizeTokenSavingTier as a0, normalizeTuiThinkingWord as a1, resolveContextWindowPolicy as a2, 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 };
@@ -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 };
@@ -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-BYcK__Ym.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-BYcK__Ym.js';
3
- import { H as FleetManager, s as Director } from '../null-fleet-bus-QVshIsDx.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-QVshIsDx.js';
5
- import { b as AgentDefinition } from '../multi-agent-coordinator-CJSpTe5O.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-CJSpTe5O.js';
7
- import { F as FleetBus } from '../agent-subagent-runner-SHJW7t8q.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-SHJW7t8q.js';
9
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-PcHQl_UQ.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-CdbbJWi3.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-CdbbJWi3.js';
3
+ import { H as FleetManager, s as Director } from '../null-fleet-bus-BxTfXBKo.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-BxTfXBKo.js';
5
+ import { b as AgentDefinition } from '../multi-agent-coordinator-BvbdNQ14.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-BvbdNQ14.js';
7
+ import { F as FleetBus } from '../agent-subagent-runner-DOLIwBRo.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-DOLIwBRo.js';
9
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-jVSZiygR.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, al as resolveProjectDir } from '../global-mailbox-Bvrz1P3f.js';
13
- import { C as Context, T as Tool } from '../context-Dp87Bcaq.js';
12
+ export { G as GlobalMailbox, aw as resolveProjectDir } from '../global-mailbox-CQj_C9Dp.js';
13
+ import { C as Context, T as Tool } from '../context-Dw55zZ_Q.js';
14
14
  import 'node:events';
15
15
  import '../logger-B63L5bTg.js';
16
16
  import '../director-state-BfeCUbmk.js';
17
- import '../config-C_ae2k86.js';
18
- import '../index-W4VJCzHa.js';
19
- import '../pipeline-l_zzFRh3.js';
17
+ import '../config-D2DGoGSQ.js';
18
+ import '../index-Qo4kTzgw.js';
19
+ import '../pipeline-sNIkhXeB.js';
20
20
  import '../observability-D-HZN_mF.js';
21
- import '../permission-CvYQNUqZ.js';
22
- import '../retry-policy-CtFhfwa8.js';
21
+ import '../permission-CC7XFYWG.js';
22
+ import '../retry-policy-BV7nzeAd.js';
23
23
 
24
24
  /** Phase 1 · Discovery — map the territory before any work begins. */
25
25
  declare const DISCOVERY_AGENTS: AgentDefinition[];
@@ -65,6 +65,10 @@ declare class DefaultMailbox implements Mailbox {
65
65
  private _messageCache;
66
66
  private _messageCacheMtime;
67
67
  private _messageCacheSize;
68
+ /** Primary index: recipient → Set of messages (points into _messageCache). */
69
+ private _byTo;
70
+ /** Secondary index: sender → Set of messages (points into _messageCache). */
71
+ private _byFrom;
68
72
  constructor(sessionDir: string);
69
73
  get mailboxPath(): string;
70
74
  send(input: MailboxSendInput): Promise<MailboxMessage>;
@@ -83,9 +87,20 @@ declare class DefaultMailbox implements Mailbox {
83
87
  clientHeartbeat(_input: ClientHeartbeatInput): Promise<void>;
84
88
  getClientStatuses(): Promise<ClientStatus[]>;
85
89
  private _readAll;
90
+ /**
91
+ * Read only newly-appended bytes from the file and append them to the
92
+ * in-memory cache, avoiding a full re-read when the file only grew.
93
+ */
94
+ private _readNewMessagesOnly;
95
+ /** Parse a JSONL string into MailboxMessage[], including migration. */
96
+ private _parseLines;
86
97
  private _readAllCached;
87
98
  private _setMessageCache;
88
99
  private _pushToCache;
100
+ /** Rebuild both indexes from a full message list. */
101
+ private _buildIndexes;
102
+ /** Add a single message to both indexes. */
103
+ private _indexMsg;
89
104
  }
90
105
 
91
106
  /**
@@ -1723,4 +1738,93 @@ declare class AutonomousCoordinator {
1723
1738
  private _emit;
1724
1739
  }
1725
1740
 
1726
- export { AgentDefinition, AgentHeartbeatInput, AgentRegistrationInput, type ApplyResult, type ApprovalDecision, AutonomousBrain, type AutonomousBrainOptions, AutonomousCoordinator, type AutonomousCoordinatorOptions, type AutonomousDecisionRequest, type AutonomousDecisionType, BUILD_AGENTS, BrainArbiter, BrainDecision, BrainDecisionOption, BrainDecisionRequest, BrainDecisionSource, type BrainInterventionInput, BrainMonitor, type BrainMonitorOptions, BrainRisk, type ChangeFile, ChangeManager, type ChangeManagerOptions, type ChangeNode, type ChangeProposal, type ChangeStatus, type ConsensusOptions, ConsensusProtocol, type ConsensusResult, type CoordinatorEvent, type CoordinatorStats, type DAGEdgeEvent, type DAGEdgeHandler, type DAGNode, type DAGNodeStatus, DEFAULT_QUALITY_CHECKS, DELIVERY_AGENTS, DEPENDENCY_FILE_PATTERNS, DISCOVERY_AGENTS, DOMAIN_AGENTS, type DecisionNode, type DecisionPrompt, DefaultMailbox, type DepWatchEntry, type DepWatcherBridgeOptions, type DependencyWatcherConfig, Director, type EscalationDecision, type FactCategory, type FactNode, FleetBus, FleetManager, type GoalNode, type GoalPriority, type GoalStatus, type GraphSubscription, KNOWLEDGE_AGENTS, KnowledgeGraph, type LLMProvider, META_AGENTS, type MailToolsOptions, Mailbox, MailboxAckInput, MailboxAgentStatus, type MailboxHooksOptions, MailboxMessage, MailboxQuery, type MailboxResolver, MailboxSendInput, type MailboxToolOptions, type NodeFilter, type NodeType, type OutdatedNotifyMessage, PLANNING_AGENTS, type PackageAuthorEntry, type PackageAuthorLog, type PackageAuthorTrackerOptions, type PackageOutdatedEntry, type PackageOutdatedResult, type PackageOutdatedWatcherOptions, type PrioritizationDecision, type QualityCheck, type QualityGateChecks, type QualityGateResult, type QuorumRule, REVIEW_AGENTS, type RollbackResult, type RunOptions, type RunnablesHandler, type SpawnDecision, type TaskAuctionOptions, TaskAuctioneer, type TaskBid, TaskDAG, VERIFY_AGENTS, type VoteNode, type VoteRecord, type VoteValue, type VoterConfig, attachDepWatcherBridge, createMailboxHooks, detectEcosystem, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, mailboxSessionTag, makeDependencyWatcherConfig, makeMailInboxTool, makeMailSendTool, makeMailboxTool, recordPackageAction, resolveMailboxIdentity, startPackageOutdatedWatcher, updatePackageOutdatedStatus };
1741
+ interface AgentTimelineEntry {
1742
+ /** Unique entry id (ULID or timestamp-based). */
1743
+ id: string;
1744
+ /** Subagent id this entry belongs to. */
1745
+ subagentId: string;
1746
+ /** Human-readable agent name/role. */
1747
+ agentName: string;
1748
+ /** ISO 8601 timestamp. */
1749
+ ts: string;
1750
+ /** Content type. */
1751
+ kind: 'text' | 'tool_use' | 'tool_result' | 'error' | 'status' | 'system';
1752
+ /** The message content (text, tool summary, error message, status text). */
1753
+ content: string;
1754
+ /** Iteration index within the subagent's run. */
1755
+ iteration: number;
1756
+ /** For tool entries: tool name. */
1757
+ toolName?: string | undefined;
1758
+ /** For tool entries: whether the tool succeeded. */
1759
+ toolOk?: boolean | undefined;
1760
+ /** Running cost estimate. */
1761
+ costUsd?: number | undefined;
1762
+ }
1763
+ interface AgentVirtualSession {
1764
+ subagentId: string;
1765
+ agentName: string;
1766
+ createdAt: string;
1767
+ status: string;
1768
+ task?: string | undefined;
1769
+ /** Ordered transcript entries (newest last). */
1770
+ transcript: AgentTimelineEntry[];
1771
+ }
1772
+ interface AgentMonitorOptions {
1773
+ /** The FleetBus to listen on for subagent events. Optional — set via `setFleetBus()` before `start()`. */
1774
+ fleetBus?: FleetBus | undefined;
1775
+ /** Local EventBus for emitting agent.timeline.* and agent.status_changed events. */
1776
+ events: EventBus;
1777
+ /** Directory where per-subagent JSONL transcripts will be written. */
1778
+ transcriptsDir: string;
1779
+ /** Maximum in-memory entries per subagent (ring buffer). Default 500. */
1780
+ maxEntriesPerAgent?: number;
1781
+ /** Whether agent stream is initially enabled. Default false. */
1782
+ streamEnabled?: boolean;
1783
+ /** Called for each new timeline entry — used by HQ publisher bridge. */
1784
+ onEntry?: ((entry: AgentTimelineEntry) => void) | undefined;
1785
+ }
1786
+ declare class AgentMonitorService {
1787
+ private _fleetBus;
1788
+ private readonly _events;
1789
+ private readonly _transcriptsDir;
1790
+ private readonly _maxEntries;
1791
+ private _streamEnabled;
1792
+ private _onEntry;
1793
+ /** Per-subagent virtual sessions. */
1794
+ private readonly _sessions;
1795
+ /** Disposers for FleetBus subscriptions, keyed by subagentId. */
1796
+ private readonly _subscriptions;
1797
+ /** Generic fleet-wide subscription disposer. */
1798
+ private _fleetDisposer;
1799
+ /** Track whether service is running. */
1800
+ private _started;
1801
+ constructor(opts: AgentMonitorOptions);
1802
+ /** Set the FleetBus to listen on. Must be called before `start()`. */
1803
+ setFleetBus(bus: FleetBus): void;
1804
+ get streamEnabled(): boolean;
1805
+ /** Enable/disable streaming agent conversations to the main chat timeline. */
1806
+ setStreamEnabled(enabled: boolean): void;
1807
+ /** Get a snapshot of all known agent sessions. */
1808
+ getAllSessions(): AgentVirtualSession[];
1809
+ /** Get a specific agent's virtual session, or undefined. */
1810
+ getSession(subagentId: string): AgentVirtualSession | undefined;
1811
+ /** Get transcript entries for a specific agent, newest first. */
1812
+ getTranscript(subagentId: string, limit?: number): AgentTimelineEntry[];
1813
+ /** Set a callback for each new timeline entry (HQ bridge). */
1814
+ setOnEntry(handler: ((entry: AgentTimelineEntry) => void) | undefined): void;
1815
+ /** Start listening to FleetBus events. */
1816
+ start(): void;
1817
+ /** Stop listening and clean up all subscriptions. */
1818
+ stop(): void;
1819
+ /** Ensure a subagent is being tracked. Called when a subagent spawns. */
1820
+ trackSubagent(subagentId: string, agentName: string, task?: string): void;
1821
+ /** Mark a subagent as completed/failed/etc. Called on subagent finish. */
1822
+ completeSubagent(subagentId: string, status: 'completed' | 'failed' | 'timeout' | 'stopped' | 'budget_exhausted', summary?: string): void;
1823
+ private _routeEvent;
1824
+ private _addEntry;
1825
+ private _appendToFile;
1826
+ private _uid;
1827
+ }
1828
+ declare function createAgentMonitorService(opts: AgentMonitorOptions): AgentMonitorService;
1829
+
1830
+ export { AgentDefinition, AgentHeartbeatInput, type AgentMonitorOptions, AgentMonitorService, AgentRegistrationInput, type AgentTimelineEntry, type AgentVirtualSession, type ApplyResult, type ApprovalDecision, AutonomousBrain, type AutonomousBrainOptions, AutonomousCoordinator, type AutonomousCoordinatorOptions, type AutonomousDecisionRequest, type AutonomousDecisionType, BUILD_AGENTS, BrainArbiter, BrainDecision, BrainDecisionOption, BrainDecisionRequest, BrainDecisionSource, type BrainInterventionInput, BrainMonitor, type BrainMonitorOptions, BrainRisk, type ChangeFile, ChangeManager, type ChangeManagerOptions, type ChangeNode, type ChangeProposal, type ChangeStatus, type ConsensusOptions, ConsensusProtocol, type ConsensusResult, type CoordinatorEvent, type CoordinatorStats, type DAGEdgeEvent, type DAGEdgeHandler, type DAGNode, type DAGNodeStatus, DEFAULT_QUALITY_CHECKS, DELIVERY_AGENTS, DEPENDENCY_FILE_PATTERNS, DISCOVERY_AGENTS, DOMAIN_AGENTS, type DecisionNode, type DecisionPrompt, DefaultMailbox, type DepWatchEntry, type DepWatcherBridgeOptions, type DependencyWatcherConfig, Director, type EscalationDecision, type FactCategory, type FactNode, FleetBus, FleetManager, type GoalNode, type GoalPriority, type GoalStatus, type GraphSubscription, KNOWLEDGE_AGENTS, KnowledgeGraph, type LLMProvider, META_AGENTS, type MailToolsOptions, Mailbox, MailboxAckInput, MailboxAgentStatus, type MailboxHooksOptions, MailboxMessage, MailboxQuery, type MailboxResolver, MailboxSendInput, type MailboxToolOptions, type NodeFilter, type NodeType, type OutdatedNotifyMessage, PLANNING_AGENTS, type PackageAuthorEntry, type PackageAuthorLog, type PackageAuthorTrackerOptions, type PackageOutdatedEntry, type PackageOutdatedResult, type PackageOutdatedWatcherOptions, type PrioritizationDecision, type QualityCheck, type QualityGateChecks, type QualityGateResult, type QuorumRule, REVIEW_AGENTS, type RollbackResult, type RunOptions, type RunnablesHandler, type SpawnDecision, type TaskAuctionOptions, TaskAuctioneer, type TaskBid, TaskDAG, VERIFY_AGENTS, type VoteNode, type VoteRecord, type VoteValue, type VoterConfig, attachDepWatcherBridge, createAgentMonitorService, createMailboxHooks, detectEcosystem, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, mailboxSessionTag, makeDependencyWatcherConfig, makeMailInboxTool, makeMailSendTool, makeMailboxTool, recordPackageAction, resolveMailboxIdentity, startPackageOutdatedWatcher, updatePackageOutdatedStatus };