import type { AgentRunArgs } from './agent-runner.js'; import type { CopilotStreamEvent, TurnOutcome } from './copilot-runner-types.js'; export declare const TURN_TIMEOUT_MS: number; /** Distinct from TURN_TIMEOUT_MS: catches a hung first-run interactive prompt * fast instead of waiting out the full turn timeout. Any output at all * disarms it. Copilot CLI has a DOCUMENTED bug where its directory-trust * and path-access prompts can hang indefinitely in CI/headless invocations * with no way to answer them — this is the primary mitigation for copilot * specifically, not just a defensive backstop. */ export declare const STARTUP_GRACE_MS = 45000; /** * copilot's tool-permission flags. Without `--sandbox` (or with `full`): * `--allow-all-tools`, or `--allow-all` (tools + every path + every URL) for * full access, so a headless turn never stops on an approval it cannot * answer. #482 (copilot 1.0.89, checked live): with no allow-all flag, a * call that needs approval is refused in `-p` mode; deny rules beat every * allow rule; without --allow-all-paths, edits stay under the cwd, * `--add-dir` and the temp dir (symlinks out of the cwd refused too). * restricted nothing — copilot's own approval rules, asks refused * read-only --deny-tool=write --deny-tool=shell * workspace-write --allow-tool=write --deny-tool=shell * With `--access full` the read-only/workspace-write turn keeps its other * tools (URLs, MCP) approved: `--allow-all` / `--allow-all-tools * --allow-all-urls` plus the same deny rules (never --allow-all-paths for * workspace-write). */ export declare function copilotPermissionArgs(args: Pick): string[]; /** * Run one `copilot` invocation and stream its NDJSON output * INCREMENTALLY: each parsed line is yielded as soon as it arrives on * stdout (see the header's "Streaming / liveness" note for why buffering * until process exit was a bug, #204). End-of-turn facts (exit code, * stderr tail, timeout/hang flags) are written into `outcome`, which the * caller reads after this generator completes. */ export declare function streamTurn(bin: string, prompt: string, sessionId: string | undefined, args: AgentRunArgs, outcome: TurnOutcome): AsyncGenerator; /** Build the actionable error for a failed copilot turn (hangSuspected is * handled separately by the caller — it has its own, more specific message). */ export declare function turnError(outcome: TurnOutcome): Error; //# sourceMappingURL=copilot-runner-stream.d.ts.map