@superbased/observer 1.4.6 → 1.4.8
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 +94 -12
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
[](https://github.com/marmutapp/superbased-observer)
|
|
6
6
|
|
|
7
7
|
**Capture, normalize, compress, and analyze every AI coding tool call you
|
|
8
|
-
run** — across Claude Code, Codex, Cursor, Cline / Roo Code,
|
|
9
|
-
Copilot — in one local single-binary
|
|
10
|
-
data leaves your machine.
|
|
8
|
+
run** — across Claude Code, Codex, Cursor, Cline / Roo Code, GitHub
|
|
9
|
+
Copilot, OpenCode, OpenClaw, and Pi — in one local single-binary
|
|
10
|
+
tool. No telemetry, no cloud, no data leaves your machine.
|
|
11
11
|
|
|
12
12
|
```
|
|
13
13
|
┌──────────────┐ ┌──────────────────────────────────┐
|
|
@@ -105,14 +105,24 @@ Different clients send to different upstreams. The local proxy on
|
|
|
105
105
|
`127.0.0.1:8820` handles all of them — routes by URL path. Set the
|
|
106
106
|
env var that matches your client(s); both can coexist on one machine.
|
|
107
107
|
|
|
108
|
-
| AI client | Env var |
|
|
109
|
-
|
|
110
|
-
| **Claude Code** | `ANTHROPIC_BASE_URL=http://127.0.0.1:8820` |
|
|
111
|
-
| **Cursor** (Anthropic mode) | `ANTHROPIC_BASE_URL=http://127.0.0.1:8820` |
|
|
112
|
-
| **Codex** | `OPENAI_BASE_URL=http://127.0.0.1:8820/v1` (note `/v1`) |
|
|
113
|
-
| **Cursor** (OpenAI mode) | `OPENAI_BASE_URL=http://127.0.0.1:8820/v1` |
|
|
114
|
-
| **Cline / Roo Code** | `ANTHROPIC_BASE_URL=...` or `OPENAI_BASE_URL=...` per provider |
|
|
115
|
-
| **GitHub Copilot** |
|
|
108
|
+
| AI client | Env var | Capture mode |
|
|
109
|
+
|---------------------------------|-------------------------------------------------------|--------------|
|
|
110
|
+
| **Claude Code** | `ANTHROPIC_BASE_URL=http://127.0.0.1:8820` | proxy + JSONL |
|
|
111
|
+
| **Cursor** (Anthropic mode) | `ANTHROPIC_BASE_URL=http://127.0.0.1:8820` | proxy + JSONL |
|
|
112
|
+
| **Codex** | `OPENAI_BASE_URL=http://127.0.0.1:8820/v1` (note `/v1`) | proxy + JSONL |
|
|
113
|
+
| **Cursor** (OpenAI mode) | `OPENAI_BASE_URL=http://127.0.0.1:8820/v1` | proxy + JSONL |
|
|
114
|
+
| **Cline / Roo Code** | `ANTHROPIC_BASE_URL=...` or `OPENAI_BASE_URL=...` per provider | proxy + JSONL |
|
|
115
|
+
| **GitHub Copilot** | (no proxy yet) | JSONL only |
|
|
116
|
+
| **OpenCode** ([opencode.ai](https://opencode.ai/)) | (no proxy yet) | SQLite — `~/.opencode/opencode.db`. Captures **token counts + model + cost** per assistant message from OpenCode's own InfoData (`tokens.input/output/reasoning/cache.{read,write}` + `cost`). Tagged `Source=jsonl, Reliability=approximate`. |
|
|
117
|
+
| **OpenClaw** ([openclaw.ai](https://openclaw.ai/)) | (no proxy yet) | JSONL + sqlite — `~/.openclaw/tasks/runs.sqlite` + `~/.openclaw/agents/<agent>/sessions/sessions.json` |
|
|
118
|
+
| **Pi** ([pi.dev](https://pi.dev/)) | (no proxy yet) | JSONL only — `~/.pi/agent/sessions/*.jsonl` |
|
|
119
|
+
|
|
120
|
+
**JSONL-only** clients are captured passively by the watcher (always-on,
|
|
121
|
+
no setup beyond `observer init`). You won't see real-time cost numbers
|
|
122
|
+
for them on the Compression tab (those need the proxy), but every tool
|
|
123
|
+
call shows up on Sessions / Actions / Discovery / Tools / Patterns and
|
|
124
|
+
the JSONL-derived token counts feed the Cost tab with `Source=jsonl`
|
|
125
|
+
+ `Reliability=unreliable` tags.
|
|
116
126
|
|
|
117
127
|
### Persistent setups
|
|
118
128
|
|
|
@@ -660,6 +670,58 @@ max_age_days = 365
|
|
|
660
670
|
|
|
661
671
|
## Troubleshooting
|
|
662
672
|
|
|
673
|
+
### `npm install -g` fails with `EACCES: permission denied`
|
|
674
|
+
|
|
675
|
+
Default npm puts globals under `/usr/local/lib/node_modules` which
|
|
676
|
+
Homebrew-managed Node owns as root on macOS. Three fixes; pick one:
|
|
677
|
+
|
|
678
|
+
```bash
|
|
679
|
+
# 1) RECOMMENDED — point npm at a user-writable prefix.
|
|
680
|
+
mkdir -p ~/.npm-global
|
|
681
|
+
npm config set prefix '~/.npm-global'
|
|
682
|
+
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
|
|
683
|
+
source ~/.zshrc
|
|
684
|
+
npm install -g @superbased/observer
|
|
685
|
+
|
|
686
|
+
# 2) Use a Node version manager — fnm / nvm install Node into your
|
|
687
|
+
# home directory and dodge the permission issue entirely.
|
|
688
|
+
brew install fnm
|
|
689
|
+
fnm install --lts
|
|
690
|
+
npm install -g @superbased/observer
|
|
691
|
+
|
|
692
|
+
# 3) sudo (works but you'll fight permissions on every update).
|
|
693
|
+
sudo npm install -g @superbased/observer
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
### `observer: command not found` after install
|
|
697
|
+
|
|
698
|
+
The shim binary is at `~/.npm-global/bin/observer` (or wherever your
|
|
699
|
+
npm prefix points). Make sure that directory is on `$PATH`:
|
|
700
|
+
|
|
701
|
+
```bash
|
|
702
|
+
echo $PATH | tr ':' '\n' | grep -E 'npm|node'
|
|
703
|
+
# add the prefix's bin/ to PATH if missing — see fix above
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
If you installed only a platform package (e.g. `@superbased/observer-darwin-x64`)
|
|
707
|
+
without the main `@superbased/observer`, the shim doesn't get created
|
|
708
|
+
— there's no `bin` field. Install the main package; npm picks up the
|
|
709
|
+
right platform binary automatically via `optionalDependencies`.
|
|
710
|
+
|
|
711
|
+
### `observer init` says "no tools selected and none auto-detected"
|
|
712
|
+
|
|
713
|
+
Auto-detection looks for the AI clients' default session-log dirs
|
|
714
|
+
(`~/.claude/projects/`, `~/.codex/sessions/`, `~/.cursor/`, etc.).
|
|
715
|
+
On a fresh machine where no client has run yet, those dirs don't
|
|
716
|
+
exist. Pass the flag explicitly:
|
|
717
|
+
|
|
718
|
+
```bash
|
|
719
|
+
observer init --claude-code # or --codex / --cursor / --cline / --all
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
This registers hooks regardless — the next time the client runs,
|
|
723
|
+
its dirs get created and the watcher picks them up.
|
|
724
|
+
|
|
663
725
|
### Empty dashboard / "No proxy traffic"
|
|
664
726
|
|
|
665
727
|
The JSONL adapter populates passively after `observer init`, but
|
|
@@ -701,7 +763,27 @@ Race condition between concurrent daemon startups, fixed in 1.4.1.
|
|
|
701
763
|
Upgrade. If you still see it, run daemons serially: `observer
|
|
702
764
|
watch`, wait, then `observer dashboard`, then `observer proxy
|
|
703
765
|
start` (or just use `observer start` which runs all three in one
|
|
704
|
-
process).
|
|
766
|
+
process — proxy + watcher + dashboard).
|
|
767
|
+
|
|
768
|
+
### `observer start` log says only `proxy + observer` — no `:8081`
|
|
769
|
+
|
|
770
|
+
You're on a pre-1.4.7 build. Earlier versions ran only proxy +
|
|
771
|
+
watcher under `observer start`; the dashboard had to be started
|
|
772
|
+
separately via `observer dashboard --addr 127.0.0.1:8081`. Upgrade
|
|
773
|
+
to 1.4.7+ — the dashboard goroutine is now part of `observer start`
|
|
774
|
+
and the log line confirms all three: `proxy <addr> + watcher +
|
|
775
|
+
dashboard http://127.0.0.1:8081`. Pass `--no-dashboard` to opt out.
|
|
776
|
+
|
|
777
|
+
### "address already in use" on port 8820
|
|
778
|
+
|
|
779
|
+
Another `observer proxy start` or `observer start` is still running.
|
|
780
|
+
Find it with `pgrep -af 'observer (proxy|start)'` and `kill <pid>`.
|
|
781
|
+
On macOS:
|
|
782
|
+
|
|
783
|
+
```bash
|
|
784
|
+
lsof -nP -iTCP:8820 -sTCP:LISTEN
|
|
785
|
+
kill <pid>
|
|
786
|
+
```
|
|
705
787
|
|
|
706
788
|
### Dashboard port already in use
|
|
707
789
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superbased/observer",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8",
|
|
4
4
|
"description": "SuperBased Observer — capture, normalize, compress, and analyze AI coding tool activity across Claude Code, Codex, Cursor, Cline/Roo, and Copilot.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"LICENSE"
|
|
37
37
|
],
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@superbased/observer-linux-x64": "1.4.
|
|
40
|
-
"@superbased/observer-linux-arm64": "1.4.
|
|
41
|
-
"@superbased/observer-darwin-x64": "1.4.
|
|
42
|
-
"@superbased/observer-darwin-arm64": "1.4.
|
|
43
|
-
"@superbased/observer-win32-x64": "1.4.
|
|
39
|
+
"@superbased/observer-linux-x64": "1.4.8",
|
|
40
|
+
"@superbased/observer-linux-arm64": "1.4.8",
|
|
41
|
+
"@superbased/observer-darwin-x64": "1.4.8",
|
|
42
|
+
"@superbased/observer-darwin-arm64": "1.4.8",
|
|
43
|
+
"@superbased/observer-win32-x64": "1.4.8"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"test": "node bin/observer.js --version"
|