@superbased/observer 1.18.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -42
- package/README.template.md +22 -6
- package/package.json +13 -8
package/README.md
CHANGED
|
@@ -7,12 +7,27 @@
|
|
|
7
7
|
|
|
8
8
|
**Homepage:** [https://superbased.app/](https://superbased.app/)
|
|
9
9
|
|
|
10
|
-
**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
**Claude Code cost tracking. Cursor token usage. Codex spend.
|
|
11
|
+
AI coding agent observability — one local tool, proxy-accurate.**
|
|
12
|
+
SuperBased Observer captures, normalizes, and analyzes every AI
|
|
13
|
+
coding tool call across **26 adapters** — Claude Code, Codex, Cursor,
|
|
14
|
+
Cline + Cline CLI, GitHub Copilot (VS Code) + Copilot CLI, Gemini CLI,
|
|
15
|
+
OpenCode, Google Antigravity, Cowork, Nous Research's Hermes Agent,
|
|
16
|
+
Kilo Code (legacy IDE extension + CLI), Aider, Goose, Devin, OpenClaw,
|
|
17
|
+
Pi, and more — in one local single-binary tool. An optional API proxy
|
|
18
|
+
reconciles the *exact* tokens your provider billed (net input, cache
|
|
19
|
+
5m/1h splits, reasoning tokens, long-context surcharges) instead of a
|
|
20
|
+
JSONL-derived estimate. No telemetry, no cloud, no data leaves your
|
|
21
|
+
machine.
|
|
22
|
+
|
|
23
|
+
**Two planes, one binary.** Plane B is coding-agent observability —
|
|
24
|
+
desktop-first: this package, capturing your own AI coding tools, with
|
|
25
|
+
an optional team rollup server. Plane A is general LLM-app
|
|
26
|
+
observability — admin-server-first: OTLP trace/span capture, evals,
|
|
27
|
+
and an LLM-as-judge input-admission guardrail for an application you
|
|
28
|
+
host. Most installs only ever use Plane B; see the [main
|
|
29
|
+
repo](https://github.com/marmutapp/superbased-observer#readme) for
|
|
30
|
+
the full two-plane explainer.
|
|
16
31
|
|
|
17
32
|
<p align="center">
|
|
18
33
|
<img src="https://github.com/marmutapp/superbased-observer/raw/main/docs/assets/infographics/one-local-path.png" alt="One local path for AI coding activity" width="780">
|
|
@@ -22,6 +37,7 @@ No telemetry, no cloud, no data leaves your machine.
|
|
|
22
37
|
|
|
23
38
|
- [Install](#install)
|
|
24
39
|
- [Five-minute quickstart](#five-minute-quickstart)
|
|
40
|
+
- [Two planes, one binary](#two-planes-one-binary)
|
|
25
41
|
- [Per-AI-client setup](#per-ai-client-setup)
|
|
26
42
|
- [Architecture in detail](#architecture-in-detail)
|
|
27
43
|
- [Dashboard tour](#dashboard-tour)
|
|
@@ -125,6 +141,21 @@ MCP and codex routing are explicit-only because both write per-client
|
|
|
125
141
|
config files. Hooks self-heal on every `start`.
|
|
126
142
|
|
|
127
143
|
|
|
144
|
+
## Two planes, one binary
|
|
145
|
+
|
|
146
|
+
Everything below this line — proxy routing, per-client capture,
|
|
147
|
+
compression, cache, MCP tools — is **Plane B: coding-agent
|
|
148
|
+
observability**, desktop-first. It's what this package is for: a
|
|
149
|
+
local node that watches your own AI coding tools and gives you
|
|
150
|
+
proxy-accurate cost and cache numbers, with an optional team rollup
|
|
151
|
+
server for org-wide spend visibility. The same binary also ships
|
|
152
|
+
**Plane A: general LLM-app observability**, admin-server-first — OTLP
|
|
153
|
+
trace/span capture, evals, and an LLM-as-judge input-admission
|
|
154
|
+
guardrail for an application *you* host, whose end users route
|
|
155
|
+
through Observer. Most installs only ever touch Plane B; Plane A is
|
|
156
|
+
opt-in and unrelated to your own coding-agent traffic. Full explainer:
|
|
157
|
+
[superbased.app/docs/getting-started/two-planes](https://superbased.app/docs/getting-started/two-planes).
|
|
158
|
+
|
|
128
159
|
## Per-AI-client setup
|
|
129
160
|
|
|
130
161
|
### Routing through the proxy — the canonical section
|
|
@@ -277,10 +308,12 @@ requests.
|
|
|
277
308
|
|
|
278
309
|
### 5. MCP server (stdio) — opt-in via `observer init`
|
|
279
310
|
|
|
280
|
-
|
|
281
|
-
`
|
|
282
|
-
|
|
283
|
-
|
|
311
|
+
21 read-only tools are always registered — `check_file_freshness`,
|
|
312
|
+
`get_last_test_result`, `search_past_outputs`, `search_symbols`,
|
|
313
|
+
etc. — plus 4 more (`get_file`, `get_symbols`, `get_relations`,
|
|
314
|
+
`retrieve_stashed`) that register conditionally, only when the
|
|
315
|
+
capability they depend on (the proxy stash, or the codeintel index)
|
|
316
|
+
is actually configured.
|
|
284
317
|
Powers cross-client tool sharing: if Claude Code ran `go test`,
|
|
285
318
|
Cursor's MCP query for the latest test result will return Claude
|
|
286
319
|
Code's run. The code-aware tools (`get_symbols`, `get_relations`,
|
|
@@ -535,7 +568,7 @@ migrations 036 + 037 — never pushed to a Teams org server, pinned by
|
|
|
535
568
|
(`[cachetrack].retention_days = 90`); the maintenance tick prunes
|
|
536
569
|
stale `cache_*` rows alongside the existing retention pass.
|
|
537
570
|
|
|
538
|
-
Operator reference: [
|
|
571
|
+
Operator reference: [superbased.app/docs/guides/cache-tracking](https://superbased.app/docs/guides/cache-tracking).
|
|
539
572
|
|
|
540
573
|
### Suggestions tab
|
|
541
574
|
|
|
@@ -690,11 +723,12 @@ explaining the actual algorithm.
|
|
|
690
723
|
|
|
691
724
|
Once you've run `observer init` (it's opt-in — `observer start`
|
|
692
725
|
alone does NOT register the MCP server), every connected AI client
|
|
693
|
-
gets
|
|
694
|
-
`
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
726
|
+
gets 21 tools registered as an MCP server always, plus 4 more
|
|
727
|
+
(`get_file`, `get_symbols`, `get_relations`, `retrieve_stashed`) that
|
|
728
|
+
register conditionally, only when the capability they depend on is
|
|
729
|
+
actually configured. They're **read-only** queries against the
|
|
730
|
+
unified database, so any agent can read any other agent's recorded
|
|
731
|
+
work — true cross-platform tool-call sharing.
|
|
698
732
|
|
|
699
733
|
| Tool | Purpose |
|
|
700
734
|
|-----------------------------------|---------|
|
|
@@ -711,12 +745,17 @@ tool-call sharing.
|
|
|
711
745
|
| `get_cost_summary` | Daily / per-model / per-session cost rollups |
|
|
712
746
|
| `get_redundancy_report` | Stale rereads, repeated commands, cross-tool overlap for the project |
|
|
713
747
|
| `list_actions_around` | ±N actions adjacent to a pivot `action_id` — browse a session's local timeline cheaply |
|
|
714
|
-
| `get_file` | The file's current bytes (or at a given commit), with a path-safety gate + audit |
|
|
715
|
-
| `get_symbols` | Resolve a symbol name + range to its file path + body (codeintel-backed) |
|
|
716
|
-
| `get_relations` | Codeintel BFS — who calls / is called by this symbol |
|
|
717
748
|
| `search_symbols` | Fuzzy symbol search across the project's codeintel index (Tier-C) |
|
|
749
|
+
| `get_output_composition` | Code vs. explanation split of a session's output, by bytes, with the code:explanation ratio and languages used |
|
|
750
|
+
| `get_suggestions` | Top dollar/time-quantified cost & quality suggestions from the local advisor |
|
|
718
751
|
| `cache_status` | Live prompt-cache health: which caches are warm, expiring, or cold, with value-at-risk |
|
|
719
752
|
| `get_model_recommendation` | Evidence-backed model suggestion per turn-kind, from the local Model Value Report |
|
|
753
|
+
| `get_routing_status` | Model-routing layer state: phase, available policy templates, tier-table size, decision-log counters |
|
|
754
|
+
| `continue_session` | A distilled, scrubbed handover of a session from another AI tool, so you can continue its work here |
|
|
755
|
+
| `get_session_message` | One full, un-excerpted message from a session's transcript — pulls the complete body a handover excerpt truncated |
|
|
756
|
+
| `get_file` _(conditional)_ | The file's current bytes (or at a given commit), with a path-safety gate + audit |
|
|
757
|
+
| `get_symbols` _(conditional)_ | Resolve a symbol name + range to its file path + body (codeintel-backed) |
|
|
758
|
+
| `get_relations` _(conditional)_ | Codeintel BFS — who calls / is called by this symbol |
|
|
720
759
|
| `retrieve_stashed` _(conditional)_| Pulls original bytes of a tool_result the proxy compressed away. Only registered when `[compression.conversation].stash` is configured. |
|
|
721
760
|
|
|
722
761
|
**Cost trade-off**: with the MCP registered, the AI client sends the
|
|
@@ -899,13 +938,9 @@ The word **"variant"** in `codex-variant` refers to the *model variant* (the `-c
|
|
|
899
938
|
after a deeper repro showed it was within noise. The numbers above
|
|
900
939
|
are the post-retraction floor.
|
|
901
940
|
|
|
902
|
-
**Reproduce it yourself:**
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
# Full methodology, raw arm data, per-arm cost rows, and a reproducer
|
|
906
|
-
# script live in this repo:
|
|
907
|
-
docs/v1.7.23-compression-savings-empirical-2026-06-01.md
|
|
908
|
-
```
|
|
941
|
+
**Reproduce it yourself:** the numbers above are workload-specific, not a
|
|
942
|
+
guarantee — A/B your own traffic with `observer profile show <name>` and
|
|
943
|
+
an OFF-baseline comparison before relying on any of them in production.
|
|
909
944
|
|
|
910
945
|
|
|
911
946
|
## Cost and token math
|
|
@@ -1001,6 +1036,18 @@ What makes it different from standalone command-guards:
|
|
|
1001
1036
|
guardrails suggested from your own observed spend (p95 + headroom)
|
|
1002
1037
|
with a daily burn-down meter, MCP pin approvals, and one-click
|
|
1003
1038
|
compliance evidence downloads.
|
|
1039
|
+
- **Alerting, not just logging.** Guard verdicts and budget/obs-alert
|
|
1040
|
+
crossings can push out through desktop toast notifications
|
|
1041
|
+
(`[guard.alerts] desktop = true`) and outbound webhooks — generic,
|
|
1042
|
+
Slack, Discord, or PagerDuty (`[[guard.cloud.webhooks]]` for guard
|
|
1043
|
+
events; the org server's per-budget and per-obs-alert-rule webhook
|
|
1044
|
+
columns for spend/eval alerts) — each behind its own opt-in, routed
|
|
1045
|
+
through one egress worker with an endpoint allowlist and a payload
|
|
1046
|
+
cap. Nothing fires until you configure it.
|
|
1047
|
+
- **Optional process observability.** `[observer.process]` (opt-in,
|
|
1048
|
+
off by default) attaches the OS-level process tree — Linux eBPF or
|
|
1049
|
+
Windows ETW — beneath each captured session, for runtime side
|
|
1050
|
+
effects hooks alone can't see.
|
|
1004
1051
|
|
|
1005
1052
|
Honest scope: hooks see declared commands, not side effects (use OS
|
|
1006
1053
|
sandboxes for containment — the guard detects and recommends them);
|
|
@@ -1020,17 +1067,13 @@ observer guard simulate --since 168h # what would last week have flagged?
|
|
|
1020
1067
|
observer guard enable --enforce # flip to enforce when ready
|
|
1021
1068
|
```
|
|
1022
1069
|
|
|
1023
|
-
Full
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
[guard-enforce-runbook.md](https://github.com/marmutapp/superbased-observer/blob/main/docs/guard-enforce-runbook.md)
|
|
1031
|
-
(the observe→enforce migration),
|
|
1032
|
-
[guard-compliance.md](https://github.com/marmutapp/superbased-observer/blob/main/docs/guard-compliance.md)
|
|
1033
|
-
(SOC 2 / NIST mapping).
|
|
1070
|
+
Full reference: [superbased.app/docs/guides/security-guard](https://superbased.app/docs/guides/security-guard)
|
|
1071
|
+
(concepts, modes, the observe→enforce path, Teams policy merge, the honest
|
|
1072
|
+
"what guard does NOT do" list). The rule catalog, policy-authoring cookbook,
|
|
1073
|
+
enforce runbook, and SOC 2 / NIST compliance mapping ship as
|
|
1074
|
+
`docs/guard-rules.md`, `docs/guard-policy-authoring.md`,
|
|
1075
|
+
`docs/guard-enforce-runbook.md`, and `docs/guard-compliance.md` in the
|
|
1076
|
+
source repository.
|
|
1034
1077
|
|
|
1035
1078
|
## Terminology and glossary
|
|
1036
1079
|
|
|
@@ -1060,7 +1103,8 @@ dashboard) has the full versions with cross-links.
|
|
|
1060
1103
|
bodies. Pass 1 = per-content-type compression, Pass 2 = drop with
|
|
1061
1104
|
marker. See [Compression mechanisms](#compression-mechanisms).
|
|
1062
1105
|
- **Cross-platform tool calling** — every AI client connected via
|
|
1063
|
-
`observer init` can call the
|
|
1106
|
+
`observer init` can call the 25 MCP tools (21 always-on + 4
|
|
1107
|
+
conditional) against the unified
|
|
1064
1108
|
database. So Cursor's `get_last_test_result` can return a `go test`
|
|
1065
1109
|
Claude Code ran an hour earlier.
|
|
1066
1110
|
- **Cross-thread reread** — the parent thread re-reads a file the
|
|
@@ -1121,11 +1165,11 @@ Every command supports `--help` for the full surface.
|
|
|
1121
1165
|
|------------------------------------|---------|
|
|
1122
1166
|
| `observer init` | Register hooks + MCP server + durable proxy routes with installed AI clients (each side defaults on; opt out with `--skip-hooks` / `--skip-mcp` / `--skip-proxy-route`). With **zero flags on a terminal** it runs an interactive checklist instead: detects your tools, previews each pending config write, and asks consent one write at a time (MCP never pre-selected). Any flag or redirected stdio keeps the batch behaviour. |
|
|
1123
1167
|
| `observer uninstall` | Reverse `observer init` |
|
|
1124
|
-
| `observer start` | Run watcher + dashboard + proxy in one process (recommended). Auto-opens the dashboard on interactive launches. Flags: `--dashboard-addr ADDR` (default `127.0.0.1:8081`), `--no-dashboard` to skip the HTTP UI, `--no-open` to skip the browser. |
|
|
1168
|
+
| `observer start` | Run watcher + dashboard + proxy in one process (recommended). Auto-opens the dashboard on interactive launches. Flags: `--dashboard-addr ADDR` (default `127.0.0.1:8081`; for a durable setting use `[dashboard].addr` in config or the `OBSERVER_DASHBOARD_ADDR` env var — precedence flag > env > config > default), `--no-dashboard` to skip the HTTP UI, `--no-open` to skip the browser. |
|
|
1125
1169
|
| `observer claude [-- args…]` | Launch Claude Code routed through the proxy for that session only (no config writes; fresh Pro/Max OAuth token re-exported so the SDK can't bypass). `--verify` runs pre-flight checks without launching. |
|
|
1126
1170
|
| `observer codex [-- args…]` | Launch Codex routed through the proxy for that session only (injects `openai_base_url` via argv; no config writes). |
|
|
1127
1171
|
| `observer watch` | Long-running JSONL watcher only |
|
|
1128
|
-
| `observer dashboard --addr ADDR` | HTTP dashboard only |
|
|
1172
|
+
| `observer dashboard --addr ADDR` | HTTP dashboard only. `--addr`/`--port` still win when passed; otherwise falls back to `OBSERVER_DASHBOARD_ADDR` > `[dashboard].addr` config > default. |
|
|
1129
1173
|
| `observer proxy start` | Reverse proxy only |
|
|
1130
1174
|
| `observer scan` | One-shot ingest of existing JSONL files (catch-up after install) |
|
|
1131
1175
|
| `observer status` | DB stats + recent activity |
|
|
@@ -1171,8 +1215,12 @@ anthropic_upstream = "https://api.anthropic.com"
|
|
|
1171
1215
|
openai_upstream = "https://api.openai.com"
|
|
1172
1216
|
|
|
1173
1217
|
[dashboard]
|
|
1174
|
-
|
|
1175
|
-
|
|
1218
|
+
# Durable dashboard listen address as host:port. Empty/omitted = the built-in
|
|
1219
|
+
# 127.0.0.1:8081 default. Precedence: `observer start --dashboard-addr` flag >
|
|
1220
|
+
# OBSERVER_DASHBOARD_ADDR env var > this value > default. Binds at daemon start
|
|
1221
|
+
# (restart to apply). A non-loopback host still fails closed unless [remote] is
|
|
1222
|
+
# armed.
|
|
1223
|
+
addr = "127.0.0.1:8081"
|
|
1176
1224
|
|
|
1177
1225
|
[compression.conversation]
|
|
1178
1226
|
enabled = false # opt-in; default off
|
package/README.template.md
CHANGED
|
@@ -7,12 +7,27 @@
|
|
|
7
7
|
|
|
8
8
|
**Homepage:** [https://superbased.app/](https://superbased.app/)
|
|
9
9
|
|
|
10
|
-
**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
**Claude Code cost tracking. Cursor token usage. Codex spend.
|
|
11
|
+
AI coding agent observability — one local tool, proxy-accurate.**
|
|
12
|
+
SuperBased Observer captures, normalizes, and analyzes every AI
|
|
13
|
+
coding tool call across **26 adapters** — Claude Code, Codex, Cursor,
|
|
14
|
+
Cline + Cline CLI, GitHub Copilot (VS Code) + Copilot CLI, Gemini CLI,
|
|
15
|
+
OpenCode, Google Antigravity, Cowork, Nous Research's Hermes Agent,
|
|
16
|
+
Kilo Code (legacy IDE extension + CLI), Aider, Goose, Devin, OpenClaw,
|
|
17
|
+
Pi, and more — in one local single-binary tool. An optional API proxy
|
|
18
|
+
reconciles the *exact* tokens your provider billed (net input, cache
|
|
19
|
+
5m/1h splits, reasoning tokens, long-context surcharges) instead of a
|
|
20
|
+
JSONL-derived estimate. No telemetry, no cloud, no data leaves your
|
|
21
|
+
machine.
|
|
22
|
+
|
|
23
|
+
**Two planes, one binary.** Plane B is coding-agent observability —
|
|
24
|
+
desktop-first: this package, capturing your own AI coding tools, with
|
|
25
|
+
an optional team rollup server. Plane A is general LLM-app
|
|
26
|
+
observability — admin-server-first: OTLP trace/span capture, evals,
|
|
27
|
+
and an LLM-as-judge input-admission guardrail for an application you
|
|
28
|
+
host. Most installs only ever use Plane B; see the [main
|
|
29
|
+
repo](https://github.com/marmutapp/superbased-observer#readme) for
|
|
30
|
+
the full two-plane explainer.
|
|
16
31
|
|
|
17
32
|
<p align="center">
|
|
18
33
|
<img src="https://github.com/marmutapp/superbased-observer/raw/main/docs/assets/infographics/one-local-path.png" alt="One local path for AI coding activity" width="780">
|
|
@@ -22,6 +37,7 @@ No telemetry, no cloud, no data leaves your machine.
|
|
|
22
37
|
|
|
23
38
|
- [Install](#install)
|
|
24
39
|
- [Five-minute quickstart](#five-minute-quickstart)
|
|
40
|
+
- [Two planes, one binary](#two-planes-one-binary)
|
|
25
41
|
- [Per-AI-client setup](#per-ai-client-setup)
|
|
26
42
|
- [Architecture in detail](#architecture-in-detail)
|
|
27
43
|
- [Dashboard tour](#dashboard-tour)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superbased/observer",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.20.0",
|
|
4
|
+
"description": "Claude Code cost tracking, Cursor token usage, Codex spend — AI coding agent observability across 26 adapters, proxy-accurate token counts and cost.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
7
7
|
"observability",
|
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
"cursor",
|
|
13
13
|
"mcp",
|
|
14
14
|
"tokens",
|
|
15
|
-
"cost"
|
|
15
|
+
"cost",
|
|
16
|
+
"cost-tracking",
|
|
17
|
+
"token-usage",
|
|
18
|
+
"ai-coding-agent",
|
|
19
|
+
"llm-observability",
|
|
20
|
+
"spend"
|
|
16
21
|
],
|
|
17
22
|
"homepage": "https://superbased.app/",
|
|
18
23
|
"repository": {
|
|
@@ -36,11 +41,11 @@
|
|
|
36
41
|
"LICENSE"
|
|
37
42
|
],
|
|
38
43
|
"optionalDependencies": {
|
|
39
|
-
"@superbased/observer-linux-x64": "1.
|
|
40
|
-
"@superbased/observer-linux-arm64": "1.
|
|
41
|
-
"@superbased/observer-darwin-x64": "1.
|
|
42
|
-
"@superbased/observer-darwin-arm64": "1.
|
|
43
|
-
"@superbased/observer-win32-x64": "1.
|
|
44
|
+
"@superbased/observer-linux-x64": "1.20.0",
|
|
45
|
+
"@superbased/observer-linux-arm64": "1.20.0",
|
|
46
|
+
"@superbased/observer-darwin-x64": "1.20.0",
|
|
47
|
+
"@superbased/observer-darwin-arm64": "1.20.0",
|
|
48
|
+
"@superbased/observer-win32-x64": "1.20.0"
|
|
44
49
|
},
|
|
45
50
|
"scripts": {
|
|
46
51
|
"test": "node bin/observer.js --version"
|