Vectrune documentationAlpha referenceLearning site ↗

Application declarations

Named sections consumed by the app routers and Rune-Web compiler.

@App

@App

Select an application runtime and its serving or presentation configuration.

Runtime: Declaration compiler / host-specific

Fields

FieldTypeDefaultMeaning
typestringRESTREST, GraphQL, MCP, STATIC, DYNAMIC-AI-WEB, PIXEL, PIXEL-3D, RUNE-DB or VECT-EVENT; dispatch is case-insensitive.
transportstringstdio (or http if port/host/endpoint set)MCP: selects stdio JSON-RPC 2.0 or http Streamable HTTP transport; can be overridden by --transport.
endpointstring/mcpMCP: Streamable HTTP endpoint path when running in HTTP mode.
instructionsstring—MCP: optional server instructions returned in the initialize response.
namestring—Application display metadata.
portnumber3000HTTP port; can be overridden by --port.
hoststring127.0.0.1HTTP bind address; can be overridden by --host.
swaggerboolfalseREST: serve /openapi.json and /swagger-ui.
versionstring1.0.0Application version metadata used in OpenAPI info.version.
default_authstring | array—REST: default @Authentication scheme(s) applied to every route unless overridden with auth = none or auth = <Scheme>.
corsbool | arrayfalseREST: enable CORS for any origin (true) or a specific list of allowed origins.
rate_limitobject—REST: global fixed-window rate limit {"requests": N, "window": seconds, "key": "ip"|"auth"|"global"|"header:<Name>"}.
not_found_pagebooltrueREST: show the built-in 404 page to clients explicitly accepting HTML. Lists route templates, including authenticated routes. A custom @NotFound overrides this setting.
scenestringrequired for PixelEntry @Scene name for game apps.
runtimestringhost-dependentSelects game host behavior, including hybrid examples.
resolution[width, height]required for PixelPixel rendering resolution.
tick_ratenumber30 in Pixel 3DSimulation ticks per second.
shellstring—Optional Rune-Web @Page shell for Pixel 3D; must contain the game canvas.
versionstring—Application metadata; does not select a versioned docs path.
sourcedatasource namerequired for storage serversFor rune-db/vect-event, select the embedded provider to host.
token_envenvironment variableunsetStorage server bearer token source; required for non-loopback binds.
allow_originorigin URLdisabledOne exact HTTP(S) browser origin for the storage protocol CORS adapter.
allow_originsJSON array of stringsdisabledStorage protocol CORS allowlist of exact HTTP(S) origins. Alternative to allow_origin; the two settings are mutually exclusive.
Example
@App
name = Example
type = REST
port = 3000

Implementation: 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

FieldTypeDefaultMeaning
maparray of ASCII rowsrequiredRectangular 3-128 by 3-128 cell grid; '.' is empty.
wallsobjectrequiredWall symbol to {texture: AsciiSprite name, color: Ink}; color defaults to white.
camerastringcameraTop-level camera state field.
entitiesstringthingsTop-level entity array state field, including an empty array.
fovnumber65Horizontal field of view in degrees, 30-110.
farnumber32Visibility distance in map units, 2-96.
cell_aspectnumber2Terminal character height divided by width, 1-3.
repeat_ybooleanfalseRepeat map rows endlessly along Y; does not replicate entities.
floorInkgrayPerspective floor checker-pattern color.
ceilingInkblueCeiling seam color.
Example
@Ascii3D/room
map = ["######", "#....#", "#....#", "######"]
walls = {"#": {"texture": "brick", "color": "cyan"}}
camera = camera
entities = things

Implementation: 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

FieldTypeDefaultMeaning
size[integer, integer]requiredRequired [columns, rows] integers: 1-240 by 1-80.
fpsinteger20Integer simulation rate 1-60; default 20.
logicstringrequiredRequired @Logic name; initialize and tick actions are required.
canvasstringcanvasDeclared state field containing drawing objects; default canvas.
spatialstringunsetOptional non-repeating Ascii3D scene binding for shared slide/sees helpers.
commandstringunsetOptional 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.
Example
@App
type = ascii-animator
scene = demo
@AsciiAnimator/demo
size = [72, 22]
fps = 20
logic = demo
canvas = canvas

Implementation: 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

FieldTypeDefaultMeaning
typestring8bit8bit, chiptune or synth; style alias.
temponumber128BPM 21-399; bpm alias.
time_signaturestring4/44/4 or 3/4; meter alias.
barsintegerinferredOptional 1-64 bars; measures alias.
loopbooleantrueRepeat the score; loop_track alias.
volumenumber0.2Score volume 0-0.5.
leadnote string or seriesnoneLead score; melody alias.
bassnote string or seriesnoneBass score.
drumsnote string or seriesnoneDrum score; percussion alias.
instrumentsobjectchannel defaultsMap standard/custom channels to shared synth instrument names. Other named string/series fields define up to five custom tracks.
Example
@AsciiMusic/haunted
tempo = 100
volume = 0.07
lead:
    D4:4 F4:4 A4:4 D4:4
bass:
    D2:2 -:2

Implementation: 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

FieldTypeDefaultMeaning
framesarray of row arraysrequired unless sourceArray of frames; each frame is an array of quoted ASCII rows. Cannot combine with source.
fpsinteger8Integer inline sprite frame rate 1-60; cannot combine with source.
sourcestringnoneUnreleased: file-relative GIF asset decoded once at startup; cannot combine with frames/fps.
widthinteger16Unreleased: GIF source terminal width 1-240; requires source.
invertbooleanfalseUnreleased: reverse the GIF brightness ramp; requires source.
Example
@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

FieldTypeDefaultMeaning
frequencynumberrequiredStarting frequency, 20-8000 Hz.
end_frequencynumberfrequencyOptional linear sweep endpoint, 20-8000 Hz.
durationnumber0.1Duration in seconds, 0.01-1.
volumenumber0.15Amplitude, 0-0.5; short attack/release are automatic.
wavestringsinesine, square, triangle, sawtooth or noise.
Example
@AsciiTone/shot
frequency = 1000
end_frequency = 160
duration = 0.07
wave = square
volume = 0.12

Implementation: 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

FieldTypeDefaultMeaning
typestringjwtAuthentication scheme type: jwt, oauth2, api_key, basic, bearer, hmac, or cookie.
algorithmstringHS256JWT signing/verification algorithm: HS256, HS384, HS512, RS256, or ES256.
secretstringemptyShared secret for HS* JWT, HMAC-SHA256 webhook verification, or signed session cookies.
public_keystring—PEM public key for RS256/ES256 JWT verification.
jwks_urlurl—OIDC/OAuth2 JWKS endpoint for dynamic public key verification with caching.
issuerstring—Expected JWT/OAuth2 iss claim.
audiencestring—Expected JWT/OAuth2 aud claim.
introspection_urlurl—OAuth 2.0 RFC 7662 token introspection endpoint.
headerstringX-API-KeyHTTP header name for api_key or hmac signature extraction.
querystring—Optional query parameter name for api_key extraction.
realmstringVectrune APIWWW-Authenticate realm for HTTP Basic authentication.
token_endpointpath—Optional POST endpoint issuing signed JWTs from configured users.
users / keys / tokensseries—JSON credential rows specifying username/password (or sha256:), API keys, or bearer/OAuth2/cookie tokens with roles and scopes.
Example
@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

FieldTypeDefaultMeaning
modeonce | intervalrequiredExplicit scheduling mode.
interval_msintegerrequired for intervalDelay from 1 to 86400000 ms after a completed run.
on_failurestop | continuestopStop the service or report the error and disable the failed job.
Example
@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

FieldTypeDefaultMeaning
capacityinteger1000Waiting events, from 1 to 10000.
completed_retentioninteger1000Completed statuses retained, from 1 to 10000.
max_input_bytesinteger1048576Serialized JSON input limit from 1 to 8388608 bytes.
Example
@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

FieldTypeDefaultMeaning
propslist—Expected property names.
stateblock—Component-local state.
bindingsblock—Selection and state bindings.
viewview 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

FieldTypeDefaultMeaning
typestringrequiredmysql, postgres, rune-db or vect-event.
connectionstringSQL adapters onlyMySQL/Postgres connection string; not required by rune-db or vect-event.
modestringembeddedembedded or remote for storage providers.
databasestringsource nameBrowser database name and default native filename stem.
native_pathpath.vectrune/data/<database>.rdbNative file, relative to the declaring source file.
storesource namerequired for embedded vect-eventrune-db provider whose transactions hold the event log.
endpointURLrequired for remoteStorage server base URL; one versioned HTTP operation protocol.
token_envenvironment variableunsetNative bearer token source; never exported to the browser.
Example
@DataSource/main
type = rune-db
native_path = .vectrune/notes.rdb

@DataSource/activity
type = vect-event
store = main

Implementation: 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

@Frontend

Mount a static or Rune-Web frontend through REST hosting.

Runtime: Declaration compiler / host-specific

Fields

FieldTypeDefaultMeaning
typestring—static or rune-web.
srcpath—Static source directory.
pathpath/Frontend mount path; %ROOT% denotes root.
pagestring—Entry @Page for Rune-Web.
localestring—Default locale bundle.
locale_pathsobject—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

Example
@GraphQL/Query/Greeting
greeting:
    result = { message: "Hello" }
    return result

Implementation: src/apps/graphql/mod.rs

@Hook

@Hook/<name>

Declare memory observer metadata parsed by the hook infrastructure.

Runtime: Declaration compiler / host-specific

Fields

FieldTypeDefaultMeaning
targetstringrequiredMemory key observed by this hook.
observerstringwebsocketObserver transport parsed by hook infrastructure.
channelstring—WebSocket channel configuration.
endpointstring—WebSocket endpoint configuration.
webhook_urlstring—Poll/webhook observer URL configuration.
runseries—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

FieldTypeDefaultMeaning
stateblock—Initial reactive state.
actiondeclarations—Named action bodies with optional parameters.
localsblock—Template-local values not exported as public state.
derivedblock—Derived values evaluated from state using match definitions.
helperdeclarations—Pure helper expressions with named parameters.
timerdeclaration—Periodic action ticker such as tick 40ms.
keysblock—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

FieldTypeDefaultMeaning
descriptionstring—Optional prompt description.
paramsseries—Prompt argument declarations (`name: string "desc"`, `name?: string "desc"`).
runseriesrequiredExecutable step block for prompts/get.
Example
@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

FieldTypeDefaultMeaning
uristringrequiredResource URI or URI template.
namestringsection nameDisplay name returned in resources/list or resources/templates/list.
descriptionstring—Optional resource description.
mime_typestringtext/plainMIME type returned in resource metadata and contents.
runseriesrequiredExecutable step block for resources/read.
Example
@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 note

Implementation: 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

FieldTypeDefaultMeaning
descriptionstring""Tool description exposed in tools/list.
titlestring—Optional human-readable display title.
inputstring—Optional @Schema name used to derive JSON Schema input properties.
paramsseries—Inline parameter declarations such as `query: string "Search text"` or `limit?: integer "Max items"`.
input_schemaobject—Explicit JSON Schema object overriding generated inputSchema.
read_onlybool—Sets MCP annotations.readOnlyHint.
destructivebool—Sets MCP annotations.destructiveHint.
idempotentbool—Sets MCP annotations.idempotentHint.
open_worldbool—Sets MCP annotations.openWorldHint.
rolesarray[]Required caller roles when HTTP @Authentication is configured.
scopesarray[]Required caller scopes when HTTP @Authentication is configured.
runseriesrequiredExecutable step block for tools/call.
Example
@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 note

Implementation: 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

FieldTypeDefaultMeaning
exportsarray of member names[]Public action/func names; unlisted members are private.
modulesobject on @Logic{}Alias to @Module name; each alias owns separate state.
Example
@Module/Wallet
exports = ["earn"]
state:
    pearls = 30
action earn(amount):
    pearls += amount
@Logic/game
modules = {"wallet":"Wallet"}
action reward:
    call wallet.earn 10

Implementation: src/apps/rune_web/modular.rs · runtime/rune-web/src/modular.ts · knowledge/language/logic-modules.md · examples/rune-web/modules/modules.rune

@Navigator

@Navigator

Synchronize a route state variable with the URL and optionally bind the page fragment separately.

Runtime: Declaration compiler / host-specific

Fields

FieldTypeDefaultMeaning
Example
@Navigator
url bound to activePage
mode = path
fragment = activeSection

Implementation: src/apps/rune_web/parser.rs

@NotFound

@NotFound

Override 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

FieldTypeDefaultMeaning
runseriesrequiredNative request steps; use respond for the desired status and body.
content_typestringtext/plain; charset=utf-8Response Content-Type, for example text/html; charset=utf-8.
Example
@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

@Optimizer

Split named route views into lazy-loadable JSON chunks.

Runtime: Declaration compiler / host-specific

Fields

FieldTypeDefaultMeaning
dynamic_xhrstringoffon, auto, lazy, or off.
pre_loadboolfalseBackground route preload.
chunk_pathpath/assets/routesPublic 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

FieldTypeDefaultMeaning
viewview tree—Indented frontend elements and components.
stylestring—Named @Style.
logicstring—Named @Logic.
on_mountaction name—Existing action invoked once after initial browser rendering, never during server rendering or export.
titlestring—Page title metadata.
descriptionstring—Page description metadata.
stateblock—Initial page-local state.

Implementation: src/apps/rune_web/parser.rs

@Route

@Route/<METHOD> /path

Define an HTTP endpoint and its executable steps.

Runtime: Declaration compiler / host-specific

Fields

FieldTypeDefaultMeaning
runseries—Ordered native request steps.
expectschema name—POST/PUT/PATCH OpenAPI request body metadata; does not run validation.
descriptionstringemptyDescription in generated OpenAPI.
authstring | array—Named @Authentication scheme, array of schemes for OR fallback, or none to bypass @App default_auth.
rolesarray—Required roles (caller must hold at least one role or receive 403 Forbidden).
scopesarray—Required scopes (caller must hold every listed scope or receive 403 Forbidden).
rate_limitobject | string—Per-route rate limit override {"requests": N, "window": seconds, "key": ...} or none to exempt from global rate_limit.
schemastring—Schema used by generated data-source CRUD handlers.
data_sourcestring—Configured data source for generated handlers.
Example
@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

Example
@Schema/User
name = string
active = bool

Implementation: 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

FieldTypeDefaultMeaning
titlestring—Document/social title.
descriptionstring—Meta description.
imageURL—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

FieldTypeDefaultMeaning
tokensblock—Reusable style values.
rulesblock—Selector/property rules.
responsiveblock—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

FieldTypeDefaultMeaning
typesarray of @Type names on @Logic[]Constructor and method availability, including composed dependencies.
Example
@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 60

Implementation: 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

FieldTypeDefaultMeaning
on_connectseries—Run after connection registration.
on_messageseries—Handle generic incoming text.
on_disconnectseries—Run when receiving ends, before removal.
Example
@Websocket/chat
on_message:
    ws.broadcast /chat body

Implementation: src/apps/rest/ws.rs

dynamic-ai-web options

@App
type = dynamic-ai-web

Configure the generated-site engine and its resource limits.

Runtime: Declaration compiler / host-specific

Fields

FieldTypeDefaultMeaning
enginestringollamaollama, codex, or copilot as supported by the engine.
modelstringengine dependentSelected AI model.
response_target_secondsnumbermin(timeout_seconds, 30)Response-time target.
timeout_secondsnumber120Generation timeout.
cache_secondsnumber60Cache duration.
max_concurrentnumber2Concurrent generation limit.
endpointURLengine defaultGeneration service endpoint.
executablepathengine defaultCLI engine executable override.
cache_entriesnumber32Maximum cached entries (1–256).
generation_limitnumber128Saved generation limit (1–4096).
generations_dirpath.vectrune/generations/<app digest>Saved generated page directory.

Implementation: src/apps/dynamic_ai_web/mod.rs

Native package event source

@ContributedSection/instance; receiver = jobName

Bind 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

FieldTypeDefaultMeaning
receiveridentifierrequiredName of the exclusive @BackgroundJob receiver.
Example
@KafkaConsumer/orders
security = plaintext
bootstrap_servers = "127.0.0.1:9092"
topic = "orders"
group_id = "orders-api"
offset_reset = earliest
receiver = handleOrder

Implementation: 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.

Example
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