The contract between Comms Array's core and a game's telemetry engine. The core owns this document; an engine follows it.
Finished views and described values. The service screens (the Cockpit tab, the setup checklist, the party line and feed, the service record, and the pad's strip, lamps and built-in panels) are finished views: the engine builds them in the formats below and the core draws them without knowing the game. Everything a player or an add-on builds with is a described value: the engine describes each value once (info.metrics), sends only the value and how fresh it is, and the core formats and colours it from the description, so every widget, built-in or custom, shows it the same way. Each game keeps its own value ids; nothing maps one game's values onto another's.
Two manifests
engine.json (at the top of the engine's package) | info (the engine's hello, at run time) | |
|---|---|---|
| Read | by the core before the engine runs (consent first) | once the engine process is running |
| Holds | id, name, version, engine_api, processes, consent, input_rules, run, author | wording, tags, metrics, layouts, sharing switches, ... |
| Wins on | which programs mean the game is running and which windows may get key presses, the link version | everything else |
The engine's code never chooses where key presses go: processes in engine.json does.
Packages
An engine is a package: a zip with, at its top,
| File | What |
|---|---|
engine.json | the manifest below |
hub.json | its stats, boards, service record and party dashboard description. The hub requires it when you publish; the app doesn't read it |
| the code | what run names |
engine.json:
| Key | Type | What |
|---|---|---|
id | str | ^[a-z][a-z0-9_]{1,30}$, the engine's own id for good (its package, updates, settings, data folder and consent use it). On the hub, the first publish claims it |
game | str | required, same rule as id: the game it serves. Everything the player keeps belongs to the game: its record, saved pad layouts, add-on permissions, personas, stats, world data and party cards. Two engines naming the same game share all of it; the player picks which one runs. Our engines: starcitizen, elite. Another engine for an existing game keeps that game's value paths, action ids and situation names, so its players' pads keep working |
game_name | str | optional: the game's name (else name). Say it when name is your engine's own name |
name | str | the engine's name, shown to the player (ours use the game's name) |
version | str | the package's version (1.2.0): numbers compared as numbers. Also the version the engine says in info |
engine_api | int | the link version it speaks (2) |
author | str | who made it, shown on the Games tab |
processes | list | the game's program names (Game.exe): when one runs, the game is running; only these windows ever get key presses |
consent | dict | terms_version (required; a new one asks the player again), notice, reads, never, places (which of personal / party / leaderboard / world the game offers; the link step asks about personal and, if offered, world before the engine runs) |
input_rules | dict | automation, text: what the game's terms allow (shown with the key-press switch) |
show_labels | dict | optional: a name for each of your show texts ({"ship": "Ship", "place": "Location"}), shown where a player picks party fields (the pad's Party widget). In engine.json so it's there for a party member's game even when it isn't running here. A text with no label is named from its key |
run | dict | {"python": "<package>"} or {"program": "<file>.exe", "args": [...]} (below) |
Two kinds of engine; the author decides:
"run": {"python": "mygame"}: Python, run by Comms Array's engine host (CommsArray.exe engine <id>), with the package folder first onsys.path.mygame/__init__.pyis in the zip, and every other file exceptengine.json,hub.json,README.mdandLICENSE*is insidemygame/. The package (or itsmygame.enginemodule) hascreate(data_dir) -> Engine(commsarray.engine.Engine). It can import only what Comms Array's exe carries (the standard library minus GUI toolkits and the test suite, as in docs/addons.md,aiohttp,grpc,protobuf, andcommsarray's helpers such ascommsarray.valuesandcommsarray.layouts)."run": {"program": "bin/mygame-engine.exe", "args": []}: its own program (a relative path to an.exein the zip; the hub refuses anything else), any language, its own libraries. It speaks this link itself (below).
The hub's own rules for a package it accepts (version format, caps on files and hub.json, publishing) are the hub's docs/api-engines.md. version is MAJOR.MINOR.PATCH with an optional -prerelease (before its release).
How the core starts an engine
Both kinds run in their own process, started only once the player linked the game, with:
| Variable | What |
|---|---|
CA_ENGINE_URL | ws://127.0.0.1:<port>/engine/v1: connect here (loopback only) |
CA_ENGINE_TOKEN | send Authorization: Bearer <token> with the WebSocket handshake. A new token each start |
CA_ENGINE_DIR | a folder for the engine's own data, kept across updates |
CA_ENGINE_PACKAGE | the installed version's folder (read it, don't write it: an update replaces it) |
The working directory is CA_ENGINE_PACKAGE. A program engine:
- connects to
CA_ENGINE_URLwith the token (a text WebSocket, one JSON object per message, 4 MB max each); - sends
hellofirst, thenstatus,frames and the rest (Messages, below); - answers each
reqwith arescarrying the sameid; - exits when the socket closes. The core closes it to stop or restart the engine and kills the process after 5 s.
Writes log lines to stderr (LEVEL name: text); the core copies them into its log. A crash is restarted (backing off; after 5 crashes in 5 minutes the Games tab offers "Try again"). Example: examples/hello_engine/ (a program engine that imports nothing of Comms Array); guide: write-an-engine.md.
Installing and updating
Engines install into %APPDATA%\CommsArray\engines-installed\<id>\<version>-<sha8>\. The official engines (Star Citizen, Elite Dangerous) ship inside the exe and install on first run, so the app works offline from the start.
Updates are the player's choice. The hub's engine catalog is checked a minute after start, every 6 hours and on "check for engine updates", on the app's own update channel (Setup > Updates): stable sees the versions their owners promoted to stable, beta the newest version. A newer version whose engine_api the app speaks shows Update to X on its game in the Games tab; nothing installs until the player clicks it. With Update engines automatically switched on (Games tab, off by default) a check installs it by itself, except an unreviewed version, which always waits for the player's trust step. Either way the download's hub signature is checked (sha256, id, version, engine_api, tier) and only that engine restarts, not the app. One that needs a newer engine_api (the catalog's latest) waits, and the Games tab says so. Tiers are per version: a newer version with a lower tier than the installed one (a verified engine's next version is unreviewed until the hub reviews it) waits for its review.
The previous version stays on disk. A new version that fails twice before it has run cleanly (60 s after a hello the core accepted) is rolled back on its own; at any time the player can click Use the previous version, which switches back and restarts only that engine. Either way the version left isn't offered again (not from the hub, not from the exe) until a newer one is published. Engines the player installed from a zip are never replaced from the hub.
Tiers
| Tier | Who | At install |
|---|---|---|
| official | made and signed by Comms Array | installed |
| verified | made by someone else, reviewed and signed by Comms Array | installed (a program engine asks first) |
| unreviewed | anyone's (a hub developer account, or a zip) | only after the player confirms "I trust whoever made this"; the step says it runs as a program on their PC |
The tier comes from the hub's signature (a zip is always unreviewed). An unreviewed zip can't replace an installed official or verified engine, and a hub update can't lower an engine's tier. The core's protections don't depend on the tier: consent per game before the engine runs, key presses only to processes and only when switched on, sharing filtered by share_fields and off until switched on, who is playing only from the engine's identity view (hashed on the PC), and the engine_api refusal.
Version
"engine_api": 2 in engine.json and in info. The core refuses an engine with another number (the Games tab says why) and tells it nothing. A later version of this link bumps the number.
| Version | What changed |
|---|---|
| 1 | first version |
| 2 | pad metrics are described values: info.metrics holds descriptions, live updates carry the value and its freshness |
| 2, addition | optional, so the number stays: info.pack_makers and the pad view's pack (packs by ship, 29 Nov 2026) |
Messages
engine -> core {"t": "hello", "info": {...}} who it is (below); first message
{"t": "status", "status"} off | waiting | connected | live
{"t": "frame", "state", "views", "events", "at"} one telemetry frame
{"t": "views", "views"} views changed without a frame
{"t": "journal", "event"} one raw log event, for add-ons with events.journal:
never chat or other players' names (strip them first)
{"t": "player", "name"} the player's in-game name (per game, never carried over)
{"t": "setup", "setup"} the setup checklist
{"t": "stats", "part", "summary", "saved"} this session's game stats
{"t": "settings", "settings"} the engine changed its own stored settings
{"t": "feed", "feed"} what the game's feed carried this session, by shape
only (below); optional
{"t": "res", "id", "body"} answer to a request
core -> engine {"t": "configure", "settings", "sharing", "player"}
{"t": "req", "id", "op", "body"} actions | press | setup | setup_fix | missions | game_info |
binding | bindings | catalog
{"t": "cmd", "op", "body"} stats_begin | stats_tick | stats_restore | stats_end
catalog: what a pad button can press (the widget picker)
Optional. The answer to {"op": "catalog"}: everything a button can press, for the pad's picker, one row per thing a player wants:
{"status": "ok",
"subjects": [{"id", "name", "icon"}], the game's own grouping, in its words (tiles in the picker)
"actions": [{"action", "name", "game", "subject", "group", "key", "api", "lit", "holdable", "dangerous", "style",
"where", "sets"?, "variants": [{"action", "role", "game", "key", "api", "where", "sets"?}]}],
"values": {value id: subject id}, "panels": {panel id: subject id},
"synonyms": {"the player's word": "the game's word"}, "hidden": {...counts left out}}
name is the clean name and game the game's own; where is where to bind it in the game's own menu (shown for one with no key); key is the action's current key as text, empty when it has none the core can press; api says the game presses it itself (the pad sends a tap on it through press; anything else, and every Hold or Toggle, goes by key); lit comes from the engine's lamps. Toggle / On / Off forms of one thing fold into one row's variants (role: Toggle, On, Off, Deploy...). sets (optional, "on" or "off", 30 Nov 2026 / add-on API 1.5) is the lamp state a form leaves the game in: Deploy "on", Retract "off", for a lit thing. Say it only where it's true whatever the state was before; the core's set (a physical toggle switch) presses that form, and falls back to the Toggle only when the lamp says the state differs. Without a catalog, the core lists the engine's actions as rows with no subjects, and the picker shows them by kind.
feed: what the game's feed carries ("new fields seen")
Optional. Games change their feeds with patches; feed lets the hub notice before world numbers go wrong. One report per play session, sent again (whole) when it grows: {"session": random id, "build": the game's version as the game states it, "schema": what the engine decodes with, "present": [field paths that held a value], "unknown": [{"at": parent path, "n": field number, "wire": type}], "enums": [{"at": path, "v": number}], "frames", "sampled"}. Never a value: an unknown field could be anything. The core sends it to the hub signed with the world key, whether or not world data is on, and puts build in the world session record (with rows, the sharing-grid rows whose world cell was on, so the hub counts a public number only from sessions that sent what it needs). An engine without a feed of its own sends nothing.
info
Each key must have this type, or the core drops it as if the engine hadn't said it. All of info together must be under 512 KB.
| Key | Type | What |
|---|---|---|
id | str | must match the engine the core started |
engine_api | int | 2 |
name, version | str | shown to the player; the version goes into stats |
glossary | dict | the game's words for generic ones: {"player": "commander", "vehicle": "ship", ...} |
tags | dict | situation id -> label |
metrics | dict | value id -> its description (below). A value without a valid description is dropped (the log says why) |
panels | dict | the engine's built-in panel widgets: id -> {name, desc, title, style, size} |
layouts | dict | built-in pad layouts by name (today every engine provides Phone and Tablet) |
dangerous | list | action ids the pad and add-ons must confirm (through the game or by key) |
lit_actions | list | the actions whose state the engine reports (its lamps): a pad button on one of these has a lamp, any other has none. A "now" list: add an action when the engine learns its state, and buttons on it get their lamp by themselves. "<Action>.on"-style ids light by their base action |
sharing | list | the sharing switch ids. They start off: the engine only names them |
sharing_labels | dict | switch id -> what it shares, in the player's words |
share_fields | dict | which switch each field of the share view belongs to (below) |
event_share | dict | event type prefix -> switch: which events may go to the party |
sharing_defaults | dict | switch id -> whether the engine suggests it on; used only by the grid's "Friends" preset |
grid | dict | the sharing grid's rows: row id -> {"label"?, "places": [...]} (below) |
stats_items | dict | which grid row each part of the session summary belongs to (below) |
grid_groups | list | how the grid is shown: [{"id", "label", "rows"}], a few categories; the single rows sit under "Advanced" |
settings | dict | the engine's settings and their defaults |
words | list | the game's own names (the core word check fails if a core file uses them) |
keys | dict | {"by": "position" | "layout", "hint"}: how the game's binds name keys |
pack_makers | dict | button pack id -> the maker it matches, in the game's words ({"aegis": "Aegis Dynamics"}). The pad's pack list shows it ("Spearhead · Aegis Dynamics ships") and offers Match my ship. Optional: a game without it has no Match my ship |
Described values
info.metrics describes every value the pad, custom widgets and add-ons can build with. Ids are a contract: saved layouts bind to them, so an id never changes meaning.
| Field | For | What |
|---|---|---|
label | all | what the player sees in the designer (required) |
group | all | where the designer lists it (required) |
type | all | number · bool · enum · text · list (required) |
range | number | [min, max]: a gauge's empty and full. Without one (and without format: percent) a number can't be a gauge |
unit | number | shown after the value (m/s, °C, ly, ...; % and ° without a space) |
format | number | decimals (default; with decimals: 0..6, thousands grouped), percent (where it is in range, default [0, 1]), duration (seconds), heading (degrees) |
levels | number | {"warn": x, "bad": y, "low_is_bad": true}: at or below (or at or above) the mark it's warn / bad, else ok |
levels | enum, bool | {value: level}; for bools the keys are "true" and "false" |
values | enum, bool | {value: word}: what to show (else the value itself; bools on / off) |
of | list | the description of each part (any type but list; no label or group needed) |
items | list | the parts' labels in order, each a string or {"label", "levels"} (that part's own levels). Without items the parts change (a hold's contents) and each comes with its label |
A level is ok, warn, bad, off or "" (nothing to say).
Widgets bind to any value of a matching type: a gauge to a number with a range, a readout to a number, bool, enum or text, a parts widget to a list. A saved gauge on a value that can't fill one shows as a readout.
Live updates
The pad view's metrics holds the live updates, by id:
{"v": value | null, "fresh": "live" | "last_known" | "unknown", "age": seconds, "t": own text, "level": own level}
vis the value in its own unit (a number,true/false, an enum value, a text, or a list). A value of the wrong type counts as unknown.freshdefaults tolivewhen there is a value;last_knownvalues (from a log, not live telemetry) say theirage. A value the engine doesn't send is unknown.tandlevelare optional: the engine may always send its own text (deep spaceinstead of an altitude) and level (a flag the game raises); a widget shows them instead of what the description gives.- A list's
vis a list: withitems, one entry per item in order,null= that part isn't there (a system the vehicle doesn't have), a shorter list = the rest aren't there; withoutitems, each entry is{"label", "v", "level"?}.
The core presents each described value before it reaches the pad and add-ons:
{"v", "t": text, "level", "pos": 0..1 | null (a gauge's fill), "fresh", "age",
"parts": [{"label", "v", "t", "level", "pos"}] (lists only)}
Views
share: what the party sees
{"game": status, "player": {...} | None, "vehicle": {...} | None, "show": {...}}
player and vehicle are the game's own shape. show is finished text for the party dashboards, which draw it without knowing the game:
show key | What |
|---|---|
lines | [[key, ...], [key, ...]]: which show keys make each line of a party member, in order. The first line follows the member's presence; later lines are smaller. Keys that weren't shared are missing and simply skipped |
status | ok / downed / dead, the member's badge colour |
badge | a short shout after the name (e.g. a travel state), optional |
| any other | a short text the lines name, or a value the hub's hub.json dashboard reads |
The core filters it again. share_fields maps "<top>" and "<top>.<field>" to a switch id, a list of switch ids (all must be on) or "always" (the name and the game status: the floor). The core drops every field whose switches are off and every field not declared at all, before the summary leaves the PC or is shown as "what you share". The engine should still filter (it knows what a readout's text reveals); the core makes sure an engine's bug can't share more than the switches allow.
The sharing grid
A player chooses, per game, what goes to each of four places: personal (their own service record), party, leaderboard (public, per in-game name, still opt-in on the hub) and world (anonymous aggregates). The engine declares the rows:
- Every
sharingswitch is a row with apartycell (the party column is the switch itself, as above). gridadds the other places a row may go to, and rows with no party cell:{"wallet": {"places": ["personal", "world"]}, "events": {"label": "Deaths, ship losses ...", "places": [...]}}. A place not listed is not offered (there is no leaderboard of a location).stats_itemsmaps each part of the session summary to a row:{"counters": {name: row}, "dimensions": {name: row}, "details": {table: row}};"always"keeps it whatever the grid says (use it only for things like the game version).
grid_groups puts the rows into a few categories for the Party tab (a player ticks a category; it shows mixed when its rows differ). A row belongs to the first group that names it; rows no group names are shown under "Other". The core adds its own first row, session (play time, party size, features used): when its personal cell is off, no session summary is sent for that game at all. The core leaves a row's counters, dimensions and detail tables out of the session summary when its personal cell is off, and leaves out anything stats_items doesn't map; counters and detail tables whose row's leaderboard cell is off are listed in the summary's no_board for the hub, which keeps them off the boards, and those whose row's party cell is off (or not offered) in no_party (always sent, even empty), which keeps them out of the party boards. Once the player has made a leaderboard choice for the game (the link step's leaderboard answer, a ticked cell or a preset), the summary also says boards: true when any leaderboard cell is on, false when none is; that choice alone lists the player on the boards. Before any choice boards is left out, a leaderboard cell reads as off in the grid, and no_board is worked out as if every leaderboard cell were on, as older builds sent it, so the hub keeps using the player's old per-name opt-in. The link step's answers (personal, world, leaderboard) are the defaults for every row the player hasn't set. An engine that declares no stats_items (an older one) has its summary sent as it was. Every counter, dimension and detail table in the engine's hub.json must be mapped (a test checks both official engines).
pad: the pad's live message
{"tags": [tag ids on], "metrics": {id: live update (above)},
"lamps": {action id: "on" | "off" | "busy"}, "panels": {...}, "strip": {title, values, badges}, "profile": key,
"pack": a button pack id | null}
pack is the engine's suggestion for the vehicle you're in (its maker's pack), null with none or on foot. A layout set to Match my ship uses it unless the player picked a pack for that vehicle; on foot the pad keeps the last vehicle's pack. Send it only for a pack id in pack_makers.
panels (the engine's built-in panel widgets: summary, level, active, items, columns, segments), strip and lamps are finished views. The same data a panel shows is also a list value, so a player can build their own. Add-ons with state.live get tags and the presented metrics; the game message carries the descriptions.
cockpit: the PC panel's Cockpit tab
{"cards": [{"id", "title", "aside"?: {"text", "level", "title"?}, "empty"?: text, "blocks": [block, ...]}]}
| Block | Fields |
|---|---|
banner | text, sub, level: a coloured line across the card |
big | text, unit: one large readout |
bar | v (0..1), level: a horizontal gauge |
rows | rows: [{"label", "text"} | {"label", "parts": [{"text", "dim"?}]}] |
lights | items: [{"label", "level", "blink"?, "title"?}], columns |
heading | text |
segments | shape: "cross" | "row", items: [{"label"?, "title"?, "v", "level"}], center? (cross: top, bottom, left, right) |
level is one of ok, warn, bad, dim, accent, "". The panel escapes every text.
identity: who is playing
{"key", "name", "group"?}: key is opaque and stable for one game account (the core hashes it with the game id before anything leaves the PC, so every engine of a game that reports the same key finds the same persona); name is the player's in-game name; group (opaque) = in the same crew.
Who is playing comes only from the running engine. The engine reports identity (and player) from what the game itself says (Star Citizen: Game.log; Elite: the journal's Commander / LoadGame), never from a name the core handed it: configure's player is always None. The core keeps no "last persona of this game" either: after a start or a game switch nobody is playing, no party is active and nothing is shared, until the engine says who. Play before that moment belongs to whoever the engine then reports.
profile, share_key
profile: the key the pad's per-profile pages match (e.g. a vehicle). share_key: changes in it send the party summary at once instead of with the 1 s tick.
Stats
stats.summary is the session so far, for the service record card. summary.lines is a list of finished texts: the panel puts the first after the play time and the rest below it. stats.part is the upload, in the shape the engine's hub.json declares.
Not yet
- Program engines aren't code-signed (Q-005): the tier and the trust step are what the player goes by.
- Every engine must provide built-in layouts named
PhoneandTablet(the pad falls back to them by name).