import { PrivacyConfig } from "./privacy.js";
import { MessageLabel, SessionEnrichments } from "./enrichments.js";
import { AmplitudeLike, Attachment, ToolCallShape } from "../types.js";
import { EVENT_AI_RESPONSE, EVENT_EMBEDDING, EVENT_SCORE, EVENT_SESSION_END, EVENT_SESSION_ENRICHMENT, EVENT_SPAN, EVENT_TOOL_CALL, EVENT_USER_MESSAGE, MAX_SERIALIZED_LENGTH, PROP_ABANDONMENT_TURN, PROP_AGENT_CHAIN, PROP_AGENT_DESCRIPTION, PROP_AGENT_ID, PROP_AGENT_VERSION, PROP_ATTACHMENTS, PROP_ATTACHMENT_COUNT, PROP_ATTACHMENT_TYPES, PROP_CACHE_CREATION_TOKENS, PROP_CACHE_READ_TOKENS, PROP_COMMENT, PROP_COMPONENT_TYPE, PROP_CONTEXT, PROP_COST_USD, PROP_CUSTOMER_ORG_ID, PROP_EDITED_MESSAGE_ID, PROP_EMBEDDING_DIMENSIONS, PROP_ENRICHMENTS, PROP_ENV, PROP_ERROR_MESSAGE, PROP_ERROR_SOURCE, PROP_ERROR_TYPE, PROP_EVALUATION_SOURCE, PROP_FINISH_REASON, PROP_GIT_REF, PROP_GIT_REPO, PROP_GIT_SHA, PROP_HAS_ATTACHMENTS, PROP_HAS_REASONING, PROP_IDLE_TIMEOUT_MINUTES, PROP_INPUT_STATE, PROP_INPUT_TOKENS, PROP_INVOCATION_ID, PROP_IS_EDIT, PROP_IS_ERROR, PROP_IS_REGENERATION, PROP_IS_STREAMING, PROP_LATENCY_MS, PROP_LOCALE, PROP_MAX_OUTPUT_TOKENS, PROP_MESSAGE_ID, PROP_MESSAGE_LABELS, PROP_MESSAGE_LABEL_MAP, PROP_MESSAGE_SOURCE, PROP_MODEL_NAME, PROP_MODEL_TIER, PROP_OUTPUT_STATE, PROP_OUTPUT_TOKENS, PROP_PARENT_AGENT_ID, PROP_PARENT_MESSAGE_ID, PROP_PARENT_SPAN_ID, PROP_PROMPT_ID, PROP_PROVIDER, PROP_QUALITY_SCORE, PROP_REASONING_CONTENT, PROP_REASONING_TOKENS, PROP_REQUEST_COMPLEXITY, PROP_ROOT_AGENT_NAME, PROP_RUNTIME, PROP_SCORE_NAME, PROP_SCORE_VALUE, PROP_SDK_VERSION, PROP_SENTIMENT_SCORE, PROP_SESSION_ID, PROP_SESSION_REPLAY_ID, PROP_SPAN_ID, PROP_SPAN_KIND, PROP_SPAN_NAME, PROP_STACK_TRACE, PROP_SYSTEM_PROMPT, PROP_SYSTEM_PROMPT_LENGTH, PROP_TAGS, PROP_TARGET_ID, PROP_TARGET_TYPE, PROP_TASK_FAILURE_REASON, PROP_TASK_FAILURE_TYPE, PROP_TEMPERATURE, PROP_TOOL_CALLS, PROP_TOOL_DEFINITIONS, PROP_TOOL_DEFINITIONS_COUNT, PROP_TOOL_DEFINITIONS_HASH, PROP_TOOL_INPUT, PROP_TOOL_NAME, PROP_TOOL_OUTPUT, PROP_TOOL_OWNER, PROP_TOOL_SUCCESS, PROP_TOOL_TYPE, PROP_TOP_P, PROP_TOTAL_ATTACHMENT_SIZE, PROP_TOTAL_TOKENS, PROP_TRACE_ID, PROP_TTFB_MS, PROP_TURN_ID, PROP_WAS_CACHED, PROP_WAS_COPIED, SDK_RUNTIME, SDK_VERSION } from "./constants.js";

//#region src/core/tracking.d.ts
declare function serializeToJsonString(value: unknown, maxLength?: number): string;
interface TrackUserMessageOptions {
  amplitude: AmplitudeLike;
  userId?: string;
  deviceId?: string | null;
  messageContent: string;
  sessionId?: string | null;
  traceId?: string | null;
  turnId?: number;
  messageId?: string | null;
  conversationId?: string | null;
  env?: string | null;
  locale?: string | null;
  agentId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  isRegeneration?: boolean;
  isEdit?: boolean;
  editedMessageId?: string | null;
  attachments?: Attachment[] | null;
  messageSource?: string | null;
  labels?: MessageLabel[] | null;
  /**
   * Session idle-timeout hint, stamped on this (typically first) event so the
   * enrichment pipeline learns it early. `-1` disables auto-close (enrich only
   * on an explicit Session End). See `BoundAgent.session`.
   */
  idleTimeoutMinutes?: number | null;
  eventProperties?: Record<string, unknown> | null;
  userProperties?: Record<string, unknown> | null;
  groups?: Record<string, unknown> | null;
  privacyConfig?: PrivacyConfig | null;
  browserSessionId?: string | number | null;
}
declare function trackUserMessage(opts: TrackUserMessageOptions): string;
interface TrackAiMessageOptions {
  amplitude: AmplitudeLike;
  userId?: string;
  deviceId?: string | null;
  modelName: string;
  provider: string;
  responseContent: string;
  latencyMs: number;
  sessionId?: string | null;
  traceId?: string | null;
  turnId?: number;
  messageId?: string | null;
  conversationId?: string | null;
  inputTokens?: number | null;
  outputTokens?: number | null;
  totalTokens?: number | null;
  reasoningTokens?: number | null;
  cacheReadInputTokens?: number | null;
  cacheCreationInputTokens?: number | null;
  totalCostUsd?: number | null;
  providerTtfbMs?: number | null;
  isError?: boolean;
  errorMessage?: string | null;
  errorType?: string | null;
  finishReason?: string | null;
  toolCalls?: Array<ToolCallShape | Record<string, unknown>> | null;
  reasoningContent?: string | null;
  toolDefinitions?: Array<Record<string, unknown>> | null;
  systemPrompt?: string | null;
  temperature?: number | null;
  maxOutputTokens?: number | null;
  topP?: number | null;
  isStreaming?: boolean | null;
  promptId?: string | null;
  wasCopied?: boolean;
  wasCached?: boolean;
  modelTier?: string | null;
  attachments?: Attachment[] | null;
  labels?: MessageLabel[] | null;
  env?: string | null;
  locale?: string | null;
  agentId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  spanKind?: string | null;
  stackTrace?: string | null;
  eventProperties?: Record<string, unknown> | null;
  userProperties?: Record<string, unknown> | null;
  groups?: Record<string, unknown> | null;
  privacyConfig?: PrivacyConfig | null;
  browserSessionId?: string | number | null;
}
declare function trackAiMessage(opts: TrackAiMessageOptions): string;
interface TrackToolCallOptions {
  amplitude: AmplitudeLike;
  userId?: string;
  deviceId?: string | null;
  toolName: string;
  toolType?: string | null;
  toolOwner?: string | null;
  success: boolean;
  latencyMs: number;
  sessionId?: string | null;
  traceId?: string | null;
  turnId?: number;
  toolInput?: unknown;
  toolOutput?: unknown;
  invocationId?: string | null;
  conversationId?: string | null;
  parentMessageId?: string | null;
  agentId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  errorMessage?: string | null;
  errorType?: string | null;
  stackTrace?: string | null;
  env?: string | null;
  locale?: string | null;
  spanKind?: string | null;
  eventProperties?: Record<string, unknown> | null;
  userProperties?: Record<string, unknown> | null;
  groups?: Record<string, unknown> | null;
  privacyConfig?: PrivacyConfig | null;
  browserSessionId?: string | number | null;
}
declare function trackToolCall(opts: TrackToolCallOptions): string;
interface TrackConversationOptions {
  amplitude: AmplitudeLike;
  userId?: string;
  deviceId?: string | null;
  messages: Array<Record<string, unknown>>;
  sessionId?: string | null;
  conversationId?: string | null;
  agentId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  env?: string | null;
  /** Locale tag (e.g. "en-US") forwarded to every emitted message. */
  locale?: string | null;
  eventProperties?: Record<string, unknown> | null;
  userProperties?: Record<string, unknown> | null;
  groups?: Record<string, unknown> | null;
  privacyConfig?: PrivacyConfig | null;
  browserSessionId?: string | number | null;
}
/**
 * Track a complete conversation of user, assistant, and tool messages.
 *
 * Supported roles: `user`, `assistant`/`ai`, and `tool`. `system` messages are
 * intentionally skipped (system content belongs on a response's `systemPrompt`,
 * not a standalone event); any other role is skipped with a debug log rather
 * than dropped silently.
 */
declare function trackConversation(opts: TrackConversationOptions): void;
interface TrackEmbeddingOptions {
  amplitude: AmplitudeLike;
  userId?: string;
  deviceId?: string | null;
  model: string;
  provider: string;
  latencyMs: number;
  inputTokens?: number | null;
  dimensions?: number | null;
  totalCostUsd?: number | null;
  sessionId?: string | null;
  traceId?: string | null;
  turnId?: number | null;
  agentId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  env?: string | null;
  eventProperties?: Record<string, unknown> | null;
  groups?: Record<string, unknown> | null;
  privacyConfig?: PrivacyConfig | null;
  browserSessionId?: string | number | null;
}
declare function trackEmbedding(opts: TrackEmbeddingOptions): string;
interface TrackSpanOptions {
  amplitude: AmplitudeLike;
  userId?: string;
  deviceId?: string | null;
  spanName: string;
  traceId: string;
  latencyMs: number;
  inputState?: Record<string, unknown> | null;
  outputState?: Record<string, unknown> | null;
  parentSpanId?: string | null;
  isError?: boolean;
  errorMessage?: string | null;
  errorType?: string | null;
  sessionId?: string | null;
  turnId?: number | null;
  agentId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  env?: string | null;
  eventProperties?: Record<string, unknown> | null;
  groups?: Record<string, unknown> | null;
  privacyConfig?: PrivacyConfig | null;
  browserSessionId?: string | number | null;
}
declare function trackSpan(opts: TrackSpanOptions): string;
interface TrackSessionEndOptions {
  amplitude: AmplitudeLike;
  userId?: string;
  deviceId?: string | null;
  sessionId: string;
  enrichments?: SessionEnrichments | null;
  traceId?: string | null;
  turnId?: number | null;
  agentId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  env?: string | null;
  abandonmentTurn?: number | null;
  idleTimeoutMinutes?: number | null;
  eventProperties?: Record<string, unknown> | null;
  groups?: Record<string, unknown> | null;
  privacyConfig?: PrivacyConfig | null;
  browserSessionId?: string | number | null;
}
declare function trackSessionEnd(opts: TrackSessionEndOptions): void;
interface TrackSessionEnrichmentOptions {
  amplitude: AmplitudeLike;
  userId?: string;
  deviceId?: string | null;
  sessionId: string;
  enrichments: SessionEnrichments;
  traceId?: string | null;
  turnId?: number | null;
  agentId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  env?: string | null;
  eventProperties?: Record<string, unknown> | null;
  groups?: Record<string, unknown> | null;
  privacyConfig?: PrivacyConfig | null;
  browserSessionId?: string | number | null;
}
declare function trackSessionEnrichment(opts: TrackSessionEnrichmentOptions): void;
interface TrackScoreOptions {
  amplitude: AmplitudeLike;
  userId?: string;
  deviceId?: string | null;
  name: string;
  value: number;
  targetId: string;
  targetType?: string;
  source?: string;
  comment?: string | null;
  sessionId?: string | null;
  traceId?: string | null;
  turnId?: number | null;
  agentId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  env?: string | null;
  eventProperties?: Record<string, unknown> | null;
  groups?: Record<string, unknown> | null;
  privacyConfig?: PrivacyConfig | null;
  browserSessionId?: string | number | null;
}
declare function trackScore(opts: TrackScoreOptions): void;
//#endregion
export { EVENT_AI_RESPONSE, EVENT_EMBEDDING, EVENT_SCORE, EVENT_SESSION_END, EVENT_SESSION_ENRICHMENT, EVENT_SPAN, EVENT_TOOL_CALL, EVENT_USER_MESSAGE, MAX_SERIALIZED_LENGTH, PROP_ABANDONMENT_TURN, PROP_AGENT_CHAIN, PROP_AGENT_DESCRIPTION, PROP_AGENT_ID, PROP_AGENT_VERSION, PROP_ATTACHMENTS, PROP_ATTACHMENT_COUNT, PROP_ATTACHMENT_TYPES, PROP_CACHE_CREATION_TOKENS, PROP_CACHE_READ_TOKENS, PROP_COMMENT, PROP_COMPONENT_TYPE, PROP_CONTEXT, PROP_COST_USD, PROP_CUSTOMER_ORG_ID, PROP_EDITED_MESSAGE_ID, PROP_EMBEDDING_DIMENSIONS, PROP_ENRICHMENTS, PROP_ENV, PROP_ERROR_MESSAGE, PROP_ERROR_SOURCE, PROP_ERROR_TYPE, PROP_EVALUATION_SOURCE, PROP_FINISH_REASON, PROP_GIT_REF, PROP_GIT_REPO, PROP_GIT_SHA, PROP_HAS_ATTACHMENTS, PROP_HAS_REASONING, PROP_IDLE_TIMEOUT_MINUTES, PROP_INPUT_STATE, PROP_INPUT_TOKENS, PROP_INVOCATION_ID, PROP_IS_EDIT, PROP_IS_ERROR, PROP_IS_REGENERATION, PROP_IS_STREAMING, PROP_LATENCY_MS, PROP_LOCALE, PROP_MAX_OUTPUT_TOKENS, PROP_MESSAGE_ID, PROP_MESSAGE_LABELS, PROP_MESSAGE_LABEL_MAP, PROP_MESSAGE_SOURCE, PROP_MODEL_NAME, PROP_MODEL_TIER, PROP_OUTPUT_STATE, PROP_OUTPUT_TOKENS, PROP_PARENT_AGENT_ID, PROP_PARENT_MESSAGE_ID, PROP_PARENT_SPAN_ID, PROP_PROMPT_ID, PROP_PROVIDER, PROP_QUALITY_SCORE, PROP_REASONING_CONTENT, PROP_REASONING_TOKENS, PROP_REQUEST_COMPLEXITY, PROP_ROOT_AGENT_NAME, PROP_RUNTIME, PROP_SCORE_NAME, PROP_SCORE_VALUE, PROP_SDK_VERSION, PROP_SENTIMENT_SCORE, PROP_SESSION_ID, PROP_SESSION_REPLAY_ID, PROP_SPAN_ID, PROP_SPAN_KIND, PROP_SPAN_NAME, PROP_STACK_TRACE, PROP_SYSTEM_PROMPT, PROP_SYSTEM_PROMPT_LENGTH, PROP_TAGS, PROP_TARGET_ID, PROP_TARGET_TYPE, PROP_TASK_FAILURE_REASON, PROP_TASK_FAILURE_TYPE, PROP_TEMPERATURE, PROP_TOOL_CALLS, PROP_TOOL_DEFINITIONS, PROP_TOOL_DEFINITIONS_COUNT, PROP_TOOL_DEFINITIONS_HASH, PROP_TOOL_INPUT, PROP_TOOL_NAME, PROP_TOOL_OUTPUT, PROP_TOOL_OWNER, PROP_TOOL_SUCCESS, PROP_TOOL_TYPE, PROP_TOP_P, PROP_TOTAL_ATTACHMENT_SIZE, PROP_TOTAL_TOKENS, PROP_TRACE_ID, PROP_TTFB_MS, PROP_TURN_ID, PROP_WAS_CACHED, PROP_WAS_COPIED, SDK_RUNTIME, SDK_VERSION, TrackAiMessageOptions, TrackConversationOptions, TrackEmbeddingOptions, TrackScoreOptions, TrackSessionEndOptions, TrackSessionEnrichmentOptions, TrackSpanOptions, TrackToolCallOptions, TrackUserMessageOptions, serializeToJsonString, trackAiMessage, trackConversation, trackEmbedding, trackScore, trackSessionEnd, trackSessionEnrichment, trackSpan, trackToolCall, trackUserMessage };
//# sourceMappingURL=tracking.d.ts.map