export declare const DEFAULT_THRESHOLD = 0.5; /** * A yes or no from a decision model (Jev, Clef, …). It has no tools and reads * nothing on its own: it judges the question against the state it is handed. */ export declare class Decider { private readonly runtime; private readonly explicit?; private constructor(); /** Throws a UsageError when no decision model resolves, before anything is asked. */ static create(model?: string): Promise; /** `provider/id` of the model it asks. */ get name(): string; decide(request: DecisionRequest): Promise; /** * The state a question is judged against: each file under its own name, * relative to `base`, a folder as the files in it. Text read from stdin goes * under `input`. */ static state(files: string[], input?: string, base?: string): Record; /** "0.7" into a probability, or a UsageError. */ static threshold(value: string | undefined): number | undefined; private model; } /** The call failed: not a "no". */ export declare class DecisionError extends Error { } export interface DecisionRequest { question: string; state: Record; /** The probability of yes that counts as yes. 0.5 by default. */ threshold?: number; signal?: AbortSignal; } export interface Decision { answer: "yes" | "no"; /** The model's probability that the answer is yes. */ probability: number; threshold: number; question: string; model: string; tokens: { input: number; output: number; }; } export type DecideFn = (request: DecisionRequest) => Promise;