Expand description
The query_syntax texts (spec/surface/README.md §4; 5.1): the manual
(QUERY_SYNTAX, { section: "all" }), its chapters
(query_syntax_section, one per ## heading of
QUERY_SYNTAX_SECTIONS) and the card (QUERY_SYNTAX_CARD, what {}
returns). A condensed distillation of docs/query-language.md. Byte for
byte the reference’s packages/core/src/mcp/reference.ts — tests below
compare every text with it when the monorepo is present, and others parse
every example the texts show.
Constants§
- QUERY_
SYNTAX - The agent-facing OQX syntax reference the
query_syntaxtool returns for{ section: "all" }(and for{}through 5.0). - QUERY_
SYNTAX_ CARD - The card
query_syntax {}returns (5.1): the grammar skeleton, the names rule and the engine names per kind, the handles, the consumers, follow in two lines, the examples agents reach for first, the chapter names. Byte for byte the reference’sQUERY_SYNTAX_CARD(a test below compares the two). - QUERY_
SYNTAX_ SECTIONS - The manual’s chapters (
spec/surface§4query_syntax, 5.1): one(slug, heading)per##heading ofQUERY_SYNTAX, in order — thesectionargument’s names. Byte for byte the reference’sQUERY_SYNTAX_SECTIONS(a test below checks every pair against its source). - QUERY_
SYNTAX_ SECTION_ NAMES - The
sectionnames a caller may pass: every slug, thenall(the whole manual).
Functions§
- query_
syntax_ section - One chapter of the manual (5.1): the lines from
## <heading>up to (not including) the next##heading or the end, trailing blank lines dropped, one trailing newline."all"is the whole manual; an unknown slug isNone. The reference’squerySyntaxSection, rule for rule.