Repository navigation
feat: a bare patchright-cli shows the open sessions and what to run next - #22
Merged
Merged
Conversation
The no-argument run printed the whole manual. It now prints the home view: the live sessions of this workspace with their mode, profile, tab count, current page and lifetime, then the next commands (or how to open a browser when none is). --json gives the same as data; --help is still the manual. It starts nothing, asks each daemon for tab-list with a 1.5 s budget, deletes no stale session file and does not touch the idle timer. Idea from AhaiMk01/patchright-cli's home view.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A bare
patchright-cliprinted the whole manual. It now prints the home view: what is already open in this workspace and what to run next, so an agent arriving in a workspace continues a session instead of opening a second one. The idea comes from the home view in AhaiMk01/patchright-cli; the implementation is ours, client-side only.With nothing open it says so and points at
open <url>andenv.How it works
src/commands/home.ts: reads this workspace's session files, connects to each daemon in parallel and askstab-list(raw) with a 1.5 s budget. A daemon that refuses the connection is skipped (stale file, left in place: the view is read-only); one that does not answer in time shows asbusy; one started by a newer client shows asincompatiblewith anopenhint, since this client refuses to drive it.--jsonreturns the same as data (sessions[]withstatus,headed,profile,tabs,current,lifetime, plusnext[]).--helpis unchanged and still the manual.src/program.ts(forked): the bare-run branch calls the home view; the--helpbranch is as before. TheAgent skill:line moved into a shared variable and shows in both.Docs and tests
patchright-cliafterenv, and continue an open session instead of opening another; README and CHANGELOG mirror it.tests/unit/home.spec.ts: tab-list parsing, workspace filtering, stale/busy/incompatible sessions, hints.tests/integration/isolation.spec.ts: empty view, a named session with its current page,--json,--help.npm run check,npm run test:unit(133),npm run test:integration(23) pass locally on Windows. Measured 0.14 s with two live sessions.🤖 Generated with Claude Code