/**
 * Pairing Migration Utility
 *
 * Migrates data from the file-based pairing store (otto)
 * to the database-backed PairingService.
 *
 * This utility reads the JSON files used by otto's pairing system
 * and imports the data into the ElizaOS database.
 */
import type { IAgentRuntime } from "../types";
import type { PairingChannel } from "../types/pairing";
/**
 * File-based pairing request format from otto.
 */
interface FilePairingRequest {
    id: string;
    code: string;
    createdAt: string;
    lastSeenAt: string;
    meta?: Record<string, string>;
}
/**
 * File-based pairing store format from otto.
 */
interface FilePairingStore {
    version: number;
    requests: FilePairingRequest[];
}
/**
 * File-based allowlist store format from otto.
 */
interface FileAllowFromStore {
    version: number;
    allowFrom: string[];
}
/**
 * Migration result for a single channel.
 */
export interface ChannelMigrationResult {
    channel: PairingChannel;
    requestsMigrated: number;
    allowlistEntriesMigrated: number;
    errors: string[];
}
/**
 * Overall migration result.
 */
export interface MigrationResult {
    success: boolean;
    channels: ChannelMigrationResult[];
    totalRequestsMigrated: number;
    totalAllowlistEntriesMigrated: number;
    errors: string[];
}
/**
 * Options for the migration.
 */
export interface MigrationOptions {
    /** Dry run - only report what would be migrated, don't actually migrate */
    dryRun?: boolean;
    /** Skip expired requests */
    skipExpired?: boolean;
    /** Expiration TTL in milliseconds (default: 1 hour) */
    expirationTtlMs?: number;
    /** Clear existing data before migration */
    clearExisting?: boolean;
}
/**
 * Migrate a single channel's pairing data from file-based store to database.
 *
 * @param runtime - The agent runtime
 * @param channel - The channel to migrate
 * @param pairingData - The pairing requests data
 * @param allowlistData - The allowlist data
 * @param options - Migration options
 * @returns Migration result for this channel
 */
export declare function migrateChannelPairingData(runtime: IAgentRuntime, channel: PairingChannel, pairingData: FilePairingStore | null, allowlistData: FileAllowFromStore | null, options?: MigrationOptions): Promise<ChannelMigrationResult>;
/**
 * Migrate all channels from a directory of file-based pairing stores.
 *
 * This function expects the directory to contain files in the format:
 * - {channel}-pairing.json (pairing requests)
 * - {channel}-allowFrom.json (allowlist)
 *
 * @param runtime - The agent runtime
 * @param readFile - Function to read a file (path) => Promise<string>
 * @param listFiles - Function to list files in the directory
 * @param options - Migration options
 * @returns Overall migration result
 */
export declare function migrateAllChannels(runtime: IAgentRuntime, readFile: (path: string) => Promise<string>, listFiles: () => Promise<string[]>, options?: MigrationOptions): Promise<MigrationResult>;
/**
 * Create a migration from file system paths.
 *
 * This is a convenience function for Node.js environments.
 *
 * @param runtime - The agent runtime
 * @param credentialsDir - Path to the credentials directory
 * @param options - Migration options
 * @returns Migration result
 */
export declare function migrateFromFileSystem(runtime: IAgentRuntime, credentialsDir: string, options?: MigrationOptions): Promise<MigrationResult>;
export {};
//# sourceMappingURL=pairing-migration.d.ts.map