import { type SpanError } from '@openai/agents-core'; import type { AgentsSpanHeader } from './headers'; export declare function withSpanAsCurrent(span: unknown, fn: () => T): T; type SpanWithLifecycle = { start: () => void; end: () => void; setError: (e: SpanError) => void; }; export declare function withScopedSpan(span: S, fn: () => T): T; export declare function withRestoredAgentsTraceContext(header: AgentsSpanHeader, fn: () => T): T; /** * Fresh AsyncLocalStorage scope preserving current trace, clearing current * span. Used by inbound handlers (Signal/Query/Update) on the no-header * path to prevent outbound-span bleed: if the Workflow body is suspended * inside an outbound interceptor's `await next(input)`, the agent-SDK * AsyncLocalStorage frame still has that outbound span as current, and an * inbound handler firing then would emit its `temporal:handle*` span as a * child of the outbound Activity span. */ export declare function withIsolatedAgentsTraceContext(fn: () => T): T; export {};