import type { SessionSystemPromptReport } from "../../config/sessions/types.js";
import type { MessagingToolSend } from "../pi-embedded-messaging.js";
export type EmbeddedPiKoiMeta = {
    sessionId: string;
    provider: string;
    model: string;
    usage?: {
        input?: number;
        output?: number;
        cacheRead?: number;
        cacheWrite?: number;
        total?: number;
    };
};
export type EmbeddedPiRunMeta = {
    durationMs: number;
    koiMeta?: EmbeddedPiKoiMeta;
    aborted?: boolean;
    systemPromptReport?: SessionSystemPromptReport;
    error?: {
        kind: "context_overflow" | "compaction_failure" | "role_ordering" | "image_size";
        message: string;
    };
    /** Stop reason for the koi run (e.g., "completed", "tool_calls"). */
    stopReason?: string;
    /** Pending tool calls when stopReason is "tool_calls". */
    pendingToolCalls?: Array<{
        id: string;
        name: string;
        arguments: string;
    }>;
};
export type EmbeddedPiRunResult = {
    payloads?: Array<{
        text?: string;
        mediaUrl?: string;
        mediaUrls?: string[];
        replyToId?: string;
        isError?: boolean;
    }>;
    meta: EmbeddedPiRunMeta;
    didSendViaMessagingTool?: boolean;
    messagingToolSentTexts?: string[];
    messagingToolSentTargets?: MessagingToolSend[];
};
export type EmbeddedPiCompactResult = {
    ok: boolean;
    compacted: boolean;
    reason?: string;
    result?: {
        summary: string;
        firstKeptEntryId: string;
        tokensBefore: number;
        tokensAfter?: number;
        details?: unknown;
    };
};
export type EmbeddedSandboxInfo = {
    enabled: boolean;
    workspaceDir?: string;
    workspaceAccess?: "none" | "ro" | "rw";
    koiWorkspaceMount?: string;
    browserBridgeUrl?: string;
    browserNoVncUrl?: string;
    hostBrowserAllowed?: boolean;
    elevated?: {
        allowed: boolean;
        defaultLevel: "on" | "off" | "ask" | "full";
    };
};
