/**
 * Recording types for capturing AI interactions.
 *
 * This module defines the data structures used to record socket messages,
 * tool executions, and LLM calls for later replay.
 */
/**
 * Type discriminator for recording entries.
 */
export type RecordingType = "socket" | "tool" | "llm" | "meta";
/**
 * Socket message recording data.
 */
export interface SocketRecording {
    /** Socket method name (e.g., 'aiGenerate') */
    method: string;
    /** Request data - only populated for specific methods that need detailed logging */
    request?: unknown;
    peerId?: string;
}
/**
 * Tool call recording data.
 */
export interface ToolRecording {
    /** Name of the tool that was called */
    toolName: string;
    /** Unique identifier for this tool call */
    toolCallId: string;
    /** Input parameters passed to the tool */
    input: unknown;
    /** Output returned by the tool (null if error) */
    output: unknown;
    /** Error message if the tool execution failed */
    error?: string;
    /** Execution duration in milliseconds */
    durationMs: number;
}
/**
 * LLM call recording data.
 */
export interface LLMRecording {
    /** Endpoint type: 'stream' for doStream, 'generate' for doGenerate */
    endpoint: "stream" | "generate";
    /** Request data sent to the LLM */
    request: {
        /** Model identifier */
        model: string;
        /** Messages in the conversation */
        messages: unknown[];
        /** Tools available to the LLM */
        tools?: unknown[];
        /** System prompt if provided */
        system?: string;
    };
    /** Response data from the LLM */
    response: {
        /** Text content generated */
        content?: string;
        /** Tool calls made by the LLM */
        toolCalls?: unknown[];
        /** Token usage statistics */
        usage?: {
            inputTokens?: number;
            outputTokens?: number;
            totalTokens?: number;
        };
        /** Finish reason */
        finishReason?: string;
    };
    /** Request/response duration in milliseconds */
    durationMs: number;
}
/**
 * Meta recording data - session metadata like snapshot info.
 */
export interface MetaRecording {
    /** Files skipped from snapshot due to size limit */
    skippedFiles?: Array<{
        path: string;
        size: number;
    }>;
    /** Max file size used for filtering (bytes) */
    message?: string;
}
export interface ErrorRecordingData {
    message: string;
}
/**
 * Union type for all recording data types.
 */
export type RecordingData = SocketRecording | ToolRecording | LLMRecording | MetaRecording | ErrorRecordingData;
/**
 * Base recording entry with common fields.
 */
export interface RecordingEntryBase {
    /** Unique identifier for this recording entry */
    id: string;
    /** Timestamp when the recording was created */
    timestamp: number;
}
/**
 * Socket recording entry.
 */
export interface SocketRecordingEntry extends RecordingEntryBase {
    type: "socket";
    data: Partial<SocketRecording> | ErrorRecordingData;
}
/**
 * Tool recording entry.
 */
export interface ToolRecordingEntry extends RecordingEntryBase {
    type: "tool";
    data: Partial<ToolRecording> | ErrorRecordingData;
}
/**
 * LLM recording entry.
 */
export interface LLMRecordingEntry extends RecordingEntryBase {
    type: "llm";
    data: Partial<LLMRecording> | ErrorRecordingData;
}
/**
 * Meta recording entry - session metadata like snapshot info.
 */
export interface MetaRecordingEntry extends RecordingEntryBase {
    type: "meta";
    data: MetaRecording;
}
/**
 * Unified recording entry - discriminated union of all recording types.
 */
export type RecordingEntry = SocketRecordingEntry | ToolRecordingEntry | LLMRecordingEntry | MetaRecordingEntry;
/**
 * Recording session metadata.
 */
export interface RecordingSession {
    /** Unique session identifier */
    id: string;
    /** Timestamp when the session started */
    startedAt: number;
    /** Timestamp when the session ended (undefined if still active) */
    endedAt?: number;
    /** Commit ID when session started (undefined if no commits yet) */
    startingCommitId?: string;
    /** Current commit ID, updated as commits occur during session */
    currentCommitId?: string;
}
//# sourceMappingURL=types.d.ts.map