Tags
The Core and AI tags (SUPPORT_TIERS.md): every attribute the parser accepts — a test fails when this list and the parser differ. Experimental tags are on their own page.
Core
q:component
A page or a reusable component. A file of components/ is served at its path (ROUTE-1).
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Component name | ||
require_auth | boolean | false | Only an authenticated, unexpired session sees it (AUTH-1) | ||
require_role | string | Comma-separated roles, one of which session.userRole must have (AUTH-2) | |||
login_url | string | Where an unauthenticated visitor is sent; a local path (AUTH-4) | |||
require_permission | string | Required permission(s) | |||
interactive | boolean | false | Client-side hydration | ||
type | string | pure | Component type | ||
port | integer | Port |
<q:component name="Home">
<p>Hello</p>
</q:component>2
3
Specified by: AUTH-1 · AUTH-2 · AUTH-4 · PARSE-3 · ROUTE-1
q:param
A parameter of a component, function, action, query or tool, converted to type and checked against its rules (FN-1, ACT-2, DB-1)
Inside: q:function, q:query, q:invoke, q:action, q:tool
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Parameter name | ||
type | enum | string | string, text, number, integer, int, long, numeric, decimal, float, double, boolean, email, url, date, array, object, json, any, file, binary, upload, datetime, time | Type the value is converted to. datetime and time exist only for a q:query's param; in a q:query the type is one of string, integer, decimal, boolean, datetime, date, time, array, json (PARSE-5) | |
default | string | Value when none is given | |||
value | expression | The value bound (in a q:query, q:invoke) | |||
description | string | What it is (shown to the model in a q:tool) | |||
validate | string | email, url, phone, cep, cpf, cnpj, uuid, creditcard, ipv4, ipv6 | A named validator, or a regular expression starting with ^ | ||
accept | string | Accepted uploads: image/*, .pdf, application/pdf (ACT-11) | |||
maxsize | string | Largest upload: 500KB, 5MB, 1GB (FILE-1) | |||
maxLength | integer | Longest text bound to a query (DB-1) | |||
scale | integer | Decimal places a query value is rounded to (DB-1) | |||
null | boolean | Bind an empty value as NULL (q:query) | |||
source | string | Where the value comes from | |||
required | boolean | false | The value must be given and not empty | ||
min | decimal | Smallest number accepted | |||
max | decimal | Largest number accepted | |||
minlength | integer | Shortest text accepted | |||
maxlength | integer | Longest text accepted | |||
pattern | regex | Regular expression the text must match | |||
enum | string | Comma-separated list of the values accepted | |||
range | string | Inclusive range, e.g. 1..10 |
<q:param name="age" type="integer" required="true" min="18" />Specified by: ACT-2 · ACT-6 · ACT-11 · DB-1 · ERR-1 · FILE-1 · FN-1 · IA-4 · INV-1 · PARSE-3 · PARSE-5 · SVC-3 · TEST-3 · UI-6 · UI-9 · UI-10 · UI-14
q:return
Ends the component or function with a value (RET-1, RET-2)
Inside: q:function
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
value | expression | The value; exactly one expression keeps its type | |||
name | string | Name of the returned value | |||
type | string | Type of the returned value | |||
description | string | What it is |
Specified by: LOOP-1 · LOOP-2 · LOOP-3 · RET-1 · RET-2 · RET-3 · SET-5
q:set
Stores a variable, converted to type, checked and changed by operation (ERR-1, SET-1, SET-3, SET-4)
Inside: q:action
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Variable name (session.x, application.x for the scopes) | ||
value | expression | The value | |||
type | enum | string, number, integer, decimal, boolean, array, object, json, text, int, long, numeric, float, double | Type the value is converted to (ERR-1); without it, a value that is one expression keeps its type (SET-5) | ||
default | string | Stored when value resolves to nothing (SET-1) | |||
operation | enum | assign | assign, increment, decrement, add, multiply, append, prepend, remove, removeAt, clear, sort, reverse, unique, merge, setProperty, deleteProperty, clone, uppercase, lowercase, trim, format | What to do with the variable (SET-3) | |
step | integer | 1 | Step of increment/decrement | ||
index | integer | Position for removeAt | |||
key | string | Key for setProperty/deleteProperty | |||
source | string | Variable clone copies | |||
scope | enum | local | local, function, component, session, application, request | Where the variable lives | |
nullable | boolean | true | false: a null value is an error | ||
validate | string | email, url, phone, cep, cpf, cnpj, uuid, creditcard, ipv4, ipv6 | A named validator, or a regular expression starting with ^ (SET-4) | ||
required | boolean | false | The value must be given and not empty | ||
min | decimal | Smallest number accepted | |||
max | decimal | Largest number accepted | |||
minlength | integer | Shortest text accepted | |||
maxlength | integer | Longest text accepted | |||
pattern | regex | Regular expression the text must match | |||
enum | string | Comma-separated list of the values accepted | |||
range | string | Inclusive range, e.g. 1..10 |
<q:set name="total" value="{price * qty}" type="number" />Specified by: ACT-8 · ERR-1 · EXEC-1 · LOOP-6 · PARSE-1 · PARSE-2 · PARSE-3 · PARSE-5 · SET-1 · SET-2 · SET-3 · SET-4 · SET-5 · UI-8
q:if
Runs its body when the condition is true (IF-1..IF-4)
Inside: q:action
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
condition | expression | yes | An expression; a missing name makes it false (EXPR-5) |
Contains: q:elseif, q:else
Specified by: AUTH-6 · DATA-3 · EXEC-1 · EXPR-3 · EXPR-5 · IF-1 · IF-3 · IF-4 · RET-3 · UI-1 · UI-3
q:loop
Repeats its body (LOOP-1..LOOP-5)
Inside: q:action
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
type | enum | range, array, list, query | Loop type; inferred when missing | ||
var | string | The loop variable | |||
from | expression | First number (range) | |||
to | expression | Last number, included (range) | |||
step | integer | 1 | Step (range) | ||
items | expression | The list (array) or text (list) | |||
index | string | Name of the position variable, from 0 | |||
delimiter | string | , | Separator of a list loop | ||
query | string | Name of the query to loop over (LOOP-4) |
Specified by: ACT-8 · DEV-3 · EXEC-1 · IF-1 · IF-3 · LOOP-1 · LOOP-2 · LOOP-4 · LOOP-5 · PARSE-2 · PARSE-5 · UI-1 · UI-3 · UI-5
q:function
A function the component's expressions can call (FN-1..FN-4)
Inside: q:tool
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Function name | ||
returnType | enum | any | any, void, string, text, number, integer, int, long, numeric, decimal, float, double, boolean, email, url, array, object, json | Type the returned value is converted to (FN-4) | |
description | string | What it does | |||
hint | string | A hint for readers |
Contains: q:param, q:return
Specified by: ACT-7 · ACT-10 · EXEC-1 · FN-1 · FN-2 · FN-3 · FN-4 · IF-1 · UI-8
q:query
Runs SQL on a declared datasource, binding :name to q:param (DB-1..DB-5, DB-9, UI-13)
Inside: q:transaction, q:action
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | Result variable (<name>, <name>_result) | |||
datasource | string | Datasource declared in quantum.config.yaml, or knowledge:<name> (IA-3) | |||
source | string | Query of queries: an earlier query's name (DB-3) | |||
result | string | Another name for <name>_result | |||
paginate | boolean | false | Return one page (DB-2) | ||
page | expression | Page number, an expression (DB-9) | |||
pageSize | integer | Rows per page | |||
page_size | integer | Rows per page | |||
sortable | boolean | false | Sort by the URL's ?sort=/&dir= (UI-13) | ||
onerror | enum | fail | fail, continue | fail stops the page with the error; continue hands it to <name>_result (INV-2, IA-5) |
Contains: q:param
Specified by: ACT-4 · DB-1 · DB-2 · DB-3 · DB-5 · DB-9 · DB-11 · DEV-3 · EXEC-1 · IA-3 · IA-5 · INV-2 · PARSE-2 · PARSE-5 · UI-5 · UI-13
q:transaction
Its queries commit together or roll back together (DB-4)
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
datasource | string | Datasource of the queries that declare none | |||
isolationLevel | enum | READ_COMMITTED | READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ, SERIALIZABLE | Isolation level | |
isolation | enum | READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ, SERIALIZABLE | Isolation level (same as isolationLevel) |
Contains: q:query
Specified by: DB-4
q:invoke
Calls a URL, a declared service or a function (INV-1, INV-2, SVC-3)
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Result variable | ||
url | url | URL to request | |||
service | string | Name registered with @service (SVC-3) | |||
function | string | Function to call | |||
component | string | Component to call | |||
method | enum | GET | GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS | HTTP method | |
timeout | integer | 30 | Seconds to wait | ||
contentType | string | application/json | Type of the body | ||
authType | enum | bearer, apikey, basic | Authentication | ||
authToken | string | Token for bearer/apikey | |||
authHeader | string | Header for apikey | |||
authUsername | string | User for basic | |||
authPassword | string | Password for basic | |||
retry | integer | 0 | More attempts when it times out or cannot connect | ||
retryDelay | integer | 1000 | Milliseconds between attempts | ||
responseFormat | string | auto | How to read the response | ||
cache | boolean | Cache the response | |||
ttl | integer | Cache seconds | |||
result | string | Another name for <name>_result | |||
onerror | enum | fail | fail, continue | fail stops the page with the error; continue hands it to <name>_result (INV-2, IA-5) |
Contains: q:param, q:header, q:body
Specified by: EXEC-1 · IA-5 · INV-1 · INV-2 · PARSE-2 · PARSE-3 · PARSE-5 · RUN-2 · SVC-3
q:data
Imports CSV, JSON or XML as a list of records (DATA-1..DATA-4)
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Result variable | ||
source | string | yes | File or URL | ||
type | enum | csv | csv, json, xml | Format | |
delimiter | string | , | CSV separator | ||
quote | string | " | CSV quote character | ||
header | boolean | true | The first CSV line is the header | ||
encoding | string | utf-8 | Encoding of the file or response | ||
skip_rows | integer | 0 | Lines to skip before the header | ||
xpath | string | XPath of the records (xml) | |||
namespace | string | XML namespace | |||
cache | boolean | true | Cache the import | ||
ttl | integer | Cache seconds | |||
result | string | Another name for <name>_result | |||
onerror | enum | fail | fail, continue | fail stops the page with the error; continue hands it to <name>_result (INV-2, IA-5) |
Contains: q:column, q:field, q:transform, q:header
Specified by: DATA-1 · DATA-2 · DATA-4 · IA-5 · INV-2
q:action
Runs on a POST with the action field; its q:params are the validated form fields (ACT-1..ACT-11)
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Action name | ||
method | enum | POST | POST, GET | HTTP method | |
table | string | Take the q:params from this table's schema (UI-10) | |||
datasource | string | Datasource of table | |||
columns | string | Only these columns, in this order (UI-10) |
Contains: q:param, q:set, q:query, q:if, q:loop, q:file, q:mail, q:flash, q:redirect
Specified by: ACT-1 · ACT-3 · ACT-4 · ACT-5 · ACT-6 · ACT-7 · ACT-8 · ACT-9 · ACT-10 · ACT-11 · AUTH-6 · AUTH-7 · DB-11 · DEV-1 · EXEC-2 · EXEC-3 · FN-1 · IF-1 · PARSE-2 · ROUTE-2 · TEST-3 · UI-1 · UI-10
q:redirect
Ends the action or page with a redirect (ACT-3, ACT-7)
Inside: q:action
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
url | expression | Where to | |||
to | expression | Where to (same as url) | |||
flash | expression | Message for the next page | |||
status | integer | 302 | HTTP status |
Specified by: ACT-3 · ACT-7 · AUTH-6 · EXEC-2 · EXPR-12
q:flash
Inside a q:action: a flash of another kind for the next page (ACT-3)
Inside: q:action
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
type | enum | info | info, success, warning, error | Kind | |
message | expression | The message (or the tag's text) |
Specified by: ACT-3
q:file
Saves an upload, sends a stored file or deletes one (FILE-1, FILE-2)
Inside: q:action
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
action | enum | yes | upload, send, delete | What to do | |
file | expression | yes | The upload, or the stored file's name | ||
destination | string | Folder inside paths.uploads | |||
nameConflict | enum | makeUnique | makeUnique, overwrite, skip, error | On a clash | |
name | string | File name the browser gets (send) | |||
result | string | Result variable |
q:mail
Sends a message through mail: in quantum.config.yaml (MAIL-1, MAIL-2)
Inside: q:action
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
to | expression | yes | Recipients | ||
subject | expression | yes | Subject | ||
from | string | Sender (else mail.from) | |||
cc | string | Copy | |||
bcc | string | Hidden copy | |||
replyTo | string | Reply address | |||
type | enum | html | html, text | Body format | |
body | expression | Body, when the tag has no content | |||
name | string | mail | Result name (<name>_result) | ||
onerror | enum | fail | fail, continue | fail stops the page with the error; continue hands it to <name>_result (INV-2, IA-5) |
Contains: q:attachment
Specified by: IA-5 · INV-2 · MAIL-1 · MAIL-2
q:import
Makes a component usable as <Name/> (COMP-1)
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
component | string | Component name | |||
from | string | Folder under paths.components | |||
as | string | Local name | |||
behavior | string | Game behavior (Laboratory) | |||
prefab | string | Game prefab (Laboratory) | |||
tilemap | string | Game tilemap (Laboratory) |
Specified by: COMP-1 · ROUTE-3
q:slot
Where the content between <Name> and </Name> goes (COMP-3)
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | Slot name |
Specified by: COMP-3
AI
q:llm
A model call; with knowledge=, an answer that cites its sources (IA-1, IA-5..IA-9)
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Result variable | ||
model | expression | Model, an expression; else QUANTUM_LLM_DEFAULT_MODEL / llm.model (IA-1) | |||
endpoint | expression | Another model server for this tag | |||
apiKey | expression | API key | |||
provider | enum | ollama, openai, anthropic, claude, lmstudio, auto | Provider | ||
temperature | decimal | Temperature | |||
maxTokens | integer | Most tokens to generate | |||
responseFormat | enum | text | text, json | json: the value is the parsed object | |
timeout | integer | 60 | Seconds to wait for the model | ||
knowledge | string | Answer from this q:knowledge, citing it (IA-6) | |||
top | integer | 4 | Chunks to retrieve | ||
minRelevance | decimal | 0 | Chunks below it are not retrieved, 0 to 1 (IA-9) | ||
stream | boolean | false | In a web request, the answer arrives as it is written (IA-7) | ||
cache | boolean | false | Cache the answer | ||
ttl | integer | Cache seconds | |||
onerror | enum | fail | fail, continue | fail stops the page with the error; continue hands it to <name>_result (INV-2, IA-5) |
Contains: q:prompt, q:message, q:system
<q:llm name="answer" model="phi3" knowledge="docs" minRelevance="0.79">
<q:message role="user">{question}</q:message>
</q:llm>2
3
Specified by: IA-1 · IA-2 · IA-3 · IA-5 · IA-6 · IA-7 · IA-8 · IA-9 · INV-2
q:knowledge
A base of text chunks that q:llm knowledge= answers from (IA-2, IA-6, IA-8)
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Base name | ||
embedModel | string | nomic-embed-text | Embedding model | ||
chunkSize | integer | 500 | Characters per chunk | ||
chunkOverlap | integer | 50 | Characters shared by neighbouring chunks | ||
persist | boolean | true | Keep the index on disk | ||
persistPath | string | ./.quantum/knowledge | Where | ||
rebuild | boolean | false | Index again | ||
onerror | enum | fail | fail, continue | fail stops the page with the error; continue hands it to <name>_result (INV-2, IA-5) |
Contains: q:source
Specified by: IA-2 · IA-5 · IA-6 · IA-8 · INV-2 · PARSE-3
q:agent
A model that uses the declared tools to do a task (IA-4, IA-5)
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Result variable | ||
model | expression | Model, an expression; else QUANTUM_LLM_DEFAULT_MODEL / llm.model (IA-1) | |||
endpoint | expression | Another model server | |||
apiKey | expression | API key | |||
provider | enum | auto | ollama, openai, anthropic, claude, lmstudio, auto | Provider | |
maxIterations | integer | 10 | Most reasoning steps | ||
timeout | integer | 60000 | Milliseconds for the whole run | ||
onerror | enum | fail | fail, continue | fail stops the page with the error; continue hands it to <name>_result (INV-2, IA-5) |
Contains: q:instruction, q:tool, q:execute
Specified by: DEV-3 · IA-1 · IA-4 · IA-5 · IA-8 · INV-2
Inside other tags
q:elseif
Another branch of the q:if before it
Inside: q:if
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
condition | expression | yes | An expression |
Specified by: IF-1 · IF-3 · IF-4
q:else
The branch when no condition was true
Inside: q:if
No attributes.
Specified by: IF-1 · IF-3 · IF-4
q:header
A header of a q:invoke or q:data request
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Header name | ||
value | expression | Header value |
Specified by: INV-1
q:body
The body of a q:invoke request (with expressions)
Inside: q:invoke
No attributes.
Specified by: INV-1
q:column
A CSV column converted to type (DATA-1)
Inside: q:data
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Column name | ||
type | enum | string | string, integer, decimal, boolean, json, array | Type |
Specified by: DATA-1 · PARSE-3
q:field
A field of a JSON/XML record (DATA-2)
Inside: q:data
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Field name | ||
xpath | string | Path relative to the record | |||
path | string | Path relative to the record | |||
type | string | Type |
Specified by: DATA-2
q:transform
Operations applied in order (DATA-3)
Inside: q:data
No attributes.
Contains: q:filter, q:sort, q:limit, q:compute
Specified by: DATA-3
q:filter
Keeps the records for which the condition is true
Inside: q:transform
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
condition | expression | yes | An expression over the record's fields |
Specified by: DATA-3
q:sort
Sorts the records
Inside: q:transform
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
by | string | yes | Field | ||
order | enum | asc | asc, desc | Order |
Specified by: DATA-3
q:limit
Keeps the first records
Inside: q:transform
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
value | integer | yes | How many |
Specified by: DATA-3
q:compute
Adds a computed field
Inside: q:transform
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
field | string | yes | New field | ||
expression | expression | yes | Its value | ||
type | string | Type |
Specified by: DATA-3
q:attachment
A file attached to a q:mail
Inside: q:mail
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
file | string | yes | Path of the file |
q:script
Client-side JavaScript of the page
No attributes.
Specified by: PARSE-1
q:prompt
The prompt of a q:llm (with expressions)
Inside: q:llm
No attributes.
q:system
The system message of a q:llm
Inside: q:llm
No attributes.
q:message
A chat message of a q:llm
Inside: q:llm
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
role | enum | user | system, user, assistant | Who says it |
q:source
A source of a q:knowledge, read whole (IA-8)
Inside: q:knowledge
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
type | enum | yes | text, file, directory, query | Kind | |
path | string | File or folder | |||
pattern | string | Files of the folder, e.g. *.md | |||
datasource | string | Datasource of a query source | |||
chunkSize | integer | Characters per chunk for this source | |||
chunkOverlap | integer | Overlap for this source |
Specified by: IA-8
q:instruction
The agent's instruction
Inside: q:agent
No attributes.
q:tool
A tool the agent can call; its body runs with the arguments as variables
Inside: q:agent
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
name | string | yes | Tool name | ||
description | string | What it does (shown to the model) | |||
builtin | boolean | false | A built-in tool (q:team) |
Contains: q:param, q:function
q:execute
The agent's task
Inside: q:agent
| Attribute | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
task | expression | yes | The task | ||
context | expression | Extra text for the model | |||
entry | string | First agent (q:team) |
Specified by: IA-4