import type { CreateSpanArgs, GetSpanArgs, GetSpanResponse, GetSpansArgs, GetSpansResponse, GetRootSpanArgs, GetRootSpanResponse, GetTraceArgs, GetTraceResponse, GetTraceLightResponse, ListBranchesArgs, ListBranchesResponse, ListTracesArgs, ListTracesLightResponse, ListTracesResponse, BatchCreateSpansArgs, BatchDeleteTracesArgs } from '@mastra/core/storage'; import type { DuckDBConnection } from '../../db/index.js'; /** Insert a 'start' event for a new span. */ export declare function createSpan(db: DuckDBConnection, args: CreateSpanArgs): Promise; /** Insert 'start' events for multiple spans in a single statement. */ export declare function batchCreateSpans(db: DuckDBConnection, args: BatchCreateSpansArgs): Promise; /** Delete all span events for the given trace IDs. */ export declare function batchDeleteTraces(db: DuckDBConnection, args: BatchDeleteTracesArgs): Promise; /** Reconstruct a single span from its event history. */ export declare function getSpan(db: DuckDBConnection, args: GetSpanArgs): Promise; /** Reconstruct the root span (no parent) for a trace. */ export declare function getRootSpan(db: DuckDBConnection, args: GetRootSpanArgs): Promise; /** Reconstruct all spans belonging to a trace. */ export declare function getTrace(db: DuckDBConnection, args: GetTraceArgs): Promise; /** Reconstruct lightweight spans belonging to a trace (timeline fields only). */ export declare function getTraceLight(db: DuckDBConnection, args: GetTraceArgs): Promise; export declare function listTraces(db: DuckDBConnection, args: ListTracesArgs): Promise; export declare function listTracesLight(db: DuckDBConnection, args: ListTracesArgs): Promise; /** * Reconstruct multiple spans by spanId within a single trace. Single round-trip * fetch used by the optimized {@link import('@mastra/core/storage').getBranch} * path: getStructure walks the skeleton to identify branch spanIds, then this * pulls full data for only those spans instead of the whole trace. */ export declare function getSpans(db: DuckDBConnection, args: GetSpansArgs): Promise; /** * List branch anchor spans (named-entity invocations) across all traces with * filtering, ordering, and pagination. * * Same two-stage strategy as `listTraces`: * 1. Pick candidate anchor `(traceId, spanId)` tuples from raw `span_events` * by looking only at `eventType = 'start'` rows whose `spanType` is in * {@link BRANCH_SPAN_TYPES}. Scalar filters (entity*, *Id, environment, * serviceName, startedAt range, ...) run here, against raw columns. This * avoids paying reconstruction cost for the high-volume sub-operation * events (MODEL_STEP, MODEL_CHUNK, ...) that are never anchors. * 2. Reconstruct full span data only for that narrowed set, then apply * post-aggregation filters (status / metadata / tags / endedAt range). * * When there are no post-aggregation filters, ordering + pagination happen * inside the prefilter so reconstruction runs on at most `perPage` rows. */ export declare function listBranches(db: DuckDBConnection, args: ListBranchesArgs): Promise; //# sourceMappingURL=tracing.d.ts.map