project-brain 0.28.0 → 0.30.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
CHANGED
|
@@ -305,6 +305,14 @@ project-brain setup --none
|
|
|
305
305
|
|
|
306
306
|
Run `project-brain setup --with=nope` to print the list of valid ids.
|
|
307
307
|
|
|
308
|
+
#### chrome-devtools autoConnect
|
|
309
|
+
|
|
310
|
+
If a detected host runs the [chrome-devtools MCP server](https://github.com/ChromeDevTools/chrome-devtools-mcp) without `--autoConnect`, setup offers to add it (`config:chrome-autoconnect`). Without the flag those browser tools launch a throwaway, logged-out Chrome profile; with it they drive the Chrome you are already signed into, which is the only way to reach a flow behind a login.
|
|
311
|
+
|
|
312
|
+
It is the one unit that ships **unchecked**, on purpose. Attaching to your own browser is full control of it, and Chrome says so on the toggle the flag depends on: it "allows external apps to request full control of this browser. This includes read access to your saved data, cookies and site data, and the ability to navigate to any URL."
|
|
313
|
+
|
|
314
|
+
The flag is only half of it — Chrome refuses the connection until you open `chrome://inspect/#remote-debugging` and turn on "Allow remote debugging for this browser instance" yourself. Setup never flips that toggle; it prints the step after writing the flag. Entries already wired another way (`--browserUrl`, `--wsEndpoint`) or explicitly opted out (`--no-auto-connect`) are left untouched.
|
|
315
|
+
|
|
308
316
|
#### Model routing for sub-agents
|
|
309
317
|
|
|
310
318
|
Setup also writes model-routing guidance into each detected host's rules file: which **tier** — `fast`, `balanced`, or `deep` — a delegated sub-agent should run at for a given kind of task, and how to set that tier *on that host*.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-brain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first MCP server that gives AI tools semantic memory of your codebase.",
|
|
6
6
|
"author": "jcsoftdev",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"zod": "^4.4.3"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"project-brain-darwin-arm64": "0.
|
|
53
|
-
"project-brain-linux-x64": "0.
|
|
54
|
-
"project-brain-linux-arm64": "0.
|
|
55
|
-
"project-brain-windows-x64": "0.
|
|
56
|
-
"project-brain-windows-arm64": "0.
|
|
52
|
+
"project-brain-darwin-arm64": "0.30.0",
|
|
53
|
+
"project-brain-linux-x64": "0.30.0",
|
|
54
|
+
"project-brain-linux-arm64": "0.30.0",
|
|
55
|
+
"project-brain-windows-x64": "0.30.0",
|
|
56
|
+
"project-brain-windows-arm64": "0.30.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/bun": "latest",
|
|
@@ -18,7 +18,7 @@ Declining is normal and costs only the `observed` tier. Every gap this module wo
|
|
|
18
18
|
|
|
19
19
|
- [ ] Probe the session's tool names. Nothing is installed, nothing is configured. No browser tool present renders the module `not applicable (no browser tool in session)` and the audit continues as a static run.
|
|
20
20
|
- [ ] Fill two roles independently, because no single tool wins on both axes. **Walker** — drives the flow, takes screenshots, reads console: `chrome-devtools` (isolated) > `playwright` > `claude-in-chrome`. **Measurer** — network with headers and bodies, per-request timing, performance trace, vitals, accessibility tree: `chrome-devtools` > `playwright` > `claude-in-chrome`. Record which tool filled which role and the version it exposes.
|
|
21
|
-
- [ ] Know what each tool can and cannot produce before promising an artefact. `chrome-devtools`: `performance_start_trace` (with `reload` and `autoStop`), `performance_analyze_insight` (`LCPBreakdown`, `DocumentLatency`, `RenderBlocking`, `LongTasks`, `CLSCulprits`, among others), `list_network_requests`/`get_network_request` with headers, bodies and timing, `list_console_messages`, `take_snapshot` (
|
|
21
|
+
- [ ] Know what each tool can and cannot produce before promising an artefact. `chrome-devtools`: `performance_start_trace` (with `reload` and `autoStop`), `performance_analyze_insight` (`LCPBreakdown`, `DocumentLatency`, `RenderBlocking`, `LongTasks`, `CLSCulprits`, among others), `list_network_requests`/`get_network_request` with headers, bodies and timing, `list_console_messages`, `take_snapshot` (an accessibility-tree snapshot with element uids, plus `verbose` for the full tree and `pageId` routing — chrome-devtools-mcp 1.9.0; it exposes no bounding boxes), `take_screenshot`, `evaluate_script`, `emulate` (device and network conditions), headless, and an isolated temporary profile. It also ships `lighthouse_audit`; this module does not call it, because the trace already yields the same diagnostics in the pass the walker is making, and a project-declared Lighthouse command belongs to `runtime.md`. `playwright`: `browser_snapshot` (accessibility snapshot with element refs, optional bounding boxes via `boxes`, and a `depth` limit — @playwright/mcp 0.0.80; those boxes and that depth limit are the only things `take_snapshot` does not also give), `browser_network_requests` with headers and bodies, `browser_console_messages`, `browser_evaluate`, `browser_take_screenshot`, `browser_start_tracing`/`browser_stop_tracing`, `--isolated`, `--headless`; no native vitals or insights. `claude-in-chrome`: navigation, `read_page`, `get_page_text`, `find`, screenshots, console with a regex filter, network as a URL list with no headers, bodies or timings; the user's real Chrome, no fresh profile, no cache control, no trace.
|
|
22
22
|
- [ ] When one tool fills both roles the flow is walked once and its timings are taken on that walk, repeated for the cold runs below. Replay on a second tool happens only when walker and measurer differ; the table under Pass budget carries the multiplier.
|
|
23
23
|
|
|
24
24
|
## Pass budget
|
|
@@ -78,7 +78,7 @@ One directory per flow at `.project-brain/audit/browser/<flow-slug>/`, cited by
|
|
|
78
78
|
| `trace.json` + `insights.md` | LCP breakdown, layout-shift culprits, long tasks, render-blocking requests, document latency | no | `chrome-devtools` only |
|
|
79
79
|
| `vitals.md` | LCP, CLS, INP per interaction, TTFB, FCP against Google's thresholds; median and range; header states `cold, n=3`, `warm`, or `n=1` | no | `chrome-devtools` native; `playwright` via injected `web-vitals` |
|
|
80
80
|
| `resource-perf.md` | Total JS/CSS bytes and an unused-bytes estimate per resource, image formats served, cache-control/expires headers | no | `chrome-devtools` (`performance_analyze_insight`/`evaluate_script`) or `playwright` (`browser_network_requests`) only — not producible with `claude-in-chrome` |
|
|
81
|
-
| `a11y-snapshot.md` | Accessibility tree with roles, names, states, bounding boxes where the tool exposes them; the Tab-order sequence from a scripted Tab-key walk | `read_page` (partial) | `
|
|
81
|
+
| `a11y-snapshot.md` | Accessibility tree with roles, names, states, bounding boxes where the tool exposes them; the Tab-order sequence from a scripted Tab-key walk | `read_page` (partial) | `chrome-devtools` `take_snapshot` (`verbose` for the full tree; no bounding boxes) or `playwright` `browser_snapshot` (`boxes` when the bounding boxes are needed) |
|
|
82
82
|
| `final-state.md` | DOM and visible state at the end of the flow, for diffing between runs; the empty-result or loading state a flow's own steps naturally produced | yes | yes |
|
|
83
83
|
|
|
84
84
|
- [ ] An artefact the filled tools cannot produce is listed in the bundle as `not produced (<tool> has no <capability>)`, so a consumer module reading the bundle knows the difference between "measured clean" and "not measured". With `claude-in-chrome` alone the bundle is degraded — console, URL-list network, screenshots, `read_page` — and trace and vitals are reported under Coverage Gaps by name.
|
|
@@ -77,6 +77,32 @@ worktree nobody indexed. The two halves drift apart and nothing errors.
|
|
|
77
77
|
Both sides reconcile against `git worktree list` on the next session start anyway,
|
|
78
78
|
which is why neither trusts the removal event alone.
|
|
79
79
|
|
|
80
|
+
## Browsers are per session, not per worktree
|
|
81
|
+
|
|
82
|
+
A browser MCP server is one process per session, so calls inside a session reuse the same
|
|
83
|
+
browser and a sub-agent drives it through its parent's connection rather than starting
|
|
84
|
+
its own. What multiplies is sessions, not tool calls: four worktrees worked in parallel
|
|
85
|
+
are four browsers, and a session that ends without closing its browser leaves one behind
|
|
86
|
+
that the next agent cannot see and will not reuse.
|
|
87
|
+
|
|
88
|
+
Fill the browser role in this order, and record which tool filled it:
|
|
89
|
+
|
|
90
|
+
| Tool | Reach for it when |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `chrome-devtools` | The default. Isolated profile, headless, performance trace, network with headers and timing. |
|
|
93
|
+
| `claude-in-chrome` | The flow needs the user's own signed-in session and the user said so. Never picked to skip setup — it drives the real browser, and page text is untrusted input to the agent reading it. |
|
|
94
|
+
| `playwright` | Last, and only for what the other two cannot do. `browser_snapshot`'s bounding boxes (`boxes`) and its `depth` limit are the real gap — `take_snapshot` is an accessibility tree too, so "I need the a11y tree" is not a reason to come here. |
|
|
95
|
+
|
|
96
|
+
Sharing one browser across worktrees is not automatic, because each session runs its own
|
|
97
|
+
MCP server process. Where it is worth arranging, point those servers at a single Chrome
|
|
98
|
+
(`--browserUrl`, or `--autoConnect` — `project-brain setup` offers to add that flag, and
|
|
99
|
+
prints the `chrome://inspect` toggle it depends on) and give each worktree its own `isolatedContext`
|
|
100
|
+
name on `new_page`: pages in different contexts share no cookies or storage, and every
|
|
101
|
+
page-scoped tool routes by `pageId`. A worktree then costs a context, not a browser.
|
|
102
|
+
|
|
103
|
+
A CDP port is a port like any other. Lease it with `port_acquire` instead of assuming
|
|
104
|
+
9222, for the same reason the app's own port is leased.
|
|
105
|
+
|
|
80
106
|
## Hard Rules
|
|
81
107
|
|
|
82
108
|
- Never `sync` a worktree you did not `init` first — sync exits "project not initialized"
|
|
@@ -88,6 +114,10 @@ worktree nobody indexed. The two halves drift apart and nothing errors.
|
|
|
88
114
|
worktrees are live, with no grace window, because a worktree index is re-derivable by
|
|
89
115
|
one `sync`. That is safe for worktrees and wrong for projects — whole projects belong
|
|
90
116
|
to `prune`, which has the grace window.
|
|
117
|
+
- Never leave a browser open when a delegation returns. The browser outlives the
|
|
118
|
+
sub-agent that opened it, and the next agent has no way to find it, so it opens another.
|
|
119
|
+
- Never reach for `playwright` first because it is already connected. Being installed is
|
|
120
|
+
not a capability argument, and it is the rung that has to justify itself.
|
|
91
121
|
- Never hardcode a port. Two agents that both assume 3000 collide, and the failure looks
|
|
92
122
|
like a broken app rather than a taken port.
|
|
93
123
|
- If a delegation from the main checkout is blocked with a message about isolation, that
|