"""Assistant personality prompts and intent helpers."""

from app.saas.personality import (
    build_meta_prompt,
    is_capability_question,
    is_identity_question,
)


def test_im_harry_not_capability():
    assert is_identity_question("who are you")
    assert is_capability_question("how can you help me")
    assert not is_capability_question("who are you")


def test_meta_prompt_includes_name_and_no_repeat():
    prompt = build_meta_prompt(
        agent_name="Alex",
        question="who are you",
        user_name="Harry",
        has_knowledge=True,
        has_statement=True,
        history="",
        already_spoke=True,
    )
    assert "Harry" in prompt
    assert "do not re-introduce" in prompt.lower() or "already chatted" in prompt.lower()


def test_capability_prompt_examples():
    prompt = build_meta_prompt(
        agent_name="Alex",
        question="how can you help me",
        user_name="Harry",
        has_knowledge=True,
        has_statement=True,
        history="",
        already_spoke=True,
    )
    assert "concrete examples" in prompt.lower() or "examples" in prompt.lower()
