One live console to monitor Claude Code and Codex agents across machines, track context and spend, and unblock sessions that need you.
Minor bug fixes
yuz2071b25ecdf17bf
diff --git a/README.md b/README.mdindex baa3af8..2881815 100644--- a/README.md+++ b/README.md@@ -10,7 +10,7 @@ hunting for their terminal.|---|---|---|| Every session on every machine as cards, a list or a graph, each with its plan and current step, its agents, model and effort, context fill, git state, cost, and what failed. | Every permission, question and plan that is waiting sits at the top, longest wait first; answer it there or in the terminal, and the first answer wins. | It sends a session only your own answers, messages and commands, never controls a terminal, never starts, stops or restarts a session, stores no transcripts, and runs on a machine you own. |-+*A simulated fleet, drawn by the real interface: no project, path or session in the pictures on this page is real.*@@ -21,7 +21,7 @@ No agents needed: a simulator fills the dashboard with a fleet. You need git and```shgit clone https://github.com/IluvatarLabs/sitrep ~/sitrep && cd ~/sitrepnpm ci-npm run dev # the server on :4317, the dashboard on http://localhost:5173+npm run dev # the server on :7487, the dashboard on http://localhost:5173```In a second terminal:@@ -34,7 +34,7 @@ npx tsx scripts/sim.ts --sessions 8 --codex 0.4 --machines 3 --chaos## Install**Before you put it on a network:** SITREP is built for one person on a trusted LAN. It speaks plain HTTP, by default-anyone who can reach port 4317 can read every session, and answering needs a sign-in with the admin secret.+anyone who can reach port 7487 can read every session, and answering needs a sign-in with the admin secret.[Operations: Security](docs/OPERATIONS.md#security-one-owner-one-secret) says what that means and how to narrow it.### The server@@ -48,7 +48,7 @@ npx tsx scripts/install.ts --server --bind 0.0.0.0 # dry run: printsnpx tsx scripts/install.ts --server --bind 0.0.0.0 --apply```-It starts as a user service and writes an admin secret to `~/.sitrep/server.env`. Open `http://<server IP>:4317`, by+It starts as a user service and writes an admin secret to `~/.sitrep/server.env`. Open `http://<server IP>:7487`, bythe machine's IP address: the server refuses a host name until it is listed in `SITREP_ALLOWED_HOSTS`([Operations: Deploy the server](docs/OPERATIONS.md#deploy-the-server), step 6).@@ -60,7 +60,7 @@ OS and harness, each with Copy:```shgit clone https://github.com/IluvatarLabs/sitrep ~/sitrep && cd ~/sitrep && npm cinpm run build -w codex-reporter # only where Codex runs-npx tsx scripts/install.ts --claude --codex --url http://<server IP>:4317 --token-stdin --apply+npx tsx scripts/install.ts --claude --codex --url http://<server IP>:7487 --token-stdin --apply```The installer takes the admin secret on its standard input: paste it, then Ctrl-D. Leave out `--claude` or `--codex` ondiff --git a/codex-reporter/package.json b/codex-reporter/package.jsonindex 3fec8ee..b796822 100644--- a/codex-reporter/package.json+++ b/codex-reporter/package.json@@ -1,5 +1,6 @@{"name": "codex-reporter",+ "version": "0.4.0","private": true,"license": "MIT","type": "module",diff --git a/codex-reporter/plugin/.codex-plugin/plugin.json b/codex-reporter/plugin/.codex-plugin/plugin.jsonindex dc38bc3..53b9cd4 100644--- a/codex-reporter/plugin/.codex-plugin/plugin.json+++ b/codex-reporter/plugin/.codex-plugin/plugin.json@@ -1,5 +1,5 @@{"name": "sitrep-codex",- "version": "0.1.0",+ "version": "0.4.0","description": "SITREP: records bounded, redacted Codex hook events to a local spool for the codex-reporter. Never decides anything, never touches the network."}diff --git a/codex-reporter/src/config.ts b/codex-reporter/src/config.tsindex 2e6b8a3..93a4556 100644--- a/codex-reporter/src/config.ts+++ b/codex-reporter/src/config.ts@@ -1,7 +1,7 @@// The reporters' shared configuration: the environment, or a `.env` file in the working directory, like the server's. codex-reporter// and hermes-reporter both read it, so one env file serves both.//-// CODEX_REPORTER_SERVER_URL the dashboard server (default http://127.0.0.1:4317, the server's default port)+// CODEX_REPORTER_SERVER_URL the dashboard server (default http://127.0.0.1:7487, the server's default port)// CODEX_REPORTER_TOKEN the admin secret, sent as X-Sitrep-Tokentry {@@ -10,5 +10,5 @@ try {// no .env here: the environment alone}export const env = (k: string) => process.env[k]?.trim() ?? '';-export const serverUrl = env('CODEX_REPORTER_SERVER_URL') || 'http://127.0.0.1:4317';+export const serverUrl = env('CODEX_REPORTER_SERVER_URL') || 'http://127.0.0.1:7487';export const token = env('CODEX_REPORTER_TOKEN');diff --git a/codex-reporter/src/main.ts b/codex-reporter/src/main.tsindex b1daf53..1f2730d 100644--- a/codex-reporter/src/main.ts+++ b/codex-reporter/src/main.ts@@ -3,7 +3,7 @@// dashboard server (1 s dirty flush, 5 s heartbeat, git every 10 s). Configuration comes from the environment or a `.env`// file in the working directory, like the server's://-// CODEX_REPORTER_SERVER_URL the dashboard server (default http://127.0.0.1:4317, the server's default port)+// CODEX_REPORTER_SERVER_URL the dashboard server (default http://127.0.0.1:7487, the server's default port)// CODEX_REPORTER_TOKEN the admin secret, sent as X-Sitrep-Token// CODEX_REPORTER_RESPOND off | questions | questions-and-plans | everything (default everything)// CODEX_REPORTER_ACTIVITY_FEED on unless "off", "false" or "0"@@ -24,8 +24,10 @@ import { Responder, type Store } from './respond.js';import { codexHome, fileLines, listRollouts, NO_NAMES, parseRolloutLine, sessionOfFile, threadNames, type RolloutFile } from './sessionFiles.js';import { JsonlTail } from './spool.js';import { Transport } from './transport.js';+// This package's manifest: the build copies it beside dist/codex-reporter/src/, so the same import finds it there.+import manifest from '../package.json' with { type: 'json' };-export const VERSION = '0.3.0';+export const VERSION = manifest.version;const FLUSH_MS = 1000;const HEARTBEAT_MS = 5000;const GIT_POLL_MS = 10_000;diff --git a/docs/HOW-IT-WORKS.md b/docs/HOW-IT-WORKS.mdindex cdea1cb..7d7bcc2 100644--- a/docs/HOW-IT-WORKS.md+++ b/docs/HOW-IT-WORKS.md@@ -10,7 +10,7 @@| Piece | Where it runs | What it does ||---|---|---|-| The server | One machine that stays on | One Node process with a SQLite database. Port 4317 carries everything: the reporters' API, the dashboard and its live stream |+| The server | One machine that stays on | One Node process with a SQLite database. Port 7487 carries everything: the reporters' API, the dashboard and its live stream || The Claude Code plugin, `sitrep-reporter` | Inside each Claude Code session | Reports the session's state, its asks and their answers || Claude Code's own telemetry | Each Claude Code session | Carries the session's usage to the server, one event per API request. The installer turns it on || The Codex plugin, `sitrep-codex`, and `codex-reporter` | Each machine that runs Codex | The plugin's hooks write to a local spool; the reporter service reads the spool, Codex's session files and the Codex daemon, and sends the reports |@@ -82,7 +82,7 @@ when it is back.SITREP is built for one person on a trusted LAN.-- It speaks plain HTTP. By default anyone who can reach port 4317 can read every session; Settings → Require sign-in to+- It speaks plain HTTP. By default anyone who can reach port 7487 can read every session; Settings → Require sign-in toview closes that.- One admin secret does everything else: the reporters send it with their reports, and you sign in with it to answer asession or change a setting.diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.mdindex b8bad42..a1f0eec 100644--- a/docs/OPERATIONS.md+++ b/docs/OPERATIONS.md@@ -25,7 +25,7 @@ Contents:| Where | What | Started by ||---|---|---|-| The server machine (always on) | The server: one Node 24 process, SQLite, the dashboard on port 4317 | A user service: systemd `--user` with linger |+| The server machine (always on) | The server: one Node 24 process, SQLite, the dashboard on port 7487 | A user service: systemd `--user` with linger || Every machine with Claude Code | The plugin `sitrep-reporter`, inside each Claude Code session (state, asks, answers); and Claude Code's own telemetry, which carries the sessions' usage | Claude Code, from this repository's plugin marketplace; the telemetry, from the settings the install writes || Every machine with Codex | The Codex plugin `sitrep-codex` (hooks that write a local spool) and the `codex-reporter` process (reads the spool, the session files and the Codex daemon; sends the reports) | Codex, from this repository's plugin marketplace; a user service |@@ -63,18 +63,18 @@ Moving the server is a change of URL in each reporter.loginctl enable-linger $USER```-5. **Firewall.** Allow TCP 4317 from the LAN only, for example `sudo ufw allow from 192.0.2.0/24 to any port 4317 proto tcp`.+5. **Firewall.** Allow TCP 7487 from the LAN only, for example `sudo ufw allow from 192.0.2.0/24 to any port 7487 proto tcp`.6. **Host names.** The server refuses a request whose `Host` it does not expect (a guard against DNS rebinding). With- `--bind 0.0.0.0`, any IP address works, so `http://192.0.2.10:4317` works as is. To use a name such as- `http://server:4317`, add it to `SITREP_ALLOWED_HOSTS` in `server.env` and restart.+ `--bind 0.0.0.0`, any IP address works, so `http://192.0.2.10:7487` works as is. To use a name such as+ `http://server:7487`, add it to `SITREP_ALLOWED_HOSTS` in `server.env` and restart.7. **Check it.**```shsystemctl --user status sitrep- curl -s -o /dev/null -w '%{http_code}\n' http://192.0.2.10:4317/api/fleet/state # 200+ curl -s -o /dev/null -w '%{http_code}\n' http://192.0.2.10:7487/api/fleet/state # 200```- Then open `http://192.0.2.10:4317` from the laptop.+ Then open `http://192.0.2.10:7487` from the laptop.On macOS, the same install writes `~/Library/LaunchAgents/dev.sitrep.server.plist` instead and loads it with`launchctl`; it starts at login and its output goes to `~/.sitrep/server.log`.@@ -94,7 +94,7 @@ Then:```shssh server "sed -n 's/^SITREP_TOKEN=//p' ~/.sitrep/server.env" \- | npx tsx scripts/install.ts --claude --codex --url http://192.0.2.10:4317 --token-stdin+ | npx tsx scripts/install.ts --claude --codex --url http://192.0.2.10:7487 --token-stdin```Check the dry run, then run it again with `--apply`. Leave out `--claude` or `--codex` for a machine without that tool.@@ -104,12 +104,12 @@ the rule below, with the secret from the local `server.env`.**Which URL the local reporters get.** With `--url`, both reporters use it. Without it, on a machine with a serverconfig (`--server` in this run, or `~/.sitrep/server.env` already there), every run that configures the reporters setsthem to that server's address, replacing a saved URL: the host is this run's `--bind`, else the saved `HOST`, else-`127.0.0.1`, and the port is this run's `--port`, else the saved `PORT`, else `4317`. `--bind` and `--port` set where+`127.0.0.1`, and the port is this run's `--port`, else the saved `PORT`, else `7487`. `--bind` and `--port` set wherethe server listens, so the install takes them only with `--server` and refuses them otherwise; to point the reportersat a server, use `--url`. A server bound to `0.0.0.0` or `::` is reached at `127.0.0.1`; one bound to a specific address(`localhost`, `::1`, any `127.x`, or a LAN address such as `192.0.2.10`) is reached at that address (an IPv6 address in-brackets). On a machine without a server config, a reporter set up for the first time sends to `http://127.0.0.1:4317`-and one set up before keeps its URL: pass `--url` there. When the reporters send to a LAN address over plain HTTP,+brackets). On a machine without a server config, a reporter set up for the first time sends to `http://127.0.0.1:7487`+and one set up before keeps the URL it was given (a Claude plugin never given one follows the default): pass `--url` there. When the reporters send to a LAN address over plain HTTP,Claude Code on that machine shows its plain-HTTP warning (`⚠` in the status line and a toast); `--bind 0.0.0.0`, as in[Deploy](#deploy-the-server), keeps them on `127.0.0.1` without it.@@ -176,7 +176,7 @@ The plugin adds one command:| Port | What ||---|---|-| 4317/tcp on the server | Everything: the reporters' API, the dashboard, and its live stream (Server-Sent Events). `PORT` changes it |+| 7487/tcp on the server | Everything: the reporters' API, the dashboard, and its live stream (Server-Sent Events). `PORT` changes it || 5173 on a development machine | The Vite dev server, only under `npm run dev` |Reporters only make outbound connections. `codex-reporter` talks to the local Codex daemon over its Unix socket, not a@@ -205,7 +205,7 @@ already in the environment, such as one from the service's `server.env`, wins ov| Setting | Default | Meaning ||---|---|---|| `HOST` | `127.0.0.1` | Where it listens. `0.0.0.0`, or the LAN address, for other machines |-| `PORT` | `4317` | Its port |+| `PORT` | `7487` | Its port || `SITREP_TOKEN` | none (the install makes one) | The admin secret: reporters send it in `X-Sitrep-Token`, and you sign in with it to answer sessions. Empty turns auth off: reports are taken from anyone and nothing can be answered. The server warns at start about one shorter than 24 characters || `SITREP_DB` | `<repository>/data/sitrep.sqlite` (the install sets `~/.sitrep/data/sitrep.sqlite`) | The SQLite database (WAL mode: `-wal` and `-shm` files sit beside it) || `SITREP_ALLOWED_HOSTS` | empty | Host names other machines type, comma-separated. `localhost`, `::1`, `127.x.x.x` and the `HOST` address always work; with `HOST=0.0.0.0` any IP address does |@@ -235,7 +235,7 @@ A timer, retention or stuck setting that is not a number of 0 or more reads as i| Setting | Default | Meaning ||---|---|---|-| `CODEX_REPORTER_SERVER_URL` | `http://127.0.0.1:4317` | Where reports go |+| `CODEX_REPORTER_SERVER_URL` | `http://127.0.0.1:7487` | Where reports go || `CODEX_REPORTER_TOKEN` | none | The server's admin secret || `CODEX_REPORTER_RESPOND` | `everything` | How far Codex sessions here take answers: `off`, `questions`, `questions-and-plans` or `everything` || `CODEX_REPORTER_ACTIVITY_FEED` | on | Send the activity feed of a loop someone is watching; on unless `off`, `false` or `0`. Answering needs it on |@@ -252,14 +252,14 @@ its default.| Option | Default | Meaning ||---|---|---|-| `serverUrl` | `http://127.0.0.1:4317` | Where reports go. Empty reads as the default |+| `serverUrl` | `http://127.0.0.1:7487` | Where reports go. Empty reads as the default || `token` | empty | The server's admin secret, sent with every report and request; leave it empty when the server has none (a sensitive option: Claude Code keeps it in its secure storage) || `respond` | `everything` | What the session takes from the dashboard: `off` (nothing), `questions` (answers to questions, and new messages while idle), `questions-and-plans` (also approving or sending back a plan) or `everything` (also allowing once or denying a tool, and `/clear`, `/compact`). Any other value reads as `off`. Needs `activityFeed` on and the server's `SITREP_RESPOND` || `activityFeed` | on | While the dashboard has a loop's panel open, send that loop's last 20 tool calls and the text between them (each cut to 300 characters, secrets redacted), and for a Bash call its whole command (up to 20,000 characters, secrets redacted) and how it ended; command output is never sent. The server keeps it in memory only. Answering needs it on || `flushIntervalMs` | `1000` | The least time between reports while something changes, in milliseconds; less than 200 reads as 200 || `heartbeatMs` | `5000` | Report at least this often even when nothing changed, in milliseconds; less than 1000 reads as 1000 || `sessionName` | empty | A display name for this machine's sessions, used after the `/sitrep name` name and Claude Code's own title ([In a Claude Code session](#in-a-claude-code-session)). Usually left empty |-| `showStatus` | on | Show the reporter's state in the status line under the prompt: `dashboard v<version> ● N live`, the version the dashboard's own, as the dashboard shows it under its name (the plugin's is in `/sitrep`); or `○ offline`, `○ connecting` or `○ token refused` in place of the count, with `· update plugin`, `· update server` or `· update available` when the versions do not fit, and `⚠` first when the server is plain HTTP beyond this machine |+| `showStatus` | on | Show the reporter's state in the status line under the prompt: `dashboard v<version> ● N live`, where the version is the dashboard's own, as the dashboard shows it under its name (the plugin's is in `/sitrep`). In place of the count it shows `○ connecting` (with no version until the server first answers), `○ offline` or `○ token refused`. After the count comes `· update plugin` or `· update server` when the versions do not fit, or `· update available` when a newer plugin exists. `⚠` comes first when the server is plain HTTP beyond this machine || `fullPrompts` | off | Send each agent's whole task prompt and final answer (up to 20,000 characters each, secrets redacted) so the dashboard can show them in full. Off, only the first 400 characters are sent |## Files and services@@ -291,7 +291,7 @@ that means:report over plain HTTP. Anyone who can watch the LAN can copy it.- **The secret can answer.** With it, anyone can answer prompts and send messages to any Claude Code session, and anydaemon-hosted Codex session, on any machine. Your sign-in in the browser also crosses the LAN in clear.-- **Reading is open.** Anyone who can reach port 4317 sees every session without signing in: names, machines, paths,+- **Reading is open.** Anyone who can reach port 7487 sees every session without signing in: names, machines, paths,branches, plan steps, and bounded, redacted excerpts of prompts, answers, commands, failed-tool output and messagesagents send each other.- **What leaves each machine.** The reports carry all of that in clear over the LAN; their free text is redacted on the@@ -305,7 +305,7 @@ that means:Ways to narrow it, from least to most work:-- Listen on the LAN address and allow port 4317 only from the LAN (see [Deploy](#deploy-the-server)).+- Listen on the LAN address and allow port 7487 only from the LAN (see [Deploy](#deploy-the-server)).- Close reading: Settings → Server → Require sign-in to view, or `SITREP_REQUIRE_SIGN_IN_TO_VIEW=on` as the default.The dashboard then shows nothing before the sign-in.- Turn answering off: Settings → Server → Answering, or `SITREP_RESPOND=off` as the default. The secret then@@ -429,11 +429,11 @@ Sessions on the laptop keep running when it leaves the LAN; its reporters queuereach it over SSH from outside:```sh-ssh -N -L 4317:127.0.0.1:4317 server+ssh -N -L 7487:127.0.0.1:7487 server```-The dashboard is then at `http://localhost:4317`, a secure context, so browser notifications work there. (If the-server listens only on its LAN address, use `-L 4317:192.0.2.10:4317`. If something on the laptop already uses 4317,+The dashboard is then at `http://localhost:7487`, a secure context, so browser notifications work there. (If the+server listens only on its LAN address, use `-L 7487:192.0.2.10:7487`. If something on the laptop already uses 7487,pick another local port and use it below.) Settings → About gives this command for the server's address and port, andSettings → This browser shows it while notifications are unavailable.@@ -441,11 +441,11 @@ Point the laptop's reporters at the tunnel:```shssh server "sed -n 's/^SITREP_TOKEN=//p' ~/.sitrep/server.env" \- | npx tsx scripts/install.ts --claude --codex --url http://127.0.0.1:4317 --token-stdin --apply+ | npx tsx scripts/install.ts --claude --codex --url http://127.0.0.1:7487 --token-stdin --apply```With that, the laptop reports only while the tunnel runs, on the LAN or off it; keep the tunnel up whenever you work,-or switch back with `--url http://192.0.2.10:4317` when you are home. `--url` moves Claude Code's telemetry endpoint+or switch back with `--url http://192.0.2.10:7487` when you are home. `--url` moves Claude Code's telemetry endpointwith the plugin's URL; Claude Code reads it at start, so a session started before the switch sends its usage to the oldaddress until restarted.diff --git a/docs/TUTORIAL.md b/docs/TUTORIAL.mdindex 64cfab4..0a61fd5 100644--- a/docs/TUTORIAL.md+++ b/docs/TUTORIAL.md@@ -7,7 +7,7 @@ Every screenshot is the real interface fed by `scripts/sim.ts`; no project, path```shnpm ci-npm run dev # the server on :4317, the dashboard on http://localhost:5173+npm run dev # the server on :7487, the dashboard on http://localhost:5173```In a second terminal, in the same folder:@@ -23,13 +23,12 @@ in its environment.## The Fleet-+The home view. At the top, a chip per state; press one to show only those sessions. At the bar's end, today's estimated-spend and each provider's plan window nearest its limit; press them for the usage panel. Headless runs and sessions-nobody is attached to sit behind a chip that counts them (**Headless**, **Detached**), there when the fleet has any.--+spend and each provider's plan window nearest its limit; press them for the usage panel, open in the picture above.+Headless runs and sessions nobody is attached to sit behind a chip that counts them (**Headless**, **Detached**), there+when the fleet has any.The usage panel: estimated spend by model (today, the last 7 days or all time, ended sessions included), cost perminute and output tokens per second. It stays open or closed as you leave it. Each machine's spend and plan windowsdiff --git a/docs/tutorial/01-fleet-cards.png b/docs/tutorial/01-fleet-cards.pngindex 58cfbf3..440f4e8 100644Binary files a/docs/tutorial/01-fleet-cards.png and b/docs/tutorial/01-fleet-cards.png differdiff --git a/docs/tutorial/02-fleet-list.png b/docs/tutorial/02-fleet-list.pngindex 374a303..5b3ed16 100644Binary files a/docs/tutorial/02-fleet-list.png and b/docs/tutorial/02-fleet-list.png differdiff --git a/docs/tutorial/03-fleet-graph.png b/docs/tutorial/03-fleet-graph.pngindex 419f1ee..e18cc19 100644Binary files a/docs/tutorial/03-fleet-graph.png and b/docs/tutorial/03-fleet-graph.png differdiff --git a/docs/tutorial/04-plans.png b/docs/tutorial/04-plans.pngindex 14a0aeb..ccef948 100644Binary files a/docs/tutorial/04-plans.png and b/docs/tutorial/04-plans.png differdiff --git a/docs/tutorial/05-fleet-light.png b/docs/tutorial/05-fleet-light.pngindex df20f72..ac84960 100644Binary files a/docs/tutorial/05-fleet-light.png and b/docs/tutorial/05-fleet-light.png differdiff --git a/docs/tutorial/06-usage.png b/docs/tutorial/06-usage.pngdeleted file mode 100644index 8b45c09..0000000Binary files a/docs/tutorial/06-usage.png and /dev/null differdiff --git a/docs/tutorial/07-session.png b/docs/tutorial/07-session.pngindex 50a7612..06000c7 100644Binary files a/docs/tutorial/07-session.png and b/docs/tutorial/07-session.png differdiff --git a/docs/tutorial/08-machines.png b/docs/tutorial/08-machines.pngindex 46e1a1c..d266961 100644Binary files a/docs/tutorial/08-machines.png and b/docs/tutorial/08-machines.png differdiff --git a/docs/tutorial/09-add-a-machine.png b/docs/tutorial/09-add-a-machine.pngindex e162d51..b28695f 100644Binary files a/docs/tutorial/09-add-a-machine.png and b/docs/tutorial/09-add-a-machine.png differdiff --git a/docs/tutorial/10-settings.png b/docs/tutorial/10-settings.pngindex f6c66ad..27244b0 100644Binary files a/docs/tutorial/10-settings.png and b/docs/tutorial/10-settings.png differdiff --git a/docs/tutorial/11-history.png b/docs/tutorial/11-history.pngindex 6b42bf6..85a36d3 100644Binary files a/docs/tutorial/11-history.png and b/docs/tutorial/11-history.png differdiff --git a/frontend/package.json b/frontend/package.jsonindex 6ba25e3..4c0d93e 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -1,5 +1,6 @@{"name": "frontend",+ "version": "0.4.0","private": true,"license": "MIT","type": "module",diff --git a/frontend/vite.config.ts b/frontend/vite.config.tsindex d201c90..940877e 100644--- a/frontend/vite.config.ts+++ b/frontend/vite.config.ts@@ -2,7 +2,7 @@ import { defineConfig } from "vite";import react from "@vitejs/plugin-react";// Proxy to 127.0.0.1 rather than "localhost", which can resolve to ::1 first and fail. PORT matches the server's PORT.-const apiTarget = `http://127.0.0.1:${process.env.PORT ?? "4317"}`;+const apiTarget = `http://127.0.0.1:${process.env.PORT ?? "7487"}`;export default defineConfig({plugins: [react()],diff --git a/hermes-reporter/README.md b/hermes-reporter/README.mdindex e846676..588268d 100644--- a/hermes-reporter/README.md+++ b/hermes-reporter/README.md@@ -37,7 +37,7 @@ again whenever it changes, so usage Hermes writes after a session ends reaches tIt uses codex-reporter's configuration, `codex-reporter/src/config.ts` (the environment, or a `.env` in the workingdirectory), so one env file serves both:-- `CODEX_REPORTER_SERVER_URL`: the dashboard server (default `http://127.0.0.1:4317`)+- `CODEX_REPORTER_SERVER_URL`: the dashboard server (default `http://127.0.0.1:7487`)- `CODEX_REPORTER_TOKEN`: the admin secret- `HERMES_HOME`: the Hermes home holding `state.db` (default `/hermes`, the sidecar's mount)diff --git a/hermes-reporter/package.json b/hermes-reporter/package.jsonindex 8ba3f17..fc1ceeb 100644--- a/hermes-reporter/package.json+++ b/hermes-reporter/package.json@@ -1,6 +1,6 @@{"name": "hermes-reporter",- "version": "0.1.0",+ "version": "0.4.0","private": true,"license": "MIT","type": "module",diff --git a/hermes-reporter/src/main.ts b/hermes-reporter/src/main.tsindex 6423ad3..e599c87 100644--- a/hermes-reporter/src/main.ts+++ b/hermes-reporter/src/main.ts@@ -22,8 +22,10 @@ import { readMachine } from '../../codex-reporter/src/machine.js';import { clip, excerpt, promptName } from '../../codex-reporter/src/report.js';import { Transport } from '../../codex-reporter/src/transport.js';import { ACTIVE_WINDOW_MS, HermesStore, hermesHome, type LastTurn, type ModelTokens, type StoredAgent, type StoredSession } from './store.js';+// This package's manifest: the build copies it beside dist/hermes-reporter/src/, so the same import finds it there.+import manifest from '../package.json' with { type: 'json' };-export const VERSION = '0.1.0';+export const VERSION = manifest.version;const PROVIDER = 'hermes';/** codex-reporter's cadence: a pass every second, a heartbeat every 5 s. */const TICK_MS = 1000;diff --git a/mod/claude-reporter/.claude-plugin/plugin.json b/mod/claude-reporter/.claude-plugin/plugin.jsonindex d348bf1..8cda3c1 100644--- a/mod/claude-reporter/.claude-plugin/plugin.json+++ b/mod/claude-reporter/.claude-plugin/plugin.json@@ -1,13 +1,13 @@{"name": "sitrep-reporter",- "version": "0.3.0",+ "version": "0.4.0","description": "Reports this Claude Code session (model, effort, plan, agents, context, git, failures) to a SITREP server, and takes answers sent from it.","userConfig": {"serverUrl": {"type": "string","title": "SITREP server URL","description": "Where the reporter posts session reports.",- "default": "http://127.0.0.1:4317"+ "default": "http://127.0.0.1:7487"},"token": {"type": "string",@@ -37,7 +37,7 @@"showStatus": {"type": "boolean","title": "Status line",- "description": "The reporter's state under the prompt: 'dashboard v<the dashboard's version> ● N live', '○ connecting', '○ offline' or '○ token refused', then '· update plugin', '· update server' or '· update available' when the versions differ.",+ "description": "The reporter's state under the prompt: 'dashboard v<the dashboard's version> ● N live', or '○ connecting', '○ offline' or '○ token refused' in place of the count; after the count, '· update plugin' or '· update server' when the versions do not fit, '· update available' when a newer plugin exists.","default": true},"fullPrompts": {diff --git a/mod/claude-reporter/hooks/register.ts b/mod/claude-reporter/hooks/register.tsindex d5ccddd..6983a77 100644--- a/mod/claude-reporter/hooks/register.ts+++ b/mod/claude-reporter/hooks/register.ts@@ -24,8 +24,6 @@ import { answeredLine, answersByQuestion, asDecision, LINE_MESSAGES_ON, LINE_OPEimport { addEvent, addFeedEntry, afterCompaction, afterStep, agentAsked, agentSpawned, apiFailure, backgroundLines, continuedAs, drainEvents, endSession, isWatched, markTextSent, measure, newSession, NO_FILES, notified, patchFeedEntry, promptShown, setAttached, setBackground, setFiles, setGit, setIdentity, setWatched, toolAborted, toolResult, toolStarted, turnComplete, turnStart, withListedAgents, withSkill, type ListedAgent, type MeasureInput, type SentTexts, type SessionState } from './state.ts';import { headersFor, isDelivery, retryWaitMs, Transport, type PostOutcome } from './transport.ts';-/** The version this reporter reports; kept equal to `version` in .claude-plugin/plugin.json. */-export const VERSION = '0.3.0';const GIT_POLL_MS = 10_000;/** How much of a transcript's end is read for Claude's generated title: Claude Code's own head and tail read (2.1.319* `LITE_READ_BUF_SIZE`, 65536), which holds the title because Claude re-appends it every half of that written. */@@ -34,7 +32,7 @@ const TITLE_TAIL_BYTES = 65_536;const END_FLUSH_MS = 1000;/** How much text of one watched step is read before the rest passes unread: far more than one 300-character entry needs. */const STEP_TEXT_MAX = 8000;-const DEFAULT_SERVER = 'http://127.0.0.1:4317';+const DEFAULT_SERVER = 'http://127.0.0.1:7487';type Engine = EngineInterface;@@ -468,6 +466,21 @@ async function devBuildOf($: Engine): Promise<string | null> {return root ? devBuild(runnerFor($, { timeoutMs: 5000 }), root) : null;}+/**+ * This plugin's version, from its own manifest, .claude-plugin/plugin.json under the plugin's folder. `unknown`, with the error+ * kept, when it cannot be read: the server then reads the plugin's compatibility as unknown, and no number is made up.+ */+async function ownVersion($: Engine): Promise<string> {+ try {+ const { version } = JSON.parse(await $.fs.read(`${$.plugin.root}/.claude-plugin/plugin.json`)) as { version?: unknown };+ if (typeof version !== 'string' || version === '') throw new Error('.claude-plugin/plugin.json has no version');+ return version;+ } catch (err) {+ logError($, 'version', err);+ return 'unknown';+ }+}+/** A string the store keeps under `key`, trimmed; null for anything else, an empty one, or a failed read. */async function stored($: Engine, key: string): Promise<string | null> {const v = await quietly<unknown>(() => $.store.get(key), null);@@ -1110,11 +1123,13 @@ async function sessionStarted($: Engine, e: { cwd: string; surface: string | nulstate = setIdentity(state, { cwd: e.cwd, projectRoot: top, repoName: repoNameOf(top, repo), model });if (usage) state = measure(state, usageFigures(usage));if (!same) state = addEvent(state, 'start', null, startText(model, null), now, { surface: e.surface });- // The plugin's folder is fixed while this code is loaded, so its commit is read at the load's first session.start only.+ // The plugin's folder is fixed while this code is loaded, so its commit and its version are read at the load's first+ // session.start only.const build = prev ? (prev.reporter.build ?? null) : await devBuildOf($);+ const version = prev ? prev.reporter.version : await ownVersion($);const transport =prev?.transport ??- new Transport((url, init) => $.http.fetch(url, init), { serverUrl: opts.serverUrl, token: opts.token, heartbeatMs: opts.heartbeatMs, version: VERSION }, (line) => void keepError('transport', line));+ new Transport((url, init) => $.http.fetch(url, init), { serverUrl: opts.serverUrl, token: opts.token, heartbeatMs: opts.heartbeatMs, version }, (line) => void keepError('transport', line));const machine = prev?.machine ?? (await thisMachine($));const storedName = await stored($, `name:${id}`);const sessionCwd = await quietly<string | null>(() => $.session.cwd(), null);@@ -1124,7 +1139,7 @@ async function sessionStarted($: Engine, e: { cwd: string; surface: string | nulstopTimers: () => {},reporter: {name: 'claude-reporter',- version: VERSION,+ version,engineVersion: engine?.version ?? null,hostSurface: sessionKind !== undefined ? 'background' : (e.surface ?? 'headless'),...(build ? { build } : {}),@@ -1214,7 +1229,7 @@ async function dashboardCommand($: Engine, args: string): Promise<string> {const lines = [`SITREP: ${trimTrailingSlashes(opts.serverUrl)}/#/`,`Connection: ${connection}`,- `Versions: plugin ${withBuild(VERSION, r.reporter.build)}${t.serverVersion ? ` · server ${withBuild(t.serverVersion, t.serverBuild)}` : ''}`,+ `Versions: plugin ${withBuild(r.reporter.version, r.reporter.build)}${t.serverVersion ? ` · server ${withBuild(t.serverVersion, t.serverBuild)}` : ''}`,t.versionNotice() ?? t.updateNotice(),`Reports: ${reports.join(' · ')}`,failure ? `Last error: ${failure}` : null,diff --git a/package-lock.json b/package-lock.jsonindex 060e513..76b0232 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,10 +1,12 @@{"name": "sitrep",+ "version": "0.4.0","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "sitrep",+ "version": "0.4.0","license": "MIT","workspaces": ["server",@@ -23,6 +25,7 @@}},"codex-reporter": {+ "version": "0.4.0","license": "MIT","dependencies": {"ws": "^8.22.0"@@ -38,6 +41,7 @@}},"frontend": {+ "version": "0.4.0","license": "MIT","dependencies": {"d3-force": "^3.0.0",@@ -58,7 +62,7 @@}},"hermes-reporter": {- "version": "0.1.0",+ "version": "0.4.0","license": "MIT","devDependencies": {"@types/node": "^24.19.2",@@ -4811,7 +4815,7 @@}},"server": {- "version": "0.1.0",+ "version": "0.4.0","license": "MIT","dependencies": {"dotenv": "^18.0.9",diff --git a/package.json b/package.jsonindex 6f4e6f1..6af9d19 100644--- a/package.json+++ b/package.json@@ -1,5 +1,6 @@{"name": "sitrep",+ "version": "0.4.0","private": true,"license": "MIT","type": "module",@@ -18,7 +19,8 @@"test": "npm run test -w server","typecheck": "npm run typecheck -w server && npm run typecheck -w frontend && npm run typecheck -w codex-reporter && npm run typecheck -w hermes-reporter && tsc -p scripts/tsconfig.json --noEmit && bash mod/claude-reporter/typecheck.sh","lint": "eslint .",- "check:protocol": "cmp server/src/fleet/protocol.ts mod/claude-reporter/hooks/protocol.ts"+ "check:protocol": "cmp server/src/fleet/protocol.ts mod/claude-reporter/hooks/protocol.ts",+ "version": "node scripts/plugin-versions.mjs"},"devDependencies": {"concurrently": "^10.0.6",diff --git a/scripts/codex-reporter.env.example b/scripts/codex-reporter.env.exampleindex 8220733..cf636ab 100644--- a/scripts/codex-reporter.env.example+++ b/scripts/codex-reporter.env.example@@ -2,8 +2,8 @@# install.ts copies this template to ~/.sitrep/codex-reporter.env (mode 0600) and fills in the server URL and# the admin secret. One KEY=VALUE per line; a line starting with # is a comment. Restart the service after a change.-# Where reports go: the server's URL as this machine reaches it (default http://127.0.0.1:4317).-CODEX_REPORTER_SERVER_URL=http://127.0.0.1:4317+# Where reports go: the server's URL as this machine reaches it (default http://127.0.0.1:7487).+CODEX_REPORTER_SERVER_URL=http://127.0.0.1:7487# The server's admin secret, sent as X-Sitrep-Token. Empty when the server runs without one.CODEX_REPORTER_TOKEN=diff --git a/scripts/install.ts b/scripts/install.tsindex 62647b9..7fca9a5 100644--- a/scripts/install.ts+++ b/scripts/install.ts@@ -17,6 +17,8 @@ import path from 'node:path';import { createInterface } from 'node:readline';import { fileURLToPath } from 'node:url';import { parseArgs } from 'node:util';+// The release's manifest, for the version this script gives as its own when it connects to Codex.+import release from '../package.json' with { type: 'json' };const HELP = `install: set up the SITREP server and this machine's reporters.@@ -40,10 +42,10 @@ Options:--url URL The server URL the reporters send to. Without it, on a machine with a server config (--server inthis run, or ~/.sitrep/server.env), both reporters are set to that server's address onevery run: host = --bind, else the saved HOST, else 127.0.0.1 (0.0.0.0 and :: mean 127.0.0.1; any- other address as given); port = --port, else the saved PORT, else 4317. On a machine without one,- a reporter keeps the URL it has, and a new one sends to http://127.0.0.1:4317+ other address as given); port = --port, else the saved PORT, else 7487. On a machine without one,+ a reporter keeps the URL it has, and a new one sends to http://127.0.0.1:7487--bind ADDR Where the server listens (default 127.0.0.1; 0.0.0.0 lets other machines report). With --server only- --port N The server's port (default 4317). With --server only+ --port N The server's port (default 7487). With --server only--token-stdin Read the server's admin secret for the reporters from stdin. Without it the reporters use thesecret in this machine's ~/.sitrep/server.env when there is one--apply Make the changes@@ -365,7 +367,7 @@ export function localServerUrl(o: Pick<InstallOptions, 'server' | 'bind' | 'portif (!o.server && !exists) return null;const saved = exists ? fs.readFileSync(SERVER_ENV, 'utf8') : '';const host = (o.bind ?? envValue(saved, KEYS.serverHost)) || '127.0.0.1';- const port = o.port !== null ? String(o.port) : envValue(saved, KEYS.serverPort) || '4317';+ const port = o.port !== null ? String(o.port) : envValue(saved, KEYS.serverPort) || '7487';const reach = host === '0.0.0.0' || host === '::' ? '127.0.0.1' : host.includes(':') ? `[${host}]` : host;return `http://${reach}:${port}`;}@@ -393,7 +395,7 @@ export function claudePluginOptions(plugin: string): { configured?: unknown; inp}/** The Claude plugin's default server URL, as mod/claude-reporter/.claude-plugin/plugin.json declares it. */-export const CLAUDE_DEFAULT_URL = 'http://127.0.0.1:4317';+export const CLAUDE_DEFAULT_URL = 'http://127.0.0.1:7487';/** The URL the Claude plugin sends to: its saved serverUrl, else its default. */export function claudePluginUrl(options: ReturnType<typeof claudePluginOptions>): string {@@ -494,12 +496,12 @@ function serviceBlockers(svc: Service, built: string): string[] {function installPlan(o: InstallOptions): Step[] {const steps: Step[] = [];- const port = o.port ?? 4317;+ const port = o.port ?? 7487;const localServer = localServerUrl(o);// The URL both reporters are set to on this run, replacing a saved one: --url, else this machine's server. Null (no// server here) keeps a reporter's saved URL, and a new one gets the Claude plugin's default.const chosenUrl = o.url ?? localServer;- const url = chosenUrl ?? 'http://127.0.0.1:4317';+ const url = chosenUrl ?? 'http://127.0.0.1:7487';let newServerSecret: string | null = null;if (o.server) {@@ -730,7 +732,7 @@ export async function openCodexAppServer(): Promise<CodexAppServer> {const socket = daemonSocket();const rpc = socket ? await overSocket(socket) : overStdio();try {- await rpc.call('initialize', { clientInfo: { name: 'codex_app_server_daemon', title: 'SITREP install', version: '0.1.0' }, capabilities: null });+ await rpc.call('initialize', { clientInfo: { name: 'codex_app_server_daemon', title: 'SITREP install', version: release.version }, capabilities: null });rpc.notify('initialized');return rpc;} catch (err) {@@ -961,7 +963,7 @@ function readArgs(argv: string[]): (InstallOptions & { apply: boolean; tokenStdi});if (v.help) return 'help';const url = v.url === undefined ? null : v.url.replace(/\/+$/, '');- if (url !== null && !/^https?:\/\/[^\s/]+$/.test(url)) throw new Error(`--url must be http:// or https:// and a host, such as http://192.0.2.10:4317, not "${url}"`);+ if (url !== null && !/^https?:\/\/[^\s/]+$/.test(url)) throw new Error(`--url must be http:// or https:// and a host, such as http://192.0.2.10:7487, not "${url}"`);const port = v.port === undefined ? null : Number(v.port);if (port !== null && (!Number.isInteger(port) || port < 1 || port > 65535)) throw new Error('--port must be a whole number from 1 to 65535');const [server, claude, codex] = [v.server, v.claude, v.codex].map(Boolean);diff --git a/scripts/plugin-versions.mjs b/scripts/plugin-versions.mjsnew file mode 100644index 0000000..d325428--- /dev/null+++ b/scripts/plugin-versions.mjs@@ -0,0 +1,15 @@+#!/usr/bin/env node+// Writes the release's version, the root package.json's, into the two plugin manifests npm does not manage: the Claude Code+// plugin's and the Codex plugin's. npm runs it as the root package's `version` script, after+// npm version <version> --workspaces --include-workspace-root --no-git-tag-version+// has written the number into every package.json and the lockfile. A manifest that is missing or is not JSON stops it.+import fs from 'node:fs';++const root = new URL('../', import.meta.url);+const { version } = JSON.parse(fs.readFileSync(new URL('package.json', root), 'utf8'));+for (const file of ['mod/claude-reporter/.claude-plugin/plugin.json', 'codex-reporter/plugin/.codex-plugin/plugin.json']) {+ const manifest = JSON.parse(fs.readFileSync(new URL(file, root), 'utf8'));+ manifest.version = version;+ // The manifests' own layout, two-space indent and a final newline, so the version line is the only one that changes.+ fs.writeFileSync(new URL(file, root), `${JSON.stringify(manifest, null, 2)}\n`);+}diff --git a/scripts/server.env.example b/scripts/server.env.exampleindex 3d61454..3d9d9e2 100644--- a/scripts/server.env.example+++ b/scripts/server.env.example@@ -10,7 +10,7 @@# Where the server listens (default 127.0.0.1). 127.0.0.1 keeps it to this machine; 0.0.0.0 (or the LAN address) lets# other machines report to it and open the dashboard.HOST=127.0.0.1-PORT=4317+PORT=7487# The admin secret. Reporters send it in the X-Sitrep-Token header and you sign in with it to answer sessions.# Empty turns auth off: the server takes reports from anyone, and nothing can be answered from the dashboard. Thediff --git a/scripts/sim.ts b/scripts/sim.tsindex 90d7359..c785db8 100644--- a/scripts/sim.ts+++ b/scripts/sim.ts@@ -31,13 +31,15 @@ import {type Report,type TokenCounts,} from '../server/src/fleet/protocol.ts';+// The release's manifest: the reports claim its version by default, as this release's reporters do.+import release from '../package.json' with { type: 'json' };const HELP = `sim: POST simulated Claude Code and Codex session reports to a SITREP server.Usage: npx tsx scripts/sim.ts [options]Options:- --url URL The dashboard server; reports and Claude telemetry go to it. Default http://127.0.0.1:4317+ --url URL The dashboard server; reports and Claude telemetry go to it. Default http://127.0.0.1:7487--sessions N Sessions open at a time, 1 to 50; each one that ends is replaced. Default 5--codex SHARE The part of them that are Codex sessions, 0 to 1. Default 0.4--machines N Machines to spread them over, 1 to 8: a Mac laptop first, then Linux servers. Default 3@@ -49,8 +51,8 @@ Options:tools failing in a row (errored), more blowouts, and plan windows filling faster--agents N Ad-hoc agents every session starts with, beyond its plan, to load the UI. Default 0--nested Keep one Claude session whose agents launch agents, four levels deep- --reporter-version V The reporter version the reports claim. Default 0.1.0-sim, outside every range the server- reads, so it shows no update warning+ --reporter-version V The reporter version the reports claim. Default ${release.version}, this release's version, which fits a+ server of the same release, so it shows no update warning--print Send nothing: write each report, and each Claude telemetry export with the machine it comesfrom, to stdout as one JSON line. Ends after --ticks--ticks N With --print, the simulated seconds to run. Default 60@@ -325,7 +327,7 @@ const FEED_SCRIPT: Record<Provider, [ActivityEntry['kind'], string][]> = {['tool', 'Grep "lastActivityAt" in server/src/fleet'],['tool', 'Edit server/src/fleet/derive.ts'],['tool', 'Bash npm test -- derive'],- ['tool', 'Bash curl -H "Authorization: [redacted]" http://127.0.0.1:4317/api/fleet/state'],+ ['tool', 'Bash curl -H "Authorization: [redacted]" http://127.0.0.1:7487/api/fleet/state'],['text', 'Tests pass; the panel is next.'],],codex: [@@ -1278,7 +1280,7 @@ function readArgs(argv: string[]): Args | null {return null;}return {- url: (v.url ?? 'http://127.0.0.1:4317').replace(/\/+$/, ''),+ url: (v.url ?? 'http://127.0.0.1:7487').replace(/\/+$/, ''),sessions: Math.round(numberArg('sessions', v.sessions, 1, 50, 5)),codex: numberArg('codex', v.codex, 0, 1, 0.4),machines: Math.round(numberArg('machines', v.machines, 1, 8, 3)),@@ -1288,7 +1290,7 @@ function readArgs(argv: string[]): Args | null {chaos: v.chaos ?? false,extraAgents: Math.round(numberArg('agents', v.agents, 0, 190, 0)),nested: v.nested ?? false,- reporterVersion: v['reporter-version'] ?? '0.1.0-sim',+ reporterVersion: v['reporter-version'] ?? release.version,print: v.print ?? false,ticks: Math.round(numberArg('ticks', v.ticks, 1, 1e7, 60)),};diff --git a/server/package.json b/server/package.jsonindex dfe49ea..e7b96a8 100644--- a/server/package.json+++ b/server/package.json@@ -1,6 +1,6 @@{"name": "server",- "version": "0.1.0",+ "version": "0.4.0","private": true,"license": "MIT","type": "module",diff --git a/server/src/fleet/compat.ts b/server/src/fleet/compat.tsindex 438a9ad..924e448 100644--- a/server/src/fleet/compat.ts+++ b/server/src/fleet/compat.ts@@ -1,20 +1,40 @@-// Which reporter versions this server reads correctly: one range per reporter, moved only when the report format or a+// Which reporter versions this server reads correctly: one range per reporter, from the oldest version of it this server reads+// correctly to the server's own version. A release carries one version for the server and every reporter, so a reporter of+// the server's own release always fits and a release changes nothing here; a floor moves only when the report format or a// reporter's behaviour changes. Only major and minor are compared, so a patch release never raises a warning.import { readFileSync } from 'node:fs';import path from 'node:path';import type { ReporterCompat, ReporterSupport } from './protocol.js';-/** For each reporter the server knows, the oldest and newest version it reads correctly. A reporter not listed reads as unknown. */+let version: string | undefined;++/** The server's own version, read once from server/package.json, two folders up from this file in src/ and dist/ alike. */+export function serverVersion(): string {+ if (version === undefined) {+ try {+ const manifest = JSON.parse(readFileSync(path.join(import.meta.dirname, '..', '..', 'package.json'), 'utf8')) as { version?: unknown };+ version = typeof manifest.version === 'string' ? manifest.version : 'unknown';+ } catch {+ version = 'unknown';+ }+ }+ return version;+}++/**+ * For each reporter the server knows, the oldest version of it the server reads correctly (`min`) and the server's own (`max`).+ * A reporter not listed reads as unknown.+ */export const REPORTER_SUPPORT: { readonly [reporter: string]: ReporterSupport } = {// From 0.2.0 plan windows carry `measuredAt` and the surface is reported, and asks, answers and results name the session// `<native id>@<machine id>`, which 0.1.0 does not, so it cannot be answered. 0.3.0 sends no usage: Claude usage comes// from Claude Code's own telemetry, and no version's usage is read.- 'claude-reporter': { min: '0.2.0', max: '0.3.0' },+ 'claude-reporter': { min: '0.2.0', max: serverVersion() },// 0.2.0 took usage from Codex's per-response records, which spend trusts; 0.3.0 adds `measuredAt` and the thread's// originator and names the session `<native id>@<machine id>` on the answer routes, so 0.2.0 cannot be answered.- 'codex-reporter': { min: '0.3.0', max: '0.3.0' },+ 'codex-reporter': { min: '0.3.0', max: serverVersion() },// Hermes sessions, observed only.- 'hermes-reporter': { min: '0.1.0', max: '0.1.0' },+ 'hermes-reporter': { min: '0.1.0', max: serverVersion() },};/** A reporter's range; null when the server has none for it, which is accepted and reads as `unknown`. */@@ -30,29 +50,18 @@ function majorMinor(version: string | null | undefined): [number, number] | null/** Below 0 when `a` is the older of the two, above 0 when it is the newer, 0 when major and minor agree. */const older = (a: [number, number], b: [number, number]): number => a[0] - b[0] || a[1] - b[1];-/** Where a version stands against a reporter's range; `unknown` when there is no range, or the version or a bound does not parse. */+/**+ * Where a version stands against a reporter's range; `unknown` when there is no range, or the version or the bound it is+ * compared with does not parse. The floor is checked by itself, so a version too old reads as outdated whatever the top is.+ */export function checkReporter(version: string | null | undefined, support: ReporterSupport | null): ReporterCompat {const [v, oldest, newest] = [version, support?.min, support?.max].map(majorMinor);- if (!v || !oldest || !newest) return 'unknown';+ if (!v || !oldest) return 'unknown';if (older(v, oldest) < 0) return 'outdated';+ if (!newest) return 'unknown';return older(v, newest) > 0 ? 'newer' : 'ok';}-let version: string | undefined;--/** The server's own version, read once from server/package.json, two folders up from this file in src/ and dist/ alike. */-export function serverVersion(): string {- if (version === undefined) {- try {- const manifest = JSON.parse(readFileSync(path.join(import.meta.dirname, '..', '..', 'package.json'), 'utf8')) as { version?: unknown };- version = typeof manifest.version === 'string' ? manifest.version : 'unknown';- } catch {- version = 'unknown';- }- }- return version;-}-/** What SITREP_BUILD holds on a dev build: its commit, 7 to 40 hex digits, then `-dirty` when it had changes. */const BUILD = /^[0-9a-f]{7,40}(-dirty)?$/;diff --git a/server/src/index.ts b/server/src/index.tsindex 617e803..e995745 100644--- a/server/src/index.ts+++ b/server/src/index.ts@@ -24,7 +24,7 @@ const REPO_ROOT = path.join(import.meta.dirname, '..', '..');loadEnv({ path: path.join(REPO_ROOT, '.env'), quiet: true });const env = process.env;-const PORT = env.PORT ? Number(env.PORT) : 4317;+const PORT = env.PORT ? Number(env.PORT) : 7487;const HOST = env.HOST || '127.0.0.1';const DB_PATH = env.SITREP_DB || path.join(REPO_ROOT, 'data', 'sitrep.sqlite');// The owner's price overrides, laid over the shipped copy of LiteLLM's table and its refresh at start (pricing.ts).