import type { PluginInput, ToolContext } from "@opencode-ai/plugin";
import { type SeedModelRoute } from "../model-routing/index.js";
import type { AgentModelAttempt } from "../run-state/index.js";
export type OpenCodeModelCallContext = Pick<PluginInput, "directory" | "client" | "worktree">;
export type OpenCodeSession = Record<string, unknown> & {
    id?: string;
    title?: string;
    parentID?: string;
    directory?: string;
    agent?: string;
    model?: {
        id?: string;
        providerID?: string;
        variant?: string;
    };
    time?: {
        created?: number;
        updated?: number;
        archived?: number;
    };
};
export type OpenCodeMessage = {
    info?: Record<string, unknown> & {
        id?: string;
        role?: string;
        agent?: string;
        finish?: string;
        providerID?: string;
        modelID?: string;
        tokens?: Record<string, unknown>;
        error?: unknown;
        time?: {
            created?: number;
            completed?: number;
        };
    };
    parts?: Array<Record<string, unknown> & {
        type?: string;
        text?: string;
        content?: unknown;
    }>;
};
export type ModelCallLaunchInput = {
    parentSessionId: string;
    targetAgent: string;
    openCodeAgent?: string;
    prompt: string;
    promptSummary: string;
    mode: "sync" | "background" | "followup";
    modelRoute: SeedModelRoute;
    sessionTools?: Record<string, boolean>;
};
export type ModelCallLaunchResult = {
    sessionId: string;
    output?: string;
    tokenUsage?: Record<string, unknown>;
    resolvedModel?: string;
    modelAttempts: AgentModelAttempt[];
};
export declare function launchOpenCodeDelegation(ctx: OpenCodeModelCallContext, toolContext: ToolContext, input: ModelCallLaunchInput): Promise<ModelCallLaunchResult>;
export declare function promptOpenCodeSessionWithModelRoute(ctx: OpenCodeModelCallContext, sessionId: string, body: Record<string, unknown>, directory: string, asyncMode: boolean, modelRoute: SeedModelRoute): Promise<{
    result: unknown;
    resolvedModel?: string;
    modelAttempts: AgentModelAttempt[];
}>;
export declare function plannedModelAttempts(route: SeedModelRoute): AgentModelAttempt[];
export declare function modelAttemptsFromError(error: unknown): AgentModelAttempt[];
export declare function createOpenCodeSession(ctx: OpenCodeModelCallContext, input: {
    parentID?: string;
    title?: string;
    agent?: string;
    directory?: string;
}): Promise<OpenCodeSession>;
export declare function getOpenCodeSession(ctx: OpenCodeModelCallContext, sessionId: string): Promise<OpenCodeSession>;
export declare function listOpenCodeSessions(ctx: OpenCodeModelCallContext, input: {
    search?: string;
    limit?: number;
    roots?: boolean;
}): Promise<OpenCodeSession[]>;
export declare function getOpenCodeMessages(ctx: OpenCodeModelCallContext, sessionId: string, limit: number): Promise<OpenCodeMessage[]>;
export declare function promptOpenCodeSession(ctx: OpenCodeModelCallContext, sessionId: string, body: Record<string, unknown>, directory: string, asyncMode: boolean): Promise<unknown>;
export declare function abortOpenCodeSession(ctx: OpenCodeModelCallContext, sessionId: string): Promise<void>;
export declare function getOpenCodeSessionStatus(ctx: OpenCodeModelCallContext, sessionId: string): Promise<string | undefined>;
export declare function compactSession(session: OpenCodeSession): Record<string, unknown>;
export declare function compactMessage(message: OpenCodeMessage): Record<string, unknown>;
export declare function messageText(message: OpenCodeMessage | undefined): string;
export declare function isActiveSessionStatus(status: string): boolean;
