@narumitw/pi-chrome-devtools 0.52.1 → 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 +112 -146
- package/dist/chunks/{browser-settings-menu-L4CZINWO.ts → browser-settings-menu-VI2I3TXI.js} +3 -3
- package/dist/chunks/{chunk-RM7OGXVL.ts → chunk-CC37WUUE.js} +2 -2
- package/dist/chunks/{menu-U4AIAN7V.ts → menu-LLR455UX.js} +4 -4
- package/dist/index.ts +5 -5
- package/package.json +6 -6
- /package/dist/chunks/{browser-settings-menu-L4CZINWO.ts.map → browser-settings-menu-VI2I3TXI.js.map} +0 -0
- /package/dist/chunks/{chunk-RM7OGXVL.ts.map → chunk-CC37WUUE.js.map} +0 -0
- /package/dist/chunks/{menu-U4AIAN7V.ts.map → menu-LLR455UX.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,37 +1,22 @@
|
|
|
1
|
-
# 🌐 pi-chrome-devtools —
|
|
1
|
+
# 🌐 pi-chrome-devtools — Inspect and Control Chrome from Pi
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@narumitw/pi-chrome-devtools) [](https://pi.dev) [](./LICENSE)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Let Pi inspect browser tabs, navigate pages, evaluate JavaScript, and capture screenshots through native Chrome DevTools Protocol tools.
|
|
6
6
|
|
|
7
|
-
Use it
|
|
7
|
+
Use it for web debugging, UI validation, and browser-assisted investigation without running an MCP server.
|
|
8
8
|
|
|
9
|
-
|
|
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
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
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,25 +30,28 @@ Try without installing permanently:
|
|
|
45
30
|
pi -e npm:@narumitw/pi-chrome-devtools
|
|
46
31
|
```
|
|
47
32
|
|
|
48
|
-
|
|
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
|
-
The package declares `dist/index.ts`, so an unbuilt local checkout must run
|
|
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
|
-
|
|
42
|
+
## 🚀 Quick start
|
|
57
43
|
|
|
58
|
-
|
|
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.
|
|
59
47
|
|
|
60
|
-
|
|
61
|
-
`http://127.0.0.1:9222`. If that local endpoint is unavailable and `browser.autoLaunch` is `true`, it
|
|
62
|
-
lazily launches an extension-owned Chromium-family browser with an isolated temp profile and retries
|
|
63
|
-
the CDP request. Existing endpoints are reused and are never terminated by the extension.
|
|
48
|
+
## 🌐 Browser setup
|
|
64
49
|
|
|
65
|
-
|
|
66
|
-
|
|
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`:
|
|
67
55
|
|
|
68
56
|
```json
|
|
69
57
|
{
|
|
@@ -75,21 +63,21 @@ Configure the canonical user file at
|
|
|
75
63
|
}
|
|
76
64
|
```
|
|
77
65
|
|
|
78
|
-
`browser.endpoint` must be an HTTP origin with an explicit port and no credentials, path, query, or
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
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.
|
|
83
71
|
|
|
84
|
-
The configured endpoint must expose the standard CDP HTTP discovery routes such as `/json/version`
|
|
85
|
-
|
|
86
|
-
`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.
|
|
87
74
|
|
|
88
75
|
### Unpacked extensions
|
|
89
76
|
|
|
90
77
|
> [!WARNING]
|
|
91
|
-
> An unpacked extension executes privileged browser code.
|
|
92
|
-
>
|
|
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.
|
|
93
81
|
|
|
94
82
|
Add trusted unpacked-extension paths to the same canonical user file:
|
|
95
83
|
|
|
@@ -105,14 +93,13 @@ Add trusted unpacked-extension paths to the same canonical user file:
|
|
|
105
93
|
}
|
|
106
94
|
```
|
|
107
95
|
|
|
108
|
-
Every user-file path must be absolute.
|
|
109
|
-
valid `manifest.json` and cannot contain a comma because Chrome uses commas to separate multiple
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
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.
|
|
113
100
|
|
|
114
|
-
A trusted project can replace the user extension list in
|
|
115
|
-
|
|
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`):
|
|
116
103
|
|
|
117
104
|
```json
|
|
118
105
|
{
|
|
@@ -122,43 +109,37 @@ A trusted project can replace the user extension list in
|
|
|
122
109
|
}
|
|
123
110
|
```
|
|
124
111
|
|
|
125
|
-
Project `extensionPaths` replace, rather than append to, the user array.
|
|
126
|
-
override `browser.endpoint`, `browser.autoLaunch`, or `browser.executablePath`; browser connection
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
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.
|
|
130
116
|
|
|
131
|
-
When `extensionPaths` is non-empty, the extension skips attach-first behavior and starts an isolated,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
the executable is missing, or the browser product is unsupported. It never adds extensions to,
|
|
135
|
-
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.
|
|
136
120
|
|
|
137
|
-
Settings are loaded on session start.
|
|
138
|
-
old managed browser is closed before the new configuration is applied.
|
|
139
|
-
existing no-extension behavior.
|
|
140
|
-
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.
|
|
141
125
|
|
|
142
126
|
### Deprecated environment overrides and manual endpoints
|
|
143
127
|
|
|
144
|
-
The existing `PI_CHROME_DEVTOOLS_HOST`, `PI_CHROME_DEVTOOLS_PORT`,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
a deprecation warning. Move their values to `browser.endpoint`, `browser.autoLaunch`, and
|
|
148
|
-
`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.
|
|
149
131
|
|
|
150
|
-
Without unpacked extensions, browser discovery still checks platform-specific Chrome, Chromium,
|
|
151
|
-
|
|
152
|
-
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:
|
|
153
134
|
|
|
154
135
|
```bash
|
|
155
136
|
google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/pi-chrome-devtools
|
|
156
137
|
```
|
|
157
138
|
|
|
158
|
-
On session shutdown, the extension terminates only browser processes it started and best-effort
|
|
159
|
-
|
|
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.
|
|
160
141
|
|
|
161
|
-
## 🛠️
|
|
142
|
+
## 🛠️ Tools
|
|
162
143
|
|
|
163
144
|
- `chrome_devtools_load` — find and load browser capabilities relevant to a task.
|
|
164
145
|
- `chrome_devtools_list_pages` — list inspectable Chrome tabs/pages.
|
|
@@ -187,8 +168,8 @@ An empty array leaves the loader active but makes every browser capability unava
|
|
|
187
168
|
|
|
188
169
|
### Screenshot files
|
|
189
170
|
|
|
190
|
-
`chrome_devtools_screenshot` always saves the captured PNG to disk.
|
|
191
|
-
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:
|
|
192
173
|
|
|
193
174
|
```text
|
|
194
175
|
/tmp/pi-chrome-devtools-screenshot-<uuid>.png
|
|
@@ -203,43 +184,35 @@ chrome_devtools_screenshot({
|
|
|
203
184
|
});
|
|
204
185
|
```
|
|
205
186
|
|
|
206
|
-
Relative `savePath` values resolve from Pi's current working directory.
|
|
207
|
-
is stripped to match Pi file-mention paths.
|
|
208
|
-
inside the current working directory or the OS temp directory.
|
|
209
|
-
NUL bytes, symlinked parent directories, directories as targets, final symbolic-link targets, or
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
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" })`.
|
|
214
194
|
|
|
215
|
-
## 💬
|
|
195
|
+
## 💬 Commands
|
|
216
196
|
|
|
217
197
|
```text
|
|
218
198
|
/chrome-devtools
|
|
219
199
|
```
|
|
220
200
|
|
|
221
|
-
Opens a menu that shows the lazy catalog size, whether that catalog is saved, the configured
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
- **
|
|
226
|
-
|
|
227
|
-
- **
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
probing the endpoint or starting Chrome.
|
|
231
|
-
- **Browser settings** — immediately save the endpoint, auto-launch policy, or browser executable;
|
|
232
|
-
inspect unpacked-extension paths and effective sources. A deprecated environment override remains
|
|
233
|
-
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.
|
|
234
210
|
- **Help** — view command usage and return to the menu.
|
|
235
211
|
|
|
236
|
-
In the tool screen, **Select all** and **Select none** are unambiguous shortcuts; individual rows use
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
unconfirmed draft without changing runtime tools or settings. A failed apply restores the previous
|
|
241
|
-
availability and loaded-tool state, preserves the settings file, retains the draft for retry, and
|
|
242
|
-
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.
|
|
243
216
|
|
|
244
217
|
Direct subcommands are also available:
|
|
245
218
|
|
|
@@ -254,28 +227,22 @@ Direct subcommands are also available:
|
|
|
254
227
|
/chrome-devtools disable
|
|
255
228
|
```
|
|
256
229
|
|
|
257
|
-
Compatibility aliases remain available: `toggle` and `select` mean `tools`, `on` means `enable`, and
|
|
258
|
-
`off` means `disable`.
|
|
230
|
+
Compatibility aliases remain available: `toggle` and `select` mean `tools`, `on` means `enable`, and `off` means `disable`.
|
|
259
231
|
|
|
260
232
|
- `help` shows command usage.
|
|
261
|
-
- `quickstart` shows the configured CDP endpoint, endpoint source, auto-launch mode, browser
|
|
262
|
-
|
|
263
|
-
- `status` shows available and loaded capability counts, loader state, the persisted catalog,
|
|
264
|
-
settings file path, endpoint source, launch mode, last launch attempt, and active non-Chrome tool
|
|
265
|
-
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.
|
|
266
235
|
- `settings` opens the same immediate-save browser settings flow used by the menu.
|
|
267
236
|
- `tools` opens the same staged, width-safe availability and review flow used by the menu.
|
|
268
237
|
- `toggle` and `select` are compatibility aliases for `tools`.
|
|
269
|
-
- `enable` makes all five capability tools available to the loader and saves that catalog; `on` is a
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
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.
|
|
273
241
|
|
|
274
|
-
The menu, `settings`, `tools`, `help`, `quickstart`, and `status` require TUI or RPC mode so their
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
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.
|
|
279
246
|
|
|
280
247
|
## ⚙️ Settings
|
|
281
248
|
|
|
@@ -285,25 +252,22 @@ The available capability names are saved to:
|
|
|
285
252
|
${PI_CODING_AGENT_DIR:-~/.pi/agent}/pi-chrome-devtools.json
|
|
286
253
|
```
|
|
287
254
|
|
|
288
|
-
The same file owns `browser.endpoint`, `browser.autoLaunch`, `browser.executablePath`, and
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
`pi-chrome-devtools.json`. The first subsequent settings save writes the canonical file. If both
|
|
305
|
-
files exist, `pi-chrome-devtools.json` wins and the legacy file is ignored. The legacy
|
|
306
|
-
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.
|
|
307
271
|
|
|
308
272
|
## 🧠 Use cases
|
|
309
273
|
|
|
@@ -331,7 +295,8 @@ packages/pi-chrome-devtools/
|
|
|
331
295
|
└── package.json
|
|
332
296
|
```
|
|
333
297
|
|
|
334
|
-
`index.ts` is the Pi entrypoint and forwards to `chrome-devtools.ts`; the other source modules are internal.
|
|
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`:
|
|
335
300
|
|
|
336
301
|
```json
|
|
337
302
|
{
|
|
@@ -349,4 +314,5 @@ Pi extension, Pi coding agent, Chrome DevTools Protocol, CDP, browser automation
|
|
|
349
314
|
|
|
350
315
|
## 📄 License
|
|
351
316
|
|
|
352
|
-
MIT.
|
|
317
|
+
MIT.
|
|
318
|
+
See [`LICENSE`](./LICENSE).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
|
-
// @ts-nocheck -- generated
|
|
2
|
+
// @ts-nocheck -- the generated entry uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
applyRuntimeBrowserSettings,
|
|
5
5
|
loadSettings,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
saveBrowserSettings,
|
|
9
9
|
shutdownManagedBrowser,
|
|
10
10
|
state
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CC37WUUE.js";
|
|
12
12
|
|
|
13
13
|
// src/browser-settings-menu.ts
|
|
14
14
|
import { isAbsolute } from "node:path";
|
|
@@ -263,4 +263,4 @@ function formatError(error) {
|
|
|
263
263
|
export {
|
|
264
264
|
showChromeDevtoolsBrowserSettings
|
|
265
265
|
};
|
|
266
|
-
//# sourceMappingURL=browser-settings-menu-
|
|
266
|
+
//# sourceMappingURL=browser-settings-menu-VI2I3TXI.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
|
-
// @ts-nocheck -- generated
|
|
2
|
+
// @ts-nocheck -- the generated entry uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
|
|
4
4
|
// src/tool-names.ts
|
|
5
5
|
var CHROME_DEVTOOLS_TOOL_NAMES = [
|
|
@@ -1604,4 +1604,4 @@ export {
|
|
|
1604
1604
|
buildCommandGuide,
|
|
1605
1605
|
allChromeDevtoolsTools
|
|
1606
1606
|
};
|
|
1607
|
-
//# sourceMappingURL=chunk-
|
|
1607
|
+
//# sourceMappingURL=chunk-CC37WUUE.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
|
-
// @ts-nocheck -- generated
|
|
2
|
+
// @ts-nocheck -- the generated entry uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
CHROME_DEVTOOLS_TOOL_NAMES,
|
|
5
5
|
availableChromeDevtoolsTools,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
sanitizeChromeDevtoolsDisplay,
|
|
13
13
|
setSelectedChromeDevtoolsTools,
|
|
14
14
|
state
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CC37WUUE.js";
|
|
16
16
|
|
|
17
17
|
// src/menu.ts
|
|
18
18
|
import { defineMenu, runMenu, runTask } from "@narumitw/pi-tui-kit";
|
|
@@ -124,7 +124,7 @@ async function showChromeDevtoolsMenu(pi, ctx, generation) {
|
|
|
124
124
|
return result?.closeParent ? { kind: "close" } : { kind: "stay" };
|
|
125
125
|
},
|
|
126
126
|
settings: async () => {
|
|
127
|
-
const { showChromeDevtoolsBrowserSettings } = await import("./browser-settings-menu-
|
|
127
|
+
const { showChromeDevtoolsBrowserSettings } = await import("./browser-settings-menu-VI2I3TXI.js");
|
|
128
128
|
if (!isCurrent()) return { kind: "stay" };
|
|
129
129
|
const result = await showChromeDevtoolsBrowserSettings(ctx, generation);
|
|
130
130
|
if (!isCurrent()) return { kind: "stay" };
|
|
@@ -394,4 +394,4 @@ export {
|
|
|
394
394
|
showChromeDevtoolsMenu,
|
|
395
395
|
showChromeDevtoolsToolWorkflow
|
|
396
396
|
};
|
|
397
|
-
//# sourceMappingURL=menu-
|
|
397
|
+
//# sourceMappingURL=menu-LLR455UX.js.map
|
package/dist/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
|
-
// @ts-nocheck -- generated
|
|
2
|
+
// @ts-nocheck -- the generated entry uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
CHROME_DEVTOOLS_TOOL_NAMES,
|
|
5
5
|
DEFAULT_ENDPOINT_WAIT_MS,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
waitForChromeDevtoolsSettings,
|
|
27
27
|
waitForSettingsWrites,
|
|
28
28
|
withEndpointRetry
|
|
29
|
-
} from "./chunks/chunk-
|
|
29
|
+
} from "./chunks/chunk-CC37WUUE.js";
|
|
30
30
|
|
|
31
31
|
// src/tools.ts
|
|
32
32
|
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
@@ -688,7 +688,7 @@ async function handleChromeDevtoolsCommand(pi, args, ctx, generation) {
|
|
|
688
688
|
if (!ctx.hasUI || ctx.mode !== "tui" && ctx.mode !== "rpc") {
|
|
689
689
|
throw new Error("/chrome-devtools settings requires TUI or RPC mode");
|
|
690
690
|
}
|
|
691
|
-
const { showChromeDevtoolsBrowserSettings } = await import("./chunks/browser-settings-menu-
|
|
691
|
+
const { showChromeDevtoolsBrowserSettings } = await import("./chunks/browser-settings-menu-VI2I3TXI.js");
|
|
692
692
|
if (generation !== state.sessionGeneration) return;
|
|
693
693
|
await showChromeDevtoolsBrowserSettings(ctx, generation);
|
|
694
694
|
return;
|
|
@@ -697,7 +697,7 @@ async function handleChromeDevtoolsCommand(pi, args, ctx, generation) {
|
|
|
697
697
|
if (!ctx.hasUI || ctx.mode !== "tui" && ctx.mode !== "rpc") {
|
|
698
698
|
throw new Error("/chrome-devtools tools requires TUI or RPC mode");
|
|
699
699
|
}
|
|
700
|
-
const { showChromeDevtoolsToolWorkflow } = await import("./chunks/menu-
|
|
700
|
+
const { showChromeDevtoolsToolWorkflow } = await import("./chunks/menu-LLR455UX.js");
|
|
701
701
|
if (generation !== state.sessionGeneration) return;
|
|
702
702
|
await showChromeDevtoolsToolWorkflow(pi, ctx, generation);
|
|
703
703
|
return;
|
|
@@ -728,7 +728,7 @@ async function showMenu(pi, ctx, generation) {
|
|
|
728
728
|
if (!ctx.hasUI || ctx.mode !== "tui" && ctx.mode !== "rpc") {
|
|
729
729
|
throw new Error("/chrome-devtools menu requires TUI or RPC mode; use a direct subcommand");
|
|
730
730
|
}
|
|
731
|
-
const { showChromeDevtoolsMenu } = await import("./chunks/menu-
|
|
731
|
+
const { showChromeDevtoolsMenu } = await import("./chunks/menu-LLR455UX.js");
|
|
732
732
|
if (generation !== state.sessionGeneration) return;
|
|
733
733
|
await showChromeDevtoolsMenu(pi, ctx, generation);
|
|
734
734
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narumitw/pi-chrome-devtools",
|
|
3
|
-
"version": "0.52.
|
|
3
|
+
"version": "0.52.2",
|
|
4
4
|
"description": "Pi extension that exposes Chrome DevTools Protocol tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"typebox": "*"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@biomejs/biome": "2.5.
|
|
43
|
-
"@earendil-works/pi-coding-agent": "0.84.
|
|
44
|
-
"esbuild": "0.28.
|
|
45
|
-
"typebox": "1.3.
|
|
42
|
+
"@biomejs/biome": "2.5.10",
|
|
43
|
+
"@earendil-works/pi-coding-agent": "0.84.3",
|
|
44
|
+
"esbuild": "0.28.2",
|
|
45
|
+
"typebox": "1.3.18",
|
|
46
46
|
"typescript": "7.0.2"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@narumitw/pi-tui-kit": "^0.
|
|
49
|
+
"@narumitw/pi-tui-kit": "^0.58.0"
|
|
50
50
|
},
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
/package/dist/chunks/{browser-settings-menu-L4CZINWO.ts.map → browser-settings-menu-VI2I3TXI.js.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|