import type { Api, Model } from "@caupulican/pi-ai"; import { type IsolatedCompletionRunner } from "../isolated-text-completion.ts"; import { REFLEX_INTERPRETER_SYSTEM_PROMPT } from "../provider-prompt-contracts.ts"; import { type SpawnedUsageReporter } from "../spawned-usage.ts"; import type { ToolkitScript } from "./script-registry.ts"; export { REFLEX_INTERPRETER_SYSTEM_PROMPT }; /** * Reflex interpreter (the BRAIN half of the user-ratified brain->muscle pipeline, statistically * validated at 10/10 correct interpretations on the hard registry): a strict instruction * interpreter that maps a fuzzy user request onto the toolkit registry. It NEVER executes * anything — it only proposes `{script, args, danger, confidence}` for the deterministic * executor path, which still enforces every safety rule (danger confirmation included). */ export interface ReflexPlan { script: string; args: string[]; danger: boolean; confidence: number; } export declare const REFLEX_MIN_CONFIDENCE = 0.75; export interface ReflexInterpreterCompletionOptions { request: string; scripts: readonly ToolkitScript[]; model: Model; laneKind: string; usageKind: string; usageLabel: string; sessionId: string; completionRunner: IsolatedCompletionRunner; usageReporter: SpawnedUsageReporter; } /** Execute the shared reflex interpreter call and account for it under the caller's lane identity. */ export declare function runReflexInterpreterCompletion(options: ReflexInterpreterCompletionOptions): Promise; export declare function buildReflexUserPrompt(request: string, scripts: readonly ToolkitScript[]): string; export declare function parseReflexPlan(text: string): ReflexPlan | undefined; /** * Accept a plan only when it is confident AND names a real registry script ("none" and unknown * names are honest refusals). The DANGER flag is never trusted from the plan — the registry's * own flag governs confirmation, exactly as for a direct match. */ export declare function acceptReflexPlan(plan: ReflexPlan | undefined, scripts: readonly ToolkitScript[]): { script: ToolkitScript; args: string[]; } | undefined; //# sourceMappingURL=reflex-interpreter.d.ts.map