import { type FunnelContractDiagnostic, type StepContractV2MigrationRule as SemanticMigrationRule } from '@funnelsgrove/runtime'; export declare const STEP_CONTRACT_V2_REPORT_PATH = ".funnelsgrove/migrations/step-contract-v2-report.json"; export type StepContractMigrationTargetVersion = 2 | 3; export declare const stepContractMigrationReportPath: (targetVersion: StepContractMigrationTargetVersion) => string; export type StepContractMigrationMode = 'check' | 'apply'; export type StepContractMigrationFlags = { check?: boolean; apply?: boolean; }; export type StepContractMigrationRule = SemanticMigrationRule | 'add-name-from-id+restore-reserved-step' | 'upgrade-purchase-terminal' | 'set-step-contract-version'; export type StepContractMigrationOperation = { path: string; start: number; end: number; beforeHash: string; afterHash: string; rule: StepContractMigrationRule; }; export type StepContractMigrationReport = { schemaVersion: 1; fromVersion: 1 | 2 | null; toVersion: StepContractMigrationTargetVersion; checkedAt: string; operations: readonly StepContractMigrationOperation[]; protectedChanges: readonly StepContractMigrationOperation[]; diagnostics: readonly FunnelContractDiagnostic[]; valid: boolean; }; export type StepContractMigrationCheckOptions = { projectDir: string; checkedAt?: string; managedBundleAvailable: boolean; targetVersion?: StepContractMigrationTargetVersion; }; export type StepContractMigrationCheckResult = { reportPath: string; report: StepContractMigrationReport; }; export type StepContractMigrationValidationResult = { valid: boolean; diagnostics: readonly FunnelContractDiagnostic[]; }; export type InstallManagedCandidateContext = { candidateDir: string; report: StepContractMigrationReport; }; export type ValidateMigrationCandidateContext = { candidateDir: string; phase: 'shadow' | 'committed'; authoringContractVersion: StepContractMigrationTargetVersion; }; export type StepContractMigrationFaultPoint = 'after-report' | 'after-shadow-created' | 'after-source-edits' | 'after-managed-install' | 'after-shadow-validation' | 'before-stage-file' | 'after-stage-file' | 'after-journal-staged' | 'before-commit-file' | 'after-commit-file' | 'after-manifest-commit' | 'before-committed-validation' | 'after-committed-validation'; export type StepContractMigrationFaultContext = { path?: string; }; export type StepContractMigrationApplyOptions = StepContractMigrationCheckOptions & { installManagedCandidate: (context: InstallManagedCandidateContext) => Promise; validateCandidate: (context: ValidateMigrationCandidateContext) => Promise; faultInjector?: (point: StepContractMigrationFaultPoint, context: StepContractMigrationFaultContext) => void | Promise; }; export type StepContractMigrationApplyResult = StepContractMigrationCheckResult & { applied: true; }; export declare class StepContractMigrationError extends Error { readonly report?: StepContractMigrationReport; constructor(message: string, report?: StepContractMigrationReport); } export declare const resolveStepContractMigrationMode: (flags: StepContractMigrationFlags) => StepContractMigrationMode; export declare const checkStepContractV2Migration: (options: StepContractMigrationCheckOptions) => Promise; export declare const applyStepContractV2Migration: (options: StepContractMigrationApplyOptions) => Promise; export declare const recoverStepContractV2Migration: (projectDirectory: string, targetVersion?: StepContractMigrationTargetVersion) => Promise<"none" | "restored">;