import type { PiIntegrationTestRuntimeArtifacts } from "./artifacts.js"; import type { PiIntegrationTestState, TraceEvent } from "../scenario/types.js"; export interface SessionSnapshot { readonly messages: readonly unknown[]; readonly state: PiIntegrationTestState | undefined; } export declare function readTrace(file: string, allowPartialLine?: boolean): Promise; export declare function waitForSettledTrace(tracePath: string, expectedProviderRequestCount: number, timeoutMs: number): Promise; /** Wait for the settlement event belonging to a real user-provider agent run. */ export declare function waitForAgentSettledTrace(tracePath: string, timeoutMs: number): Promise; /** * Reads a growing JSONL trace incrementally. * * Each poll reads only the bytes appended since the previous one and parses every complete line * once, so waiting on a large trace costs time proportional to the new events, not the whole file. * A line without its trailing newline stays pending until a later poll completes it. */ export declare class TraceTail { private readonly file; private readonly events; private offset; private pending; constructor(file: string); /** Return every complete event written so far. */ poll(): Promise; private consume; } export declare function getSessionSnapshot(traceEvents: readonly TraceEvent[]): SessionSnapshot | undefined; export declare function copySessionFileFromTrace(runtime: PiIntegrationTestRuntimeArtifacts, tracePath: string): Promise; export declare function waitForNonEmptyFile(filePath: string, timeoutMs: number): Promise; export declare function delay(milliseconds: number): Promise;