import { SpanParams, ToolParams, ToolSpan, TrackToolParams, FinishOptions, TraceContext } from './types.js'; interface Interaction { getEventId(): string | undefined; setInput(input: string): void; setProperty(key: string, value: string): void; setProperties(props: Record): void; /** * Run `fn` with this interaction's association properties active — required so * auto-instrumented OpenAI/Anthropic spans inherit user_id / convo_id / tags. */ run(fn: () => Promise | T): Promise; /** Run `fn` inside a traced task span; LLM calls within inherit attribution. */ withSpan(params: SpanParams | string, fn: () => Promise | T): Promise; /** Run `fn` inside a traced tool span. */ withTool(params: ToolParams | string, fn: () => Promise | T): Promise; /** Start a tool span you end manually. */ startToolSpan(params: ToolParams | string): ToolSpan; /** Record an already-completed tool invocation. */ trackTool(params: TrackToolParams): void; /** Metadata for the Vercel AI SDK `experimental_telemetry.metadata`. */ vercelAiSdkMetadata(): Record; /** End the interaction with its final output. */ finish(opts: FinishOptions | string): Promise; } type Tracer = Pick; declare function createInteractionApi(initial: TraceContext & { userId?: string; }, traceContent: boolean, onClose?: (eventId: string) => void): Interaction; /** * Inert Interaction for disabled instances. Preserves control flow — run() / * withTool() still execute their callback and rethrow errors — but never touches * the tracer. Required because the OTel provider is a process-wide singleton: a * disabled instance that created real spans would ship them through whichever * enabled instance registered the provider. */ declare function createNoopInteraction(initial: TraceContext & { userId?: string; }): Interaction; export { type Interaction, type Tracer, createInteractionApi, createNoopInteraction };