/** * Shared Python helpers for one-shot sidecar invocations. * * The Resolve bridge (`hosts/resolve/bridge.ts`) is a *long-lived* Python * subprocess we talk to via JSON-line protocol. Other tools (beat detection, * face reframe, etc.) only need a one-shot invocation: spawn → write JSON to * stdin → read JSON from stdout → exit. Both modes share interpreter probing, * so `findPython()` lives here and is re-exported from bridge.ts for callers * that already imported it from there. * * Cross-platform notes match the bridge's: * - macOS/Linux ship `python3`. Windows often only has `python` or `py -3`. * - Force UTF-8 I/O so JSON with non-ASCII names is safe on Windows. * - Capture stderr separately for diagnostics (warnings shouldn't break parsing). */ export interface PythonCmd { cmd: string; args: string[]; /** * `sys.prefix` of the interpreter (Windows-only convenience for setting * PYTHONHOME when multiple Pythons sit on PATH). Other callers can ignore. */ prefix?: string; } export declare function findPython(): PythonCmd | undefined; /** * Test-only: clear the cached interpreter so subsequent calls re-probe. * Production code never needs this — there's no path where Python * disappears mid-process and we need to rediscover. */ export declare function __resetPythonCacheForTests(): void; export interface RunPythonResult { code: number; stdout: string; stderr: string; } export interface RunPythonOptions { signal?: AbortSignal; cwd?: string; /** Extra env vars layered on top of process.env. */ env?: Record; /** * JSON payload written to the script's stdin (one shot). Stringified by * the caller in most cases — pass a string directly if you need raw bytes. */ stdin?: string; } /** * Run a Python script as a one-shot subprocess. Resolves with combined * stdout/stderr/exit-code; never rejects on a non-zero exit (callers * decide how to interpret it). Rejects only on spawn failure. * * Distinct from the Resolve bridge's long-lived spawn — this is for * sidecars that produce one JSON blob and exit. */ export declare function runPython(scriptPath: string, scriptArgs: string[], opts?: RunPythonOptions): Promise; //# sourceMappingURL=python.d.ts.map