UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

22 lines (21 loc) 1.04 kB
/** * Id generator shared by `registerOTel` and the agent OTel provider. A span * whose lifetime crosses durable worker boundaries (`invoke_agent`) is emitted * at its terminal; priming the next span id lets that span carry the * pre-allocated id its descendants already parented to. */ export declare class AgentSpanIdGenerator { #private; /** Reserves a span id for a span emitted later via {@link withSpanId}. */ allocateSpanId(): string; /** Derives one span id for a replay-stable instrumentation event. */ deriveSpanId(key: string): string; deriveTraceId(key: string): string; generateSpanId(): string; generateTraceId(): string; /** Runs `startSpan` so the next span started carries `spanId`. */ withSpanId<T>(spanId: string, startSpan: () => T): T; withTraceId<T>(traceId: string, startSpan: () => T): T; } export declare function deriveAgentSpanId(key: string): string; export declare function deriveAgentActionSpanId(sessionId: string, turnId: string, callId: string): string;