/** * PromptManager - Manages agent prompts with POM support. * * Holds either raw prompt text or a PomBuilder for structured prompts. */ import { PomBuilder } from './PomBuilder.js'; /** Manages agent prompt text, supporting both raw text and structured POM-based prompts. */ export declare class PromptManager { private rawText; private postPrompt; private pom; private usePom; /** * Creates a new PromptManager. * @param usePom - Whether to use structured POM sections (default true). */ constructor(usePom?: boolean); /** * Sets the raw prompt text, bypassing POM rendering. * @param text - The raw prompt string. */ setPromptText(text: string): void; /** * Sets the post-prompt text appended after the main prompt. * @param text - The post-prompt string. */ setPostPrompt(text: string): void; /** * Adds a POM section to the prompt, initializing the PomBuilder if needed. * @param title - The section heading. * @param opts - Optional body, bullets, numbering, and subsection configuration. */ addSection(title: string, opts?: { body?: string; bullets?: string[]; numbered?: boolean; numberedBullets?: boolean; subsections?: { title: string; body?: string; bullets?: string[]; }[]; }): void; /** * Appends body text or bullets to an existing POM section, creating it if absent. * @param title - The section heading to append to. * @param opts - Body text and/or bullets to add. */ addToSection(title: string, opts?: { body?: string; bullet?: string; bullets?: string[]; }): void; /** * Adds a subsection under a parent POM section, creating the parent if absent. * @param parentTitle - The heading of the parent section. * @param title - The subsection heading. * @param opts - Optional body text and bullets for the subsection. */ addSubsection(parentTitle: string, title: string, opts?: { body?: string; bullets?: string[]; }): void; /** * Checks whether a POM section with the given title exists. * @param title - The section heading to look for. * @returns True if the section exists. */ hasSection(title: string): boolean; /** * Returns the fully rendered prompt text, either raw text or POM-rendered Markdown. * @returns The prompt string, or empty string if nothing is set. */ getPrompt(): string; /** * Returns the post-prompt text. * @returns The post-prompt string, or null if not set. */ getPostPrompt(): string | null; /** * Returns the underlying PomBuilder instance, if POM mode is active. * @returns The PomBuilder, or null if POM is not in use. */ getPomBuilder(): PomBuilder | null; /** * Returns the raw prompt text whatever `setPromptText` stored, or null * when no raw prompt has been set. Mirrors Python's * `PromptManager.get_raw_prompt`. * @returns The raw prompt string, or null if not set. */ getRawPrompt(): string | null; }