import type { ServerResponse } from "node:http";
import { type RequestContext, type AgentRunRequest } from "../gen/agent/v1/agent_pb.js";
import type { Logger } from "../logger.js";
import type { ModelRegistry, RegisteredModel } from "../models/registry.js";
import type { ChatMessage, OpenAIStreamOptions } from "../providers/openai.js";
export interface LocalAgentRunDecision {
    model: RegisteredModel;
    messages: ChatMessage[];
    diagnostics: AgentRunDiagnostics;
}
export interface AgentRunDiagnostics {
    modelId: string;
    promptLength: number;
    customSystemPromptLength: number;
    selectedContext: {
        extraContext: number;
        extraContextEntries: number;
        files: number;
        codeSelections: number;
        terminals: number;
        terminalSelections: number;
        folders: number;
        externalLinks: number;
        cursorRules: number;
        cursorCommands: number;
        documentations: number;
        uiElements: number;
        consoleLogs: number;
        gitCommits: number;
        pastChats: number;
        pullRequests: number;
        selectedSkills: number;
        browsers: number;
        documents: number;
    };
    promptContextNodes: number;
    inlinePromptContextNodes: number;
    inlinePromptContextCharacters: number;
    mcpToolCount: number;
    mcpToolNames: string[];
    hasMcpFileSystemOptions: boolean;
    hasSkillOptions: boolean;
    excludeWorkspaceContext: boolean;
    preFetchedBlobCount: number;
    injectedContextMessages: number;
    requestContext?: {
        rules: number;
        tools: number;
        fileContents: number;
        gitRepos: number;
        projectLayouts: number;
        agentSkills: number;
    };
}
export declare function getLocalAgentRunDecision(payload: Buffer, models: ModelRegistry): LocalAgentRunDecision | undefined;
export declare function getLocalAgentRunDecisionFromClientMessage(payload: Uint8Array, models: ModelRegistry): LocalAgentRunDecision | undefined;
export declare function describeAgentRunPayload(payload: Uint8Array): string[];
export declare function withNativeRequestContext(decision: LocalAgentRunDecision, requestContext: RequestContext): LocalAgentRunDecision;
export declare function writeLocalAgentRunResponse(response: ServerResponse, decision: LocalAgentRunDecision, logger: Logger, options?: OpenAIStreamOptions): Promise<void>;
export declare function buildAgentRunDiagnostics(request: AgentRunRequest, modelId?: string): AgentRunDiagnostics;
