import type { Message, PromptResult } from "smoltalk"; import type { PromptConfig } from "../llmClient.js"; import type { DecisionLog } from "../../statelog/wireTypes.js"; import { type DecisionPlan } from "./questions.js"; import type { RuntimeContext } from "../state/context.js"; import type { GraphState } from "../types.js"; import type { Run } from "../asyncContext.js"; /** The provider of a decision model the registry does not know. It names * the wire protocol Jev and Laya speak; a registry model carries its own. */ export declare const DECISION_PROVIDER = "typesafe"; /** Known models use their registry type. An unknown local decision model * can opt into the TypeSafe protocol with provider: "typesafe". */ export declare function isDecisionCall(config: PromptConfig): boolean; /** The thread as a decision model reads it: everything before the prompt, * which `runPrompt` appended last. The prompt itself becomes the questions' * instructions. A thread that holds only the prompt sends it as the state, * so the model never sees an empty state. */ export declare function stateMessages(messages: Message[]): Message[]; /** Everything that can refuse a decision call before a request exists: the * tools check, the schema mapping, and the client capability. Runs before * metering so a refusal is never counted as an attempt. */ /** The most questions one request to this call's model may carry: the * registry's `maxQuestions` for a known decision model, else Jev's cap. */ export declare function questionCapFor(config: PromptConfig): number; export declare function prepareDecision(ctx: RuntimeContext, config: PromptConfig): DecisionPlan; /** The completion, plus the request and reply as the log records them. */ export type DecisionOutcome = { completion: PromptResult; decision: DecisionLog; }; export declare function dispatchDecision(run: Run, config: PromptConfig, plan?: DecisionPlan): Promise;