/**
 * Mesh Sync — Sync local mesh config to/from cloud D1
 *
 * When cloud is available, this module pushes local mesh config
 * to the server and pulls remote meshes that were created from
 * other machines. The local ~/.adhdev/meshes.json remains the
 * canonical source; cloud is a persistence/relay layer.
 *
 * This is called lazily (not on daemon startup) — only when the
 * user explicitly opens the mesh page or runs `adhdev mesh sync`.
 */
export interface MeshSyncTransport {
    /** GET /api/v1/repo-meshes */
    listRemoteMeshes(): Promise<{
        meshes: RemoteMeshRecord[];
    }>;
    /** POST /api/v1/repo-meshes */
    createRemoteMesh(data: {
        name: string;
        repo_identity: string;
        repo_remote_url?: string;
        default_branch?: string;
        policy?: string;
    }): Promise<{
        mesh: RemoteMeshRecord;
    }>;
    /** DELETE /api/v1/repo-meshes/:id */
    deleteRemoteMesh(meshId: string): Promise<void>;
}
export interface RemoteMeshRecord {
    id: string;
    name: string;
    repo_identity: string;
    repo_remote_url: string | null;
    default_branch: string | null;
    policy: string;
    status: string;
    created_at: string;
    updated_at: string;
}
export interface MeshSyncResult {
    pushed: number;
    pulled: number;
    deleted: number;
    errors: string[];
}
/**
 * Push local meshes to cloud (upsert by repo_identity).
 * Pull remote meshes that don't exist locally.
 */
export declare function syncMeshes(transport: MeshSyncTransport): Promise<MeshSyncResult>;
