@misha_misha/agentwatch 0.0.1 → 0.0.2

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 CHANGED
@@ -1,14 +1,91 @@
1
+ <div align="center">
2
+
1
3
  # agentwatch
2
4
 
3
- **Local-only observability for AI coding agents.** One terminal timeline across Claude Code, Cursor, and OpenClaw what each agent is reading, writing, running, and what each is actually allowed to do.
5
+ **See what every AI coding agent on your machine is doingin one terminal.**
6
+
7
+ Local-only observability for Claude Code, OpenClaw, and Cursor — all the
8
+ tool calls, file reads & writes, shell commands, prompts, responses, costs,
9
+ and permissions, in a single timeline.
10
+
11
+ [![npm](https://img.shields.io/npm/v/@misha_misha/agentwatch.svg)](https://www.npmjs.com/package/@misha_misha/agentwatch)
12
+ [![CI](https://github.com/mishanefedov/agentwatch/actions/workflows/ci.yml/badge.svg)](https://github.com/mishanefedov/agentwatch/actions/workflows/ci.yml)
13
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
14
+ [![Node >=20](https://img.shields.io/badge/node-%E2%89%A520-brightgreen.svg)](./package.json)
15
+
16
+ </div>
17
+
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
+ <div align="center">
29
+ <img src="./docs/demo.gif" alt="agentwatch demo" width="820"
30
+ onerror="this.style.display='none'" />
31
+ </div>
32
+
33
+ ---
34
+
35
+ ## Table of contents
4
36
 
5
- No cloud. No Docker. No telemetry. `npm i -g agentwatch` and go.
37
+ - [Why this exists](#why-this-exists)
38
+ - [Install](#install)
39
+ - [First 60 seconds](#first-60-seconds)
40
+ - [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
+ - [Keyboard reference](#keyboard-reference)
51
+ - [What agentwatch reads](#what-agentwatch-reads)
52
+ - [Configuration](#configuration)
53
+ - [How it compares](#how-it-compares)
54
+ - [Limitations](#limitations)
55
+ - [Non-goals](#non-goals)
56
+ - [Roadmap](#roadmap)
57
+ - [Architecture](#architecture)
58
+ - [Development](#development)
59
+ - [Security](#security)
60
+ - [License](#license)
6
61
 
7
- ## Why
62
+ ---
8
63
 
9
- You're running Claude Code + Cursor + OpenClaw on the same machine. Each has its own config (`CLAUDE.md`, `.cursorrules`, OpenClaw workspaces), its own activity log in a different place, and its own permission model. Nothing shows you one unified view: *right now, which agent just touched which file, ran which command, and why.*
64
+ ## Why this exists
10
65
 
11
- [claude-devtools](https://github.com/matt1398/claude-devtools) solves this beautifully for Claude only. agentwatch does the same thing for the whole multi-agent setup.
66
+ You're running three AI coding agents on one laptop. Claude Code in a
67
+ terminal, Cursor as your IDE, OpenClaw churning on long-running tasks.
68
+ Every one of them has its own log file in a different place, its own
69
+ permission model, its own idea of what a "session" is. None of them tells
70
+ you what the others are doing.
71
+
72
+ 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 three
74
+ JSONLs and guessing.
75
+
76
+ [`claude-devtools`](https://github.com/matt1398/claude-devtools) solves
77
+ this beautifully for Claude Code. **agentwatch does the same thing for the
78
+ whole multi-agent stack, in the terminal, with zero infra.**
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.
87
+
88
+ ---
12
89
 
13
90
  ## Install
14
91
 
@@ -17,67 +94,405 @@ npm i -g @misha_misha/agentwatch
17
94
  agentwatch
18
95
  ```
19
96
 
20
- That's it. No config, no accounts, no daemon. (Published under a
21
- scope because `agentwatch` was blocked by npm's anti-typosquatting
22
- check the binary is still `agentwatch`.)
97
+ Requires:
98
+
99
+ - **Node 20** (tested on 20 + 22 in CI)
100
+ - **macOS or Linux** (Windows is intentionally out of scope for v0)
101
+
102
+ agentwatch is published under the `@misha_misha` npm scope — the unscoped
103
+ `agentwatch` name was already taken by a different tool from CyberArk.
104
+ Once installed the binary on your `$PATH` is simply `agentwatch`.
105
+
106
+ ---
23
107
 
24
- Requires Node 20. Works on macOS and Linux.
108
+ ## First 60 seconds
25
109
 
26
- ## What it shows
110
+ ```bash
111
+ # 1. Sanity-check that agentwatch sees your installed AI agents
112
+ agentwatch doctor
113
+ ```
27
114
 
28
- - **Claude Code** tails `~/.claude/projects/**/*.jsonl` and emits every prompt, response, tool call, file read/write, and shell exec with attribution and risk scoring.
29
- - **OpenClaw** — watches `~/.openclaw/agents/*/sessions/*.jsonl` across every sub-agent (content, research, docs, main) with sub-agent attribution in the event stream, plus `config-audit.jsonl` with elevated risk scoring for config writes.
30
- - **Cursor** — config-level visibility: MCP server list, permissions (`cli-config.json`), recently-viewed files (`ide_state.json`), discovered `.cursorrules` anywhere in your workspace.
31
- - **Workspace filesystem** — chokidar-backed watcher over `$WORKSPACE_ROOT` (default `~/IdeaProjects`) with sensible ignores (`node_modules`, `.git`, `dist`).
32
- - **Permissions (Claude)** — press `p` in the TUI to open a full-screen view of `~/.claude/settings.json`. Renders the allow / deny lists, `defaultMode`, and flags dangerous patterns: `Bash(*)`, missing `~/.ssh`/`.aws`/`.gnupg` denies, auto/bypass modes.
115
+ You should see something like:
33
116
 
34
- ## Hotkeys
117
+ ```
118
+ workspace: /Users/you/IdeaProjects
35
119
 
120
+ agents:
121
+ ● Claude Code installed
122
+ config: /Users/you/.claude/settings.json
123
+ ○ Codex not detected
124
+ config: /Users/you/.codex/config.toml
125
+ ● Cursor installed
126
+ config: /Users/you/.cursor/mcp.json
127
+ ● Gemini CLI installed
128
+ config: /Users/you/.gemini/settings.json
129
+ ● OpenClaw installed
130
+ config: /Users/you/.openclaw
36
131
  ```
37
- q quit
38
- a toggle agent side panel
39
- f cycle agent filter
40
- p toggle full-screen permission view
41
- space pause / resume event stream
42
- c clear events
132
+
133
+ Then:
134
+
135
+ ```bash
136
+ # 2. Launch the TUI
137
+ agentwatch
43
138
  ```
44
139
 
45
- ## CLI
140
+ You land in the live timeline. Everything your agents do from this moment
141
+ on streams in. The last ~64 KB of each active session is backfilled so you
142
+ have immediate context.
143
+
144
+ - Press **`?`** — see every hotkey
145
+ - Press **`P`** — open the projects grid (one card per workspace)
146
+ - Use Claude Code in another terminal and watch events appear
147
+ - Press **Enter** on a row to see the full content (file diff, full Bash
148
+ output, full prompt text, extended thinking)
149
+ - Press **`q`** — quit, your shell scrollback is restored
150
+
151
+ ---
152
+
153
+ ## Features
154
+
155
+ ### Live multi-agent timeline
156
+
157
+ The main screen. Every event your agents emit, in reverse-chronological
158
+ order by event timestamp (not arrival order — backfill from different
159
+ session files is sorted correctly). Columns: time · agent · type ·
160
+ `[project / sub-agent]` summary · duration · error flag.
46
161
 
47
162
  ```
48
- agentwatch launch the TUI
49
- agentwatch doctor detect installed agents and print config paths
50
- agentwatch --help usage
163
+ 09:54:01 openclaw response [content_agent] <think> Checked the knowledge base…
164
+ 09:52:53 claude-code response [auraqu] Commit bddc363. q now exits instantly…
165
+ 09:52:48 claude-code tool_call [auraqu] Bash: git log -5 · 12ms
166
+ 09:52:43 claude-code tool_call [auraqu] Edit: src/ui/App.tsx · 7ms
167
+ 09:51:51 claude-code tool_call [auraqu] Agent: Competitive landscape 2026 ▸ 52 child events
168
+ 09:28:06 claude-code prompt [mishanefedov] I mean what's the link, do I go through…
51
169
  ```
52
170
 
53
- `$WORKSPACE_ROOT` overrides the detected workspace root.
171
+ Event types: `prompt`, `response`, `tool_call`, `shell_exec`, `file_read`,
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.
175
+
176
+ ### Event detail pane
177
+
178
+ Press **`Enter`** on any focused row. Opens a full-screen pane with:
179
+
180
+ - Event metadata (time, agent, type, tool, path, cmd)
181
+ - **Tokens / cost / duration** breakdown — `in=6 cache_create=25508 cache_read=16827 out=353` · `cost: $0.08 (claude-opus-4-6)` · `duration: 151ms`
182
+ - **Tool result** — stdout / stderr for Bash, full file content for Read,
183
+ search matches for Grep
184
+ - **Full text** — untruncated prompt or response
185
+ - **Extended thinking** block when present
186
+ - **Tool input** — JSON-pretty for Task / WebFetch / Grep arguments
187
+
188
+ Scrollable with `↑↓` or `j/k`. `esc` closes.
189
+
190
+ ### Subagent drilldown
191
+
192
+ Parent `Agent` tool_use events show `▸ 52 child events`. Press **`x`** on
193
+ one to scope the timeline to only that subagent's inner tool calls — every
194
+ Bash, WebFetch, Grep, Read it ran during that Task. `X` unscopes.
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.
198
+
199
+ ### Project and session navigation
200
+
201
+ ```
202
+ P → projects grid (every workspace across every agent)
203
+ ↓ → pick one, Enter
204
+
205
+ sessions list (grouped Today / Yesterday / Last 7d / Older)
206
+ ↓ pick one, Enter
207
+
208
+ scoped timeline (only events from this session)
209
+ ```
210
+
211
+ Projects grid aggregates across agents: one row per filesystem path, with
212
+ per-agent session counts, total cost, last activity. Sessions list shows
213
+ the first user prompt + event count + duration + cost per session.
214
+ `esc` always walks back one level.
215
+
216
+ ### Full-text search
217
+
218
+ Press **`/`**. Type a query. The timeline narrows to matches against
219
+ summary, path, cmd, tool, agent, full text, or extended thinking. Live
220
+ match count shown below the timeline. `esc` clears.
221
+
222
+ ```
223
+ / Bash: rm → filters to every Bash with "rm" in its command
224
+ ```
225
+
226
+ ### Per-agent permission surface
227
+
228
+ Press **`p`**. Scrollable view of:
229
+
230
+ - **Claude Code** — allow / deny / `defaultMode`, plus flagged risks:
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).
237
+
238
+ Gemini CLI is documented and omitted — it exposes no permission model
239
+ beyond auth.
240
+
241
+ ### Per-session cost with cache accounting
242
+
243
+ Naive token summers are **3–10× wrong** on Claude because `cache_read` is
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.
247
+
248
+ - Per-agent total cost shows in the side panel
249
+ - Per-event cost shows in the detail pane
250
+ - Per-session cost shows in the sessions list
251
+
252
+ ### Desktop notifications
253
+
254
+ Fires only for events that happen **after** the TUI was launched (backfill
255
+ is silent). Rate-limited to one alert per rule per 60s.
256
+
257
+ Triggers built-in:
258
+
259
+ - `.env` file read or write
260
+ - `~/.ssh`, `~/.aws`, `~/.gnupg` paths touched
261
+ - `rm -rf`, `sudo`, `curl | sh` in shell_exec
262
+ - Tool errors (`is_error: true`)
263
+
264
+ Platform dispatch: `osascript` on macOS, `notify-send` on Linux,
265
+ PowerShell fallback on Windows. Zero dependencies.
266
+
267
+ Custom regex triggers (e.g. "alert on any `psql.*prod`") are planned for
268
+ v0.5.
269
+
270
+ ### Yank to clipboard
271
+
272
+ Press **`y`** on any focused event. Copies the most useful payload:
273
+
274
+ - Tool result content if available (the actual stdout / file body)
275
+ - Otherwise full text (prompt / response)
276
+ - Otherwise cmd / path / summary
277
+
278
+ macOS `pbcopy`, Linux `wl-copy` / `xclip` / `xsel`, Windows `clip`.
279
+ Confirmation flashes in green at the footer (`✓ copied 4,210 chars`) or red
280
+ if no clipboard tool is available.
281
+
282
+ ---
283
+
284
+ ## Keyboard reference
285
+
286
+ Press **`?`** anytime to open this inside the TUI.
287
+
288
+ ### Navigate
289
+
290
+ | Key | Action |
291
+ | ------------------ | ---------------------------------------------- |
292
+ | `↑ ↓` / `j k` | move selection in the timeline |
293
+ | `Enter` | open event detail pane |
294
+ | `esc` | close current view / clear selection |
295
+ | `P` | projects grid — every workspace on this machine |
296
+ | `Enter` on project | sessions list for that project (by date) |
297
+ | `Enter` on session | scoped timeline for that session |
298
+ | `q` / `Ctrl-C` | quit |
299
+
300
+ ### Filter & scope
301
+
302
+ | Key | Action |
303
+ | ---- | ------------------------------------------------------------ |
304
+ | `/` | full-text search (summary, path, cmd, tool, text, thinking) |
305
+ | `f` | cycle agent filter (Claude only → OpenClaw only → …) |
306
+ | `a` | toggle agent side panel |
307
+ | `x` | drill selected Agent event into its subagent run |
308
+ | `X` | unscope subagent |
309
+ | `A` | clear project filter |
310
+
311
+ ### Actions
312
+
313
+ | Key | Action |
314
+ | --------- | ------------------------------------------- |
315
+ | `y` | yank selected event content to clipboard |
316
+ | `space` | pause / resume live event stream |
317
+ | `c` | clear event buffer |
318
+
319
+ ### Info views
320
+
321
+ | Key | Action |
322
+ | ------ | --------------------------------------------------------- |
323
+ | `p` | permissions view (Claude + Cursor + OpenClaw) |
324
+ | `↑↓` | scroll inside permissions or detail pane |
325
+
326
+ ---
327
+
328
+ ## What agentwatch reads
329
+
330
+ Everything is read-only. agentwatch writes to exactly two places: your
331
+ terminal, and the clipboard (on explicit `y`).
332
+
333
+ | Path | What |
334
+ | --------------------------------------------- | ----------------------------------- |
335
+ | `~/.claude/projects/**/*.jsonl` | Claude Code session transcripts |
336
+ | `~/.claude/projects/**/subagents/*.jsonl` | Claude Code Task-spawned subagents |
337
+ | `~/.claude/settings.json` | Claude permissions |
338
+ | `~/.openclaw/agents/*/sessions/*.jsonl` | OpenClaw sub-agent sessions |
339
+ | `~/.openclaw/logs/config-audit.jsonl` | OpenClaw config audit trail |
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 |
344
+
345
+ The SECURITY.md file carries the authoritative list and the details on
346
+ what is *not* read.
347
+
348
+ ---
349
+
350
+ ## Configuration
351
+
352
+ No config file yet — every behavior has a sensible default and the
353
+ scope is deliberately narrow. Two environment variables:
354
+
355
+ | Variable | Default | Purpose |
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 |
359
+
360
+ The workspace fallback chain (used when `WORKSPACE_ROOT` isn't set) is:
361
+ `~/IdeaProjects` → `~/src` → `~/code` → `~/Projects` → `~/dev` → `$HOME`.
362
+
363
+ Per-user config files and per-adapter toggles land in v0.5 alongside
364
+ custom notification triggers and budget alarms.
365
+
366
+ ---
54
367
 
55
368
  ## How it compares
56
369
 
57
- | | agentwatch | claude-devtools | Unfucked | Langfuse / Phoenix |
58
- |---|---|---|---|---|
59
- | Runs locally only | ✓ | ✓ | ✓ | self-host possible |
60
- | Multi-agent | ✓ Claude + Cursor + OpenClaw | Claude only | agent-agnostic (file-level) | production apps, not CLI agents |
61
- | Per-agent attribution | ✓ | ✓ | ✗ (file-level only) | N/A |
62
- | Permission surface view | ✓ | ✗ | ✗ | ✗ |
63
- | Install | `npm i -g` | Homebrew / Electron app | Homebrew / Rust binary | Docker + Postgres |
370
+ | | agentwatch | claude-devtools | Unfucked | Langfuse / Phoenix |
371
+ | -------------------------------- | ----------------------------------- | -------------------------- | -------------------------- | -------------------------------- |
372
+ | Runs locally only | ✓ | ✓ | ✓ | self-host possible |
373
+ | Multi-agent | ✓ Claude + OpenClaw + Cursor | Claude only | agent-agnostic, file-only | production LLM apps |
374
+ | Per-agent event attribution | ✓ | ✓ | ✗ (file-level only) | N/A |
375
+ | Permission surface view | ✓ (Claude + Cursor + OpenClaw) | ✗ | ✗ | ✗ |
376
+ | Cost with cache-hit accounting | ✓ | | | |
377
+ | Subagent drilldown | ✓ | ✓ | ✗ | ✓ (LangChain) |
378
+ | Install | `npm i -g` | Homebrew / Electron | Homebrew / Rust binary | Docker + Postgres |
379
+ | UI | TUI (ink) | Electron + web standalone | CLI only | Web |
380
+ | Bundle size | ~50 KB source | ~150 MB Electron app | ~10 MB Rust binary | Postgres + app |
381
+ | Telemetry | none | none | none | opt-in |
382
+
383
+ ---
384
+
385
+ ## Limitations
386
+
387
+ - **Backfill isn't unbounded.** agentwatch reads the last ~64 KB of each
388
+ session file on startup. Older events still live in your jsonl — open
389
+ them directly if you need deeper history.
390
+ - **Cursor activity is config-level only.** Cursor stores its full AI
391
+ activity in a SQLite DB we don't parse yet. We capture config changes +
392
+ recently-viewed files as a live signal. Full activity parsing is planned.
393
+ - **Gemini CLI and Codex aren't instrumented yet.** Detection works in
394
+ `agentwatch doctor`; events don't land in the timeline. Follows in v0.4
395
+ and v0.5.
396
+ - **macOS and Linux only.** Windows isn't supported in v0. chokidar edge
397
+ cases and notification dispatch need more testing before we promise it.
398
+ - **Subagent correlation is best-effort.** We match parent `Agent`
399
+ tool_use to its subagent jsonl via the `agentId` in the `tool_result`
400
+ payload. If Claude Code changes that convention upstream, drilldown
401
+ needs an adapter tweak.
402
+ - **The timeline window is 40 rows + header.** Scrolling deep into older
403
+ events doesn't smoothly extend the window yet; use the projects → sessions
404
+ drilldown or `/` search to find older events.
405
+
406
+ ---
64
407
 
65
408
  ## Non-goals
66
409
 
67
- - Not cloud. Not a SaaS. Not ever.
68
- - Not an agent itself.
69
- - Not production LLM-app tracing — [Langfuse](https://langfuse.com) owns that space.
70
- - Not enterprise compliance Anthropic's Compliance API covers that.
71
- - Not orchestration. Use [Mission Control](https://github.com/MeisnerDan/mission-control) or [DevSwarm](https://devswarm.ai) for running agents in parallel.
410
+ Hard scope boundaries so agentwatch stays small and maintainable.
411
+
412
+ - **Not cloud. Not SaaS. Not ever.**
413
+ - **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.
416
+ - **Not enterprise compliance.** Anthropic's Compliance API covers that.
417
+ - **Not orchestration.** Use [Mission Control](https://github.com/MeisnerDan/mission-control)
418
+ or [Stoneforge](https://stoneforge.ai) for running agents in parallel.
419
+ - **Not memory.** Use [claude-mem](https://github.com/thedotmack/claude-mem).
420
+ - **Not governance / policy enforcement.** Use [DashClaw](https://github.com/ucsandman/DashClaw)
421
+ or [Castra](https://github.com/amangsingh/castra).
422
+
423
+ ---
72
424
 
73
425
  ## Roadmap
74
426
 
75
- - Codex + Gemini CLI adapters
76
- - Deeper Cursor activity (SQLite AI-tracking DB)
77
- - MCP proxy mode (`agentwatch wrap <agent>`)
78
- - Permission viewer for OpenClaw + Cursor + Codex + Gemini
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.
461
+
462
+ ---
463
+
464
+ ## Architecture
465
+
466
+ TypeScript monorepo shape. Three-layer mental model:
467
+
468
+ ```
469
+ ┌─────────────────────────────────────────────────────┐
470
+ │ TUI layer (ink / React) │
471
+ │ Timeline · EventDetail · Permissions · Projects │
472
+ │ Sessions · AgentPanel · HelpView │
473
+ └───────────────▲─────────────────────────────────────┘
474
+ │ EventSink.emit / enrich
475
+ ┌───────────────┴─────────────────────────────────────┐
476
+ │ Adapter layer (per agent) │
477
+ │ claude-code · openclaw · cursor · fs-watcher │
478
+ └───────────────▲─────────────────────────────────────┘
479
+ │ files read-only
480
+ ┌───────────────┴─────────────────────────────────────┐
481
+ │ OS (log files, config files, clipboard, notifier) │
482
+ └─────────────────────────────────────────────────────┘
483
+ ```
484
+
485
+ - Adapters read files, translate raw log lines into a canonical
486
+ `AgentEvent`, emit through an `EventSink`.
487
+ - The sink's `enrich(id, patch)` lets an adapter update a previously-
488
+ emitted event (e.g. when a Claude `tool_result` arrives late and needs
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.
79
492
 
80
- Feature requests [GitHub issues](https://github.com/mishanefedov/agentwatch/issues).
493
+ See `src/schema.ts` for the canonical event shape.
494
+
495
+ ---
81
496
 
82
497
  ## Development
83
498
 
@@ -85,11 +500,58 @@ Feature requests → [GitHub issues](https://github.com/mishanefedov/agentwatch/
85
500
  git clone https://github.com/mishanefedov/agentwatch.git
86
501
  cd agentwatch
87
502
  npm install
88
- npm run dev
503
+ npm run dev # launch the TUI directly from source (tsx)
504
+ npm test # vitest, 14 tests
505
+ npm run typecheck # strict TypeScript
506
+ npm run build # tsup → dist/
89
507
  ```
90
508
 
91
- Run tests with `npm test`. Typecheck with `npm run typecheck`.
509
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for the contribution workflow,
510
+ issue triage policy, and what's in scope for PRs.
511
+
512
+ ## Docs
513
+
514
+ In-depth documentation lives in `docs/`:
515
+
516
+ - **[`docs/features/`](./docs/features/)** — one spec per feature:
517
+ what it does, how to invoke, inputs, outputs, failure modes,
518
+ interactions. 12 files covering timeline, detail pane, subagent
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.
529
+
530
+ ---
531
+
532
+ ## Security
533
+
534
+ Local-first is a hard invariant.
535
+
536
+ - **Zero network calls.** Verify with `lsof -i -p $(pgrep -n agentwatch)`.
537
+ - **Zero telemetry.** Not opt-in, not opt-out — simply not there.
538
+ - **All files read-only** except clipboard (on `y`) and terminal output.
539
+ - Every path agentwatch reads is documented in [SECURITY.md](./SECURITY.md).
540
+
541
+ Report vulnerabilities privately: `misha@auraqu.com` or via a
542
+ [Security Advisory](https://github.com/mishanefedov/agentwatch/security/advisories/new).
543
+
544
+ ---
92
545
 
93
546
  ## License
94
547
 
95
548
  MIT © Misha Nefedov. See [LICENSE](./LICENSE).
549
+
550
+ ---
551
+
552
+ <div align="center">
553
+
554
+ If agentwatch saves you a debugging hour, a ⭐ on the repo makes the effort
555
+ worth it.
556
+
557
+ </div>