import { SyncManifestEntry } from "./sync-manifest.js";
import { type OmkRuntimeScope } from "./resource-profile.js";
import { getProjectRootDiagnostics, resolveProjectRoot, resolveProjectRootAsync, displayProjectRootPath, type ProjectRootResolution, type ProjectRootSource } from "./project-root.js";
export { getProjectRootDiagnostics, resolveProjectRoot, resolveProjectRootAsync, displayProjectRootPath, type ProjectRootResolution, type ProjectRootSource, };
type KimiGlobalSyncStepName = "hooks" | "mcp" | "skills" | "memory";
export interface KimiGlobalSyncOptions {
    dryRun?: boolean;
    diff?: boolean;
    quiet?: boolean;
    manifest?: SyncManifestEntry[];
    timestamp?: string;
}
export interface KimiGlobalSyncStepReport {
    name: KimiGlobalSyncStepName;
    changed: boolean;
    blocked: boolean;
    skipped: boolean;
    error?: string;
    manifest: SyncManifestEntry[];
}
export interface KimiGlobalSyncReport {
    changed: boolean;
    blocked: boolean;
    steps: KimiGlobalSyncStepReport[];
    actions: string[];
    skipped: string[];
    errors: string[];
    manifest: SyncManifestEntry[];
}
export declare function ensureDir(path: string): Promise<void>;
export declare function writeFileSafe(path: string, content: string): Promise<void>;
export declare function pathExists(path: string): Promise<boolean>;
export interface RuntimeMcpPruneDiagnostic {
    name: string;
    kind: string;
    message: string;
}
export interface RuntimeMcpNormalization {
    name: string;
    kind: string;
    message: string;
}
export declare function getManifestPath(): string;
export declare function getBackupDir(timestamp: string): string;
export declare function readManifest(): Promise<SyncManifestEntry[]>;
export declare function writeManifest(entries: SyncManifestEntry[]): Promise<void>;
export declare function backupFile(sourcePath: string, backupDir: string, relativePath: string): Promise<string>;
export declare function isDirectory(path: string): Promise<boolean>;
export declare function readTextFile(path: string, defaultValue?: string): Promise<string>;
export declare function getProjectRoot(): string;
export declare function getProjectRootAsync(): Promise<string>;
export declare function getUserHome(env?: NodeJS.ProcessEnv): string;
export declare function normalizeUserHomePath(value: string | undefined): string | undefined;
export declare function getOmkPath(subPath?: string): string;
export { validateRunId, sanitizeRunId, validateRunArtifactPath, getRunsDir, getRunPath, getRunArtifactPath, listValidRunIds, } from "./run-store.js";
export declare function getKimiConfigPath(): string;
/**
 * .omk/kimi.config.toml 의 hooks 를 ~/.kimi/config.toml 에 병합.
 * 상대 경로를 절대 경로로 변환하여 어디서 실행돼도 작동하도록 함.
 */
export declare function mergeKimiHooks(omkConfigPath: string, options?: KimiGlobalSyncOptions): Promise<boolean>;
export declare function extractHooksBlocks(content: string): string;
/** 프로젝트의 .omk/mcp.json + .kimi/mcp.json → ~/.kimi/mcp.json 병합 */
export declare function syncKimiMcpGlobal(options?: KimiGlobalSyncOptions): Promise<boolean>;
/** 프로젝트의 .kimi/skills/* → ~/.kimi/skills/ 심링크 */
export declare function syncKimiSkillsGlobal(options?: KimiGlobalSyncOptions): Promise<boolean>;
/** local graph memory policy를 ~/.kimi/omk.memory.toml 에 동기화 */
export declare function syncKimiMemoryGlobal(options?: KimiGlobalSyncOptions): Promise<boolean>;
/** Sync hooks + MCP + skills to ~/.kimi/ at once */
export declare function syncAllKimiGlobals(options?: KimiGlobalSyncOptions): Promise<KimiGlobalSyncReport>;
/** Canonical OMK MCP config collection with project `.kimi/mcp.json` compatibility. */
export declare function collectMcpConfigs(scope?: OmkRuntimeScope): Promise<string[]>;
export declare const STALE_PACKAGE_NAMES: Record<string, string>;
export declare function diagnoseRuntimeMcpServer(name: string, server: unknown): Promise<RuntimeMcpPruneDiagnostic[]>;
export type RuntimeMcpPreflightMode = "warn-skip" | "strict" | "off";
export type RuntimeMcpPreflightFailureReason = "timeout" | "exit";
export type RuntimeMcpPreflightEntryStatus = "ok" | "failed" | "skipped";
export interface RuntimeMcpPreflightOptions {
    timeoutMs: number;
    concurrency: number;
}
export interface RuntimeMcpPreflightEntry {
    name: string;
    status: RuntimeMcpPreflightEntryStatus;
    reason?: RuntimeMcpPreflightFailureReason | "not-npm-family" | "no-package-spec";
    detail?: string;
    packageSpec?: string;
}
export interface RuntimeMcpPreflightResult {
    failed: Set<string>;
    details: Map<string, {
        reason: RuntimeMcpPreflightFailureReason;
        detail: string;
    }>;
    entries: RuntimeMcpPreflightEntry[];
}
export declare function resolveRuntimeMcpPreflightMode(env?: Record<string, string | undefined>): RuntimeMcpPreflightMode;
export declare function resolveRuntimeMcpPreflightOptions(env?: Record<string, string | undefined>): RuntimeMcpPreflightOptions & {
    mode: RuntimeMcpPreflightMode;
};
export declare function preflightRuntimeMcpServers(servers: Record<string, unknown>, options: RuntimeMcpPreflightOptions): Promise<RuntimeMcpPreflightResult>;
export declare function pruneRuntimeMcpServers(servers: Record<string, unknown>): Promise<{
    servers: Record<string, unknown>;
    diagnostics: RuntimeMcpPruneDiagnostic[];
    normalizations: RuntimeMcpNormalization[];
}>;
export declare function writeRuntimeMcpConfig(configPaths: string[], allowlist?: readonly string[]): Promise<string | null>;
/** 프로젝트의 .kimi/skills 디렉토리 경로 */
export declare function getKimiSkillsDir(): string;
/** ~/.kimi/config.toml 에서 default_model 읽기 */
export declare function getKimiDefaultModel(): Promise<string | null>;
/** .omk/config.toml 에서 안전한 logo_image 경로 읽기 (상대경로는 프로젝트 루트 기준) */
export declare function getOmkLogoImagePath(): Promise<string | null>;
/**
 * Auto-generate a built-in omk-project MCP config so users never need to
 * define it manually in ~/.kimi/mcp.json or .kimi/mcp.json.
 * The config uses the currently-running omk CLI path and sets OMK_PROJECT_ROOT
 * to the current project root.
 */
export declare function writeBuiltinMcpConfig(): Promise<string | null>;
/** Kimi CLI 실행 인자에 model + MCP + Skills 주입 (전역 동기화는 별도) */
export declare function injectKimiGlobals(args: string[], options?: {
    mcpScope?: OmkRuntimeScope;
    skillsScope?: OmkRuntimeScope;
    hooksScope?: OmkRuntimeScope;
    role?: string;
    mcpAllowlist?: readonly string[];
}): Promise<void>;
