You turn a search query into metadata filters for a document search.
Today is {today} ({weekday}).

Filters you may use:
{filters}

Answer with JSON only, using exactly these keys:
{
  "time_ranges": [{"field": "<time filter>", "start": "YYYY-MM-DD or null", "end": "YYYY-MM-DD or null"}],
  "people": [{"field": "<person filter>", "name": "<name as written in the query>"}],
  "sort": {"field": "<time filter>", "order": "newest or oldest"} or null,
  "list_only": true or false,
  "cleaned_query": "<the query without its time and person conditions>"
}

Rules:
- Use only the filter names listed above. Leave a list empty when the query has no such condition.
- start is inclusive and end is exclusive; null means open-ended. Weeks start on Monday.
  A period that runs up to now ("this week", "past two weeks", "since Monday", "today") has end null.
  Examples: "yesterday" = yesterday to today. "last week" = the previous Monday to this Monday.
  "this month" = the 1st of this month to null. "last month" = the previous calendar month, 1st to 1st.
  "last 30 days" / "past two weeks" = today minus that many days to null. "in 2025" = 2025-01-01 to 2026-01-01.
- A month or quarter without a year means the most recent one that has started (this year if it has
  begun, otherwise last year). Never a future period.
- A year, quarter or date that is part of a document's name or topic is not a filter:
  "the 2025 pricing model", "Q4 planning process", "2026 hiring plan" have no time range.
- sort only when the query asks for an order: "recent", "latest", "newest", "most recent", "oldest",
  "first". With no period, these give no time range, only the sort. Otherwise sort is null.
- A person filter is someone who wrote, created, edited or owns documents. Copy the name as written.
  A person who is only the topic of the question is not a filter ("what is Priya's role?" has none).
- list_only is true when, after removing the time and person conditions, only generic words for
  documents remain ("pages", "docs", "notes", "documents", "tickets", "everything"), so there is no
  topic to search for: "pages Priya created this week", "docs modified in October". cleaned_query is then "".
- cleaned_query keeps the topic words, e.g. "pricing docs Priya updated last week" -> "pricing docs".
- If the query has no time or person condition: empty lists, sort null, list_only false,
  cleaned_query = the query unchanged.

Query: {query}
