/**
 * System Prompt Builder
 *
 * OpenClaw-inspired dynamic system prompt assembly.
 *
 * Dynamically merges:
 * - Base system instructions
 * - Available tools description
 * - Active skills
 * - Relevant memories
 * - Session context
 * - Operating mode constraints
 * - User preferences
 *
 * The builder produces context-aware system prompts that adapt to
 * the current session state, available capabilities, and user needs.
 *
 * Usage:
 * ```typescript
 * const builder = new SystemPromptBuilder();
 *
 * const prompt = builder
 *   .withBaseInstructions('You are Code Buddy...')
 *   .withTools(availableTools)
 *   .withSkills(activeSkills)
 *   .withMemory(relevantMemories)
 *   .withMode('code')
 *   .withSkillContext(matchedSkill)
 *   .build();
 * ```
 */
import type { UnifiedSkill } from '../skills/types.js';
/**
 * A section of the system prompt
 */
export interface PromptSection {
    /** Section identifier */
    id: string;
    /** Section title (rendered as heading) */
    title: string;
    /** Section content */
    content: string;
    /** Priority (higher = appears earlier) */
    priority: number;
    /** Whether this section is required */
    required: boolean;
    /** Maximum token budget for this section */
    maxTokens?: number;
    /** Condition for including this section */
    condition?: () => boolean;
}
/**
 * Tool information for prompt
 */
export interface ToolInfo {
    name: string;
    description: string;
    category?: string;
}
/**
 * Skill information for prompt
 */
export interface SkillInfo {
    name: string;
    description: string;
    triggers: string[];
}
/**
 * Memory entry for prompt
 */
export interface MemoryEntry {
    key: string;
    value: string;
    category: string;
    relevance?: number;
}
/**
 * Operating mode constraints
 */
export type OperatingMode = 'plan' | 'code' | 'ask' | 'architect';
/**
 * Build configuration
 */
export interface PromptBuildConfig {
    /** Maximum total tokens for system prompt */
    maxTokens: number;
    /** Include tool descriptions */
    includeTools: boolean;
    /** Include skill descriptions */
    includeSkills: boolean;
    /** Include memory context */
    includeMemory: boolean;
    /** Include datetime context */
    includeDatetime: boolean;
    /** Include OS/platform context */
    includePlatform: boolean;
    /** Compact mode (shorter descriptions) */
    compact: boolean;
}
export declare class SystemPromptBuilder {
    private sections;
    private tools;
    private skills;
    private memories;
    private mode;
    private buildConfig;
    private customInstructions;
    private activeSkillContext;
    constructor(config?: Partial<PromptBuildConfig>);
    /**
     * Set base instructions
     */
    withBaseInstructions(instructions: string): this;
    /**
     * Set available tools
     */
    withTools(tools: ToolInfo[]): this;
    /**
     * Set active skills
     */
    withSkills(skills: SkillInfo[]): this;
    /**
     * Set relevant memories
     */
    withMemory(memories: MemoryEntry[]): this;
    /**
     * Set operating mode
     */
    withMode(mode: OperatingMode): this;
    /**
     * Add custom instructions
     */
    withCustomInstructions(instructions: string): this;
    /**
     * Add a custom section
     */
    withSection(section: Omit<PromptSection, 'required'> & {
        required?: boolean;
    }): this;
    /**
     * Inject context from a matched UnifiedSkill.
     *
     * When a skill is matched for the current query, this method adds the
     * skill's system prompt / description as a high-priority section so the
     * LLM receives skill-specific instructions.
     *
     * @param skill - The matched UnifiedSkill (or null to clear)
     */
    withSkillContext(skill: UnifiedSkill | null): this;
    /**
     * Set project context (from CLAUDE.md or similar)
     */
    withProjectContext(context: string): this;
    /**
     * Set user preferences
     */
    withUserPreferences(preferences: Record<string, string>): this;
    /**
     * Build the complete system prompt
     */
    build(): string;
    /**
     * Build and return sections (for inspection)
     */
    buildSections(): PromptSection[];
    /**
     * Build all dynamic sections based on current state
     */
    private buildDynamicSections;
    /**
     * Build tools description section
     */
    private buildToolsSection;
    /**
     * Build skills description section
     */
    private buildSkillsSection;
    /**
     * Build memory context section
     */
    private buildMemorySection;
    /**
     * Build active skill section from UnifiedSkill context
     */
    private buildActiveSkillSection;
    /**
     * Build operating mode constraints
     */
    private buildModeSection;
    /**
     * Add or replace a section
     */
    private addSection;
    /**
     * Format a section with title
     */
    private formatSection;
    /**
     * Estimate token count (rough: ~4 chars per token)
     */
    private estimateTokens;
    /**
     * Truncate text to fit within token budget
     */
    private truncateToTokens;
    /**
     * Reset builder state
     */
    reset(): this;
}
export default SystemPromptBuilder;
