import { $ as withScopedTool, Ct as hashPayload, St as canonicalizeForHash, _t as recordAgentHandoff, at as RotateAgentIdentityInput, bt as createAgentAuditMetadata, ct as defineAgentAction, dt as recordPolicyDecision, et as CreateSignedEventEnvelopeOptions, ft as withAgentAction, gt as delegateToAgent, ht as RecordAgentHandoffMetadata, it as RevokeAgentIdentityInput, lt as defineAgentToolCall, mt as DelegateToAgentInput, nt as verifyEventEnvelopeHash, ot as createAgentIdentityRegistry, pt as withAgentToolCall, rt as ProvisionAgentIdentityInput, st as withAgentSession, tt as createSignedEventEnvelope, ut as recordDecisionBasis, vt as flattenAgentAttributes, wt as AGENT_AUDIT_SCHEMA_VERSION, xt as HashPayloadOptions, yt as setAgentAttributes } from "./index-C-X35G5b.js"; import { a as TokenUsage, c as recordLLMCost, d as unpricedServerTools, i as ModelPricingTable, l as registerModelPricing, n as GEN_AI_COST_ATTRIBUTE, o as estimateLLMCost, r as ModelPricing, s as priceAsOf, t as EstimateCostOptions, u as registeredModelPricing } from "./cost-CiXR1eKW.js"; import { _ as GenAiToolType, a as GEN_AI_GUARD_EVENT, c as GEN_AI_OUTPUT_TYPE, d as GEN_AI_TOOL_TYPE, f as GenAiAttributeKey, g as GenAiTokenType, h as GenAiProviderName, i as GEN_AI_EXT_EVENT, l as GEN_AI_PROVIDER, m as GenAiOutputType, n as GEN_AI, o as GEN_AI_METRIC, p as GenAiOperationName, r as GEN_AI_EVENT, s as GEN_AI_OPERATION, t as CONTENT_ORIGINAL_SIZE_SUFFIX, u as GEN_AI_TOKEN_TYPE, v as genAiSpanName } from "./semconv-BdR5pWDh.js"; import { $ as PrivacyProfileName, A as AgentAiMetadata, B as AgentOutcome, D as AgentActionFactory, F as AgentIdentity, G as AgentToolCallOptions, H as AgentSessionMetadata, I as AgentIdentityRecord, K as AiLifecycleStage, L as AgentIdentityRegistry, M as AgentDecisionMetadata, N as AgentEventKind, O as AgentActionMetadata, P as AgentHandler, Q as PrivacyProfile, R as AgentIdentityStatus, U as AgentSessionStatus, V as AgentSessionActionMetadata, W as AgentToolCallActionMetadata, X as PolicyDecision, Y as GovernanceMetadata, Z as PolicyMetadata, at as resolvePrivacyProfile, ct as AgentContext, et as ScopedToolDefinition, j as AgentAuditEventEnvelope, k as AgentActionOptions, nt as ToolStatus, ot as sanitizeAuditPayload, q as DelegationContext, rt as PrivacyProfileInput, tt as ToolCallMetadata, z as AgentMetadataInput } from "./agent-security-L5yiq0tm.js"; import { _ as genAiWorkflowAttributes, a as GenAiResponseInput, c as GenAiUsageInput, d as genAiMemoryAttributes, f as genAiRequestAttributes, g as genAiUsageAttributes, h as genAiToolAttributes, i as GenAiRequestInput, l as GenAiWorkflowInput, m as genAiRetrievalAttributes, n as GenAiAttributeMap, o as GenAiRetrievalInput, p as genAiResponseAttributes, r as GenAiMemoryInput, s as GenAiToolInput, t as GenAiAgentInput, u as genAiAgentAttributes } from "./attributes-xDXxzr8D.js"; import { AI_SDK_ATTR, AUTOTEL_ENRICHED_ATTR, AiSdkEnrichContext, AiSdkSpanType, AutotelEnrichOptions, autotelEnrich, estimateAiSdkCost, extractAiSdkModel, extractAiSdkUsage, mapAiSdkAttributes, normalizeAiSdkProvider, recordAiSdkCost } from "./ai-sdk-bridge.js"; import { a as GenAiMessage, c as GenAiWarning, d as recordInferenceDetails, f as recordModelWarnings, i as GenAiContentSink, l as InferenceDetailsEvent, m as setGenAiContent, n as DEFAULT_MAX_CONTENT_BYTES, o as GenAiMessagePart, p as recordOperationException, r as EvaluationResultEvent, s as GenAiOperationExceptionEvent, t as ContentCaptureSettings, u as recordEvaluationResult } from "./events-DVyUmrxu.js"; import { CONTEXT_LIMITS, GenAiBudgetOptions, GenAiGuard, GenAiGuardOptions, GenAiGuardRule, GenAiGuardStep, GuardAction, GuardSink, GuardState, GuardStopBehavior, GuardUsage, GuardViolation, contextBudget, costCeiling, createGenAiBudget, createGenAiGuard, errorLoop, maxDuration, maxSteps, maxToolCalls, parseGuardRules, spinLoop, tokenCeiling } from "./guard.js"; import { GEN_AI_COST_USD_BUCKETS, GEN_AI_DURATION_BUCKETS_SECONDS, GEN_AI_TOKEN_USAGE_BUCKETS, GenAiHistogramKind, GenAiMetricInput, genAiMetricViews, llmHistogramAdvice, recordGenAiMetrics, resetGenAiInstruments } from "./metrics.js"; import { ChunkIntervalStats, ComputeStreamTimingInput, StreamTimer, StreamTiming, chunkIntervalStats, computeStreamTiming, createStreamTimer, recordStreamTiming } from "./streaming.js"; import { TraceGenAIConfig, recordGenAiResponse, recordGenAiUsage, traceGenAI, traceLLM } from "./trace.js"; import { a as GEN_AI_OPERATION_EVALUATE, c as wrapEvaluationModel, i as EvaluationScoreOptions, n as AiSdkEvaluationModel, o as WrapEvaluationModelOptions, r as AiSdkEvaluationResult, s as evaluationScore, t as AiSdkEvaluationAnswer } from "./ai-sdk-evaluate-E6JEPzHC.js"; import { A as ChatEndEvent, B as ToolStartEvent, C as AiSdkUsage, D as createGenAiObserver, E as SpanRegistry, F as GenAiObserverOptions, H as WorkflowStartEvent, I as GenAiToolIdentity, L as SpanEnd, M as ChatStreamTiming, N as GenAiObserver, O as AgentEndEvent, P as GenAiObserverEvent, R as SpanStart, S as AiSdkToolResult, T as observeAiSdkResult, V as WorkflowEndEvent, _ as contentToGenAiMessage, b as AiSdkStep, c as createLangChainObserver, d as AutotelTelemetryIntegration, f as AutotelTelemetryOptions, g as ConvertedPrompt, h as autotelTelemetry, j as ChatStartEvent, k as AgentStartEvent, l as SubscribeAiTelemetryOptions, o as LangChainObserverHandler, s as LangChainObserverOptions, u as subscribeAiTelemetry, v as promptToGenAiMessages, w as ObserveAiSdkOptions, x as AiSdkToolCall, y as AiSdkResult, z as ToolEndEvent } from "./index-GY6-9p0K.js"; //#region src/redaction.d.ts /** * Keeping binary out of spans, and keeping what is left inside the limits. * * A multimodal call carries images, audio and PDFs inline as base64. Serialised * into `gen_ai.input.messages` verbatim, one such call is a megabyte-scale span * attribute — which collectors truncate mid-string, backends reject, and nobody * can read anyway. The bytes were never the interesting part: the prompt around * them is. * * So {@link redactBinaryContent} walks a payload and swaps every recognised * blob for a placeholder that names what was there, and {@link truncateUtf8} * caps whatever survives. Both are pure and backend-agnostic — the same problem * exists on Grafana, Honeycomb and Jaeger as on any vendor. * * Recognition is contextual, because "is this base64?" has no safe answer from * the string alone. A 100-character alphanumeric run is far more likely a * request id than an image, so a bare string must be long (1KB) before it is * suspected. Under a key that means binary — `data`, `image_url`, `inline_data` * — or beside a `mediaType` / `format` hint, 64 bytes is enough. An explicit * `text/*` media type settles it the other way and nothing is touched. */ interface RedactBinaryOptions { /** * Media type of the value as a whole, when the caller already knows it — * an image buffer handed in on its own has no sibling field to say so. */ mediaType?: string; /** * Called once per payload replaced. Callers that need to declare the loss * (an evidence label, a metric) count them here rather than diffing the * result against the input, which on a multimodal payload is the expensive * work this function exists to avoid. */ onRedact?: () => void; } /** * Replace binary and base64 payloads inside `value` with placeholders naming * what was removed. Returns a new structure; `value` is left alone. * * A cycle resolves to `null` rather than looping. */ export declare function redactBinaryContent(value: T, options?: RedactBinaryOptions): T; interface TruncateResult { /** The string as it should be recorded. */ text: string; /** Whether anything was cut. */ truncated: boolean; /** UTF-8 byte length before truncation — the size the caller nearly recorded. */ originalBytes: number; } /** * Cap `text` at `maxBytes` UTF-8 bytes, reporting what it cost. A limit of zero * or less is no limit. * * Byte-accurate rather than character-accurate because that is what every * attribute limit downstream is measured in, and a multi-byte character is * never split into a broken one. */ export declare function truncateUtf8(text: string, maxBytes: number): TruncateResult; interface SerializeWithinBudgetResult { /** The text to record. Always valid JSON, unless the input was a plain string. */ text: string; /** Whether anything was cut. */ truncated: boolean; /** UTF-8 byte size of the untruncated serialisation. */ originalBytes: number; } /** * Serialise `value` into at most `maxBytes` UTF-8 bytes **without breaking it**. * * Slicing serialised JSON at a byte offset lands mid-token and yields a string * nothing can parse — including autotel's own devtools, which then drop the * attribute entirely. So an oversized structure is shrunk from the inside * instead: long string leaves are cut first (keeping every message, role and * part where it was), and only if that is not enough does the container lose * trailing entries. Either way what lands is parseable. * * A plain string is sliced, since a cut string is still a valid string. * A budget of zero or less is no budget. Nothing here throws: a value JSON * cannot serialise (a cycle, a `toJSON` that fails) degrades to `null` rather * than taking down the call being instrumented. */ export declare function serializeWithinBudget(value: unknown, maxBytes: number): SerializeWithinBudgetResult; //#endregion //#region src/conversation-signals.d.ts /** One turn of the conversation under judgment. */ interface ConversationSignalTurn { role: 'user' | 'assistant' | 'system'; text: string; } /** Input for {@link conversationSignalState} / {@link runConversationSignals}. */ interface ConversationSignalInput { turns: ConversationSignalTurn[]; } /** AI SDK boolean question shape. */ interface ConversationSignalQuestion { type: 'boolean'; instructions: string; criteria: { true: string; false: string; }; } export declare const CONVERSATION_SIGNAL_NAMES: readonly ['user_frustrated', 'user_follow_up', 'user_disagrees', 'outcome_resolved', 'agent_corrected']; type ConversationSignalName = (typeof CONVERSATION_SIGNAL_NAMES)[number]; /** * Fixed pack of independent yes/no signals. Ask them together over the same * conversation state; answers cannot see one another. */ export declare const CONVERSATION_SIGNAL_QUESTIONS: Record; /** Default P(true) cutoffs for `yes` / `no` labels. Tune on labeled traffic. */ export declare const DEFAULT_CONVERSATION_SIGNAL_THRESHOLDS: Record; /** Named JSON state for the evaluate call — not a single string blob. */ export declare function conversationSignalState(input: ConversationSignalInput): { turns: ConversationSignalTurn[]; }; interface ConversationSignalResult { name: ConversationSignalName; scoreValue: number; scoreLabel: 'yes' | 'no'; } /** * Map boolean answers to yes/no verdicts using per-key thresholds. * Non-boolean answers and unknown keys are skipped. */ export declare function conversationSignalResults(answers: Record, thresholds?: Partial>): ConversationSignalResult[]; interface RunConversationSignalsOptions { /** Pricing lookup for `gen_ai.usage.cost.usd`; `recordCost: false` skips it. */ cost?: WrapEvaluationModelOptions['cost']; /** Extra attributes for every evaluation span. */ attributes?: WrapEvaluationModelOptions['attributes']; /** Record `gen_ai.client.*` metrics alongside the span (default on). */ metrics?: WrapEvaluationModelOptions['metrics']; /** Override or subset of {@link CONVERSATION_SIGNAL_QUESTIONS}. */ questions?: Partial>; /** Per-signal P(true) cutoffs; defaults to {@link DEFAULT_CONVERSATION_SIGNAL_THRESHOLDS}. */ thresholds?: Partial>; } /** * Run the conversation-signal pack through an evaluation model (e.g. Jev). * Traces via {@link wrapEvaluationModel} and returns thresholded yes/no verdicts. */ export declare function runConversationSignals(model: AiSdkEvaluationModel, input: ConversationSignalInput, options?: RunConversationSignalsOptions): Promise<{ results: ConversationSignalResult[]; answers: AiSdkEvaluationResult['answers']; }>; //#endregion export { AGENT_AUDIT_SCHEMA_VERSION, AI_SDK_ATTR, AUTOTEL_ENRICHED_ATTR, type AgentActionFactory, type AgentActionMetadata, type AgentActionOptions, type AgentAiMetadata, type AgentAuditEventEnvelope, type AgentContext, type AgentDecisionMetadata, type AgentEndEvent, type AgentEventKind, type AgentHandler, type AgentIdentity, type AgentIdentityRecord, type AgentIdentityRegistry, type AgentIdentityStatus, type AgentMetadataInput, type AgentOutcome, type AgentSessionActionMetadata, type AgentSessionMetadata, type AgentSessionStatus, type AgentStartEvent, type AgentToolCallActionMetadata, type AgentToolCallOptions, type AiLifecycleStage, type AiSdkEnrichContext, type AiSdkEvaluationAnswer, type AiSdkEvaluationModel, type AiSdkEvaluationResult, type AiSdkResult, type AiSdkSpanType, type AiSdkStep, type AiSdkToolCall, type AiSdkToolResult, type AiSdkUsage, type AutotelEnrichOptions, type AutotelTelemetryIntegration, type AutotelTelemetryOptions, CONTENT_ORIGINAL_SIZE_SUFFIX, CONTEXT_LIMITS, type ChatEndEvent, type ChatStartEvent, type ChatStreamTiming, type ChunkIntervalStats, type ComputeStreamTimingInput, type ContentCaptureSettings, type ConversationSignalInput, type ConversationSignalName, type ConversationSignalQuestion, type ConversationSignalResult, type ConversationSignalTurn, type ConvertedPrompt, type CreateSignedEventEnvelopeOptions, DEFAULT_MAX_CONTENT_BYTES, type DelegateToAgentInput, type DelegationContext, type EstimateCostOptions, type EvaluationResultEvent, type EvaluationScoreOptions, GEN_AI, GEN_AI_COST_ATTRIBUTE, GEN_AI_COST_USD_BUCKETS, GEN_AI_DURATION_BUCKETS_SECONDS, GEN_AI_EVENT, GEN_AI_EXT_EVENT, GEN_AI_GUARD_EVENT, GEN_AI_METRIC, GEN_AI_OPERATION, GEN_AI_OPERATION_EVALUATE, GEN_AI_OUTPUT_TYPE, GEN_AI_PROVIDER, GEN_AI_TOKEN_TYPE, GEN_AI_TOKEN_USAGE_BUCKETS, GEN_AI_TOOL_TYPE, type GenAiAgentInput, type GenAiAttributeKey, type GenAiAttributeMap, type GenAiBudgetOptions, type GenAiContentSink, type GenAiGuard, type GenAiGuardOptions, type GenAiGuardRule, type GenAiGuardStep, type GenAiHistogramKind, type GenAiMemoryInput, type GenAiMessage, type GenAiMessagePart, type GenAiMetricInput, type GenAiObserver, type GenAiObserverEvent, type GenAiObserverOptions, type GenAiOperationExceptionEvent, type GenAiOperationName, type GenAiOutputType, type GenAiProviderName, type GenAiRequestInput, type GenAiResponseInput, type GenAiRetrievalInput, type GenAiTokenType, type GenAiToolIdentity, type GenAiToolInput, type GenAiToolType, type GenAiUsageInput, type GenAiWarning, type GenAiWorkflowInput, type GovernanceMetadata, type GuardAction, type GuardSink, type GuardState, type GuardStopBehavior, type GuardUsage, type GuardViolation, type HashPayloadOptions, type InferenceDetailsEvent, type LangChainObserverHandler, type LangChainObserverOptions, type ModelPricing, type ModelPricingTable, type ObserveAiSdkOptions, type PolicyDecision, type PolicyMetadata, type PrivacyProfile, type PrivacyProfileInput, type PrivacyProfileName, type ProvisionAgentIdentityInput, type RecordAgentHandoffMetadata, type RedactBinaryOptions, type RevokeAgentIdentityInput, type RotateAgentIdentityInput, type RunConversationSignalsOptions, type ScopedToolDefinition, type SerializeWithinBudgetResult, type SpanEnd, SpanRegistry, type SpanStart, type StreamTimer, type StreamTiming, type SubscribeAiTelemetryOptions, type TokenUsage, type ToolCallMetadata, type ToolEndEvent, type ToolStartEvent, type ToolStatus, type TraceGenAIConfig, type TruncateResult, type WorkflowEndEvent, type WorkflowStartEvent, type WrapEvaluationModelOptions, autotelEnrich, autotelTelemetry, canonicalizeForHash, chunkIntervalStats, computeStreamTiming, contentToGenAiMessage, contextBudget, costCeiling, createAgentAuditMetadata, createAgentIdentityRegistry, createGenAiBudget, createGenAiGuard, createGenAiObserver, createLangChainObserver, createSignedEventEnvelope, createStreamTimer, defineAgentAction, defineAgentToolCall, delegateToAgent, errorLoop, estimateAiSdkCost, estimateLLMCost, evaluationScore, extractAiSdkModel, extractAiSdkUsage, flattenAgentAttributes, genAiAgentAttributes, genAiMemoryAttributes, genAiMetricViews, genAiRequestAttributes, genAiResponseAttributes, genAiRetrievalAttributes, genAiSpanName, genAiToolAttributes, genAiUsageAttributes, genAiWorkflowAttributes, hashPayload, llmHistogramAdvice, mapAiSdkAttributes, maxDuration, maxSteps, maxToolCalls, normalizeAiSdkProvider, observeAiSdkResult, parseGuardRules, priceAsOf, promptToGenAiMessages, recordAgentHandoff, recordAiSdkCost, recordDecisionBasis, recordEvaluationResult, recordGenAiMetrics, recordGenAiResponse, recordGenAiUsage, recordInferenceDetails, recordLLMCost, recordModelWarnings, recordOperationException, recordPolicyDecision, recordStreamTiming, registerModelPricing, registeredModelPricing, resetGenAiInstruments, resolvePrivacyProfile, sanitizeAuditPayload, setAgentAttributes, setGenAiContent, spinLoop, subscribeAiTelemetry, tokenCeiling, traceGenAI, traceLLM, unpricedServerTools, verifyEventEnvelopeHash, withAgentAction, withAgentSession, withAgentToolCall, withScopedTool, wrapEvaluationModel };