export interface HerdrExecResult { code: number; stdout: string; stderr: string; killed?: boolean; } /** Mutable-array executor, compatible with a bound `pi.exec`. Args are copied by createHerdrClient. */ export type HerdrExecutor = (command: string, args: string[], options: Options) => Promise; export interface HerdrClient { exec(args: readonly string[], options: Options): Promise; run(args: readonly string[], options: Options): Promise; json(args: readonly string[], options: Options): Promise>; } export interface StartPiAgentOptions { name: string; pane: string; args: readonly string[]; options: Options; delay?: (milliseconds: number) => Promise; onPaneBusy?: () => Promise; shouldRetry?: (result: HerdrExecResult) => boolean; } /** Start a Pi agent in a Herdr pane, retrying only transient pane contention. */ export declare function startPiAgent(client: Pick, "exec">, input: StartPiAgentOptions): Promise; export declare function createHerdrClient(execute: HerdrExecutor): HerdrClient; export declare function herdrCommandFailure(args: readonly string[], result: HerdrExecResult): string; export declare function hasHerdrErrorCode(result: Pick, expected: string): boolean; /** Lock a Herdr worktree checkout path while mutating it via the Herdr CLI. */ export declare function withWorktreeLock(checkout: string, operation: () => Promise): Promise;