@cognipeer/agent-sdk 0.14.0 → 0.16.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.
package/dist/index.d.ts CHANGED
@@ -525,6 +525,25 @@ interface HookMap {
525
525
  tokensAfter: number;
526
526
  /** Name of the strategy that produced it — `"builtin"` when no slot is filled. */
527
527
  strategy: string;
528
+ /**
529
+ * The summarizer's own model call — absent when it produced no call (a
530
+ * local fallback, or a strategy that reports none). It is a real, billed
531
+ * model call that never passes `pre/postModelCall`, so this is the only
532
+ * place an observer sees it.
533
+ */
534
+ call?: {
535
+ model?: string;
536
+ durationMs?: number;
537
+ usage?: {
538
+ inputTokens?: number;
539
+ outputTokens?: number;
540
+ cachedInputTokens?: number;
541
+ totalTokens?: number;
542
+ };
543
+ messagesCompressed?: number;
544
+ /** True when the model call failed and the summary was built locally. */
545
+ fallback?: boolean;
546
+ };
528
547
  };
529
548
  output: void;
530
549
  };
@@ -952,23 +971,57 @@ type SubagentPolicy = {
952
971
  childContextPolicy: ChildContextPolicy;
953
972
  /** Whether ad-hoc spawns may reference the parent's tools by name. */
954
973
  allowAdhocTools: boolean;
974
+ /**
975
+ * Forward the children's streamed text to the parent's `onStream` / `stream`
976
+ * events. Off by default: a host that appends `chunk.text` would print every
977
+ * child's words as if they were the parent's answer. When on, each forwarded
978
+ * chunk carries `subagentName` / `subagentId`.
979
+ */
980
+ streamChildren?: boolean;
955
981
  };
956
982
  declare const DEFAULT_SUBAGENT_POLICY: SubagentPolicy;
957
- /** Result of a single sub-agent run (returned to the model as the tool result). */
983
+ /**
984
+ * How a child run ended.
985
+ * - `ok` — finished and produced an answer.
986
+ * - `incomplete` — stopped early (a limit, the tool-call cap, no answer): `content` is partial.
987
+ * - `blocked` — refused by policy (a `subagentStart` gate or an output guardrail).
988
+ * - `needs_input` — wanted a human (parallel fan-out cannot ask).
989
+ * - `cancelled` — the run was cancelled while the child was working.
990
+ * - `error` — threw, or its structured output failed.
991
+ */
992
+ type SubagentStatus = "ok" | "incomplete" | "blocked" | "needs_input" | "cancelled" | "error";
993
+ /** Model calls a child made, in the parent's `state.usage` shape. */
994
+ type SubagentUsage = {
995
+ perRequest: NonNullable<AgentState["usage"]>["perRequest"];
996
+ totals: NonNullable<AgentState["usage"]>["totals"];
997
+ };
998
+ /**
999
+ * Result of a single sub-agent run. The model sees a projection of it
1000
+ * (`toModelResult`: no `input`, `usage` or `durationMs`); hosts get the whole
1001
+ * thing on `subagent` events, `subagentStop` observers and the registry.
1002
+ */
958
1003
  type SubagentResult = {
959
1004
  /** Sub-agent name (registry) or role (ad-hoc). */
960
1005
  name: string;
961
1006
  mode: "registry" | "adhoc";
962
- /** The input the sub-agent was tasked with. */
963
- input: string;
964
- /** Final assistant content from the child. */
1007
+ status: SubagentStatus;
1008
+ /** The input the sub-agent was tasked with. Not echoed to the model. */
1009
+ input?: string;
1010
+ /** Final assistant content from the child (partial unless `status` is `ok`). */
965
1011
  content?: string;
966
1012
  /** Parsed structured output, when the child had an `outputSchema`. */
967
1013
  output?: any;
968
1014
  /** Latest child summary, when summarization fired. */
969
1015
  summary?: string;
970
- /** Populated when the child failed or was refused by a guard. */
1016
+ /** Set when the child produced no usable result (`error`, `blocked`, `needs_input`). */
971
1017
  error?: string;
1018
+ /** Why a result is partial or cancelled. */
1019
+ note?: string;
1020
+ /**
1021
+ * The model calls this run made. Already merged into the parent's
1022
+ * `state.usage` (each entry tagged `subagent`), so a parent budget sees them.
1023
+ */
1024
+ usage?: SubagentUsage;
972
1025
  durationMs?: number;
973
1026
  };
974
1027
  /**
@@ -1563,6 +1616,13 @@ type StructuredSummary = {
1563
1616
  * the user explicitly revoked it (listed in `discarded_obsolete`).
1564
1617
  */
1565
1618
  user_directives?: string[];
1619
+ /**
1620
+ * Directive → the user's own words it came from, quoted verbatim from a user
1621
+ * message. A directive is only kept when it can be traced to something the
1622
+ * user said (see `summarization.groundDirectives`); the quote is what a later
1623
+ * pass checks again, and what an operator reads to see where it came from.
1624
+ */
1625
+ user_directive_sources?: Record<string, string>;
1566
1626
  stable_facts: SummaryFactItem[];
1567
1627
  active_goals: string[];
1568
1628
  open_questions: string[];
@@ -1595,6 +1655,14 @@ type SmartAgentSummarizationConfig = {
1595
1655
  promptTemplate?: string;
1596
1656
  toolFreeCall?: boolean;
1597
1657
  integrityCheck?: boolean;
1658
+ /**
1659
+ * Keep a `user_directives` entry only when it traces back to a USER message
1660
+ * (its quoted source is found there, or — for a summary that gave no quote —
1661
+ * most of its words are). Default true. A directive the summarizer made up,
1662
+ * or lifted from a tool output or from its own prompt, would otherwise be
1663
+ * rendered to every later turn as "still in force — follow them".
1664
+ */
1665
+ groundDirectives?: boolean;
1598
1666
  };
1599
1667
  type SmartAgentBudgetConfig = {
1600
1668
  systemReserveTokens?: number;
@@ -2210,6 +2278,12 @@ type TraceSessionRuntime = {
2210
2278
  sequenceOffset?: number;
2211
2279
  /** 1-based part number; 1 for a session that starts with this invoke. */
2212
2280
  part?: number;
2281
+ /**
2282
+ * Set once the session has been handed to its sink. A closed session takes no
2283
+ * more events: they would never be delivered (and, on a session continued by
2284
+ * the next invoke, would collide with its sequence numbers).
2285
+ */
2286
+ closed?: boolean;
2213
2287
  fileBaseDir?: string;
2214
2288
  fileSessionDir?: string;
2215
2289
  };
@@ -2259,6 +2333,12 @@ type AgentState = {
2259
2333
  timestamp: string;
2260
2334
  turn: number;
2261
2335
  cachedInput?: number;
2336
+ /** Present when a sub-agent made this call; it was merged in from the child's run. */
2337
+ subagent?: {
2338
+ name: string;
2339
+ id: string;
2340
+ mode: "registry" | "adhoc";
2341
+ };
2262
2342
  }>;
2263
2343
  totals: Record<string, {
2264
2344
  input: number;
@@ -2376,6 +2456,17 @@ type SummarizationEvent = {
2376
2456
  archivedCount?: number;
2377
2457
  structuredSummary?: StructuredSummary;
2378
2458
  integrity?: SummaryIntegrityCheck;
2459
+ /** Model that produced the summary. */
2460
+ model?: string;
2461
+ /** Directives the summarizer returned that were dropped, and why. */
2462
+ droppedDirectives?: DroppedDirective[];
2463
+ };
2464
+ /** A `user_directives` entry the grounding check refused. */
2465
+ type DroppedDirective = {
2466
+ directive: string;
2467
+ reason: "not_found_in_user_messages" | "source_quote_not_found";
2468
+ /** The quote the summarizer claimed, when it gave one. */
2469
+ sourceQuote?: string;
2379
2470
  };
2380
2471
  type EvalFamily = "recall" | "state_continuity" | "summarization_fidelity" | "context_rollover" | "query_focused_summary";
2381
2472
  type EvalCase = {
@@ -2616,8 +2707,14 @@ type SubagentEvent = {
2616
2707
  parallel?: boolean;
2617
2708
  /** Task input (on `start`). */
2618
2709
  input?: string;
2619
- /** Final content (on `result`). */
2710
+ /** Final content (on `result` / `error`; partial unless `status` is `ok`). */
2620
2711
  content?: string;
2712
+ /** How the child ended (on `result` and `error`). */
2713
+ status?: SubagentStatus;
2714
+ /** Why the outcome is partial or cancelled. */
2715
+ note?: string;
2716
+ /** The child's model calls (on `result` and `error`); already merged into the parent's usage. */
2717
+ usage?: SubagentUsage;
2621
2718
  error?: {
2622
2719
  message: string;
2623
2720
  };
@@ -2672,6 +2769,12 @@ type ProgressUpdate = {
2672
2769
  type StreamChunk = {
2673
2770
  text: string;
2674
2771
  isFinal?: boolean;
2772
+ /**
2773
+ * Set only on a sub-agent's chunk, and only when `subagentPolicy.streamChildren`
2774
+ * is on. A chunk without it is the top-level agent's own text.
2775
+ */
2776
+ subagentName?: string;
2777
+ subagentId?: string;
2675
2778
  };
2676
2779
  type InvokeConfig = RunnableConfig & {
2677
2780
  onEvent?: (event: SmartAgentEvent) => void;
@@ -2780,7 +2883,18 @@ type AgentInstance<TOutput = unknown> = {
2780
2883
  };
2781
2884
  type SmartAgentInstance<TOutput = unknown> = AgentInstance<TOutput>;
2782
2885
 
2783
- type SmartToolFn = (args: any) => Promise<any> | any;
2886
+ /**
2887
+ * Per-call context the tools node hands to a tool's `func` as its second
2888
+ * argument. Anything that must be true of THIS call (rather than of the tool
2889
+ * object, which sibling calls in the same turn share) belongs here.
2890
+ */
2891
+ type ToolCallContext = {
2892
+ /** The model's tool_call id for this exact call. */
2893
+ toolCallId?: string;
2894
+ cancellationToken?: any;
2895
+ signal?: AbortSignal;
2896
+ };
2897
+ type SmartToolFn = (args: any, context?: ToolCallContext) => Promise<any> | any;
2784
2898
  type ToolCachePolicy = {
2785
2899
  /** Cache scope. "run" persists for the current invoke only. */
2786
2900
  scope?: "run";
@@ -2851,6 +2965,8 @@ declare function createResolverNode(): (state: SmartState) => Promise<SmartState
2851
2965
 
2852
2966
  declare function createToolLimitFinalizeNode(_opts: SmartAgentOptions): (state: SmartState) => Promise<Partial<SmartState>>;
2853
2967
 
2968
+ /** ctx key: the last pass's model call, read (and removed) by the smart driver for `postCompact`. */
2969
+ declare const LAST_SUMMARIZATION_CALL_KEY = "__lastSummarizationCall";
2854
2970
  /**
2855
2971
  * Creates the summarization node.
2856
2972
  *
@@ -3147,13 +3263,15 @@ declare function withinDepth(currentDepth: number, policy: SubagentPolicy): {
3147
3263
  * context policy. Extracted so both `asTool` delegation and the sub-agent tools
3148
3264
  * share ONE implementation.
3149
3265
  *
3150
- * - `full` — entire parent transcript (minus its system prompt) + the input.
3151
- * - `scoped` — last user turn + the task input.
3152
- * - `minimal` — only the task input (default).
3266
+ * - `minimal` — only the task input.
3267
+ * - `scoped` — last user turn + the task input (default).
3268
+ * - `full` — entire parent transcript (minus its system prompt and the
3269
+ * current turn's unresolved tool_calls) + the task input.
3153
3270
  *
3154
- * The parent's system message is intentionally NOT carried over: the child agent
3155
- * composes its own system prompt from its `SubagentDef.systemPrompt` (or role),
3156
- * and leaking the parent's system message would suppress it.
3271
+ * `scoped` and `full` mark the transcript as background and the input as the
3272
+ * job. The parent's system message is intentionally NOT carried over: the child
3273
+ * agent composes its own system prompt from its `SubagentDef.systemPrompt` (or
3274
+ * role), and leaking the parent's system message would suppress it.
3157
3275
  */
3158
3276
  declare function seedChildMessages(policy: ChildContextPolicy, parentMessages: Message[], input: string): Message[];
3159
3277
  /**
@@ -3162,11 +3280,17 @@ declare function seedChildMessages(policy: ChildContextPolicy, parentMessages: M
3162
3280
  * or registry sub-agent can borrow a subset of the parent's capabilities.
3163
3281
  */
3164
3282
  declare function resolveSubagentTools(declared: SubagentDef["tools"] | string[] | undefined, parentTools: ToolInterface[]): Promise<ToolInterface[]>;
3165
- /** The cheap catalog block the model always sees in its system prompt. */
3283
+ /**
3284
+ * The cheap catalog block the model always sees in its system prompt: what it
3285
+ * can delegate to, how to write a task, and how to read what comes back.
3286
+ */
3166
3287
  declare function buildSubagentCatalogBlock(subagents: SubagentDef[], policy: SubagentPolicy, toolNames: {
3167
3288
  delegate: string;
3168
3289
  spawn: string;
3169
3290
  parallel: string;
3291
+ }, opts?: {
3292
+ parentToolNames?: string[];
3293
+ askUser?: boolean;
3170
3294
  }): string;
3171
3295
 
3172
3296
  /**
@@ -3177,6 +3301,10 @@ declare function buildSubagentCatalogBlock(subagents: SubagentDef[], policy: Sub
3177
3301
  * with createSmartAgent), and forward events/streaming/cancellation into each
3178
3302
  * child. Human-in-the-loop pauses inside a sequential child are surfaced to the
3179
3303
  * parent and resumed via `state.ctx.__subagentPending`.
3304
+ *
3305
+ * The `_stateRef` is shared by every call of a tool in a turn, so a call's own
3306
+ * identity (its tool_call id) comes from the per-call context the tools node
3307
+ * passes to `func`, never from the ref.
3180
3308
  */
3181
3309
  /** Config a child agent is built from. The factory lives in createSmartAgent. */
3182
3310
  type BuildChildConfig = {
@@ -3186,6 +3314,13 @@ type BuildChildConfig = {
3186
3314
  tools: ToolInterface[];
3187
3315
  outputSchema?: any;
3188
3316
  limits?: any;
3317
+ /**
3318
+ * Whether a question the child asks reaches a human: true under `delegate_to` /
3319
+ * `spawn_subagent` (the pause is surfaced and resumed), false in a parallel
3320
+ * fan-out (it ends the task as `needs_input`). Decides how the child is told
3321
+ * about asking.
3322
+ */
3323
+ interactive: boolean;
3189
3324
  };
3190
3325
  type SubagentToolDeps = {
3191
3326
  registryRef: SubagentRegistryRef;
@@ -3199,7 +3334,16 @@ type SubagentToolDeps = {
3199
3334
  spawn?: string;
3200
3335
  parallel?: string;
3201
3336
  };
3337
+ /** Names of the parent's tools an ad-hoc child may borrow, listed to the model. */
3338
+ parentToolNames?: string[];
3339
+ /** True when the parent has `humanInTheLoop.askUser`, which its children inherit. */
3340
+ canAskUser?: boolean;
3202
3341
  };
3342
+ /**
3343
+ * What the model is shown of a result: no `input` (it wrote it), no `usage` or
3344
+ * `durationMs` (bookkeeping for the host, tokens for the model to spend).
3345
+ */
3346
+ declare function toModelResult(result: SubagentResult): Omit<SubagentResult, "input" | "usage" | "durationMs">;
3203
3347
  declare function createDelegateTool(deps: SubagentToolDeps): ToolInterface;
3204
3348
  declare function createSpawnTool(deps: SubagentToolDeps): ToolInterface;
3205
3349
  declare function createParallelTool(deps: SubagentToolDeps): ToolInterface;
@@ -4329,6 +4473,18 @@ type SessionMetrics = {
4329
4473
  totalTokens: number;
4330
4474
  /** Present only when a `costEstimator` was configured. */
4331
4475
  estimatedCostUsd?: number;
4476
+ /**
4477
+ * What sub-agents spent during this run, kept apart from the figures above:
4478
+ * each child opens its own session and reports its own record, so folding
4479
+ * them in would count every child token twice in a pipeline that sums runs.
4480
+ * Present only when the run delegated.
4481
+ */
4482
+ subagentCalls?: number;
4483
+ subagentInputTokens?: number;
4484
+ subagentOutputTokens?: number;
4485
+ subagentTotalTokens?: number;
4486
+ /** Present only with a `costEstimator` and sub-agent calls. */
4487
+ subagentEstimatedCostUsd?: number;
4332
4488
  /** Executions per tool name. Opt-in — a wide tool menu makes this unbounded. */
4333
4489
  toolBreakdown?: Record<string, number>;
4334
4490
  };
@@ -5413,6 +5569,12 @@ declare function buildToolDefinitionsSection(toolDefinitions: Array<{
5413
5569
  * Exported for provider/node code that assembles sections itself.
5414
5570
  */
5415
5571
  declare function buildResponseFormatSection(responseFormat: Record<string, any> | undefined, strategy?: "native" | "tool_based"): TraceResponseFormatSection | undefined;
5572
+ /**
5573
+ * The message sections `recordTraceEvent` builds from a `messageList`, for a
5574
+ * caller that needs them next to sections of its own (an event takes either
5575
+ * `sections` or `messageList`, not both).
5576
+ */
5577
+ declare function traceSectionsFromMessages(messageList?: any[]): TraceDataSection[];
5416
5578
  /**
5417
5579
  * Reads a `ctx.__traceContinuation` value back, or undefined when it is not
5418
5580
  * one. It arrives from caller-persisted state, so every field is checked.
@@ -5425,6 +5587,83 @@ declare function traceContinuationOf(session: TraceSessionRuntime): TraceContinu
5425
5587
  * This sends the session start to the remote endpoint immediately.
5426
5588
  */
5427
5589
  declare function startStreamingSession(session: TraceSessionRuntime | undefined, agentRuntime?: AgentRuntimeConfig): Promise<void>;
5590
+ declare function recordTraceEvent(session: TraceSessionRuntime | undefined, event: {
5591
+ type: string;
5592
+ label?: string;
5593
+ timestamp?: string;
5594
+ actor?: TraceEventRecord["actor"];
5595
+ status?: TraceEventRecord["status"];
5596
+ /** Explicit parent span ID. Falls back to session.currentIterationSpanId when omitted. */
5597
+ parentSpanId?: string;
5598
+ durationMs?: number;
5599
+ inputTokens?: number;
5600
+ outputTokens?: number;
5601
+ totalTokens?: number;
5602
+ cachedInputTokens?: number;
5603
+ /** Subset of `outputTokens` spent on reasoning (see TraceEventRecord). */
5604
+ reasoningTokens?: number;
5605
+ /** Why the model stopped — `length` explains most truncated JSON. */
5606
+ finishReason?: string;
5607
+ requestBytes?: number;
5608
+ responseBytes?: number;
5609
+ model?: string;
5610
+ provider?: string;
5611
+ toolDetails?: TraceEventRecord["toolDetails"];
5612
+ toolExecutionId?: string;
5613
+ retryOf?: string;
5614
+ error?: {
5615
+ message: string;
5616
+ stack?: string;
5617
+ } | null;
5618
+ messageList?: any[];
5619
+ /** Pre-built sections to use instead of auto-converting messageList */
5620
+ sections?: TraceDataSection[];
5621
+ /**
5622
+ * Tool MENU bound to this model call (`ai_call` events). Appended as a
5623
+ * `tool_definitions` section AFTER messageList/sections resolution, so it
5624
+ * composes with the auto-converted message sections instead of replacing
5625
+ * them. Size-capped; suppressed when logData is off.
5626
+ */
5627
+ toolDefinitions?: Array<{
5628
+ name: string;
5629
+ description?: string;
5630
+ parameters?: Record<string, any>;
5631
+ }>;
5632
+ /**
5633
+ * Structured-output CONTRACT bound to this model call (`ai_call` events),
5634
+ * appended as a `response_format` section next to the tool menu. Accepts
5635
+ * the `{ response_format: … }` invoke-options envelope or a bare
5636
+ * response_format object. Size-capped; suppressed when logData is off.
5637
+ */
5638
+ responseFormat?: Record<string, any>;
5639
+ /** Which structured-output strategy produced `responseFormat`. */
5640
+ responseFormatStrategy?: "native" | "tool_based";
5641
+ debug?: Record<string, any>;
5642
+ }): TraceEventRecord | undefined;
5643
+ /** An event held for the next trace session: the same input `recordTraceEvent` takes. */
5644
+ type DeferredTraceEvent = Parameters<typeof recordTraceEvent>[1];
5645
+ /**
5646
+ * True when `session` still accepts events. The smart agent runs a turn as
5647
+ * several invokes ("legs") and does its own work — context summarization — in
5648
+ * between them; at that point the previous leg has already handed its session
5649
+ * to the sink, and the next leg has not opened one yet.
5650
+ */
5651
+ declare function isTraceSessionOpen(session: TraceSessionRuntime | undefined): session is TraceSessionRuntime;
5652
+ /**
5653
+ * Records `event` into the open session on `ctx`, or — when there is none —
5654
+ * returns a copy of `ctx` holding it for the next invoke to record. Returns
5655
+ * undefined when nothing on ctx changed (recorded, or tracing is off).
5656
+ */
5657
+ declare function recordOrDeferTraceEvent(ctx: Record<string, any> | undefined, event: DeferredTraceEvent, options: {
5658
+ tracingEnabled: boolean;
5659
+ }): Record<string, any> | undefined;
5660
+ /**
5661
+ * Records events another invoke held for this one (see `recordOrDeferTraceEvent`),
5662
+ * in the order they happened. They keep their own timestamps; they get this
5663
+ * session's next sequence numbers, which is where they belong — after what the
5664
+ * previous leg recorded, before anything this one does.
5665
+ */
5666
+ declare function replayDeferredTraceEvents(session: TraceSessionRuntime | undefined, deferred: unknown): void;
5428
5667
 
5429
5668
  /** True when the model's rule uses `thinking:{type:"adaptive"}` + `output_config.effort` (Claude 4.6+ / 5.x). */
5430
5669
  declare function supportsAdaptiveThinking(model: unknown): boolean;
@@ -5745,4 +5984,4 @@ declare class ModelRequestError extends ProviderError {
5745
5984
  constructor(init: ModelRequestErrorInit);
5746
5985
  }
5747
5986
 
5748
- export { type AIMessage, ASK_USER_TOOL_NAME, type AgentInstance, type AgentInvokeResult, type AgentLimits, type AgentOptions, type AgentPlugin, type AgentRuleOptions, type AgentRuntimeConfig, type AgentSnapshot, type AgentSnapshotMetadata, type AgentState, AnthropicProvider, AnthropicProviderConfig, type ApprovalTransport, type AuditEntry, type AuditLogConfig, type AzureContentSafetyConfig, AzureProvider, AzureProviderConfig, type BaseChatMessage, type BaseChatMessagePart, type BaseChatModel, type BaseMessage, BaseProvider, type BedrockGuardrailConfig, BedrockProvider, BedrockProviderConfig, type BudgetGuardConfig, type BuildChildConfig, type BuiltInRuntimeProfile, CCRStore, CONSOLE_HOOK_MAP, CONTEXT_PILOT_JSON_MARKER_KEY, CONTROL_PLANE_TOOL_NAMES, type CancellationTokenLike, type CancelledEvent, type CapabilityStatus, ChatCompletionChunk, ChatCompletionRequest, ChatCompletionResponse, type CheckpointPluginConfig, type CheckpointStore, type ChildContextPolicy, type CodeDetectionRuleOptions, type CodeGuardrailOptions, type CognipeerGuardrailConfig, type CompressToolOutputParams, type ContextBuilder, type ContextPilotCCRConfig, type ContextPilotCacheAlignmentConfig, type ContextPilotCompressionConfig, type ContextPilotCompressionStats, type ContextPilotCompressorKind, type ContextPilotConfig, type ContextPilotDedupConfig, type ContextPilotDiffCompressionConfig, type ContextPilotJsonCompressionConfig, type ContextPilotLogCompressionConfig, type ContextPilotResult, type ContextPilotRuntime, type ContextPilotSearchCompressionConfig, type ContextPilotTextCompressionConfig, type ContextPolicy, type ContextToolsStateRef, type ConversationGuardrail, type ConversationPluginConfig, type ConversationStore, type CostEstimator, type CustomRuleCallback, type CustomRuleOptions, DEFAULT_MAX_TOOL_INPUT_FIELD_CHARS, DEFAULT_PROFILE_CONFIGS, DEFAULT_SKILL_POLICY, DEFAULT_SUBAGENT_POLICY, DEFAULT_SUBAGENT_TOOL_NAMES, DEFAULT_TOOL_INPUT_DIGEST_HEAD_CHARS, DELEGATION_TOOL_NAMES, DedupTracker, type DelegationEventStamp, type DelegationMode, EmbeddingRequest, EmbeddingResponse, type EvalCase, type EvalCaseResult, type EvalFamily, type EvalHarnessMetrics, type EvalHarnessParams, type EvalHarnessResult, type EvalProfileDescriptor, type EvalProfileTarget, type FinalAnswerEvent, type GateResult, type GuardrailCallContext, type GuardrailContext, type GuardrailDisposition, type GuardrailEvent, type GuardrailIncident, type GuardrailJudgeEngine, type GuardrailOutcome, GuardrailPhase, type GuardrailPhaseName, type GuardrailPluginOptions, type GuardrailRequest, type GuardrailRule, type GuardrailRuleResult, type GuardrailTransport, type GuardrailVerdict, type GuardrailViolation, HOOK_CONTRACT_VERSION, HOOK_NAMES, type HandoffDescriptor, type HandoffEvent, type HookContext, type HookDecision, type HookHandler, type HookMap, type HookName, type HookRegistrations, HookTimeoutError, type HttpGuardrailOptions, type HumanInTheLoopAskUserConfig, type HumanInTheLoopOptions, type HumanInTheLoopRuntimeConfig, InMemoryMemoryStore, type InjectionScan, type InvokeConfig, type JevClientLike, type JevEngineOptions, type JevNoulAnswer, JevProvider, JevProviderConfig, type JevQuestion, type JevSystemOneRequest, type JevSystemOneResult, type JsonGuardrailOptions, type JsonSchemaRuleOptions, type LangfuseBuildContext, type LangfuseEvent, type LangfuseEventKind, type LangfuseTracingConfig, type LanguageGuardConfig, type LoadSkillsOptions, type MaybePromise, type McpConfig, type McpConnection, type MediaAttachment, type MediaKind$1 as MediaKind, type MediaPolicyConfig, type MemoryFact, type MemoryProviderKind, type MemoryReadPolicy, type MemoryScope, type MemoryStore, type MemoryWritePolicy, type Message, type MessageUsage, type MetadataEvent, type ModelCapabilities, ModelRequestError, type ModelRequestErrorCode, type ModelRequestErrorInit, ModelRuleLearnedEvent, NativeJsonSchemaStrategy, type NativeModelOptions, type NativeReasoningConfig, OpenAICompatibleProvider, OpenAICompatibleProviderConfig, type OpenAIModerationConfig, OpenAIProvider, OpenAIProviderConfig, type OtelTracingConfig, type OutputGuardConfig, PREOPEN_TOOL_CALL_PREFIX, type PendingToolApproval, type PendingUserQuestion, type PiiDetector, type PiiEntity, type PiiRedactionConfig, type PlanEvent, type PlanStepRecord, type PlanningMode, type PluginContributions, type PluginEvent, type PluginFailureMode, type PluginHost, type PluginHostOptions, type PluginLogger, type PluginProvides, type PluginRunHost, type PluginSetupContext, type PortkeyGatewayConfig, type PortkeyGuardrailConfig, type PreopenSkillsResult, type ProfileConfig, type ProgressEvent, type ProgressUpdate, type PromptHooks, type PromptInjectionFamily, type PromptInjectionGuardConfig, type PromptSource, ProviderConfig, ProviderError, ToolDefinition as ProviderToolDefinition, ProviderType, type RateLimitConfig, type ReasoningConfig, type ReasoningLevel, type RedactionResult, type ReflectionCadence, type ReflectionConfig, type ReflectionEvent, type ReflectionHookContext, type ReflectionRecord, type RegexGuardrailConfig, type RegexGuardrailOptions, type RegexRuleOptions, type ReplanPolicy, type ResolvedContextPilotConfig, type ResolvedSmartAgentConfig, type ResolvedTraceConfig, type ResolvedTraceSink, type ResponseCacheConfig, type RestoreSnapshotOptions, RulePatch, type RuntimeProfile, SMALL_TIER_SKILL_POLICY, type SdkCapabilities, type SerializableSmartState, type SessionMetrics, type SessionMetricsConfig, type Skill, type SkillDisclosure, type SkillExecutionContext, type SkillFrontmatter, type SkillFs, type SkillModelTier, type SkillPolicy, type SkillRegistryRef, type SkillSource, type SkillToolDeps, type SkillToolHeader, type SlotName, type SmartAgentBudgetConfig, type SmartAgentContextConfig, type SmartAgentCustomProfileConfig, type SmartAgentDelegationConfig, type SmartAgentEvent, type SmartAgentInstance, type SmartAgentLimits, type SmartAgentMemoryConfig, type SmartAgentOptions, type SmartAgentPlanningConfig, type SmartAgentSummarizationConfig, type SmartAgentToolResponseConfig, type SmartAgentTracingConfig, type SmartModel, type SmartState, type SmartToolFn, type SnapshotOptions, type SnapshotRuntimeHint, type StreamChunk, type StreamEvent, type StrictRestorers, type StrictTransform, type StructuredOutputError, type StructuredOutputFieldError, StructuredOutputManager, type StructuredOutputManagerConfig, type StructuredOutputResult, type StructuredOutputStrategy, type StructuredSummary, type SubagentDef, type SubagentEvent, type SubagentMode, type SubagentPendingRecord, type SubagentPolicy, type SubagentRegistryRef, type SubagentResult, type SubagentToolDeps, type SubagentToolNames, type SummarizationEvent, type SummarizationMode, type SummarizerInput, type SummarizerResult, type SummarizerStrategy, type SummaryFactItem, type SummaryIntegrityCheck, TOOL_INPUT_DIGEST_KEY, type TokenCounter, TokenUsage, type ToolApprovalEvent, type ToolApprovalResolution, type ToolApprovalStatus, ToolBasedStrategy, type ToolCachePolicy, type ToolCallEvent, type ToolInputDigestOptions, type ToolInputDigestResult, type ToolInputRetentionPolicy, type ToolInterface, type ToolPolicyConfig, type ToolResponseClassification, type ToolResponseRetentionPolicy, type ToolRetentionDeclarations, type ToolRetentionSpec, type ToolRetryPolicy, type ToolRule, type TraceContinuation, type TraceDataSection, type TraceErrorRecord, type TraceEventRecord, type TraceMessagePart, type TraceMessageSection, type TraceMetadataSection, type TraceSessionConfigSnapshot, type TraceSessionFile, type TraceSessionStatus, type TraceSessionSummary, type TraceSinkCognipeerConfig, type TraceSinkConfig, type TraceSinkCustomConfig, type TraceSinkFileConfig, type TraceSinkHttpConfig, type TraceSinkOtlpConfig, type TraceSinkSnapshot, type TraceSummarySection, type TraceToolCallSection, type TraceToolDefinition, type TraceToolDefinitionsSection, type TraceToolDetails, type TraceToolResponseSection, type TraceToolResultSection, type TracingConfig, type TracingMode, UnifiedMessage, type UserQuestionAnswer, type UserQuestionAnswerSet, type UserQuestionEvent, type UserQuestionItem, type UserQuestionOption, type UserQuestionResolution, type UserQuestionStatus, VertexProvider, VertexProviderConfig, type VolatileContentFinding, type VolatileContentPattern, type WebhookApprovalConfig, agentVerdictRule, appendBoundTools, auditLog, azureContentSafety, bedrockGuardrail, budgetGuard, buildHandoffTools, buildResponseFormatSection, buildSkillHeaderBlock, buildSubagentCatalogBlock, buildSystemPrompt, buildToolDefinitionsSection, canOpenSkill, canSpawn, captureSnapshot, checkpointing, codePresenceRule, coerceToolArgs, cognipeerGuardrail, cognipeerSink, collectAttachments, collectToolRetentionDeclarations, composeToolSets, compressDiffOutput, compressJsonOutput, compressLogOutput, compressSearchOutput, compressTextOutput, compressToolOutput, contentPartToText, contentToString, conversationHistory, countApproxTokens, countMessagesTokens, createAgent, createAgentNode, createAskUserQuestionTool, createBindSkillToolsTool, createCodeGuardrail, createContextPilotRuntime, createContextSummarizeNode, createContextTools, createDelegateTool, createGetToolResponseTool, createGuardrail, createGuardrailPlugin, createJsonGuardrail, createManageTodoListAliasTool, createManageTodoTool, createOpenSkillTool, createParallelTool, createPluginHost, createProvider, createRegexGuardrail, createResolverNode, createSearchSkillsTool, createSkillRegistryRef, createSkillTools, createSmartAgent, createSpawnTool, createSubagentRegistryRef, createSubagentTools, createTool, createToolLimitFinalizeNode, createToolsNode, customCallbackRule, customGuardrail, customSink, dedupeToolsByName, defaultTokenCounter, defineHook, definePlugin, describeContentPart, detectLanguage, detectTextFormat, detectVolatileContent, digestToolInputArguments, digestToolInputValue, evaluateGuardrails, extractLatestUserQuery, extractMessageText, fileCheckpointStore, fileSink, findSubagent, formatZodError, fromLangchainModel, fromLangchainTools, fromNativeProvider, generateSpanId, generateTraceId, getModelCapabilities, getNestedValue, getResolvedSmartConfig, getTokenCounter, hasMediaPart, hasToolResponseRecoveryReference, httpGuardrail, httpSink, inMemoryCheckpointStore, inMemoryConversationStore, isHookImplemented, isOpenAIHostedEndpoint, isSmartModel, isValidIban, isValidLuhn, isValidTckn, jsonSchemaRule, defaultBuildPayload as langfuseDefaultPayload, langfuseTracing, languageGuard, loadSkillsFromDisk, mapConsoleHookVerdict, mapTextParts, mcp, mediaKindOf, mediaPolicy, normalizeSmartAgentOptions, normalizeVerdicts, openAIModeration, otelTracing, otlpSink, outputGuard, parseApprovalDecision, parseSkillFrontmatter, pathSandbox, piiRedaction, pluginCapabilities, portkeyGateway, portkeyGuardrail, preopenSkills, preopenToolCallId, prepareStrictToolMenu, promptInjectionGuard, rateLimit, readMemoryFacts, readTraceContinuation, redactText, regexGuardrail, regexRule, replaceTextContent, resolveAvailableSkills, resolveAvailableSubagents, resolveInputRetention, resolveMemoryStore, resolveReasoning, resolveStrategy, resolveSubagentTools, resolveSummarizationRetention, resolveToolApprovalState, resolveUserQuestionState, responseCache, restoreSnapshot, restoreToolCalls, runSmartAgentEvalHarness, scoreItemsByRelevance, searchSkills, seedChildMessages, selectTopIndicesInOrder, sessionMetrics, setTokenCounter, startStreamingSession, summarizeObject, supportsAdaptiveThinking, textFromContent, toMessageUsage, toStrictCompatible, toStrictToolSchema, tokenize, toolPolicy, traceContinuationOf, traceSessionToOtlp, validateReasoningConfig, validateToolArgs, webhookApproval, withTools, withinDepth, writeSummaryFactsToMemory };
5987
+ export { type AIMessage, ASK_USER_TOOL_NAME, type AgentInstance, type AgentInvokeResult, type AgentLimits, type AgentOptions, type AgentPlugin, type AgentRuleOptions, type AgentRuntimeConfig, type AgentSnapshot, type AgentSnapshotMetadata, type AgentState, AnthropicProvider, AnthropicProviderConfig, type ApprovalTransport, type AuditEntry, type AuditLogConfig, type AzureContentSafetyConfig, AzureProvider, AzureProviderConfig, type BaseChatMessage, type BaseChatMessagePart, type BaseChatModel, type BaseMessage, BaseProvider, type BedrockGuardrailConfig, BedrockProvider, BedrockProviderConfig, type BudgetGuardConfig, type BuildChildConfig, type BuiltInRuntimeProfile, CCRStore, CONSOLE_HOOK_MAP, CONTEXT_PILOT_JSON_MARKER_KEY, CONTROL_PLANE_TOOL_NAMES, type CancellationTokenLike, type CancelledEvent, type CapabilityStatus, ChatCompletionChunk, ChatCompletionRequest, ChatCompletionResponse, type CheckpointPluginConfig, type CheckpointStore, type ChildContextPolicy, type CodeDetectionRuleOptions, type CodeGuardrailOptions, type CognipeerGuardrailConfig, type CompressToolOutputParams, type ContextBuilder, type ContextPilotCCRConfig, type ContextPilotCacheAlignmentConfig, type ContextPilotCompressionConfig, type ContextPilotCompressionStats, type ContextPilotCompressorKind, type ContextPilotConfig, type ContextPilotDedupConfig, type ContextPilotDiffCompressionConfig, type ContextPilotJsonCompressionConfig, type ContextPilotLogCompressionConfig, type ContextPilotResult, type ContextPilotRuntime, type ContextPilotSearchCompressionConfig, type ContextPilotTextCompressionConfig, type ContextPolicy, type ContextToolsStateRef, type ConversationGuardrail, type ConversationPluginConfig, type ConversationStore, type CostEstimator, type CustomRuleCallback, type CustomRuleOptions, DEFAULT_MAX_TOOL_INPUT_FIELD_CHARS, DEFAULT_PROFILE_CONFIGS, DEFAULT_SKILL_POLICY, DEFAULT_SUBAGENT_POLICY, DEFAULT_SUBAGENT_TOOL_NAMES, DEFAULT_TOOL_INPUT_DIGEST_HEAD_CHARS, DELEGATION_TOOL_NAMES, DedupTracker, type DeferredTraceEvent, type DelegationEventStamp, type DelegationMode, type DroppedDirective, EmbeddingRequest, EmbeddingResponse, type EvalCase, type EvalCaseResult, type EvalFamily, type EvalHarnessMetrics, type EvalHarnessParams, type EvalHarnessResult, type EvalProfileDescriptor, type EvalProfileTarget, type FinalAnswerEvent, type GateResult, type GuardrailCallContext, type GuardrailContext, type GuardrailDisposition, type GuardrailEvent, type GuardrailIncident, type GuardrailJudgeEngine, type GuardrailOutcome, GuardrailPhase, type GuardrailPhaseName, type GuardrailPluginOptions, type GuardrailRequest, type GuardrailRule, type GuardrailRuleResult, type GuardrailTransport, type GuardrailVerdict, type GuardrailViolation, HOOK_CONTRACT_VERSION, HOOK_NAMES, type HandoffDescriptor, type HandoffEvent, type HookContext, type HookDecision, type HookHandler, type HookMap, type HookName, type HookRegistrations, HookTimeoutError, type HttpGuardrailOptions, type HumanInTheLoopAskUserConfig, type HumanInTheLoopOptions, type HumanInTheLoopRuntimeConfig, InMemoryMemoryStore, type InjectionScan, type InvokeConfig, type JevClientLike, type JevEngineOptions, type JevNoulAnswer, JevProvider, JevProviderConfig, type JevQuestion, type JevSystemOneRequest, type JevSystemOneResult, type JsonGuardrailOptions, type JsonSchemaRuleOptions, LAST_SUMMARIZATION_CALL_KEY, type LangfuseBuildContext, type LangfuseEvent, type LangfuseEventKind, type LangfuseTracingConfig, type LanguageGuardConfig, type LoadSkillsOptions, type MaybePromise, type McpConfig, type McpConnection, type MediaAttachment, type MediaKind$1 as MediaKind, type MediaPolicyConfig, type MemoryFact, type MemoryProviderKind, type MemoryReadPolicy, type MemoryScope, type MemoryStore, type MemoryWritePolicy, type Message, type MessageUsage, type MetadataEvent, type ModelCapabilities, ModelRequestError, type ModelRequestErrorCode, type ModelRequestErrorInit, ModelRuleLearnedEvent, NativeJsonSchemaStrategy, type NativeModelOptions, type NativeReasoningConfig, OpenAICompatibleProvider, OpenAICompatibleProviderConfig, type OpenAIModerationConfig, OpenAIProvider, OpenAIProviderConfig, type OtelTracingConfig, type OutputGuardConfig, PREOPEN_TOOL_CALL_PREFIX, type PendingToolApproval, type PendingUserQuestion, type PiiDetector, type PiiEntity, type PiiRedactionConfig, type PlanEvent, type PlanStepRecord, type PlanningMode, type PluginContributions, type PluginEvent, type PluginFailureMode, type PluginHost, type PluginHostOptions, type PluginLogger, type PluginProvides, type PluginRunHost, type PluginSetupContext, type PortkeyGatewayConfig, type PortkeyGuardrailConfig, type PreopenSkillsResult, type ProfileConfig, type ProgressEvent, type ProgressUpdate, type PromptHooks, type PromptInjectionFamily, type PromptInjectionGuardConfig, type PromptSource, ProviderConfig, ProviderError, ToolDefinition as ProviderToolDefinition, ProviderType, type RateLimitConfig, type ReasoningConfig, type ReasoningLevel, type RedactionResult, type ReflectionCadence, type ReflectionConfig, type ReflectionEvent, type ReflectionHookContext, type ReflectionRecord, type RegexGuardrailConfig, type RegexGuardrailOptions, type RegexRuleOptions, type ReplanPolicy, type ResolvedContextPilotConfig, type ResolvedSmartAgentConfig, type ResolvedTraceConfig, type ResolvedTraceSink, type ResponseCacheConfig, type RestoreSnapshotOptions, RulePatch, type RuntimeProfile, SMALL_TIER_SKILL_POLICY, type SdkCapabilities, type SerializableSmartState, type SessionMetrics, type SessionMetricsConfig, type Skill, type SkillDisclosure, type SkillExecutionContext, type SkillFrontmatter, type SkillFs, type SkillModelTier, type SkillPolicy, type SkillRegistryRef, type SkillSource, type SkillToolDeps, type SkillToolHeader, type SlotName, type SmartAgentBudgetConfig, type SmartAgentContextConfig, type SmartAgentCustomProfileConfig, type SmartAgentDelegationConfig, type SmartAgentEvent, type SmartAgentInstance, type SmartAgentLimits, type SmartAgentMemoryConfig, type SmartAgentOptions, type SmartAgentPlanningConfig, type SmartAgentSummarizationConfig, type SmartAgentToolResponseConfig, type SmartAgentTracingConfig, type SmartModel, type SmartState, type SmartToolFn, type SnapshotOptions, type SnapshotRuntimeHint, type StreamChunk, type StreamEvent, type StrictRestorers, type StrictTransform, type StructuredOutputError, type StructuredOutputFieldError, StructuredOutputManager, type StructuredOutputManagerConfig, type StructuredOutputResult, type StructuredOutputStrategy, type StructuredSummary, type SubagentDef, type SubagentEvent, type SubagentMode, type SubagentPendingRecord, type SubagentPolicy, type SubagentRegistryRef, type SubagentResult, type SubagentStatus, type SubagentToolDeps, type SubagentToolNames, type SubagentUsage, type SummarizationEvent, type SummarizationMode, type SummarizerInput, type SummarizerResult, type SummarizerStrategy, type SummaryFactItem, type SummaryIntegrityCheck, TOOL_INPUT_DIGEST_KEY, type TokenCounter, TokenUsage, type ToolApprovalEvent, type ToolApprovalResolution, type ToolApprovalStatus, ToolBasedStrategy, type ToolCachePolicy, type ToolCallContext, type ToolCallEvent, type ToolInputDigestOptions, type ToolInputDigestResult, type ToolInputRetentionPolicy, type ToolInterface, type ToolPolicyConfig, type ToolResponseClassification, type ToolResponseRetentionPolicy, type ToolRetentionDeclarations, type ToolRetentionSpec, type ToolRetryPolicy, type ToolRule, type TraceContinuation, type TraceDataSection, type TraceErrorRecord, type TraceEventRecord, type TraceMessagePart, type TraceMessageSection, type TraceMetadataSection, type TraceSessionConfigSnapshot, type TraceSessionFile, type TraceSessionStatus, type TraceSessionSummary, type TraceSinkCognipeerConfig, type TraceSinkConfig, type TraceSinkCustomConfig, type TraceSinkFileConfig, type TraceSinkHttpConfig, type TraceSinkOtlpConfig, type TraceSinkSnapshot, type TraceSummarySection, type TraceToolCallSection, type TraceToolDefinition, type TraceToolDefinitionsSection, type TraceToolDetails, type TraceToolResponseSection, type TraceToolResultSection, type TracingConfig, type TracingMode, UnifiedMessage, type UserQuestionAnswer, type UserQuestionAnswerSet, type UserQuestionEvent, type UserQuestionItem, type UserQuestionOption, type UserQuestionResolution, type UserQuestionStatus, VertexProvider, VertexProviderConfig, type VolatileContentFinding, type VolatileContentPattern, type WebhookApprovalConfig, agentVerdictRule, appendBoundTools, auditLog, azureContentSafety, bedrockGuardrail, budgetGuard, buildHandoffTools, buildResponseFormatSection, buildSkillHeaderBlock, buildSubagentCatalogBlock, buildSystemPrompt, buildToolDefinitionsSection, canOpenSkill, canSpawn, captureSnapshot, checkpointing, codePresenceRule, coerceToolArgs, cognipeerGuardrail, cognipeerSink, collectAttachments, collectToolRetentionDeclarations, composeToolSets, compressDiffOutput, compressJsonOutput, compressLogOutput, compressSearchOutput, compressTextOutput, compressToolOutput, contentPartToText, contentToString, conversationHistory, countApproxTokens, countMessagesTokens, createAgent, createAgentNode, createAskUserQuestionTool, createBindSkillToolsTool, createCodeGuardrail, createContextPilotRuntime, createContextSummarizeNode, createContextTools, createDelegateTool, createGetToolResponseTool, createGuardrail, createGuardrailPlugin, createJsonGuardrail, createManageTodoListAliasTool, createManageTodoTool, createOpenSkillTool, createParallelTool, createPluginHost, createProvider, createRegexGuardrail, createResolverNode, createSearchSkillsTool, createSkillRegistryRef, createSkillTools, createSmartAgent, createSpawnTool, createSubagentRegistryRef, createSubagentTools, createTool, createToolLimitFinalizeNode, createToolsNode, customCallbackRule, customGuardrail, customSink, dedupeToolsByName, defaultTokenCounter, defineHook, definePlugin, describeContentPart, detectLanguage, detectTextFormat, detectVolatileContent, digestToolInputArguments, digestToolInputValue, evaluateGuardrails, extractLatestUserQuery, extractMessageText, fileCheckpointStore, fileSink, findSubagent, formatZodError, fromLangchainModel, fromLangchainTools, fromNativeProvider, generateSpanId, generateTraceId, getModelCapabilities, getNestedValue, getResolvedSmartConfig, getTokenCounter, hasMediaPart, hasToolResponseRecoveryReference, httpGuardrail, httpSink, inMemoryCheckpointStore, inMemoryConversationStore, isHookImplemented, isOpenAIHostedEndpoint, isSmartModel, isTraceSessionOpen, isValidIban, isValidLuhn, isValidTckn, jsonSchemaRule, defaultBuildPayload as langfuseDefaultPayload, langfuseTracing, languageGuard, loadSkillsFromDisk, mapConsoleHookVerdict, mapTextParts, mcp, mediaKindOf, mediaPolicy, normalizeSmartAgentOptions, normalizeVerdicts, openAIModeration, otelTracing, otlpSink, outputGuard, parseApprovalDecision, parseSkillFrontmatter, pathSandbox, piiRedaction, pluginCapabilities, portkeyGateway, portkeyGuardrail, preopenSkills, preopenToolCallId, prepareStrictToolMenu, promptInjectionGuard, rateLimit, readMemoryFacts, readTraceContinuation, recordOrDeferTraceEvent, redactText, regexGuardrail, regexRule, replaceTextContent, replayDeferredTraceEvents, resolveAvailableSkills, resolveAvailableSubagents, resolveInputRetention, resolveMemoryStore, resolveReasoning, resolveStrategy, resolveSubagentTools, resolveSummarizationRetention, resolveToolApprovalState, resolveUserQuestionState, responseCache, restoreSnapshot, restoreToolCalls, runSmartAgentEvalHarness, scoreItemsByRelevance, searchSkills, seedChildMessages, selectTopIndicesInOrder, sessionMetrics, setTokenCounter, startStreamingSession, summarizeObject, supportsAdaptiveThinking, textFromContent, toMessageUsage, toModelResult, toStrictCompatible, toStrictToolSchema, tokenize, toolPolicy, traceContinuationOf, traceSectionsFromMessages, traceSessionToOtlp, validateReasoningConfig, validateToolArgs, webhookApproval, withTools, withinDepth, writeSummaryFactsToMemory };