Skip to main content

Module reference

Module reference 

Source
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_syntax tool 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’s QUERY_SYNTAX_CARD (a test below compares the two).
QUERY_SYNTAX_SECTIONS
The manual’s chapters (spec/surface §4 query_syntax, 5.1): one (slug, heading) per ## heading of QUERY_SYNTAX, in order — the section argument’s names. Byte for byte the reference’s QUERY_SYNTAX_SECTIONS (a test below checks every pair against its source).
QUERY_SYNTAX_SECTION_NAMES
The section names a caller may pass: every slug, then all (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 is None. The reference’s querySyntaxSection, rule for rule.