@narumitw/pi-chrome-devtools 0.52.0 → 0.52.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,37 +1,22 @@
1
- # 🌐 pi-chrome-devtools — Chrome DevTools Tools for Pi Agents
1
+ # 🌐 pi-chrome-devtools — Inspect and Control Chrome from Pi
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@narumitw/pi-chrome-devtools)](https://www.npmjs.com/package/@narumitw/pi-chrome-devtools) [![Pi extension](https://img.shields.io/badge/Pi-extension-blue)](https://pi.dev) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
4
4
 
5
- `@narumitw/pi-chrome-devtools` is a native [Pi coding agent](https://pi.dev) extension that exposes Chrome DevTools Protocol (CDP) automation as Pi tools.
5
+ Let Pi inspect browser tabs, navigate pages, evaluate JavaScript, and capture screenshots through native Chrome DevTools Protocol tools.
6
6
 
7
- Use it to let the Pi agent inspect browser tabs, navigate pages, evaluate JavaScript, and capture screenshots while debugging web apps or validating UI behavior.
7
+ Use it for web debugging, UI validation, and browser-assisted investigation without running an MCP server.
8
8
 
9
- This package is inspired by [`chrome-devtools-mcp`](https://github.com/ChromeDevTools/chrome-devtools-mcp), but it is implemented as native Pi tools instead of an MCP server.
9
+ The design is inspired by [`chrome-devtools-mcp`](https://github.com/ChromeDevTools/chrome-devtools-mcp), not guaranteed to be compatible with it.
10
10
 
11
11
  ## ✨ Features
12
12
 
13
- - Lists inspectable Chrome tabs and pages.
14
- - Selects an active Chrome page for later tool calls.
15
- - Navigates Chrome to a target URL, creating an inspectable page when none exists.
16
- - Recovers from stale active page selections by falling back to an available page.
17
- - Evaluates JavaScript in the selected page.
18
- - Captures PNG screenshots, including optional full-page screenshots, and saves them to disk.
19
- - Renders compact tool results that expand/collapse with Pi's default output toggle (`Ctrl+O`).
20
- - Reuses an existing Chrome DevTools Protocol endpoint when one is already available.
21
- - Lazily auto-launches a Chromium-family browser for missing local endpoints, with Chrome,
22
- Chromium, Brave, and Edge fallbacks.
23
- - Loads one or more user-approved unpacked extensions into an isolated managed Chrome for Testing
24
- or Chromium browser.
25
- - Uses a dynamic managed DevTools port by default to avoid port conflicts, while preserving
26
- explicit endpoint overrides.
27
- - Retries briefly while Chrome is starting and reports actionable endpoint errors.
28
- - Shows statusline activity only while Chrome DevTools tools are running.
29
- - Keeps one loader tool active and exposes matching browser capabilities only when the agent needs them.
30
- - Provides a state-first `/chrome-devtools` menu for tool availability, editable browser settings,
31
- browser status, setup, and help.
32
- - Stages menu-based availability changes for exact review before one confirmed apply.
33
- - Uses `@narumitw/pi-tui-kit` for width-safe TUI menus and equivalent RPC dialogs.
34
- - Persists the Chrome DevTools lazy-load catalog across Pi restarts.
13
+ - Lists and selects inspectable pages, navigates URLs, evaluates JavaScript, and captures PNG screenshots.
14
+ - Reuses an existing CDP endpoint or lazily launches an isolated Chromium-family browser.
15
+ - Recovers from stale page selections and reports actionable browser startup or endpoint errors.
16
+ - Loads explicitly approved unpacked extensions only in an extension-owned Chrome for Testing or Chromium process.
17
+ - Keeps browser tools lazy and exposes availability, setup, status, and help through `/chrome-devtools`.
18
+ - Shows compact expandable results and activity only while browser tools are running.
19
+ - Persists reviewed tool availability while keeping browser connection settings machine-owned.
35
20
 
36
21
  ## 📦 Install
37
22
 
@@ -45,21 +30,28 @@ Try without installing permanently:
45
30
  pi -e npm:@narumitw/pi-chrome-devtools
46
31
  ```
47
32
 
48
- Try this package locally from the repository root:
33
+ Build and try this package locally from the repository root:
49
34
 
50
35
  ```bash
36
+ npm --workspace @narumitw/pi-chrome-devtools run build
51
37
  pi -e ./packages/pi-chrome-devtools
52
38
  ```
53
39
 
54
- ## 🚀 Browser startup
40
+ The package declares `dist/index.ts`, so an unbuilt local checkout must run the build before Pi loads the package directory.
55
41
 
56
- Without unpacked extensions, the extension first tries `browser.endpoint`, defaulting to
57
- `http://127.0.0.1:9222`. If that local endpoint is unavailable and `browser.autoLaunch` is `true`, it
58
- lazily launches an extension-owned Chromium-family browser with an isolated temp profile and retries
59
- the CDP request. Existing endpoints are reused and are never terminated by the extension.
42
+ ## 🚀 Quick start
60
43
 
61
- Configure the canonical user file at
62
- `${PI_CODING_AGENT_DIR:-~/.pi/agent}/pi-chrome-devtools.json`:
44
+ Start Pi and ask the agent to load the Chrome DevTools capability needed for the task.
45
+ The extension first tries `http://127.0.0.1:9222` and otherwise launches an isolated local Chromium-family browser by default.
46
+ Run `/chrome-devtools` to review browser status, settings, help, and available tools.
47
+
48
+ ## 🌐 Browser setup
49
+
50
+ Without unpacked extensions, the extension first tries `browser.endpoint`, defaulting to `http://127.0.0.1:9222`.
51
+ If that endpoint is unavailable and `browser.autoLaunch` is `true`, it lazily launches an extension-owned browser with an isolated temporary profile and retries the CDP request.
52
+ Existing endpoints are reused and never terminated by the extension.
53
+
54
+ Configure the canonical user file at `${PI_CODING_AGENT_DIR:-~/.pi/agent}/pi-chrome-devtools.json`:
63
55
 
64
56
  ```json
65
57
  {
@@ -71,21 +63,21 @@ Configure the canonical user file at
71
63
  }
72
64
  ```
73
65
 
74
- `browser.endpoint` must be an HTTP origin with an explicit port and no credentials, path, query, or
75
- fragment. Omitting it keeps attach-first behavior on `127.0.0.1:9222` and lets a managed launch use
76
- Chrome's dynamic DevTools port mode (`--remote-debugging-port=0`). Explicitly saving an endpoint pins
77
- managed launches to that port. `browser.autoLaunch` defaults to `true`. `browser.executablePath` is
78
- optional and must be an absolute path; when absent, normal browser discovery applies.
66
+ `browser.endpoint` must be an HTTP origin with an explicit port and no credentials, path, query, or fragment.
67
+ Omitting it keeps attach-first behavior on `127.0.0.1:9222` and lets a managed launch use Chrome's dynamic DevTools port mode (`--remote-debugging-port=0`).
68
+ Explicitly saving an endpoint pins managed launches to that port.
69
+ `browser.autoLaunch` defaults to `true`.
70
+ `browser.executablePath` is optional and must be an absolute path; when absent, normal browser discovery applies.
79
71
 
80
- The configured endpoint must expose the standard CDP HTTP discovery routes such as `/json/version`
81
- and `/json/list`. Chrome's newer built-in permission flow can listen on port `9222` while returning
82
- `404` from those routes; setting the same HTTP origin does not by itself make that flow compatible.
72
+ The configured endpoint must expose the standard CDP HTTP discovery routes such as `/json/version` and `/json/list`.
73
+ Chrome's newer built-in permission flow can listen on port `9222` while returning `404` from those routes; setting the same HTTP origin does not by itself make that flow compatible.
83
74
 
84
75
  ### Unpacked extensions
85
76
 
86
77
  > [!WARNING]
87
- > An unpacked extension executes privileged browser code. Load only code you trust. Project settings
88
- > are honored only when Pi reports the project as trusted.
78
+ > An unpacked extension executes privileged browser code.
79
+ > Load only code you trust.
80
+ > Project settings are honored only when Pi reports the project as trusted.
89
81
 
90
82
  Add trusted unpacked-extension paths to the same canonical user file:
91
83
 
@@ -101,14 +93,13 @@ Add trusted unpacked-extension paths to the same canonical user file:
101
93
  }
102
94
  ```
103
95
 
104
- Every user-file path must be absolute. Each extension path must resolve to a directory containing a
105
- valid `manifest.json` and cannot contain a comma because Chrome uses commas to separate multiple
106
- startup paths. For extension-configured sessions, `executablePath` must identify Chrome for
107
- Testing or Chromium. Branded Google Chrome is rejected because tested releases can silently ignore
108
- unpacked-extension startup flags.
96
+ Every user-file path must be absolute.
97
+ Each extension path must resolve to a directory containing a valid `manifest.json` and cannot contain a comma because Chrome uses commas to separate multiple startup paths.
98
+ For extension-configured sessions, `executablePath` must identify Chrome for Testing or Chromium.
99
+ Branded Google Chrome is rejected because tested releases can silently ignore unpacked-extension startup flags.
109
100
 
110
- A trusted project can replace the user extension list in
111
- `<workspace>/.pi/pi-chrome-devtools.json`. Relative paths resolve from the workspace (`ctx.cwd`):
101
+ A trusted project can replace the user extension list in `<workspace>/.pi/pi-chrome-devtools.json`.
102
+ Relative paths resolve from the workspace (`ctx.cwd`):
112
103
 
113
104
  ```json
114
105
  {
@@ -118,43 +109,37 @@ A trusted project can replace the user extension list in
118
109
  }
119
110
  ```
120
111
 
121
- Project `extensionPaths` replace, rather than append to, the user array. A project file cannot
122
- override `browser.endpoint`, `browser.autoLaunch`, or `browser.executablePath`; browser connection
123
- settings remain machine-owned user configuration. Effective precedence is defaults, user settings,
124
- trusted project extension paths, then deprecated environment overrides. No new environment variable
125
- is required.
112
+ Project `extensionPaths` replace, rather than append to, the user array.
113
+ A project file cannot override `browser.endpoint`, `browser.autoLaunch`, or `browser.executablePath`; browser connection settings remain machine-owned user configuration.
114
+ Effective precedence is defaults, user settings, trusted project extension paths, then deprecated environment overrides.
115
+ No new environment variable is required.
126
116
 
127
- When `extensionPaths` is non-empty, the extension skips attach-first behavior and starts an isolated,
128
- extension-owned managed browser with `--disable-extensions-except` and `--load-extension`. It fails
129
- before spawning when the endpoint is remote, auto-launch is disabled, an explicit port is occupied,
130
- the executable is missing, or the browser product is unsupported. It never adds extensions to,
131
- modifies, restarts, or closes an external browser.
117
+ When `extensionPaths` is non-empty, the extension skips attach-first behavior and starts an isolated, extension-owned managed browser with `--disable-extensions-except` and `--load-extension`.
118
+ It fails before spawning when the endpoint is remote, auto-launch is disabled, an explicit port is occupied, the executable is missing, or the browser product is unsupported.
119
+ It never adds extensions to, modifies, restarts, or closes an external browser.
132
120
 
133
- Settings are loaded on session start. After editing JSON, use `/reload` or replace the session; the
134
- old managed browser is closed before the new configuration is applied. Missing files preserve the
135
- existing no-extension behavior. Invalid JSON, invalid browser values, and missing manifests are left
136
- unchanged and ignored with an actionable warning.
121
+ Settings are loaded on session start.
122
+ After editing JSON, use `/reload` or replace the session; the old managed browser is closed before the new configuration is applied.
123
+ Missing files preserve the existing no-extension behavior.
124
+ Invalid JSON, invalid browser values, and missing manifests are left unchanged and ignored with an actionable warning.
137
125
 
138
126
  ### Deprecated environment overrides and manual endpoints
139
127
 
140
- The existing `PI_CHROME_DEVTOOLS_HOST`, `PI_CHROME_DEVTOOLS_PORT`,
141
- `PI_CHROME_DEVTOOLS_AUTO_LAUNCH`, and `PI_CHROME_DEVTOOLS_BROWSER` variables remain temporary
142
- compatibility overrides. They still take precedence over JSON, but every session that sees one emits
143
- a deprecation warning. Move their values to `browser.endpoint`, `browser.autoLaunch`, and
144
- `browser.executablePath`; the variables will be removed in a future version.
128
+ The existing `PI_CHROME_DEVTOOLS_HOST`, `PI_CHROME_DEVTOOLS_PORT`, `PI_CHROME_DEVTOOLS_AUTO_LAUNCH`, and `PI_CHROME_DEVTOOLS_BROWSER` variables remain temporary compatibility overrides.
129
+ They still take precedence over JSON, but every session that sees one emits a deprecation warning.
130
+ Move their values to `browser.endpoint`, `browser.autoLaunch`, and `browser.executablePath`; the variables will be removed in a future version.
145
131
 
146
- Without unpacked extensions, browser discovery still checks platform-specific Chrome, Chromium,
147
- Brave, and Microsoft Edge candidates. Manual launch remains available when no unpacked extensions are
148
- configured:
132
+ Without unpacked extensions, browser discovery still checks platform-specific Chrome, Chromium, Brave, and Microsoft Edge candidates.
133
+ Manual launch remains available when no unpacked extensions are configured:
149
134
 
150
135
  ```bash
151
136
  google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/pi-chrome-devtools
152
137
  ```
153
138
 
154
- On session shutdown, the extension terminates only browser processes it started and best-effort
155
- removes their temporary profiles. It never closes user-started browsers or remote endpoints.
139
+ On session shutdown, the extension terminates only browser processes it started and best-effort removes their temporary profiles.
140
+ It never closes user-started browsers or remote endpoints.
156
141
 
157
- ## 🛠️ Pi tools
142
+ ## 🛠️ Tools
158
143
 
159
144
  - `chrome_devtools_load` — find and load browser capabilities relevant to a task.
160
145
  - `chrome_devtools_list_pages` — list inspectable Chrome tabs/pages.
@@ -183,8 +168,8 @@ An empty array leaves the loader active but makes every browser capability unava
183
168
 
184
169
  ### Screenshot files
185
170
 
186
- `chrome_devtools_screenshot` always saves the captured PNG to disk. If `savePath` is omitted,
187
- the extension writes a unique temp file such as:
171
+ `chrome_devtools_screenshot` always saves the captured PNG to disk.
172
+ If `savePath` is omitted, the extension writes a unique temp file such as:
188
173
 
189
174
  ```text
190
175
  /tmp/pi-chrome-devtools-screenshot-<uuid>.png
@@ -199,43 +184,35 @@ chrome_devtools_screenshot({
199
184
  });
200
185
  ```
201
186
 
202
- Relative `savePath` values resolve from Pi's current working directory. A single leading `@`
203
- is stripped to match Pi file-mention paths. Absolute paths are accepted only when they stay
204
- inside the current working directory or the OS temp directory. Paths containing `..` segments,
205
- NUL bytes, symlinked parent directories, directories as targets, final symbolic-link targets, or
206
- other non-regular file targets are rejected. Existing regular files at the target path are
207
- replaced. The tool result includes the resolved path, byte count, and an inline image block when
208
- the active model/provider can consume images. If the model cannot inspect the inline image, ask it
209
- to read the saved path, for example `read({ path: "artifacts/homepage.png" })`.
187
+ Relative `savePath` values resolve from Pi's current working directory.
188
+ A single leading `@` is stripped to match Pi file-mention paths.
189
+ Absolute paths are accepted only when they stay inside the current working directory or the OS temp directory.
190
+ Paths containing `..` segments, NUL bytes, symlinked parent directories, directories as targets, final symbolic-link targets, or other non-regular file targets are rejected.
191
+ Existing regular files at the target path are replaced.
192
+ The tool result includes the resolved path, byte count, and an inline image block when the active model/provider can consume images.
193
+ If the model cannot inspect the inline image, ask it to read the saved path, for example `read({ path: "artifacts/homepage.png" })`.
210
194
 
211
- ## 💬 Command
195
+ ## 💬 Commands
212
196
 
213
197
  ```text
214
198
  /chrome-devtools
215
199
  ```
216
200
 
217
- Opens a menu that shows the lazy catalog size, whether that catalog is saved, the configured
218
- endpoint, the observed managed-browser state, and any settings or launch warning before you choose
219
- an action. The five actions stay on one level:
220
-
221
- - **Choose available browser tools…** — stage any combination of the five capabilities, then review
222
- the exact available/unavailable result before selecting **Apply tool changes**.
223
- - **Make all browser tools available…** or **Make all browser tools unavailable…** — preview the
224
- context-appropriate bulk change before applying it.
225
- - **Browser status** — inspect runtime, endpoint, launch mode, and the last launch attempt without
226
- probing the endpoint or starting Chrome.
227
- - **Browser settings** — immediately save the endpoint, auto-launch policy, or browser executable;
228
- inspect unpacked-extension paths and effective sources. A deprecated environment override remains
229
- effective until removed even when its underlying JSON value changes.
201
+ Opens a menu that shows the lazy catalog size, whether that catalog is saved, the configured endpoint, the observed managed-browser state, and any settings or launch warning before you choose an action.
202
+ The five actions stay on one level:
203
+
204
+ - **Choose available browser tools…** — stage any combination of the five capabilities, then review the exact available/unavailable result before selecting **Apply tool changes**.
205
+ - **Make all browser tools available…** or **Make all browser tools unavailable…** — preview the context-appropriate bulk change before applying it.
206
+ - **Browser status** — inspect runtime, endpoint, launch mode, and the last launch attempt without probing the endpoint or starting Chrome.
207
+ - **Browser settings** — immediately save the endpoint, auto-launch policy, or browser executable.
208
+ Inspect unpacked-extension paths and effective sources.
209
+ A deprecated environment override remains effective until removed even when its underlying JSON value changes.
230
210
  - **Help** — view command usage and return to the menu.
231
211
 
232
- In the tool screen, **Select all** and **Select none** are unambiguous shortcuts; individual rows use
233
- friendly task labels while retaining their raw `chrome_devtools_*` identity in the description.
234
- Toggles remain a command-local draft. **Review changes** previews the exact effect, **Apply tool
235
- changes** saves it, and Cancel, Escape, Ctrl+C, disposal, or session replacement discards an
236
- unconfirmed draft without changing runtime tools or settings. A failed apply restores the previous
237
- availability and loaded-tool state, preserves the settings file, retains the draft for retry, and
238
- reports how to recover.
212
+ In the tool screen, **Select all** and **Select none** are unambiguous shortcuts; individual rows use friendly task labels while retaining their raw `chrome_devtools_*` identity in the description.
213
+ Toggles remain a command-local draft.
214
+ **Review changes** previews the exact effect, **Apply tool changes** saves it, and Cancel, Escape, Ctrl+C, disposal, or session replacement discards an unconfirmed draft without changing runtime tools or settings.
215
+ A failed apply restores the previous availability and loaded-tool state, preserves the settings file, retains the draft for retry, and reports how to recover.
239
216
 
240
217
  Direct subcommands are also available:
241
218
 
@@ -250,28 +227,22 @@ Direct subcommands are also available:
250
227
  /chrome-devtools disable
251
228
  ```
252
229
 
253
- Compatibility aliases remain available: `toggle` and `select` mean `tools`, `on` means `enable`, and
254
- `off` means `disable`.
230
+ Compatibility aliases remain available: `toggle` and `select` mean `tools`, `on` means `enable`, and `off` means `disable`.
255
231
 
256
232
  - `help` shows command usage.
257
- - `quickstart` shows the configured CDP endpoint, endpoint source, auto-launch mode, browser
258
- candidates, last launch attempt, and launch hints.
259
- - `status` shows available and loaded capability counts, loader state, the persisted catalog,
260
- settings file path, endpoint source, launch mode, last launch attempt, and active non-Chrome tool
261
- count.
233
+ - `quickstart` shows the configured CDP endpoint, endpoint source, auto-launch mode, browser candidates, last launch attempt, and launch hints.
234
+ - `status` shows available and loaded capability counts, loader state, the persisted catalog, settings file path, endpoint source, launch mode, last launch attempt, and active non-Chrome tool count.
262
235
  - `settings` opens the same immediate-save browser settings flow used by the menu.
263
236
  - `tools` opens the same staged, width-safe availability and review flow used by the menu.
264
237
  - `toggle` and `select` are compatibility aliases for `tools`.
265
- - `enable` makes all five capability tools available to the loader and saves that catalog; `on` is a
266
- compatibility alias.
267
- - `disable` makes all five capability tools unavailable and saves the empty catalog; `off` is a
268
- compatibility alias. The slash command and `chrome_devtools_load` remain available.
238
+ - `enable` makes all five capability tools available to the loader and saves that catalog; `on` is a compatibility alias.
239
+ - `disable` makes all five capability tools unavailable and saves the empty catalog; `off` is a compatibility alias.
240
+ The slash command and `chrome_devtools_load` remain available.
269
241
 
270
- The menu, `settings`, `tools`, `help`, `quickstart`, and `status` require TUI or RPC mode so their
271
- result is observable. TUI uses keyboard navigation and injected Pi keybindings; RPC receives
272
- equivalent standard dialogs. In print and JSON modes, interactive and informational routes reject
273
- explicitly instead of silently opening unavailable UI. The immediate `enable`/`disable` routes remain
274
- available for deterministic non-interactive use.
242
+ The menu, `settings`, `tools`, `help`, `quickstart`, and `status` require TUI or RPC mode so their result is observable.
243
+ TUI uses keyboard navigation and injected Pi keybindings; RPC receives equivalent standard dialogs.
244
+ In print and JSON modes, interactive and informational routes reject explicitly instead of silently opening unavailable UI.
245
+ The immediate `enable`/`disable` routes remain available for deterministic non-interactive use.
275
246
 
276
247
  ## ⚙️ Settings
277
248
 
@@ -281,25 +252,22 @@ The available capability names are saved to:
281
252
  ${PI_CODING_AGENT_DIR:-~/.pi/agent}/pi-chrome-devtools.json
282
253
  ```
283
254
 
284
- The same file owns `browser.endpoint`, `browser.autoLaunch`, `browser.executablePath`, and
285
- `browser.extensionPaths`. Browser connection fields are machine-owned user settings; trusted project
286
- files may replace only `browser.extensionPaths`. Confirmed menu changes apply before the next browser
287
- connection and close only an extension-owned managed browser. Manual JSON edits and unpacked-extension
288
- changes apply after `/reload` or session replacement.
289
-
290
- When the file is missing or invalid, the extension preserves Pi's current Chrome DevTools
291
- availability policy instead of replacing it. A valid saved catalog is restored on Pi startup and
292
- `/reload`, while its capability definitions remain deferred. A missing file is created by the first
293
- confirmed browser or tool setting. Within one Pi process, all browser and tool saves run in invocation
294
- order, reread the latest valid document, publish by temporary-file rename, and preserve unknown
295
- fields. Malformed JSON or invalid recognized fields make menu mutation unavailable and block direct
296
- saves without replacement; a failed save restores the prior displayed and effective state.
297
-
298
- Compatibility: older versions used `pi-chrome-devtools-settings.json`. A legacy-only file remains
299
- readable with a warning and is never modified automatically; rename it to
300
- `pi-chrome-devtools.json`. The first subsequent settings save writes the canonical file. If both
301
- files exist, `pi-chrome-devtools.json` wins and the legacy file is ignored. The legacy
302
- filename is deprecated and will be removed in a future major release.
255
+ The same file owns `browser.endpoint`, `browser.autoLaunch`, `browser.executablePath`, and `browser.extensionPaths`.
256
+ Browser connection fields are machine-owned user settings; trusted project files may replace only `browser.extensionPaths`.
257
+ Confirmed menu changes apply before the next browser connection and close only an extension-owned managed browser.
258
+ Manual JSON edits and unpacked-extension changes apply after `/reload` or session replacement.
259
+
260
+ When the file is missing or invalid, the extension preserves Pi's current Chrome DevTools availability policy instead of replacing it.
261
+ A valid saved catalog is restored on Pi startup and `/reload`, while its capability definitions remain deferred.
262
+ A missing file is created by the first confirmed browser or tool setting.
263
+ Within one Pi process, all browser and tool saves run in invocation order, reread the latest valid document, publish by temporary-file rename, and preserve unknown fields.
264
+ Malformed JSON or invalid recognized fields make menu mutation unavailable and block direct saves without replacement; a failed save restores the prior displayed and effective state.
265
+
266
+ Compatibility: older versions used `pi-chrome-devtools-settings.json`.
267
+ A legacy-only file remains readable with a warning and is never modified automatically; rename it to `pi-chrome-devtools.json`.
268
+ The first subsequent settings save writes the canonical file.
269
+ If both files exist, `pi-chrome-devtools.json` wins and the legacy file is ignored.
270
+ The legacy filename is deprecated and will be removed in a future major release.
303
271
 
304
272
  ## 🧠 Use cases
305
273
 
@@ -313,6 +281,9 @@ filename is deprecated and will be removed in a future major release.
313
281
 
314
282
  ```txt
315
283
  packages/pi-chrome-devtools/
284
+ ├── dist/ # Generated TypeScript runtime loaded by Jiti
285
+ ├── scripts/
286
+ │ └── build-runtime.mjs # Deterministic runtime builder and boundary validator
316
287
  ├── src/
317
288
  │ ├── index.ts # Pi package entrypoint
318
289
  │ ├── chrome-devtools.ts # Extension registration and command orchestration
@@ -324,20 +295,24 @@ packages/pi-chrome-devtools/
324
295
  └── package.json
325
296
  ```
326
297
 
327
- `index.ts` is the Pi entrypoint and forwards to `chrome-devtools.ts`; the other source modules are internal. The package exposes its Pi extension through `package.json`:
298
+ `index.ts` is the Pi entrypoint and forwards to `chrome-devtools.ts`; the other source modules are internal.
299
+ The package exposes its Pi extension through `package.json`:
328
300
 
329
301
  ```json
330
302
  {
331
303
  "pi": {
332
- "extensions": ["./src/index.ts"]
304
+ "extensions": ["./dist/index.ts"]
333
305
  }
334
306
  }
335
307
  ```
336
308
 
309
+ The generated runtime is built from the authoritative `src/index.ts` graph and does not import back into `src`.
310
+
337
311
  ## 🔎 Keywords
338
312
 
339
313
  Pi extension, Pi coding agent, Chrome DevTools Protocol, CDP, browser automation, web debugging, JavaScript evaluation, screenshot automation, AI coding agent tools.
340
314
 
341
315
  ## 📄 License
342
316
 
343
- MIT. See [`LICENSE`](./LICENSE).
317
+ MIT.
318
+ See [`LICENSE`](./LICENSE).