export { GENAI, NAMZU } from '../constants/telemetry/index.js'; /** The root span of one turn. It carries `gen_ai.conversation.id` (the session) and `namzu.turn.id`. */ export declare function agentTurnSpanName(agentName: string): string; export declare function agentIterationSpanName(iteration: number): string; export declare function toolSpanName(toolName: string): string; /** * OTel GenAI semconv names the model-call span `chat {model}`. * * There was no span around the model call at all — `chatSpanName` existed * in `@namzu/telemetry` with zero call sites — so a turn's traces carried * no LLM latency whatsoever, and the token attributes landed on the * iteration span instead of the operation that produced them. */ export declare function chatSpanName(model: string): string; /** * Build a context that parents a new span to `parent`. * * Async generators cannot use `startActiveSpan` for parenting: a generator * body resumes on its CONSUMER's async context, so whatever was active when * the parent span was created is gone by the time the child is made. Every * span-owning body in the turn loop is a generator, which is why a * 20-iteration turn emitted 21 disconnected root spans. Passing the parent explicitly is * the only thing that works here. */ export declare function parentContext(parent?: import('@opentelemetry/api').Span | SerializedSpanContext): import("@opentelemetry/api").Context; /** * A span context flattened for storage. * * `parentContext` used to accept only a live in-memory span, so a parent * that had to survive a process boundary could not be expressed at all — a * turn that crashed at iteration 12 and resumed produced two traces with * different trace ids and no link between them, and the crash and its * recovery could not be put on one timeline. Every span carries * `namzu.turn.id`, which is enough to FIND both traces by query and not * enough to see one waterfall; and that much disappears for a fork, which * starts a new session. * * Flat strings rather than the OTel type so it survives `JSON.stringify` * into a checkpoint unchanged. */ export interface SerializedSpanContext { readonly traceId: string; readonly spanId: string; readonly traceFlags: number; /** Whether the parent lives in a different process. Always true on read. */ readonly isRemote?: boolean; } /** Flatten a live span for storage, or `undefined` when there is nothing real to store. */ export declare function serializeSpan(span?: import('@opentelemetry/api').Span): SerializedSpanContext | undefined; //# sourceMappingURL=attributes.d.ts.map