import type { ZodRawShape } from 'zod/v3';
import type { TelemetryService } from '../TelemetryService';
export type AgentStep = {
    type: 'tool_call' | 'tool_result' | 'reasoning' | 'error';
    timestamp: number;
    data: unknown;
};
export type AgentProgressEvent = {
    type: 'step' | 'complete' | 'error';
    step?: AgentStep;
    error?: string;
};
/** Default model id when no model is specified. */
export declare const AGENT_DEFAULT_MODEL_ID = "claude-opus-4-7";
/**
 * Defines a structured-output tool that the agent must call to submit its
 * final result. The SDK validates the input against the schema before the
 * handler runs, so callers receive validated structured data instead of
 * having to parse JSON out of free-form text.
 */
export type AgentResultTool = {
    name: string;
    description: string;
    inputSchema: ZodRawShape;
};
export type AgentExecutionOptions = {
    systemPrompt: string;
    userPrompt: string;
    allowedTools: string[];
    permissionMode: 'acceptEdits' | 'bypassPermissions' | 'default';
    cwd: string;
    onProgress: (event: AgentProgressEvent) => void;
    abortController?: AbortController;
    resumeSessionId?: string;
    model?: string;
    /** Define subagents the model can invoke via the built-in Task tool */
    agents?: Record<string, {
        description: string;
        tools?: string[];
        prompt: string;
    }>;
    executionPolicy?: {
        disableBash?: boolean;
        disableSubagents?: boolean;
        maxTaskCalls?: number;
        allowedTaskAgentTypes?: string[];
    };
    correlation?: {
        traceId: string;
        agentRunId: string;
        posthogSessionId?: string;
    };
    telemetry?: TelemetryService;
    /**
     * When set, registers an in-process MCP tool the agent must call to submit
     * its final structured output. The captured input is returned via
     * `AgentExecutionResult.resultToolInput`. If the agent finishes without
     * calling the tool, `execute()` throws.
     */
    resultTool?: AgentResultTool;
};
export type AgentExecutionResult = {
    filesModified: string[];
    reasoning: string[];
    toolCalls: Array<{
        name: string;
        input: unknown;
    }>;
    sessionId?: string;
    model?: string;
    ttfmMs?: number;
    ttfwMs?: number;
    traceId?: string;
    agentRunId?: string;
    toolSummary?: {
        toolCallCounts: Record<string, number>;
        readTargets: string[];
        editTargets: string[];
        writeTargets: string[];
    };
    /** Validated input from the result tool, when `resultTool` was set. */
    resultToolInput?: unknown;
};
/**
 * Core agent execution infrastructure shared by all agent types.
 * Handles SDK initialization, auth, streaming, and error handling.
 */
export declare class AgentCore {
    private configManager;
    private gatewayUrl;
    private proxyUrl;
    constructor(gatewayUrl?: string);
    /**
     * Execute an agent with the given options.
     * Handles SDK initialization, auth token management, and streaming.
     *
     * @effect Streams progress events via onProgress callback
     * @returns Files modified, reasoning steps, and tool calls
     */
    execute(options: AgentExecutionOptions): Promise<AgentExecutionResult>;
    /**
     * Get a valid auth token, refreshing if needed
     */
    private getValidAuthToken;
    /**
     * Build environment variables for agent subprocess
     */
    private buildAgentEnvironment;
    /**
     * Sanitize outbound header values to avoid control-character injection.
     */
    private sanitizeHeaderValue;
    /**
     * Return structured token validation state without exposing token claims.
     */
    private getTokenValidationState;
    /**
     * Decode JWT and check if it expires within the next hour
     */
    private isTokenExpiringSoon;
    /**
     * Refresh access token using refresh token
     */
    private refreshAccessToken;
}
//# sourceMappingURL=AgentCore.d.ts.map