/** * Laya-MLX judge adapter for pi-warden. * * Implements the pi-typesafe `Judge` interface by communicating with a long-running * Python subprocess that loads the Laya model once and answers questions on demand. * * Architecture: * Node (LayaJudge) ←stdin/stdout JSON→ Python (laya-bridge.py) */ import type { Judge } from "pi-typesafe"; import type { EvaluationOptions } from "pi-typesafe"; import type { SystemOneRequest } from "@typesafe-ai/sdk"; /** * A Judge backed by a local Laya-MLX model via a Python subprocess. * * Usage: * const judge = await LayaJudge.create(onStatus); * const result = await judge.evaluate(request); */ export declare class LayaJudge implements Judge { private onStatus?; private process; private pending; private ready; private readyPromise; private modelName; private buffer; private requestCounter; /** Resolved Python binary path; set by create() before spawnBridge(). */ python: string | null; private constructor(); private _resolveReady; /** * Create a LayaJudge: download the model if needed, then spawn the Python bridge. */ static create(onStatus?: (msg: string) => void): Promise; /** * Evaluate a SystemOneRequest — the core Judge interface method. */ evaluate(request: SystemOneRequest, options?: EvaluationOptions): Promise; /** Shut down the Python bridge subprocess gracefully. */ shutdown(): Promise; private spawnBridge; private processBuffer; private handleMessage; } /** Run `python --version` and return [major, minor] or null. */ export declare function getPythonVersion(cmd: string): Promise; /** * Find a Python 3.11+ binary on this machine. * * Phase 1: scan every search directory for `python3.X` files where X >= 11, * sort newest-first, probe each. This covers any future Python version * without hardcoding names. * * Phase 2: generic `python3` / `python` on PATH and in well-known dirs. * These may point to an old system Python (3.9 on macOS), so they are * tried last. * * Exported for tests. */ export declare function findPython(): Promise;