import { spawnSync } from "node:child_process"; import { type LegacyAftConfigSource } from "./paths.js"; export { resolveCortexKitStorageRoot } from "./storage-paths.js"; type SpawnSyncForMigration = typeof spawnSync; export declare function __setSpawnSyncForTests(impl: SpawnSyncForMigration | null): void; export type MigrationHarness = "opencode" | "pi"; export interface MigrationOptions { harness: MigrationHarness; binaryPath?: string; logger?: { warn?: (msg: string) => void; info?: (msg: string) => void; log?: (msg: string) => void; }; timeoutMs?: number; } export interface AftConfigFileMigrationOptions { scope: "user" | "project"; targetPath: string; legacySources: readonly LegacyAftConfigSource[]; /** * The harness whose plugin is running this migration. When two harnesses * (OpenCode + Pi) have DIFFERENT legacy configs, this one wins: its config * becomes the shared CortexKit target, and the other's is preserved beside it * as `._OLD` for manual merge. Without it, the first source * by list order wins (back-compat for callers that don't pass it). */ operatingHarness?: MigrationHarness; logger?: { warn?: (msg: string) => void; info?: (msg: string) => void; log?: (msg: string) => void; }; } export interface AftConfigFileMigrationResult { migrated: boolean; conflict: boolean; sourcePath?: string; targetPath: string; warnings: string[]; } export interface MigrationStatus { harness: MigrationHarness; target_root: string; migrated: boolean; marker_path?: string; migrated_at?: string; source_path?: string; aft_version?: string; source_marker_path?: string; source_marker_present?: boolean; partial_state?: boolean; } export declare function resolveLegacyStorageRoot(harness: MigrationHarness): string; export declare function migrateAftConfigFile(opts: AftConfigFileMigrationOptions): AftConfigFileMigrationResult; export declare function ensureStorageMigrated(opts: MigrationOptions): Promise; /** * Query the migration status without performing any migration. * Used by `aft doctor` and similar diagnostics. */ export declare function getMigrationStatus(opts: { harness: MigrationHarness; binaryPath?: string; }): Promise; //# sourceMappingURL=migration.d.ts.map