/** * Session-log harvesting and parsing for dsh-eval. A trial's headless dsh * writes a plain-JSONL session log under its DSH_HOME; the importer reads the * header line, decodes every event row (packed chunk rows included) through * the session package's storage decoder, and enforces seq continuity. * * @module dsh-eval/trace */ import type { EvalTrace } from './types.ts'; /** * Parse a plain-JSONL session log into a trace. * @param text - the log file's UTF-8 text, header line first. * @returns the parsed trace. * @throws when the header is missing or malformed, a row is not valid JSON, * or event seqs are not contiguous. */ export declare function parseSessionLog(text: string): EvalTrace; /** * Load and parse the primary session log at a path. * @param path - absolute path to a `session.jsonl` file. * @returns the parsed trace. */ export declare function loadTrace(path: string): Promise; /** * Find the newest primary `session.jsonl` under a DSH_HOME tree, descending * into directories without following symlinks. * @param root - the DSH_HOME directory to scan. * @returns the newest primary log's absolute path, or null when none exists. */ export declare function findPrimarySessionLog(root: string): Promise; /** * Find every `session.jsonl` under a DSH_HOME tree, sorted by modification * time ascending so the parent session (started first) comes first. * @param root - the DSH_HOME directory to scan. * @returns absolute log paths in ascending mtime order. */ export declare function findSessionLogs(root: string): Promise; /** * Merge traces into one timeline: events from every trace sorted by event * time, ties broken by source order. The primary trace's header (session id * and creation time) labels the merged trace. * @param traces - harvested traces, primary first. * @returns the merged trace. */ export declare function mergeTraces(traces: readonly EvalTrace[]): EvalTrace;