import type { Command } from "commander"; import type { Config } from "../types/index.js"; import { type MergeAssessment } from "../services/api/HulaApiClient.js"; /** * Prefix for the single machine-readable line `hula approve` writes to stdout * when it exits 3 (merge confidence below threshold in a non-TTY). The ported * `approve-remote`/`approve-local` scripts parse the JSON `{ message, assessment }` * that follows the prefix and re-emit it as a `below_threshold` error so the * `/hula-approve` skill can render the concerns and end-user steps. Everything * else on stdout is human-readable. */ export declare const BELOW_THRESHOLD_STDOUT_PREFIX = "HULA_MERGE_BELOW_THRESHOLD:"; /** * Render the warning block shown before `hula approve` prompts (or exits 3) when * the stored merge assessment is not `ready`. Lists the confidence/threshold/ * verdict header, the five category scores (when present), the concerns, and the * recommended end-user test steps. A `blocked` verdict gets a stronger prefix. * The assessment text is printed verbatim — never passed to a shell. */ export declare function formatAssessmentWarning(a: MergeAssessment | null): string; /** * The exit-3 message printed (and sent to the scripts) when the merge is gated. * Uses the assessment's own frozen `threshold`, not the local config value, so * the CLI and the server's PR comment agree. */ export declare function belowThresholdMessage(a: MergeAssessment | null): string; /** * Decide whether `hula approve` may proceed, based on the stored merge * assessment (never recomputed locally). `ready` proceeds silently; anything * else prints the warning block and then either proceeds (`--force`), prompts * in a TTY, or signals exit-3 in a non-TTY. * * Pure of `process.exit` so it can be unit-tested; the caller performs the * exit/emit for the `'exit3'` result. */ export declare function assessMergeGate(a: MergeAssessment | null, opts: { force: boolean; isTTY: boolean; confirmFn?: (msg: string, def: boolean) => Promise; }): Promise<"proceed" | "cancelled" | "exit3">; /** * Best-effort: after a successful remote merge, fast-forward the project * root's local default branch to match origin. * * `hula approve` often runs inside a git worktree, so we locate the project * root (main worktree) explicitly rather than assuming the current working * directory is the root. FF-only and fully guarded: any problem is a * warning, never an error — the PR is already merged remotely. * * Guards (each logs a specific, actionable warning when it skips): * 1. Default branch name is shell-safe * 2. The project root (main) worktree can be located * 3. The root is checked out on the default branch * 4. The root working tree is clean * 5. `git pull --ff-only` succeeds * * @returns `true` if the local default branch was actually fast-forwarded; * `false` if the update was skipped or failed (non-critical). */ export declare function updateRootMainBranch(): Promise; /** * Merge command - Merge PR, delete branch, remove from tracking */ export declare function approveCommand(program: Command, config: Config): void; //# sourceMappingURL=approve.d.ts.map