// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
// ══════════════════════════════════════════════════════════════════════
// Migration v2 — primitive shapes only (types + version-compat predicate).
// ══════════════════════════════════════════════════════════════════════
// The fork-and-sunset lifecycle workflow (request store, migration store,
// approval state machine, probation tracking, lineage queries) has been
// split out to migration-workflow.ts in @aeoess/gateway
// (src/sdk-migrated/v2/). This module keeps ONLY:
//
//   MigrationRequest / MigrationRecord   (types — in src/v2/types.ts)
//   isV2MigrationFactorCompatible        (pure version-compat predicate)
//
// Stateful helpers (requestV2Migration, approveV2Migration,
// executeV2Migration, rollbackV2Migration, processV2CompletedProbations,
// isV2InProbation, computeV2MigrationDiscount, traceV2MigrationLineage,
// getV2MigrationRequest, getV2MigrationRecord, getV2MigrationsForAgent,
// getV2ActiveProbations, clearV2MigrationStores) remain exported as
// deprecation stubs that throw and point callers to the gateway module.
// ══════════════════════════════════════════════════════════════════════
const MOVED = 'This function has moved to migration-workflow in @aeoess/gateway ' +
    '(src/sdk-migrated/v2/migration-workflow.ts). ' +
    'Migration types stay in src/v2/types.ts; SDK retains only the ' +
    'version-compatibility predicate. See MIGRATION.md.';
// ══════════════════════════════════════
// PURE VERSION-COMPATIBILITY PREDICATE
// ══════════════════════════════════════
/**
 * Pure: a migration factor is valid iff in [0, 1]. Callers use this to
 * check migration receipts before honoring them.
 */
export function isV2MigrationFactorCompatible(factor) {
    return Number.isFinite(factor) && factor >= 0 && factor <= 1;
}
// ══════════════════════════════════════════════════════════════════════
// STATEFUL HELPERS — moved to @aeoess/gateway
// ══════════════════════════════════════════════════════════════════════
export function requestV2Migration(_params) { throw new Error(MOVED); }
export function approveV2Migration(_params) { throw new Error(MOVED); }
export function executeV2Migration(_params) { throw new Error(MOVED); }
export function isV2InProbation(_agentId) { throw new Error(MOVED); }
export function computeV2MigrationDiscount(_rawRep, _agentId) {
    throw new Error(MOVED);
}
export function traceV2MigrationLineage(_agentId) {
    throw new Error(MOVED);
}
export function rollbackV2Migration(_migrationId, _reason) {
    throw new Error(MOVED);
}
export function processV2CompletedProbations() { throw new Error(MOVED); }
export function getV2MigrationRequest(_id) {
    throw new Error(MOVED);
}
export function getV2MigrationRecord(_id) {
    throw new Error(MOVED);
}
export function getV2MigrationsForAgent(_agentId) {
    throw new Error(MOVED);
}
export function getV2ActiveProbations() { throw new Error(MOVED); }
export function clearV2MigrationStores() {
    // No-op: SDK no longer holds state. Gateway owns the stores.
}
//# sourceMappingURL=migration-v2.js.map