feat(skill/playwright): unify shared-session CLI flow for web skills

This commit is contained in:
2026-03-04 12:19:57 +08:00
parent aa72b570e1
commit 8fc5c6e128
12 changed files with 411 additions and 236 deletions
+7 -2
View File
@@ -20,13 +20,17 @@ description: "Generate music in Gemini web via browser automation, download resu
- Ensure browser session can access Gemini (`https://gemini.google.com/app`).
- If login, captcha, or MFA is required, pause and ask user to complete it manually.
- Use the shared Playwright session policy across all skills:
- `export PLAYWRIGHT_SHARED_SESSION=codex-shared`
- Invoke Playwright CLI through `/Users/xd/java/xhs/tools/pw` (do not pass `--session` manually).
- Decide output directory before generation, for example:
- `/Users/xd/java/xhs/output/gemini-music`
Quick run:
```bash
bash scripts/run_music_flow.sh \
export PLAYWRIGHT_SHARED_SESSION=codex-shared
python3 scripts/run_music_flow.py \
--prompt "创作一段 90 BPM 的 lo-fi hiphop,温暖、夜晚、钢琴和刷镲,时长 30 秒。" \
--target /Users/xd/java/xhs/output/gemini-music \
--count 1
@@ -152,5 +156,6 @@ Return:
## Scripts
- `scripts/run_music_flow.sh`: End-to-end runner (login gate, enter music tool, generate, download MP3, collect files).
- `/Users/xd/java/xhs/tools/pw`: Shared Playwright CLI entrypoint with fixed session + lock.
- `scripts/run_music_flow.py`: End-to-end runner (login gate, enter music tool, generate, download MP3, collect files).
- `scripts/collect_downloads.py`: Collect recent downloaded audio files with fallback sources, dedupe, and manifest.