import { z } from 'zod';
import { I as IAgentService } from '../agent-CW9XbmG_.js';
import { C as CopilotBackendOptions } from '../backends-BSrsBYFn.js';
import '../errors-C-so0M4t.js';

/** @internal */
interface SDKClientOptions {
    cliPath?: string;
    cwd?: string;
    useStdio?: boolean;
    autoStart?: boolean;
    autoRestart?: boolean;
    logLevel?: string;
    githubToken?: string;
    useLoggedInUser?: boolean;
    cliArgs?: string[];
    env?: Record<string, string | undefined>;
}
/** @internal */
interface SDKTool {
    name: string;
    description?: string;
    parameters?: z.ZodType | Record<string, unknown>;
    handler: (args: unknown, invocation: {
        sessionId: string;
        toolCallId: string;
        toolName: string;
        arguments: unknown;
    }) => Promise<unknown> | unknown;
}
/** @internal */
interface SDKPermissionRequest {
    kind: string;
    toolCallId?: string;
    [key: string]: unknown;
}
/** @internal */
interface SDKPermissionResult {
    kind: "approved" | "denied-by-rules" | "denied-no-approval-rule-and-could-not-request-from-user" | "denied-interactively-by-user";
}
/** @internal */
interface SDKUserInputRequest {
    question: string;
    choices?: string[];
    allowFreeform?: boolean;
}
/** @internal */
interface SDKUserInputResponse {
    answer: string;
    wasFreeform: boolean;
}
/** @internal */
interface SDKSessionConfig {
    model?: string;
    tools?: SDKTool[];
    systemMessage?: {
        mode: "append" | "replace";
        content: string;
    };
    onPermissionRequest?: (request: SDKPermissionRequest, ctx: {
        sessionId: string;
    }) => Promise<SDKPermissionResult> | SDKPermissionResult;
    onUserInputRequest?: (request: SDKUserInputRequest, ctx: {
        sessionId: string;
    }) => Promise<SDKUserInputResponse> | SDKUserInputResponse;
    streaming?: boolean;
    workingDirectory?: string;
    availableTools?: string[];
}
/** @internal */
interface SDKSessionEvent {
    id: string;
    timestamp: string;
    parentId: string | null;
    ephemeral?: boolean;
    type: string;
    data: Record<string, unknown>;
}
/** @internal */
interface SDKAssistantMessageData {
    messageId: string;
    content: string;
}
/** @internal */
interface SDKSession {
    readonly sessionId: string;
    on(handler: (event: SDKSessionEvent) => void): () => void;
    send(options: {
        prompt: string;
    }): Promise<string>;
    sendAndWait(options: {
        prompt: string;
    }, timeout?: number): Promise<{
        type: "assistant.message";
        data: SDKAssistantMessageData;
    } | undefined>;
    destroy(): Promise<void>;
    abort(): Promise<void>;
}
/** @internal */
interface SDKModelInfo {
    id: string;
    name: string;
    capabilities?: {
        limits?: {
            max_context_window_tokens?: number;
            max_prompt_tokens?: number;
        };
    };
}
/** @internal */
interface SDKClient {
    start(): Promise<void>;
    stop(): Promise<Error[]>;
    getState(): string;
    createSession(config?: SDKSessionConfig): Promise<SDKSession>;
    resumeSession(sessionId: string, config?: SDKSessionConfig): Promise<SDKSession>;
    listModels(): Promise<SDKModelInfo[]>;
    getAuthStatus(): Promise<{
        isAuthenticated: boolean;
    }>;
}
type CopilotSDKModule = {
    CopilotClient: new (options?: SDKClientOptions) => SDKClient;
};
/** @internal For testing: inject mock SDK module */
declare function _injectSDK(mock: CopilotSDKModule | null): void;
/** @internal For testing: reset injected SDK */
declare function _resetSDK(): void;
/** Create Copilot CLI backend service. */
declare function createCopilotService(options: CopilotBackendOptions): IAgentService;

export { CopilotBackendOptions, _injectSDK, _resetSDK, createCopilotService };
