import type { MessageParam } from "@anthropic-ai/sdk/resources";
import type { TerminalReason } from "@anthropic-ai/claude-agent-sdk";
import type { VisionClawConfig } from "../../config/types.js";
import type { UsageSnapshot } from "../../config/index.js";
import type { ScreenshotInjector } from "../screenshot-injector.js";
import type { SessionMode } from "../mailbox.js";
import type { RuntimeSurface } from "../runtime-surface.js";
import type { TranscriptInfo } from "../transcript-info.js";
export type SystemPromptConfig = string | {
    type: "preset";
    preset: "claude_code";
    append?: string;
};
export interface AgentTextBlock {
    type: "text";
    text: string;
}
export interface AgentThinkingBlock {
    type: "thinking";
    thinking: string;
}
export interface AgentToolUseBlock {
    type: "tool_use";
    name: string;
    input: unknown;
    id?: string;
    tool_use_id?: string;
}
export interface AgentToolResultBlock {
    type: "tool_result";
    tool_use_id: string;
    content: unknown;
    is_error?: boolean;
}
export interface AgentAssistantMessage {
    type: "assistant";
    session_id?: string;
    message: {
        role: "assistant";
        content: (AgentTextBlock | AgentThinkingBlock | AgentToolUseBlock)[];
    };
    parent_tool_use_id?: string | null;
    error?: string;
}
export interface AgentUserMessage {
    type: "user";
    session_id?: string;
    message: {
        role: "user";
        content: AgentToolResultBlock[];
    };
    parent_tool_use_id?: string | null;
}
export interface AgentResultMessage {
    type: "result";
    subtype: string;
    num_turns: number;
    usage: {
        input_tokens: number;
        output_tokens: number;
    };
    total_cost_usd: number;
    is_error: boolean;
    errors?: string[];
    model?: string;
    modelUsage?: unknown;
    model_usage?: unknown;
    terminal_reason?: TerminalReason;
}
export interface AgentSystemMessage {
    type: "system";
    subtype: string;
    session_id?: string;
    [key: string]: unknown;
}
export interface AgentStreamEventMessage {
    type: "stream_event";
    event: unknown;
    parent_tool_use_id: string | null;
    uuid: string;
    session_id: string;
    ttft_ms?: number;
}
export type AgentStreamMessage = AgentAssistantMessage | AgentUserMessage | AgentResultMessage | AgentSystemMessage | AgentStreamEventMessage;
export interface CurrentQueryLike {
    mcpServerStatus?(): Promise<unknown>;
    toggleMcpServer?(serverName: string, enabled: boolean): Promise<void>;
}
export type { UsageSnapshot };
export interface AgentSessionContext {
    mode: SessionMode;
    getDualSessionEnabled: () => boolean;
    getAndroidUseEnabled: () => boolean;
    getCardAvailable: () => boolean;
}
export interface AgentSessionConstructorArgs {
    config: VisionClawConfig;
    buildSystemPrompt: () => SystemPromptConfig;
    runtimeSurface: RuntimeSurface;
    sessionContext: AgentSessionContext;
}
export interface InjectMessageOptions {
    shouldQuery?: boolean;
}
export type EffortLevel = "low" | "medium" | "high" | "max";
export interface SendAndStreamOptions {
    /** Override the default effort level for this query. */
    effort?: EffortLevel;
}
export interface AgentSessionLike {
    readonly mode: SessionMode;
    warmUp(): Promise<void>;
    /**
     * Discard any idle pre-warmed subprocess/state so the next `warmUp()` /
     * `sendAndStream()` rebuilds it from the current `config`. Used when
     * provider-bound state (e.g. provider, env, model) changes underneath
     * us — the most common case is client-side provider fallback. Must be
     * safe to call when no warm state exists.
     */
    discardWarmQuery(): void;
    sendAndStream(content: MessageParam["content"], options?: SendAndStreamOptions): AsyncIterable<AgentStreamMessage>;
    injectMessage(content: MessageParam["content"], options?: InjectMessageOptions): boolean;
    closeInput(): void;
    requestStop(): void;
    clearStop(): void;
    isStopRequested(): boolean;
    requestCompaction(): Promise<void>;
    /** Unified between-turn compaction gate (token usage + image count). */
    maybeCompact(options?: {
        usedPctThreshold?: number;
        cooldownMs?: number;
        imageThreshold?: number;
    }): Promise<void>;
    captureSessionId(id: string | undefined): void;
    captureUsageSnapshot(snapshot: UsageSnapshot): void;
    capturePostCompactionSnapshot(postCompactionTokens: number): void;
    /**
     * Number of consecutive compaction attempts that timed out without
     * completing. The wake loop reads this to decide when to force an
     * auto-refresh. Optional — engines without timeout tracking omit it
     * (callers treat absence as 0).
     */
    getConsecutiveCompactionTimeouts?(): number;
    getSessionId(): string | null;
    getTranscriptPath(): string | null;
    getTranscriptInfo(): TranscriptInfo;
    getUsageSnapshot(): UsageSnapshot | null;
    getLiveContextUsage?(): Promise<UsageSnapshot | null>;
    getCurrentQuery(): CurrentQueryLike | null;
    setDynamicMcpServers(servers: Record<string, Record<string, unknown>>): void;
    getDynamicMcpServers(): Record<string, Record<string, unknown>>;
    /**
     * Reset the session: clear the session ID so the next turn creates a brand-
     * new session. Optionally accepts a summary string to inject as priority
     * context into the new session's first turn.
     */
    resetForNewSession(summary?: string): void;
    /**
     * Inject a priority summary into the next turn without rotating or minting
     * a session ID. Callers are responsible for any session-id bookkeeping.
     */
    injectSummary(summary: string): void;
    readonly hasOrphanedInjections: boolean;
    readonly isInputClosed: boolean;
    screenshotInjector?: ScreenshotInjector | null;
}
//# sourceMappingURL=session-types.d.ts.map