/** * PhilosopherPromptBuilder — transforms Philosopher context into a prompt for the LLM. * * PRI-107: The Philosopher runner previously sent only `{ taskId, contextHash, dreamerArtifact }` * as inputPayload, giving the LLM no instructions about what to produce. This builder * follows the DiagnosticianPromptBuilder pattern: it packages context data + an * explicit instruction telling the LLM to produce PhilosopherOutputV1 JSON. * * ## Contract * * buildPrompt() takes PhilosopherPromptBuilderInput and returns a build result * whose `message` is the JSON string to be passed as `inputPayload` in * StartRunInput, and whose `systemPrompt` is the base-layer system prompt * (role + protocol) to pass via `StartRunInput.systemPrompt` (PRI-633). * * ## Constraints * * - Message payload is ONLY task data (JSON) — no markdown, no file ops, no tool calls * - Role/protocol instructions travel as the base systemPrompt layer, NOT in * the user payload (PRI-633); the profile's configured systemPrompt remains * the append layer owned by the agent profile (DPB-07, as revised by PRI-633) * - buildPrompt() is a pure function — no DB calls, no side effects */ import type { CoreAxiomBlockOptions } from '../core-principles/core-axiom-block.js'; import type { OutputLanguage } from '../language-directive.js'; export interface PhilosopherPromptBuilderInput { taskId: string; contextHash: string; dreamerArtifact: unknown; sourceDreamerArtifactId: string; /** Inject core axiom grounding section (default: false). */ coreGrounding?: boolean; /** Output language for bilingual principle statements. */ outputLanguage?: OutputLanguage; } export interface PhilosopherPromptInput { taskId: string; contextHash: string; dreamerArtifact: unknown; sourceDreamerArtifactId: string; } export interface PhilosopherPromptBuildResult { readonly message: string; readonly promptInput: PhilosopherPromptInput; /** * PRI-633: base-layer system prompt (role + protocol). Previously embedded * in the payload as `philosopherInstruction`; now delivered via the system * channel by the runtime adapter. */ readonly systemPrompt: string; } /** * Build the Philosopher protocol instruction with optional core axiom grounding. * * When `coreGrounding` is true, a CORE AXIOMS section is injected so the * Philosopher can check whether the new principle candidate duplicates or * contradicts an existing core principle. * * PRI-714 (review fix): when `outputLanguage` is provided, a language * directive is appended so the OUTPUT (not just the axiom block) follows the * owner's language — thesis/principleCandidate.{title,rationale,scope}/risks * are the human-readable fields (confidence stays numeric; lineage IDs stay * untranslated). Undefined = no directive (byte-identical to pre-PRI-714). */ export declare function buildPhilosopherProtocolInstruction(opts?: CoreAxiomBlockOptions): string; export declare class PhilosopherPromptBuilder { private readonly coreGrounding; private readonly outputLanguage?; constructor(opts?: { coreGrounding?: boolean; outputLanguage?: OutputLanguage; }); buildPrompt(input: PhilosopherPromptBuilderInput): PhilosopherPromptBuildResult; } //# sourceMappingURL=philosopher-prompt-builder.d.ts.map