/**
 * Spawn helper for the pi CLI.
 *
 * Mirrors gemini-cli/transport/geminiSpawn.ts (process-level, framework-
 * agnostic structure) but encodes the pi-specific credential boundary and the
 * canonical one-shot argv.
 *
 * The argv (`buildPiOneShotArgv`) and the JSONL event-stream facts the
 * one-shot parser depends on were verified HANDS-ON in the P0.1 eval (pi
 * 0.78.1, docs/specs/_drafts/pi-eval-report.md) — they are ground truth, not
 * inferred from docs.
 *
 * stdin discipline: like gemini, the binary may read stdin; without an
 * explicit EOF it can hang waiting for input. `spawn` + an immediate
 * `child.stdin.end()` defeats this (harmless and defensive regardless).
 *
 * Output-byte cap: captured stdout + stderr are hard-capped at
 * `maxOutputBytes` and the result is flagged `truncated` — a runaway/looping
 * child can never OOM the supervising process.
 */
/** Default output cap: 8 MiB per stream. A one-shot final message is tiny;
 *  the cap only fires on a runaway/looping child. */
export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
/**
 * The canonical one-shot argv — pinned, no ambiguity. EVAL-VERIFIED (pi
 * 0.78.1, P0.1):
 *
 *   pi -p --mode json --no-session --offline [--model <pattern>] <prompt>
 *
 * - `-p` is pi's one-shot/print entrypoint.
 * - `--mode json` emits the typed JSONL event stream on stdout (the format
 *   `oneShotCompletion.ts` parses for the assistant `message_end`).
 * - `--no-session` keeps the call stateless — no session file is written
 *   (one-shot has nothing to resume).
 * - `--offline` blocks the first-boot binary fetch (pi otherwise pulls `fd` +
 *   `ripgrep` from GitHub on first run — eval caveat 2); a one-shot text
 *   completion needs neither.
 * - `--model <pattern>` is appended only when a model is configured; when
 *   omitted, pi's OWN configured default provider/model applies.
 * - The prompt is the SOLE trailing POSITIONAL — exactly ONE argv element. A
 *   leading-dash prompt (`"--help me"`, `"-y do X"`) can NEVER be re-parsed as
 *   a flag because it is the last element AND all flags precede it (same
 *   argument-injection hardening note as gemini's `-p <prompt>`).
 */
export declare function buildPiOneShotArgv(model: string | undefined, prompt: string): string[];
/**
 * Provider billing-capable vars UNCONDITIONALLY deleted from the child env,
 * regardless of allowlist contents. Any of these present could silently route
 * pi onto a billed API key instead of its auth.json subscription / models.json
 * custom-provider path. A false-negative (silent billing) is asymmetrically
 * costly, so the delete is unconditional.
 */
export declare const PI_BILLING_ENV_VARS: readonly ["ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN", "OPENAI_API_KEY", "GEMINI_API_KEY", "GOOGLE_API_KEY", "XAI_API_KEY", "GROQ_API_KEY", "OPENROUTER_API_KEY"];
/**
 * Build the env for a `pi` child process per the no-API-keys rule. Constructs
 * an explicit allowlist (variables not listed are dropped), then
 * UNCONDITIONALLY hard-deletes every billing-capable provider var and clears
 * `CLAUDECODE` (the Claude-Code session marker — pi must not believe it is
 * running inside a Claude Code session).
 */
export declare function buildPiChildEnv(parentEnv?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
export interface PiSpawnResult {
    exitCode: number | null;
    stdout: string;
    stderr: string;
    /** True when stdout OR stderr capture hit the byte cap and was truncated. */
    truncated: boolean;
}
export interface SpawnPiOptions {
    timeoutMs: number;
    env: NodeJS.ProcessEnv;
    signal?: AbortSignal;
    /** Hard cap on captured stdout/stderr bytes (each stream). */
    maxOutputBytes?: number;
}
/**
 * Spawn `pi` with the given argv and wait for completion.
 *
 * - Closes stdin immediately (pi may otherwise block waiting for EOF).
 * - SIGTERM→SIGKILL on timeout (2s grace), AbortSignal handling.
 * - Bounds captured stdout/stderr at `maxOutputBytes` (default 8 MiB),
 *   killing the child and flagging `truncated` once the cap is exceeded.
 * - The caller fails only on a non-zero exit code; benign startup stderr lines
 *   are not treated as failures.
 */
export declare function spawnPiAndWait(binary: string, args: string[], options: SpawnPiOptions): Promise<PiSpawnResult>;
//# sourceMappingURL=piSpawn.d.ts.map