import { Placeholders } from "../contracts/placeholders.type.mjs"; import { InstructionContract } from "../contracts/system-prompt.contract.mjs"; //#region ../ai/src/system-prompt/instruction.d.ts /** * Concrete `InstructionContract` โ€” a reusable directive block. * * **Role.** A single addressable prompt block representing one rule the * agent must follow (`"Always respond in {{language|English}}."`). Exists * as its own type so the same instruction can be shared across many * prompts and agents, each render supplying its own placeholder map. * * **Responsibility.** * - Owns: the `type: "instruction"` discriminator, the raw template text, * and the placeholder-rendering step. * - Does NOT own: ordering relative to other instructions, joining with a * persona, or any surrounding prompt composition โ€” those concerns live * in `SystemPrompt`. * * Users construct via the `ai.instruction()` factory โ€” `new Instruction()` * is not the public API (see ยง4.2 of code-style.md). * * @example * const replyInLanguage = ai.instruction("Respond in {{language|English}}."); * * const prompt = ai.systemPrompt() * .persona("You are Alex.") * .instruction(replyInLanguage) * .instruction("Always include code examples."); */ declare class Instruction implements InstructionContract { readonly text: string; readonly type: "instruction"; constructor(text: string); /** * Substitute `{{mustache}}` placeholders in the instruction text against * the supplied map. Delegates to the shared `renderPlaceholders` helper * so persona / instruction / system-prompt rendering stays identical. */ resolve(placeholders?: Placeholders): string; } /** * Create an `Instruction` from raw template text. * * @example * const replyIn = instruction("Respond in {{language|English}}."); * const cite = instruction("Always cite sources inline."); */ declare function instruction(text: string): Instruction; //#endregion export { Instruction, instruction }; //# sourceMappingURL=instruction.d.mts.map