Documentation

Argus (xtnd-argus-web)

Repository: XTND-DYNAMICS/xtnd-argus-web Production: https://argus.xgi.io XAuth service: argus, licensed separately from Vantage Data: https://api.vantage.xgi.io/v1/dashboard/summary Hosting: Cloudflare Worker (static assets), deployed by CI on every merge to main


1. Overview

XARGUS is the live operational dashboard for XTND Vantage. It shows the events Vantage holds, counted by priority and by source, and the newest of them as they arrive.

Argus is an XSuite app in its own right. It has its own XAuth service and its own licence, and it runs in two places:

  • on its own page at argus.xgi.io;
  • inside XWorkspace, as the web component <xtnd-argus-dashboard>.

Everything on the dashboard is the Vantage API's answer for the person signed in. Argus shows nothing the API does not return.


2. Stack

Argus is built like every XSuite web app (the template is xtnd-url-web).

Layer What Argus uses
Framework Angular 22: zoneless, signals, standalone components
Federation Native Federation remote argus, exposing ./elements (registers <xtnd-argus-dashboard>)
XUI @xtnd-dynamics/xtnd-ui ^0.5.0 provideXAuth (sign-in), provideXtndVersion (version widget, /version.json), provideXsuiteLoad (the last answer is kept per person and shown at once on the next open), provideXsuitePwa (installed app, new deploys swapped in at a safe moment)
XUI shell xtnd-header (brand lockup, app selector), xtnd-version-widget, xtnd-locale-picker, xtnd-avatar, xtnd-avatar-sidebar, xtnd-footer. The theme is XUI's --xtnd-* tokens, light and dark; Argus sets only its accent.
XCore @xtnd-dynamics/xtnd-core-web ^0.1.4 The app's driver: provideXCore (event hub), provideXtndNavigation, and the page lifecycle on the hub
xtnd-platform @xtnd-dynamics/xtnd-platform ^0.3.1 The xsuite-app/1 manifest schema, which the tests validate the manifest against

Events on the hub

Event Meaning
app:pause / app:resume The tab went to the background, or came back. The poll stops and starts with it.
argus:dashboard:state What the dashboard shows now: its phase, the last status, the latency, the account's roles and the app that admitted them. The shell reads this for the account sidebar.
argus:dashboard:refresh Asks for a fresh answer now. After a refusal, it also restarts polling. External scripts can send it through window.__XTND_EVENT_HUB__.

3. Sign-in and licence

Argus signs in with XAuth using OAuth 2.1 authorization code with PKCE (S256), as its own client, argus.

XAuth registry entry argus
Name / lockup XARGUS / ARGUS; the sign-in page reads "XARGUS" in Argus's emerald (accent 500 #059669)
Redirect URI https://argus.xgi.io/ only. There is no localhost entry, so signing in works on argus.xgi.io only.
Roles viewer, admin
Permission dashboard.read, held by both roles

An Argus licence is a role at argus. XAuth administrators grant it:

PUT https://api.auth.xgi.io/v1/admin/users/<guid>/grants
{ "grants": [{ "service": "argus", "roles": ["viewer"] }] }

The XAuth token names the person and nothing else. Its audience is https://xgi.io, and every XSuite API accepts it. Whether a person may read the dashboard is decided on every request by XAuth's Access Graph. The Vantage API admits a person to the dashboard summary with either permission, asked in this order:

  1. events.read at vantage: Vantage's own operators and admins, answered exactly as before Argus had a service;
  2. dashboard.read at argus: an Argus licence.

The summary's user.app names which of the two admitted the person, and user.roles are their roles there. The dashboard shows them as "Roles at Argus" or "Roles at Vantage".


4. What the dashboard shows, and from where

Argus polls one route, every 3.5 s, while the dashboard is shown to someone signed in:

GET https://api.vantage.xgi.io/v1/dashboard/summary
Authorization: Bearer <XAuth token>

Every call is built on the one base https://api.vantage.xgi.io/v1. Only one request is out at a time, and the next is scheduled only after the last has answered.

Response field On the dashboard
status "Vantage API", e.g. OPERATIONAL
timestamp "Answered", in the page's language
user.email, user.roles, user.app "Account" and "Roles at Argus / Vantage"; the roles also appear in the account sidebar
metrics.totalEvents "Events held"
metrics.priorities One tile per priority (P0_CRITICAL … P3_DEFERRED, shown as P0 Critical … P3 Deferred), with its count and share of all events
metrics.sources "Sources with the most events": the top five, with count, share and a bar
recentEvents (20) "Newest events": priority tag, type, source, time, and the first three payload fields. "Details" opens id, priority, when it happened (timestamp), when Vantage stored it (created_at) and the whole payload. A payload over 8 KB is named by its lake key and size.

Numbers and times follow the language chosen in the locale picker. The text itself is English.

States

State What Argus does
Signed out Asks the person to sign in; nothing is sent to Vantage
Connecting Shows the last answer kept on this device, if there is one, while the first request is out
Live Shows the latest answer and its latency
Retrying Vantage could not answer (unreachable, 5xx). The last answer stays on screen and the next poll tries again.
Paused The tab is in the background, so no requests are sent
Refused, 403 "No access to Vantage telemetry", in Vantage's own words. Polling stops; "Try again" starts it over.
Refused, 401 The Vantage API refused the token even after XAuth renewed it. Polling stops, so an API that keeps refusing cannot trigger a session renewal on every poll.

On a refusal, none of the data stays on the page.


5. Websites and Replay (since 2.2.0)

The Websites tab shows the sites XRADAR reports from, read from the Vantage API's /v1/web/* routes (vantage-api.md, §2.4).

  • /web and /web/:source. Pick a site and a range (24 hours, 7, 30 or 90 days; ?range= keeps it in the address) and see:
    • visitors, sessions, page views and clicks;
    • median time on a page and median read;
    • the visits, newest first, each opening in the replay;
    • counts by day and by page, and the site's own events;
    • referrers, languages, devices and browsers;
    • Core Web Vitals, rated by the ratings the samples carry, with no thresholds kept in Argus;
    • errors.
  • /web/:source/sessions/:session. One visit's page loads in order, each played back with rrweb 2.1.7, the version XRADAR records with, beside every event in sequence. Choosing an event plays the replay from there, and the event the replay has reached is marked. Canvases and frames from other sites are not recorded and show empty.

The replay runs in a frame sandboxed without scripts, so nothing recorded can run. rrweb loads with the player only. Everything is styled with XUI's tokens (XUI 0.6.0 and later).

6. The web component and the manifest

Argus serves its XSuite app manifest at https://argus.xgi.io/.well-known/xsuite-app.json, with CORS *:

{
  "schema": "xsuite-app/1",
  "id": "argus",
  "name": "XARGUS",
  "origin": "https://argus.xgi.io",
  "api": "https://api.vantage.xgi.io",
  "federation": { "remoteEntry": "https://argus.xgi.io/remoteEntry.json", "elements": "./elements" },
  "components": [{ "tag": "xtnd-argus-dashboard", "attributes": [], "events": [] }],
  "contributes": {
    "workspace.sections": [
      { "id": "telemetry", "label": "Telemetry", "icon": "chart", "component": "xtnd-argus-dashboard", "order": 90 }
    ]
  }
}
  • Manifest id: the XAuth registry slug, argus, as xtnd-platform defines it.
  • What a host does: XWorkspace imports remoteEntry.json and loads ./elements, which defines <xtnd-argus-dashboard> on the host's shared Angular.
  • Contexts it reads: the component takes xtnd:auth (the person and their fetch) and xtnd:locale from the host. On argus.xgi.io, Argus's own shell provides both, so it is the same component in both places.
  • Event hub: the component keeps its event hub off window, so it never replaces the host's.
  • Not workspace-scoped: Vantage's events carry no workspace, so the Telemetry section shows the same Vantage-wide feed in every workspace.

XWorkspace finds an app through XAuth's registry (GET https://api.auth.xgi.io/v1/services). The argus entry's manifest is not set yet, so XWorkspace does not list the Telemetry section until it is.


7. Version, build and deploy

  • One version on every surface: package.json, the build stamp, /version.json ({ service: "xtnd-argus-web", version, sha, committedAt, dirty }) and the version widget.
  • Build: ng build && xsuite-pwa dist/xtnd-argus-web/browser. This writes the service worker, its manifest and the cache headers.
  • CI (.github/workflows/deploy.yml, self-hosted xtnd-ci runners):
    • on every PR: type check, unit tests (node --test), build, and the browser E2E (Playwright, with XAuth and the Vantage API faked at the network);
    • on merge to main, in addition: wrangler deploy, a check that /version.json reports the merged commit, and a read-only production smoke test.
  • Deploys: CI only. Changes go branch → PR → green checks → merge.

Local development

npm ci        # @xtnd-dynamics/* come from GitHub Packages
npm start     # http://localhost:3000
npm test && npm run check && npm run build && npm run e2e

Signing in works on argus.xgi.io only, so a local build shows the signed-out dashboard. The E2E suite covers the signed-in states against fakes.