/**
 * Sync Bindings for Unified Scripting
 *
 * Provides scripting functions for cross-session synchronization:
 * - sync.status() - Get current sync status
 * - sync.push() - Push local changes
 * - sync.pull() - Pull remote changes
 * - sync.diff() - Show pending changes
 * - sync.resolve() - Resolve conflicts
 * - sync.snapshot() - Create workspace snapshot
 * - sync.restore() - Restore from snapshot
 *
 * Migrated from src/fcs/sync-bindings.ts
 */
import { CodeBuddyValue, CodeBuddyScriptConfig } from './types.js';
import { SyncManager, SyncConflict, SyncStatus } from '../sync/index.js';
export interface WorkspaceSnapshot {
    id: string;
    timestamp: number;
    files: Map<string, FileState>;
    context: SessionContext;
    metadata: SnapshotMetadata;
}
export interface FileState {
    path: string;
    content: string;
    hash: string;
    lastModified: number;
    isOpen: boolean;
    isDirty: boolean;
}
export interface SessionContext {
    sessionId: string;
    agentMode: string;
    toolsUsed: string[];
    conversationLength: number;
    startTime: number;
}
export interface SnapshotMetadata {
    name?: string;
    description?: string;
    tags?: string[];
    createdBy: string;
}
export interface SyncBindingsConfig extends Partial<CodeBuddyScriptConfig> {
    sessionId?: string;
    nodeId?: string;
    onConflict?: (conflict: SyncConflict) => void;
}
export declare class WorkspaceStateTracker {
    private files;
    private sessionContext;
    private syncManager;
    private snapshots;
    constructor(sessionId: string, nodeId?: string);
    initialize(): Promise<void>;
    private restoreSnapshotFromData;
    trackFile(filePath: string, content: string, isOpen?: boolean): void;
    untrackFile(filePath: string): void;
    markFileDirty(filePath: string): void;
    markFileClean(filePath: string): void;
    getTrackedFiles(): FileState[];
    getDirtyFiles(): FileState[];
    updateContext(updates: Partial<SessionContext>): void;
    recordToolUsage(toolName: string): void;
    incrementConversation(): void;
    getContext(): SessionContext;
    createSnapshot(metadata?: Partial<SnapshotMetadata>): WorkspaceSnapshot;
    getSnapshot(id: string): WorkspaceSnapshot | undefined;
    listSnapshots(): WorkspaceSnapshot[];
    restoreSnapshot(id: string): boolean;
    getSyncManager(): SyncManager<WorkspaceSnapshot>;
    getSyncStatus(): SyncStatus;
    pushChanges(): Promise<{
        success: boolean;
        snapshot: WorkspaceSnapshot;
    }>;
    pullChanges(remoteSnapshots: WorkspaceSnapshot[]): Promise<{
        success: boolean;
        conflicts: SyncConflict<WorkspaceSnapshot>[];
        applied: number;
    }>;
    diffWith(other: WorkspaceSnapshot): FileDiff[];
    private computeHash;
    dispose(): void;
}
export interface FileDiff {
    path: string;
    type: 'added' | 'deleted' | 'modified';
    local?: string;
    remote?: string;
}
export declare function getWorkspaceTracker(sessionId?: string): Promise<WorkspaceStateTracker>;
export declare function resetWorkspaceTracker(): void;
/**
 * Create sync bindings for the scripting runtime
 */
export declare function createSyncBindings(config: SyncBindingsConfig, print: (msg: string) => void): Promise<Record<string, CodeBuddyValue>>;
declare const _default: {
    createSyncBindings: typeof createSyncBindings;
    getWorkspaceTracker: typeof getWorkspaceTracker;
    resetWorkspaceTracker: typeof resetWorkspaceTracker;
    WorkspaceStateTracker: typeof WorkspaceStateTracker;
};
export default _default;
