import type { RunSummary, RuntimeEventLike } from "@mono-agent/observability"; import type { MonoAgentAppConfigInput } from "./app-config.js"; /** True for a thrown OTLP error whose status is transient (5xx/429/408) or a non-HTTP (network) error. */ export declare function isRetryable(error: unknown): boolean; export interface BackfillOptions { /** Export exactly this run id; mutually exclusive with `all`. */ readonly run?: string; /** Export every run found in the artifact dir. */ readonly all?: boolean; /** Only runs whose `startedAt` is >= this ISO instant. */ readonly since?: string; /** Only runs whose `startedAt` is <= this ISO instant. */ readonly until?: string; /** Map + serialize but do not POST; report span counts and byte sizes. */ readonly dryRun?: boolean; /** With `all`, include memory-run artifacts in addition to default agent runs. */ readonly includeMemory?: boolean; } export interface BackfillRunArtifacts { readonly summary: RunSummary; readonly events: RuntimeEventLike[]; readonly warnings: readonly string[]; } /** * Read a run's on-disk artifacts directly into the shapes the OTLP mapping * needs. Deliberately bypasses `readRecordedRun` (which returns the classified * `RecordedRunEvent` shape and caps events at a maximum) so backfill exports a * faithful, uncapped copy: `summary.json` parses straight to `RunSummary`, and * each `events.jsonl` line is a raw `RuntimeEventLike`. */ export declare function readRunArtifacts(artifactDir: string, runId: string): Promise; export declare function runStartEndNanos(summary: RunSummary): { start: bigint; end: bigint; }; type RunOutcome = { readonly runId: string; readonly status: "ok"; readonly spanCount: number; readonly bytes: number; readonly dryRun: boolean; } | { readonly runId: string; readonly status: "skip"; readonly reason: string; } | { readonly runId: string; readonly status: "fail"; readonly reason: string; }; /** * Export already-recorded runs to the configured Phoenix exporter. Returns one * outcome per attempted run; a single run's network failure is non-fatal (it * becomes a `fail` outcome) so a partial backfill still reports. Trace/span ids * are deterministic (keyed on run id) so re-running is idempotent: Phoenix * overwrites rather than duplicating. Backfill forwards persisted * `summary.userInput` through the shared export context when an artifact carries * it; older artifacts without that field retain the root descriptor fallback. */ export declare function backfillRuns(input: MonoAgentAppConfigInput, options: BackfillOptions): Promise<{ readonly artifactDir: string; readonly endpoint: string; readonly outcomes: RunOutcome[]; }>; export interface RunBackfillArgs { readonly configPath?: string; readonly run?: string; readonly all: boolean; readonly since?: string; readonly until?: string; readonly dryRun: boolean; readonly includeMemory?: boolean; } /** CLI entry: resolve config, run the backfill, and print a per-run report. */ export declare function runBackfill(args: RunBackfillArgs): Promise; export {}; //# sourceMappingURL=backfill.d.ts.map