Commit Graph

688 Commits

Author SHA1 Message Date
Tommy D. Rossi 2a95cc9a9a Update playwright 2026-02-05 22:28:59 +01:00
Tommy D. Rossi d9c3362dd9 Update PLAYWRITER_AGENTS.md 2026-02-05 22:28:56 +01:00
Tommy D. Rossi 9e88bcd64e agents 2026-02-05 22:26:47 +01:00
Tommy D. Rossi 187b8ba992 Update AGENTS.md 2026-02-05 22:14:55 +01:00
Tommy D. Rossi 2bc851e37b Update PLAYWRITER_AGENTS.md 2026-02-05 22:14:35 +01:00
Tommy D. Rossi afd0840523 chore: wire forked playwright-core into workspace 2026-02-05 17:06:08 +01:00
Tommy D. Rossi 3f24ac1d8f fix: use Runtime.evaluate fallback when setScriptSource is deprecated
Chrome deprecated Debugger.setScriptSource in Chrome 142+ (removed in 145).
Falls back to Runtime.evaluate to re-execute modified scripts, which
works for scripts defining functions at global scope.
2026-02-05 16:56:27 +01:00
Tommy D. Rossi 0eaf771c57 docs: refine Framer MCP palette verification 2026-02-05 15:48:17 +01:00
Tommy D. Rossi c4a413efba fix iframe snapshots and document Framer MCP flow 2026-02-05 14:49:32 +01:00
Tommy D. Rossi cd6d512d74 Update aria-snapshot.test.ts 2026-02-05 13:13:11 +01:00
Tommy D. Rossi 4eac3235cd waitForExtension in cli session new command 2026-02-05 12:48:37 +01:00
Tommy D. Rossi ebcfe33323 add iframe test with snapshot use 2026-02-05 12:47:15 +01:00
Tommy D. Rossi e33af55982 docs: clarify playwriter auto-use 2026-02-04 23:39:52 +01:00
Tommy D. Rossi 73c9723840 slopping around 2026-02-04 23:21:33 +01:00
Tommy D. Rossi 280572b36e refactor: track frame ownership on targets 2026-02-04 22:16:44 +01:00
Tommy D. Rossi ac49afc535 fix: route iframe targets through page sessions 2026-02-04 22:08:04 +01:00
Tommy D. Rossi dfe9738a00 Update SKILL.md 2026-02-04 22:05:28 +01:00
Tommy D. Rossi a718299b73 feat: add well-known skills discovery endpoint 2026-02-04 19:20:33 +01:00
Tommy D. Rossi 0b60fe844e chore: update diff messaging from tests
- Add "No changes since last call" hints for snapshots/html/markdown

- Adjust truncation message to suggest search

- Update skill.md snapshot behavior doc
2026-02-04 18:16:00 +01:00
Tommy D. Rossi b510f3f0d5 feat: use stable browser keys in CLI selection
- Show stableKey in session new listing
- Require stableKey for --browser selection
- Pass stableKey to session creation when available
2026-02-04 18:01:49 +01:00
Tommy D. Rossi e41c85af7b fix: match stable extension keys in status check 2026-02-04 17:57:59 +01:00
Tommy D. Rossi 1a59082e12 feat: auto-connect tabs created via ghostPublicAPI.openTab
Tabs created via Ghost Browser's openTab API now automatically
attach to Playwriter's debugger, making them immediately available
in context.pages() without requiring manual extension icon click.
2026-02-04 17:47:57 +01:00
Tommy D. Rossi 6f2aae0006 fix: enforce extension binding for cdp clients
- Resolve extension connections by stable key and map to current connection
- Reject Playwright clients without explicit extension binding when multiple browsers connected
- Reject duplicate clientId connections
- Allow default extension only when a single browser is connected
- Include stableKey in /extensions/status response
2026-02-04 17:36:30 +01:00
Tommy D. Rossi e3cec36bf6 fix: normalize session ids for relay endpoints
- Normalize sessionId values to strings in relay handlers
- Ensure recording endpoints pass string sessionId values
- Stringify CLI sessionId before request body
2026-02-04 17:26:24 +01:00
Tommy D. Rossi 321acf9dbc Update ghost-browser-api.d.ts 2026-02-04 17:24:36 +01:00
Tommy D. Rossi 5641b3803b fix: address multi-browser routing issues
- Move recording cleanup before connection delete (was no-op)
- Only fallback to default extension when extensionId is null
- Add cwd param to /cli/session/new, CLI passes process.cwd()
- Require pre-existing sessions for execute/reset endpoints
- Remove duplicate ensureRelayServer call in CLI
- Increase fetch timeouts from 500ms to 2000ms
2026-02-04 16:51:44 +01:00
Tommy D. Rossi 44514f00c8 feat: add multi-browser support
- Extension connections are now tracked per-connection with isolated state
- Each connection has its own connectedTargets, pendingRequests, messageId
- Sessions are bound to specific extensionId via SessionMetadata
- New /extensions/status endpoint for listing all connected browsers
- CLI session new shows browser selection when multiple connected
- Browser detection via navigator.userAgentData (Ghost, Brave, Edge, etc)
- Added identity permission for Chrome profile email detection
2026-02-04 16:43:09 +01:00
Tommy D. Rossi c623c91891 extract Ghost Browser code to shared ghost-browser.ts
- Constants, types, proxy factory, and handler in one file
- Works in both Node.js (executor) and Chrome (extension) environments
- executor.ts imports createGhostBrowserChrome factory
- background.ts imports handleGhostBrowserCommand handler
2026-02-04 13:16:29 +01:00
Tommy D. Rossi f2faee50c0 move Ghost Browser docs to .d.ts, shorten skill.md section 2026-02-04 13:14:46 +01:00
Tommy D. Rossi a1178cbd35 add Ghost Browser API integration
Exposes chrome.ghostPublicAPI, chrome.ghostProxies, and chrome.projects
in the executor sandbox when running in Ghost Browser.

- protocol.ts: add GhostBrowserCommandMessage type
- background.ts: handle ghost-browser messages, call chrome APIs
- cdp-relay.ts: route ghost-browser commands to extension
- executor.ts: inject chrome object with Proxy-based API namespaces
- skill.md: document Ghost Browser integration with examples

Enables multi-identity automation for managing multiple accounts,
rotating proxies per tab/identity, and isolated cookie sessions.
2026-02-04 13:09:41 +01:00
Tommy D. Rossi a52ec9a8f2 add Ghost Browser API type definitions
Extracted from Ghost Browser.app binary. Includes:
- chrome.ghostPublicAPI: tab/identity management
- chrome.ghostProxies: full proxy control per tab/identity/session
- chrome.projects: identity/workspace/session management
- Extended chrome.tabs with Ghost-specific properties
2026-02-04 12:55:03 +01:00
Tommy D. Rossi bd38ba0532 feat: implicit return for single expressions using acorn parser
- Parse code with acorn to detect single expression statements
- Auto-wrap expressions with 'return await (...)' for implicit return
- Exclude side-effects: assignments, updates (x++), delete operator
- Update skill.md examples to remove console.log (keep await)
- Add unit tests for shouldAutoReturn function
2026-02-04 11:23:39 +01:00
Tommy D. Rossi 26ddeb2a7b more logging 2026-02-03 22:01:44 +01:00
Tommy D. Rossi adeaabd5aa speed up list scripts test (10.5s → 1.4s)
The test was slow due to:
1. Page scanning by content (slow waitForLoadState + content() per page)
2. Using example.com which only has inline scripts with empty URLs

Fix:
- Use URL matching instead of content scanning (fast)
- Use news.ycombinator.com which has scripts with actual URLs
- The Debugger class filters out scripts without URLs, so we need
  a page that actually has external script files

Total relay-session.test.ts time: 74s → 27s
2026-02-03 20:05:11 +01:00
Tommy D. Rossi f6110ec023 speed up slow debugger tests (~74s → ~38s)
Two tests were taking 30s and 10s respectively due to avoidable waits:

1. 'should pause on all exceptions with setPauseOnExceptions' (30.6s → 0.5s)
   - Was awaiting page.evaluate() while debugger was paused
   - Playwright's evaluate has 30s timeout, so it sat there waiting
   - Fix: use Runtime.evaluate via CDP session (don't await until after resume)

2. 'should manage breakpoints with Debugger class' (10.6s → 0.4s)
   - Was connecting over CDP and scanning all pages with waitForLoadState
   - Each page waited up to 5s for domcontentloaded + content check
   - Fix: use getCDPSessionForPage directly on the page we just created
2026-02-03 19:56:46 +01:00
Tommy D. Rossi 7eac07b989 stabilize debugger CDP tests 2026-02-03 19:19:32 +01:00
Tommy D. Rossi decac4888e Update relay-session.test.ts 2026-02-03 18:38:59 +01:00
Tommy D. Rossi d401b22dfe delete cdp session from cache on page close 2026-02-03 18:35:07 +01:00
Tommy D. Rossi 0a38084263 use unique temp entry files for bundles 2026-02-03 15:40:53 +01:00
Tommy D. Rossi fa2a520d84 interactiveOnly: true in the screenshot aria labels 2026-02-03 15:38:41 +01:00
Tommy D. Rossi 0819067dc0 log times it takes for snapshotting and screenshotting 2026-02-03 15:37:08 +01:00
Tommy D. Rossi a3c874ac4c try returning first page when not in PLAYWRITER_AUTO_ENABLE 2026-02-03 15:36:50 +01:00
Tommy D. Rossi 01a6622d71 use virtual entrypoints for wrapper bundles 2026-02-03 13:51:27 +01:00
Tommy D. Rossi cfd9ba8594 fix entry shit in build for client 2026-02-03 13:46:20 +01:00
Tommy D. Rossi 3b71024328 Update executor.ts 2026-02-03 13:15:47 +01:00
Tommy D. Rossi ede969cbc2 Refactor aria snapshot filtering and add unit tests 2026-02-03 13:09:02 +01:00
Tommy D. Rossi bc8b10039c Update snapshot-tools.test.ts 2026-02-03 12:38:52 +01:00
Tommy D. Rossi d0489b3d48 Update relay-core.test.ts 2026-02-03 12:36:57 +01:00
Tommy D. Rossi 1b6be13d11 Dedupe parent names that are substrings of child names in aria snapshot 2026-02-03 12:36:54 +01:00
Tommy D. Rossi ae7276e466 fix: diff-utils returns plain content without messages
- no-change returns newContent directly
- full returns newContent directly (no 'Content changed significantly' prefix)
- diff only returned when shorter than full content
2026-02-03 12:12:19 +01:00