UNPKG

eve

Version:

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

21 lines (20 loc) 1.39 kB
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"; interface AgentOtelSessionContextInput { 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 {};