import type { Api, FetchImpl } from "@oh-my-pi/pi-catalog/types"; import { type ApiKey } from "../auth-retry.js"; import * as AIError from "../error/index.js"; import { type Judge, type JudgeOptions, type JudgmentRequest, type JudgmentResult, type Questions } from "./types.js"; export declare const TYPESAFE_PROVIDER = "typesafe"; export declare const TYPESAFE_DEFAULT_MODEL = "jev-latest"; /** Judgment `POST` path under a model's base URL, per System One–compatible API. */ export declare const JUDGMENT_ROUTES: { readonly typesafe: "/v1/systemone"; readonly "openrouter-decisions": "/decisions"; }; /** APIs {@link TypeSafeJudge} can serve. */ export type JudgmentApi = keyof typeof JUDGMENT_ROUTES; /** Whether a catalog API answers System One judgments natively. */ export declare function isJudgmentApi(api: Api): api is JudgmentApi; /** `TYPESAFE_BASE_URL` when set, else the public API root; trailing slashes stripped. */ export declare function typesafeBaseUrl(): string; /** `TYPESAFE_DEFAULT_MODEL` when set, else {@link TYPESAFE_DEFAULT_MODEL}. */ export declare function typesafeModel(): string; export interface TypeSafeJudgeOptions { apiKey: ApiKey; /** Wire route; defaults to TypeSafe's own API. */ api?: JudgmentApi; /** Catalog provider reported on results; defaults to {@link TYPESAFE_PROVIDER}. */ provider?: string; /** Defaults to {@link typesafeBaseUrl}. */ baseUrl?: string; /** Defaults to {@link typesafeModel}. */ model?: string; /** Static headers attached to judgment requests (e.g. proxy routing, gateway auth). */ headers?: Record; fetch?: FetchImpl; /** Per-attempt timeout; defaults to {@link DEFAULT_TIMEOUT_MS}. */ timeoutMs?: number; } /** Non-2xx response from the TypeSafe API. */ export declare class TypeSafeApiError extends AIError.ProviderHttpError { readonly name = "TypeSafeApiError"; } export declare class TypeSafeJudge implements Judge { #private; readonly label: string; readonly api: JudgmentApi; readonly provider: string; readonly model: string; readonly baseUrl: string; constructor(options: TypeSafeJudgeOptions); judge(request: JudgmentRequest, options?: JudgeOptions): Promise>; }