import { SessionEnrichments } from "./core/enrichments.js";
import { AmplitudeAI } from "./client.js";
import { Session } from "./session.js";

//#region src/bound-agent.d.ts

type UserMessageOpts = Partial<Omit<Parameters<AmplitudeAI['trackUserMessage']>[0], 'content'>>;
type AiMessageOpts = Partial<Omit<Parameters<AmplitudeAI['trackAiMessage']>[0], 'content' | 'model' | 'provider' | 'latencyMs'>>;
type ToolCallOpts = Partial<Omit<Parameters<AmplitudeAI['trackToolCall']>[0], 'toolName' | 'latencyMs' | 'success'>>;
type EmbeddingOpts = Partial<Omit<Parameters<AmplitudeAI['trackEmbedding']>[0], 'model' | 'provider' | 'latencyMs'>>;
type SpanOpts = Partial<Omit<Parameters<AmplitudeAI['trackSpan']>[0], 'spanName' | 'latencyMs'>>;
type SessionEndOpts = Partial<Parameters<AmplitudeAI['trackSessionEnd']>[0]>;
type SessionEnrichmentOpts = Partial<Omit<Parameters<AmplitudeAI['trackSessionEnrichment']>[0], 'enrichments'>>;
type ScoreOpts = Partial<Omit<Parameters<AmplitudeAI['score']>[0], 'name' | 'value' | 'targetId'>>;
interface AgentOptions {
  userId?: string | null;
  parentAgentId?: string | null;
  customerOrgId?: string | null;
  agentVersion?: string | null;
  description?: string | null;
  context?: Record<string, unknown> | null;
  env?: string | null;
  sessionId?: string | null;
  traceId?: string | null;
  groups?: Record<string, unknown> | null;
  deviceId?: string | null;
  browserSessionId?: string | null;
}
declare class BoundAgent {
  readonly _ai: AmplitudeAI;
  readonly _defaults: Record<string, unknown>;
  constructor(ai: AmplitudeAI, opts: AgentOptions & {
    agentId: string;
  });
  get agentId(): string;
  get ai(): AmplitudeAI;
  child(agentId: string, overrides?: AgentOptions): BoundAgent;
  private _merge;
  trackUserMessage(content: string, opts?: UserMessageOpts): string;
  trackAiMessage(content: string, model: string, provider: string, latencyMs: number, opts?: AiMessageOpts): string;
  trackToolCall(toolName: string, latencyMs: number, success: boolean, opts?: ToolCallOpts): string;
  trackEmbedding(model: string, provider: string, latencyMs: number, opts?: EmbeddingOpts): string;
  trackSpan(spanName: string, latencyMs: number, opts?: SpanOpts): string;
  trackSessionEnd(opts?: SessionEndOpts): void;
  trackSessionEnrichment(enrichments: SessionEnrichments, opts?: SessionEnrichmentOpts): void;
  score(name: string, value: number, targetId: string, opts?: ScoreOpts): void;
  /**
   * Create a {@link Session}.
   *
   * `idleTimeoutMinutes` hints to the enrichment pipeline how long to wait
   * before considering the session idle. Defaults to the pipeline default
   * (~30 min). Positive values up to 90 days (129600) are honored; larger
   * values are clamped to 90 days. Set to `-1` when you intend to end the
   * session explicitly: it is enriched early when an explicit
   * `[Agent] Session End` is emitted (e.g. on `run`/`end`), and otherwise
   * auto-closes after a 90-day inactivity backstop — so a session that is never
   * explicitly ended still flushes eventually rather than leaking open.
   *
   * @throws {RangeError} if `idleTimeoutMinutes` is a negative value other than
   *   the `-1` sentinel.
   */
  session(opts?: {
    sessionId?: string | null;
    idleTimeoutMinutes?: number | null;
    userId?: string | null;
    deviceId?: string | null;
    browserSessionId?: string | null;
    autoFlush?: boolean;
    tags?: string[] | null;
  }): Session;
  flush(): unknown;
  shutdown(): void;
}
//#endregion
export { AgentOptions, AiMessageOpts, BoundAgent, EmbeddingOpts, ScoreOpts, SessionEndOpts, SessionEnrichmentOpts, SpanOpts, ToolCallOpts, UserMessageOpts };
//# sourceMappingURL=bound-agent.d.ts.map