@misha_misha/agentwatch 0.0.2 → 0.0.3
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 +368 -312
- package/dist/index.js +4602 -841
- package/package.json +15 -3
- package/dist/chunk-5QNDC2VP.js +0 -98
- package/dist/chunk-EMMMIDXY.js +0 -37
- package/dist/detect-JH6COHZ5.js +0 -7
- package/dist/workspace-N6FQVHKD.js +0 -9
package/README.md
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
**See what every AI coding agent on your machine is doing — in one terminal.**
|
|
6
6
|
|
|
7
|
-
Local-only observability for Claude Code,
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
Local-only observability for Claude Code, Codex, Gemini CLI, Cursor, and
|
|
8
|
+
OpenClaw — unified timeline, real token + cost accounting, compaction and
|
|
9
|
+
anomaly detection, an MCP server agents can query their own history from,
|
|
10
|
+
and an OpenTelemetry exporter with `gen_ai.*` semantic conventions. All
|
|
11
|
+
local. No cloud. No telemetry. No sign-in.
|
|
10
12
|
|
|
11
13
|
[](https://www.npmjs.com/package/@misha_misha/agentwatch)
|
|
12
14
|
[](https://github.com/mishanefedov/agentwatch/actions/workflows/ci.yml)
|
|
@@ -15,19 +17,8 @@ and permissions, in a single timeline.
|
|
|
15
17
|
|
|
16
18
|
</div>
|
|
17
19
|
|
|
18
|
-
<!--
|
|
19
|
-
Hero demo GIF — recorded on a real machine, ~30s, showing:
|
|
20
|
-
1. `npm i -g @misha_misha/agentwatch`
|
|
21
|
-
2. `agentwatch` launches, events streaming
|
|
22
|
-
3. Press `?` → hotkey reference
|
|
23
|
-
4. Press `P` → projects grid → Enter → sessions → Enter → scoped timeline
|
|
24
|
-
5. Press Enter on a Bash event → full stdout + duration
|
|
25
|
-
6. Press `p` → permissions view with flagged risks
|
|
26
|
-
-->
|
|
27
|
-
|
|
28
20
|
<div align="center">
|
|
29
|
-
<img src="./docs/demo.gif" alt="agentwatch demo" width="820"
|
|
30
|
-
onerror="this.style.display='none'" />
|
|
21
|
+
<img src="./docs/demo.gif" alt="agentwatch demo" width="820" />
|
|
31
22
|
</div>
|
|
32
23
|
|
|
33
24
|
---
|
|
@@ -37,23 +28,16 @@ and permissions, in a single timeline.
|
|
|
37
28
|
- [Why this exists](#why-this-exists)
|
|
38
29
|
- [Install](#install)
|
|
39
30
|
- [First 60 seconds](#first-60-seconds)
|
|
31
|
+
- [Agent coverage](#agent-coverage)
|
|
40
32
|
- [Features](#features)
|
|
41
|
-
- [Live multi-agent timeline](#live-multi-agent-timeline)
|
|
42
|
-
- [Event detail pane](#event-detail-pane)
|
|
43
|
-
- [Subagent drilldown](#subagent-drilldown)
|
|
44
|
-
- [Project and session navigation](#project-and-session-navigation)
|
|
45
|
-
- [Full-text search](#full-text-search)
|
|
46
|
-
- [Per-agent permission surface](#per-agent-permission-surface)
|
|
47
|
-
- [Per-session cost with cache accounting](#per-session-cost-with-cache-accounting)
|
|
48
|
-
- [Desktop notifications](#desktop-notifications)
|
|
49
|
-
- [Yank to clipboard](#yank-to-clipboard)
|
|
50
33
|
- [Keyboard reference](#keyboard-reference)
|
|
51
|
-
- [What agentwatch reads](#what-agentwatch-reads)
|
|
52
34
|
- [Configuration](#configuration)
|
|
35
|
+
- [What agentwatch reads](#what-agentwatch-reads)
|
|
36
|
+
- [MCP server mode](#mcp-server-mode)
|
|
37
|
+
- [OpenTelemetry exporter](#opentelemetry-exporter)
|
|
53
38
|
- [How it compares](#how-it-compares)
|
|
54
39
|
- [Limitations](#limitations)
|
|
55
40
|
- [Non-goals](#non-goals)
|
|
56
|
-
- [Roadmap](#roadmap)
|
|
57
41
|
- [Architecture](#architecture)
|
|
58
42
|
- [Development](#development)
|
|
59
43
|
- [Security](#security)
|
|
@@ -63,27 +47,19 @@ and permissions, in a single timeline.
|
|
|
63
47
|
|
|
64
48
|
## Why this exists
|
|
65
49
|
|
|
66
|
-
You
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
you what the others are doing.
|
|
50
|
+
You run three AI coding agents on one laptop. Claude Code in a terminal,
|
|
51
|
+
Codex alongside it, Cursor as your IDE, maybe Gemini CLI for a quick
|
|
52
|
+
review, maybe an OpenClaw sub-agent churning on a long task. Every one of
|
|
53
|
+
them has its own log file, its own permission model, its own idea of what
|
|
54
|
+
a "session" is. None of them tells you what the others are doing.
|
|
71
55
|
|
|
72
56
|
When something goes wrong — a file rewritten unexpectedly, a spend spike,
|
|
73
|
-
an `rm` you don't remember running — you're piecing it together from
|
|
57
|
+
an `rm` you don't remember running — you're piecing it together from five
|
|
74
58
|
JSONLs and guessing.
|
|
75
59
|
|
|
76
|
-
[`claude-devtools`](https://github.com/matt1398/claude-devtools)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- Single timeline: every agent's tool call, file op, shell exec, prompt,
|
|
81
|
-
response
|
|
82
|
-
- Per-agent attribution: `[auraqu] Bash: git log --oneline` or `[content_agent / sub:ab3c99fc] WebFetch: https://…`
|
|
83
|
-
- One unified permissions view: Claude allow/deny, Cursor approval mode,
|
|
84
|
-
OpenClaw sub-agents
|
|
85
|
-
- Local-only by design. No cloud. No telemetry. No sign-in. `lsof` will
|
|
86
|
-
show you there's nothing outbound.
|
|
60
|
+
[`claude-devtools`](https://github.com/matt1398/claude-devtools) does this
|
|
61
|
+
well for Claude Code. **agentwatch does it for the whole multi-agent
|
|
62
|
+
stack, in the terminal, with zero infrastructure and zero network.**
|
|
87
63
|
|
|
88
64
|
---
|
|
89
65
|
|
|
@@ -97,56 +73,73 @@ agentwatch
|
|
|
97
73
|
Requires:
|
|
98
74
|
|
|
99
75
|
- **Node ≥ 20** (tested on 20 + 22 in CI)
|
|
100
|
-
- **macOS or Linux** (Windows
|
|
76
|
+
- **macOS or Linux** (Windows intentionally out of scope for v0.x)
|
|
101
77
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
78
|
+
Published under the `@misha_misha` npm scope — the unscoped `agentwatch`
|
|
79
|
+
name was already taken by a CyberArk tool. The installed binary on your
|
|
80
|
+
`$PATH` is simply `agentwatch`.
|
|
105
81
|
|
|
106
82
|
---
|
|
107
83
|
|
|
108
84
|
## First 60 seconds
|
|
109
85
|
|
|
110
86
|
```bash
|
|
111
|
-
|
|
112
|
-
agentwatch
|
|
87
|
+
agentwatch doctor # detects installed agents + readiness
|
|
88
|
+
agentwatch # launches the TUI
|
|
89
|
+
agentwatch mcp # runs the MCP stdio server (for agents, not humans)
|
|
90
|
+
agentwatch --help
|
|
113
91
|
```
|
|
114
92
|
|
|
115
|
-
|
|
93
|
+
`doctor` output looks like:
|
|
116
94
|
|
|
117
95
|
```
|
|
118
96
|
workspace: /Users/you/IdeaProjects
|
|
119
97
|
|
|
120
98
|
agents:
|
|
121
|
-
● Claude Code
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
●
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
config: /Users/you/.gemini/settings.json
|
|
129
|
-
● OpenClaw installed
|
|
130
|
-
config: /Users/you/.openclaw
|
|
99
|
+
● Claude Code installed (events captured)
|
|
100
|
+
● Codex installed (events captured)
|
|
101
|
+
● Gemini CLI installed (events captured)
|
|
102
|
+
● Cursor installed (config-level only)
|
|
103
|
+
● OpenClaw installed (events captured)
|
|
104
|
+
○ Aider not detected
|
|
105
|
+
○ Cline (VS Code) not detected
|
|
131
106
|
```
|
|
132
107
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
# 2. Launch the TUI
|
|
137
|
-
agentwatch
|
|
138
|
-
```
|
|
108
|
+
Launch the TUI and every event your agents emit streams in. The last 4 MB
|
|
109
|
+
of each active session is backfilled on startup so you have immediate
|
|
110
|
+
context. Press **`?`** to see every hotkey.
|
|
139
111
|
|
|
140
|
-
|
|
141
|
-
on streams in. The last ~64 KB of each active session is backfilled so you
|
|
142
|
-
have immediate context.
|
|
112
|
+
---
|
|
143
113
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
114
|
+
## Agent coverage
|
|
115
|
+
|
|
116
|
+
What actually works per agent, as of v0.0.3. Features not listed here
|
|
117
|
+
work across every agent (timeline, export, syntax highlighting, notifications,
|
|
118
|
+
triggers, search, stale detection, clipboard yank).
|
|
119
|
+
|
|
120
|
+
| Feature | Claude Code | Codex | Gemini CLI | Cursor | OpenClaw |
|
|
121
|
+
| ------------------------------ | :---------: | :---: | :--------: | :----: | :------: |
|
|
122
|
+
| Live events on timeline | ✅ | ✅ | ✅ | 🟡 | ✅ |
|
|
123
|
+
| Token usage + cost | ✅ | ✅ | ✅ | ❌ | ✅ |
|
|
124
|
+
| Tool call + result pairing | ✅ | ✅ | ✅ | ❌ | 🟡 |
|
|
125
|
+
| Per-turn token attribution | ✅ | ✅ | ✅ | ❌ | ✅ |
|
|
126
|
+
| Budget alarms (session + day) | ✅ | ✅ | ✅ | ❌ | ✅ |
|
|
127
|
+
| Anomaly detection (cost/loops) | ✅ | ✅ | ✅ | 🟡 | ✅ |
|
|
128
|
+
| Compaction visualizer | ✅ | ✅ | ❌ | — | ❌ |
|
|
129
|
+
| Permissions view | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
130
|
+
| Cross-session search | ✅ | ✅ | ✅ | ❌ | ❌ |
|
|
131
|
+
| Subagent drilldown | ✅ | — | 🟡 | — | 🟡 |
|
|
132
|
+
| Agent memory file overhead | `CLAUDE.md` | `AGENTS.md` | `GEMINI.md` | `.cursorrules` | `OPENCLAW.md` |
|
|
133
|
+
| OTel span coverage | ✅ | ✅ | ✅ | 🟡 | ✅ |
|
|
134
|
+
| MCP server exposes history | ✅ | ✅ | ✅ (raw) | ❌ | ❌ |
|
|
135
|
+
|
|
136
|
+
- **Cursor** exposes config state (MCP servers, `.cursorrules`, approval
|
|
137
|
+
mode, sandbox) but its actual AI activity lives in a SQLite database we
|
|
138
|
+
haven't parsed yet. A thin read-only adapter is a follow-up.
|
|
139
|
+
- **Gemini CLI** doesn't persist context-compaction markers to disk, so
|
|
140
|
+
compaction detection is Claude + Codex only.
|
|
141
|
+
- **OpenClaw** doesn't persist tool_result content or compaction markers
|
|
142
|
+
to its JSONL — structural limit of what's on disk, not an adapter gap.
|
|
150
143
|
|
|
151
144
|
---
|
|
152
145
|
|
|
@@ -154,130 +147,173 @@ have immediate context.
|
|
|
154
147
|
|
|
155
148
|
### Live multi-agent timeline
|
|
156
149
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
`[project / sub-agent]` summary · duration · error flag.
|
|
150
|
+
Main screen. Every event your agents emit, ordered by event timestamp (not
|
|
151
|
+
arrival order, so backfill from different sessions merges correctly).
|
|
152
|
+
Columns: time · agent · type · `[project]` summary · duration · error.
|
|
161
153
|
|
|
162
154
|
```
|
|
163
|
-
09:54:01 openclaw response [content_agent] <think> Checked the
|
|
155
|
+
09:54:01 openclaw response [content_agent] <think> Checked the KB…
|
|
164
156
|
09:52:53 claude-code response [auraqu] Commit bddc363. q now exits instantly…
|
|
165
|
-
09:52:48
|
|
157
|
+
09:52:48 codex shell_exec [dataset_research] ls -la · 12ms
|
|
166
158
|
09:52:43 claude-code tool_call [auraqu] Edit: src/ui/App.tsx · 7ms
|
|
167
|
-
09:51:51
|
|
168
|
-
09:
|
|
159
|
+
09:51:51 gemini file_write [landing] write_file: public/llms.txt
|
|
160
|
+
09:51:51 claude-code tool_call [auraqu] Agent: Competitive landscape ▸ 52 child events
|
|
169
161
|
```
|
|
170
162
|
|
|
171
|
-
|
|
172
|
-
`file_write`, `file_change`, `session_start`. Each gets a risk-based color
|
|
173
|
-
(green / yellow / orange / red) so destructive shell execs and sensitive
|
|
174
|
-
file writes jump out visually.
|
|
163
|
+
Rows with an anomaly fire a red `◎` prefix on the type column.
|
|
175
164
|
|
|
176
165
|
### Event detail pane
|
|
177
166
|
|
|
178
|
-
Press **`Enter`** on any
|
|
167
|
+
Press **`Enter`** on any row. Opens a full-screen pane with:
|
|
179
168
|
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
- **Tool input** — JSON-pretty for Task / WebFetch / Grep arguments
|
|
169
|
+
- Metadata (time, agent, type, tool, path, cmd)
|
|
170
|
+
- Tokens / cost / duration (`in=6 cache_create=25508 cache_read=16827 out=353` · `$0.08 (claude-opus-4-6)` · `151ms`)
|
|
171
|
+
- Tool result — stdout for Bash, file content for Read/Write, search matches for Grep — with syntax highlighting inferred from the tool + file extension
|
|
172
|
+
- Full prompt or response text
|
|
173
|
+
- Extended thinking block when present
|
|
174
|
+
- Tool input JSON
|
|
187
175
|
|
|
188
176
|
Scrollable with `↑↓` or `j/k`. `esc` closes.
|
|
189
177
|
|
|
190
178
|
### Subagent drilldown
|
|
191
179
|
|
|
192
|
-
Parent `Agent` tool_use events show `▸ 52 child events`. Press **`x`**
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
This is the only multi-agent-observability feature claude-devtools has that
|
|
197
|
-
agentwatch matches *and* extends — because we cover non-Claude agents too.
|
|
180
|
+
Parent `Agent` tool_use events show `▸ 52 child events`. Press **`x`** to
|
|
181
|
+
scope the timeline to only that subagent's inner tool calls. `X` unscopes.
|
|
182
|
+
Applies to Claude Code (Task tool) and partially to OpenClaw (per-agent
|
|
183
|
+
delegation) and Gemini (subagent sessions).
|
|
198
184
|
|
|
199
|
-
### Project
|
|
185
|
+
### Project + session navigation
|
|
200
186
|
|
|
201
187
|
```
|
|
202
|
-
P
|
|
203
|
-
↓
|
|
204
|
-
|
|
205
|
-
sessions list (grouped Today / Yesterday / Last 7d / Older)
|
|
206
|
-
↓ pick one, Enter
|
|
207
|
-
↓
|
|
208
|
-
scoped timeline (only events from this session)
|
|
188
|
+
P → projects grid (one workspace per row, across all agents)
|
|
189
|
+
↓ enter → sessions list (grouped Today / Yesterday / 7d / Older)
|
|
190
|
+
↓ enter → scoped timeline
|
|
209
191
|
```
|
|
210
192
|
|
|
211
|
-
Projects grid aggregates across agents:
|
|
212
|
-
|
|
213
|
-
the first user prompt + event count + duration + cost per session.
|
|
214
|
-
`esc` always walks back one level.
|
|
193
|
+
Projects grid aggregates across agents: per-agent session counts, total
|
|
194
|
+
cost, last activity. `esc` walks back one level.
|
|
215
195
|
|
|
216
|
-
###
|
|
196
|
+
### Cross-session search (`?`)
|
|
217
197
|
|
|
218
|
-
Press
|
|
219
|
-
|
|
220
|
-
|
|
198
|
+
Press **`?`** — fuzzy-substring search across every session file on disk
|
|
199
|
+
(`~/.claude`, `~/.codex`, `~/.gemini`). Uses ripgrep if installed, falls
|
|
200
|
+
back to a native scan. Enter on a hit scopes the timeline to that session.
|
|
221
201
|
|
|
222
|
-
|
|
223
|
-
|
|
202
|
+
Different from in-buffer search:
|
|
203
|
+
- **`/`** — search the 500-event live buffer
|
|
204
|
+
- **`?`** — search every session file ever written
|
|
205
|
+
|
|
206
|
+
### Per-session cost with cache accounting
|
|
207
|
+
|
|
208
|
+
Naive token counters are 3–10× wrong on Claude because `cache_read` is
|
|
209
|
+
billed at 10% of input and `cache_creation` at 125%. agentwatch ships a
|
|
210
|
+
per-model rate table (Claude opus/sonnet/haiku, GPT-5 / GPT-5-mini,
|
|
211
|
+
Gemini 2.5 Pro/Flash) and computes true USD cost per turn. Cost shows:
|
|
212
|
+
|
|
213
|
+
- Per-agent total in the side panel
|
|
214
|
+
- Per-event in the detail pane
|
|
215
|
+
- Per-session in the sessions list
|
|
216
|
+
- Aggregate in the session's token attribution view (`[t]`)
|
|
217
|
+
|
|
218
|
+
### Per-turn token attribution (`[t]`)
|
|
219
|
+
|
|
220
|
+
Inside a scoped session, press **`t`**. Stacked bar per turn showing:
|
|
221
|
+
|
|
222
|
+
- `user` — the preceding prompt (tokenized with `gpt-tokenizer`)
|
|
223
|
+
- `memory file` — CLAUDE.md / AGENTS.md / GEMINI.md / .cursorrules / etc., read from the session's cwd
|
|
224
|
+
- `tool I/O` — tool_input JSON + tool_result text
|
|
225
|
+
- `thinking` — extended thinking block
|
|
226
|
+
- `input (fresh)` / `cache read` / `cache create` / `output` — exact from the model's own usage record
|
|
227
|
+
|
|
228
|
+
### Compaction visualizer (`[C]`)
|
|
229
|
+
|
|
230
|
+
Inside a scoped session, press **`C`**. Horizontal bar of context fill %
|
|
231
|
+
across turns, with `⋈` markers where the agent auto-compacted. Selected
|
|
232
|
+
compaction shows before / after token counts and the dropped-token delta.
|
|
233
|
+
Works on Claude Code (via `isCompactSummary`) and Codex (via
|
|
234
|
+
`event_msg/turn_truncated`).
|
|
235
|
+
|
|
236
|
+
### Budget alarms
|
|
237
|
+
|
|
238
|
+
`~/.agentwatch/budgets.json`:
|
|
239
|
+
|
|
240
|
+
```json
|
|
241
|
+
{ "perSessionUsd": 5, "perDayUsd": 20 }
|
|
224
242
|
```
|
|
225
243
|
|
|
226
|
-
|
|
244
|
+
Red banner in the Header when either cap is crossed; OS notification
|
|
245
|
+
fires once per crossing. No kill switch — we don't control agents; we
|
|
246
|
+
just shout.
|
|
227
247
|
|
|
228
|
-
|
|
248
|
+
### Anomaly detection
|
|
229
249
|
|
|
230
|
-
|
|
231
|
-
`Bash(*)` allows arbitrary shell; missing `~/.ssh` / `.aws` / `.gnupg`
|
|
232
|
-
denies; auto or bypass mode surfaces as red.
|
|
233
|
-
- **Cursor** — approval mode, sandbox state, allow/deny counts, MCP server
|
|
234
|
-
list, discovered `.cursorrules` file paths.
|
|
235
|
-
- **OpenClaw** — default workspace + per-sub-agent breakdown (name, emoji,
|
|
236
|
-
model, workspace).
|
|
250
|
+
Three detectors, all fully local, all running on the 500-event buffer:
|
|
237
251
|
|
|
238
|
-
|
|
239
|
-
|
|
252
|
+
- **MAD z-score outliers** on cost, duration, and input tokens per agent
|
|
253
|
+
(`|z| > 3.5` by default — tune in `~/.agentwatch/anomaly.json`)
|
|
254
|
+
- **Stuck-loop detector** with periods 1–4 — catches `A-A-A-…` and
|
|
255
|
+
`A-B-A-B-…` "apologize and retry" loops
|
|
256
|
+
- Per-session rollup + OS notification on first flag + timeline `◎` marker
|
|
257
|
+
+ `[D]` to dismiss the banner
|
|
240
258
|
|
|
241
|
-
###
|
|
259
|
+
### User-defined notification triggers
|
|
242
260
|
|
|
243
|
-
|
|
244
|
-
billed at 10% of input while `cache_creation` is billed at 125%. agentwatch
|
|
245
|
-
embeds a per-model rate table (opus-4-6, sonnet-4-6, haiku-4-5) and
|
|
246
|
-
computes true USD cost per turn.
|
|
261
|
+
`~/.agentwatch/triggers.json` — live-reloaded via chokidar:
|
|
247
262
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
263
|
+
```json
|
|
264
|
+
[
|
|
265
|
+
{ "match": "curl .* \\| (bash|sh)", "title": "pipe-to-shell", "body": "{{agent}}: {{cmd}}" },
|
|
266
|
+
{ "type": "file_write", "pathMatch": "^/etc/", "title": "/etc write" },
|
|
267
|
+
{ "thresholdUsd": 0.5, "title": "expensive turn", "body": "cost {{cost}}" }
|
|
268
|
+
]
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Placeholders: `{{agent}} {{type}} {{cmd}} {{path}} {{tool}} {{summary}} {{cost}}`.
|
|
251
272
|
|
|
252
273
|
### Desktop notifications
|
|
253
274
|
|
|
254
|
-
|
|
255
|
-
|
|
275
|
+
Built-in alerts fire on sensitive events — `.env` access, `~/.ssh` /
|
|
276
|
+
`~/.aws` / `~/.gnupg` paths, `rm -rf`, `sudo`, `curl | sh`, tool errors,
|
|
277
|
+
budget breach, anomaly. Rate-limited (60s per rule key). Silent during
|
|
278
|
+
backfill.
|
|
256
279
|
|
|
257
|
-
|
|
280
|
+
Platform dispatch: `osascript` on macOS, `notify-send` on Linux,
|
|
281
|
+
PowerShell `MessageBox` on Windows. Zero third-party dependencies.
|
|
258
282
|
|
|
259
|
-
-
|
|
260
|
-
- `~/.ssh`, `~/.aws`, `~/.gnupg` paths touched
|
|
261
|
-
- `rm -rf`, `sudo`, `curl | sh` in shell_exec
|
|
262
|
-
- Tool errors (`is_error: true`)
|
|
283
|
+
### Per-agent permission surface (`[p]`)
|
|
263
284
|
|
|
264
|
-
|
|
265
|
-
|
|
285
|
+
Scrollable view showing:
|
|
286
|
+
|
|
287
|
+
- **Claude Code** — allow / deny / defaultMode; flagged risks (`Bash(*)`, missing `.ssh` denies, `auto` / `bypass` modes in red)
|
|
288
|
+
- **Codex** — config.toml projects + trust_level; latest session's sandbox_policy, approval_policy, writable_roots, network_access, model
|
|
289
|
+
- **Gemini CLI** — auth type, selected model, tool allow/block lists, trusted folders
|
|
290
|
+
- **Cursor** — approval mode, sandbox state, MCP servers, discovered `.cursorrules`
|
|
291
|
+
- **OpenClaw** — default workspace + per-sub-agent (name, emoji, model, workspace)
|
|
292
|
+
|
|
293
|
+
### Session export (`[e]`)
|
|
294
|
+
|
|
295
|
+
From a session list or scoped timeline, press **`e`**. Writes
|
|
296
|
+
`./agentwatch-export/<agent>-<session>-<ts>.md` (human-readable transcript
|
|
297
|
+
with tool calls as fenced blocks) and `.json` (raw events). Path copied to
|
|
298
|
+
clipboard.
|
|
299
|
+
|
|
300
|
+
### Syntax highlighting in the detail pane
|
|
266
301
|
|
|
267
|
-
|
|
268
|
-
|
|
302
|
+
`cli-highlight` (tiny ANSI highlighter) applies to:
|
|
303
|
+
- Tool input JSON
|
|
304
|
+
- Tool result when the tool is Bash or the file extension is known (`.ts`, `.py`, `.rs`, `.go`, etc.)
|
|
305
|
+
- Fenced blocks in user/assistant text
|
|
269
306
|
|
|
270
|
-
###
|
|
307
|
+
### Stale-session detection
|
|
271
308
|
|
|
272
|
-
|
|
309
|
+
Sessions and projects idle for > 5 minutes render dimmed with a `⊘ stale`
|
|
310
|
+
badge. Un-greys on the next event.
|
|
273
311
|
|
|
274
|
-
|
|
275
|
-
- Otherwise full text (prompt / response)
|
|
276
|
-
- Otherwise cmd / path / summary
|
|
312
|
+
### Clipboard yank (`[y]`)
|
|
277
313
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
314
|
+
Copies the most useful payload (tool result > full text > cmd / path /
|
|
315
|
+
summary). Uses `pbcopy`, `wl-copy` / `xclip` / `xsel`, or `clip`.
|
|
316
|
+
Confirmation flashes at the footer.
|
|
281
317
|
|
|
282
318
|
---
|
|
283
319
|
|
|
@@ -292,8 +328,8 @@ Press **`?`** anytime to open this inside the TUI.
|
|
|
292
328
|
| `↑ ↓` / `j k` | move selection in the timeline |
|
|
293
329
|
| `Enter` | open event detail pane |
|
|
294
330
|
| `esc` | close current view / clear selection |
|
|
295
|
-
| `P` | projects grid
|
|
296
|
-
| `Enter` on project | sessions list for that project
|
|
331
|
+
| `P` | projects grid |
|
|
332
|
+
| `Enter` on project | sessions list for that project |
|
|
297
333
|
| `Enter` on session | scoped timeline for that session |
|
|
298
334
|
| `q` / `Ctrl-C` | quit |
|
|
299
335
|
|
|
@@ -301,107 +337,181 @@ Press **`?`** anytime to open this inside the TUI.
|
|
|
301
337
|
|
|
302
338
|
| Key | Action |
|
|
303
339
|
| ---- | ------------------------------------------------------------ |
|
|
304
|
-
| `/` |
|
|
305
|
-
|
|
|
340
|
+
| `/` | in-buffer search (last 500 events) |
|
|
341
|
+
| `?` | cross-session search (every session file on disk) |
|
|
342
|
+
| `f` | cycle agent filter |
|
|
306
343
|
| `a` | toggle agent side panel |
|
|
307
344
|
| `x` | drill selected Agent event into its subagent run |
|
|
308
345
|
| `X` | unscope subagent |
|
|
309
346
|
| `A` | clear project filter |
|
|
347
|
+
| `Z` | clear all filters |
|
|
310
348
|
|
|
311
349
|
### Actions
|
|
312
350
|
|
|
313
351
|
| Key | Action |
|
|
314
352
|
| --------- | ------------------------------------------- |
|
|
315
353
|
| `y` | yank selected event content to clipboard |
|
|
354
|
+
| `e` | export current session to `.md` + `.json` |
|
|
316
355
|
| `space` | pause / resume live event stream |
|
|
317
356
|
| `c` | clear event buffer |
|
|
357
|
+
| `D` | dismiss the current anomaly banner |
|
|
318
358
|
|
|
319
|
-
### Info
|
|
359
|
+
### Info overlays (only in a scoped session)
|
|
320
360
|
|
|
321
|
-
| Key | Action
|
|
322
|
-
| ------ |
|
|
323
|
-
| `
|
|
324
|
-
|
|
|
361
|
+
| Key | Action |
|
|
362
|
+
| ------ | ----------------------------------------- |
|
|
363
|
+
| `t` | per-turn token attribution |
|
|
364
|
+
| `C` | context compaction visualizer |
|
|
365
|
+
| `p` | permissions view (works anywhere) |
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## Configuration
|
|
370
|
+
|
|
371
|
+
Four config files, all optional. Loaded on startup; triggers reload live.
|
|
372
|
+
|
|
373
|
+
| File | Purpose |
|
|
374
|
+
| -------------------------------- | -------------------------------------------------------- |
|
|
375
|
+
| `~/.agentwatch/triggers.json` | User-defined notification rules (live-reloaded) |
|
|
376
|
+
| `~/.agentwatch/budgets.json` | `perSessionUsd` / `perDayUsd` spend caps |
|
|
377
|
+
| `~/.agentwatch/anomaly.json` | `zScore`, `loopWindow`, `loopMinRepeats`, `minSamples` |
|
|
378
|
+
|
|
379
|
+
Environment variables:
|
|
380
|
+
|
|
381
|
+
| Variable | Default | Purpose |
|
|
382
|
+
| ------------------------------ | --------------------------- | ----------------------------------------------------- |
|
|
383
|
+
| `WORKSPACE_ROOT` | `~/IdeaProjects` (fallback) | Where the generic filesystem watcher looks for edits |
|
|
384
|
+
| `AGENTWATCH_CONTEXT_WINDOW` | `200000` | Tokens per window — used by compaction % calculation |
|
|
385
|
+
| `AGENTWATCH_OTLP_ENDPOINT` | unset | Enables the OTel exporter when set |
|
|
386
|
+
| `NO_COLOR` | unset | Standard honoring: disables ANSI colors if set |
|
|
387
|
+
|
|
388
|
+
Workspace fallback chain (used when `WORKSPACE_ROOT` isn't set):
|
|
389
|
+
`~/IdeaProjects` → `~/src` → `~/code` → `~/Projects` → `~/dev` → `$HOME`.
|
|
325
390
|
|
|
326
391
|
---
|
|
327
392
|
|
|
328
393
|
## What agentwatch reads
|
|
329
394
|
|
|
330
|
-
|
|
331
|
-
|
|
395
|
+
Read-only. agentwatch writes to exactly two places: your terminal and the
|
|
396
|
+
clipboard (on explicit `y`) / disk (on explicit `e` to export).
|
|
397
|
+
|
|
398
|
+
| Path | What |
|
|
399
|
+
| ------------------------------------------------------------ | ---------------------------------------- |
|
|
400
|
+
| `~/.claude/projects/**/*.jsonl` | Claude Code session transcripts |
|
|
401
|
+
| `~/.claude/projects/**/subagents/*.jsonl` | Claude Code Task-spawned subagents |
|
|
402
|
+
| `~/.claude/settings.json` | Claude permissions |
|
|
403
|
+
| `~/.codex/sessions/**/rollout-*.jsonl` | Codex session transcripts |
|
|
404
|
+
| `~/.codex/config.toml` | Codex permissions + trust levels |
|
|
405
|
+
| `~/.gemini/tmp/**/chats/*.json` | Gemini CLI transcripts + tool calls |
|
|
406
|
+
| `~/.gemini/settings.json` + `trustedFolders.json` | Gemini permissions |
|
|
407
|
+
| `~/.openclaw/agents/*/sessions/*.jsonl` | OpenClaw sub-agent sessions |
|
|
408
|
+
| `~/.openclaw/logs/config-audit.jsonl` + `openclaw.json` | OpenClaw config audit + agent roster |
|
|
409
|
+
| `~/.cursor/{mcp.json, cli-config.json, ide_state.json}` | Cursor config state |
|
|
410
|
+
| Any `.cursorrules` / `.cursor/rules/*.mdc` under WORKSPACE | Cursor project rules |
|
|
411
|
+
| `{CLAUDE,AGENTS,GEMINI,OPENCLAW}.md` + `.windsurfrules` etc. | Per-agent memory files for token attribution |
|
|
412
|
+
| `~/.agentwatch/*.json` | User config (triggers / budgets / anomaly) |
|
|
413
|
+
| `$WORKSPACE_ROOT` tree | Filesystem change events |
|
|
414
|
+
|
|
415
|
+
`SECURITY.md` carries the authoritative list and details of what is *not* read.
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## MCP server mode
|
|
420
|
+
|
|
421
|
+
Run agentwatch as an MCP server so other agents can query their own
|
|
422
|
+
history. Install:
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
claude mcp add agentwatch -- npx -y @misha_misha/agentwatch mcp
|
|
426
|
+
# or edit ~/.claude.json / ~/.cursor/mcp.json manually
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Tools exposed:
|
|
332
430
|
|
|
333
|
-
|
|
|
334
|
-
|
|
|
335
|
-
|
|
|
336
|
-
|
|
|
337
|
-
|
|
|
338
|
-
|
|
|
339
|
-
|
|
|
340
|
-
| `~/.openclaw/openclaw.json` | OpenClaw agent roster |
|
|
341
|
-
| `~/.cursor/{mcp.json, cli-config.json, ide_state.json}` | Cursor state |
|
|
342
|
-
| Any `.cursorrules` under `$WORKSPACE_ROOT` | Cursor project rules |
|
|
343
|
-
| `$WORKSPACE_ROOT` tree (default `~/IdeaProjects`) | Filesystem change events |
|
|
431
|
+
| Tool | Args | Returns |
|
|
432
|
+
| ------------------------- | --------------------------------- | ----------------------------------------------------- |
|
|
433
|
+
| `list_recent_sessions` | `limit?: 1-100` | `[{agent, sessionId, project, lastActivity, sizeBytes}]` |
|
|
434
|
+
| `get_session_events` | `sessionId`, `maxBytes?: 1K-10M` | Raw JSONL (tail-capped) for that session |
|
|
435
|
+
| `search_sessions` | `query`, `limit?: 1-50` | `[{session, agent, line}]` substring hits |
|
|
436
|
+
| `get_tool_usage_stats` | `sessionId?`, `limit?: 1-500` | Per-tool counts, totalDurationMs, errorCount |
|
|
437
|
+
| `get_session_cost` | `sessionId` | `{totalCostUsd, turns, tokens, byModel}` |
|
|
344
438
|
|
|
345
|
-
|
|
346
|
-
what is *not* read.
|
|
439
|
+
See [`docs/features/mcp-server.md`](./docs/features/mcp-server.md).
|
|
347
440
|
|
|
348
441
|
---
|
|
349
442
|
|
|
350
|
-
##
|
|
443
|
+
## OpenTelemetry exporter
|
|
351
444
|
|
|
352
|
-
|
|
353
|
-
|
|
445
|
+
Set `AGENTWATCH_OTLP_ENDPOINT=http://localhost:4318/v1/traces` to emit
|
|
446
|
+
OTLP/HTTP spans for every agent event. Uses the OpenTelemetry GenAI
|
|
447
|
+
semantic conventions so any consumer (Jaeger, Tempo, Honeycomb, Grafana)
|
|
448
|
+
can interpret the data without custom dashboards.
|
|
354
449
|
|
|
355
|
-
|
|
356
|
-
| ----------------- | ----------------------------------- | ------------------------------------------------------- |
|
|
357
|
-
| `WORKSPACE_ROOT` | `~/IdeaProjects` (fallback chain) | Where the generic filesystem watcher looks for edits |
|
|
358
|
-
| `NO_COLOR` | unset | Standard honoring: disables ANSI colors if set |
|
|
450
|
+
Attributes emitted:
|
|
359
451
|
|
|
360
|
-
|
|
361
|
-
|
|
452
|
+
- `gen_ai.system` (anthropic | openai | google | cursor | …)
|
|
453
|
+
- `gen_ai.operation.name` (chat | tool_use | context_compaction | …)
|
|
454
|
+
- `gen_ai.request.model` / `gen_ai.response.model`
|
|
455
|
+
- `gen_ai.usage.input_tokens` / `gen_ai.usage.output_tokens`
|
|
456
|
+
- `gen_ai.tool.name` / `gen_ai.tool.call.id`
|
|
457
|
+
- `error.type` on tool errors
|
|
458
|
+
- `agentwatch.session.id` / `agentwatch.cost_usd`
|
|
459
|
+
- `agentwatch.cache_read_tokens` / `agentwatch.cache_create_tokens` / `agentwatch.cache_hit_ratio`
|
|
460
|
+
- `agentwatch.context.fill_pct`
|
|
461
|
+
- `agentwatch.risk_score`
|
|
362
462
|
|
|
363
|
-
|
|
364
|
-
|
|
463
|
+
OTel deps are loaded dynamically only when the env var is set — zero
|
|
464
|
+
runtime cost when disabled.
|
|
365
465
|
|
|
366
466
|
---
|
|
367
467
|
|
|
368
468
|
## How it compares
|
|
369
469
|
|
|
370
|
-
|
|
|
371
|
-
|
|
|
372
|
-
| Runs locally only
|
|
373
|
-
| Multi-agent
|
|
374
|
-
|
|
|
375
|
-
|
|
|
376
|
-
|
|
|
377
|
-
|
|
|
378
|
-
|
|
|
379
|
-
|
|
|
380
|
-
|
|
|
381
|
-
|
|
|
470
|
+
| | **agentwatch** | claude-devtools | Claudex | ccflare | Langfuse / Phoenix |
|
|
471
|
+
| ---------------------------------- | ---------------------------------------------- | --------------------- | --------------------- | ------------------ | ---------------------------- |
|
|
472
|
+
| Runs locally only | ✅ | ✅ | ✅ | ✅ | self-host possible |
|
|
473
|
+
| Multi-agent | ✅ Claude, Codex, Gemini, Cursor (config), OpenClaw | Claude only | Claude only | Claude only | production LLM apps |
|
|
474
|
+
| Real token + cost with cache | ✅ | ✅ | 🟡 | ✅ (proxy-level) | ✅ |
|
|
475
|
+
| Per-turn token attribution | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
476
|
+
| Compaction visualizer | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
477
|
+
| **Anomaly detection** | **✅ MAD + stuck-loop** | rule-based only | ❌ | ❌ | ❌ |
|
|
478
|
+
| **Budget alarms w/ OS notification** | **✅** | ❌ | ❌ | ❌ | ❌ |
|
|
479
|
+
| **User triggers (regex/threshold)** | **✅ live-reload** | ❌ | ❌ | ❌ | ❌ |
|
|
480
|
+
| **OTel exporter (gen_ai.*)** | **✅** | ❌ | ❌ | ❌ | ✅ (its own format) |
|
|
481
|
+
| MCP server (self-query) | ✅ | ❌ | ✅ | ❌ | ❌ |
|
|
482
|
+
| Permission surface view | ✅ 5 agents | ❌ | ❌ | ❌ | ❌ |
|
|
483
|
+
| Subagent drilldown | ✅ | ✅ | ❌ | ❌ | ✅ (LangChain-specific) |
|
|
484
|
+
| Install | `npm i -g` | Homebrew / Electron | `npm i -g` | Bun repo | Docker + Postgres |
|
|
485
|
+
| UI | TUI (Ink) | Electron + standalone | Web UI | Web + TUI | Web |
|
|
486
|
+
| Telemetry | none | none | none | none | opt-in |
|
|
487
|
+
|
|
488
|
+
Three moats are genuinely unique: **anomaly detection** (statistical, not
|
|
489
|
+
rule-based), **budget alarms**, and **OTel with gen_ai.* conventions**.
|
|
382
490
|
|
|
383
491
|
---
|
|
384
492
|
|
|
385
493
|
## Limitations
|
|
386
494
|
|
|
387
|
-
- **
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
- **
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
495
|
+
- **agentwatch is a viewer, not a daemon.** It captures events only while
|
|
496
|
+
the TUI is running. A background-capture daemon is planned.
|
|
497
|
+
- **Backfill is bounded.** On launch we read the last ~4 MB of each
|
|
498
|
+
active session file (roughly hundreds of events). For long gaps on
|
|
499
|
+
very active sessions, earliest events may fall out of the backfill
|
|
500
|
+
window. Keep agentwatch open in a tmux pane for zero gaps.
|
|
501
|
+
- **Cursor activity is config-level only.** Cursor's AI activity lives in
|
|
502
|
+
a SQLite database we don't parse yet. We capture config changes +
|
|
503
|
+
`.cursorrules` + MCP servers + `.cursor/rules/*.mdc`. Full activity
|
|
504
|
+
parsing is a follow-up.
|
|
505
|
+
- **Gemini and OpenClaw have data-structure gaps.** Gemini CLI doesn't
|
|
506
|
+
persist compaction markers to disk. OpenClaw doesn't persist
|
|
507
|
+
tool_result content or compaction markers. Not fixable from our side.
|
|
508
|
+
- **Windsurf, Aider, Cline** are detected but not instrumented yet.
|
|
509
|
+
- **macOS and Linux only.** Windows needs more chokidar + notifier
|
|
510
|
+
testing before we promise it.
|
|
511
|
+
- **tokenizer is cl100k_base (gpt-tokenizer)**, which is ~5% off for
|
|
512
|
+
Claude. Exact tokens for input / cache / output come from the model's
|
|
513
|
+
own usage record; the ~5% approximation only affects the user /
|
|
514
|
+
thinking / tool I/O / memory-file categories in the attribution view.
|
|
405
515
|
|
|
406
516
|
---
|
|
407
517
|
|
|
@@ -411,84 +521,44 @@ Hard scope boundaries so agentwatch stays small and maintainable.
|
|
|
411
521
|
|
|
412
522
|
- **Not cloud. Not SaaS. Not ever.**
|
|
413
523
|
- **Not an agent itself.** It watches agents; it doesn't take actions.
|
|
414
|
-
- **Not production LLM-app tracing.** [Langfuse](https://langfuse.com)
|
|
415
|
-
owns that.
|
|
524
|
+
- **Not production LLM-app tracing.** [Langfuse](https://langfuse.com) owns that.
|
|
416
525
|
- **Not enterprise compliance.** Anthropic's Compliance API covers that.
|
|
417
|
-
- **Not orchestration.** Use
|
|
418
|
-
or [Stoneforge](https://stoneforge.ai) for running agents in parallel.
|
|
526
|
+
- **Not orchestration.** Use Mission Control / Stoneforge for running agents in parallel.
|
|
419
527
|
- **Not memory.** Use [claude-mem](https://github.com/thedotmack/claude-mem).
|
|
420
|
-
- **Not governance / policy enforcement.** Use
|
|
421
|
-
or [Castra](https://github.com/amangsingh/castra).
|
|
422
|
-
|
|
423
|
-
---
|
|
424
|
-
|
|
425
|
-
## Roadmap
|
|
426
|
-
|
|
427
|
-
The full, ticket-level roadmap lives in the [Linear project](https://linear.app/auraqu/project/agentwatch-748d6aa1c20a).
|
|
428
|
-
Headlines:
|
|
429
|
-
|
|
430
|
-
### v0.4 — parity mop-up
|
|
431
|
-
|
|
432
|
-
- 7-category token attribution (CLAUDE.md / skills / mentions / tool I/O / thinking / team / user)
|
|
433
|
-
- Context compaction visualizer
|
|
434
|
-
- Syntax highlighting in detail pane
|
|
435
|
-
- Markdown + JSON session export
|
|
436
|
-
- Stale-session detection (dim after 5 min idle)
|
|
437
|
-
- UX polish: breadcrumbs, consistent `esc`, home key, first-run tour
|
|
438
|
-
|
|
439
|
-
### v0.5 — moats
|
|
440
|
-
|
|
441
|
-
- User-defined regex / threshold notification triggers
|
|
442
|
-
- Budget alarms with hard spend caps
|
|
443
|
-
- OpenTelemetry exporter with rich semantic conventions
|
|
444
|
-
- Cross-session ripgrep-fast search
|
|
445
|
-
- MCP server mode — agent self-query (`get_timeline`, `get_cost`,
|
|
446
|
-
`search_sessions`)
|
|
447
|
-
- **Web UI companion** — `agentwatch serve` on localhost:3456, same
|
|
448
|
-
adapters, Preact-based renderer with inline diffs and stacked token bars
|
|
449
|
-
|
|
450
|
-
### v1.0 — ambitious
|
|
451
|
-
|
|
452
|
-
- Semantic session search ("the session where I broke the build")
|
|
453
|
-
- Diff-attribution (file change → prompt that caused it)
|
|
454
|
-
- Cross-agent session correlation (Claude → Cursor stitched)
|
|
455
|
-
- Tauri desktop app (3-5 MB bundle, not Electron)
|
|
456
|
-
- Anomaly detection (stuck loops, cost spikes, error bursts)
|
|
457
|
-
|
|
458
|
-
Feature requests: [GitHub issues](https://github.com/mishanefedov/agentwatch/issues).
|
|
459
|
-
Before opening one, please skim the roadmap — most ideas are already
|
|
460
|
-
tracked.
|
|
528
|
+
- **Not governance / policy enforcement.** Use DashClaw / Castra.
|
|
461
529
|
|
|
462
530
|
---
|
|
463
531
|
|
|
464
532
|
## Architecture
|
|
465
533
|
|
|
466
|
-
TypeScript monorepo
|
|
534
|
+
TypeScript monorepo. Three-layer mental model:
|
|
467
535
|
|
|
468
536
|
```
|
|
469
|
-
|
|
470
|
-
│ TUI layer (ink / React)
|
|
471
|
-
│ Timeline · EventDetail · Permissions · Projects
|
|
472
|
-
│ Sessions ·
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
│
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
│
|
|
482
|
-
|
|
537
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
538
|
+
│ TUI layer (ink / React) │
|
|
539
|
+
│ Timeline · EventDetail · Permissions · Projects │
|
|
540
|
+
│ Sessions · Tokens · Compaction · CrossSearch · Header │
|
|
541
|
+
│ │
|
|
542
|
+
│ MCP server (stdio — programmatic, not a UI) │
|
|
543
|
+
│ list_recent_sessions · get_session_events │
|
|
544
|
+
│ search_sessions · get_tool_usage_stats · get_session_cost │
|
|
545
|
+
└─────────────────────────▲───────────────────────────────────┘
|
|
546
|
+
│ EventSink.emit / enrich
|
|
547
|
+
┌─────────────────────────┴───────────────────────────────────┐
|
|
548
|
+
│ Adapter layer (one per agent) │
|
|
549
|
+
│ claude-code · codex · gemini · cursor · openclaw │
|
|
550
|
+
│ fs-watcher (generic) │
|
|
551
|
+
└─────────────────────────▲───────────────────────────────────┘
|
|
552
|
+
│ files read-only
|
|
553
|
+
┌─────────────────────────┴───────────────────────────────────┐
|
|
554
|
+
│ OS (log files, config files, clipboard, notifier) │
|
|
555
|
+
└─────────────────────────────────────────────────────────────┘
|
|
483
556
|
```
|
|
484
557
|
|
|
485
|
-
- Adapters read files, translate raw log lines into
|
|
486
|
-
|
|
487
|
-
- The
|
|
488
|
-
|
|
489
|
-
to attach duration + output to the original `tool_use`).
|
|
490
|
-
- The TUI is a pure reducer over the event buffer. Filtering, search,
|
|
491
|
-
scope are all derived views — no mutation.
|
|
558
|
+
- Adapters read files, translate raw log lines into canonical `AgentEvent`s, emit through an `EventSink`.
|
|
559
|
+
- `EventSink.enrich(id, patch)` lets an adapter update a previously-emitted event (e.g. when a tool_result arrives late and needs to attach duration + output to the original tool_use).
|
|
560
|
+
- The TUI is a pure reducer over the event buffer. Filtering, search, scope are derived views — no mutation.
|
|
561
|
+
- The MCP server is a peer of the TUI: it reads the same session files on demand, via its own scan (no shared in-memory state with the TUI). This is a known duplication; see Linear for the refactor ticket.
|
|
492
562
|
|
|
493
563
|
See `src/schema.ts` for the canonical event shape.
|
|
494
564
|
|
|
@@ -501,31 +571,18 @@ git clone https://github.com/mishanefedov/agentwatch.git
|
|
|
501
571
|
cd agentwatch
|
|
502
572
|
npm install
|
|
503
573
|
npm run dev # launch the TUI directly from source (tsx)
|
|
504
|
-
npm test # vitest
|
|
574
|
+
npm test # vitest — 97 tests
|
|
505
575
|
npm run typecheck # strict TypeScript
|
|
506
576
|
npm run build # tsup → dist/
|
|
507
577
|
```
|
|
508
578
|
|
|
509
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for the contribution workflow
|
|
510
|
-
issue triage policy, and what's in scope for PRs.
|
|
511
|
-
|
|
512
|
-
## Docs
|
|
579
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for the contribution workflow.
|
|
513
580
|
|
|
514
|
-
|
|
581
|
+
### Docs
|
|
515
582
|
|
|
516
|
-
- **[`docs/features/`](./docs/features/)** —
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
drilldown, projects + sessions navigation, search, permissions,
|
|
520
|
-
cost accounting, notifications, clipboard yank, filesystem watcher,
|
|
521
|
-
agent detection.
|
|
522
|
-
- **[`docs/testing/`](./docs/testing/)** — manual test procedures per
|
|
523
|
-
feature, plus a 15-minute pre-release walkthrough
|
|
524
|
-
([`TEST-SCRIPT.md`](./docs/testing/TEST-SCRIPT.md)).
|
|
525
|
-
- **[`docs/use-cases/`](./docs/use-cases/)** — real-world scenarios:
|
|
526
|
-
multi-agent triage on a monorepo, cost-overrun investigation,
|
|
527
|
-
security audit, stuck-loop detection, subagent post-mortem, .env
|
|
528
|
-
leak alert.
|
|
583
|
+
- **[`docs/features/`](./docs/features/)** — feature specs (scope, inputs, outputs, failure modes). Being extended feature-by-feature.
|
|
584
|
+
- **[`docs/testing/`](./docs/testing/)** — manual test procedures + a pre-release walkthrough.
|
|
585
|
+
- **[`docs/use-cases/`](./docs/use-cases/)** — multi-agent triage, cost-overrun investigation, security audit, stuck-loop detection, subagent post-mortem, .env leak alert.
|
|
529
586
|
|
|
530
587
|
---
|
|
531
588
|
|
|
@@ -533,9 +590,9 @@ In-depth documentation lives in `docs/`:
|
|
|
533
590
|
|
|
534
591
|
Local-first is a hard invariant.
|
|
535
592
|
|
|
536
|
-
- **Zero network calls
|
|
593
|
+
- **Zero network calls** unless you explicitly set `AGENTWATCH_OTLP_ENDPOINT` (to a host *you* chose, OTel output only).
|
|
537
594
|
- **Zero telemetry.** Not opt-in, not opt-out — simply not there.
|
|
538
|
-
- **All files read-only** except clipboard (on `y`) and
|
|
595
|
+
- **All files read-only** except the clipboard (on `y`) and `./agentwatch-export/` (on `e`).
|
|
539
596
|
- Every path agentwatch reads is documented in [SECURITY.md](./SECURITY.md).
|
|
540
597
|
|
|
541
598
|
Report vulnerabilities privately: `misha@auraqu.com` or via a
|
|
@@ -551,7 +608,6 @@ MIT © Misha Nefedov. See [LICENSE](./LICENSE).
|
|
|
551
608
|
|
|
552
609
|
<div align="center">
|
|
553
610
|
|
|
554
|
-
If agentwatch saves you a debugging hour, a ⭐ on the repo makes the effort
|
|
555
|
-
worth it.
|
|
611
|
+
If agentwatch saves you a debugging hour, a ⭐ on the repo makes the effort worth it.
|
|
556
612
|
|
|
557
613
|
</div>
|