import type { AgentMessage } from "@mariozechner/pi-agent-core";
import type { Api, AssistantMessage, Model } from "@mariozechner/pi-ai";
import type { ThinkLevel } from "../../../auto-reply/thinking.js";
import type { SessionSystemPromptReport } from "../../../config/sessions/types.js";
import type { MessagingToolSend } from "../../pi-embedded-messaging.js";
import type { AuthStorage, ModelRegistry } from "../../pi-model-discovery.js";
import type { NormalizedUsage } from "../../usage.js";
import type { RunEmbeddedPiAgentParams } from "./params.js";
type EmbeddedRunAttemptBase = Omit<RunEmbeddedPiAgentParams, "provider" | "model" | "authProfileId" | "authProfileIdSource" | "thinkLevel" | "lane" | "enqueue">;
export type EmbeddedRunAttemptParams = EmbeddedRunAttemptBase & {
    provider: string;
    modelId: string;
    model: Model<Api>;
    authStorage: AuthStorage;
    modelRegistry: ModelRegistry;
    thinkLevel: ThinkLevel;
};
export type EmbeddedRunAttemptResult = {
    aborted: boolean;
    timedOut: boolean;
    /** True if the timeout occurred while compaction was in progress or pending. */
    timedOutDuringCompaction: boolean;
    /**
     * True when the abort was triggered specifically by the consecutive-tool-error
     * circuit breaker in attempt.ts. Distinguishes this abort kind from user
     * aborts and timeouts so `runAgentTurn` can auto-retry the run with tools
     * disabled instead of returning a silent empty result to the caller.
     */
    circuitBreakerAborted: boolean;
    promptError: unknown;
    sessionIdUsed: string;
    systemPromptReport?: SessionSystemPromptReport;
    messagesSnapshot: AgentMessage[];
    assistantTexts: string[];
    toolMetas: Array<{
        toolName: string;
        meta?: string;
    }>;
    lastAssistant: AssistantMessage | undefined;
    lastToolError?: {
        toolName: string;
        meta?: string;
        error?: string;
        mutatingAction?: boolean;
        actionFingerprint?: string;
    };
    didSendViaMessagingTool: boolean;
    messagingToolSentTexts: string[];
    messagingToolSentMediaUrls: string[];
    messagingToolSentTargets: MessagingToolSend[];
    successfulCronAdds?: number;
    cloudCodeAssistFormatError: boolean;
    attemptUsage?: NormalizedUsage;
    compactionCount?: number;
    /** Client tool call detected (OpenResponses hosted tools). */
    clientToolCall?: {
        name: string;
        params: Record<string, unknown>;
    };
};
export {};
