import type { AgentMessage } from '@earendil-works/pi-agent-core';
import { SessionManager } from '@earendil-works/pi-coding-agent';
import type { TranscriptCompactionRecord } from '../transcript-format.js';
import { type TranscriptStoredRow, type XopcTranscriptContextEntry } from '../session-context-for-llm.js';
/** Custom JSONL entry for persisted-only context rows. */
export declare const XOPC_CONTEXT_CUSTOM_TYPE = "xopc:transcript-row";
/**
 * Persist the in-memory {@link SessionManager} graph with an atomic rewrite of the JSONL file.
 * Ensures durability even when pi would otherwise defer `_persist` until the first assistant message.
 */
export declare function writeAtomicSessionManagerSnapshot(sessionManager: SessionManager, absPath: string): Promise<void>;
/**
 * Serialize transcript rows to a pi-coding-agent JSONL file (linear chain).
 * Always rewrites the file; guarded by a cross-process transcript lock.
 */
export declare function writeTranscriptJsonl(params: {
    absPath: string;
    sessionId: string;
    cwd: string;
    rows: TranscriptStoredRow[];
    appendCompaction?: TranscriptCompactionRecord;
}): Promise<void>;
/**
 * Persist merged transcript rows with append optimization (strict prefix → tail append).
 * Intended for hot paths that already merged prior rows with new LLM state.
 */
export declare function persistMergedTranscriptRows(params: {
    absPath: string;
    sessionId: string;
    cwd: string;
    rows: TranscriptStoredRow[];
    appendCompaction?: TranscriptCompactionRecord;
}): Promise<void>;
/**
 * Load full transcript rows from a JSONL path (pi session file).
 */
/**
 * Append one `xopc:transcript-row` context entry via pi SessionManager (OpenClaw-aligned append path).
 */
/** Append one LLM message row via pi SessionManager (slash receipts, goals, etc.). */
export declare function appendPiTranscriptMessage(params: {
    absPath: string;
    cwd: string;
    message: import('@earendil-works/pi-agent-core').AgentMessage;
    sessionKey?: string;
}): Promise<void>;
export declare function appendPiTranscriptContextEntry(params: {
    absPath: string;
    cwd: string;
    entry: XopcTranscriptContextEntry;
    sessionKey?: string;
}): Promise<void>;
export declare function readTranscriptRowsFromFile(absPath: string): Promise<TranscriptStoredRow[]>;
export declare function rowsToLlmMessages(rows: TranscriptStoredRow[]): AgentMessage[];
