/** * DistillerPromptBuilder — Stage B prompt builder for the split diagnostician pipeline. * * Constructs the prompt for the Distiller stage (Stage B). It receives the * Stage A root cause artifact as input and produces an abstracted principle * grounded on core axioms (T-01..T-10). * * ## Prompt Sections * * 1. Role — principle distiller identity * 2. Input — Stage A root cause output (structured data) * 3. Core Axioms — T-01..T-10 list (when coreGrounding=true) * 4. Output Requirements — DiagDistillerOutputV1Schema * 5. Quality Guard — abstract vs rule-like distinction * * @see PRI-372 */ import type { TSchema } from '@sinclair/typebox'; import type { SchemaPromptAdapter } from '../adapter/schema-prompt-adapter.js'; import type { DiagRootCauseOutputV1 } from './diag-rootcause-output.js'; import type { OutputLanguage } from '../language-directive.js'; import type { BuildPromptOptions } from '../diagnostician-prompt-builder.js'; /** * Options for DistillerPromptBuilder constructor and buildDistillerInstruction. * * Uses an opts-object pattern to satisfy @typescript-eslint/max-params. * * @see PRI-372 */ export interface DistillerPromptBuilderOptions { /** Schema prompt adapter (default: DefaultSchemaPromptAdapter) */ adapter?: SchemaPromptAdapter; /** TypeBox schema for output validation (default: DiagDistillerOutputV1Schema) */ schema?: TSchema; /** Output language directive (default: none) */ outputLanguage?: OutputLanguage; /** Inject core axiom grounding section (default: false) */ coreGrounding?: boolean; } /** * Input context for the Distiller stage (Stage B). * * Contains the Stage A root cause artifact ID and output, plus an optional * coreGrounding flag that overrides the builder-level default. * * @see PRI-372 */ export interface DistillerContextInput { /** Artifact ID of the Stage A root cause output — used for lineage tracing */ rootCauseArtifactId: string; /** Stage A root cause output — the structured data to abstract from */ rootCauseOutput: DiagRootCauseOutputV1; /** Override builder-level coreGrounding for this specific invocation */ coreGrounding?: boolean; } /** * PromptInput for the Distiller stage (Stage B). * * Unlike Stage A (which uses the full DiagnosticianContextPayload), * Stage B receives only the Stage A root cause artifact and the * distiller instruction. * * @see PRI-372 */ export interface DistillerPromptInput { /** Artifact ID of the Stage A root cause output — for lineage tracing */ rootCauseArtifactId: string; /** Stage A root cause output — the structured data to abstract from */ rootCauseOutput: DiagRootCauseOutputV1; } /** * Build result for the Distiller stage (Stage B). * * Follows the same contract as PromptBuildResult but with a * DistillerPromptInput shape specific to Stage B. * * @see PRI-372 */ export interface DistillerPromptBuildResult { /** JSON string — the exact value to pass as openclaw agent --message argument */ readonly message: string; /** The DistillerPromptInput object that was serialized to JSON */ readonly promptInput: DistillerPromptInput; /** * PRI-633: base-layer system prompt (role + protocol). Previously embedded * in the payload as `distillerInstruction`; now delivered via the system * channel by the runtime adapter. */ readonly systemPrompt: string; } /** * Build the Stage B distiller protocol instruction. * * When `coreGrounding` is true, the Core Axioms section is included with * the full T-01..T-10 list and a strict instruction prohibiting fabricated * axiom IDs. When false or undefined, the section is omitted. * * @see PRI-372 */ export declare function buildDistillerProtocolInstruction(opts?: DistillerPromptBuilderOptions): string; /** * DistillerPromptBuilder — Stage B prompt builder for the split diagnostician pipeline. * * Receives the Stage A root cause artifact as input and produces an abstracted * principle grounded on core axioms (T-01..T-10). * * Uses an opts-object pattern for all methods to satisfy @typescript-eslint/max-params. * * @see PRI-372 */ export declare class DistillerPromptBuilder { private readonly adapter; private readonly schema; constructor(opts?: DistillerPromptBuilderOptions); /** * Build the Stage B distiller protocol instruction. * * Contains the role definition, input description, core axioms section * (when coreGrounding=true), output requirements, and quality guard. * * @see PRI-372 */ buildDistillerInstruction(opts?: DistillerPromptBuilderOptions): string; /** * Build the full prompt for Stage B. * * Constructs a DistillerPromptBuildResult containing the JSON message to pass * as the --message argument to the LLM agent. The message includes the * distiller instruction and the Stage A root cause context. * * Per DPB-02: Output is ONLY JSON — no markdown, no file ops, no tool calls. * Per DPB-05: This method only builds the prompt; it does NOT commit to PD database. * * @see PRI-372 */ buildPrompt(context: DistillerContextInput, opts?: BuildPromptOptions): DistillerPromptBuildResult; } //# sourceMappingURL=distiller-prompt-builder.d.ts.map