CMLabs · Psyclone AIOS

3. PsyProbe Configuration

Configuring the built-in web interface, PsyProbe 2: ports and web roots, custom subsites, private data, parameters, catalog queries, apps and views, federation, recordings, certificates, alerts and the console.

PsyProbe architecture

PsyProbe is Psyclone's built-in web interface on the main port (http://localhost:10000/ by default). Since 16 Nov 2026 it is PsyProbe 2 only: / opens the app at /v2/ (login, roles, live graph, components, logs, console, alerts, recordings), and everything it shows comes from the REST API at /api/v2/ (generated reference at /api/v2/docs.md). The port also serves the documentation (docs.html, userguide/, systemguide/) and any <alias> directories. PsyProbe 1.x (its pages, time.xml/system.xml feeds and the /api/query-style calls) was removed: its pages redirect to /v2/ and its API calls answer 410 Gone naming the call that replaces them.

PsyProbe 1.x call (removed)PsyProbe 2 replacement
/api/query?from=X&query=YGET or POST /api/v2/systems/local/query?from=X&query=Y (permission catalog.query)
/api/getcomponentdata?compid=N&name=KGET /api/v2/systems/local/components/N/data/K
/api/getcomponentkeys?compid=NGET /api/v2/systems/local/components/N (its data list)
/api/post?type=T&...POST /api/v2/systems/local/actions/inject {type, to?, ...}
/api/triggeractivate, /api/postactivateactions/test.trigger, actions/test.post
/api/retrievemessages, /api/getmessageGET /api/v2/systems/local/messages?entity=comp:N
/api/getlogGET /api/v2/systems/local/logs
time.xml, system.xml, main.xmlGET /api/v2/systems/local/model, components, the /api/v2/live WebSocket

Scripts and other programs log in once (POST /api/v2/auth/login) or, better, use an API key of a machine account: Authorization: Bearer psy_... (created under Admin → accounts).

The <psyprobe> element

<psyprobe location="otherdir/html" port="8080" tlsport="10443" datadir="/var/lib/myapp/probe">
  <alias name="robot" location="/somedir/html" default="index.html" />
</psyprobe>
Attribute / childMeaningDefault
locationWeb root directory (overrides the auto-detected html dir and the html= cmdline); must contain probe/built-in autodetect
portAdds a dedicated PsyProbe HTTP interface on this portshares main port
defaultportno removes PsyProbe from the main porton main port
<alias>Custom subsite: URL prefix → any local directory, optional default file (served without login, as before)—

The PsyProbe 2 attributes (HTTPS, accounts, apps, views, alerts, federation, recordings) are in PsyProbe 2 settings below. Two 1.x features are gone: <post> children (manual-test buttons; use the inject action or a trigger's test button) and component custom views registered with addPsyProbeCustomView or <customview> (declare a <view>, see Applications and custom views). Both are logged once and ignored.

Custom subsites

<alias name="robot" location="/somedir/html" default="index.html" /> maps http://host:port/robot/anydir/anyfile to /somedir/html/anydir/anyfile: any local directory can be published under the PsyProbe port, without login (keep secrets out of it). For a UI that needs the user's login and live data, ship it as a PsyProbe 2 app or view instead (below): the app gets the session, the view gets the probe SDK.

Working with private data

Any component can publish binary or textual blobs as private data; give it a mimetype and it appears in the component's Data tab in PsyProbe and becomes readable over the API:

// component side
api->setPrivateData("My Data", str.c_str(), str.length(), "application/json");

// any HTTP client with a login or API key (permission system.privatedata)
GET /api/v2/systems/local/components/15/data/My%20Data
# component side
api.setPrivateData("My Data", str, "application/json")

# any HTTP client with a login or API key (permission system.privatedata)
GET /api/v2/systems/local/components/15/data/My%20Data

The reply keeps the stored type for images, JSON, plain text and XML; HTML comes back as text and anything else as a download. Secret-looking text is masked unless an account with secrets.unmask asks with unmask=1. Every read is audited.

Component parameters

Parameters declared in the psySpec (or created with api->createParameter) are listed with their type, value, default, range, step and list entries by GET /api/v2/systems/local/components/N/parameters, which works for a component on any node of the system. The PsyProbe app shows them in the component's Parameters tab with a fitting control (slider and number for a ranged number, buttons or a menu for a list, a text box for a string). A change is the parameters.set action {component, name, value}: the value is checked against the type, range and list first (a clear 400 otherwise), applied at once without a confirmation, and audited; parameters.reset restores the default. A description and a unit on the <parameter> element are shown in the editor and returned by the API.

<module name="Tuner">
  <parameter name="Gain" type="Integer" value="[0:100:5]=50" description="How loud the output is" unit="%" />     <!-- 0..100, step 5, starts at 50 -->
  <parameter name="Rate" type="Float" value="[0.0:2.0]=1.0" />
  <parameter name="Mode" type="String" value="['fast';'slow';'auto']=slow" />
  <parameter name="Label" type="String" value="hello" />
</module>

RequestStore: serving live messages over HTTP

The RequestStore catalog (implemented as MessageDataCatalog; both type names work) subscribes to messages system-wide, keeps the most recent, and serves parts or whole messages through a catalog query — the standard way to feed dashboards without writing any C++ on the web side:

<catalog name="RequestStore" type="RequestStore">
  <trigger name="VideoFrame" type="robot.sensor.video" />
  <trigger name="Status" type="Robot.Status" />
  <setup>
    <store name="VideoFrame" trigger="VideoFrame" datatype="raw" mimetype="image/bmp" />
    <store name="Status" trigger="Status" mimetype="application/json" maxkeep="1" />
    <store name="StatusTime" trigger="Status" key="timetext" mimetype="text" />
  </setup>
</catalog>
GET /api/v2/systems/local/query?from=RequestStore&query=VideoFrame
GET /api/v2/systems/local/query?from=RequestStore&query=Status
GET /api/v2/systems/local/query?from=RequestStore&List=1        (every store with its mimetype)

Every parameter except from= becomes a string entry of the query message; a lower-case name is also passed capitalised (query= → Query), because catalogs read Query, List and so on. The answer keeps the catalog's content type (XML, JSON, HTML, text or binary) and its ResultCode. Operators may query (catalog.query); monitoring accounts may not.

Store attributeMeaning
nameRequest name used in the query (required)
triggerSource trigger feeding this store (required)
keyA user entry, or header fields time (µs since year 0), timetext, type, size, content; omitted ⇒ whole message rendered as JSON/XML/HTML/TEXT per mimetype
keytypeReserved; not currently used Stub
datatyperaw = raw pixels; the message must contain width/height and a valid bitmap is built
mimetypeRequired; standard (application/json, text/html, text/xml) or short forms json/xml/text
maxkeepHistory count (default 1)
maxfrequencyMax messages kept per second (rate limit)
Note. A query reaches any component with a crank: a catalog's own <Name>ComponentCrank, or a module's <crank> (since 16 Nov 2026; before that a module never received queries and the caller timed out). The crank sees a CTRL_QUERY message without a trigger name and answers with api->queryReply(...).

Custom visualisers: putting it together

The extension paths, in increasing effort:

  • Custom subsite — static HTML under an <alias>; public, no login.
  • RequestStore or private data + a view — a PsyProbe 2 <view> (an HTML page in the psySpec) reads them with probe.get("systems/local/query", {from, query}) or probe.get("systems/local/components/N/data/K"), as the logged-in user. No native code.
  • App — a whole page behind the login with its own WebSocket to a Psyclone service, through the probe port (Mimir's web page is one).
Tip. For dashboards that must survive restarts and be shareable, prefer RequestStore + a view: everything is declared in the psySpec and plain HTML — nothing to recompile, and the login and roles come for free.

PsyProbe 2 settings

PsyProbe 2 reads extra attributes on the same element. It needs the SSL build (without OpenSSL it answers /api/v2 with 503).

<psyprobe tlsport="10443" mode="deployed" datadir="/var/lib/psyclone/probe"
          http="local" trustproxy="127.0.0.1" hostnames="probe.example.com"
          acme="https://acme-v02.api.letsencrypt.org/directory" acmedomain="probe.example.com" acmeemail="ops@example.com"
          telnetfrom="10.0.0.0/8">
  <alert name="asr_backlog" entity="ASR" metric="queue" above="50" for="5" severity="critical" />
</psyprobe>
AttributeMeaningDefault
v2off disables PsyProbe 2 (/v2/, /api/v2/)on
tlsportHTTPS port for PsyProbe 2; without it PsyProbe 2 is reachable only from this machinenone
modedeployed: developer accounts may only log in from this machine; Telnet only from this machine or telnetfromdevelopment
httpon accepts plain HTTP from other machines (only behind a TLS-terminating proxy); local redirects them to HTTPS or refuseslocal
datadirAccounts (accounts.xml, owner-only), audit (audit-YYYY-MM-DD.jsonl), setup code, certs/probe/ next to the psySpec
trustproxyReverse proxies whose X-Forwarded-For / X-Forwarded-Proto: https are trusted (never treated as local)none
hostnamesExtra DNS names / IPs for the local-CA server certificatehost name, localhost, local IPs
cert, keyYour own PEM certificate chain and key (bring your own; wins over ACME and the local CA)none
acmeACME directory URL for a free certificate (Let's Encrypt: https://acme-v02.api.letsencrypt.org/directory; staging: https://acme-staging-v02.api.letsencrypt.org/directory)off
acmedomainComma-separated DNS names for the certificate; each must resolve to this machinenone
acmeemailAccount contact (expiry warnings from the CA)none
acmeportPlain-HTTP port that answers /.well-known/acme-challenge/ (nothing else). The CA always connects to port 80 of the domain: open 80 here, or forward 80 to this port80
acmecaCA file for the ACME server's own HTTPS certificate (test servers such as Pebble only)system store
systemThis system's name for federationthe psySpec's name
telnetoff disables the Telnet consoleon (admin login)
telnetfromDeployed mode: comma-separated networks (CIDR) allowed to use Telnet besides this machinenone

Check it: the log shows PsyProbe 2: HTTPS on port N (CA SHA-256 ...) and /v2/ ready; curl -s http://127.0.0.1:<port>/health answers {"status":"ok"}. Back up datadir: it holds the accounts, the CA key and the ACME account key.

Applications and custom views

PsyProbe 2 can host applications (a whole web page for users, behind the same login) and custom views (a page or an inspector tab that shows something PsyProbe itself does not).

<psyprobe datadir="/var/lib/mimir/probe">
  <app name="mimir" title="Mimir" root="/opt/mimir/web/static" channel="Web" />
  <view name="Mimir live" path="/opt/mimir/web/static/" entry="probe-view.html" placement="page" />
</psyprobe>
<module name="Turn"> ... <view name="Live timeline" path="/opt/mimir/web/static/" entry="probe-view.html" /> </module>
<app> attributeMeaningDefault
nameServed at /apps/<name>/required
titleShown in PsyProbe's header and launchername
root, entryDirectory with the app's files, and its start page—, index.html
channelA Psyclone service whose WebSocket the app uses through PsyProbe's port (no port of its own)none
permissionWho may open itapps.<name> (roles user, admin, developer)

Opening /apps/mimir/ without a login shows the login page and comes back to the app afterwards; the app then runs as its own page, without PsyProbe around it. An account without system.view (the user role) lands in its app straight after the login. The app's socket goes to /api/v2/live and starts with {"op":"hello","ticket":...,"app":"mimir"} (the ticket from POST /api/v2/live/ticket); after that every frame belongs to the channel service, which answers exactly as on its own port. Each opening is audited (app.open).

<view> attributeMeaningDefault
nameTab or header labelView
path, entryDirectory (absolute, or relative to html/ or the psySpec) and page—, index.html
placementcomponent: a tab in the inspector of the component it is declared in; page: a header button and the whole main areacomponent inside a component, page inside <psyprobe>
permissionWho sees itsystem.view

A view runs in a sandboxed iframe (no cookies, no network of its own: connect-src 'none') and reaches the system only through /v2/psyprobe-view.js, as the logged-in user: reads under systems/local/, control actions (with the confirmation dialog), live topics, and an app channel. See the User Guide, chapter 12, for writing one. Check it: GET /api/v2/views lists the views the caller may open, and the log shows PsyProbe 2: N custom view(s).

Federation: several systems, one login

One PsyProbe (the entry system) can show and control other Psyclone systems. The browser only talks to the entry system; it forwards requests for another system to that system's PsyProbe over HTTPS with a signed identity assertion. The other system checks the rights itself, with its own roles, and audits the action as account@entry-system.

<!-- on Main (the entry system) -->
<psyprobe tlsport="10443">
  <federate system="Robot2" address="https://robot2.example:10443" key="file:/etc/psyclone/fed-robot2.key"
            fingerprint="AB:CD:...:EF" />
</psyprobe>
<!-- on Robot2 -->
<psyprobe tlsport="10443">
  <federate system="Main" key="file:/etc/psyclone/fed-robot2.key" maxrole="operator" />
</psyprobe>
<federate> attributeMeaningDefault
systemThe other system's name (its psySpec name, or its <psyprobe system=>)required
keyShared link secret, the same on both sides, 16+ characters: literal, file:/path or env:NAMErequired
addressThe other system's PsyProbe HTTPS base (entry side; omit on a system that is only reached)none
fingerprintSHA-256 of the other system's PsyProbe CA (its log line CA SHA-256 ...): fetched once, checked, kept in datadir/federation/, every later connection verified against itsystem CA store (a public, e.g. ACME, certificate)
caInstead of fingerprint: a CA file to trust for that systemnone
maxroleReceiving side: the highest role an account from that system gets here (developer becomes admin in deployed mode)admin

The system's own name comes from <psyprobe system="...">, else the psySpec's name. Make a key with head -c 24 /dev/urandom | base64 > fed.key; chmod 600 fed.key and copy it to both machines. Assertions expire after 5 minutes and are accepted once; a request from a federated system is never sent on again. In the app the other system appears as a system box in the graph and the tree; its components open in the inspector, actions, the console (system picker) and the Components view work on it. If it stops answering, it turns grey ("unreachable") and its last state stays visible. Check it: GET /api/v2/systems lists each federated system with status ok or unreachable (and for how long); the other system's audit log shows thor@Main for actions taken from Main.

Recordings

The 10-minute history ends where recordings begin. A component that records the system (Mimir's Recorder, or a catalog that keeps a session index) is named as the system's recording provider; PsyProbe then lists its recordings (header button Recordings, and "Older than 10 minutes" links under every history chart) and opens one in the named view:

<psyprobe recordings="Recorder" recordingview="Live timeline">
  <view name="Live timeline" path="%webroot%/" entry="probe-view.html" />
</psyprobe>
<catalog name="Recorder" type="Mimir::Recorder"> ... </catalog>

The provider answers three queries: ListRecordings [limit] → {recordings:[{id, open, meta}], total}; RecordingInfo id → {id, open, meta}; RecordingEvents id [skip, limit, from_ms, to_ms] → {events:[{t, trig, m}], count, skipped, truncated} (unix ms, trigger name, the message's entries), each as a JSON entry; an unknown id answers {"error":"not_found"}. PsyProbe exposes them as GET /api/v2/systems/local/recordings, recordings/<id> and recordings/<id>/events (permission system.recordings: operators and admins; events are masked like messages). The view is opened with ?recording=<id> and reads the events with probe.get("systems/local/recordings/<id>/events").

AttributeMeaningDefault
recordingsThe recording provider component (answers the three queries above)none
recordingviewThe name of the <view> that shows one recordingnone (the list only)

Free certificates (ACME)

With acme and acmedomain set (and no cert/key), PsyProbe starts on its local-CA certificate, asks the CA for a real one in the background (RFC 8555, HTTP-01 answered on acmeport), and swaps it in without a restart; new connections get it at once. It keeps certs/acme.pem + acme.key (owner-only) and acme-account.key, renews when under a third of the lifetime is left (at most 30 days before expiry), and retries failures after 5 minutes, doubling to 12 hours. Progress is in the log (requesting a certificate, ACME certificate installed ... (expires in N days), or the CA's error) and in GET /api/v2/health:

"certificate":{"source":"acme","notAfter":1771286400,"acme":{"directory":"https://acme-v02...","domains":"probe.example.com","status":"ok"}}

source is own, acme, local-ca (also while ACME is still pending) or none. A tls_expiring alert fires when the certificate has under 14 days left. Try the Let's Encrypt staging directory first: its rate limits are generous and failures do not count against the real ones.

Alerts

PsyProbe 2 evaluates alert rules once a second. Built-in: a component queue over 1000 messages for 10 s, a component over 90 % CPU for 30 s, a crank with queued work but no runs for 5 s, a node that stops answering, error log lines (rate over 1/s), and a TLS certificate within 14 days of expiry. Add your own with <alert/> children of <psyprobe>:

AttributeMeaningDefault
nameRule name (shown and exported)alertN
entityComponent name, or * for every component*
metricqueue, cpu (%), msgIn, msgOut, msgs (in + out, per second), bytesIn, bytesOut, runsqueue
above / belowThresholdabove="0"
forSeconds the condition must hold10
severitywarning or criticalwarning

Firing alerts show as a badge in the app (Alerts view, with Acknowledge), on the live alerts topic, at GET /api/v2/systems/local/alerts (?all=1 adds the resolved ones), and in /metrics. Admins, operators and monitoring accounts may acknowledge (POST .../alerts/{id}/ack, audited).

Prometheus and other scrapers

GET /metrics serves OpenMetrics text (per component: messages and bytes in/out per second, queue, runs, CPU; per connection; per node CPU; firing alerts; probe clients). It needs an API key with monitoring.metrics: create a machine account with role monitoring in Admin → Accounts and press New key (shown once).

curl -s -H "Authorization: Bearer psy_8ec8c3b7235d_..." https://probe.example.com:10443/metrics | head
# TYPE psy_component_messages_in_per_second gauge
psy_component_messages_in_per_second{component="Ping",id="comp:2",kind="module",node="1"} 10
...
# EOF
# prometheus.yml
scrape_configs:
  - job_name: psyclone
    scheme: https
    tls_config: { ca_file: /etc/prometheus/probe-ca.pem }   # the local CA (or omit with an ACME certificate)
    authorization: { credentials_file: /etc/prometheus/psyprobe.key }
    static_configs: [ { targets: ["probe.example.com:10443"] } ]

Control actions, the console and Telnet

Actions run with POST /api/v2/systems/local/actions/{action}; GET .../actions lists them with the permission each needs. Destructive ones (parameter set, spec reload, restart, shutdown) answer 409 with a summary and a token; repeat the same request with "confirm":"<token>" within 60 s. Everything is audited.

curl -s -b jar -H "X-Psy-CSRF: $CSRF" -H "Content-Type: application/json" \
  -d '{}' https://localhost:10443/api/v2/systems/local/actions/system.restart
{"confirm":"8ffd602511df02138c2918c2","summary":"Restart the whole system","expiresIn":60,...}
curl -s -b jar -H "X-Psy-CSRF: $CSRF" -H "Content-Type: application/json" \
  -d '{"confirm":"8ffd602511df02138c2918c2"}' https://localhost:10443/api/v2/systems/local/actions/system.restart
ActionBodyPermissionConfirm
inject{type, to?, field: value...}control.inject
test.trigger, test.post{component, trigger} / {component, post}control.test
contexts.set{context}control.contexts
parameters.set, parameters.reset{component, name, value} / {component, name}control.parameters
spec.reload, system.restart{file?} / {}control.reloadyes
node.shutdown, system.shutdown{}control.shutdownyes
component.stop, component.restart{component}control.componentyes
component.start{component}control.component

Stopping a component sets the COMPONENT_PAUSED policy flag on the node that runs it: its crank's api->shouldContinue() turns false within 100 ms (a crank that loops returns), and the space drops every message for it until it is started; the component list shows "stopped": true. Start clears the flag and runs the crank once with nothing queued, so a crank that loops until told to stop starts its loop again; a per-message crank simply runs on its next message. Restart stops, waits up to 5 s for the crank to finish, and starts it: the crank runs again from the start with fresh local state. Messages that arrived while it was stopped are gone (a ping-pong pair broken by a stop stays broken until something posts again). Operators may stop and start components (control.component).

The web console (POST .../console {"command":"..."}, Console view in the app) runs the Telnet console's commands. Operators get read-only commands (help status nodes components alerts log whoami); admins and developers also the level commands (verbose/debug), restart, reinit, shutdown and kill, which act at once. Output is masked.

The Telnet console (on the main port: connect and press Enter) now asks for a PsyProbe 2 login and only admits admin and developer accounts. Three wrong passwords close the connection and lock the address out for 30 s; every attempt is audited (telnet.login). Telnet sends the password in clear, so in deployed mode it is accepted only from this machine or telnetfrom networks; prefer the web console over HTTPS. Without accounts (no SSL build, or no admin created yet) only this machine may connect, as before. telnet="off" disables it.

Secrets. Message summaries, private-data text, logs and console output mask values whose key looks secret (password, token, apikey, secret, ...) and values that look like keys (AWS, JWT, PEM private keys, Bearer tokens, PsyProbe keys). Admins can add ?unmask=1 to private-data and log requests; each use is audited (secrets.unmask).

The PsyProbe 2 source and building it

The web application is in Psyclone/probe-ui/ (Svelte 5, TypeScript and Vite; Cytoscape.js and uPlot are bundled), and it ships in the source distribution. Its build output is committed in html/probe/ (index.html plus hashed assets/), so Psyclone serves it as plain files and needs no Node.js at run time. To change it:

cd Psyclone/probe-ui
npm install            # once
npm run build          # writes ../../html/probe/ and checks it has no external URLs
npm run dev            # a Vite dev server that proxies /api to a node on 127.0.0.1:10000

The REST API the app uses is declared in html/probe/probe-api.xml, which the node reads at start (operations, parameters and the permission of each); a running node generates the reference from it at GET /api/v2/docs.md and docs.json, listing what the caller may use. A copy generated for an admin account is Docs/psyprobe-api-v2.md. The view SDK for your own views is public/psyprobe-view.js, served as /v2/psyprobe-view.js. The browser tests (tests/run-e2e.sh, tests/run-fed-e2e.sh, and run-*-windows.sh for nodes on Windows) start test systems from the built Psyclone and drive the app in headless Chromium; they need Node.js, playwright-core and Chromium or Chrome. Psyclone/probe-ui/README.md has the layout of the source.

Psyclone AIOS · CMLabs