import type { GitRepoStatus } from '../git/git-types.js';
export interface MeshFastForwardNodeArgs {
    nodeId?: string;
    meshId?: string;
    workspace: string;
    branch?: string;
    execute?: boolean;
    dryRun?: boolean;
    updateSubmodules?: boolean;
    submoduleIgnorePaths?: string[];
    timeoutMs?: number;
    trigger?: 'manual' | 'idle_auto' | string;
    /**
     * Operation mode. 'merge' (default) absorbs upstream commits into the local
     * branch via git merge --ff-only (requires ahead=0, behind>0). 'push' publishes
     * local commits to origin via a strict ff-only push (requires HEAD to be a
     * descendant of origin/<branch>); it never force-pushes, resets, or rebases.
     */
    mode?: 'merge' | 'push';
    /**
     * When mode='push', also fast-forward push submodule (e.g. oss) HEADs to their
     * origin main branch. Gated by allowAutoPublishSubmoduleMainCommits — skipped
     * unless that policy is true. Each submodule must still pass the descendant gate.
     * Defaults false (root push only).
     */
    pushSubmodules?: boolean;
    /**
     * Mesh policy flag mirrored from RepoMeshPolicy.allowAutoPublishSubmoduleMainCommits.
     * Submodule pushes are refused unless this is true.
     */
    allowAutoPublishSubmoduleMainCommits?: boolean;
}
export interface MeshFastForwardPlannedStep {
    operation: 'refresh_upstream' | 'verify_clean_worktree' | 'verify_fast_forward' | 'merge_ff_only' | 'submodule_update' | 'verify_post_status' | 'verify_push_descendant' | 'push_ff_only' | 'push_submodules_ff_only';
    description: string;
    safe: true;
    willMutateWorktree: boolean;
}
export interface MeshFastForwardSubmodulePushResult {
    path: string;
    commit?: string;
    remote: string;
    remoteBranch: string;
    pushed: boolean;
    skipped: boolean;
    code: string;
    refspec?: string;
    error?: string;
}
export interface MeshFastForwardResult {
    success: boolean;
    code: string;
    nodeId?: string;
    meshId?: string;
    workspace: string;
    mode: 'merge' | 'push';
    allowed: boolean;
    dryRun: boolean;
    willRun: boolean;
    executed: boolean;
    updateSubmodules: boolean;
    blockingReasons: string[];
    plannedSteps: MeshFastForwardPlannedStep[];
    current?: GitRepoStatus;
    preStatus?: GitRepoStatus;
    postStatus?: GitRepoStatus;
    /** Push target derived from the tracked upstream (mode='push'). */
    pushTarget?: {
        remote: string;
        remoteBranch: string;
        refspec: string;
    };
    /** Submodule ff-only push outcomes (mode='push' with pushSubmodules). */
    submodulePushes?: MeshFastForwardSubmodulePushResult[];
    finalBranchConvergenceState?: Record<string, unknown>;
    operationError?: string;
    ledgerError?: string;
    nextStep?: string;
    trigger?: string;
}
export declare function fastForwardMeshNode(args: MeshFastForwardNodeArgs): Promise<MeshFastForwardResult>;
