import { type CustomToolDefinition } from './custom-tool';
import type { AgentDefinition } from '@codebuff/common/templates/initial-agents-dir/types/agent-definition';
import type { Message } from '@codebuff/common/types/messages/codebuff-message';
import type { AgentOutput, SessionState } from '@codebuff/common/types/session-state';
import type { FileTreeNode } from '@codebuff/common/util/file';
export type RunState = {
    sessionState: SessionState;
    output: AgentOutput;
};
export declare function initialSessionState(cwd: string, options: {
    projectFiles?: Record<string, string>;
    knowledgeFiles?: Record<string, string>;
    agentDefinitions?: AgentDefinition[];
    customToolDefinitions?: CustomToolDefinition[];
    maxAgentSteps?: number;
}): Promise<{
    fileContext: {
        projectRoot: string;
        cwd: string;
        fileTree: FileTreeNode[];
        fileTokenScores: Record<string, Record<string, number>>;
        knowledgeFiles: Record<string, string>;
        agentTemplates: Record<string, any>;
        customToolDefinitions: Record<string, {
            inputJsonSchema: any;
            endsAgentStep: boolean;
            description?: string | undefined;
            exampleInputs?: Record<string, any>[] | undefined;
        }>;
        gitChanges: {
            status: string;
            diff: string;
            diffCached: string;
            lastCommitMessages: string;
        };
        changesSinceLastChat: Record<string, string>;
        shellConfigFiles: Record<string, string>;
        systemInfo: {
            platform: string;
            shell: string;
            nodeVersion: string;
            arch: string;
            homedir: string;
            cpus: number;
        };
        tokenCallers?: Record<string, Record<string, string[]>> | undefined;
        userKnowledgeFiles?: Record<string, string> | undefined;
        codebuffConfig?: {
            maxAgentSteps: number;
            description?: any;
            startupProcesses?: {
                name: string;
                command: string;
                enabled: boolean;
                cwd?: string | undefined;
                stdoutFile?: string | undefined;
                stderrFile?: string | undefined;
            }[] | undefined;
            fileChangeHooks?: {
                name: string;
                command: string;
                enabled: boolean;
                cwd?: string | undefined;
                filePattern?: string | undefined;
            }[] | undefined;
            baseAgent?: string | undefined;
            spawnableAgents?: string[] | undefined;
        } | undefined;
    };
    mainAgentState: {
        agentId: string;
        agentType: import("@codebuff/common/types/session-state").AgentTemplateType | null;
        agentContext: Record<string, import("@codebuff/common/types/session-state").Subgoal>;
        subagents: import("@codebuff/common/types/session-state").AgentState[];
        messageHistory: Message[];
        stepsRemaining: number;
        creditsUsed: number;
        output?: Record<string, any>;
        parentId?: string;
    };
}>;
export declare function generateInitialRunState({ cwd, projectFiles, knowledgeFiles, agentDefinitions, customToolDefinitions, maxAgentSteps, }: {
    cwd: string;
    projectFiles?: Record<string, string>;
    knowledgeFiles?: Record<string, string>;
    agentDefinitions?: AgentDefinition[];
    customToolDefinitions?: CustomToolDefinition[];
    maxAgentSteps?: number;
}): Promise<RunState>;
export declare function withAdditionalMessage({ runState, message, }: {
    runState: RunState;
    message: Message;
}): RunState;
export declare function withMessageHistory({ runState, messages, }: {
    runState: RunState;
    messages: Message[];
}): RunState;
/**
 * Applies overrides to an existing session state, allowing specific fields to be updated
 * even when continuing from a previous run.
 */
export declare function applyOverridesToSessionState(cwd: string, baseSessionState: SessionState, overrides: {
    projectFiles?: Record<string, string>;
    knowledgeFiles?: Record<string, string>;
    agentDefinitions?: AgentDefinition[];
    customToolDefinitions?: CustomToolDefinition[];
    maxAgentSteps?: number;
}): Promise<SessionState>;
//# sourceMappingURL=run-state.d.ts.map