Talos docs

Query API

54 pages.

Plain text
NameSummary
GET /contacts
GET /entitiesStill a bare array however it is narrowed; how many matched and where the next page starts are the x-argus-total and x-argus-next-cursor headers.
GET /entity/{id}
GET /environmentThe sky as it resolved, for an agent that wants to know what it is looking at before it decides whether to change it.
GET /events
GET /feelWhat an agent that cannot look or listen needs to judge how the game feels: animator state and pose, whether the camera's near plane is inside a collider, whether the player is in view, sounds started and animator names that resolved to nothing.
GET /frame.pngThe cached frame, or ?fresh=1 for one rendered now.
GET /inputWhere a press goes.
GET /navmeshGET /navmesh — ?bounds= and ?limit= window it; see crate::types::NavMeshQuery.
GET /perf
GET /snapshot
GET /stateThe committed state this server is serving, and what it will take on.
GET /traceThe body is the frozen Vec<FrameDelta>.
GET /uiAn exact read, like GET /entities: it takes ?at= and reports the state it answered at, so an agent that pressed something, waited for the stamp, and then read the tree is looking at the tick it thinks it is.
GET /ui/schemaThe machine-readable support table (§3).
GET /ui/statsThe UI's cost on the last frame (time, draw calls, quads, texts) and, per screen, layout passes and what last dirtied layout.
POST /capture
POST /entity/{id}/teleportMove one entity outright: the same path as a behaviour's ctx.entity.teleport, answered after the move is published.
POST /environmentA partial sky merged onto the live one.
POST /input
POST /path
POST /raycastOne ray { from, dir, … }, or several under { "rays": [...] }.
POST /sceneSwitch the running world to another scene of the project.
POST /snapshotPut the world back into a previously captured state.
POST /step: inputs, ticks and an entity read in one call.
POST /time

GET /

Since 0.6

What this server answers, for an agent that arrives without the docs.

Example

curl "http://127.0.0.1:7700/"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /camera/project

Since 0.7

A world point (or an entity's position) as a pixel of a view's cell.

Example

curl "http://127.0.0.1:7700/camera/project"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /camera/ray

Since 0.7

The world ray through a pixel of a view's cell.

Example

curl "http://127.0.0.1:7700/camera/ray"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /frame

Since 0.6

A bare JSON number, exactly as the SPEC table writes it.

Response

Response: FrameIndex

GET /frame — the current frame index.

FieldTypePresentDescription

Example

curl "http://127.0.0.1:7700/frame"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /npc/log

Since 0.7

The last decisions of one NPC, oldest first.

400 without id; 404 when id is not an NPC of the running scene.

Example

curl "http://127.0.0.1:7700/npc/log"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /npc/pending

Since 0.7

The script commands (npc.damaged, npc.talk, npc.reputation...) and stimuli queued for the NPCs' next tick, in the order they were raised (lane rule 35: the queue is visible).

Example

curl "http://127.0.0.1:7700/npc/pending"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /profile

Since 0.6

Whether the flight recorder is on, how full its ring is, and what captures are on disk.

Example

curl "http://127.0.0.1:7700/profile"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /profile/capture/{id}

Since 0.6

One saved capture's header and shape.

Path parameters

NameTypeDescription
idstringTaken from the path: id.

Example

curl "http://127.0.0.1:7700/profile/capture/<id>"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /profile/captures

Since 0.6

The saved captures on disk, newest first.

Example

curl "http://127.0.0.1:7700/profile/captures"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /profile/frames

Since 0.6

One row per recent frame (cost, phases, spike flag): what the frame-time strip draws.

Example

curl "http://127.0.0.1:7700/profile/frames"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /profile/trace

Since 0.6

Chrome trace JSON of the ring or of a saved capture, for ui.perfetto.dev.

Example

curl "http://127.0.0.1:7700/profile/trace"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /roads

Since 0.7

Each road entity's centre line, width and gates, in world space.

Example

curl "http://127.0.0.1:7700/roads"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /save

Since 0.7

Every key of the running game's ctx.save store.

Example

curl "http://127.0.0.1:7700/save"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /schema

Since 0.6

The names of every response schema.

Example

curl "http://127.0.0.1:7700/schema"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /schema/{name}

Since 0.6

One JSON Schema, draft 2020-12.

Path parameters

NameTypeDescription
namestringTaken from the path: name.

Example

curl "http://127.0.0.1:7700/schema/<name>"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /stream

Since 0.6

Example

curl "http://127.0.0.1:7700/stream"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

GET /ui/screens

Since 0.6

Example

curl "http://127.0.0.1:7700/ui/screens"

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /profile/capture

Since 0.6

Save the last few seconds of the ring now; an optional {"reason": "..."} body names it.

Example

curl -X POST "http://127.0.0.1:7700/profile/capture" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /save

Since 0.7

Set and remove keys of the running game's ctx.save store.

Example

curl -X POST "http://127.0.0.1:7700/save" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /ui/activate

Since 0.6

Press a node by id.

Example

curl -X POST "http://127.0.0.1:7700/ui/activate" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /ui/focus

Since 0.6

Move focus by id or by direction.

Example

curl -X POST "http://127.0.0.1:7700/ui/focus" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /ui/input

Since 0.6

Pointer, key and nav events in UI logical pixels.

Example

curl -X POST "http://127.0.0.1:7700/ui/input" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /ui/locale

Since 0.6

Force a locale for a screenshot matrix.

Example

curl -X POST "http://127.0.0.1:7700/ui/locale" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /ui/pop

Since 0.6

Pop the top screen.

Takes no body at all, so a caller need not send {}; anything sent is ignored, which is the one place in this API where that is true and is the difference between a one-line curl and a puzzle.

Example

curl -X POST "http://127.0.0.1:7700/ui/pop" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /ui/push

Since 0.6

Put a registered screen on the stack.

Example

curl -X POST "http://127.0.0.1:7700/ui/push" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /ui/scale

Since 0.6

Force the player's UI-scale setting for a screenshot matrix.

Example

curl -X POST "http://127.0.0.1:7700/ui/scale" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /ui/theme

Since 0.6

Force a theme for a screenshot matrix.

Example

curl -X POST "http://127.0.0.1:7700/ui/theme" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.

POST /ui/viewport

Since 0.6

Put the surface at a size and lay the UI out at it.

The resolution axis of docs/PLAN-UI.md §3's matrix, over one engine. See UiViewportRequest for why it needs capture rather than input.

Example

curl -X POST "http://127.0.0.1:7700/ui/viewport" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.