import { ContentBlock } from '@agentclientprotocol/sdk';
import { PostHogAPIClient } from '../../../posthog-api.js';
import { StoredEntry } from '../../../types.js';
import '@posthog/shared';
import '@posthog/shared/domain-types';

interface ConversationTurn {
    role: "user" | "assistant";
    content: ContentBlock[];
    toolCalls?: ToolCallInfo[];
}
interface ToolCallInfo {
    toolCallId: string;
    toolName: string;
    input: unknown;
    result?: unknown;
}
interface JsonlConfig {
    sessionId: string;
    cwd: string;
    model?: string;
    version?: string;
    gitBranch?: string;
    slug?: string;
    permissionMode?: string;
}
declare function encodeCwdToProjectKey(cwd: string): string;
declare function getSessionJsonlPath(sessionId: string, cwd: string): string;
declare function rebuildConversation(entries: StoredEntry[]): ConversationTurn[];
declare function selectRecentTurns(turns: ConversationTurn[], maxTokens?: number): ConversationTurn[];
declare function conversationTurnsToJsonlEntries(turns: ConversationTurn[], config: JsonlConfig): string[];
interface HydrationLog {
    info: (msg: string, data?: unknown) => void;
    warn: (msg: string, data?: unknown) => void;
}
declare function sanitizeSessionJsonl(jsonlPath: string): Promise<boolean>;
declare function hydrateSessionJsonl(params: {
    sessionId: string;
    cwd: string;
    taskId: string;
    runId: string;
    model?: string;
    gitBranch?: string;
    permissionMode?: string;
    posthogAPI: PostHogAPIClient;
    log: HydrationLog;
}): Promise<boolean>;

export { conversationTurnsToJsonlEntries, encodeCwdToProjectKey, getSessionJsonlPath, hydrateSessionJsonl, rebuildConversation, sanitizeSessionJsonl, selectRecentTurns };
