import { L as LlmSpan, J as JudgeSpan, R as Run, F as FailureClass, T as ToolSpan } from './schema-m0gsnbt3.js';
import { T as TraceStore } from './store-BcFXE6LG.js';

/**
 * Typed query helpers over TraceStore.
 *
 * Not a full SQL engine — a minimal, composable set of operators that
 * cover the canned-pipeline use cases. For ad-hoc analytics, persist to
 * NDJSON and point DuckDB at it; the schema is stable so external SQL
 * tooling works out of the box.
 */

declare function runsForScenario(store: TraceStore, scenarioId: string): Promise<Run[]>;
declare function llmSpans(store: TraceStore, runId?: string): Promise<LlmSpan[]>;
declare function toolSpans(store: TraceStore, runId?: string, toolName?: string): Promise<ToolSpan[]>;
declare function judgeSpans(store: TraceStore, runId?: string): Promise<JudgeSpan[]>;
/** Group spans by any key selector. */
declare function groupBy<T, K extends string | number>(items: T[], key: (t: T) => K): Map<K, T[]>;
/** Hash tool arguments to an orderless-key-stable string for de-duplication. */
declare function argHash(args: unknown): string;
/** Sum an LLM-span array into aggregate token + cost. */
declare function aggregateLlm(spans: LlmSpan[]): {
    inputTokens: number;
    outputTokens: number;
    cachedTokens: number;
    reasoningTokens: number;
    costUsd: number;
};
/** Pick the outcome's failure class when present, else derive 'success' from run status. */
declare function runFailureClass(run: Run): FailureClass;

export { aggregateLlm as a, argHash as b, runsForScenario as c, groupBy as g, judgeSpans as j, llmSpans as l, runFailureClass as r, toolSpans as t };
