import { PrivacyConfig } from "./core/privacy.js";
import { AIConfig } from "./config.js";
import { MessageLabel, SessionEnrichments } from "./core/enrichments.js";
import { TenantHandle } from "./tenant.js";
import { AmplitudeClientLike, Attachment } from "./types.js";
import { AgentOptions, BoundAgent } from "./bound-agent.js";

//#region src/client.d.ts
/** @internal Exposed for testing only. */
declare function _resetShortIdWarned(): void;
/** @internal Exposed for testing only. */
declare function _getGlobalUnflushedCount(): number;
/**
 * Main Amplitude AI client for tracking LLM interactions.
 *
 * Create an instance with an API key or an existing Amplitude client,
 * then use `.agent()` to create bound agents and `.session()` to
 * manage session context.
 *
 * @example
 * ```typescript
 * const ai = new AmplitudeAI({ apiKey: 'YOUR_KEY' });
 * const agent = ai.agent('my-chatbot', { userId: 'user-1' });
 * const session = agent.session();
 * await session.run(async (s) => {
 *   s.trackUserMessage('Hello');
 *   s.trackAiMessage('Hi there!', 'gpt-4', 'openai', 150);
 * });
 * ```
 */
declare class AmplitudeAI {
  protected _amplitude: AmplitudeClientLike;
  protected _ownsClient: boolean;
  protected _config: AIConfig;
  protected _privacyConfig: PrivacyConfig;
  protected _sessionTurnCounters: Map<string, number>;
  /** @internal Tracks events since last flush() — used by the exit warning. */
  _trackCountSinceFlush: number;
  private _otelEnabled;
  private _otelTracerProvider;
  private _otelMapper;
  private _otelProcessor;
  constructor(options: {
    amplitude?: AmplitudeClientLike;
    apiKey?: string;
    config?: AIConfig;
  });
  private _installTrackCounter;
  private _installTrackHook;
  get amplitude(): AmplitudeClientLike;
  get config(): AIConfig;
  _nextTurnId(sessionId: string): number;
  trackUserMessage(opts: {
    userId?: string;
    deviceId?: string | null;
    content: string;
    sessionId: string;
    traceId?: string | null;
    turnId?: number | null;
    messageId?: string | null;
    messageSource?: 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;
    isRegeneration?: boolean;
    isEdit?: boolean;
    editedMessageId?: string | null;
    attachments?: Attachment[] | null;
    labels?: MessageLabel[] | null;
    idleTimeoutMinutes?: number | null;
    eventProperties?: Record<string, unknown> | null;
    groups?: Record<string, unknown> | null;
    browserSessionId?: string | number | null;
  }): string;
  trackAiMessage(opts: {
    userId?: string;
    deviceId?: string | null;
    content: string;
    sessionId: string;
    model: string;
    provider: string;
    latencyMs: number;
    inputTokens?: number | null;
    outputTokens?: number | null;
    reasoningTokens?: number | null;
    cacheReadTokens?: number | null;
    cacheCreationTokens?: number | null;
    totalTokens?: number | null;
    totalCostUsd?: number | null;
    finishReason?: string | null;
    toolCalls?: Array<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;
    traceId?: string | null;
    turnId?: number | null;
    messageId?: 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;
    isError?: boolean;
    errorMessage?: string | null;
    errorType?: string | null;
    ttfbMs?: number | null;
    eventProperties?: Record<string, unknown> | null;
    groups?: Record<string, unknown> | null;
    privacyConfig?: PrivacyConfig | null;
    browserSessionId?: string | number | null;
  }): string;
  trackToolCall(opts: {
    userId?: string;
    deviceId?: string | null;
    toolName: string;
    toolType?: string | null;
    toolOwner?: string | null;
    latencyMs: number;
    success: boolean;
    sessionId?: string | null;
    traceId?: string | null;
    turnId?: number | null;
    invocationId?: string | null;
    input?: unknown;
    output?: unknown;
    parentMessageId?: 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;
    errorMessage?: string | null;
    errorType?: string | null;
    eventProperties?: Record<string, unknown> | null;
    groups?: Record<string, unknown> | null;
    browserSessionId?: string | number | null;
  }): string;
  trackEmbedding(opts: {
    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;
    browserSessionId?: string | number | null;
  }): string;
  trackSpan(opts: {
    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;
    browserSessionId?: string | number | null;
  }): string;
  trackSessionEnd(opts: {
    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;
    browserSessionId?: string | number | null;
  }): void;
  trackSessionEnrichment(opts: {
    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;
    browserSessionId?: string | number | null;
  }): void;
  score(opts: {
    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;
    browserSessionId?: string | number | null;
  }): void;
  agent(agentId: string, opts?: AgentOptions): BoundAgent;
  tenant(customerOrgId: string, opts?: {
    groups?: Record<string, unknown> | null;
    env?: string | null;
  }): TenantHandle;
  enableOtel(options?: {
    defaultUserId?: string;
    defaultDeviceId?: string;
    otelEndpoint?: string;
  }): this;
  get otelEnabled(): boolean;
  usingAttributes<T>(attrs: Record<string, string>, fn: () => T): T;
  updateCurrentSpan(attrs: Record<string, string>): void;
  updateCurrentTrace(attrs: Record<string, string>): void;
  status(): Record<string, unknown>;
  flush(): unknown;
  shutdown(): void;
}
//#endregion
export { AmplitudeAI, _getGlobalUnflushedCount, _resetShortIdWarned };
//# sourceMappingURL=client.d.ts.map