pw-repl 0.6.1 → 0.7.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/skill/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pw-repl
3
- description: Inspect and drive a Chromium browser, possibly one a person is using, through the pw-repl (playwright-repl) REPL - tabs, page snapshots, clicks and typing, the mouse at a point (moves, buttons, wheel), requests and their bodies, console messages, waiting for pages and elements, choosing files, faking, patching or delaying responses, cutting or slowing the network, emulating a phone, dark mode, a locale or a timezone, and recording what the person does. Use when asked to look at, debug or test something in a web page, in an existing Chromium with remote debugging or in one it starts itself.
3
+ description: Inspect and drive a Chromium browser, possibly one a person is using, through the pw-repl (playwright-repl) REPL - tabs, page snapshots, clicks and typing, the mouse at a point (moves, buttons, wheel), requests and their bodies, console messages, waiting for pages and elements, choosing files, faking, patching or delaying responses, cutting or slowing the network, emulating a phone, dark mode, a locale or a timezone, recording what the person does, and recording a video of a tab. Use when asked to look at, debug or test something in a web page, in an existing Chromium with remote debugging or in one it starts itself.
4
4
  allowed-tools: Bash(pw-repl:*) Bash(npx pw-repl@latest:*)
5
5
  ---
6
6
 
@@ -158,7 +158,8 @@ blindly retry a change), `64` usage or the REPL is not reachable. `pw-repl --hel
158
158
  ## Learn the commands
159
159
 
160
160
  Run `pw-repl send help`. It lists six topics; `help <topic>` lists their commands, `help <command>`
161
- gives usage and caveats, and `help --all` prints everything at once. It needs no running REPL. The
161
+ gives usage and caveats, and `help --all` prints everything at once. pw-repl answers it itself: it needs
162
+ no running REPL, and never reaches one. The
162
163
  help is the command reference; this file does not repeat it. If you know playwright-cli, its command
163
164
  names work too (`help playwright-cli` lists them).
164
165
 
@@ -194,23 +195,28 @@ pw-repl send -c <name> close # your modes off; tab close
194
195
  one too; otherwise no tab is selected.
195
196
  Tab numbers change when tabs open or close; `tab <url-part>` and `tab close <url-part>` pick a tab by
196
197
  its URL and refuse if it is ambiguous.
197
- - Dialogs are never answered on their own. While one is open, its page and the commands that read it
198
- wait; `dialog` shows it, and `dialog accept` or `dialog dismiss` answers it.
198
+ - You can answer any dialog yourself, one you opened included: `dialog` shows it, and `dialog accept`
199
+ or `dialog dismiss` answers it. Nothing answers one on its own, and while one is open its page and
200
+ the commands that read it wait. One answered in the browser is gone from `dialog` too.
199
201
  - Modes and tabs stay on or open until they are turned off or closed, whoever started them. `modes`
200
202
  lists what is on in every tab (the prompt shows the selected tab's, e.g. `(watch routes:1) pw>`);
201
203
  `modes off` turns off every mode in every tab.
202
204
  - Someone may be attached to the REPL's tmux session; killing the session ends it for them too.
203
- - pw-repl does not record video. For one of a flow in a browser of its own, Microsoft's playwright-cli (a
204
- separate tool, the npm package `@playwright/cli`: `video-start`, `video-stop`); for this browser as the
205
- person sees it, a screen recorder (`ffmpeg -f x11grab`, macOS `screencapture -v`, OBS). A screen
206
- recorder records their whole screen, not the tab: ask before starting one, or have them start it. A
207
- headless browser is not on the screen, so it does not show.
205
+ - To point something out, to the person or in a screenshot, `highlight <ref|selector>` draws a box over it
206
+ without changing the page (`--style=<css>` restyles it; `highlight off` hides them). Its label can
207
+ cover what is below it; `help highlight` says how to mark a screenshot without one.
208
+ - For a video, `help video` says which way suits what you want: `record on` records a tab's page, and a
209
+ screen recorder on the person's machine records what they see.
208
210
 
209
211
  ## Environment
210
212
 
211
213
  - Chromium must be running with `--remote-debugging-port=9222`, unless `--launch` starts one. A headless
212
214
  one works too (`--headless=new`); nobody answers its dialogs but `dialog`.
213
215
  - `PW_CHROME` — the Chromium `--launch` starts (default: Playwright's own, then one on the `PATH`).
216
+ - `PW_FFMPEG` — the ffmpeg `record` uses, and no other, read by the REPL, not by `send` (default:
217
+ Playwright's own, then one on the `PATH`).
218
+ - Playwright's own Chromium and ffmpeg are found where Playwright installs them: `PLAYWRIGHT_BROWSERS_PATH`,
219
+ or `~/.cache/ms-playwright`.
214
220
  - `PW_CDP_URL` — CDP endpoint (default `http://localhost:9222`).
215
221
  - `PW_SCREENSHOT_DIR` — where the REPL saves screenshots, read when it starts, not by `send`. Without it,
216
222
  a REPL on a socket of its own saves them next to its socket, and any other in `/tmp`. `screenshot`