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; export type EmbeddedRunAttemptParams = EmbeddedRunAttemptBase & { provider: string; modelId: string; model: Model; 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; 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; }; }; export {};