Application declarations
Named sections consumed by the app routers and Rune-Web compiler.
@App¶
@AppSelect an application runtime and its serving or presentation configuration.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
type | string | REST | REST, GraphQL, MCP, STATIC, DYNAMIC-AI-WEB, PIXEL, PIXEL-3D, RUNE-DB or VECT-EVENT; dispatch is case-insensitive. |
transport | string | stdio (or http if port/host/endpoint set) | MCP: selects stdio JSON-RPC 2.0 or http Streamable HTTP transport; can be overridden by --transport. |
endpoint | string | /mcp | MCP: Streamable HTTP endpoint path when running in HTTP mode. |
instructions | string | — | MCP: optional server instructions returned in the initialize response. |
name | string | — | Application display metadata. |
port | number | 3000 | HTTP port; can be overridden by --port. |
host | string | 127.0.0.1 | HTTP bind address; can be overridden by --host. |
swagger | bool | false | REST: serve /openapi.json and /swagger-ui. |
version | string | 1.0.0 | Application version metadata used in OpenAPI info.version. |
default_auth | string | array | — | REST: default @Authentication scheme(s) applied to every route unless overridden with auth = none or auth = <Scheme>. |
cors | bool | array | false | REST: enable CORS for any origin (true) or a specific list of allowed origins. |
rate_limit | object | — | REST: global fixed-window rate limit {"requests": N, "window": seconds, "key": "ip"|"auth"|"global"|"header:<Name>"}. |
not_found_page | bool | true | REST: show the built-in 404 page to clients explicitly accepting HTML. Lists route templates, including authenticated routes. A custom @NotFound overrides this setting. |
scene | string | required for Pixel | Entry @Scene name for game apps. |
runtime | string | host-dependent | Selects game host behavior, including hybrid examples. |
resolution | [width, height] | required for Pixel | Pixel rendering resolution. |
tick_rate | number | 30 in Pixel 3D | Simulation ticks per second. |
shell | string | — | Optional Rune-Web @Page shell for Pixel 3D; must contain the game canvas. |
version | string | — | Application metadata; does not select a versioned docs path. |
source | datasource name | required for storage servers | For rune-db/vect-event, select the embedded provider to host. |
token_env | environment variable | unset | Storage server bearer token source; required for non-loopback binds. |
allow_origin | origin URL | disabled | One exact HTTP(S) browser origin for the storage protocol CORS adapter. |
allow_origins | JSON array of strings | disabled | Storage protocol CORS allowlist of exact HTTP(S) origins. Alternative to allow_origin; the two settings are mutually exclusive. |
@App
name = Example
type = REST
port = 3000Implementation: src/apps/mod.rs
@Ascii3D¶
@Ascii3D/<name>Optional raycasting augmentation for ASCII Animator (v0.3.12): textured grid walls, perspective floor/ceiling and depth-tested billboard entities.
Runtime: ASCII Animator native CLI only
Returns / effects
Draw {type: "ascii3d", scene: "name", x, y, width, height} in the canvas, followed by ordinary 2D HUD objects. Each view owns its depth buffer.
Errors / edge cases
Rejects unknown fields, invalid state data, nonrectangular/unknown-symbol maps, cameras in walls and missing sprite assets. At most four 3D views per canvas and 256 entities per view.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
map | array of ASCII rows | required | Rectangular 3-128 by 3-128 cell grid; '.' is empty. |
walls | object | required | Wall symbol to {texture: AsciiSprite name, color: Ink}; color defaults to white. |
camera | string | camera | Top-level camera state field. |
entities | string | things | Top-level entity array state field, including an empty array. |
fov | number | 65 | Horizontal field of view in degrees, 30-110. |
far | number | 32 | Visibility distance in map units, 2-96. |
cell_aspect | number | 2 | Terminal character height divided by width, 1-3. |
repeat_y | boolean | false | Repeat map rows endlessly along Y; does not replicate entities. |
floor | Ink | gray | Perspective floor checker-pattern color. |
ceiling | Ink | blue | Ceiling seam color. |
@Ascii3D/room
map = ["######", "#....#", "#....#", "######"]
walls = {"#": {"texture": "brick", "color": "cyan"}}
camera = camera
entities = thingsImplementation: src/apps/ascii_animator/ascii3d.rs · examples/ascii/sentinel.rune · examples/ascii/halls.rune · examples/ascii/descent.rune · knowledge/runtime/ascii3d.md
@AsciiAnimator¶
@AsciiAnimator/<name>Terminal-only ASCII canvas (v0.3.12) driven by shared @Logic initialize and tick actions.
Runtime: Native CLI only
Returns / effects
Ordered drawing commands from a declared state field render to terminal cells; no HTTP or browser host.
Errors / edge cases
Invalid sizes, frame rates, references, timers and reserved/unsupported key bindings fail explicitly.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
size | [integer, integer] | required | Required [columns, rows] integers: 1-240 by 1-80. |
fps | integer | 20 | Integer simulation rate 1-60; default 20. |
logic | string | required | Required @Logic name; initialize and tick actions are required. |
canvas | string | canvas | Declared state field containing drawing objects; default canvas. |
spatial | string | unset | Optional non-repeating Ascii3D scene binding for shared slide/sees helpers. |
command | string | unset | Optional one-parameter action for typed command input. No key bindings in this mode; Enter submits normalized lowercase text, Backspace edits, Ctrl-U clears, Esc/Ctrl-C exits. Plain --commands repeats once per tick. |
@App
type = ascii-animator
scene = demo
@AsciiAnimator/demo
size = [72, 22]
fps = 20
logic = demo
canvas = canvasImplementation: src/apps/ascii_animator.rs · src/cli/ascii.rs · examples/ascii/README.md · knowledge/runtime/ascii-animator.md
@AsciiMusic¶
@AsciiMusic/<name>Define a native terminal synth score using Rune-Web music notation.
Runtime: ASCII Animator native CLI only; unreleased prototype
Returns / effects
Named score controlled with music "name", music.pause, music.resume and music.stop.
Errors / edge cases
Invalid metadata, notes and names fail explicitly. Effects and arrangements are unsupported. Limits: 32 scores, eight channels, 4096 events and 64 KiB per score.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
type | string | 8bit | 8bit, chiptune or synth; style alias. |
tempo | number | 128 | BPM 21-399; bpm alias. |
time_signature | string | 4/4 | 4/4 or 3/4; meter alias. |
bars | integer | inferred | Optional 1-64 bars; measures alias. |
loop | boolean | true | Repeat the score; loop_track alias. |
volume | number | 0.2 | Score volume 0-0.5. |
lead | note string or series | none | Lead score; melody alias. |
bass | note string or series | none | Bass score. |
drums | note string or series | none | Drum score; percussion alias. |
instruments | object | channel defaults | Map standard/custom channels to shared synth instrument names. Other named string/series fields define up to five custom tracks. |
@AsciiMusic/haunted
tempo = 100
volume = 0.07
lead:
D4:4 F4:4 A4:4 D4:4
bass:
D2:2 -:2Implementation: src/apps/ascii_animator/music.rs · runtime/rune-web/src/ascii_audio.ts · examples/ascii/games/clockwork/forest.rune
@AsciiSprite¶
@AsciiSprite/<name>Define reusable animated printable-ASCII sprite frames for ASCII Animator.
Runtime: ASCII Animator native CLI only
Returns / effects
Named sprite frames; inline spaces and GIF alpha cells are transparent. Canvas sprite objects select color and position.
Errors / edge cases
Frames require 1-120 arrays, each with 1-80 printable ASCII rows of at most 240 characters. GIF source errors include missing/corrupt files, size limits and incompatible frames/fps fields.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
frames | array of row arrays | required unless source | Array of frames; each frame is an array of quoted ASCII rows. Cannot combine with source. |
fps | integer | 8 | Integer inline sprite frame rate 1-60; cannot combine with source. |
source | string | none | Unreleased: file-relative GIF asset decoded once at startup; cannot combine with frames/fps. |
width | integer | 16 | Unreleased: GIF source terminal width 1-240; requires source. |
invert | boolean | false | Unreleased: reverse the GIF brightness ramp; requires source. |
@AsciiSprite/fish
fps = 3
frames = [["><(((o>"], ["><((o>"]]Implementation: src/apps/ascii_animator.rs · examples/ascii/aquarium.rune
@AsciiTone¶
@AsciiTone/<name>Define a short native synth cue for ASCII Animator actions.
Runtime: ASCII Animator native CLI only
Returns / effects
sound "name" schedules a nonblocking cue through the shared native PCM mixer.
Errors / edge cases
Unknown fields, names, waveforms and out-of-range numbers fail explicitly. Maximum 64 declared tones and 32 emitted cues per action invocation.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
frequency | number | required | Starting frequency, 20-8000 Hz. |
end_frequency | number | frequency | Optional linear sweep endpoint, 20-8000 Hz. |
duration | number | 0.1 | Duration in seconds, 0.01-1. |
volume | number | 0.15 | Amplitude, 0-0.5; short attack/release are automatic. |
wave | string | sine | sine, square, triangle, sawtooth or noise. |
@AsciiTone/shot
frequency = 1000
end_frequency = 160
duration = 0.07
wave = square
volume = 0.12Implementation: src/apps/ascii_animator.rs · src/apps/pixel/native_audio.rs · examples/ascii/sentinel.rune · knowledge/runtime/ascii-animator.md
@Authentication¶
@Authentication/<name>Configure REST authentication schemes (JWT, OAuth2/OIDC, API Key, HTTP Basic, Opaque Bearer, HMAC-SHA256 webhooks, and Signed Session Cookies) with RBAC roles and scopes.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
type | string | jwt | Authentication scheme type: jwt, oauth2, api_key, basic, bearer, hmac, or cookie. |
algorithm | string | HS256 | JWT signing/verification algorithm: HS256, HS384, HS512, RS256, or ES256. |
secret | string | empty | Shared secret for HS* JWT, HMAC-SHA256 webhook verification, or signed session cookies. |
public_key | string | — | PEM public key for RS256/ES256 JWT verification. |
jwks_url | url | — | OIDC/OAuth2 JWKS endpoint for dynamic public key verification with caching. |
issuer | string | — | Expected JWT/OAuth2 iss claim. |
audience | string | — | Expected JWT/OAuth2 aud claim. |
introspection_url | url | — | OAuth 2.0 RFC 7662 token introspection endpoint. |
header | string | X-API-Key | HTTP header name for api_key or hmac signature extraction. |
query | string | — | Optional query parameter name for api_key extraction. |
realm | string | Vectrune API | WWW-Authenticate realm for HTTP Basic authentication. |
cookie_name | string | vectrune_session | Cookie name for session cookie authentication. |
token_endpoint | path | — | Optional POST endpoint issuing signed JWTs from configured users. |
users / keys / tokens | series | — | JSON credential rows specifying username/password (or sha256:), API keys, or bearer/OAuth2/cookie tokens with roles and scopes. |
@Authentication/JWTAuth
type = jwt
algorithm = HS256
secret = "change-me"
issuer = "api.example.com"
audience = "clients"
token_endpoint = "/auth/token"Implementation: src/apps/rest/auth.rs · src/apps/rest/mod.rs
@BackgroundJob¶
@BackgroundJob/name; mode = once | interval; interval_ms = N; on_failure = stop | continue; run:Run a restricted supervised job alongside a native REST or GraphQL server.
Runtime: Experimental native REST and GraphQL CLI servers
Returns / effects
Once runs once; interval runs immediately and waits a fixed delay after each completion.
Errors / edge cases
Invalid configuration or unsupported steps fail startup. Failure stops the service by default; continue reports the error and permanently stops that job.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
mode | once | interval | required | Explicit scheduling mode. |
interval_ms | integer | required for interval | Delay from 1 to 86400000 ms after a completed run. |
on_failure | stop | continue | stop | Stop the service or report the error and disable the failed job. |
@BackgroundJob/heartbeat
mode = interval
interval_ms = 5000
run:
log "Heartbeat"Implementation: src/background_jobs/mod.rs · src/core/strict_steps.rs · examples/api/background_jobs.rune · tests/background_jobs.rs
@BackgroundJob receiver¶
@BackgroundJob/name; mode = receiver; onreceive(event):Process queued events with ordinary Rune steps in a native REST app.
Runtime: Experimental native REST CLI
Returns / effects
background.name queue event returns a UUID. background.name status id returns the current status and any retained receipt.
Errors / edge cases
Unknown commands and surfaced handler errors fail work. Queue operations return 503 for full or closed queues, 413 for oversized input, 400 for invalid IDs, and 404 for unknown or evicted IDs.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
capacity | integer | 1000 | Waiting events, from 1 to 10000. |
completed_retention | integer | 1000 | Completed statuses retained, from 1 to 10000. |
max_input_bytes | integer | 1048576 | Serialized JSON input limit from 1 to 8388608 bytes. |
@BackgroundJob/audit
mode = receiver
onreceive(event):
log "Received {event.id}"Implementation: src/background_jobs/receivers.rs · src/background_jobs/queue.rs · examples/api/kafka_orders.rune · tests/kafka_receivers.rs
@Component¶
@Component/<name>Declare a reusable frontend view with local scope.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
props | list | — | Expected property names. |
state | block | — | Component-local state. |
bindings | block | — | Selection and state bindings. |
view | view tree | — | Component markup. |
Implementation: src/apps/rune_web/parser.rs
@Content¶
@Content[/name]Supply descriptive content to the AI generation context.
Runtime: Declaration compiler / host-specific
Implementation: src/apps/dynamic_ai_web/mod.rs
@Data¶
@Data[/name]Supply structured records to generated pages and API responses.
Runtime: Declaration compiler / host-specific
Implementation: src/apps/dynamic_ai_web/mod.rs
@DataSource¶
@DataSource/<name>Declare a named SQL, embedded Rune DB, event stream or remote storage provider.
Runtime: Declaration compiler / host-specific
Aliases: @Datasource
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
type | string | required | mysql, postgres, rune-db or vect-event. |
connection | string | SQL adapters only | MySQL/Postgres connection string; not required by rune-db or vect-event. |
mode | string | embedded | embedded or remote for storage providers. |
database | string | source name | Browser database name and default native filename stem. |
native_path | path | .vectrune/data/<database>.rdb | Native file, relative to the declaring source file. |
store | source name | required for embedded vect-event | rune-db provider whose transactions hold the event log. |
endpoint | URL | required for remote | Storage server base URL; one versioned HTTP operation protocol. |
token_env | environment variable | unset | Native bearer token source; never exported to the browser. |
@DataSource/main
type = rune-db
native_path = .vectrune/notes.rdb
@DataSource/activity
type = vect-event
store = mainImplementation: src/builtins/builtin/data_source.rs · src/storage/provider.rs · runtime/rune-web/src/datasource.ts
@Event¶
@Event/<socket-path>/<type>Handle a structured WebSocket message selected by its JSON type property.
Runtime: Declaration compiler / host-specific
Implementation: src/apps/rest/ws.rs
@Frontend¶
@FrontendMount a static or Rune-Web frontend through REST hosting.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
type | string | — | static or rune-web. |
src | path | — | Static source directory. |
path | path | / | Frontend mount path; %ROOT% denotes root. |
page | string | — | Entry @Page for Rune-Web. |
locale | string | — | Default locale bundle. |
locale_paths | object | — | Locale-to-path-prefix map. |
Implementation: src/apps/rest/mod.rs
@GraphQL¶
@GraphQL/Query[/Type] | @GraphQL/Mutation[/Type]Declare named resolver step series with typed arguments.
Runtime: Declaration compiler / host-specific
@GraphQL/Query/Greeting
greeting:
result = { message: "Hello" }
return resultImplementation: src/apps/graphql/mod.rs
@Hook¶
@Hook/<name>Declare memory observer metadata parsed by the hook infrastructure.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
target | string | required | Memory key observed by this hook. |
observer | string | websocket | Observer transport parsed by hook infrastructure. |
channel | string | — | WebSocket channel configuration. |
endpoint | string | — | WebSocket endpoint configuration. |
webhook_url | string | — | Poll/webhook observer URL configuration. |
run | series | — | Optional custom logic steps. |
Implementation: src/memory/hook_parser.rs
@I18N¶
@I18N/<locale>[/namespace]Declare translation data resolved by %i18n.path% or frontend interpolation, including hyphenated key segments.
Runtime: Declaration compiler / host-specific
Implementation: src/apps/rune_web/parser.rs
@Logic¶
@Logic/<name>Declare reactive state and actions for a frontend or game scene.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
state | block | — | Initial reactive state. |
action | declarations | — | Named action bodies with optional parameters. |
locals | block | — | Template-local values not exported as public state. |
derived | block | — | Derived values evaluated from state using match definitions. |
helper | declarations | — | Pure helper expressions with named parameters. |
timer | declaration | — | Periodic action ticker such as tick 40ms. |
keys | block | — | Keyboard key/code to action mapping. |
Implementation: src/apps/rune_web/parser.rs · src/rune_parser.rs · tests/logic_continuation.rs
@MCP/Prompt¶
@MCP/Prompt/<name>Declare a reusable MCP prompt template in an @App type = MCP server.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
description | string | — | Optional prompt description. |
params | series | — | Prompt argument declarations (`name: string "desc"`, `name?: string "desc"`). |
run | series | required | Executable step block for prompts/get. |
@MCP/Prompt/summarize
description = "Summarize notes"
params:
topic: string "Topic"
run:
respond 200 "Summarize notes about {topic}"Implementation: src/apps/mcp/mod.rs
@MCP/Resource¶
@MCP/Resource/<name>Declare a static MCP resource or URI template (when uri contains {param} placeholders) in an @App type = MCP server.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
uri | string | required | Resource URI or URI template. |
name | string | section name | Display name returned in resources/list or resources/templates/list. |
description | string | — | Optional resource description. |
mime_type | string | text/plain | MIME type returned in resource metadata and contents. |
run | series | required | Executable step block for resources/read. |
@MCP/Resource/note_item
uri = "notes://item/{id}"
name = "Note by ID"
mime_type = "application/json"
run:
notes = memory.get "notes"
note = notes.find it.id == id
return noteImplementation: src/apps/mcp/mod.rs
@MCP/Tool¶
@MCP/Tool/<name>Declare an executable Model Context Protocol (MCP) tool in an @App type = MCP server.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
description | string | "" | Tool description exposed in tools/list. |
title | string | — | Optional human-readable display title. |
input | string | — | Optional @Schema name used to derive JSON Schema input properties. |
params | series | — | Inline parameter declarations such as `query: string "Search text"` or `limit?: integer "Max items"`. |
input_schema | object | — | Explicit JSON Schema object overriding generated inputSchema. |
read_only | bool | — | Sets MCP annotations.readOnlyHint. |
destructive | bool | — | Sets MCP annotations.destructiveHint. |
idempotent | bool | — | Sets MCP annotations.idempotentHint. |
open_world | bool | — | Sets MCP annotations.openWorldHint. |
roles | array | [] | Required caller roles when HTTP @Authentication is configured. |
scopes | array | [] | Required caller scopes when HTTP @Authentication is configured. |
run | series | required | Executable step block for tools/call. |
@MCP/Tool/get_note
description = "Fetch a note by ID"
read_only = true
params:
id: integer "Numeric note ID"
run:
notes = memory.get "notes"
note = notes.find it.id == id
return noteImplementation: src/apps/mcp/mod.rs
@Memory¶
@Memory[/key]Seed shared state from section properties or records.
Runtime: Declaration compiler / host-specific
Implementation: src/core/mod.rs
@Module¶
@Module/<name>; @Logic modules = {"alias":"name"}Namespaced subsystem state with explicit action/helper exports and isolated execution scope.
Runtime: Shared Rune-Web: browser pages, Pixel/Pixel-3D and embedded logic tests; source builds
Returns / effects
An independent nested state record per alias; exported func helpers return expression values.
Errors / edge cases
Unknown definitions/exports, conflicting names and aliases, private calls, undeclared scoped assignments and outside module mutations raise errors.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
exports | array of member names | [] | Public action/func names; unlisted members are private. |
modules | object on @Logic | {} | Alias to @Module name; each alias owns separate state. |
@Module/Wallet
exports = ["earn"]
state:
pearls = 30
action earn(amount):
pearls += amount
@Logic/game
modules = {"wallet":"Wallet"}
action reward:
call wallet.earn 10Implementation: src/apps/rune_web/modular.rs · runtime/rune-web/src/modular.ts · knowledge/language/logic-modules.md · examples/rune-web/modules/modules.rune
@NotFound¶
@NotFoundOverride unmatched REST requests with native run steps.
Runtime: Declaration compiler / host-specific
Returns / effects
The status and body produced by run; defaults to the standard executor response if no respond is executed.
Errors / edge cases
Missing or empty run, or an invalid content_type, yields HTTP 500.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
run | series | required | Native request steps; use respond for the desired status and body. |
content_type | string | text/plain; charset=utf-8 | Response Content-Type, for example text/html; charset=utf-8. |
@NotFound
content_type = text/html; charset=utf-8
run:
respond 404 "<h1>Not found</h1>"Implementation: src/apps/rest/mod.rs · src/core/mod.rs
@Optimizer¶
@OptimizerSplit named route views into lazy-loadable JSON chunks.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
dynamic_xhr | string | off | on, auto, lazy, or off. |
pre_load | bool | false | Background route preload. |
chunk_path | path | /assets/routes | Public chunk URL prefix. |
Implementation: src/apps/rune_web/optimizer.rs
@Page¶
@Page/<name>Declare a Rune-Web page, or a descriptive generated page in a dynamic AI app.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
view | view tree | — | Indented frontend elements and components. |
style | string | — | Named @Style. |
logic | string | — | Named @Logic. |
on_mount | action name | — | Existing action invoked once after initial browser rendering, never during server rendering or export. |
title | string | — | Page title metadata. |
description | string | — | Page description metadata. |
state | block | — | Initial page-local state. |
Implementation: src/apps/rune_web/parser.rs
@Route¶
@Route/<METHOD> /pathDefine an HTTP endpoint and its executable steps.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
run | series | — | Ordered native request steps. |
expect | schema name | — | POST/PUT/PATCH OpenAPI request body metadata; does not run validation. |
description | string | empty | Description in generated OpenAPI. |
auth | string | array | — | Named @Authentication scheme, array of schemes for OR fallback, or none to bypass @App default_auth. |
roles | array | — | Required roles (caller must hold at least one role or receive 403 Forbidden). |
scopes | array | — | Required scopes (caller must hold every listed scope or receive 403 Forbidden). |
rate_limit | object | string | — | Per-route rate limit override {"requests": N, "window": seconds, "key": ...} or none to exempt from global rate_limit. |
schema | string | — | Schema used by generated data-source CRUD handlers. |
data_source | string | — | Configured data source for generated handlers. |
@Route/GET /health
run:
respond 200 "OK"Implementation: src/apps/rest/mod.rs
@Schema¶
@Schema/<name>Declare object fields for validation, generated API schemas, and GraphQL types.
Runtime: Declaration compiler / host-specific
@Schema/User
name = string
active = boolImplementation: src/builtins/builtin/validate.rs
@SEO¶
@SEO[/route]Declare default or route-specific metadata for title, description, and social image.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
title | string | — | Document/social title. |
description | string | — | Meta description. |
image | URL | — | Social preview image. |
Implementation: src/apps/rune_web/parser.rs
@Site¶
@Site[/name]Provide generated-site title, description, tone, style, and navigation.
Runtime: Declaration compiler / host-specific
Implementation: src/apps/dynamic_ai_web/mod.rs
@Style¶
@Style/<name>Declare design tokens, presets, selector rules, and responsive overrides.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
tokens | block | — | Reusable style values. |
rules | block | — | Selector/property rules. |
responsive | block | — | Rules keyed by media condition. |
Implementation: src/apps/rune_web/css.rs
@Type¶
@Type/<name>; @Logic types = ["name"]; name("stable-id", {fields})Composable plain-data entity constructors and receiver actions, without inheritance or serialized functions.
Runtime: Shared Rune-Web: browser pages, Pixel/Pixel-3D and embedded logic tests; source builds
Parameters
id- Nonempty stable ID; application ensures uniqueness.
fields- Overrides of declared fields; object/array overrides retain supplied references.
Returns / effects
JSON-serializable {id, __type, ...declaredFields}; method dispatch survives JSON restore.
Errors / edge cases
Empty/non-string IDs, non-record overrides, unknown fields, identity mutation, missing receivers and unsupported initial-state constructors raise errors.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
types | array of @Type names on @Logic | [] | Constructor and method availability, including composed dependencies. |
@Type/Life
state:
age = 0
action advance(seconds):
age += seconds
@Logic/game
types = ["Life"]
state:
life = null
action initialize:
life = Life("fish-1")
action age:
call life.advance 60Implementation: src/apps/rune_web/modular.rs · runtime/rune-web/src/expression.ts · runtime/rune-web/src/logic.ts · knowledge/language/logic-modules.md · examples/games/idle_aquarium/care.rune
@Websocket¶
@Websocket/<path>Mount a WebSocket endpoint on a REST application.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
on_connect | series | — | Run after connection registration. |
on_message | series | — | Handle generic incoming text. |
on_disconnect | series | — | Run when receiving ends, before removal. |
@Websocket/chat
on_message:
ws.broadcast /chat bodyImplementation: src/apps/rest/ws.rs
dynamic-ai-web options¶
@App
type = dynamic-ai-webConfigure the generated-site engine and its resource limits.
Runtime: Declaration compiler / host-specific
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
engine | string | ollama | ollama, codex, or copilot as supported by the engine. |
model | string | engine dependent | Selected AI model. |
response_target_seconds | number | min(timeout_seconds, 30) | Response-time target. |
timeout_seconds | number | 120 | Generation timeout. |
cache_seconds | number | 60 | Cache duration. |
max_concurrent | number | 2 | Concurrent generation limit. |
endpoint | URL | engine default | Generation service endpoint. |
executable | path | engine default | CLI engine executable override. |
cache_entries | number | 32 | Maximum cached entries (1–256). |
generation_limit | number | 128 | Saved generation limit (1–4096). |
generations_dir | path | .vectrune/generations/<app digest> | Saved generated page directory. |
Implementation: src/apps/dynamic_ai_web/mod.rs
Native package event source¶
@ContributedSection/instance; receiver = jobNameBind an imported native package source to a core receiver job.
Runtime: Experimental native REST CLI with an approved source package.
Returns / effects
Runs the named onreceive block for one event at a time and acknowledges successful processing to the source.
Errors / edge cases
Missing or shared receiver bindings fail startup. Poll, handler, timeout and acknowledgement failures stop the service.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
receiver | identifier | required | Name of the exclusive @BackgroundJob receiver. |
@KafkaConsumer/orders
security = plaintext
bootstrap_servers = "127.0.0.1:9092"
topic = "orders"
group_id = "orders-api"
offset_reset = earliest
receiver = handleOrderImplementation: src/native/source.rs · src/background_jobs/runtime.rs · examples/api/kafka_consumer.rune
Native package import¶
import "pkg:alias"Enable section and command declarations from an installed native dependency.
Runtime: Experimental native REST CLI. Native approval on macOS and Linux.
Returns / effects
Section instances and namespaced commands supplied by the approved native library.
Errors / edge cases
Missing installed dependencies, conflicting contributions, missing approvals, and incompatible library descriptors fail loading or startup.
import "pkg:kafka"Implementation: src/packages/manifest.rs · src/rune_parser.rs · src/native/runtime.rs · src/cli/native.rs · examples/api/kafka_orders.rune