"""prompt_builder: Token-aware prompt compilation framework.

Usage:
    from prompt_builder import Prompt, Instruction, TokenBudget, compile

    prompt = Prompt(
        instruction=Instruction(task="Classify this ticket."),
    )
    result = compile(prompt, TokenBudget(context_window=128_000))
    print(result.messages)
    print(result.report())
"""

from .types import (
    # Enums
    CoTStrategy,
    RulePriority,
    Scope,
    Section,
    TruncationStrategy,
    Visibility,
    # Models
    CompilationResult,
    ContextBlock,
    CoTSpec,
    Example,
    InputData,
    Instruction,
    Message,
    OutputSpec,
    Persona,
    PriorityEntry,
    PriorityMap,
    Prompt,
    Rule,
    SectionReport,
    TokenBudget,
    WhenScope,
)
from .tokens import TokenCounter, get_counter
from .compiler import Compiler, compile
from .renderer import (
    render_persona,
    render_rules,
    render_output_spec,
    render_cot,
    render_context_blocks,
    render_examples,
    render_instruction,
    render_input_data,
)
from .loader import load, loads

__version__ = "0.1.0"

__all__ = [
    # Core function
    "compile",
    # Types
    "Prompt",
    "Instruction",
    "Persona",
    "Rule",
    "ContextBlock",
    "Example",
    "InputData",
    "OutputSpec",
    "CoTSpec",
    "Message",
    "TokenBudget",
    "PriorityMap",
    "PriorityEntry",
    "CompilationResult",
    "SectionReport",
    "WhenScope",
    # Enums
    "Section",
    "TruncationStrategy",
    "CoTStrategy",
    "Visibility",
    "Scope",
    "RulePriority",
    # Classes
    "Compiler",
    "TokenCounter",
    # Functions
    "get_counter",
    "load",
    "loads",
    # Renderers
    "render_persona",
    "render_rules",
    "render_output_spec",
    "render_cot",
    "render_context_blocks",
    "render_examples",
    "render_instruction",
    "render_input_data",
]
