/**
 * Shared types for the VisionClaw data-processing pipeline.
 */
import { type PiCodingInit } from "./pi-log-metadata.js";
export type { PiCodingInit };
export interface LogEntry {
    timestamp: string;
    level: string;
    category: string;
    message: string;
    data: Record<string, unknown>;
    sourceFile: string;
    lineIndex: number;
}
export declare class WakeCycle {
    entries: LogEntry[];
    hasResult: boolean;
    hasInterrupts: boolean;
    get wakeEntry(): LogEntry | undefined;
    get resultEntry(): LogEntry | undefined;
    get trigger(): string;
    get incomingMessages(): LogEntry[];
    get originalIncoming(): LogEntry[];
    get interruptIncoming(): LogEntry[];
    get systemInitEntry(): LogEntry | undefined;
    /**
     * Find the first `system_prompt` log entry in this cycle, which contains
     * the dynamically built system prompt captured at runtime.
     */
    get systemPromptEntry(): LogEntry | undefined;
    /**
     * All system-init entries in this cycle, each representing one SDK query()
     * call.  In a dual-session setup, multiple inits with different session_ids
     * indicate session switches.
     */
    get systemInitEntries(): LogEntry[];
    /**
     * Parse active session mode from the "send" entry's text.
     * Returns "general", "coding", or undefined if not a dual-session cycle.
     */
    get activeSessionMode(): string | undefined;
    /**
     * Extract ordered session turns from system-init entries.
     * Each turn has a sessionId and the timestamp when the SDK query started.
     */
    getSessionTurns(): {
        sessionId: string;
        timestamp: string;
    }[];
    /** Pi/GPT agent init metadata from [pi-coding-*] log lines. */
    getPiCodingInits(): PiCodingInit[];
}
export interface SDKMessage {
    type?: string;
    subtype?: string;
    timestamp?: string;
    message?: {
        role?: string;
        content?: unknown;
        id?: string;
        model?: string;
        stop_reason?: string;
        [key: string]: unknown;
    };
    compactMetadata?: {
        trigger?: string;
        preTokens?: number;
    };
    [key: string]: unknown;
}
export type SDKTurnStart = "wake_event" | "session_switch";
export interface SDKSessionTurn {
    sessionId: string;
    startType: SDKTurnStart;
    timestamp: string;
    messages: SDKMessage[];
    priorContext: SDKMessage[];
}
/**
 * @deprecated Use SDKSessionTurn for per-session-turn matching.
 * Kept temporarily for backwards-compatible API surface.
 */
export type SDKWakeCycle = SDKSessionTurn;
export type TrajectoryRole = "thinking" | "assistant" | "tool_call" | "tool_result" | "context" | "user_message";
export interface TrajectoryEntry {
    role: TrajectoryRole;
    content: string;
    timestamp: string;
    metadata?: Record<string, unknown>;
}
export interface PromptMeta {
    channel: string;
    sender: string;
    message_id: string;
    timestamp: string;
    is_interrupt: boolean;
}
export interface InterruptMeta {
    channel: string;
    sender: string;
    message_id: string;
    timestamp: string;
    text: string;
}
export interface UsageInfo {
    turns: number | undefined;
    input_tokens: number | undefined;
    output_tokens: number | undefined;
    cost: string | undefined;
}
export interface PriorContext {
    compaction_summary: string | null;
    compacted_fresh_start?: boolean;
    prior_messages_count: number;
    prior_messages: TrajectoryEntry[];
}
export type TrajectorySource = "sdk_transcript" | "visionclaw_logs";
export interface OutputRecord {
    system_message: unknown;
    /** Dynamically built system prompt captured at runtime (VisionClaw portion). */
    system_prompt: string | null;
    prior_context: PriorContext | null;
    prompt: string;
    prompt_meta: PromptMeta;
    interrupts: InterruptMeta[] | null;
    trajectory: TrajectoryEntry[];
    usage: UsageInfo | null;
    complete: boolean;
    has_interrupts: boolean;
    trajectory_source: TrajectorySource;
    /** Shared ID linking all records from the same log wake cycle. */
    wake_cycle_id?: string;
    /** SDK session UUID for this record's session turn. */
    session_id?: string;
    /** "general" or "coding". */
    session_mode?: string;
    /** 0-based index of this session turn within the wake cycle. */
    turn_index?: number;
    /** Total number of session turns in this wake cycle. */
    turn_count?: number;
}
export interface ClassifiedCycles {
    clean: WakeCycle[];
    interrupted: WakeCycle[];
    incomplete: WakeCycle[];
}
//# sourceMappingURL=types.d.ts.map