import type { Finding, TokenMap } from "../types.js"; import type { AgentId } from "./registry.js"; /** Passed through to `deps.launch` so it can build the right argv (`--review` omits the permission-bypass flag). */ export interface LaunchOpts { reviewMode?: boolean; } export interface HandoffDeps { prompt: (choices: { value: string; label: string; }[]) => Promise; launch: (agentId: AgentId, prompt: string, cwd: string, opts?: LaunchOpts) => Promise; /** Injected path for the handoff-target persistence file (tests only). */ targetFilePath?: string; /** * Pre-spawn safety confirmation, shown only in the default (unattended, * permission-bypassed) mode — skipped entirely when `reviewMode` is set. * Defaults to {@link confirmBypass} (real TTY prompt; auto-proceeds when * non-interactive/CI/`--yes`). */ confirm?: (message: string) => Promise; } export interface HandoffInput { findings: Finding[]; tokens: TokenMap | null; root: string; projectName: string; topN?: number; /** `.lyse.yaml` `advisory.migrationScaleFileCount` override; falls back to the payload default. */ migrationScaleFileCount?: number; /** * `--review` / `LYSE_HANDOFF_REVIEW=1` / `.lyse.yaml` `handoff.review`: * launch the agent under its own default permission model (it prompts * per-action) instead of bypassing permission prompts. Also skips the * pre-spawn safety confirmation — the agent's own prompts are the safety * net in this mode. Default `false`. */ reviewMode?: boolean; } type HandoffAction = "launched" | "copied" | "copy-failed" | "skipped" | "none"; export interface HandoffResult { action: HandoffAction; agentId?: AgentId; } export declare function runHandoff(input: HandoffInput, deps: HandoffDeps): Promise; export declare function spawnAgentLauncher(agentId: AgentId, prompt: string, cwd: string, opts?: LaunchOpts): Promise; export {};