import { AgentMode } from '../types.js';
import { z } from 'zod';

declare const remoteMcpServerSchema: z.ZodObject<{
    type: z.ZodEnum<["http", "sse"]>;
    name: z.ZodString;
    url: z.ZodString;
    headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        value: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        value: string;
        name: string;
    }, {
        value: string;
        name: string;
    }>, "many">>;
}, "strip", z.ZodTypeAny, {
    type: "http" | "sse";
    name: string;
    url: string;
    headers: {
        value: string;
        name: string;
    }[];
}, {
    type: "http" | "sse";
    name: string;
    url: string;
    headers?: {
        value: string;
        name: string;
    }[] | undefined;
}>;
type RemoteMcpServer = z.infer<typeof remoteMcpServerSchema>;

interface ClaudeCodeConfig {
    systemPrompt?: string | {
        type: "preset";
        preset: "claude_code";
        append?: string;
    };
    plugins?: {
        type: "local";
        path: string;
    }[];
}
interface AgentServerConfig {
    port: number;
    repositoryPath?: string;
    apiUrl: string;
    apiKey: string;
    projectId: number;
    jwtPublicKey: string;
    mode: AgentMode;
    taskId: string;
    runId: string;
    version?: string;
    mcpServers?: RemoteMcpServer[];
    baseBranch?: string;
    claudeCode?: ClaudeCodeConfig;
}

declare class AgentServer {
    private config;
    private logger;
    private server;
    private session;
    private app;
    private posthogAPI;
    private questionRelayedToSlack;
    private detectedPrUrl;
    private resumeState;
    private emitConsoleLog;
    constructor(config: AgentServerConfig);
    private getEffectiveMode;
    private createApp;
    start(): Promise<void>;
    private autoInitializeSession;
    stop(): Promise<void>;
    private authenticateRequest;
    private executeCommand;
    private initializeSession;
    private sendInitialTaskMessage;
    private sendResumeMessage;
    private static RESUME_HISTORY_TOKEN_BUDGET;
    private static TOOL_RESULT_MAX_CHARS;
    private formatConversationForResume;
    private getInitialPromptOverride;
    private getPendingUserMessage;
    private getResumeRunId;
    private buildSessionSystemPrompt;
    private buildCloudSystemPrompt;
    private signalTaskComplete;
    private configureEnvironment;
    private createCloudClient;
    private relayAgentResponse;
    private relaySlackQuestion;
    private getFirstQuestionMeta;
    private isQuestionMeta;
    private detectAndAttachPrUrl;
    private cleanupSession;
    private captureTreeState;
    private broadcastTurnComplete;
    private broadcastEvent;
    private sendSseEvent;
}

export { AgentServer };
