import { z } from "zod"; import dayjs from "dayjs"; import { Blob, File } from "node:buffer"; //#region ../sdk/dist/index.d.mts //#region ../shared/src/schemas/display.d.ts declare const repoFileRefSchema: z.ZodObject<{ source: z.ZodLiteral<"repo">; path: z.ZodString; mimeType: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>; /** Reference to a file that lives in the authored workspace. */ type RepoFileRef = z.infer; /** Numeric presentation options for values rendered with `format: 'number'`. */ type NumberDisplayOptions$2 = { /** Number notation used when rendering the value. */notation?: 'standard' | 'compact'; /** Compact style used when `notation: 'compact'` is enabled. */ compactDisplay?: 'short' | 'long'; /** String prepended to the rendered number, such as `$`. */ prefix?: string; /** String appended to the rendered number, such as ` ms`. */ suffix?: string; /** Minimum number of decimal places to render. */ minDecimalPlaces?: number; /** Maximum number of decimal places to render. */ maxDecimalPlaces?: number; }; /** Schema for the built-in column formatting presets. */ declare const columnFormatSchema$1: z.ZodEnum<{ number: "number"; boolean: "boolean"; file: "file"; markdown: "markdown"; json: "json"; image: "image"; html: "html"; pdf: "pdf"; audio: "audio"; video: "video"; duration: "duration"; percent: "percent"; passFail: "passFail"; stars: "stars"; }>; /** Formatting preset applied to a column value in the UI. */ type ColumnFormat$1 = z.infer; //#endregion //#region ../shared/src/schemas/trace.d.ts /** Context passed to a `traceDisplay` transform while resolving a span value. */ type TraceAttributeTransformContext$1 = { value: unknown; span: EvalTraceSpan$2; }; /** * Runner-side transform used to derive a display value from a raw trace * attribute. */ type TraceAttributeTransform$1 = (ctx: TraceAttributeTransformContext$1) => unknown; /** Schema for authored trace display config in eval or workspace config. */ declare const traceDisplayInputConfigSchema$1: z.ZodObject<{ attributes: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; transform: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; /** Trace display configuration authored by users in config or eval files. */ type TraceDisplayInputConfig$1 = z.infer; /** Schema for an error attached to a trace span. */ declare const traceSpanErrorSchema$2: z.ZodObject<{ name: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>; /** Error payload stored on a trace span. */ type EvalTraceSpanError$2 = z.infer; /** Schema for a warning attached to a trace span. */ declare const traceSpanWarningSchema$2: z.ZodObject<{ name: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>; /** Warning payload stored on a trace span. */ type EvalTraceSpanWarning$2 = z.infer; /** Schema for a persisted trace span captured during case execution. */ declare const traceSpanSchema$2: z.ZodObject<{ id: z.ZodString; parentId: z.ZodNullable; caseId: z.ZodString; kind: z.ZodString; name: z.ZodString; startedAt: z.ZodString; endedAt: z.ZodNullable; status: z.ZodEnum<{ error: "error"; running: "running"; ok: "ok"; cancelled: "cancelled"; }>; attributes: z.ZodOptional>; error: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; errors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; warning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; warnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; }, z.core.$strip>; /** Persisted trace span shape stored for each eval case run. */ type EvalTraceSpan$2 = z.infer; //#endregion //#region ../shared/src/schemas/eval.d.ts /** * Reducer used to collapse per-case values into a single duration or column * stat. * `best` selects the highest finite value and `worst` selects the lowest. */ declare const evalStatAggregateSchema$1: z.ZodEnum<{ avg: "avg"; min: "min"; max: "max"; sum: "sum"; best: "best"; worst: "worst"; }>; /** * Reducer used to collapse per-case values into a single duration or column * stat. * `best` selects the highest finite value and `worst` selects the lowest. */ type EvalStatAggregate$1 = z.infer; /** Ordered list of stats rendered in the EvalCard stats row. */ declare const evalStatsConfigSchema$1: z.ZodArray; kind: z.ZodLiteral<"cases">; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"passRate">; accent: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"duration">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"cacheHits">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"column">; key: z.ZodString; label: z.ZodOptional; aggregate: z.ZodEnum<{ avg: "avg"; min: "min"; max: "max"; sum: "sum"; best: "best"; worst: "worst"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; accent: z.ZodOptional; }, z.core.$strip>], "kind">>; /** Ordered list of stats rendered in the EvalCard stats row. */ type EvalStatsConfig$1 = z.infer; /** Structured assertion failure metadata captured for one case run. */ declare const assertionFailureSchema$1: z.ZodObject<{ name: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; }, z.core.$strip>; /** Assertion failure metadata captured for one case run. */ type AssertionFailure$1 = z.infer; /** Structured assertion result metadata captured for one case run. */ declare const assertionResultSchema: z.ZodObject<{ name: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; status: z.ZodEnum<{ pass: "pass"; fail: "fail"; }>; }, z.core.$strip>; /** Assertion result metadata captured for one case run. */ type AssertionResult = z.infer; /** Severity level for one log captured during a case run. */ declare const runLogLevelSchema$1: z.ZodEnum<{ error: "error"; log: "log"; info: "info"; warn: "warn"; }>; /** Severity level for one log captured during a case run. */ type RunLogLevel$1 = z.infer; /** Schema for one persisted log entry captured during a case run. */ declare const runLogEntrySchema$1: z.ZodObject<{ timestamp: z.ZodString; level: z.ZodEnum<{ error: "error"; log: "log"; info: "info"; warn: "warn"; }>; phase: z.ZodEnum<{ eval: "eval"; derive: "derive"; tracingAssertions: "tracingAssertions"; outputsSchema: "outputsSchema"; scorer: "scorer"; }>; message: z.ZodString; args: z.ZodDefault>; truncated: z.ZodDefault; location: z.ZodOptional; }, z.core.$strip>>; source: z.ZodOptional; }, z.core.$strip>; /** Persisted log entry captured during a case run. */ type RunLogEntry$1 = z.infer; //#endregion //#region ../shared/src/schemas/chart.d.ts /** * Ordered list of history charts rendered for an eval. Opt-in: when omitted or * empty, the UI renders no history chart at all. */ declare const evalChartsConfigSchema$1: z.ZodArray; hideIfNoValue: z.ZodOptional; dedupeConsecutiveValues: z.ZodOptional; type: z.ZodEnum<{ area: "area"; line: "line"; bar: "bar"; }>; metrics: z.ZodArray; metric: z.ZodEnum<{ passRate: "passRate"; durationMs: "durationMs"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ avg: "avg"; sum: "sum"; min: "min"; max: "max"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>], "source">>; yDomain: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; right: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; tooltipExtras: z.ZodOptional; metric: z.ZodEnum<{ passRate: "passRate"; durationMs: "durationMs"; }>; label: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ avg: "avg"; sum: "sum"; min: "min"; max: "max"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; }, z.core.$strip>], "source">>>; }, z.core.$strip>>; /** Ordered list of history charts rendered for an eval. */ type EvalChartsConfig$1 = z.infer; //#endregion //#region ../shared/src/schemas/config.d.ts /** * Built-in eval-level output/column keys. * * `costUsd` controls the default LLM cost family: actual billed cost plus the * normalized `costUsdWithoutCache` and `costUsdWarmedCache` chart outputs. */ declare const defaultConfigKeySchema: z.ZodEnum<{ apiCalls: "apiCalls"; costUsd: "costUsd"; llmTurns: "llmTurns"; inputTokens: "inputTokens"; outputTokens: "outputTokens"; totalTokens: "totalTokens"; cachedInputTokens: "cachedInputTokens"; cacheCreationInputTokens: "cacheCreationInputTokens"; reasoningTokens: "reasoningTokens"; llmDurationMs: "llmDurationMs"; }>; /** Built-in eval-level output/column key. */ type DefaultConfigKey = z.infer; /** Single authored eval case with its stable identifier and input payload. */ type EvalCase$1$1 = { id: string; input: TInput; tags?: string[]; }; /** Normalized view of one tool-call span and its common tool metadata. */ type EvalToolCallSpan = { /** Preferred tool name, using GenAI/Mastra identity metadata when present. */name: string; /** Original trace span display name. */ spanName: string; /** Original trace span kind. */ kind: string; /** Parsed tool-call arguments, or the raw value when parsing is not possible. */ arguments: unknown; /** Parsed tool-call result, or the raw value when parsing is not possible. */ result: unknown; /** Tool description from GenAI/Mastra metadata when present. */ description: string | undefined; /** Tool type from GenAI/Mastra metadata when present. */ toolType: string | undefined; /** Original span attributes. */ attributes: Record | undefined; /** Original trace span for fields not normalized above. */ span: EvalTraceSpan$2; }; /** Query helpers built from the flattened trace recorded for one eval case. */ type EvalTraceTree = { /** Flat span list in creation order. */spans: EvalTraceSpan$2[]; /** Top-level spans whose `parentId` is `null`. */ rootSpans: EvalTraceSpan$2[]; /** Return the first span whose name exactly matches `name`. */ findSpan: (name: string) => EvalTraceSpan$2 | undefined; /** Return every span whose name exactly matches `name`. */ findSpans: (name: string) => EvalTraceSpan$2[]; /** Return whether any span name exactly matches `name`. */ hasSpan: (name: string) => boolean; /** Return every span whose kind exactly matches `kind`. */ findSpansByKind: (kind: string) => EvalTraceSpan$2[]; /** Return every span with `kind: 'tool'` or `kind: 'tool_call'`. */ findToolCallSpans: () => EvalTraceSpan$2[]; /** * Return tool-call names, preferring GenAI/Mastra tool identity attributes * when available. */ listToolCallSpanNames: () => string[]; /** Return whether a tool-call span name or tool identity matches `name`. */ hasToolCallSpan: (name: string) => boolean; /** Return normalized tool-call spans whose name or tool identity matches `name`. */ getToolCallSpans: (name: string) => EvalToolCallSpan[]; /** Return how many tool-call spans have a name or tool identity matching `toolName`. */ getToolCallSpanCount: (toolName: string) => number; /** Return whether a tool-call span name or tool identity appears exactly `expectedCalls` times. */ hasToolCallSpanCount: (toolName: string, expectedCalls: number) => boolean; /** Return span names in creation order, optionally filtered by kind. */ listSpanNames: (kind?: string) => string[]; /** Return span names in depth-first tree order, optionally filtered by kind. */ listSpanNamesDfs: (kind?: string) => string[]; /** Return all spans in depth-first tree order. */ flattenDfs: () => EvalTraceSpan$2[]; checkpoints: Map; }; /** Context passed to `deriveFromTracing` after execution has completed. */ type EvalDeriveContext = { trace: EvalTraceTree; input: TInput; case: EvalCase$1$1; }; type MaybePromise$1 = T | Promise; /** Function that derives one output value for a configured output key. */ type EvalDeriveValueFn = (ctx: EvalDeriveContext) => MaybePromise$1; /** Keyed `deriveFromTracing` config where each key derives one output value. */ type EvalDeriveMap = Record>; /** Object-returning `deriveFromTracing` callback. */ type EvalDeriveFn = (ctx: EvalDeriveContext) => Record | Promise>; /** Trace-derived output config accepted globally and on eval definitions. */ type EvalDeriveConfig = EvalDeriveMap | EvalDeriveFn; /** Function that records trace-derived assertions for one case. */ type EvalTracingAssertionsFn = (ctx: EvalDeriveContext) => MaybePromise$1; /** Trace-derived assertion config accepted globally and on eval definitions. */ type EvalTracingAssertionsConfig = EvalTracingAssertionsFn; /** UI overrides for a derived or scored column emitted by an eval. */ type EvalColumnOverride = { /** Display label shown for the column in tables and detail views. */label?: string; /** Optional helper text explaining what this column represents. */ description?: string; /** * Presentation preset for the value. * * Use this to control how the UI renders the cell and infer table behavior, * for example `number`, `boolean`, `duration`, `markdown`, `json`, * `image`, `html`, `pdf`, or file/media previews. */ format?: ColumnFormat$1; /** * Extra options for `format: 'number'`. * * Use this to add a prefix or suffix, control minimum and maximum decimal * places, or switch to compact notation such as `1.2K`. */ numberFormat?: NumberDisplayOptions$2; /** * Hides the column from the runs table while keeping it available in detail * views and raw output data. */ hideInTable?: boolean; /** * Hides the column from the runs table when none of the rendered rows have a * value. Missing values, `null`, and empty strings count as no value; `0` and * `false` remain visible. */ hideIfNoValue?: boolean; /** Horizontal alignment used when rendering the column cells. */ align?: 'left' | 'center' | 'right'; /** * Maximum number of stars used when `format: 'stars'`. * * Values are still stored as normalized `0..1` numbers; the UI maps the * selected star count evenly across that range. */ maxStars?: number; }; /** Column override map keyed by output or score field name. */ type EvalColumns = Record; /** Context passed to an input-section selector callback. */ type EvalInputSectionSelectContext$1 = { /** Active eval case whose input is being prepared for display. */case: EvalCase$1$1; }; /** Function that selects one highlighted input value for case detail display. */ type EvalInputSectionSelectFn$1 = (input: TInput, ctx: EvalInputSectionSelectContext$1) => MaybePromise$1; /** * Input section selector. String values are dot-separated paths into the case * input; function values receive the full input and return the display value. */ type EvalInputSectionSelector$1 = string | EvalInputSectionSelectFn$1; /** * Rich input-section config with optional label and format metadata. * * Provide either `path` for a dot-separated input selector or `select` for a * callback. `format`, `numberFormat`, and `maxStars` use the same renderer * presets as output columns. */ type EvalInputSectionObjectConfig$1 = { /** Label shown above the highlighted input section. Defaults to the key. */label?: string; /** Dot-separated path into the case input. */ path?: string; /** Callback that returns the highlighted value from the case input. */ select?: EvalInputSectionSelectFn$1; /** Presentation preset for the selected input value. */ format?: ColumnFormat$1; /** Extra options for `format: 'number'`. */ numberFormat?: NumberDisplayOptions$2; /** Maximum number of stars used when `format: 'stars'`. */ maxStars?: number; }; /** * One highlighted input section config. Use a bare string or callback for the * common case, or an object when the section needs a label or format. */ type EvalInputSectionConfig$1 = EvalInputSectionSelector$1 | EvalInputSectionObjectConfig$1; /** Input section map keyed by stable section id. */ type EvalInputSections$1 = Record>; //#endregion //#region ../shared/src/schemas/cache.d.ts /** * Mode that controls how the cache is consulted for a given run. * * - `use`: read cache on hit, write on miss. Default. * - `bypass`: never read, never write. * - `refresh`: never read, always write (forces re-execution and overwrites). */ declare const cacheModeSchema$1: z.ZodEnum<{ use: "use"; bypass: "bypass"; refresh: "refresh"; }>; /** Mode controlling how cached spans behave during a run. */ type CacheMode$1 = z.infer; /** * Filesystem storage target for one cached operation. * * - `durable`: store under `.agent-evals/cache`, intended for small reusable * cache entries that a project may commit. * - `temporary`: store under `.agent-evals/tmp/cache`, intended for large or * local-only cache entries. */ declare const cacheStorageSchema$2: z.ZodEnum<{ durable: "durable"; temporary: "temporary"; }>; /** Filesystem storage target for one cached operation. */ type CacheStorage$2 = z.infer; /** Options accepted by an `evalTracer.span` call to opt the span into caching. */ declare const spanCacheOptionsSchema$1: z.ZodObject<{ key: z.ZodUnknown; namespace: z.ZodString; storage: z.ZodOptional>; serializeFileBytes: z.ZodOptional; }, z.core.$strip>; /** Options accepted by an `evalTracer.span` call to opt the span into caching. */ type SpanCacheOptions$1 = z.infer; /** Category of operation stored in the eval cache. */ declare const cacheOperationTypeSchema$1: z.ZodEnum<{ span: "span"; value: "value"; }>; /** Category of operation stored in the eval cache. */ type CacheOperationType$1 = z.infer; /** * Reference to a value-cache lookup performed via `evalTracer.cache(...)`. * * Refs are appended to the active span's `cache.refs` attribute when the call * happens inside a `traceSpan(...)` body, or to the case scope's * `caseCacheRefs` bucket when the call is made directly from the case body. */ declare const traceCacheRefSchema$1: z.ZodObject<{ type: z.ZodLiteral<"value">; name: z.ZodString; namespace: z.ZodString; key: z.ZodString; status: z.ZodEnum<{ bypass: "bypass"; refresh: "refresh"; hit: "hit"; miss: "miss"; }>; storage: z.ZodOptional>; read: z.ZodOptional; stored: z.ZodOptional; storedAt: z.ZodOptional; age: z.ZodOptional; }, z.core.$strip>; /** Reference to a value-cache lookup performed via `evalTracer.cache(...)`. */ type TraceCacheRef = z.infer; /** Serialized nested span captured while recording a cached operation. */ type SerializedCacheSpan$2 = { kind: string; name: string; attributes?: Record; status: 'running' | 'ok' | 'error' | 'cancelled'; error?: EvalTraceSpanError$2; errors?: EvalTraceSpanError$2[]; warning?: EvalTraceSpanWarning$2; warnings?: EvalTraceSpanWarning$2[]; children: SerializedCacheSpan$2[]; }; /** * One captured operation performed while a cached span's body executed. * * Operations are replayed in order against a fresh scope on cache hit to * reproduce the observable effects of the original run. */ declare const cacheRecordingOpSchema$1: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"setOutput">; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">; /** Single effect captured by a cache recording. */ type CacheRecordingOp$1 = z.infer; /** * Captured observable effects + return value of a cached span body. * * Persisted JSON omits object properties whose value is `undefined`; parsing * normalizes an omitted `returnValue` back to an explicit undefined return. */ declare const cacheRecordingSchema$1: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions$2 | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan$2; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions$2 | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan$2; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; /** Captured observable effects + return value of a cached span body. */ type CacheRecording$1 = z.output; /** Persisted cache file containing metadata and a recording. */ declare const cacheEntrySchema$1: z.ZodObject<{ version: z.ZodLiteral<1>; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodOptional>; operationName: z.ZodOptional; spanName: z.ZodOptional; spanKind: z.ZodOptional; storedAt: z.ZodString; recording: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions$2 | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan$2; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions$2 | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan$2; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; }, z.core.$strip>; /** Persisted cache file contents. */ type CacheEntry$1 = z.infer; //#endregion //#region src/types.d.ts /** * Augment this interface to narrow accepted tag names for direct * `@agent-evals/sdk` imports. * * @example * ```ts * declare module '@agent-evals/sdk' { * interface AgentEvalTagRegistry { * tags: 'refunds' | 'slow'; * } * } * ``` */ interface AgentEvalTagRegistry$1 { /** Internal marker so the interface can be safely augmented by users. */ __agentEvalTagRegistry?: never; } /** Tag name accepted by eval definitions, cases, and runtime tag checks. */ type EvalTag$1 = AgentEvalTagRegistry$1 extends { tags: infer T; } ? Extract : string; /** Typed input accepted by {@link matchesEvalTags}. */ /** Single authored eval case with its stable identifier, input, and tags. */ type EvalCase$2 = Omit, 'tags'> & { /** Additional tags applied only to this case. */tags?: EvalTag$1[]; }; /** Runtime output values collected from output helpers and `deriveFromTracing`. */ type EvalOutputs = Record; /** * Display options that can be attached directly to one `setOutput(...)` write. * * Pass a format string such as `'markdown'` for the common case, or an * `EvalColumnOverride` when the output also needs a label, numeric formatting, * table visibility, alignment, helper description, or star count. */ type EvalOutputOptions = ColumnFormat$1 | EvalColumnOverride; /** * Initial wall-clock time used by an eval's shifted Date clock. * * Pass `'now'` to opt one eval back into the real current clock. */ type EvalStartTime = Date | number | string; /** * Schema used to validate and type an eval's collected runtime outputs. * * Zod schemas are supported directly. The runner validates after `execute` and * `deriveFromTracing` finish, before computed scores run. */ type EvalOutputsSchema = z.ZodType; /** Per-eval controls for SDK operation caching. */ type EvalCacheConfig = { /** * Whether cached spans and value caches may read existing persisted entries. * * Defaults to `true`. Set to `false` when this eval should always execute * cached operations instead of replaying previous results. */ read?: boolean; /** * Whether cached spans and value caches may persist entries after execution. * * Defaults to `true`. Set to `false` when this eval may reuse existing cache * entries but must not create or refresh stored cache files. */ store?: boolean; }; /** Type-safe output writer passed to an eval's `execute` function. */ type EvalSetOutput = >( /** * Output field to record. For narrowed output maps, this must be one of the * known output keys. */ key: TKey, /** * Value for the output field. For narrowed output maps, this must match the * field's declared output type. */ value: TOutputs[TKey], /** * Optional display format or column override for this output. Runtime * options are persisted with the case result and are useful when a one-off * output should render as Markdown, JSON, media, a number, duration, etc. */ options?: EvalOutputOptions) => void; /** Context passed to an eval's `execute` function for a single case run. */ type EvalExecuteContext = { /** Authored input for the active eval case. */input: TInput; /** * Record or replace an output value for the current case scope. * * When the eval has a narrowed outputs generic, keys and values are typed * from that output map. The recorded values are still validated by * `outputsSchema` before computed scores run. */ setOutput: EvalSetOutput; }; /** Context passed to score functions after outputs have been collected. */ type EvalScoreContext = { input: TInput; outputs: TOutputs; case: EvalCase$2; }; /** Score callback that computes a numeric result for one case. */ type EvalScoreFn = (ctx: EvalScoreContext) => number | Promise; /** * Score definition accepted by `defineEval`, with optional UI metadata. * * When `passThreshold` is provided, this score gates the case pass/fail: * a case fails if its computed value is strictly below the threshold. A * score without a `passThreshold` is informational only and never causes * a case to fail on its own. */ type EvalScoreDef = EvalScoreFn | ({ compute: EvalScoreFn; passThreshold?: number; } & EvalColumnOverride); /** * Manual score definition accepted by `defineEval`. * * Manual scores are emitted as score columns with pending values during CLI * execution. The web UI is responsible for setting their normalized `0..1` * values after a run completes. */ type EvalManualScoreDef = Omit & { /** * Required review instructions shown alongside the manual score column. * Spell out exactly what a human reviewer should inspect before entering * the score. */ description: string; /** * Optional pass/fail gate applied after a value is filled. Pending manual * values keep the eval in an `unscored` state instead of failing the case. */ passThreshold?: number; }; /** * Per-field override applied on top of the configuration derived from the * eval's `manualInput.schema`. Every property is optional; missing values * fall back to whatever the schema-walker inferred. */ type ManualInputFieldOverride = { /** Display label rendered next to the field. Defaults to a humanised key. */label?: string; /** Optional helper text rendered under the label. */ description?: string; /** Optional placeholder rendered inside the input. */ placeholder?: string; /** * Force the textarea/multiline widget for a string field. By default a * `z.string()` field renders as a single-line text input. */ multiline?: boolean; /** * Suggested number of visible textarea rows when `multiline` is enabled or * the field falls back to the JSON widget. UIs may clamp this value. */ rows?: number; /** * Force the JSON textarea widget. Use when a field's Zod type is supported * natively but you want the raw JSON authoring experience instead. */ asJson?: boolean; /** * Force the file/image upload widget. The runtime value will be a * {@link ManualInputFileValue} carrying the original file name, mime type, * size in bytes, content hash, and workspace-relative artifact path. The * field's Zod schema should accept that shape — use * {@link manualInputFileValueSchema}. */ asFile?: boolean; /** * Browser `accept` attribute for the file picker (e.g. `image/*`, * `image/png,image/jpeg`, `.pdf`). Only used when `asFile` is true. */ accept?: string; /** * Optional maximum file size in bytes enforced client-side before the value * is sent to the server. Only used when `asFile` is true. */ maxSizeBytes?: number; /** * Override the inferred default value. Useful when the schema has no * `.default()` but you want the modal to prefill a starting value. */ defaultValue?: unknown; /** * Override the inferred select options. Each entry may be a plain string * (used as both value and label) or a `{ value, label }` pair. */ options?: Array; }; /** * Runtime shape produced by the manual-input file widget. File bytes are * persisted as a real workspace-relative artifact so run inputs stay readable * and coding agents can inspect uploaded files directly on disk. */ type ManualInputFileValue = { /** Original file name as reported by the browser. */name: string; /** Detected MIME type (`''` when the browser could not determine one). */ mimeType: string; /** File size in bytes. */ sizeBytes: number; /** SHA-256 hash of the persisted file bytes, encoded as lowercase hex. */ sha256: string; /** Workspace-relative path to the persisted file artifact. */ path: string; }; /** * Per-field override map accepted by `manualInput.fields`. Keys must match a * top-level field on the eval's `manualInput.schema` object shape. */ type ManualInputFieldsConfig = { [K in Extract]?: ManualInputFieldOverride }; /** * Manual-input configuration for an eval. When set, every run of the eval * pauses on a modal in the web UI (or requires `--input` / `--input-file` * in the CLI) until the user submits values matching `schema`. The * validated values become the input for a single synthetic case per run. * * `schema` is bound to the eval's `TInput` generic, so the values delivered * to `execute` are end-to-end type-safe. Authoring `cases` and `manualInput` * on the same eval is rejected at discovery time. */ type EvalManualInputConfig = { /** Zod schema describing the user-entered input. Must produce `TInput`. */schema: z.ZodType; /** Optional title shown in the modal header. Defaults to the eval title. */ title?: string; /** Optional helper text rendered above the form. */ description?: string; /** Optional submit button label. Defaults to `Run`. */ submitLabel?: string; /** * Optional per-field overrides merged on top of the configuration derived * from `schema`. Keys must match a top-level field on the schema's object * shape. */ fields?: ManualInputFieldsConfig; }; type EvalDefinitionOutputSchemaConfig = [EvalOutputs] extends [TOutputs] ? { /** * Optional schema for runtime outputs collected through output helpers * and `deriveFromTracing`. * * The runner validates configured output fields before scoring. For * Zod object schemas, only declared keys are passed to the schema; * parsed fields are merged back into the raw output map, so schema * defaults and transforms apply to configured fields while * unconfigured outputs are kept unchanged. Validation failures mark * the case as failed and skip computed scores. */ outputsSchema?: EvalOutputsSchema; } : { /** * Required schema for typed runtime outputs collected through output * helpers and `deriveFromTracing`. * * When `EvalDefinition` or `defineEval` receives an explicit narrowed * outputs generic, this schema is required so scorer inputs are backed * by runtime validation before computed scores run. */ outputsSchema: EvalOutputsSchema; }; type EvalDefinitionBase = { /** * Stable eval identifier within the authored eval file. * * The runner combines this value with the workspace-relative file path to * form the eval key used for targeting, persisted runs, and UI navigation. */ id: string; /** * Human-readable eval name shown in the CLI and web UI. * * When omitted, consumers fall back to `id`. */ title?: string; /** * Optional short summary shown in discovery surfaces such as the CLI list and * eval cards. Use it to explain the behavior, workflow, or risk area this * eval covers. */ description?: string; /** * Tags applied to every case in this eval, in addition to workspace-wide * tags from `agent-evals.config.ts`. */ tags?: EvalTag$1[]; /** * Workspace-wide tags this eval should not inherit. Each tag must be present * in `AgentEvalsConfig.tags`; removing unknown tags is reported during * discovery. */ removeTags?: EvalTag$1[]; /** * Per-eval cache controls. Both `read` and `store` default to `true`. * * `read: false` skips cache lookups for this eval. `store: false` prevents * new or refreshed entries from being written while still allowing reads * unless `read` is also disabled. */ cache?: EvalCacheConfig; /** * Authored cases for this eval. * * When omitted or resolved to an empty array, the runner still executes the * eval once using a synthetic case with empty object input. * * Mutually exclusive with `manualInput`: declaring both raises a discovery * issue and prevents the eval from running. Manual-input evals always * produce a single synthetic case whose input is the user-submitted value. */ cases?: EvalCase$2[] | (() => Promise[]>); /** * Pause every run on a modal in the web UI (or require `--input` / * `--input-file` from the CLI) and use the user-submitted, schema-validated * value as the case input. * * Default field configuration is derived from `manualInput.schema`; per * field overrides under `manualInput.fields` can replace labels, mark a * string field as multiline, override the default value, etc. Mutually * exclusive with `cases`. */ manualInput?: EvalManualInputConfig; /** * Output and score column display overrides for this eval. * * Use this to label, format, group, hide, or otherwise customize columns * produced by default config, output helpers, `deriveFromTracing`, scores, * or manual scores. */ columns?: EvalColumns; /** * Highlight important case input values as separate sections in the Input * tab. Use a dot selector (`'prompt.data.test'`), a callback * (`(input) => value`), or an object with `path` / `select` plus label and * format metadata. * * `file://` URL strings selected by an input section are copied into the run * artifacts and rendered as files/media when their extension is supported. */ inputSections?: EvalInputSections$1; /** * Per-eval trace attribute display rules for the UI. * * These are merged with the global `AgentEvalsConfig.traceDisplay` rules. * Matching entries override the global rule by `key`, or by `path` when no * `key` is provided. */ traceDisplay?: TraceDisplayInputConfig$1; /** * Whether registered background jobs should finish before outputs, tracing, * and scores are finalized. Defaults to `true`. * * Set to `false` for evals that intentionally fire work that should not * delay case finalization; late mutations are not guaranteed to persist. */ waitForBackgroundJobs?: boolean; /** * Optional initial wall-clock time for this eval's runtime. * * When set, `new Date()` and `Date.now()` inside case generation, execution, * tracing, derived outputs, and scorers start from this wall-clock value and * then continue advancing with real elapsed time. The default is * `2026-04-10T00:00:00.000Z`. Pass `'now'` to use the real current clock for * this eval. Timers are not faked, so `setTimeout` and other asynchronous * work still run normally. */ startTime?: EvalStartTime; /** * Freeze the eval Date clock at `startTime` until `evalTime.advance(...)` * moves it manually. Defaults to `false`, so eval time advances with real * elapsed time from the configured `startTime`. */ freezeTime?: boolean; /** * Run one eval case. * * The callback receives the authored case input and a typed `setOutput` * helper. It may record outputs, run assertions, start traced work, and * return either synchronously or asynchronously. Thrown errors fail the * active case and skip later computed scores for that case. */ execute: (ctx: EvalExecuteContext) => Promise | void; /** * Derive additional output fields from the case trace after `execute`. * * Prefer the keyed map form when each key has one derivation. The * object-returning callback form is also supported. Derived values only fill * keys not already recorded during execution. Assertion helpers are not * allowed here; use `tracingAssertions` for trace-derived pass/fail checks. */ deriveFromTracing?: EvalDeriveConfig; /** * Record assertions from the finished execution trace. * * Runs after `deriveFromTracing` and before output schema validation and * scores. Use `evalAssert(...)` or `evalExpect(...)` inside the callback to * write normal assertion results without creating score columns. */ tracingAssertions?: EvalTracingAssertionsConfig; /** * Computed score columns for each case. * * Each key becomes a persisted score column. A score can be a bare callback * or an object with UI metadata and an optional `passThreshold`; thresholds * fail a case only when the computed value is strictly below the threshold. */ scores?: Record>; /** * Score columns whose values are entered in the web UI after a run. * * Keys become persisted score columns, initialized as pending (`null`) for * every case. Once filled, values are normalized numbers in the `0..1` * range and participate in summaries, stats, charts, and pass thresholds * like computed scores. */ manualScores?: Record; /** * Optional stats row configuration for the EvalCard in the web UI. * * Opt-in: when omitted (or empty) the EvalCard renders no stats row at all. * When provided, the stats render in order, left to right. * * Built-in kinds (`cases`, `passRate`, `duration`, `cacheHits`) read from * the latest run. `duration` aggregates finite per-case durations using the * same modes as column stats. `cacheHits` counts Agent Eval operation-level * cache hits over total cache operations, not LLM provider prompt-cache read * tokens. Cache-hit stats have their own aggregate mode and default to `sum`; * `avg` is average per-case hit rate, and min/max/best/worst select cases by * hit rate. `kind: 'column'` aggregates a score or numeric output column * across the latest run's cases — `key` must match one of the eval's score or * column keys, and only finite numeric values participate in the reduction. * When no case has a numeric value for the key the stat renders an em dash, or * hides when `hideIfNoValue` is true. `label`, `format`, and `numberFormat` * default to the matching `ColumnDef`. */ stats?: EvalStatsConfig$1; /** * Initial aggregate mode used for this eval's duration and column stats in * the web UI. * * Overrides `AgentEvalsConfig.defaultStatAggregate`. Individual stat * `aggregate` values still define their authored reducer and remain the * fallback when neither default is configured. */ defaultStatAggregate?: EvalStatAggregate$1; /** * Optional history chart configuration for the EvalCard in the web UI. * * Opt-in: when omitted (or empty) the EvalCard renders no history chart at * all. Each entry in the list renders as its own chart frame, stacked in * authoring order. * * Each chart declares its `type` (`area | line | bar`) and one or more * `metrics`. Built-in metrics (`passRate`, `durationMs`) aggregate * the run summary. Column metrics aggregate a score or numeric output column * across the run using an `aggregate` reducer (`avg`, `sum`, `min`, `max`, * `latest`, `passThresholdRate`). `passThresholdRate` requires a score column * with `passThreshold`. Set `hideIfNoValue` to hide a chart until at least * one metric has a numeric value in the rendered history window. Set * `dedupeConsecutiveValues` to drop consecutive history points when the * chart's plotted metrics and tooltip extras match the previous kept point. */ charts?: EvalChartsConfig$1; /** * Remove built-in eval-level outputs, columns, stats, and charts. * * By default the runner derives usage fields from trace spans using the * workspace `llmCalls` and `apiCalls` configs. Set to `true` to remove all * defaults for this eval, or pass specific keys such as * `['costUsd', 'apiCalls']` to remove only those defaults. Per-eval removals * are combined with global removals. */ removeDefaultConfig?: true | DefaultConfigKey[]; }; /** * Complete authored eval definition consumed by `defineEval`. * * `outputsSchema` is optional for the default loose output map. When the * `TOutputs` generic is narrowed, `outputsSchema` is required so the runtime * validates collected outputs before exposing them as typed scorer inputs. */ type EvalDefinition$1 = EvalDefinitionBase & EvalDefinitionOutputSchemaConfig; //#endregion //#region src/defineEval.d.ts /** * Registered eval metadata tracked by the SDK during module loading. * * Consumers usually access these entries through `getEvalRegistry()`. */ type EvalRegistryEntry = { /** Stable eval identifier authored in `defineEval(...)`. */id: string; /** Optional human-readable eval name. */ title?: string; /** Optional short summary describing what the eval covers. */ description?: string; /** Read the registered definition without erasing its input/output generics. */ use: (fn: (def: EvalDefinition$1) => R) => R; }; /** Return the in-memory registry of evals defined in the current process. */ declare function getEvalRegistry(): Map; /** * Execute a callback with an empty async-local eval registry. * * Runner internals use this when importing eval modules concurrently so * `defineEval(...)` calls from one import cannot overwrite another import's * registered definitions. The callback receives the scoped registry populated * during its async execution. */ //#endregion //#region src/evalExpect.d.ts /** * Focused expectation helpers for eval case invariants. * * These matchers intentionally cover comparisons that produce clearer failure * messages than a plain `evalAssert(...)`. Use `evalAssert(...)` directly for * truthiness checks and custom type narrowing. */ type EvalExpectation = { /** Invert the next matcher. */readonly not: EvalExpectation; /** Assert strict `Object.is(...)` equality. */ toBe(expected: unknown): void; /** Assert Node.js deep strict equality. */ toEqual(expected: unknown): void; /** Assert that object properties recursively match the expected subset. */ toMatchObject(expected: Record): void; /** Assert substring, array item, or set item containment. */ toContain(expected: unknown): void; /** Assert the value has a numeric `length` equal to `expected`. */ toHaveLength(expected: number): void; /** Assert a dot-path property exists, optionally with a deep-equal value. */ toHaveProperty(path: string, ...expected: [] | [unknown]): void; /** Assert the received number is greater than `expected`. */ toBeGreaterThan(expected: number): void; /** Assert the received number is greater than or equal to `expected`. */ toBeGreaterThanOrEqual(expected: number): void; /** Assert the received number is less than `expected`. */ toBeLessThan(expected: number): void; /** Assert the received number is less than or equal to `expected`. */ toBeLessThanOrEqual(expected: number): void; /** Assert the received number is close to `expected` at `precision` decimals. */ toBeCloseTo(expected: number, precision?: number): void; /** Assert the received string matches the regular expression. */ toMatch(expected: RegExp): void; }; /** * Create focused expectation helpers for the current eval case. * * Failed expectations record assertion failures and throw only while an eval * case scope is active, matching `evalAssert(...)`. */ declare function evalExpect(value: T): EvalExpectation; //#endregion //#region src/manualInputFile.d.ts /** * Zod schema describing one file uploaded through the manual-input modal. * * Use this as the field type on your `manualInput.schema` whenever you mark * a field with `{ asFile: true }` in `manualInput.fields`. The UI / CLI stages * the selected file on disk, the runner materializes it into the run artifacts * directory, and the server validates this JSON metadata against the schema * before flowing it into the case input. * * @example * ```ts * const schema = z.object({ * image: manualInputFileValueSchema, * note: z.string().optional(), * }); * * defineEval({ * id: 'image-analyzer', * manualInput: { * schema, * fields: { image: { asFile: true, accept: 'image/*' } }, * }, * // ... * }); * ``` */ declare const manualInputFileValueSchema: z.ZodObject<{ name: z.ZodString; mimeType: z.ZodString; sizeBytes: z.ZodNumber; sha256: z.ZodString; path: z.ZodString; }, z.core.$strip>; /** Resolved file content and convenience views for a manual-input file. */ type ReadManualInputFileResult = { /** Metadata supplied to the eval input. */value: ManualInputFileValue; /** Absolute path resolved from {@link ManualInputFileValue.path}. */ absolutePath: string; /** Raw file bytes. */ bytes: Uint8Array; /** Copy of {@link bytes} as an `ArrayBuffer`. */ arrayBuffer: ArrayBuffer; /** Bytes wrapped as a `Blob` with the input MIME type. */ blob: Blob; /** Bytes wrapped as a `File` with the input name and MIME type. */ file: File; /** Decode the file bytes as UTF-8 text. */ text: () => Promise; /** Parse the file bytes as JSON. */ json: () => Promise; }; /** * Read a manual-input file artifact from disk and expose common byte, Blob, * File, text, and JSON views for eval code. * * @param value Manual-input file metadata received by an eval. * @param options.cwd Directory used to resolve relative paths. Defaults to `process.cwd()`. * @returns File bytes plus convenience views for common file-processing flows. */ declare function readManualInputFile(value: ManualInputFileValue, options?: { cwd?: string; }): Promise; //#endregion //#region src/repoFile.d.ts /** * Create a file reference that can be emitted via `setEvalOutput(...)` and rendered * by a column configured with `format: 'image' | 'html' | 'pdf' | 'audio' | * 'video' | 'file'`. * * @param path Relative or absolute path to the repository file. * @param mimeType Optional MIME type hint for UI rendering. * @param sizeBytes Optional file size hint shown by artifact cards in the UI. * @returns A repo-backed file reference suitable for file/media columns. */ declare function repoFile(path: string, mimeType?: string, sizeBytes?: number): RepoFileRef; //#endregion //#region src/cacheSerialization.d.ts declare const serializedCacheValueMarker = "__aecs"; type JsonSafeCacheValueType = 'ArrayBuffer' | 'ArrayBufferView' | 'BigInt' | 'Blob' | 'Date' | 'Error' | 'ExternalJson' | 'File' | 'Float64Array' | 'Headers' | 'Map' | 'Number' | 'Object' | 'RegExp' | 'Set' | 'URL' | 'URLSearchParams' | 'Undefined'; type JsonSafeSerializedCacheValue = { [serializedCacheValueMarker]: `v1:${JsonSafeCacheValueType}`; compressedLength?: number; hash?: string; length?: number; path?: string; value?: unknown; }; /** JSON-safe persisted representation for one rich cached value. */ type SerializedCacheValue = JsonSafeSerializedCacheValue; /** Metadata for a Brotli-compressed external JSON blob. */ type ExternalJsonBlobRef = { /** Original UTF-8 JSON byte length. */length: number; /** Brotli-compressed byte length. */ compressedLength: number; /** SHA-256 digest of the original UTF-8 JSON payload. */ hash: `sha256:${string}`; /** Store-relative Brotli blob path. */ path: string; }; /** Store used by cache serialization for large nested JSON values. */ type CacheSerializationExternalJsonStore = { /** Persist canonical JSON and return its content-addressed ref. */write(rawJson: string): Promise; /** Read a previously persisted canonical JSON payload. */ read(ref: ExternalJsonBlobRef): Promise; }; /** Options controlling how rich cache values are persisted as JSON-safe data. */ type CacheSerializationOptions = { /** Preserve JavaScript `undefined` values with explicit tagged wrappers. */preserveUndefined?: boolean; /** Externalize large nested JSON values through Brotli blob refs. */ compress?: boolean; /** Store used for large nested JSON values when `compress` is enabled. */ externalJsonStore?: CacheSerializationExternalJsonStore; }; /** * Serialize one cached value while keeping plain JSON as plain JSON. * * Rich runtime values use small tagged wrappers. Undefined values are omitted * by default; pass `preserveUndefined: true` to round-trip them explicitly. */ declare function serializeCacheValue(value: unknown, options?: CacheSerializationOptions | undefined): Promise; /** Revive one cached value, while preserving legacy JSON-round-tripped data. */ declare function deserializeCacheValue(value: unknown): unknown; /** Replace external JSON blob refs with their parsed serialized payloads. */ /** * Serialize all rich values captured in a cache recording before persistence. * * Undefined values are omitted by default; pass `preserveUndefined: true` to * retain the legacy explicit undefined wrappers in the recording payload. */ declare function serializeCacheRecording(recording: CacheRecording$1, options?: CacheSerializationOptions | undefined): Promise; /** Revive all rich values captured in a cache recording after lookup. */ declare function deserializeCacheRecording(recording: CacheRecording$1): CacheRecording$1; //#endregion //#region src/runtime.d.ts declare global { var __agentEvalsRealDate: DateConstructor | undefined; } /** * Raw-key debug payload passed alongside cache writes. * * `rawKey` may include prompt text, user input, or other sensitive material. * Runners store it outside the reusable cache so projects can gitignore the * debug folder while keeping hash-only cache entries shareable. */ type CacheDebugKeyWrite = { rawKey: unknown; operationType: CacheOperationType$1; operationName: string; }; /** * Adapter used by the SDK to read and write cache entries. * * Implementations are typically injected by the runner before the eval case * starts executing. */ type CacheAdapter = { /** Return the stored entry for `keyHash` under `namespace`, or `null`. */lookup(namespace: string, keyHash: string): Promise; /** Optional store for large nested JSON values persisted outside cache JSON. */ externalJsonStore?: CacheSerializationExternalJsonStore; /** * Persist a cache entry. Must be safe under concurrent calls. * * `debugKey` is optional and contains the authored raw key value for * debugging. It may contain sensitive prompt/input data and should be stored * separately from reusable cache files. */ write(entry: CacheEntry$1, debugKey?: CacheDebugKeyWrite): Promise; }; /** Runner-supplied cache context attached to an eval case scope. */ type CacheScopeContext = { /** Durable cache adapter used for committed/shareable cache entries. */adapter: CacheAdapter; /** Temporary cache adapter used for local-only cache entries. */ temporaryAdapter?: CacheAdapter; mode: CacheMode$1; evalId: string; /** * Whether cache lookups are allowed for this eval scope. Defaults to `true`. * * Run-level `bypass` and `refresh` modes still take precedence and skip * reads even when this is enabled. */ read?: boolean; /** * Whether cache writes are allowed for this eval scope. Defaults to `true`. * * Run-level `bypass` still takes precedence and skips writes even when this * is enabled. */ store?: boolean; }; /** Active recording frame captured while a cached operation body executes. */ type CacheRecordingFrame = { /** Length of `scope.spans` immediately before the cached body started. */baseSpanIndex: number; /** Parent id used when recording and replaying direct child spans. */ replayParentSpanId: string | null; /** Spans created by this cache body's async execution branch. */ spanIds: Set; /** Non-cache attributes written to the replay parent by this async branch. */ finalAttributes: Record; /** Ordered observable effects recorded during the cached body. */ ops: CacheRecordingOp$1[]; }; /** Mutable per-case runtime state stored in async local storage. */ type EvalCaseScope = { caseId: string; /** Initial wall-clock time used by Date APIs inside this eval case. */ startTime: EvalStartTime | undefined; /** Mutable shifted wall-clock state shared across this eval case's phases. */ evalClockState: { startMs: number; realStartMs: number; offsetMs: number; frozen: boolean; shifted: boolean; }; /** Stable prefix used by `nextEvalId()` for this eval case scope. */ idPrefix: string | undefined; /** Monotonic per-scope counter used by `nextEvalId()`. */ nextEvalIdCounter: number; /** Authored input for the current case, when provided by the runner. */ input?: unknown; /** Effective tags for the current case. */ tags: string[]; outputs: Record; /** Runtime display overrides recorded by output helpers for this case. */ outputColumnOverrides: Record; /** Structured assertion results recorded for the current case. */ assertions: AssertionResult[]; /** Structured assertion failures recorded for the current case. */ assertionFailures: AssertionFailure$1[]; /** Logs captured from manual `evalLog(...)` calls and enabled console calls. */ logs: RunLogEntry$1[]; spans: EvalTraceSpan$2[]; checkpoints: Map; /** * Incremented while replaying a cached operation, so nested SDK calls do not * accidentally double-record ops into outer recorders. */ replayingDepth: number; /** Runner-provided cache adapter + mode; absent when caching is disabled. */ cacheContext: CacheScopeContext | undefined; /** * Value-cache refs recorded by `evalTracer.cache(...)` calls made with no * active span. Span-bound refs are appended to the owning span's * `cache.refs` attribute instead. */ caseCacheRefs: TraceCacheRef[]; /** Background promises that should settle before the case scope finalizes. */ pendingBackgroundJobs: Set>; }; /** * Runtime phase currently owned by the eval runner. * * `null` means the current async execution is outside an eval run. `env` * covers run-time module/environment loading, including top-level code in * modules imported while a run is being prepared. */ type EvalRuntimeScope = 'env' | 'cases' | 'eval' | 'derive' | 'tracingAssertions' | 'outputsSchema' | 'scorer'; type EvalLogLevelInput = RunLogLevel$1 | 'warning'; /** Error thrown when an eval assertion fails during case execution. */ declare class EvalAssertionError extends Error { constructor(message: string); } /** Error thrown when an SDK helper is used in an unsupported runner phase. */ declare class EvalRuntimeUsageError extends Error { constructor(message: string); } /** Return the host process clock, bypassing the eval Date shim. */ /** * Eval time helpers for reading and moving the active eval clock. * * `startTime` is a Dayjs object for the wall-clock start captured for the * active eval. For `startTime: 'now'`, it reflects the real time captured when * the eval clock context was created. Dayjs objects are immutable, so * `evalTime.startTime.add(5, 'minutes')` computes a derived time without * moving the active eval clock. */ declare const evalTime: { /** Create a Dayjs object with the same arguments as `dayjs(...)`. */dayjs: typeof dayjs; /** Dayjs wall-clock start captured for the active eval. */ readonly startTime: dayjs.Dayjs; /** * Move the active shifted Date clock and return the new current eval time. * * Throws outside an active shifted eval clock. Evals that set * `startTime: 'now'` use the real current clock unless `freezeTime: true` is * also set. */ advance: (amount: number, unit: dayjs.ManipulateType) => dayjs.Dayjs; }; /** Execute a callback with the eval Date clock shifted from `startTime`. */ /** Return the current eval scope for the active async context, if any. */ declare function getCurrentScope(): EvalCaseScope | undefined; /** * Return the current eval runner phase for this async execution. * * Returns `null` outside eval-owned work, `env` while the runner is loading * eval modules for a run, `cases` while generating cases, `eval` while running * case `execute`, `derive` while deriving outputs from traces, * `tracingAssertions` while checking trace-derived assertions, * `outputsSchema` while validating outputs, and `scorer` while computing * scores. */ declare function isInEvalScope(): EvalRuntimeScope | null; /** * Return whether the current eval case has tags matching the typed input. * * Calls outside an eval case scope return `false`. */ /** * Record a manual log entry on the active eval case. * * Values are formatted with Node-style console formatting and capped before * persistence so a single log cannot make run artifacts unbounded. Calls made * outside active case-owned eval phases are ignored. */ declare function evalLog(level: EvalLogLevelInput, ...args: unknown[]): void; /** * Register background work that should settle before eval finalization. * * The original promise is returned unchanged, and its fulfillment or rejection * behavior remains normal for callers. The eval runtime only waits for * settlement; it does not convert background rejections into case errors. */ declare function startEvalBackgroundJob(promise: Promise): Promise; /** * Return the authored input for the current eval case. * * Pass a dot-separated path to read nested values, for example * `getEvalCaseInput('customer.tier')`. Calls outside an eval case scope return * `undefined` so shared workflow code can safely use this helper. */ declare function getEvalCaseInput(): unknown; declare function getEvalCaseInput(path: string): unknown; /** * Attach cache context (adapter, mode, eval id, fingerprint) to a scope. * * Runner-internal helper called immediately before the user's `execute` * function runs inside `runInEvalScope`. */ declare function setScopeCacheContext(scope: EvalCaseScope, context: CacheScopeContext): void; /** Optional inputs accepted when starting a new eval case scope. */ type RunInEvalScopeOptions = { /** Authored input for the active eval case. */input?: unknown; /** Effective tags for the active eval case. */ tags?: string[]; /** Stable prefix used when generating scoped IDs with `nextEvalId()`. */ idPrefix?: string; /** Cache adapter + mode attached to the scope before `fn` runs. */ cacheContext?: CacheScopeContext; /** Whether registered background jobs should settle before scope finalizes. */ waitForBackgroundJobs?: boolean; /** Eval runner phase exposed through `isInEvalScope()`. Defaults to `eval`. */ runtimeScope?: EvalRuntimeScope; /** Initial wall-clock time used by `new Date()` and `Date.now()` in this eval. */ startTime?: EvalStartTime; /** Whether Date APIs stay frozen until advanced manually. */ freezeTime?: boolean; }; /** Execute a callback while `isInEvalScope()` reports a runner phase. */ declare function runInEvalRuntimeScope(runtimeScope: EvalRuntimeScope, fn: () => Promise | T): Promise; /** * Execute a callback with an existing case scope and a specific runner phase. * * Runner-internal helper for post-execute phases that still need access to the * completed case scope through output, trace, assertion, and input helpers. */ declare function runInExistingEvalScope(scope: EvalCaseScope, runtimeScope: EvalRuntimeScope, fn: () => Promise | T): Promise; /** * Execute a callback inside a fresh eval case scope and capture its outputs, * trace data, and terminal error state. */ declare function runInEvalScope(caseId: string, fn: () => Promise | T, options?: RunInEvalScopeOptions): Promise<{ result: T | undefined; scope: EvalCaseScope; error: Error | undefined; }>; /** * Return the next deterministic ID for the active eval case execution. * * The runner derives the ID prefix from the eval file, eval id, and case id, * then this helper appends a per-scope sequence number. Calls outside an * active eval case scope throw so accidental product-code usage is caught * immediately. */ declare function nextEvalId(): string; /** * Record or replace an output value for the current case scope. * * Supported values include scalars, JSON-safe objects/arrays, explicit file * refs, and native `Blob`/`File` instances for media or file columns. * * Pass the optional third argument to persist a display format or full column * override with this runtime output, for example `'markdown'` or * `{ label: 'Receipt', format: 'image', hideInTable: true }`. */ declare function setEvalOutput(key: string, value: unknown, options?: EvalOutputOptions | undefined): void; /** * Append an item to an output array in the current case scope. * * Missing values become `[value]`, existing arrays receive the item, and * existing scalar/object values are preserved as `[existing, value]`. */ declare function appendToEvalOutput(key: string, value: unknown): void; /** * Shallow-merge object fields into an output value in the current case scope. * * Missing values become a copy of `patch`. Non-object existing values are * recorded as assertion failures instead of being replaced. */ declare function mergeEvalOutput(key: string, patch: Record): void; /** * Add a numeric delta to an output value in the current case scope. * * If the existing value is non-numeric, the operation is recorded as an * assertion failure instead of mutating the output. */ declare function incrementEvalOutput(key: string, delta: number): void; /** * Assert a truthy condition for the current eval case and throw on failure. * * Calls made outside `runInEvalScope(...)` are ignored so shared workflow code * can safely reuse `evalAssert(...)` when it also runs outside an eval. The * TypeScript assertion signature still narrows the checked value after the * call. Calls inside `deriveFromTracing` throw because derivations must only * write outputs; use `tracingAssertions` for trace-derived pass/fail checks. */ declare function evalAssert(condition: unknown, message: string): asserts condition; //#endregion //#region src/valueCache.d.ts /** Info accepted by `evalTracer.cache(info, fn)` for spanless value caching. */ type TraceCacheInfo = { /** Display name used for cache listings and the default namespace. */name: string; /** Arbitrary JSON-safe value used to derive the cache key. */ key: unknown; /** Override the default namespace (`${evalId}.${name}`). */ namespace?: string; /** * Cache storage target. Durable entries use `.agent-evals/cache`; temporary * entries use `.agent-evals/tmp/cache` and are intended to stay uncommitted. */ storage?: CacheStorage$2; /** * Include native `Blob`/`File` bytes in the cache key. By default only stable * metadata (`type`, `size`, plus `name`/`lastModified` for `File`) is used. */ serializeFileBytes?: boolean; }; /** Info accepted by `evalTracer.cache.get(...)` and `evalTracer.cache.set(...)`. */ type TraceCacheManualInfo = { /** Required cache namespace shared by related manual value entries. */namespace: string; /** Arbitrary JSON-safe value used to derive the cache key. */ key: unknown; /** Display name used for cache refs. Defaults to `namespace`. */ name?: string; /** * Cache storage target. Durable entries use `.agent-evals/cache`; temporary * entries use `.agent-evals/tmp/cache` and are intended to stay uncommitted. */ storage?: CacheStorage$2; /** * Include native `Blob`/`File` bytes in the cache key. By default only stable * metadata (`type`, `size`, plus `name`/`lastModified` for `File`) is used. */ serializeFileBytes?: boolean; }; /** Info accepted by the single-argument `evalTracer.cache.set(...)` form. */ type TraceCacheSetInfo = TraceCacheManualInfo & { /** Value to persist for later `evalTracer.cache.get(...)` calls. */value: T; }; /** Result returned by `evalTracer.cache.get(...)`. */ type TraceCacheGetResult = { hit: true; value: T; } | { hit: false; }; /** Callable cache helper plus explicit get/set primitives. */ type TraceCache = { /** Cache a pure value and replay SDK-mediated effects on cache hits. */(info: TraceCacheInfo, fn: () => Promise | T): Promise; /** Cache a pure value and replay SDK-mediated effects on cache hits. */ (info: TraceCacheInfo, fn: () => unknown): Promise; /** * Read a cached value without running a callback or replaying cached SDK * effects. Misses include disabled-read and refresh/bypass modes. */ get(info: TraceCacheManualInfo): Promise>; /** * Persist a manual cached value. This is a no-op when cache writes are * disabled by run/eval cache settings. */ set(info: TraceCacheSetInfo): Promise; /** * Persist a manual cached value. This is a no-op when cache writes are * disabled by run/eval cache settings. */ set(info: TraceCacheManualInfo, value: T): Promise; /** * Convenience wrapper over `get` then `set` for simple pure values. Use raw * `get`/`set` when errors or partial-cache semantics should stay explicit. */ getOrSet(info: TraceCacheManualInfo, fn: () => Promise | T): Promise; }; //#endregion //#region src/traceDiagnostics.d.ts /** Severity used when attaching a recoverable diagnostic to an active span. */ type CaptureEvalSpanErrorLevel = 'error' | 'warning'; /** Options accepted by `captureEvalSpanError(...)`. */ type CaptureEvalSpanErrorOptions = { /** * Captured diagnostic severity. * * `error` marks the active span as errored. `warning` records the diagnostic * without changing an otherwise successful span's status. */ level?: CaptureEvalSpanErrorLevel; }; //#endregion //#region src/cacheKey.d.ts /** Components folded into a deterministic cache key hash. */ type CacheKeyHashInput = { /** Cache namespace, usually derived from the eval id and operation name. */namespace: string; /** User-authored cache key value. */ key: unknown; }; /** Optional controls for cache key hashing. */ type CacheKeyHashOptions = { /** * When true, native `Blob` and `File` values are read asynchronously and * hashed by bytes plus stable metadata. Defaults to metadata-only hashing. */ serializeFileBytes?: boolean; }; /** * Hash the components of a cache key into a deterministic hex digest. * * Native `Blob` and `File` values use stable metadata by default. Pass * `serializeFileBytes: true` to read them asynchronously and include their byte * hash in the key. */ declare function hashCacheKey(input: CacheKeyHashInput, options?: CacheKeyHashOptions): Promise; /** * Synchronously hash cache key components. This supports JSON-like data and * in-memory binary values such as `Buffer`, `ArrayBuffer`, and typed arrays, * plus stable metadata for native `Blob` and `File` values. */ declare function hashCacheKeySync(input: CacheKeyHashInput): string; /** * Convert an authored cache key into JSON-safe debug data. * * Binary values are represented by type, byte length, and SHA-256 digest so * raw-key debug sidecars stay inspectable without embedding large byte arrays. */ //#endregion //#region src/tracer.d.ts /** Mutable handle for the current span. Prefer ambient `evalSpan` in helpers. */ type TraceActiveSpan = { /** Rename the active span after it has been created. */setName(value: string): void; /** Set a single attribute on the active span. Later writes replace the same key. */ setAttribute(key: string, value: unknown): void; /** Merge multiple attributes into the active span. */ setAttributes(value: Record): void; /** Add a numeric delta to one attribute. */ incrementAttribute(key: string, delta: number): void; /** Append one item to an attribute array, preserving an existing scalar. */ appendToAttribute(key: string, value: unknown): void; /** Shallow-merge object fields into one attribute. */ mergeAttribute(key: string, patch: Record): void; }; /** Timestamp accepted by the external span lifecycle API. */ type TraceSpanTimestamp = Date | string; /** Info accepted by `evalTracer.startSpan(info)` for externally managed spans. */ type TraceExternalSpanStartInfo = { /** Stable span id from the upstream tracer. Generated when omitted. */id?: string; /** Parent span id from the upstream tracer. Defaults to the active eval span. */ parentId?: string | null; /** Semantic category used by the trace UI. */ kind: string; /** Display name for the span. */ name: string; /** Span start time. Defaults to now. */ startedAt?: TraceSpanTimestamp; /** Initial span attributes. Later updates merge into this object. */ attributes?: Record; }; /** Info accepted by `evalTracer.updateSpan(info)` for lifecycle updates. */ type TraceExternalSpanUpdateInfo = { /** Span id previously passed to `evalTracer.startSpan(...)`. */id: string; /** Optional replacement display name. */ name?: string; /** Attributes to merge into the recorded span. */ attributes?: Record; /** Optional status override, useful when the upstream tracer emits one. */ status?: EvalTraceSpan$2['status']; /** Optional error payload to attach to the span. */ error?: EvalTraceSpan$2['error']; /** Optional latest warning payload to attach to the span. */ warning?: EvalTraceSpan$2['warning']; /** Optional warning payloads to attach to the span. */ warnings?: EvalTraceSpan$2['warnings']; }; /** Info accepted by `evalTracer.endSpan(info)` for externally managed spans. */ type TraceExternalSpanEndInfo = TraceExternalSpanUpdateInfo & { /** Span end time. Defaults to now. */endedAt?: TraceSpanTimestamp; }; /** Info accepted by `evalTracer.recordSpan(info)` for completed external spans. */ type TraceExternalSpanRecordInfo = { /** Stable span id from the upstream tracer. Generated when omitted. */id?: string; /** Parent span id from the upstream tracer. Defaults to the active eval span. */ parentId?: string | null; /** Semantic category used by the trace UI. */ kind: string; /** Display name for the span. */ name: string; /** Span start time. Defaults to now. */ startedAt?: TraceSpanTimestamp; /** Span end time. Defaults to the start time. */ endedAt?: TraceSpanTimestamp | null; /** Final span status. Defaults to `ok`. */ status?: EvalTraceSpan$2['status']; /** Final span attributes. */ attributes?: Record; /** Optional error payload to attach to the span. */ error?: EvalTraceSpan$2['error']; /** Optional latest warning payload to attach to the span. */ warning?: EvalTraceSpan$2['warning']; /** Optional warning payloads to attach to the span. */ warnings?: EvalTraceSpan$2['warnings']; }; /** Mutable handle returned by `evalTracer.startSpan(...)`. */ type TraceExternalSpanHandle = TraceActiveSpan & { /** Recorded span id, either caller-provided or generated by the SDK. */id: string; /** Finish the external span and merge any final fields. */ end(info?: Omit): void; }; declare function startExternalSpan(info: TraceExternalSpanStartInfo): TraceExternalSpanHandle; declare function updateExternalSpan(info: TraceExternalSpanUpdateInfo): void; declare function endExternalSpan(info: TraceExternalSpanEndInfo): void; declare function recordExternalSpan(info: TraceExternalSpanRecordInfo): string; /** * Ambient handle for the active span in the current async context. * * Calls are no-ops when executed outside of `evalTracer.span(...)`. */ declare const evalSpan: TraceActiveSpan; /** * Attach one or more recoverable errors to the active eval span. * * By default the active span is marked as `error` even if its callback later * completes without throwing. Pass `'warning'` or `{ level: 'warning' }` as the * final argument to record the diagnostic without changing span status. Calls * outside `evalTracer.span(...)` are ignored. */ declare function captureEvalSpanError(errorOrErrors: unknown, ...additionalErrorsOrOptions: readonly unknown[]): void; type TraceSpanInfoBase = { kind: string; name: string; attributes?: Record; /** * Whether this span should delay eval finalization when the returned promise * is not awaited by user code. Defaults to `true`. */ waitForBackgroundJob?: boolean; }; /** Info accepted by `evalTracer.span(info, fn)` when creating an uncached span. */ type TraceSpanInfoUncached = TraceSpanInfoBase & { cache?: undefined; }; /** * Info accepted by `evalTracer.span(info, fn)` when opting in to caching. * * Cached spans return `Promise` because the replayed value is revived * from persisted cache data on hit. Narrow the value yourself when you need a * typed return. */ type TraceSpanInfoCached = TraceSpanInfoBase & { cache: SpanCacheOptions$1; }; /** Info accepted by `evalTracer.span(info, fn)`. */ type TraceSpanInfo = TraceSpanInfoUncached | TraceSpanInfoCached; declare function traceSpan(info: TraceSpanInfoUncached, fn: () => Promise | T): Promise; declare function traceSpan(info: TraceSpanInfoUncached, fn: (span: TraceActiveSpan) => Promise | T): Promise; declare function traceSpan(info: TraceSpanInfoCached, fn: () => unknown): Promise; declare function traceSpan(info: TraceSpanInfoCached, fn: (span: TraceActiveSpan) => unknown): Promise; /** * Trace builder used to create hierarchical spans and checkpoints during eval * execution. */ declare const evalTracer: { /** Run a callback inside a new trace span and record its lifecycle. */span: typeof traceSpan; /** * Cache a pure value without creating a trace span. * * When called inside an active span, the span receives a `cache.refs` entry * describing the value cache status for this run. */ cache: TraceCache; /** * Start a span whose lifecycle is controlled by an external tracer/exporter. * * Calls are no-ops outside an eval case scope, except that a generated or * caller-provided id is still returned for ergonomic adapter code. */ startSpan: typeof startExternalSpan; /** * Merge updates into an externally managed span that was started earlier. * * This is intended for observability exporters that receive span update * events before the final end event. */ updateSpan: typeof updateExternalSpan; /** * Finish an externally managed span and attach final attributes or errors. * * Missing spans are ignored so exporter adapters can safely forward events * even when they are emitted outside an eval case scope. */ endSpan: typeof endExternalSpan; /** * Record a complete external span in one call. * * Use this when an upstream tracer only exposes completed spans rather than * start/update/end events. */ recordSpan: typeof recordExternalSpan; /** Record a named point-in-time value alongside the trace. */ checkpoint(name: string, data: unknown): void; }; /** Build a queryable trace tree helper from a flat span list and checkpoints. */ declare function buildTraceTree(spans: EvalTraceSpan$2[], checkpoints: Map): EvalTraceTree; //#endregion //#endregion //#region ../shared/dist/index.d.mts //#region src/schemas/display.d.ts declare const scalarCellSchema: z.ZodUnion; /** Primitive table cell value supported by the eval UI. */ type ScalarCell = z.infer; declare const jsonCellSchema: z.ZodType | unknown[]>; /** JSON-safe value supported by `format: 'json'` columns. */ type JsonCell = z.infer; /** Numeric presentation options for values rendered with `format: 'number'`. */ type NumberDisplayOptions = { /** Number notation used when rendering the value. */notation?: 'standard' | 'compact'; /** Compact style used when `notation: 'compact'` is enabled. */ compactDisplay?: 'short' | 'long'; /** String prepended to the rendered number, such as `$`. */ prefix?: string; /** String appended to the rendered number, such as ` ms`. */ suffix?: string; /** Minimum number of decimal places to render. */ minDecimalPlaces?: number; /** Maximum number of decimal places to render. */ maxDecimalPlaces?: number; }; /** Schema for numeric presentation options used by number-formatted values. */ /** Schema for the supported column rendering kinds in list views. */ declare const columnKindSchema: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; /** Display kind used by a column definition in the UI. */ type ColumnKind = z.infer; /** Schema for the built-in column formatting presets. */ declare const columnFormatSchema: z.ZodEnum<{ number: "number"; boolean: "boolean"; file: "file"; markdown: "markdown"; json: "json"; image: "image"; html: "html"; pdf: "pdf"; audio: "audio"; video: "video"; duration: "duration"; percent: "percent"; passFail: "passFail"; stars: "stars"; }>; /** Formatting preset applied to a column value in the UI. */ type ColumnFormat = z.infer; /** Schema describing a rendered column in the eval results table. */ declare const columnDefSchema: z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; kind: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; isScore: z.ZodOptional; isManualScore: z.ZodOptional; passThreshold: z.ZodOptional; maxStars: z.ZodOptional; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; }, z.core.$strip>; /** Column definition exposed to the UI for eval and case tables. */ type ColumnDef = z.infer; /** Schema for any supported value that can populate a table cell. */ declare const cellValueSchema: z.ZodUnion | unknown[] | null, unknown, z.core.$ZodTypeInternals | unknown[] | null, unknown>>, z.ZodUnion; path: z.ZodString; mimeType: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"run">; artifactId: z.ZodString; mimeType: z.ZodString; fileName: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>]>]>; /** Value stored in a rendered eval result table cell. */ type CellValue = z.infer; //#endregion //#region src/schemas/trace.d.ts /** * Schema for span categories recorded in traces. * * The value is intentionally open-ended so external tracers can preserve their * native span kinds instead of collapsing them into the built-in categories. */ /** Schema for the supported presentation formats of trace attributes. */ declare const traceAttributeDisplayFormatSchema: z.ZodEnum<{ string: "string"; number: "number"; json: "json"; duration: "duration"; }>; /** * Formatting hint for trace attribute values rendered by the UI. * * This affects presentation only and does not change the stored value. */ type TraceAttributeDisplayFormat = z.infer; /** Schema for the UI locations where a trace attribute can appear. */ declare const traceAttributeDisplayPlacementSchema: z.ZodEnum<{ tree: "tree"; detail: "detail"; section: "section"; }>; /** UI locations where a trace attribute may be rendered. */ type TraceAttributeDisplayPlacement = z.infer; /** Schema for resolved trace display rules sent to the UI. */ declare const traceAttributeDisplaySchema: z.ZodObject<{ key: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; }, z.core.$strip>; /** * Resolved trace display rule consumed by the UI. * * `path` points at the attribute to render on each span. `scope` and `mode` * control whether the value comes from the current span only or from the full * subtree, and how multiple matches are combined. */ type TraceAttributeDisplay = z.infer; /** Schema for trace display config after transforms have been resolved. */ declare const traceDisplayConfigSchema: z.ZodObject<{ attributes: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; /** UI-ready trace display configuration attached to case details. */ type TraceDisplayConfig = z.infer; /** Context passed to a `traceDisplay` transform while resolving a span value. */ type TraceAttributeTransformContext = { value: unknown; span: EvalTraceSpan$1; }; /** * Runner-side transform used to derive a display value from a raw trace * attribute. */ type TraceAttributeTransform = (ctx: TraceAttributeTransformContext) => unknown; /** Schema for authored trace display rules accepted from user config. */ declare const traceAttributeDisplayInputSchema: z.ZodObject<{ key: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; transform: z.ZodOptional>; }, z.core.$strip>; /** * Authored trace display rule accepted in eval definitions and config files. * * `key` allows the same source `path` to be displayed multiple ways, such as * raw and compact views of a single token count. `numberFormat` customizes * `format: 'number'` values. `transform` runs in the * runner before the UI receives the resolved trace payload. */ type TraceAttributeDisplayInput = z.infer; /** Schema for authored trace display config in eval or workspace config. */ declare const traceDisplayInputConfigSchema: z.ZodObject<{ attributes: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; transform: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; /** Trace display configuration authored by users in config or eval files. */ type TraceDisplayInputConfig = z.infer; /** Schema for an error attached to a trace span. */ declare const traceSpanErrorSchema$1: z.ZodObject<{ name: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>; /** Error payload stored on a trace span. */ type EvalTraceSpanError$1 = z.infer; /** Schema for a warning attached to a trace span. */ declare const traceSpanWarningSchema$1: z.ZodObject<{ name: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>; /** Warning payload stored on a trace span. */ type EvalTraceSpanWarning$1 = z.infer; /** Schema for a persisted trace span captured during case execution. */ declare const traceSpanSchema$1: z.ZodObject<{ id: z.ZodString; parentId: z.ZodNullable; caseId: z.ZodString; kind: z.ZodString; name: z.ZodString; startedAt: z.ZodString; endedAt: z.ZodNullable; status: z.ZodEnum<{ error: "error"; running: "running"; ok: "ok"; cancelled: "cancelled"; }>; attributes: z.ZodOptional>; error: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; errors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; warning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; warnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; }, z.core.$strip>; /** Persisted trace span shape stored for each eval case run. */ type EvalTraceSpan$1 = z.infer; //#endregion //#region src/schemas/eval.d.ts /** Freshness signal derived from the latest relevant run plus git state. */ declare const evalFreshnessStatusSchema: z.ZodEnum<{ fresh: "fresh"; stale: "stale"; outdated: "outdated"; }>; /** Freshness signal derived from the latest relevant run plus git state. */ type EvalFreshnessStatus = z.infer; /** * Reducer used to collapse per-case values into a single duration or column * stat. * `best` selects the highest finite value and `worst` selects the lowest. */ declare const evalStatAggregateSchema: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; best: "best"; worst: "worst"; }>; /** * Reducer used to collapse per-case values into a single duration or column * stat. * `best` selects the highest finite value and `worst` selects the lowest. */ type EvalStatAggregate = z.infer; /** * One entry in the EvalCard stats row. Built-in kinds read from the latest run; * `duration` aggregates per-case durations, `cacheHits` counts Agent Eval * operation-level cache hits from spans and `evalTracer.cache(...)` refs, not * LLM provider prompt-cache read tokens. Cache hits use an independent * aggregate mode and default to `sum`. `column` aggregates a score or numeric * output column across the latest run. */ declare const evalStatItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"cases">; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"passRate">; accent: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"duration">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"cacheHits">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"column">; key: z.ZodString; label: z.ZodOptional; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; best: "best"; worst: "worst"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; accent: z.ZodOptional; }, z.core.$strip>], "kind">; /** Single stat rendered in the EvalCard stats row. */ type EvalStatItem = z.infer; /** Ordered list of stats rendered in the EvalCard stats row. */ declare const evalStatsConfigSchema: z.ZodArray; kind: z.ZodLiteral<"cases">; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"passRate">; accent: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"duration">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"cacheHits">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"column">; key: z.ZodString; label: z.ZodOptional; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; best: "best"; worst: "worst"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; accent: z.ZodOptional; }, z.core.$strip>], "kind">>; /** Ordered list of stats rendered in the EvalCard stats row. */ type EvalStatsConfig = z.infer; /** Schema summarizing a discovered eval for list and overview screens. */ declare const evalSummarySchema$1: z.ZodObject<{ key: z.ZodDefault; id: z.ZodString; title: z.ZodOptional; description: z.ZodOptional; filePath: z.ZodString; tags: z.ZodOptional>; stale: z.ZodBoolean; outdated: z.ZodBoolean; freshnessStatus: z.ZodEnum<{ fresh: "fresh"; stale: "stale"; outdated: "outdated"; }>; latestRunAt: z.ZodNullable; latestRunCommitSha: z.ZodNullable; currentCommitSha: z.ZodNullable; columnDefs: z.ZodArray; kind: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; isScore: z.ZodOptional; isManualScore: z.ZodOptional; passThreshold: z.ZodOptional; maxStars: z.ZodOptional; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; }, z.core.$strip>>; caseCount: z.ZodNullable; caseIds: z.ZodOptional>; lastRunStatus: z.ZodNullable>; stats: z.ZodOptional; kind: z.ZodLiteral<"cases">; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"passRate">; accent: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"duration">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"cacheHits">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"column">; key: z.ZodString; label: z.ZodOptional; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; best: "best"; worst: "worst"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; accent: z.ZodOptional; }, z.core.$strip>], "kind">>>; defaultStatAggregate: z.ZodOptional>; charts: z.ZodOptional; hideIfNoValue: z.ZodOptional; dedupeConsecutiveValues: z.ZodOptional; type: z.ZodEnum<{ area: "area"; line: "line"; bar: "bar"; }>; metrics: z.ZodArray; metric: z.ZodEnum<{ durationMs: "durationMs"; passRate: "passRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>], "source">>; yDomain: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; right: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; tooltipExtras: z.ZodOptional; metric: z.ZodEnum<{ durationMs: "durationMs"; passRate: "passRate"; }>; label: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; }, z.core.$strip>], "source">>>; }, z.core.$strip>>>; manualInput: z.ZodOptional; description: z.ZodOptional; submitLabel: z.ZodOptional; fields: z.ZodArray; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"text">; minLength: z.ZodOptional; maxLength: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"multiline">; minLength: z.ZodOptional; maxLength: z.ZodOptional; rows: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"number">; min: z.ZodOptional; max: z.ZodOptional; step: z.ZodOptional; integer: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"boolean">; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"select">; options: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"json">; rows: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"file">; accept: z.ZodOptional; maxSizeBytes: z.ZodOptional; }, z.core.$strip>], "kind">>; }, z.core.$strip>>; }, z.core.$strip>; /** Metadata shown for one discovered eval in the explorer UI. */ type EvalSummary = z.infer; /** Schema for one case row in an eval run result table. */ declare const caseRowSchema$1: z.ZodObject<{ evalKey: z.ZodOptional; caseKey: z.ZodOptional; caseId: z.ZodString; evalId: z.ZodString; tags: z.ZodOptional>; status: z.ZodEnum<{ error: "error"; running: "running"; cancelled: "cancelled"; pending: "pending"; pass: "pass"; fail: "fail"; }>; durationMs: z.ZodNullable; cacheHits: z.ZodOptional; cacheOperations: z.ZodOptional; llmCalls: z.ZodOptional; llmCallsMade: z.ZodOptional; llmCacheHits: z.ZodOptional; costUsd: z.ZodOptional>; columns: z.ZodRecord | unknown[] | null, unknown, z.core.$ZodTypeInternals | unknown[] | null, unknown>>, z.ZodUnion; path: z.ZodString; mimeType: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"run">; artifactId: z.ZodString; mimeType: z.ZodString; fileName: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>]>]>>; outputColumnDefs: z.ZodOptional; kind: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; isScore: z.ZodOptional; isManualScore: z.ZodOptional; passThreshold: z.ZodOptional; maxStars: z.ZodOptional; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; }, z.core.$strip>>>; trial: z.ZodNumber; }, z.core.$strip>; /** Flattened per-case row rendered in run tables and streamed updates. */ type CaseRow = z.infer; /** Schema for one highlighted input section in a case detail payload. */ /** Structured assertion failure metadata captured for one case run. */ declare const assertionFailureSchema: z.ZodObject<{ name: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; }, z.core.$strip>; /** Assertion failure metadata captured for one case run. */ type AssertionFailure = z.infer; /** Pass/fail outcome for one recorded eval assertion. */ /** Severity level for one log captured during a case run. */ declare const runLogLevelSchema: z.ZodEnum<{ error: "error"; log: "log"; info: "info"; warn: "warn"; }>; /** Severity level for one log captured during a case run. */ type RunLogLevel = z.infer; /** Eval runner phase that emitted a captured case log. */ declare const runLogPhaseSchema: z.ZodEnum<{ tracingAssertions: "tracingAssertions"; eval: "eval"; derive: "derive"; outputsSchema: "outputsSchema"; scorer: "scorer"; }>; /** Eval runner phase that emitted a captured case log. */ type RunLogPhase = z.infer; /** Schema for one persisted log entry captured during a case run. */ declare const runLogLocationSchema: z.ZodObject<{ file: z.ZodString; line: z.ZodNumber; column: z.ZodNumber; stack: z.ZodOptional; }, z.core.$strip>; /** Best-effort source location and captured stack for one case log. */ type RunLogLocation = z.infer; /** Schema for one persisted log entry captured during a case run. */ declare const runLogEntrySchema: z.ZodObject<{ timestamp: z.ZodString; level: z.ZodEnum<{ error: "error"; log: "log"; info: "info"; warn: "warn"; }>; phase: z.ZodEnum<{ tracingAssertions: "tracingAssertions"; eval: "eval"; derive: "derive"; outputsSchema: "outputsSchema"; scorer: "scorer"; }>; message: z.ZodString; args: z.ZodDefault>; truncated: z.ZodDefault; location: z.ZodOptional; }, z.core.$strip>>; source: z.ZodOptional; }, z.core.$strip>; /** Persisted log entry captured during a case run. */ type RunLogEntry = z.infer; /** Trace payload captured while computing one score for a case. */ declare const scoreTraceSchema: z.ZodObject<{ trace: z.ZodArray; caseId: z.ZodString; kind: z.ZodString; name: z.ZodString; startedAt: z.ZodString; endedAt: z.ZodNullable; status: z.ZodEnum<{ error: "error"; running: "running"; ok: "ok"; cancelled: "cancelled"; }>; attributes: z.ZodOptional>; error: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; errors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; warning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; warnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; }, z.core.$strip>>; traceDisplay: z.ZodObject<{ attributes: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; cacheRefs: z.ZodDefault; name: z.ZodString; namespace: z.ZodString; key: z.ZodString; status: z.ZodEnum<{ bypass: "bypass"; refresh: "refresh"; hit: "hit"; miss: "miss"; }>; storage: z.ZodOptional>; read: z.ZodOptional; stored: z.ZodOptional; storedAt: z.ZodOptional; age: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; /** Trace payload captured while computing one score for a case. */ type ScoreTrace = z.infer; /** Schema for the detailed payload shown when opening a specific case. */ declare const caseDetailSchema$1: z.ZodObject<{ evalKey: z.ZodOptional; caseKey: z.ZodOptional; caseId: z.ZodString; evalId: z.ZodString; tags: z.ZodOptional>; status: z.ZodEnum<{ error: "error"; running: "running"; cancelled: "cancelled"; pending: "pending"; pass: "pass"; fail: "fail"; }>; input: z.ZodUnknown; inputSections: z.ZodOptional; kind: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; isScore: z.ZodOptional; isManualScore: z.ZodOptional; passThreshold: z.ZodOptional; maxStars: z.ZodOptional; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; value: z.ZodUnion | unknown[] | null, unknown, z.core.$ZodTypeInternals | unknown[] | null, unknown>>, z.ZodUnion; path: z.ZodString; mimeType: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"run">; artifactId: z.ZodString; mimeType: z.ZodString; fileName: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>]>]>; }, z.core.$strip>>>; trace: z.ZodArray; caseId: z.ZodString; kind: z.ZodString; name: z.ZodString; startedAt: z.ZodString; endedAt: z.ZodNullable; status: z.ZodEnum<{ error: "error"; running: "running"; ok: "ok"; cancelled: "cancelled"; }>; attributes: z.ZodOptional>; error: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; errors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; warning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; warnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; }, z.core.$strip>>; traceDisplay: z.ZodObject<{ attributes: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; scoringTraces: z.ZodOptional; caseId: z.ZodString; kind: z.ZodString; name: z.ZodString; startedAt: z.ZodString; endedAt: z.ZodNullable; status: z.ZodEnum<{ error: "error"; running: "running"; ok: "ok"; cancelled: "cancelled"; }>; attributes: z.ZodOptional>; error: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; errors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; warning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; warnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; }, z.core.$strip>>; traceDisplay: z.ZodObject<{ attributes: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; cacheRefs: z.ZodDefault; name: z.ZodString; namespace: z.ZodString; key: z.ZodString; status: z.ZodEnum<{ bypass: "bypass"; refresh: "refresh"; hit: "hit"; miss: "miss"; }>; storage: z.ZodOptional>; read: z.ZodOptional; stored: z.ZodOptional; storedAt: z.ZodOptional; age: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>>; columns: z.ZodRecord | unknown[] | null, unknown, z.core.$ZodTypeInternals | unknown[] | null, unknown>>, z.ZodUnion; path: z.ZodString; mimeType: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"run">; artifactId: z.ZodString; mimeType: z.ZodString; fileName: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>]>]>>; outputColumnDefs: z.ZodOptional; kind: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; isScore: z.ZodOptional; isManualScore: z.ZodOptional; passThreshold: z.ZodOptional; maxStars: z.ZodOptional; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; }, z.core.$strip>>>; assertions: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; status: z.ZodEnum<{ pass: "pass"; fail: "fail"; }>; }, z.core.$strip>, z.ZodPipe>]>>>; assertionFailures: z.ZodArray; message: z.ZodString; stack: z.ZodOptional; }, z.core.$strip>, z.ZodPipe>]>>; logs: z.ZodDefault; phase: z.ZodEnum<{ tracingAssertions: "tracingAssertions"; eval: "eval"; derive: "derive"; outputsSchema: "outputsSchema"; scorer: "scorer"; }>; message: z.ZodString; args: z.ZodDefault>; truncated: z.ZodDefault; location: z.ZodOptional; }, z.core.$strip>>; source: z.ZodOptional; }, z.core.$strip>>>; error: z.ZodNullable; message: z.ZodString; stack: z.ZodOptional; }, z.core.$strip>>; trial: z.ZodNumber; cacheRefs: z.ZodDefault; name: z.ZodString; namespace: z.ZodString; key: z.ZodString; status: z.ZodEnum<{ bypass: "bypass"; refresh: "refresh"; hit: "hit"; miss: "miss"; }>; storage: z.ZodOptional>; read: z.ZodOptional; stored: z.ZodOptional; storedAt: z.ZodOptional; age: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; /** Full case payload including inputs, trace, outputs, and failures. */ type CaseDetail = z.infer; /** Schema for discovery problems that should be shown before running evals. */ declare const discoveryIssueSchema$1: z.ZodObject<{ type: z.ZodEnum<{ "duplicate-eval-id": "duplicate-eval-id"; "manual-input-with-cases": "manual-input-with-cases"; "invalid-tags": "invalid-tags"; }>; severity: z.ZodEnum<{ error: "error"; }>; filePath: z.ZodString; evalId: z.ZodString; message: z.ZodString; }, z.core.$strip>; /** Discovery problem found while scanning eval files. */ type DiscoveryIssue = z.infer; //#endregion //#region src/evalIdentity.d.ts /** Build the stable identity for one eval inside a workspace. */ //#endregion //#region src/schemas/chart.d.ts /** Chart type rendered for a single eval history chart. */ declare const evalChartTypeSchema: z.ZodEnum<{ area: "area"; line: "line"; bar: "bar"; }>; /** Chart type rendered for a single eval history chart. */ type EvalChartType = z.infer; /** * Run-level metric sourced from the aggregated `RunSummary` for a run, rather * than from a per-case column. */ declare const evalChartBuiltinMetricSchema: z.ZodEnum<{ durationMs: "durationMs"; passRate: "passRate"; }>; /** * Run-level metric sourced from the aggregated `RunSummary` for a run, rather * than from a per-case column. */ type EvalChartBuiltinMetric = z.infer; /** Reducer applied to a numeric column across all cases of a single run. */ declare const evalChartAggregateSchema: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; /** Reducer applied to a numeric column across all cases of a single run. */ type EvalChartAggregate = z.infer; /** * Semantic color token resolved to a theme color by the web UI. The SDK does * not emit raw hex so authored evals stay decoupled from the web theme. */ declare const evalChartColorSchema: z.ZodEnum<{ error: "error"; success: "success"; accent: "accent"; accentDim: "accentDim"; warning: "warning"; textMuted: "textMuted"; }>; /** Semantic color token resolved to a theme color by the web UI. */ type EvalChartColor = z.infer; /** Y-axis placement for a plotted series on a dual-axis chart. */ declare const evalChartAxisSchema: z.ZodEnum<{ left: "left"; right: "right"; }>; /** Y-axis placement for a plotted series on a dual-axis chart. */ type EvalChartAxis = z.infer; /** * One plotted series on an eval history chart. `builtin` metrics come from the * per-run `RunSummary`; `column` metrics aggregate a per-case score or * `setEvalOutput` column across the run using `aggregate`. */ declare const evalChartMetricSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ source: z.ZodLiteral<"builtin">; metric: z.ZodEnum<{ durationMs: "durationMs"; passRate: "passRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>], "source">; /** One plotted series on an eval history chart. */ type EvalChartMetric = z.infer; /** Extra field rendered only in the tooltip, not plotted as a series. */ declare const evalChartTooltipExtraSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ source: z.ZodLiteral<"builtin">; metric: z.ZodEnum<{ durationMs: "durationMs"; passRate: "passRate"; }>; label: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; }, z.core.$strip>], "source">; /** Extra field rendered only in the tooltip, not plotted as a series. */ type EvalChartTooltipExtra = z.infer; /** * Authored configuration for one eval history chart rendered in `EvalCard`. * Authors declare a list of these via `EvalDefinition.charts` — the UI renders * each entry as its own chart frame, stacked in authoring order. */ declare const evalChartConfigSchema: z.ZodObject<{ heading: z.ZodOptional; hideIfNoValue: z.ZodOptional; dedupeConsecutiveValues: z.ZodOptional; type: z.ZodEnum<{ area: "area"; line: "line"; bar: "bar"; }>; metrics: z.ZodArray; metric: z.ZodEnum<{ durationMs: "durationMs"; passRate: "passRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>], "source">>; yDomain: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; right: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; tooltipExtras: z.ZodOptional; metric: z.ZodEnum<{ durationMs: "durationMs"; passRate: "passRate"; }>; label: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; }, z.core.$strip>], "source">>>; }, z.core.$strip>; /** Authored configuration for one eval history chart. */ type EvalChartConfig = z.infer; /** * Ordered list of history charts rendered for an eval. Opt-in: when omitted or * empty, the UI renders no history chart at all. */ declare const evalChartsConfigSchema: z.ZodArray; hideIfNoValue: z.ZodOptional; dedupeConsecutiveValues: z.ZodOptional; type: z.ZodEnum<{ area: "area"; line: "line"; bar: "bar"; }>; metrics: z.ZodArray; metric: z.ZodEnum<{ durationMs: "durationMs"; passRate: "passRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>], "source">>; yDomain: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; right: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; tooltipExtras: z.ZodOptional; metric: z.ZodEnum<{ durationMs: "durationMs"; passRate: "passRate"; }>; label: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ min: "min"; max: "max"; sum: "sum"; avg: "avg"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; }, z.core.$strip>], "source">>>; }, z.core.$strip>>; /** Ordered list of history charts rendered for an eval. */ type EvalChartsConfig = z.infer; //#endregion //#region src/schemas/run.d.ts /** Schema for persisted metadata about a single run invocation. */ declare const runManifestSchema$1: z.ZodObject<{ id: z.ZodString; shortId: z.ZodString; status: z.ZodEnum<{ error: "error"; running: "running"; cancelled: "cancelled"; pending: "pending"; completed: "completed"; }>; temporary: z.ZodDefault>; startedAt: z.ZodString; endedAt: z.ZodNullable; commitSha: z.ZodDefault>>; branchName: z.ZodDefault>>; evalSourceFingerprints: z.ZodDefault>>; target: z.ZodObject<{ mode: z.ZodEnum<{ all: "all"; evalIds: "evalIds"; caseIds: "caseIds"; }>; evalKeys: z.ZodOptional>; files: z.ZodOptional>; evalIds: z.ZodOptional>; caseIds: z.ZodOptional>; tagsFilter: z.ZodOptional>; }, z.core.$strip>; trials: z.ZodNumber; trialSelection: z.ZodDefault>>; cacheMode: z.ZodOptional>; }, z.core.$strip>; /** Persisted lifecycle metadata for a single eval run. */ type RunManifest = z.infer; /** Schema for aggregate metrics computed over a completed or active run. */ declare const runSummarySchema$1: z.ZodObject<{ runId: z.ZodString; status: z.ZodEnum<{ error: "error"; running: "running"; cancelled: "cancelled"; pending: "pending"; completed: "completed"; }>; totalCases: z.ZodNumber; passedCases: z.ZodNumber; failedCases: z.ZodNumber; errorCases: z.ZodNumber; cancelledCases: z.ZodNumber; totalDurationMs: z.ZodNullable; cacheHits: z.ZodDefault>; cacheOperations: z.ZodDefault>; llmCalls: z.ZodDefault>; llmCallsMade: z.ZodDefault>; llmCacheHits: z.ZodDefault>; errorMessage: z.ZodDefault>; }, z.core.$strip>; /** Roll-up statistics for one run. */ type RunSummary = z.infer; //#endregion //#region src/tags.d.ts /** Result returned when validating one authored tag name. */ //#endregion //#region src/status.d.ts /** * Canonical derived result status used for aggregated displays and propagation * across case, eval, file, folder, and run result views. */ type DerivedStatus = 'pending' | 'running' | 'pass' | 'fail' | 'error' | 'cancelled'; /** * Aggregate summary derived from a scoped set of case rows. * * This is intentionally separate from `RunSummary`: it represents a summary * over any slice of case rows, such as a single eval within a run. */ type ScopedCaseSummary = { status: DerivedStatus; totalCases: number; passedCases: number; failedCases: number; errorCases: number; cancelledCases: number; pendingCases: number; runningCases: number; totalDurationMs: number | null; /** * Sum of Agent Eval operation-level cache hits across the scoped case rows. * * Missing values from older run artifacts count as zero. This is separate * from LLM prompt-cache token reads such as `cachedInputTokens`. */ cacheHits: number; /** * Sum of Agent Eval operation-level cache activity entries across the scoped * case rows. * * This is the denominator for `cacheHits`. Missing values from older run * artifacts count as zero. */ cacheOperations: number; /** * Sum of LLM call spans across the scoped case rows. * * Missing values from older run artifacts count as zero. */ llmCalls: number; /** * Sum of LLM call spans that actually executed across the scoped case rows. * * Missing values from older run artifacts count as zero. */ llmCallsMade: number; /** * Sum of LLM call spans replayed from Agent Eval operation-cache hits. * * Missing values from older run artifacts count as zero. */ llmCacheHits: number; }; //#endregion //#region src/evalStatus.d.ts /** Display status used for eval, file, and folder UI surfaces. */ type EvalDisplayStatus = DerivedStatus | 'enqueued' | 'stale' | 'outdated' | 'unscored'; /** * Derive the user-facing eval status from the raw latest run result plus * freshness state. */ //#endregion //#region src/utils/getNestedAttribute.d.ts /** * Read a value from `source` by walking a dot-separated path. * * Returns `undefined` when any segment of the path is missing or when an * intermediate value is not a plain object. Used by trace-attribute display, * the LLM calls extractor, and any consumer that needs to look up nested * properties from a span's `attributes` record. */ declare function getNestedAttribute(value: unknown, path: string): unknown; //#endregion //#region src/schemas/config.d.ts /** Strategy used to collapse repeated trials into one stored case result. */ declare const trialSelectionModeSchema: z.ZodEnum<{ lowestScore: "lowestScore"; median: "median"; }>; /** Strategy used to collapse repeated trials into one stored case result. */ type TrialSelectionMode = z.infer; /** * Built-in eval-level output/column keys. * * `costUsd` controls the default LLM cost family: actual billed cost plus the * normalized `costUsdWithoutCache` and `costUsdWarmedCache` chart outputs. */ /** Removal config for built-in eval-level outputs and UI metadata. */ declare const removeDefaultConfigSchema: z.ZodUnion, z.ZodArray>]>; /** Removal config for built-in eval-level outputs and UI metadata. */ type RemoveDefaultConfig = z.infer; /** Single authored eval case with its stable identifier and input payload. */ type EvalCase$1 = { id: string; input: TInput; tags?: string[]; }; /** Normalized view of one tool-call span and its common tool metadata. */ type EvalToolCallSpan$1 = { /** Preferred tool name, using GenAI/Mastra identity metadata when present. */name: string; /** Original trace span display name. */ spanName: string; /** Original trace span kind. */ kind: string; /** Parsed tool-call arguments, or the raw value when parsing is not possible. */ arguments: unknown; /** Parsed tool-call result, or the raw value when parsing is not possible. */ result: unknown; /** Tool description from GenAI/Mastra metadata when present. */ description: string | undefined; /** Tool type from GenAI/Mastra metadata when present. */ toolType: string | undefined; /** Original span attributes. */ attributes: Record | undefined; /** Original trace span for fields not normalized above. */ span: EvalTraceSpan$1; }; /** Query helpers built from the flattened trace recorded for one eval case. */ type EvalTraceTree$1 = { /** Flat span list in creation order. */spans: EvalTraceSpan$1[]; /** Top-level spans whose `parentId` is `null`. */ rootSpans: EvalTraceSpan$1[]; /** Return the first span whose name exactly matches `name`. */ findSpan: (name: string) => EvalTraceSpan$1 | undefined; /** Return every span whose name exactly matches `name`. */ findSpans: (name: string) => EvalTraceSpan$1[]; /** Return whether any span name exactly matches `name`. */ hasSpan: (name: string) => boolean; /** Return every span whose kind exactly matches `kind`. */ findSpansByKind: (kind: string) => EvalTraceSpan$1[]; /** Return every span with `kind: 'tool'` or `kind: 'tool_call'`. */ findToolCallSpans: () => EvalTraceSpan$1[]; /** * Return tool-call names, preferring GenAI/Mastra tool identity attributes * when available. */ listToolCallSpanNames: () => string[]; /** Return whether a tool-call span name or tool identity matches `name`. */ hasToolCallSpan: (name: string) => boolean; /** Return normalized tool-call spans whose name or tool identity matches `name`. */ getToolCallSpans: (name: string) => EvalToolCallSpan$1[]; /** Return how many tool-call spans have a name or tool identity matching `toolName`. */ getToolCallSpanCount: (toolName: string) => number; /** Return whether a tool-call span name or tool identity appears exactly `expectedCalls` times. */ hasToolCallSpanCount: (toolName: string, expectedCalls: number) => boolean; /** Return span names in creation order, optionally filtered by kind. */ listSpanNames: (kind?: string) => string[]; /** Return span names in depth-first tree order, optionally filtered by kind. */ listSpanNamesDfs: (kind?: string) => string[]; /** Return all spans in depth-first tree order. */ flattenDfs: () => EvalTraceSpan$1[]; checkpoints: Map; }; /** Context passed to `deriveFromTracing` after execution has completed. */ type EvalDeriveContext$1 = { trace: EvalTraceTree$1; input: TInput; case: EvalCase$1; }; type MaybePromise = T | Promise; /** Function that derives one output value for a configured output key. */ type EvalDeriveValueFn$1 = (ctx: EvalDeriveContext$1) => MaybePromise; /** Keyed `deriveFromTracing` config where each key derives one output value. */ type EvalDeriveMap$1 = Record>; /** Object-returning `deriveFromTracing` callback. */ type EvalDeriveFn$1 = (ctx: EvalDeriveContext$1) => Record | Promise>; /** Trace-derived output config accepted globally and on eval definitions. */ type EvalDeriveConfig$1 = EvalDeriveMap$1 | EvalDeriveFn$1; /** Schema for keyed or object-returning trace-derived output config. */ /** Function that records trace-derived assertions for one case. */ type EvalTracingAssertionsFn$1 = (ctx: EvalDeriveContext$1) => MaybePromise; /** Trace-derived assertion config accepted globally and on eval definitions. */ type EvalTracingAssertionsConfig$1 = EvalTracingAssertionsFn$1; /** Schema for trace-derived assertion config. */ /** UI overrides for a derived or scored column emitted by an eval. */ type EvalColumnOverride$1 = { /** Display label shown for the column in tables and detail views. */label?: string; /** Optional helper text explaining what this column represents. */ description?: string; /** * Presentation preset for the value. * * Use this to control how the UI renders the cell and infer table behavior, * for example `number`, `boolean`, `duration`, `markdown`, `json`, * `image`, `html`, `pdf`, or file/media previews. */ format?: ColumnFormat; /** * Extra options for `format: 'number'`. * * Use this to add a prefix or suffix, control minimum and maximum decimal * places, or switch to compact notation such as `1.2K`. */ numberFormat?: NumberDisplayOptions; /** * Hides the column from the runs table while keeping it available in detail * views and raw output data. */ hideInTable?: boolean; /** * Hides the column from the runs table when none of the rendered rows have a * value. Missing values, `null`, and empty strings count as no value; `0` and * `false` remain visible. */ hideIfNoValue?: boolean; /** Horizontal alignment used when rendering the column cells. */ align?: 'left' | 'center' | 'right'; /** * Maximum number of stars used when `format: 'stars'`. * * Values are still stored as normalized `0..1` numbers; the UI maps the * selected star count evenly across that range. */ maxStars?: number; }; /** Column override map keyed by output or score field name. */ type EvalColumns$1 = Record; /** Schema for UI overrides on derived or scored columns. */ /** Context passed to an input-section selector callback. */ type EvalInputSectionSelectContext = { /** Active eval case whose input is being prepared for display. */case: EvalCase$1; }; /** Function that selects one highlighted input value for case detail display. */ type EvalInputSectionSelectFn = (input: TInput, ctx: EvalInputSectionSelectContext) => MaybePromise; /** * Input section selector. String values are dot-separated paths into the case * input; function values receive the full input and return the display value. */ type EvalInputSectionSelector = string | EvalInputSectionSelectFn; /** * Rich input-section config with optional label and format metadata. * * Provide either `path` for a dot-separated input selector or `select` for a * callback. `format`, `numberFormat`, and `maxStars` use the same renderer * presets as output columns. */ type EvalInputSectionObjectConfig = { /** Label shown above the highlighted input section. Defaults to the key. */label?: string; /** Dot-separated path into the case input. */ path?: string; /** Callback that returns the highlighted value from the case input. */ select?: EvalInputSectionSelectFn; /** Presentation preset for the selected input value. */ format?: ColumnFormat; /** Extra options for `format: 'number'`. */ numberFormat?: NumberDisplayOptions; /** Maximum number of stars used when `format: 'stars'`. */ maxStars?: number; }; /** * One highlighted input section config. Use a bare string or callback for the * common case, or an object when the section needs a label or format. */ type EvalInputSectionConfig = EvalInputSectionSelector | EvalInputSectionObjectConfig; /** Input section map keyed by stable section id. */ type EvalInputSections = Record>; /** Schema for highlighted input sections shown in the case detail input tab. */ /** Render formats supported by an LLM-call metric in the UI. */ declare const llmCallMetricFormatSchema$1: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; json: "json"; duration: "duration"; }>; /** Render format applied to an LLM-call metric value. */ type LlmCallMetricFormat = z.infer; /** Render formats supported by an API-call metric in the UI. */ declare const apiCallMetricFormatSchema$1: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; json: "json"; duration: "duration"; }>; /** Render format applied to an API-call metric value. */ type ApiCallMetricFormat = z.infer; /** Where an LLM-call metric is rendered inside the LLM calls tab. */ declare const llmCallMetricPlacementSchema$1: z.ZodEnum<{ header: "header"; body: "body"; }>; /** Placement option for an LLM-call metric. */ type LlmCallMetricPlacement = z.infer; /** Where an API-call metric is rendered inside the API calls tab. */ declare const apiCallMetricPlacementSchema$1: z.ZodEnum<{ header: "header"; body: "body"; }>; /** Placement option for an API-call metric. */ type ApiCallMetricPlacement = z.infer; /** Context passed to LLM/API-call derived attribute functions. */ type CallDerivedAttributeContext = { /** Current attributes from the matching trace span. */attributes: Record | undefined; /** Matching trace span. */ span: EvalTraceSpan$1; /** Dot-path helper for reading from the current span attributes. */ get: (path: string) => unknown; }; /** * Runner-side function used to derive one new span attribute from a matching * LLM/API-call span. Return `undefined` to omit the attribute for that span. */ type CallDerivedAttribute = (ctx: CallDerivedAttributeContext) => unknown; /** * Runner-side function used to derive multiple span attributes from a matching * LLM/API-call span. Returned object keys are dot-paths under * `span.attributes`; `undefined` values are skipped. */ type CallDerivedAttributesFn = (ctx: CallDerivedAttributeContext) => Record | undefined; /** Authored LLM/API-call derived-attributes config. */ type CallDerivedAttributesConfig = Record | CallDerivedAttributesFn; /** One resolved derived span attribute rule. */ type ResolvedCallDerivedAttribute = { /** Dot-path where one derived value is persisted on `span.attributes`. */path?: string; /** * Function that derives one persisted value for each matching span. Omitted * after this config is serialized to the browser. */ compute?: CallDerivedAttribute; /** * Function that derives multiple persisted values for each matching span. * Omitted after this config is serialized to the browser. */ computeMany?: CallDerivedAttributesFn; }; /** * Schema for a single user-defined metric attached to LLM call rows. * * Each metric reads `path` from the span's `attributes` and renders the value * with the configured `format` and `numberFormat`. Use * `llmCalls.derivedAttributes` when a metric should read a value computed from * other attributes. `placements` controls whether the metric appears as a chip * on the collapsed row header, as a row inside the expanded body, or both. * Defaults to `['body']` when omitted. */ declare const llmCallMetricSchema: z.ZodObject<{ label: z.ZodString; tooltip: z.ZodOptional; path: z.ZodString; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; }, z.core.$strip>; /** User-defined metric authored in `agent-evals.config.ts`. */ type LlmCallMetric = z.infer; /** * Schema for a single user-defined metric attached to API call rows. * * Each metric reads `path` from the span's `attributes` and renders the value * with the configured `format` and `numberFormat`. Use * `apiCalls.derivedAttributes` when a metric should read a value computed from * other attributes. `placements` controls whether the metric appears as a chip * on the collapsed row header, as a row inside the expanded body, or both. * Defaults to `['body']` when omitted. */ declare const apiCallMetricSchema: z.ZodObject<{ label: z.ZodString; tooltip: z.ZodOptional; path: z.ZodString; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; }, z.core.$strip>; /** User-defined API-call metric authored in `agent-evals.config.ts`. */ type ApiCallMetric = z.infer; /** * Schema for pricing rates used to derive LLM-call costs from token counts. */ declare const llmCallPricingRateSchema: z.ZodObject<{ inputUsdPerMillion: z.ZodOptional; outputUsdPerMillion: z.ZodOptional; cachedInputUsdPerMillion: z.ZodOptional; cacheCreationInputUsdPerMillion: z.ZodOptional; cacheCreationInput1hUsdPerMillion: z.ZodOptional; reasoningUsdPerMillion: z.ZodOptional; }, z.core.$strip>; /** Token pricing rates authored in `agent-evals.config.ts`. */ type LlmCallPricingRate = z.infer; /** * Schema for one model's pricing config. The object key is the exact model * name. Use `providers` when a model has provider-specific rates in addition * to, or instead of, generic model rates. */ declare const llmCallPricingSchema: z.ZodObject<{ inputUsdPerMillion: z.ZodOptional; outputUsdPerMillion: z.ZodOptional; cachedInputUsdPerMillion: z.ZodOptional; cacheCreationInputUsdPerMillion: z.ZodOptional; cacheCreationInput1hUsdPerMillion: z.ZodOptional; reasoningUsdPerMillion: z.ZodOptional; provider: z.ZodOptional; providers: z.ZodOptional; outputUsdPerMillion: z.ZodOptional; cachedInputUsdPerMillion: z.ZodOptional; cacheCreationInputUsdPerMillion: z.ZodOptional; cacheCreationInput1hUsdPerMillion: z.ZodOptional; reasoningUsdPerMillion: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; /** Model pricing config authored in `agent-evals.config.ts`. */ type LlmCallPricing = z.infer; /** Model-keyed pricing registry authored in `agent-evals.config.ts`. */ type LlmCallPricingRegistry = Record; /** * Schema for extra currencies displayed in the LLM calls breakdown table. * Costs are still derived in USD, then multiplied by `usdToCurrencyRate`. */ declare const llmCallCostCurrencySchema: z.ZodObject<{ code: z.ZodString; label: z.ZodOptional; usdToCurrencyRate: z.ZodNumber; numberFormat: z.ZodOptional>>; }, z.core.$strip>; /** Extra LLM-call cost currency authored in `agent-evals.config.ts`. */ type LlmCallCostCurrency = z.infer; /** Schema for the global LLM calls config block in `agent-evals.config.ts`. */ declare const llmCallsConfigSchema: z.ZodObject<{ kinds: z.ZodOptional>; attributes: z.ZodOptional; provider: z.ZodOptional; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; cachedInputTokens: z.ZodOptional; cacheCreationInputTokens: z.ZodOptional; cacheCreationInput1hTokens: z.ZodOptional; reasoningTokens: z.ZodOptional; latencyMs: z.ZodOptional; steps: z.ZodOptional; finishReason: z.ZodOptional; input: z.ZodOptional; output: z.ZodOptional; reasoning: z.ZodOptional; toolCalls: z.ZodOptional; }, z.core.$strip>>; derivedAttributes: z.ZodOptional>>; pricing: z.ZodOptional; outputUsdPerMillion: z.ZodOptional; cachedInputUsdPerMillion: z.ZodOptional; cacheCreationInputUsdPerMillion: z.ZodOptional; cacheCreationInput1hUsdPerMillion: z.ZodOptional; reasoningUsdPerMillion: z.ZodOptional; provider: z.ZodOptional; providers: z.ZodOptional; outputUsdPerMillion: z.ZodOptional; cachedInputUsdPerMillion: z.ZodOptional; cacheCreationInputUsdPerMillion: z.ZodOptional; cacheCreationInput1hUsdPerMillion: z.ZodOptional; reasoningUsdPerMillion: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>>; costCurrencies: z.ZodOptional; usdToCurrencyRate: z.ZodNumber; numberFormat: z.ZodOptional>>; }, z.core.$strip>>>; metrics: z.ZodOptional; path: z.ZodString; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; }, z.core.$strip>>>; }, z.core.$strip>; /** Authored LLM calls config accepted from `agent-evals.config.ts`. */ type LlmCallsConfigInput = z.infer; /** Schema for the global API calls config block in `agent-evals.config.ts`. */ declare const apiCallsConfigSchema: z.ZodObject<{ kinds: z.ZodOptional>; attributes: z.ZodOptional; url: z.ZodOptional; routeAlias: z.ZodOptional; statusCode: z.ZodOptional; request: z.ZodOptional; response: z.ZodOptional; requestBody: z.ZodOptional; responseBody: z.ZodOptional; headers: z.ZodOptional; durationMs: z.ZodOptional; error: z.ZodOptional; }, z.core.$strip>>; derivedAttributes: z.ZodOptional>>; metrics: z.ZodOptional; path: z.ZodString; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; }, z.core.$strip>>>; }, z.core.$strip>; /** Authored API calls config accepted from `agent-evals.config.ts`. */ type ApiCallsConfigInput = z.infer; /** Schema for workspace-level run log capture options. */ declare const runLogsConfigSchema: z.ZodObject<{ captureConsole: z.ZodOptional; }, z.core.$strip>; /** Workspace-level run log capture options. */ type RunLogsConfigInput = z.infer; /** Resolved LLM-calls config sent to the UI with all defaults applied. */ type ResolvedLlmCallsConfig = { kinds: string[]; attributes: { model: string; provider: string; inputTokens: string; outputTokens: string; cachedInputTokens: string; cacheCreationInputTokens: string; cacheCreationInput1hTokens: string; reasoningTokens: string; latencyMs: string; steps: string; finishReason: string; input: string; output: string; reasoning: string; toolCalls: string; }; derivedAttributes: ResolvedCallDerivedAttribute[]; metrics: ResolvedLlmCallMetric[]; pricing: ResolvedLlmCallPricing[]; costCurrencies: ResolvedLlmCallCostCurrency[]; }; /** Resolved API-calls config sent to the UI with all defaults applied. */ type ResolvedApiCallsConfig = { kinds: string[]; attributes: { method: string; url: string; routeAlias: string; statusCode: string; request: string; response: string; requestBody: string; responseBody: string; headers: string; durationMs: string; error: string; }; derivedAttributes: ResolvedCallDerivedAttribute[]; metrics: ResolvedApiCallMetric[]; }; /** Fully-resolved LLM-call metric used by the runner and UI. */ type ResolvedLlmCallMetric = { label: string; tooltip?: string; path: string; format: LlmCallMetricFormat; numberFormat?: NumberDisplayOptions; placements: LlmCallMetricPlacement[]; }; /** Fully-resolved API-call metric used by the runner and UI. */ type ResolvedApiCallMetric = { label: string; tooltip?: string; path: string; format: ApiCallMetricFormat; numberFormat?: NumberDisplayOptions; placements: ApiCallMetricPlacement[]; }; /** Fully-resolved pricing entry used by the LLM calls extractor. */ type ResolvedLlmCallPricing = { model: string; provider?: string; inputUsdPerMillion?: number; outputUsdPerMillion?: number; cachedInputUsdPerMillion?: number; cacheCreationInputUsdPerMillion?: number; cacheCreationInput1hUsdPerMillion?: number; /** * USD per one million reasoning tokens when reported outside `outputTokens`. * If `outputTokens` already includes reasoning, reasoning is not billed again. */ reasoningUsdPerMillion?: number; }; /** Fully-resolved extra currency used by the LLM calls tab. */ type ResolvedLlmCallCostCurrency = { code: string; label?: string; usdToCurrencyRate: number; numberFormat?: NumberDisplayOptions; }; /** Default LLM-calls config the UI uses before the workspace fetch resolves. */ /** Top-level config authored in `agent-evals.config.ts`. */ type AgentEvalsConfig$1 = { /** Root directory used to resolve all relative paths. Defaults to `process.cwd()`. */workspaceRoot?: string; /** Glob patterns (relative to `workspaceRoot`) used to discover eval files. */ include: string[]; /** Workspace-wide tags inherited by every eval unless removed per eval. */ tags?: string[]; /** Number of trials per case when none is specified. Defaults to `1`. */ defaultTrials?: number; /** * Strategy used to pick the single persisted result when `trials > 1`. * * `lowestScore` is the default. `median` uses the lower median when the * number of trials is even. */ trialSelection?: TrialSelectionMode; /** * Maximum number of case executions that may run in parallel across one run, * including trial fan-out. Defaults to `2`. */ concurrency?: number; /** * Age threshold, in days, before a latest run from a different commit is * considered outdated. Defaults to `14`. */ staleAfterDays?: number; /** * Whether `agent-evals run` may run every discovered eval when no `--eval` * or `--case` filter is provided. Defaults to `false`; set to `true` to * opt into unfiltered CLI runs. Grouped runs in the UI are still allowed. */ allowCliRunAll?: boolean; /** * Global trace attribute display config for the UI. * * These rules are merged with per-eval `traceDisplay` rules, with the eval * definition taking precedence for matching `key` or `path` entries. */ traceDisplay?: TraceDisplayInputConfig; /** * Workspace-wide output columns applied to every eval. * * Eval-level `columns` with the same key take precedence. Authored columns * are ordered before built-in default columns unless defaults are removed * with `removeDefaultConfig`. */ columns?: EvalColumns$1; /** * Workspace-wide highlighted input sections applied to every eval case. * * Use string values for dot-separated input paths, callback values for custom * selection, or rich objects for labels and formats. Eval-level * `inputSections` with the same key override these entries. */ inputSections?: EvalInputSections; /** * Workspace-wide trace-derived outputs applied to every eval case. * * Prefer the keyed map form for shared metrics: * `{ toolCalls: ({ trace }) => trace.findSpansByKind('tool').length }`. * The object-returning function form is also supported. Derived outputs * only fill keys that were not already recorded by eval execution. Do not * call assertion helpers here; use `tracingAssertions` for trace-derived * pass/fail checks. */ deriveFromTracing?: EvalDeriveConfig$1; /** * Workspace-wide assertions derived from the finished execution trace. * * These run after `deriveFromTracing` and before output schema validation and * scores. Use `evalAssert(...)` or `evalExpect(...)` inside the callback to * record normal assertion results without creating fake score columns. */ tracingAssertions?: EvalTracingAssertionsConfig$1; /** * Workspace-wide stats prepended to every eval's stats row. * * Eval-level stats render after these, and built-in default stats are * appended last unless removed with `removeDefaultConfig`. */ stats?: EvalStatsConfig; /** * Initial aggregate mode used for duration and column stats on every eval * card. * * Per-eval `defaultStatAggregate` overrides this value. Individual stat * `aggregate` values still define their authored reducer and remain the * fallback when no default aggregate is configured. */ defaultStatAggregate?: EvalStatAggregate; /** * Configuration for the "LLM calls" tab in the case-run drawer. * * Determines which trace spans are treated as LLM calls (`kinds`), how * structured fields like `model` and `usage.inputTokens` are read from * span attributes, which pricing registry derives built-in costs, and which * custom user-defined metrics are surfaced on each call. All fields are * optional and fall back to the documented defaults; the LLM calls tab is * shown automatically when at least one matching span exists in a case run. * * @example * ```ts * llmCalls: { * kinds: ['llm', 'ai-sdk.generateText'], * attributes: { * cachedInputTokens: 'usage.cache_read_input_tokens', * }, * metrics: [ * { label: 'Retries', path: 'retryCount', format: 'number' }, * ], * pricing: { * 'gpt-4o-mini': { * provider: 'openai', * inputUsdPerMillion: 0.15, * outputUsdPerMillion: 0.6, * }, * }, * costCurrencies: [ * { code: 'BRL', usdToCurrencyRate: 5.7, numberFormat: { prefix: 'R$ ' } }, * ], * } * ``` */ llmCalls?: LlmCallsConfigInput; /** * Remove built-in eval-level outputs, columns, stats, and charts. * * Defaults are derived from trace spans using the resolved `llmCalls` and * `apiCalls` extraction configs. Set to `true` to remove all defaults, or * pass specific keys such as `['costUsd', 'apiCalls']` to remove only those * defaults globally. Removing `costUsd` removes the whole default cost * family, including normalized no-cache and warmed-cache outputs. Per-eval * removal is additive. */ removeDefaultConfig?: RemoveDefaultConfig; /** * Configuration for the "API calls" tab in the case-run drawer. * * Determines which trace spans are treated as API calls (`kinds`), how * structured fields like `method`, `url`, and `statusCode` are read from * span attributes, and which custom user-defined metrics are surfaced on * each call. All fields are optional and fall back to the documented * defaults; the API calls tab is shown automatically when at least one * matching span exists in a case run. * * @example * ```ts * apiCalls: { * kinds: ['api', 'http.client', 'undici.request'], * attributes: { * statusCode: 'http.status_code', * routeAlias: 'http.route', * }, * metrics: [ * { label: 'Retries', path: 'retryCount', format: 'number' }, * ], * } * ``` */ apiCalls?: ApiCallsConfigInput; /** * Configuration for case run logs. * * Console capture is enabled by default and stores `console.log`, * `console.info`, `console.warn`, and `console.error` calls made during * active case-owned phases. Set `captureConsole: false` to keep console * output visible in the terminal without persisting it to case details. * Manual `evalLog(...)` calls are still persisted. */ runLogs?: RunLogsConfigInput; /** * Optional controls for the operation cache. When omitted, the cache is * enabled and stored under `/.agent-evals/cache`. */ cache?: { /** Disable the cache entirely; spans with `cache` options execute as if uncached. */enabled?: boolean; /** Override the directory used to persist cache entries. */ dir?: string; /** * Maximum indexed cache bytes retained per cache namespace. * * Pass a number to set the default byte cap for every namespace. Pass an * object to set a default byte cap plus exact namespace-specific caps. * Non-positive or non-finite values fall back to the default 3 MiB cap. * * @example * ```ts * cache: { * maxBytes: { * default: 10 * 1024 * 1024, * namespaces: { 'receipt-audit.receipt-audit-context': 50 * 1024 * 1024 }, * }, * } * ``` */ maxBytes?: number | { default?: number; namespaces?: Record; }; /** * Milliseconds the runner waits after becoming idle before pruning indexed * cache entries. Defaults to `5000`; non-positive or non-finite values use * the default. */ pruneIdleDelayMs?: number; /** * Maximum age, in milliseconds, for cache entries that are only referenced * by old non-latest saved runs. Defaults to 15 days. Entries referenced by * the latest run for a current eval are protected from this age cleanup. */ oldRunMaxAgeMs?: number; /** * Minimum milliseconds between `lastAccessedAt` index rewrites for repeated * cache hits. Defaults to four hours. Set to `0` to record every hit. */ lastAccessedAtUpdateIntervalMs?: number; }; }; /** Zod schema for validating `agent-evals.config.ts` input. */ //#endregion //#region src/utils/extractLlmCalls.d.ts /** Resolved value for one user-defined metric on an LLM call row. */ type LlmCallMetricValue = { label: string; tooltip: string | undefined; rawValue: unknown; format: LlmCallMetricFormat; numberFormat: NumberDisplayOptions | undefined; placements: LlmCallMetricPlacement[]; }; /** Single entry rendered as one expandable row in the LLM calls tab. */ type LlmCallEntry = { id: string; name: string; kind: string; status: EvalTraceSpan$1['status']; model: string | null; provider: string | null; inputTokens: number | null; outputTokens: number | null; cachedInputTokens: number | null; cacheCreationInputTokens: number | null; reasoningTokens: number | null; totalTokens: number | null; /** Time to first token for the LLM call in milliseconds, when reported by the span. */ latencyMs: number | null; /** Output-token throughput over the full elapsed LLM call duration. */ tokensPerSecond: number | null; costUsd: number | null; inputCostUsd: number | null; outputCostUsd: number | null; cachedInputCostUsd: number | null; cacheCreationInputCostUsd: number | null; reasoningCostUsd: number | null; /** Number of inference rounds. Derived from the array length when `stepDetails` is set. */ stepCount: number | null; /** Per-step breakdown when the configured `steps` attribute resolves to an array. */ stepDetails: unknown[] | null; finishReason: string | null; /** Elapsed LLM call span duration in milliseconds. */ durationMs: number | null; input: unknown; output: unknown; reasoning: unknown; toolCalls: unknown; metrics: LlmCallMetricValue[]; warnings: EvalTraceSpanWarning$1[]; error: EvalTraceSpanError$1 | null; }; /** * Cost-simulation scenarios available in the LLM calls breakdown table. * * - `actual` — Real billed cost recorded on the span. * - `noCache` — Bill every input token at the base input rate, ignoring all * cache reads and cache writes. Worst case for any prompt that could be * cached. * - `withBaseCaching` — Steady-state cost on a fully warmed cache: cache * writes are treated as already paid (free), cache reads keep the cache-read * discount, and base input keeps the base rate. When the call has no * caching at all, every input token is billed at the cache-read rate, as if * the prompt had been warmed by an earlier run. Cache-read pricing is the * same on the base (5-minute) and extended (1-hour) tiers, so this scenario * covers the warmed case for both TTLs. * - `withBaseCachingWrite` — First-call cost paying the 5-minute cache write * premium. When the call already uses caching, every cache write token is * billed at the 5-minute rate (any extended-cache split is folded into the * 5-minute rate). When the call has no caching at all, every input token is * billed at the 5-minute cache write rate, as if this were the first call * warming up the base cache. * - `withExtendedCachingWrite` — First-call cost paying the extended (e.g. * 1-hour) cache write premium. When the call already uses caching, every * cache write token is billed at the extended rate. When the call has no * caching at all, every input token is billed at the extended cache write * rate, as if this were the first call warming up the extended cache. */ type LlmCostScenario = 'actual' | 'noCache' | 'withBaseCaching' | 'withBaseCachingWrite' | 'withExtendedCachingWrite'; /** Per-row cost values returned by {@link simulateLlmCallCost}. */ type LlmCallCostBreakdown = { inputCostUsd: number | null; outputCostUsd: number | null; cachedInputCostUsd: number | null; cacheCreationInputCostUsd: number | null; reasoningCostUsd: number | null; totalCostUsd: number | null; }; /** * Recompute the LLM-call cost breakdown for a hypothetical billing scenario, * using the call's recorded token counts and the resolved pricing registry. * * The `actual` scenario returns the costs already stored on `entry`. Other * scenarios re-derive each cost component from `pricing` so users can compare * what the same usage would have cost under different cache strategies. When * pricing is missing for the model/provider, simulated cost components fall * back to `null` exactly like the original extractor. */ declare function simulateLlmCallCost({ entry, pricing, scenario }: { entry: LlmCallEntry; pricing: ResolvedLlmCallPricing[]; scenario: LlmCostScenario; }): LlmCallCostBreakdown; /** Per-row simulated token counts shown in the LLM call breakdown table. */ type LlmCallSimulatedTokens = { /** Tokens shown on the `Input` row — base input only (cached + creation are subtracted). */baseInputTokens: number | null; /** Tokens shown on the `Cache read` row. */ cachedInputTokens: number | null; /** Tokens shown on the `Cache write` row. */ cacheCreationInputTokens: number | null; }; /** * Project the call's recorded token allocation onto a hypothetical billing * scenario. Cacheable tokens shift between rows so the breakdown reflects the * simulated billing model: `noCache` folds reads/writes into base input, * `withBaseCaching` (warmed) treats every cacheable token as a cache read, and * the first-call write scenarios treat every cacheable token as a cache write. * * The returned counts are what the UI renders on each row and what * {@link simulateLlmCallCost} prices, so display and totals never drift. */ declare function simulateTokenAllocation({ entry, scenario }: { entry: LlmCallEntry; scenario: LlmCostScenario; }): LlmCallSimulatedTokens; /** * Filter `spans` down to LLM calls and project each one to the structured * shape consumed by the LLM calls tab. * * Spans whose `kind` is not in `config.kinds` are dropped. Structured fields * (`model`, token counts, latency, etc.) are read via * `getNestedAttribute` from the configured paths, with safe coercion to * `string | null` / `number | null`. `latencyMs` is an explicit * time-to-first-token attribute; full span elapsed time is reported separately * as `durationMs`. `tokensPerSecond` is output tokens divided by that full * elapsed duration. Built-in USD costs are derived only from configured model * pricing and token counts. `totalTokens` is always derived from input + * output tokens. Cached input, cache creation, and reasoning tokens are * reported separately because they are subsets of input/output usage. The main * cache creation token field is treated as the total write count; optional * one-hour cache creation tokens only split that total for cost calculation. * Base input cost uses input minus cache read/write tokens so cached tokens are * not charged twice. Reasoning tokens are not charged again when they are * already included in `outputTokens`. Cache read/write costs still contribute * to the total USD cost at their configured rates. The `steps` attribute path * may resolve to an array * of per-step detail objects, with `stepCount` derived from the array length. * When a matching LLM span does not expose that array, direct child spans with * `kind: 'model_step'` are used as the step details instead. This preserves * Mastra/OpenTelemetry traces where model steps are emitted as child spans. * `durationMs` and `tokensPerSecond` are `null` while the span is still * running. User-defined `metrics` whose path resolves to * `undefined` are dropped, but `null`, `0`, and `false` are preserved as * legitimate values worth displaying. Original span order is preserved so the * LLM calls tab matches the ordering in the Trace tab. */ declare function extractLlmCalls(spans: EvalTraceSpan$1[], config: ResolvedLlmCallsConfig): LlmCallEntry[]; //#endregion //#region src/utils/extractApiCalls.d.ts /** Resolved value for one user-defined metric on an API call row. */ type ApiCallMetricValue = { label: string; tooltip: string | undefined; rawValue: unknown; format: ApiCallMetricFormat; numberFormat: NumberDisplayOptions | undefined; placements: ApiCallMetricPlacement[]; }; /** Single entry rendered as one expandable row in the API calls tab. */ type ApiCallEntry = { id: string; name: string; kind: string; status: EvalTraceSpan$1['status']; method: string | null; url: string | null; /** * Dynamic route alias read from the API span, such as `/v3/tabs/:id`. * The original `url` stays available for request details. */ routeAlias: string | null; statusCode: number | null; /** Elapsed API call duration in milliseconds. */ durationMs: number | null; request: unknown; response: unknown; requestBody: unknown; responseBody: unknown; headers: unknown; errorPayload: unknown; metrics: ApiCallMetricValue[]; warnings: EvalTraceSpanWarning$1[]; error: EvalTraceSpanError$1 | null; }; /** * Filter `spans` down to API calls and project each one to the structured * shape consumed by the API calls tab. * * Spans whose `kind` is not in `config.kinds` are dropped. Structured fields * (`method`, `url`, `statusCode`, etc.) are read via `getNestedAttribute` from * the configured paths. An explicit `durationMs` attribute takes precedence, * with a fallback to the span start/end timestamps. User-defined `metrics` * whose path resolves to `undefined` are dropped, but `null`, `0`, and `false` * are preserved as legitimate values worth displaying. Original span order is * preserved so the API calls tab matches the ordering in the Trace tab. */ declare function extractApiCalls(spans: EvalTraceSpan$1[], config: ResolvedApiCallsConfig): ApiCallEntry[]; //#endregion //#region src/schemas/cache.d.ts /** * Mode that controls how the cache is consulted for a given run. * * - `use`: read cache on hit, write on miss. Default. * - `bypass`: never read, never write. * - `refresh`: never read, always write (forces re-execution and overwrites). */ declare const cacheModeSchema: z.ZodEnum<{ use: "use"; bypass: "bypass"; refresh: "refresh"; }>; /** Mode controlling how cached spans behave during a run. */ type CacheMode = z.infer; /** * Filesystem storage target for one cached operation. * * - `durable`: store under `.agent-evals/cache`, intended for small reusable * cache entries that a project may commit. * - `temporary`: store under `.agent-evals/tmp/cache`, intended for large or * local-only cache entries. */ declare const cacheStorageSchema$1: z.ZodEnum<{ durable: "durable"; temporary: "temporary"; }>; /** Filesystem storage target for one cached operation. */ type CacheStorage$1 = z.infer; /** Options accepted by an `evalTracer.span` call to opt the span into caching. */ declare const spanCacheOptionsSchema: z.ZodObject<{ key: z.ZodUnknown; namespace: z.ZodString; storage: z.ZodOptional>; serializeFileBytes: z.ZodOptional; }, z.core.$strip>; /** Options accepted by an `evalTracer.span` call to opt the span into caching. */ type SpanCacheOptions = z.infer; /** Category of operation stored in the eval cache. */ declare const cacheOperationTypeSchema: z.ZodEnum<{ span: "span"; value: "value"; }>; /** Category of operation stored in the eval cache. */ type CacheOperationType = z.infer; /** Status of a cache lookup recorded on a span or case scope. */ declare const cacheStatusSchema: z.ZodEnum<{ bypass: "bypass"; refresh: "refresh"; hit: "hit"; miss: "miss"; }>; /** Status of a cache lookup recorded on a span or case scope. */ type CacheStatus = z.infer; /** * Reference to a value-cache lookup performed via `evalTracer.cache(...)`. * * Refs are appended to the active span's `cache.refs` attribute when the call * happens inside a `traceSpan(...)` body, or to the case scope's * `caseCacheRefs` bucket when the call is made directly from the case body. */ declare const traceCacheRefSchema: z.ZodObject<{ type: z.ZodLiteral<"value">; name: z.ZodString; namespace: z.ZodString; key: z.ZodString; status: z.ZodEnum<{ bypass: "bypass"; refresh: "refresh"; hit: "hit"; miss: "miss"; }>; storage: z.ZodOptional>; read: z.ZodOptional; stored: z.ZodOptional; storedAt: z.ZodOptional; age: z.ZodOptional; }, z.core.$strip>; /** Reference to a value-cache lookup performed via `evalTracer.cache(...)`. */ type TraceCacheRef$1 = z.infer; /** Minimal index-backed summary of a persisted cache entry. */ declare const cacheListItemSchema$1: z.ZodObject<{ key: z.ZodString; namespace: z.ZodString; storedAt: z.ZodString; lastAccessedAt: z.ZodNullable; }, z.core.$strip>; /** Minimal summary row for a single cache entry. */ type CacheListItem = z.infer; /** Summary of cleanup performed by manual cache repair. */ declare const cacheRepairSummarySchema$1: z.ZodObject<{ removedCacheFiles: z.ZodNumber; removedDebugFiles: z.ZodNumber; removedBlobFiles: z.ZodNumber; removedIndexRows: z.ZodNumber; rewrittenIndexes: z.ZodNumber; }, z.core.$strip>; /** Stable JSON summary returned by manual cache repair. */ type CacheRepairSummary = z.infer; /** Serialized nested span captured while recording a cached operation. */ type SerializedCacheSpan = { kind: string; name: string; attributes?: Record; status: 'running' | 'ok' | 'error' | 'cancelled'; error?: EvalTraceSpanError$1; errors?: EvalTraceSpanError$1[]; warning?: EvalTraceSpanWarning$1; warnings?: EvalTraceSpanWarning$1[]; children: SerializedCacheSpan[]; }; /** Zod schema for `SerializedCacheSpan`, defined lazily for recursion. */ /** * One captured operation performed while a cached span's body executed. * * Operations are replayed in order against a fresh scope on cache hit to * reproduce the observable effects of the original run. */ declare const cacheRecordingOpSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"setOutput">; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">; /** Single effect captured by a cache recording. */ type CacheRecordingOp = z.infer; /** * Captured observable effects + return value of a cached span body. * * Persisted JSON omits object properties whose value is `undefined`; parsing * normalizes an omitted `returnValue` back to an explicit undefined return. */ declare const cacheRecordingSchema: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; /** Captured observable effects + return value of a cached span body. */ type CacheRecording = z.output; /** Persisted cache file containing metadata and a recording. */ declare const cacheEntrySchema: z.ZodObject<{ version: z.ZodLiteral<1>; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodOptional>; operationName: z.ZodOptional; spanName: z.ZodOptional; spanKind: z.ZodOptional; storedAt: z.ZodString; recording: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; }, z.core.$strip>; /** Persisted cache file contents. */ type CacheEntry = z.infer; /** * Debug-only raw key metadata stored outside the reusable cache entry. * * Debug entries mirror the serialized cache entry so inspecting one debug file * shows both the authored raw key and the persisted payload for that key. */ declare const cacheDebugKeyEntrySchema: z.ZodObject<{ version: z.ZodLiteral<1>; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodEnum<{ span: "span"; value: "value"; }>; operationName: z.ZodString; storedAt: z.ZodString; rawKey: z.ZodUnknown; entry: z.ZodObject<{ version: z.ZodLiteral<1>; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodOptional>; operationName: z.ZodOptional; spanName: z.ZodOptional; spanKind: z.ZodOptional; storedAt: z.ZodString; recording: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; }, z.core.$strip>; }, z.core.$strip>; /** * Debug-only raw cache key entry. * * May contain sensitive prompt/input data and the full serialized cache entry. */ type CacheDebugKeyEntry = z.infer; /** Cache lookup response with optional debug-only raw key data. */ declare const cacheEntryWithDebugKeySchema$1: z.ZodObject<{ version: z.ZodLiteral<1>; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodOptional>; operationName: z.ZodOptional; spanName: z.ZodOptional; spanKind: z.ZodOptional; storedAt: z.ZodString; recording: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; debugKey: z.ZodOptional; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodEnum<{ span: "span"; value: "value"; }>; operationName: z.ZodString; storedAt: z.ZodString; rawKey: z.ZodUnknown; entry: z.ZodObject<{ version: z.ZodLiteral<1>; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodOptional>; operationName: z.ZodOptional; spanName: z.ZodOptional; spanKind: z.ZodOptional; storedAt: z.ZodString; recording: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; }, z.core.$strip>; }, z.core.$strip>>; }, z.core.$strip>; /** Cache lookup response returned by cache APIs when raw-key debug data exists. */ type CacheEntryWithDebugKey = z.infer; /** Legacy aggregate cache file shape retained for API compatibility. */ declare const cacheFileSchema: z.ZodObject<{ version: z.ZodLiteral<1>; owner: z.ZodString; entries: z.ZodRecord; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodOptional>; operationName: z.ZodOptional; spanName: z.ZodOptional; spanKind: z.ZodOptional; storedAt: z.ZodString; recording: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; }, z.core.$strip>>; }, z.core.$strip>; /** Legacy aggregate cache file contents retained for API compatibility. */ type CacheFile = z.infer; /** Legacy aggregate debug file shape retained for API compatibility. */ declare const cacheDebugKeyFileSchema: z.ZodObject<{ version: z.ZodLiteral<1>; owner: z.ZodString; entries: z.ZodRecord; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodEnum<{ span: "span"; value: "value"; }>; operationName: z.ZodString; storedAt: z.ZodString; rawKey: z.ZodUnknown; entry: z.ZodObject<{ version: z.ZodLiteral<1>; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodOptional>; operationName: z.ZodOptional; spanName: z.ZodOptional; spanKind: z.ZodOptional; storedAt: z.ZodString; recording: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; }, z.core.$strip>; }, z.core.$strip>>; }, z.core.$strip>; /** Legacy aggregate raw cache key debug file contents retained for compatibility. */ type CacheDebugKeyFile = z.infer; //#endregion //#region src/utils/extractCacheHits.d.ts /** * Single cache activity entry rendered as one row in the case drawer's Cache * tab. * * `action === 'hit'` rows reused an existing persisted cache entry. * `action === 'added'` rows came from a miss or refresh that wrote a persisted * cache entry during the run. `action === 'notStored'` rows executed a cached * operation but did not persist it because storage was disabled for that eval * scope. `origin === 'caseRoot'` rows came from `evalTracer.cache(...)` calls * made directly from the case body (no surrounding `traceSpan`), which would * otherwise be invisible. */ type CacheActivityEntry = { id: string; source: 'span' | 'value'; origin: 'span' | 'caseRoot'; action: 'hit' | 'added' | 'notStored'; status: 'hit' | 'miss' | 'refresh'; stored: boolean; name: string; namespace: string; key: string; storage?: CacheStorage$1; storedAt: string | undefined; age: number | undefined; spanId: string | undefined; }; /** Cache activity row narrowed to cache hits for compatibility helpers. */ type CacheHitEntry = CacheActivityEntry & { action: 'hit'; status: 'hit'; }; /** * Collect every cache hit or cache write recorded for a case run. * * Walks `spans` for span-level cache activity (`attributes['cache.status']`) * and per-span value-cache refs (`attributes['cache.refs']`), then appends * spanless value-cache refs persisted on the case scope. Bypasses are skipped * because they do not read or write a persisted cache entry. */ declare function extractCacheEntries(spans: EvalTraceSpan$1[], caseCacheRefs: TraceCacheRef$1[]): CacheActivityEntry[]; /** * Collect every `status === 'hit'` cache event recorded for a case run. * * This compatibility helper returns only rows that reused an existing * persisted cache entry. Use `extractCacheEntries(...)` when the UI should * include cache misses and refreshes that wrote entries during the run. */ declare function extractCacheHits(spans: EvalTraceSpan$1[], caseCacheRefs: TraceCacheRef$1[]): CacheHitEntry[]; //#endregion //#region src/schemas/sse.d.ts declare const sseEventTypeSchema: z.ZodEnum<{ "discovery.updated": "discovery.updated"; "config.reload": "config.reload"; "run.started": "run.started"; "run.summary": "run.summary"; "case.started": "case.started"; "case.updated": "case.updated"; "case.finished": "case.finished"; "trace.span": "trace.span"; "run.finished": "run.finished"; "run.cancelled": "run.cancelled"; "run.error": "run.error"; }>; /** Server-sent event name emitted by the runner or backend. */ type SseEventType = z.infer; /** Schema for the SSE envelope used to stream run updates to clients. */ declare const sseEnvelopeSchema$1: z.ZodObject<{ type: z.ZodString; runId: z.ZodOptional; timestamp: z.ZodString; payload: z.ZodUnknown; }, z.core.$strip>; /** Wire format for a streamed event emitted during eval execution. */ type SseEnvelope = z.infer; //#endregion //#region src/schemas/api.d.ts /** Lifecycle state for an app config reload triggered by `agent-evals.config.ts`. */ declare const configReloadStatusSchema: z.ZodEnum<{ idle: "idle"; pending: "pending"; reloading: "reloading"; }>; /** Status for config reloads in the long-running app server. */ type ConfigReloadStatus = z.infer; /** UI/API-visible state for config reloads in `agent-evals app`. */ declare const configReloadStateSchema$1: z.ZodObject<{ status: z.ZodEnum<{ idle: "idle"; pending: "pending"; reloading: "reloading"; }>; activeRunCount: z.ZodNumber; lastChangedAt: z.ZodNullable; lastReloadedAt: z.ZodNullable; }, z.core.$strip>; /** UI/API-visible state for config reloads in `agent-evals app`. */ type ConfigReloadState = z.infer; /** Schema for the API request that starts a new eval run. */ declare const createRunRequestSchema$1: z.ZodObject<{ target: z.ZodObject<{ mode: z.ZodEnum<{ all: "all"; evalIds: "evalIds"; caseIds: "caseIds"; }>; evalKeys: z.ZodOptional>; files: z.ZodOptional>; evalIds: z.ZodOptional>; caseIds: z.ZodOptional>; tagsFilter: z.ZodOptional>; }, z.core.$strip>; trials: z.ZodNumber; temporary: z.ZodOptional; cache: z.ZodOptional>; }, z.core.$strip>>; manualInputs: z.ZodOptional>; }, z.core.$strip>; /** Request payload accepted by the run creation endpoint. */ type CreateRunRequest = z.infer; /** Schema for updating a UI-authored manual score on one persisted case. */ declare const updateManualScoreRequestSchema: z.ZodObject<{ value: z.ZodNullable; }, z.core.$strip>; /** Request payload accepted by the manual score update endpoint. */ type UpdateManualScoreRequest = z.infer; //#endregion //#region src/schemas/manualInput.d.ts /** One option rendered by the `select` widget. */ declare const manualInputSelectOptionSchema: z.ZodObject<{ value: z.ZodString; label: z.ZodString; }, z.core.$strip>; /** One option rendered by the `select` widget. */ type ManualInputSelectOption = z.infer; /** Single line text widget descriptor. */ /** * Discriminated union of all supported manual-input widget kinds. The web UI * dispatches to the matching field component based on `kind`. */ declare const manualInputFieldDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"text">; minLength: z.ZodOptional; maxLength: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"multiline">; minLength: z.ZodOptional; maxLength: z.ZodOptional; rows: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"number">; min: z.ZodOptional; max: z.ZodOptional; step: z.ZodOptional; integer: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"boolean">; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"select">; options: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"json">; rows: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"file">; accept: z.ZodOptional; maxSizeBytes: z.ZodOptional; }, z.core.$strip>], "kind">; /** Single field descriptor rendered by the manual-input modal. */ type ManualInputFieldDescriptor = z.infer; /** Widget kind discriminant for {@link ManualInputFieldDescriptor}. */ type ManualInputFieldKind = ManualInputFieldDescriptor['kind']; /** * Wire-format descriptor attached to an `EvalSummary` when the eval declares * `manualInput`. Carries the ordered list of fields the modal renders and * basic context shown in the modal header. */ declare const manualInputDescriptorSchema: z.ZodObject<{ title: z.ZodOptional; description: z.ZodOptional; submitLabel: z.ZodOptional; fields: z.ZodArray; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"text">; minLength: z.ZodOptional; maxLength: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"multiline">; minLength: z.ZodOptional; maxLength: z.ZodOptional; rows: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"number">; min: z.ZodOptional; max: z.ZodOptional; step: z.ZodOptional; integer: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"boolean">; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"select">; options: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"json">; rows: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"file">; accept: z.ZodOptional; maxSizeBytes: z.ZodOptional; }, z.core.$strip>], "kind">>; }, z.core.$strip>; /** Wire-format manual-input descriptor attached to an `EvalSummary`. */ type ManualInputDescriptor = z.infer; //#endregion //#endregion //#region ../runner/dist/index.d.mts //#region ../shared/src/schemas/display.d.ts /** Numeric presentation options for values rendered with `format: 'number'`. */ type NumberDisplayOptions$1 = { /** Number notation used when rendering the value. */notation?: 'standard' | 'compact'; /** Compact style used when `notation: 'compact'` is enabled. */ compactDisplay?: 'short' | 'long'; /** String prepended to the rendered number, such as `$`. */ prefix?: string; /** String appended to the rendered number, such as ` ms`. */ suffix?: string; /** Minimum number of decimal places to render. */ minDecimalPlaces?: number; /** Maximum number of decimal places to render. */ maxDecimalPlaces?: number; }; //#endregion //#region ../shared/src/schemas/trace.d.ts /** Schema for an error attached to a trace span. */ declare const traceSpanErrorSchema: z.ZodObject<{ name: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>; /** Error payload stored on a trace span. */ type EvalTraceSpanError = z.infer; /** Schema for a warning attached to a trace span. */ declare const traceSpanWarningSchema: z.ZodObject<{ name: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>; /** Warning payload stored on a trace span. */ type EvalTraceSpanWarning = z.infer; /** Schema for a persisted trace span captured during case execution. */ declare const traceSpanSchema: z.ZodObject<{ id: z.ZodString; parentId: z.ZodNullable; caseId: z.ZodString; kind: z.ZodString; name: z.ZodString; startedAt: z.ZodString; endedAt: z.ZodNullable; status: z.ZodEnum<{ error: "error"; running: "running"; ok: "ok"; cancelled: "cancelled"; }>; attributes: z.ZodOptional>; error: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; errors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; warning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; warnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; }, z.core.$strip>; /** Persisted trace span shape stored for each eval case run. */ type EvalTraceSpan = z.infer; //#endregion //#region ../shared/src/schemas/eval.d.ts /** Schema summarizing a discovered eval for list and overview screens. */ declare const evalSummarySchema: z.ZodObject<{ key: z.ZodDefault; id: z.ZodString; title: z.ZodOptional; description: z.ZodOptional; filePath: z.ZodString; tags: z.ZodOptional>; stale: z.ZodBoolean; outdated: z.ZodBoolean; freshnessStatus: z.ZodEnum<{ fresh: "fresh"; stale: "stale"; outdated: "outdated"; }>; latestRunAt: z.ZodNullable; latestRunCommitSha: z.ZodNullable; currentCommitSha: z.ZodNullable; columnDefs: z.ZodArray; kind: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; isScore: z.ZodOptional; isManualScore: z.ZodOptional; passThreshold: z.ZodOptional; maxStars: z.ZodOptional; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; }, z.core.$strip>>; caseCount: z.ZodNullable; caseIds: z.ZodOptional>; lastRunStatus: z.ZodNullable>; stats: z.ZodOptional; kind: z.ZodLiteral<"cases">; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"passRate">; accent: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"duration">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"cacheHits">; aggregate: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ hideIfNoValue: z.ZodOptional; kind: z.ZodLiteral<"column">; key: z.ZodString; label: z.ZodOptional; aggregate: z.ZodEnum<{ avg: "avg"; min: "min"; max: "max"; sum: "sum"; best: "best"; worst: "worst"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; accent: z.ZodOptional; }, z.core.$strip>], "kind">>>; defaultStatAggregate: z.ZodOptional>; charts: z.ZodOptional; hideIfNoValue: z.ZodOptional; dedupeConsecutiveValues: z.ZodOptional; type: z.ZodEnum<{ area: "area"; line: "line"; bar: "bar"; }>; metrics: z.ZodArray; metric: z.ZodEnum<{ passRate: "passRate"; durationMs: "durationMs"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ avg: "avg"; min: "min"; max: "max"; sum: "sum"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; color: z.ZodOptional>; axis: z.ZodOptional>; }, z.core.$strip>], "source">>; yDomain: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; right: z.ZodOptional; max: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; tooltipExtras: z.ZodOptional; metric: z.ZodEnum<{ passRate: "passRate"; durationMs: "durationMs"; }>; label: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"column">; key: z.ZodString; aggregate: z.ZodEnum<{ avg: "avg"; min: "min"; max: "max"; sum: "sum"; latest: "latest"; passThresholdRate: "passThresholdRate"; }>; label: z.ZodOptional; }, z.core.$strip>], "source">>>; }, z.core.$strip>>>; manualInput: z.ZodOptional; description: z.ZodOptional; submitLabel: z.ZodOptional; fields: z.ZodArray; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"text">; minLength: z.ZodOptional; maxLength: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"multiline">; minLength: z.ZodOptional; maxLength: z.ZodOptional; rows: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"number">; min: z.ZodOptional; max: z.ZodOptional; step: z.ZodOptional; integer: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"boolean">; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"select">; options: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"json">; rows: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; label: z.ZodString; description: z.ZodOptional; placeholder: z.ZodOptional; required: z.ZodBoolean; defaultValue: z.ZodOptional; kind: z.ZodLiteral<"file">; accept: z.ZodOptional; maxSizeBytes: z.ZodOptional; }, z.core.$strip>], "kind">>; }, z.core.$strip>>; }, z.core.$strip>; /** Metadata shown for one discovered eval in the explorer UI. */ type EvalSummary$1 = z.infer; /** Schema for one case row in an eval run result table. */ declare const caseRowSchema: z.ZodObject<{ evalKey: z.ZodOptional; caseKey: z.ZodOptional; caseId: z.ZodString; evalId: z.ZodString; tags: z.ZodOptional>; status: z.ZodEnum<{ error: "error"; pass: "pass"; fail: "fail"; running: "running"; cancelled: "cancelled"; pending: "pending"; }>; durationMs: z.ZodNullable; cacheHits: z.ZodOptional; cacheOperations: z.ZodOptional; llmCalls: z.ZodOptional; llmCallsMade: z.ZodOptional; llmCacheHits: z.ZodOptional; costUsd: z.ZodOptional>; columns: z.ZodRecord | unknown[] | null, unknown, z.core.$ZodTypeInternals | unknown[] | null, unknown>>, z.ZodUnion; path: z.ZodString; mimeType: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"run">; artifactId: z.ZodString; mimeType: z.ZodString; fileName: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>]>]>>; outputColumnDefs: z.ZodOptional; kind: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; isScore: z.ZodOptional; isManualScore: z.ZodOptional; passThreshold: z.ZodOptional; maxStars: z.ZodOptional; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; }, z.core.$strip>>>; trial: z.ZodNumber; }, z.core.$strip>; /** Flattened per-case row rendered in run tables and streamed updates. */ type CaseRow$1 = z.infer; /** Schema for the detailed payload shown when opening a specific case. */ declare const caseDetailSchema: z.ZodObject<{ evalKey: z.ZodOptional; caseKey: z.ZodOptional; caseId: z.ZodString; evalId: z.ZodString; tags: z.ZodOptional>; status: z.ZodEnum<{ error: "error"; pass: "pass"; fail: "fail"; running: "running"; cancelled: "cancelled"; pending: "pending"; }>; input: z.ZodUnknown; inputSections: z.ZodOptional; kind: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; isScore: z.ZodOptional; isManualScore: z.ZodOptional; passThreshold: z.ZodOptional; maxStars: z.ZodOptional; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; value: z.ZodUnion | unknown[] | null, unknown, z.core.$ZodTypeInternals | unknown[] | null, unknown>>, z.ZodUnion; path: z.ZodString; mimeType: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"run">; artifactId: z.ZodString; mimeType: z.ZodString; fileName: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>]>]>; }, z.core.$strip>>>; trace: z.ZodArray; caseId: z.ZodString; kind: z.ZodString; name: z.ZodString; startedAt: z.ZodString; endedAt: z.ZodNullable; status: z.ZodEnum<{ error: "error"; running: "running"; cancelled: "cancelled"; ok: "ok"; }>; attributes: z.ZodOptional>; error: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; errors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; warning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; warnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; }, z.core.$strip>>; traceDisplay: z.ZodObject<{ attributes: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; scoringTraces: z.ZodOptional; caseId: z.ZodString; kind: z.ZodString; name: z.ZodString; startedAt: z.ZodString; endedAt: z.ZodNullable; status: z.ZodEnum<{ error: "error"; running: "running"; cancelled: "cancelled"; ok: "ok"; }>; attributes: z.ZodOptional>; error: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; errors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; warning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; warnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; }, z.core.$strip>>; traceDisplay: z.ZodObject<{ attributes: z.ZodOptional; path: z.ZodString; label: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; placements: z.ZodOptional>>; scope: z.ZodOptional>; mode: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; cacheRefs: z.ZodDefault; name: z.ZodString; namespace: z.ZodString; key: z.ZodString; status: z.ZodEnum<{ hit: "hit"; miss: "miss"; refresh: "refresh"; bypass: "bypass"; }>; storage: z.ZodOptional>; read: z.ZodOptional; stored: z.ZodOptional; storedAt: z.ZodOptional; age: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>>; columns: z.ZodRecord | unknown[] | null, unknown, z.core.$ZodTypeInternals | unknown[] | null, unknown>>, z.ZodUnion; path: z.ZodString; mimeType: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ source: z.ZodLiteral<"run">; artifactId: z.ZodString; mimeType: z.ZodString; fileName: z.ZodOptional; sizeBytes: z.ZodOptional; }, z.core.$strip>]>]>>; outputColumnDefs: z.ZodOptional; kind: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; }>; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; isScore: z.ZodOptional; isManualScore: z.ZodOptional; passThreshold: z.ZodOptional; maxStars: z.ZodOptional; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; }, z.core.$strip>>>; assertions: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; status: z.ZodEnum<{ pass: "pass"; fail: "fail"; }>; }, z.core.$strip>, z.ZodPipe>]>>>; assertionFailures: z.ZodArray; message: z.ZodString; stack: z.ZodOptional; }, z.core.$strip>, z.ZodPipe>]>>; logs: z.ZodDefault; phase: z.ZodEnum<{ eval: "eval"; derive: "derive"; tracingAssertions: "tracingAssertions"; outputsSchema: "outputsSchema"; scorer: "scorer"; }>; message: z.ZodString; args: z.ZodDefault>; truncated: z.ZodDefault; location: z.ZodOptional; }, z.core.$strip>>; source: z.ZodOptional; }, z.core.$strip>>>; error: z.ZodNullable; message: z.ZodString; stack: z.ZodOptional; }, z.core.$strip>>; trial: z.ZodNumber; cacheRefs: z.ZodDefault; name: z.ZodString; namespace: z.ZodString; key: z.ZodString; status: z.ZodEnum<{ hit: "hit"; miss: "miss"; refresh: "refresh"; bypass: "bypass"; }>; storage: z.ZodOptional>; read: z.ZodOptional; stored: z.ZodOptional; storedAt: z.ZodOptional; age: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; /** Full case payload including inputs, trace, outputs, and failures. */ type CaseDetail$1 = z.infer; /** Schema for discovery problems that should be shown before running evals. */ declare const discoveryIssueSchema: z.ZodObject<{ type: z.ZodEnum<{ "duplicate-eval-id": "duplicate-eval-id"; "manual-input-with-cases": "manual-input-with-cases"; "invalid-tags": "invalid-tags"; }>; severity: z.ZodEnum<{ error: "error"; }>; filePath: z.ZodString; evalId: z.ZodString; message: z.ZodString; }, z.core.$strip>; /** Discovery problem found while scanning eval files. */ type DiscoveryIssue$1 = z.infer; //#endregion //#region ../shared/src/schemas/run.d.ts /** Schema for persisted metadata about a single run invocation. */ declare const runManifestSchema: z.ZodObject<{ id: z.ZodString; shortId: z.ZodString; status: z.ZodEnum<{ pending: "pending"; running: "running"; completed: "completed"; cancelled: "cancelled"; error: "error"; }>; temporary: z.ZodDefault>; startedAt: z.ZodString; endedAt: z.ZodNullable; commitSha: z.ZodDefault>>; branchName: z.ZodDefault>>; evalSourceFingerprints: z.ZodDefault>>; target: z.ZodObject<{ mode: z.ZodEnum<{ all: "all"; evalIds: "evalIds"; caseIds: "caseIds"; }>; evalKeys: z.ZodOptional>; files: z.ZodOptional>; evalIds: z.ZodOptional>; caseIds: z.ZodOptional>; tagsFilter: z.ZodOptional>; }, z.core.$strip>; trials: z.ZodNumber; trialSelection: z.ZodDefault>>; cacheMode: z.ZodOptional>; }, z.core.$strip>; /** Persisted lifecycle metadata for a single eval run. */ type RunManifest$1 = z.infer; /** Schema for aggregate metrics computed over a completed or active run. */ declare const runSummarySchema: z.ZodObject<{ runId: z.ZodString; status: z.ZodEnum<{ pending: "pending"; running: "running"; completed: "completed"; cancelled: "cancelled"; error: "error"; }>; totalCases: z.ZodNumber; passedCases: z.ZodNumber; failedCases: z.ZodNumber; errorCases: z.ZodNumber; cancelledCases: z.ZodNumber; totalDurationMs: z.ZodNullable; cacheHits: z.ZodDefault>; cacheOperations: z.ZodDefault>; llmCalls: z.ZodDefault>; llmCallsMade: z.ZodDefault>; llmCacheHits: z.ZodDefault>; errorMessage: z.ZodDefault>; }, z.core.$strip>; /** Roll-up statistics for one run. */ type RunSummary$1 = z.infer; //#endregion //#region ../shared/src/schemas/config.d.ts /** Render formats supported by an LLM-call metric in the UI. */ declare const llmCallMetricFormatSchema: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; duration: "duration"; json: "json"; }>; /** Render format applied to an LLM-call metric value. */ type LlmCallMetricFormat$1 = z.infer; /** Render formats supported by an API-call metric in the UI. */ declare const apiCallMetricFormatSchema: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; duration: "duration"; json: "json"; }>; /** Render format applied to an API-call metric value. */ type ApiCallMetricFormat$1 = z.infer; /** Where an LLM-call metric is rendered inside the LLM calls tab. */ declare const llmCallMetricPlacementSchema: z.ZodEnum<{ header: "header"; body: "body"; }>; /** Placement option for an LLM-call metric. */ type LlmCallMetricPlacement$1 = z.infer; /** Where an API-call metric is rendered inside the API calls tab. */ declare const apiCallMetricPlacementSchema: z.ZodEnum<{ header: "header"; body: "body"; }>; /** Placement option for an API-call metric. */ type ApiCallMetricPlacement$1 = z.infer; /** Context passed to LLM/API-call derived attribute functions. */ type CallDerivedAttributeContext$1 = { /** Current attributes from the matching trace span. */attributes: Record | undefined; /** Matching trace span. */ span: EvalTraceSpan; /** Dot-path helper for reading from the current span attributes. */ get: (path: string) => unknown; }; /** * Runner-side function used to derive one new span attribute from a matching * LLM/API-call span. Return `undefined` to omit the attribute for that span. */ type CallDerivedAttribute$1 = (ctx: CallDerivedAttributeContext$1) => unknown; /** * Runner-side function used to derive multiple span attributes from a matching * LLM/API-call span. Returned object keys are dot-paths under * `span.attributes`; `undefined` values are skipped. */ type CallDerivedAttributesFn$1 = (ctx: CallDerivedAttributeContext$1) => Record | undefined; /** One resolved derived span attribute rule. */ type ResolvedCallDerivedAttribute$1 = { /** Dot-path where one derived value is persisted on `span.attributes`. */path?: string; /** * Function that derives one persisted value for each matching span. Omitted * after this config is serialized to the browser. */ compute?: CallDerivedAttribute$1; /** * Function that derives multiple persisted values for each matching span. * Omitted after this config is serialized to the browser. */ computeMany?: CallDerivedAttributesFn$1; }; /** Resolved LLM-calls config sent to the UI with all defaults applied. */ type ResolvedLlmCallsConfig$1 = { kinds: string[]; attributes: { model: string; provider: string; inputTokens: string; outputTokens: string; cachedInputTokens: string; cacheCreationInputTokens: string; cacheCreationInput1hTokens: string; reasoningTokens: string; latencyMs: string; steps: string; finishReason: string; input: string; output: string; reasoning: string; toolCalls: string; }; derivedAttributes: ResolvedCallDerivedAttribute$1[]; metrics: ResolvedLlmCallMetric$1[]; pricing: ResolvedLlmCallPricing$1[]; costCurrencies: ResolvedLlmCallCostCurrency$1[]; }; /** Resolved API-calls config sent to the UI with all defaults applied. */ type ResolvedApiCallsConfig$1 = { kinds: string[]; attributes: { method: string; url: string; routeAlias: string; statusCode: string; request: string; response: string; requestBody: string; responseBody: string; headers: string; durationMs: string; error: string; }; derivedAttributes: ResolvedCallDerivedAttribute$1[]; metrics: ResolvedApiCallMetric$1[]; }; /** Fully-resolved LLM-call metric used by the runner and UI. */ type ResolvedLlmCallMetric$1 = { label: string; tooltip?: string; path: string; format: LlmCallMetricFormat$1; numberFormat?: NumberDisplayOptions$1; placements: LlmCallMetricPlacement$1[]; }; /** Fully-resolved API-call metric used by the runner and UI. */ type ResolvedApiCallMetric$1 = { label: string; tooltip?: string; path: string; format: ApiCallMetricFormat$1; numberFormat?: NumberDisplayOptions$1; placements: ApiCallMetricPlacement$1[]; }; /** Fully-resolved pricing entry used by the LLM calls extractor. */ type ResolvedLlmCallPricing$1 = { model: string; provider?: string; inputUsdPerMillion?: number; outputUsdPerMillion?: number; cachedInputUsdPerMillion?: number; cacheCreationInputUsdPerMillion?: number; cacheCreationInput1hUsdPerMillion?: number; /** * USD per one million reasoning tokens when reported outside `outputTokens`. * If `outputTokens` already includes reasoning, reasoning is not billed again. */ reasoningUsdPerMillion?: number; }; /** Fully-resolved extra currency used by the LLM calls tab. */ type ResolvedLlmCallCostCurrency$1 = { code: string; label?: string; usdToCurrencyRate: number; numberFormat?: NumberDisplayOptions$1; }; //#endregion //#region ../shared/src/schemas/cache.d.ts /** * Filesystem storage target for one cached operation. * * - `durable`: store under `.agent-evals/cache`, intended for small reusable * cache entries that a project may commit. * - `temporary`: store under `.agent-evals/tmp/cache`, intended for large or * local-only cache entries. */ declare const cacheStorageSchema: z.ZodEnum<{ durable: "durable"; temporary: "temporary"; }>; /** Filesystem storage target for one cached operation. */ type CacheStorage = z.infer; /** Minimal index-backed summary of a persisted cache entry. */ declare const cacheListItemSchema: z.ZodObject<{ key: z.ZodString; namespace: z.ZodString; storedAt: z.ZodString; lastAccessedAt: z.ZodNullable; }, z.core.$strip>; /** Minimal summary row for a single cache entry. */ type CacheListItem$1 = z.infer; /** Summary of cleanup performed by manual cache repair. */ declare const cacheRepairSummarySchema: z.ZodObject<{ removedCacheFiles: z.ZodNumber; removedDebugFiles: z.ZodNumber; removedBlobFiles: z.ZodNumber; removedIndexRows: z.ZodNumber; rewrittenIndexes: z.ZodNumber; }, z.core.$strip>; /** Stable JSON summary returned by manual cache repair. */ type CacheRepairSummary$1 = z.infer; /** Serialized nested span captured while recording a cached operation. */ type SerializedCacheSpan$1 = { kind: string; name: string; attributes?: Record; status: 'running' | 'ok' | 'error' | 'cancelled'; error?: EvalTraceSpanError; errors?: EvalTraceSpanError[]; warning?: EvalTraceSpanWarning; warnings?: EvalTraceSpanWarning[]; children: SerializedCacheSpan$1[]; }; /** Cache lookup response with optional debug-only raw key data. */ declare const cacheEntryWithDebugKeySchema: z.ZodObject<{ version: z.ZodLiteral<1>; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodOptional>; operationName: z.ZodOptional; spanName: z.ZodOptional; spanKind: z.ZodOptional; storedAt: z.ZodString; recording: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions$1 | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan$1; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions$1 | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan$1; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; debugKey: z.ZodOptional; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodEnum<{ span: "span"; value: "value"; }>; operationName: z.ZodString; storedAt: z.ZodString; rawKey: z.ZodUnknown; entry: z.ZodObject<{ version: z.ZodLiteral<1>; key: z.ZodString; namespace: z.ZodString; operationType: z.ZodOptional>; operationName: z.ZodOptional; spanName: z.ZodOptional; spanKind: z.ZodOptional; storedAt: z.ZodString; recording: z.ZodPipe; finalAttributes: z.ZodRecord; finalStatus: z.ZodOptional>; finalError: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalErrors: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; finalWarning: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>; finalWarnings: z.ZodOptional; message: z.ZodString; stack: z.ZodOptional; capturedAt: z.ZodOptional; }, z.core.$catchall>>>; ops: z.ZodArray; key: z.ZodString; value: z.ZodUnknown; column: z.ZodOptional; format: z.ZodOptional>; numberFormat: z.ZodOptional>>; hideInTable: z.ZodOptional; hideIfNoValue: z.ZodOptional; align: z.ZodOptional>; maxStars: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"appendOutput">; key: z.ZodString; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"mergeOutput">; key: z.ZodString; patch: z.ZodRecord; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"incrementOutput">; key: z.ZodString; delta: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"checkpoint">; name: z.ZodString; data: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"subSpan">; span: z.ZodType>; }, z.core.$strip>], "kind">>; }, z.core.$strip>, z.ZodTransform<{ returnValue: unknown; finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions$1 | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan$1; })[]; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }, { finalAttributes: Record; ops: ({ kind: "setOutput"; key: string; value: unknown; column?: { label?: string | undefined; format?: "number" | "boolean" | "file" | "markdown" | "json" | "image" | "html" | "pdf" | "audio" | "video" | "duration" | "percent" | "passFail" | "stars" | undefined; numberFormat?: NumberDisplayOptions$1 | undefined; hideInTable?: boolean | undefined; hideIfNoValue?: boolean | undefined; align?: "left" | "center" | "right" | undefined; maxStars?: number | undefined; } | undefined; } | { kind: "appendOutput"; key: string; value: unknown; } | { kind: "mergeOutput"; key: string; patch: Record; } | { kind: "incrementOutput"; key: string; delta: number; } | { kind: "checkpoint"; name: string; data: unknown; } | { kind: "subSpan"; span: SerializedCacheSpan$1; })[]; returnValue?: unknown; finalStatus?: "error" | "running" | "ok" | "cancelled" | undefined; finalError?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalErrors?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; finalWarning?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; } | undefined; finalWarnings?: { [x: string]: unknown; message: string; name?: string | undefined; stack?: string | undefined; capturedAt?: string | undefined; }[] | undefined; }>>; }, z.core.$strip>; }, z.core.$strip>>; }, z.core.$strip>; /** Cache lookup response returned by cache APIs when raw-key debug data exists. */ type CacheEntryWithDebugKey$1 = z.infer; //#endregion //#region ../shared/src/schemas/sse.d.ts /** Schema for the SSE envelope used to stream run updates to clients. */ declare const sseEnvelopeSchema: z.ZodObject<{ type: z.ZodString; runId: z.ZodOptional; timestamp: z.ZodString; payload: z.ZodUnknown; }, z.core.$strip>; /** Wire format for a streamed event emitted during eval execution. */ type SseEnvelope$1 = z.infer; //#endregion //#region ../shared/src/schemas/api.d.ts /** UI/API-visible state for config reloads in `agent-evals app`. */ declare const configReloadStateSchema: z.ZodObject<{ status: z.ZodEnum<{ idle: "idle"; pending: "pending"; reloading: "reloading"; }>; activeRunCount: z.ZodNumber; lastChangedAt: z.ZodNullable; lastReloadedAt: z.ZodNullable; }, z.core.$strip>; /** UI/API-visible state for config reloads in `agent-evals app`. */ type ConfigReloadState$1 = z.infer; /** Schema for the API request that starts a new eval run. */ declare const createRunRequestSchema: z.ZodObject<{ target: z.ZodObject<{ mode: z.ZodEnum<{ all: "all"; evalIds: "evalIds"; caseIds: "caseIds"; }>; evalKeys: z.ZodOptional>; files: z.ZodOptional>; evalIds: z.ZodOptional>; caseIds: z.ZodOptional>; tagsFilter: z.ZodOptional>; }, z.core.$strip>; trials: z.ZodNumber; temporary: z.ZodOptional; cache: z.ZodOptional>; }, z.core.$strip>>; manualInputs: z.ZodOptional>; }, z.core.$strip>; /** Request payload accepted by the run creation endpoint. */ type CreateRunRequest$1 = z.infer; //#endregion //#region ../sdk/src/types.d.ts /** * Runtime shape produced by the manual-input file widget. File bytes are * persisted as a real workspace-relative artifact so run inputs stay readable * and coding agents can inspect uploaded files directly on disk. */ type ManualInputFileValue$1 = { /** Original file name as reported by the browser. */name: string; /** Detected MIME type (`''` when the browser could not determine one). */ mimeType: string; /** File size in bytes. */ sizeBytes: number; /** SHA-256 hash of the persisted file bytes, encoded as lowercase hex. */ sha256: string; /** Workspace-relative path to the persisted file artifact. */ path: string; }; //#endregion //#region ../sdk/src/runtime.d.ts declare global { var __agentEvalsRealDate: DateConstructor | undefined; } /** * Raw-key debug payload passed alongside cache writes. * * `rawKey` may include prompt text, user input, or other sensitive material. * Runners store it outside the reusable cache so projects can gitignore the * debug folder while keeping hash-only cache entries shareable. */ //#endregion //#region src/cacheStore.d.ts /** Filter accepted by `FsCacheStore.clear` to narrow the set of entries removed. */ type CacheClearFilter = { /** Cache namespace to remove. Omit to allow all namespaces. */namespace?: string; /** Cache key hash to remove. Omit to allow all keys in the selected namespace. */ key?: string; /** Cache storage target to remove. Omit to clear matching entries from every store. */ storage?: CacheStorage; /** Human-readable terminal explanation for why this cleanup was requested. */ reason?: string; }; //#endregion //#region src/manualInput/walker.d.ts /** One field-level validation issue surfaced by `parseManualInputValues`. */ type ManualInputValidationIssue = { /** Dot-separated path into the input object, empty when the issue is global. */path: string; /** Human-readable message describing what went wrong. */ message: string; }; //#endregion //#region src/manualInput/validation.d.ts /** Per-eval failure shape returned by {@link validateManualInputsForRequest}. */ type ManualInputValidationFailure = { /** Stable eval key (`filePath + evalId`) the issue applies to. */evalKey: string; /** Authored eval id, useful for human-readable messages. */ evalId: string; /** Reason category. */ reason: 'missing' | 'invalid'; /** Field-keyed issues; `path` is empty for whole-eval issues. */ issues: ManualInputValidationIssue[]; }; /** Discriminated union returned by {@link validateManualInputsForRequest}. */ type ManualInputValidationResult = { ok: true; parsed: Record; } | { ok: false; failures: ManualInputValidationFailure[]; }; //#endregion //#region src/recalculateDerivedAttributes.d.ts type RecalculateDerivedAttributesResult = { updated: true; caseDetail: CaseDetail$1; } | { updated: false; reason: string; }; //#endregion //#region src/runnerTypes.d.ts /** Imperative runner interface used by the server and CLI. */ type EvalRunner = { /** Load workspace config, discover evals, and start file watching when enabled. */init(): Promise; /** Return the currently discovered eval summaries for the active workspace. */ getEvals(): EvalSummary$1[]; /** Look up one discovered eval by id. */ getEval(id: string): EvalSummary$1 | undefined; /** * Mark a discovered eval's latest run as matching the current eval source. * * This clears source-fingerprint staleness without re-running the eval. Run * result status and case data are left unchanged. */ markEvalNotStale(id: string): Promise<{ updated: true; eval: EvalSummary$1; } | { updated: false; reason: 'not-found' | 'no-latest-run' | 'source-fingerprint-missing'; }>; /** * Mark a discovered eval's latest run as no longer matching the current eval * source, forcing the eval into the stale state until it is re-run or marked * fresh again. Run result status and case data are left unchanged. */ markEvalStale(id: string): Promise<{ updated: true; eval: EvalSummary$1; } | { updated: false; reason: 'not-found' | 'no-latest-run' | 'source-fingerprint-missing'; }>; /** Return discovery errors that should be shown before running evals. */ getDiscoveryIssues(): DiscoveryIssue$1[]; /** Return current config-reload state for the long-running app server. */ getConfigReloadState(): ConfigReloadState$1; /** Return the effective per-run case concurrency after applying defaults. */ getConfiguredConcurrency(): number; /** Re-scan configured eval files and emit a discovery update to listeners. */ refreshDiscovery(): Promise; startRun(request: CreateRunRequest$1): Promise<{ manifest: RunManifest$1; summary: RunSummary$1; cases: CaseRow$1[]; }>; /** Return run manifests tracked in memory, including persisted runs loaded during init. */ getRuns(): RunManifest$1[]; /** Return one run with its summary and case rows when available in memory. */ getRun(id: string): { manifest: RunManifest$1; summary: RunSummary$1; cases: CaseRow$1[]; } | undefined; /** Request cancellation for an in-flight run and persist its cancelled state. */ cancelRun(id: string): Promise; /** Return full details for a single case in a run, when available. */ getCaseDetail(runId: string, caseId: string): CaseDetail$1 | undefined; /** Subscribe to streamed events for a specific run. */ subscribe(runId: string, listener: (event: SseEnvelope$1) => void): () => void; /** Subscribe to discovery updates triggered by file changes or manual refresh. */ subscribeDiscovery(listener: (event: SseEnvelope$1) => void): () => void; /** Stop background filesystem watchers owned by this runner instance. */ close(): Promise; /** Resolve the workspace root backing this runner instance. */ getWorkspaceRoot(): string; /** * Return whether the current workspace allows an unfiltered CLI run. * * `false` means `agent-evals run` must include `--eval` or `--case`. * Programmatic/server runs are intentionally unaffected. */ getAllowCliRunAll(): boolean; /** * Resolved LLM-calls config used by the UI to derive the LLM calls tab. * * Returns the workspace's `llmCalls` config block from * `agent-evals.config.ts` with all defaults applied. */ getLlmCallsConfig(): ResolvedLlmCallsConfig$1; /** * Resolved API-calls config used by the UI to derive the API calls tab. * * Returns the workspace's `apiCalls` config block from * `agent-evals.config.ts` with all defaults applied. */ getApiCallsConfig(): ResolvedApiCallsConfig$1; /** Resolve a persisted artifact path when artifact storage is supported. */ getArtifactPath(artifactId: string): string | undefined; /** Return summaries for every persisted cache entry in the workspace. */ listCache(): Promise; /** * Return the full persisted cache entry for `namespace` + `key`, including * its recording and optional raw-key debug metadata. Returns `null` when no * entry matches. Used by the case drawer's Cache tab to lazily fetch the * cached return value when a row is expanded. */ getCacheEntry(namespace: string, key: string, storage?: CacheStorage): Promise; /** * Remove cache entries matching `filter`, or all entries when no filter is * supplied. Pass `filter.reason` to explain the cleanup in terminal logs. */ clearCache(filter?: CacheClearFilter): Promise; /** Remove cache/debug/blob files that are not referenced by cache indexes. */ repairCache(): Promise; /** * Recompute persisted case and run statuses for terminal runs touching one * eval. Accepts the exact eval key. */ recomputeStatusesForEval(evalKey: string): Promise<{ updatedRuns: number; }>; /** Recalculate configured LLM/API derived attributes for one persisted case trace. */ recalculateDerivedAttributesForCase(params: { runId: string; caseId: string; }): Promise; /** * Delete terminal persisted runs that touch one eval from memory and disk. * Accepts the exact eval key. */ cleanRunsForEval(evalKey: string): Promise<{ deletedRuns: number; }>; /** Persist a UI-authored manual score for one case and recompute affected summaries. */ updateManualScore(params: { runId: string; caseId: string; scoreKey: string; value: number | null; }): Promise<{ updated: true; run: { manifest: RunManifest$1; summary: RunSummary$1; cases: CaseRow$1[]; }; caseDetail: CaseDetail$1; } | { updated: false; reason: string; }>; /** * Delete one persisted run from in-memory history and disk. * * Ignored for in-flight runs — cancel first, then delete. * Returns `deleted: false` when the run is missing or still running. */ deleteRun(runId: string): Promise<{ deleted: boolean; }>; /** * Convert a temporary persisted run into durable run history. * * Returns the updated run when found. Already-durable runs are treated as a * no-op success so UI callers can refresh their cached copy idempotently. */ promoteRun(runId: string): Promise<{ promoted: boolean; run: { manifest: RunManifest$1; summary: RunSummary$1; cases: CaseRow$1[]; }; } | { promoted: false; }>; /** * Validate a `CreateRunRequest`'s `manualInputs` map against each targeted * eval's authored `manualInput.schema`. Returns `ok: true` with the parsed * values keyed by eval key, or `ok: false` with structured per-eval issues * when an entry is missing or fails schema validation. */ validateManualInputs(request: CreateRunRequest$1): ManualInputValidationResult; }; //#endregion //#region src/runner.d.ts /** * Create an in-memory eval runner bound to the current workspace config. * * @param options.watchForChanges Watch eval files, run history, config, and * workspace `.env` for live reloads. * @param options.loadEnv Load `.env` from the current workspace before config, * discovery, and runs. Shell-provided values keep precedence. */ declare function createRunner({ watchForChanges, loadEnv }?: { watchForChanges?: boolean; loadEnv?: boolean; }): EvalRunner; //#endregion //#region src/manualInput/files.d.ts type StageManualInputFileParams = { workspaceRoot: string; bytes: Uint8Array; name: string; mimeType?: string | undefined; }; type StageManualInputFileFromPathParams = { workspaceRoot: string; path: string; name?: string | undefined; mimeType?: string | undefined; }; type MaterializeManualInputFilesParams = { workspaceRoot: string; runId: string; runDir: string; value: unknown; }; type MaterializeManualInputFilesResult = { error: null; value: unknown; } | { error: string; value: null; }; declare function isManualInputFileValue(value: unknown): value is ManualInputFileValue$1; /** * Persist uploaded manual-input bytes in the workspace staging area and return * the JSON-safe metadata used by manual-input schemas. */ declare function stageManualInputFile({ workspaceRoot, bytes, name, mimeType }: StageManualInputFileParams): Promise; /** * Read a file path supplied by the CLI and stage it as a manual-input file. */ declare function stageManualInputFileFromPath({ workspaceRoot, path, name, mimeType }: StageManualInputFileFromPathParams): Promise; /** * Copy all manual-input file references inside a run request into the run's * artifact directory and return a request-safe value with artifact paths. */ declare function materializeManualInputFiles({ workspaceRoot, runId, runDir, value }: MaterializeManualInputFilesParams): Promise; /** Remove stale staged manual-input uploads from previous abandoned runs. */ declare function cleanupStagedManualInputFiles(workspaceRoot: string): Promise; //#endregion //#endregion //#region src/cli.d.ts /** * Run the Agent Evals CLI against the current workspace. * * @param argv Raw command-line arguments excluding the executable name. */ declare function runCli(argv: string[]): Promise; //#endregion //#region src/index.d.ts /** * Augment this interface to narrow accepted tag names for * `@ls-stack/agent-eval` imports. */ interface AgentEvalTagRegistry { /** Internal marker so the interface can be safely augmented by users. */ __agentEvalTagRegistry?: never; } /** Tag name accepted by eval definitions, config, cases, and runtime checks. */ type EvalTag = AgentEvalTagRegistry extends { tags: infer T; } ? Extract : string; /** Typed input accepted by {@link matchesEvalTags}. */ type EvalTagMatchInput = EvalTag | { all?: EvalTag[]; any?: EvalTag[]; not?: EvalTag[]; }; /** Public config type with module-augmentable eval tags. */ type AgentEvalsConfig = Omit & { /** Workspace-wide tags inherited by every eval unless removed per eval. */tags?: EvalTag[]; }; /** Single authored eval case with module-augmentable tags. */ type EvalCase = Omit, 'tags'> & { /** Additional tags applied only to this case. */tags?: EvalTag[]; }; /** Complete authored eval definition with module-augmentable tags. */ type EvalDefinition = EvalDefinition$1 & { /** Tags applied to every case in this eval. */tags?: EvalTag[]; /** Workspace tags this eval should not inherit. */ removeTags?: EvalTag[]; /** Authored cases for this eval. */ cases?: EvalCase[] | (() => Promise[]>); }; /** Register an eval definition with typed tag support. */ declare function defineEval(definition: EvalDefinition): void; /** Return whether the active eval case has tags matching the typed input. */ declare function matchesEvalTags(input: EvalTagMatchInput): boolean; //#endregion export { AgentEvalTagRegistry, AgentEvalsConfig, type ApiCallEntry, type ApiCallMetric, type ApiCallMetricFormat, type ApiCallMetricPlacement, type ApiCallMetricValue, type ApiCallsConfigInput, type AssertionFailure, type CacheActivityEntry, type CacheAdapter, type CacheDebugKeyEntry, type CacheDebugKeyFile, type CacheDebugKeyWrite, type CacheEntry, type CacheEntryWithDebugKey, type CacheFile, type CacheHitEntry, type CacheKeyHashInput, type CacheKeyHashOptions, type CacheListItem, type CacheMode, type CacheOperationType, type CacheRecording, type CacheRecordingFrame, type CacheRecordingOp, type CacheRepairSummary, type CacheScopeContext, type CacheSerializationOptions, type CacheStatus, type CallDerivedAttribute, type CallDerivedAttributeContext, type CallDerivedAttributesConfig, type CallDerivedAttributesFn, type CaptureEvalSpanErrorLevel, type CaptureEvalSpanErrorOptions, type CaseDetail, type CaseRow, type CellValue, type ColumnDef, type ColumnFormat, type ColumnKind, type ConfigReloadState, type ConfigReloadStatus, type CreateRunRequest, type DefaultConfigKey, type DerivedStatus, type DiscoveryIssue, EvalAssertionError, type EvalCacheConfig, EvalCase, type EvalCaseScope, type EvalChartAggregate, type EvalChartAxis, type EvalChartBuiltinMetric, type EvalChartColor, type EvalChartConfig, type EvalChartMetric, type EvalChartTooltipExtra, type EvalChartType, type EvalChartsConfig, type EvalColumnOverride, type EvalColumns, EvalDefinition, type EvalDeriveConfig, type EvalDeriveContext, type EvalDeriveFn, type EvalDeriveMap, type EvalDeriveValueFn, type EvalDisplayStatus, type EvalExecuteContext, type EvalExpectation, type EvalFreshnessStatus, type EvalManualInputConfig, type EvalManualScoreDef, type EvalOutputs, type EvalOutputsSchema, type EvalRunner, type EvalRuntimeScope, EvalRuntimeUsageError, type EvalScoreContext, type EvalScoreDef, type EvalScoreFn, type EvalSetOutput, type EvalStartTime, type EvalStatAggregate, type EvalStatItem, type EvalStatsConfig, type EvalSummary, EvalTag, EvalTagMatchInput, type EvalToolCallSpan, type EvalTraceTree, type EvalTracingAssertionsConfig, type EvalTracingAssertionsFn, type JsonCell, type LlmCallCostBreakdown, type LlmCallCostCurrency, type LlmCallEntry, type LlmCallMetric, type LlmCallMetricFormat, type LlmCallMetricPlacement, type LlmCallMetricValue, type LlmCallPricing, type LlmCallPricingRate, type LlmCallPricingRegistry, type LlmCallSimulatedTokens, type LlmCallsConfigInput, type LlmCostScenario, type ManualInputDescriptor, type ManualInputFieldDescriptor, type ManualInputFieldKind, type ManualInputFieldOverride, type ManualInputFieldsConfig, type ManualInputFileValue, type ManualInputSelectOption, type MaterializeManualInputFilesResult, type NumberDisplayOptions, type ReadManualInputFileResult, type RemoveDefaultConfig, type ResolvedApiCallMetric, type ResolvedApiCallsConfig, type ResolvedCallDerivedAttribute, type ResolvedLlmCallCostCurrency, type ResolvedLlmCallMetric, type ResolvedLlmCallPricing, type ResolvedLlmCallsConfig, type RunInEvalScopeOptions, type RunLogEntry, type RunLogLevel, type RunLogLocation, type RunLogPhase, type RunLogsConfigInput, type RunManifest, type RunSummary, type ScalarCell, type ScopedCaseSummary, type ScoreTrace, type SerializedCacheSpan, type SerializedCacheValue, type SpanCacheOptions, type SseEnvelope, type SseEventType, type TraceActiveSpan, type TraceAttributeDisplay, type TraceAttributeDisplayFormat, type TraceAttributeDisplayInput, type TraceAttributeDisplayPlacement, type TraceAttributeTransform, type TraceAttributeTransformContext, type TraceCache, type TraceCacheGetResult, type TraceCacheInfo, type TraceCacheManualInfo, type TraceCacheRef, type TraceCacheSetInfo, type TraceDisplayConfig, type TraceDisplayInputConfig, type TraceSpanInfo, type TrialSelectionMode, type UpdateManualScoreRequest, appendToEvalOutput, buildTraceTree, captureEvalSpanError, cleanupStagedManualInputFiles, createRunner, defineEval, deserializeCacheRecording, deserializeCacheValue, evalAssert, evalExpect, evalLog, evalSpan, evalTime, evalTracer, extractApiCalls, extractCacheEntries, extractCacheHits, extractLlmCalls, getCurrentScope, getEvalCaseInput, getEvalRegistry, getNestedAttribute, hashCacheKey, hashCacheKeySync, incrementEvalOutput, isInEvalScope, isManualInputFileValue, manualInputFileValueSchema, matchesEvalTags, materializeManualInputFiles, mergeEvalOutput, nextEvalId, readManualInputFile, repoFile, runCli, runInEvalRuntimeScope, runInEvalScope, runInExistingEvalScope, serializeCacheRecording, serializeCacheValue, setEvalOutput, setScopeCacheContext, simulateLlmCallCost, simulateTokenAllocation, stageManualInputFile, stageManualInputFileFromPath, startEvalBackgroundJob };