"""Prompts used by summary-mode fetch tools.

Kept separate from builder code so the wording can be tuned without
touching the wiring.  Both prompts share the same role-framing block —
small local models (qwen3, gpt-oss) calibrate measurably better when
told what's downstream of their output.
"""

# Role-framing block included by every summary prompt.
_ROLE = (
    "You are a content-extraction step inside a multi-step research agent.\n\n"
    "Your role in the pipeline:\n"
    "- The agent has already run web searches and decided this specific "
    "page is worth reading more carefully than its snippet allowed.\n"
    "- Your output is returned to the agent as a tool result. The agent — "
    "not you — will combine your output with other sources and write the "
    "final cited answer.\n"
    "- Therefore you are an extractor, NOT an answerer. Do not interpret, "
    "conclude, or compose. Just pull the relevant raw text out of the page."
)

# Output rules, identical for both variants.
_RULES = (
    "Output rules:\n"
    "- Output ONLY verbatim quotes from the page. Copy numbers, names, "
    "dates, and proper nouns exactly as written — never paraphrase facts.\n"
    "- One quote per line. No bullets, no numbering, no section headers.\n"
    "- Omit navigation, ads, cookie/subscription banners, related-article "
    "lists, author bios, comments, and anything off-topic.\n"
    "- If nothing on the page helps, reply with exactly: NOT RELEVANT\n"
    "- Do NOT include introductions ('Here is the relevant information:'), "
    "conclusions ('In summary...'), explanations of what you kept or "
    "skipped, or commentary on the source's quality, bias, or relevance.\n"
    "- Maximum 1500 characters. Quality over quantity — fewer precise "
    "quotes beat many borderline ones."
)


# Focus-only variant: the agent declares what it's looking for on this page.
SUMMARY_FOCUS_PROMPT = (
    f"{_ROLE}\n\n"
    "Why this page was fetched: {focus}\n\n"
    "Page title: {title}\n"
    "Page URL: {url}\n"
    "Page content:\n{content}\n\n"
    f"{_RULES}"
)


# Focus + overall-query variant: agent's focus PLUS the original research
# question, so the extractor can disambiguate vague focus phrasings
# ("publication year" vs "publication year of Liepmann's Prandtl-Ring award").
SUMMARY_FOCUS_QUERY_PROMPT = (
    f"{_ROLE}\n\n"
    "Overall research question: {overall_query}\n"
    "Why this page was fetched: {focus}\n\n"
    "Page title: {title}\n"
    "Page URL: {url}\n"
    "Page content:\n{content}\n\n"
    f"{_RULES}"
)
