import { spawn, type SpawnOptionsWithoutStdio } from "node:child_process"; import { reapProcessTree } from "@claudexor/core"; export declare const AGY_PRINT_TIMEOUT_MS = 30000; export declare const AGY_PRINT_STREAM_LIMIT_BYTES: number; type EnvMap = Record; export type AgyPrintFailureReason = "spawn_failed" | "timed_out" | "aborted" | "output_overflow" | "termination_unconfirmed"; export type AgyPrintCommandResult = { kind: "completed"; code: number | null; signal: NodeJS.Signals | null; stdout: string; stderr: string; } | { kind: "failed"; reason: AgyPrintFailureReason; detail: string; stdout: string; stderr: string; }; export interface AgyPrintCommandOptions { timeoutMs?: number; maxStdoutBytes?: number; maxStderrBytes?: number; abortSignal?: AbortSignal; platform?: NodeJS.Platform; /** Bounded cancellation proof seam; production default is 5 seconds. */ cancelDeadlineMs?: number; /** Bounded post-exit pipe drain seam; production default is 200 ms. */ drainMs?: number; /** Deterministic binary-resolution seam; production uses the shared exact resolver. */ resolveBinary?: (bin: string, env: NodeJS.ProcessEnv, platform: NodeJS.Platform) => string | null; /** Deterministic lifecycle seams. */ spawnProcess?: typeof spawn; reap?: typeof reapProcessTree; /** Deterministic passive-registry seam; production uses the shared registry. */ processRegistry?: { register(pid: number, command: string): void; unregister(pid: number): void; }; } /** Spawn policy is exported so Windows fixtures can assert no inherited console/stdio. */ export declare function agyPrintSpawnOptions(platform: NodeJS.Platform, env: NodeJS.ProcessEnv): SpawnOptionsWithoutStdio; /** * Bounded discovery owner for `/model`, `/quota` and the plain `models` listing. The child gets pipe EOF * and no controlling terminal: POSIX starts a new session; Windows uses * DETACHED_PROCESS because CREATE_NO_WINDOW still exposes a windowless * CONIN$. Child exit is completion authority; descendant-held pipes receive * only a bounded drain. */ export declare function runAgyPrintCommand(bin: string, command: "/model" | "/quota" | "models", envPatch: EnvMap, options?: AgyPrintCommandOptions): Promise; export type AgyPrintClassification = { kind: "success"; envelope: Record; } | { kind: "unauthenticated"; detail: string; } | { kind: "probe_failed"; detail: string; }; /** Shared exit/envelope/auth classifier for doctor and quota. */ export declare function classifyAgyPrintResult(result: AgyPrintCommandResult): AgyPrintClassification; export {}; //# sourceMappingURL=print-command.d.ts.map