export { KNOWLEDGE_FILE_NAMES, PRIMARY_KNOWLEDGE_FILE_NAME, isKnowledgeFile, } from '@levelcode/common/constants/knowledge';
import type { CustomToolDefinition } from './custom-tool';
import type { AgentDefinition } from '@levelcode/common/templates/initial-agents-dir/types/agent-definition';
import type { Logger } from '@levelcode/common/types/contracts/logger';
import type { LevelCodeFileSystem } from '@levelcode/common/types/filesystem';
import type { Message } from '@levelcode/common/types/messages/levelcode-message';
import type { AgentOutput, SessionState } from '@levelcode/common/types/session-state';
import type { LevelCodeSpawn } from '@levelcode/common/types/spawn';
/**
 * Given a list of candidate file paths, selects the one with highest priority.
 * Priority order: knowledge.md > AGENTS.md > CLAUDE.md (case-insensitive).
 * Returns undefined if no knowledge files are found.
 * @internal Exported for testing
 */
export declare function selectHighestPriorityKnowledgeFile(candidates: string[]): string | undefined;
export type RunState = {
    sessionState?: SessionState;
    output: AgentOutput;
};
export type InitialSessionStateOptions = {
    cwd?: string;
    projectFiles?: Record<string, string>;
    knowledgeFiles?: Record<string, string>;
    /** User-provided knowledge files that will be merged with home directory files */
    userKnowledgeFiles?: Record<string, string>;
    agentDefinitions?: AgentDefinition[];
    customToolDefinitions?: CustomToolDefinition[];
    maxAgentSteps?: number;
    fs?: LevelCodeFileSystem;
    spawn?: LevelCodeSpawn;
    logger?: Logger;
};
/**
 * Loads user knowledge files from the home directory.
 * Checks for ~/.knowledge.md, ~/.AGENTS.md, and ~/.CLAUDE.md with priority fallback.
 * Matching is case-insensitive (e.g., ~/.KNOWLEDGE.md will match).
 * Returns a record with the tilde-prefixed path as key (e.g., "~/.knowledge.md").
 * @internal Exported for testing
 */
export declare function loadUserKnowledgeFiles(params: {
    fs: LevelCodeFileSystem;
    logger: Logger;
    /** Optional home directory override for testing */
    homeDir?: string;
}): Promise<Record<string, string>>;
/**
 * Selects knowledge files from a list of file paths with fallback logic.
 * For each directory, checks for knowledge.md first, then AGENTS.md, then CLAUDE.md.
 * @internal Exported for testing
 */
export declare function selectKnowledgeFilePaths(allFilePaths: string[]): string[];
export declare function initialSessionState(params: InitialSessionStateOptions): Promise<SessionState>;
export declare function generateInitialRunState({ cwd, projectFiles, knowledgeFiles, userKnowledgeFiles, agentDefinitions, customToolDefinitions, maxAgentSteps, fs, }: {
    cwd: string;
    projectFiles?: Record<string, string>;
    knowledgeFiles?: Record<string, string>;
    userKnowledgeFiles?: Record<string, string>;
    agentDefinitions?: AgentDefinition[];
    customToolDefinitions?: CustomToolDefinition[];
    maxAgentSteps?: number;
    fs: LevelCodeFileSystem;
}): 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 | undefined, baseSessionState: SessionState, overrides: {
    projectFiles?: Record<string, string>;
    knowledgeFiles?: Record<string, string>;
    agentDefinitions?: AgentDefinition[];
    customToolDefinitions?: CustomToolDefinition[];
    maxAgentSteps?: number;
}): Promise<SessionState>;
