eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
23 lines (22 loc) • 1.52 kB
TypeScript
import { type InstrumentationSessionStartedEvent, type InstrumentationTraceSeed, type InstrumentationTurnStartedEvent } from "#instrumentation/lifecycle.js";
import type { AgentSpanIdGenerator } from "#tracing/agent-span-id-generator.js";
import type { TraceCapturePolicy } from "#tracing/otel-declaration.js";
import type { AgentSessionTraceState, AgentTraceStateStore } from "#tracing/agent-trace-state.js";
import { type AgentSamplingOperation } from "#tracing/agent-span-contract.js";
import type { ConversationEnvironment } from "#shared/conversation-context.js";
interface AgentOtelSessionContextInput {
readonly environment: ConversationEnvironment;
readonly frameworkVersion: string;
readonly idGenerator: AgentSpanIdGenerator;
readonly samplesTrace?: (traceId: string, operation?: AgentSamplingOperation) => boolean;
readonly stateStore: AgentTraceStateStore;
readonly tracePolicy?: TraceCapturePolicy;
}
type SessionMetadata = Omit<InstrumentationSessionStartedEvent, "idempotencyKey" | "type">;
interface AgentOtelSessionContext {
readonly ensureSessionContext: (event: SessionMetadata) => Promise<AgentSessionTraceState>;
readonly prepareSessionTrace: (event: InstrumentationSessionStartedEvent) => Promise<InstrumentationTraceSeed>;
readonly prepareTurnTrace: (event: InstrumentationTurnStartedEvent) => Promise<InstrumentationTraceSeed>;
}
export declare function createAgentOtelSessionContext(input: AgentOtelSessionContextInput): AgentOtelSessionContext;
export {};