/** * The herdr hand-off for `aidlc start --worktree` (worktree-opens-in-herdr). * * Inside herdr, the new worktree opens as a workspace and the agent is started there on * `/aidlc-continue `, so "start this roadmap item" ends with the agent already working * instead of a command to paste. Outside herdr nothing here runs a process. * * Best effort by design: every outcome is one printed line and none changes the exit status * (AC-4). Failing the start instead would undo a good worktree because a terminal * multiplexer did not answer. * * Every herdr call is an argument vector. The one string a shell does see is the command * typed into the pane, built only from an allowlisted name and a single-quoted path (AC-11). * * @module */ export type HerdrAgent = 'claude' | 'codex'; export interface HerdrCall { status: number | null; stdout: string; stderr: string; timedOut: boolean; /** Set when the process could not be run at all. */ error: string | null; } /** One herdr call: argv in, outcome out. Injectable so tests need no herdr. */ export type HerdrRunner = (args: string[], timeoutMs: number) => HerdrCall; export interface HandOffInput { instance: string; /** The directory to work in — `worktreeRef.projectPath`. */ worktree: string; /** What herdr opens — `worktreeRef.path`, the worktree's top. */ checkout: string; projectRoot: string; /** False under `--no-open`. */ open: boolean; blockingFailed: boolean; env?: NodeJS.ProcessEnv; run?: HerdrRunner; /** Test seam; HERDR_TIMEOUT_MS otherwise. */ timeoutMs?: number; } /** Per call (AC-12). Opening a workspace is a socket round-trip; ten seconds is a hang. */ export declare const HERDR_TIMEOUT_MS = 10000; /** * The platform to start (AC-2): `AIDLC_AGENT` when it names one of the two adapters, else the * first of them in `.aidlc/config.yaml` `platforms`, else Claude Code. */ export declare function agentFor(projectRoot: string, env?: NodeJS.ProcessEnv): HerdrAgent; /** * The command typed into the pane, and printed when the hand-off fails. The `cd` is typed * rather than trusting herdr's pane directory: herdr opens the checkout, and for a project * below the repository root the agent must run in the project's copy. */ export declare function agentCommand(worktree: string, agent: HerdrAgent, instance: string): string; /** * Open the worktree in herdr and start the agent there. Returns the line to print, or null * when the hand-off does not apply — outside herdr, under `--no-open`, unattended, or after a * blocking action failed — in which case no process was run. Never throws. */ export declare function herdrHandOff(input: HandOffInput): string | null; //# sourceMappingURL=herdr.d.ts.map