Commit Graph

572 Commits

Author SHA1 Message Date
jackwener 53cd006a23 fix(boss): resolve limit=60 infinite loop and global CLI hangs
- search.ts: Added deduplication break condition so if the API returns duplicate pages, it stops instead of looping forever.
- search.ts: Removed unsafe Promise.race around page.goto which caused 'context closed' errors.
- browser.ts: Added robust static cleanup hooks to guarantee process and MCP lock destruction on crashed or ctrl+c'd runs.
2026-03-15 20:33:22 +08:00
jackwener c9710a656b feat(boss): add pagination loop to support fetching more than 15 results
- The API endpoint only returns 15 results per page.
- Added a loop to fetch multiple pages until the requested limit is reached.
- Added random 1-3 second delays between page fetches to avoid rate limits.
2026-03-15 20:19:30 +08:00
jackwener 4f570fa75e docs: add instruction to get token by clicking extension icon 2026-03-15 20:08:30 +08:00
jackwener 730285c0ca docs: set MCP Bridge as primary connection method, CDP as fallback 2026-03-15 20:07:32 +08:00
jackwener c5915d9ee3 docs: clarify that MCP token needs to be configured in both MCP config and env var 2026-03-15 20:06:32 +08:00
jackwener b7c8067bc9 docs: restore playwright MCP token configuration guide 2026-03-15 20:05:08 +08:00
jackwener c28ccd4b23 docs: huge improvement on README structure, badges and readability 2026-03-15 19:59:02 +08:00
jackwener 00f0ac9133 fix(boss): prioritize fresh browser cookie extraction over boss-cli cache 2026-03-15 19:58:46 +08:00
jackwener 64d655ae0d feat(boss): rewrite search adapter to use boss-cli native cookie extraction
- BOSS Zhipin aggressively detects CDP connections and kills pages
- Completely rewrote boss/search.ts to use browser: false (bypassing Playwright)
- Implemented native Python subprocess to extract cookies via browser-cookie3
- Falls back to boss-cli ~/.config/boss-cli/credential.json if available
- Uses direct Node.js fetch with anti-detection headers to avoid bans
2026-03-15 19:55:46 +08:00
jackwener 9c78ffdd39 chore: change license to BSD-3-Clause 2026-03-15 19:54:34 +08:00
jackwener a6e9c3b611 feat(browser): enhance CDP auto-discovery with port probe & opt-in priority
- Add TCP port reachability check to handle stale DevToolsActivePort files
- Make discoverChromeEndpoint() async with port probe before returning
- Change connection priority: extension mode is default, CDP is opt-in
  - OPENCLI_CDP_ENDPOINT: explicit CDP endpoint
  - OPENCLI_USE_CDP=1: enable DevToolsActivePort auto-discovery
  - Default: --extension mode (Playwright MCP Bridge)
- Add verbose logging for CDP discovery when -v flag is used
- Fix indentation inconsistency in connect() method
- Update README.md, README.zh-CN.md, SKILL.md with new connection docs
2026-03-15 19:44:27 +08:00
jackwener da155e96f0 feat: add forceExtension to bypass CDP detection for anti-bot sites
- Added forceExtension flag to CliCommand, CliOptions, browserSession, and PlaywrightMCP.connect()
- BOSS Zhipin detects CDP mode and drops connections; marked boss/search with forceExtension: true
- Also supports OPENCLI_FORCE_EXTENSION=1 env var for global override
- Fixed async discoverChromeEndpoint() placement outside Promise constructor
- Enhanced boss search with city names, experience, degree, salary, etc.
2026-03-15 19:39:39 +08:00
backtime1993 c20eaee393 feat(browser): Chrome 144+ auto-discovery via DevToolsActivePort
Chrome 144+ allows enabling remote debugging from chrome://inspect
without any command-line flags (--remote-debugging-port). Chrome writes
the active port and browser GUID to a DevToolsActivePort file in the
user data directory.

This change reads that file to auto-discover the CDP WebSocket endpoint,
eliminating the need for the Playwright MCP Bridge browser extension in
most cases.

Connection priority:
1. OPENCLI_CDP_ENDPOINT env var (manual override)
2. DevToolsActivePort auto-discovery (Chrome/Edge, cross-platform)
3. --extension mode fallback (original behavior)

Supports Windows, macOS, and Linux with Chrome, Edge, and Chromium.

Co-authored-by: kensei <backtime1993@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 19:34:14 +08:00
jackwener 15d8c45b95 feat(boss): add city name mapping, experience/degree/salary filters, page support
- 30+ Chinese city names → code mapping (e.g. --city 杭州)
- Experience filter: 应届/1-3年/3-5年/5-10年/10年以上
- Degree filter: 大专/本科/硕士/博士
- Salary filter: 3K以下/3-5K/5-10K/10-20K/20-50K/50K以上
- Page number support for pagination
- Area now shows city·district·business district
- Skills column added to output
2026-03-15 19:31:05 +08:00
jackwener 3ac5aa3023 docs: reduce excessive emoji usage across markdown files 2026-03-15 19:30:32 +08:00
jackwener 9a6e157af6 docs: add strong AI Agent prompts to read CLI-CREATOR.md before creating adapters 2026-03-15 19:28:05 +08:00
jackwener 9a45988197 v0.4.2 v0.4.2 2026-03-15 19:00:15 +08:00
jackwener 2d638e3a0a fix(manifest): extract TS adapter args at build time for proper CLI registration
The manifest builder now statically parses TS source files to extract
args, description, columns, domain, and strategy metadata. Previously
TS adapters had empty args in the manifest, causing commander to reject
their options (e.g. --keyword) before the lazy module could load.

Also includes the xiaohongshu search DOM fallback fix from earlier.

Co-authored-by: jack4world <jack4world@users.noreply.github.com>
2026-03-15 18:59:15 +08:00
jackwener b3850d9c53 fix(xiaohongshu): switch search from broken XHR interception to DOM extraction (Fixes #10)
Co-authored-by: jack4world <jack4world@users.noreply.github.com>
2026-03-15 18:55:29 +08:00
jackwener 91d7892516 docs(CLI-CREATOR): streamline 840→719 lines — remove redundancies, keep all value
- MCP Bridge: 6-step flowchart + step-by-step → compact table (-51 lines)
- Remove duplicate cascade code example (kept full template below)
- Verbose mode + output verification → 3-line compact form
- Step 5 + design philosophy → merged into concise section
2026-03-15 18:49:47 +08:00
jackwener 3f859b3238 docs(CLI-CREATOR): add SDK table, template-first guide, pagination pattern, success story
Four practical improvements based on real adapter development experience:
- Real success story: 5-minute following adapter walkthrough
- Step 2.5: template-first + Bilibili SDK reference table
- Pagination pattern with code template (pn+ps)
- Wbi vs fetchJson decision rule
2026-03-15 18:46:13 +08:00
jackwener 2fdab085a7 chore: release v0.4.1 v0.4.1 2026-03-15 18:41:14 +08:00
jackwener 7ec04c66cb docs: deep review fixes — sync command tables to actual 47 commands
- Command count 46 → 47 (added following)
- bilibili row: add 'following' command
- github row: remove non-existent 'trending', change mode to Public
- SKILL.md: add following, xueqiu hot/search commands
- Fix github section from 'trending=browser' to 'public'
2026-03-15 18:41:14 +08:00
jackwener f8ee50b776 feat(bilibili): add following adapter — get user's followed accounts
Discovered via Playwright MCP Bridge workflow (CLI-CREATOR.md):
 - Navigate to space.bilibili.com/{uid}/fans/follow
 - Sniff network: GET /x/relation/followings (Cookie-tier, no Wbi needed)
 - Verify API response: total=1342, fields: mid/uname/sign

Also fixed .d.ts loading bug in build-manifest.ts and engine.ts:
 - build-manifest now scans .js files in dist/ (not .ts)
 - engine.ts skips .d.js declaration stubs
2026-03-15 18:38:34 +08:00
jackwener 53b28637bb docs(CLI-CREATOR): add mandatory Playwright MCP Bridge workflow for AI agents
Critical addition: AI agents MUST use browser_navigate, browser_snapshot,
browser_network_requests, browser_click to discover APIs interactively.
Includes 6-step workflow, concrete tool examples, and common mistakes table.
This directly addresses the root cause of the subtitle API exploration failure.
2026-03-15 18:31:04 +08:00
jackwener ad9e9605fc feat: extreme architectural optimizations
Phase 1: Smart autoScroll with MutationObserver (single IPC, instant DOM change detection)
Phase 2: Build-time CLI manifest compiler + lazy-loading engine (instant cold start)
Phase 3: Batch IPC fetch (N browser fetches in single evaluate() call)
2026-03-15 18:25:58 +08:00
jackwener 0e1cea84b6 chore: release v0.4.0 v0.4.0 2026-03-15 18:16:27 +08:00
jackwener ee2e0a3bfc docs: update command tables to 46 commands, add subtitle/dynamic/ranking/frontpage/subreddit/profile/timeline/me/user, update SKILL.md version 2026-03-15 18:16:26 +08:00
jackwener 4fc4c4b92f fix: apply remaining code review fixes to subtitle.ts and explore.ts
- subtitle.ts: URL injection fix (JSON.stringify), --lang option,
  debug console.error removal, comment numbering
- explore.ts: clickLabels targeted clicking, empty-value penalty
  moved to scoreEndpoint(), removed console.log debug output
- Deleted stale test_subtitle.ts
2026-03-15 18:12:40 +08:00
jackwener a47d687513 perf: extreme architectural optimizations
Phase 1: Smart autoScroll with MutationObserver (single IPC, instant DOM change detection)
Phase 2: Build-time CLI manifest compiler + lazy-loading engine (instant cold start)
Phase 3: Batch IPC fetch (N browser fetches in single evaluate() call)
2026-03-15 18:12:36 +08:00
jackwener 2dacba8244 fix: code review improvements (#1-#8)
- #1 Fix URL injection in subtitle.ts via JSON.stringify
- #2 Remove debug console.error from production code
- #3 Delete stale test_subtitle.ts
- #4 Add --lang option for multi-language subtitle selection
- #5 Fix duplicate comment numbering (two '// 4.')
- #6 Add clickLabels targeted clicking + --click flag to explore
- #7 Move empty-value penalty into scoreEndpoint() (affects filtering)
- #8 Add cascade request code template to CLI-CREATOR.md
2026-03-15 18:09:59 +08:00
jackwener e64fc65554 feat: add Bilibili subtitle adapter with Wbi signing & explore fuzzing
- New: src/clis/bilibili/subtitle.ts - cascading BVID→CID→subtitle fetch
  using apiGet with automatic Wbi signature (w_rid)
- Enhanced: src/explore.ts - added INTERACT_FUZZ_JS for interactive
  API discovery via simulated clicks (--auto flag)
- Enhanced: src/explore.ts - empty-value score penalty for anti-bot detection
- Fixed: src/main.ts - restored explore command syntax, added --auto option
- Updated: CLI-CREATOR.md - cascading requests & anti-bot sections
2026-03-15 18:03:25 +08:00
jackwener 4e6d6bb81d chore: release v0.3.0 v0.3.0 2026-03-15 16:04:40 +08:00
jackwener 790c94d644 feat: Add Xueqiu site with 6 new commands and a Twitter bookmarks command, updating documentation. 2026-03-15 16:03:45 +08:00
jackwener aef110a8f8 feat(browser): support OPENCLI_BROWSER_EXECUTABLE_PATH env var to specify custom Playwright MCP browser path (Resolves #8) 2026-03-15 15:54:08 +08:00
jackwener 71f2f3d6e6 fix: integrate community bugfixes for PRs 1, 4, 6 and Issue 7
- Fix zhihu id truncation issue beyond safe integer
- Add json filter to template engine
- Escape evaluate args in browser scripts using json filter
- Resolve module not found bug for index.ts

Co-authored-by: 袁鑫 <eric.yuanxin@gmail.com>
Co-authored-by: zhenxing jiang <jiangzhx@gmail.com>
Co-authored-by: wangruotian <wangruotian@meituan.com>
Co-authored-by: 滕文证 <83223457+tenwz@users.noreply.github.com>
2026-03-15 15:43:33 +08:00
jackwener 829172fc59 feat: introduce browser interception and auto-scroll utilities, enable dynamic loading of TypeScript CLIs, and add a JSON template filter 2026-03-15 15:42:19 +08:00
jackwener 20f7d58dd6 feat: Add new CLIs for Bilibili, Reddit, Twitter, and Xiaohongshu, incorporating an intercept strategy for Twitter. 2026-03-15 15:33:30 +08:00
jackwener 92c23e8f9b docs: fix CLI creator guide links in READMEs 2026-03-15 08:59:13 +08:00
jackwener 70863fbdec Release v0.2.0 v0.2.0 2026-03-15 08:54:35 +08:00
jackwener 1361fe6c19 feat: release v0.2.0 with all new adapters and fixes 2026-03-15 08:54:35 +08:00
jackwener f19842c6b7 0.1.2 v0.1.2 2026-03-15 08:46:39 +08:00
jackwener 46ae0a0aa3 fix: test import path 2026-03-15 08:46:39 +08:00
jackwener 0fd9adf0f5 feat: add 8 new sites — bbc, weibo, boss, yahoo-finance, reuters, smzdm, ctrip, youtube
New adapters ported from bb-sites:
- bbc/news: BBC News RSS headlines (public API)
- weibo/hot: 微博热搜 (browser)
- boss/search: BOSS直聘搜索职位 (browser)
- yahoo-finance/quote: 股票行情 (browser)
- reuters/search: 路透社新闻搜索 (browser)
- smzdm/search: 什么值得买搜索好价 (browser)
- ctrip/search: 携程旅行搜索 (browser)
- youtube/search: YouTube视频搜索 (browser)

Also: build script adds clean-yaml step, docs updated to 28 commands / 16 sites
2026-03-15 08:46:13 +08:00
jackwener 862be02732 0.1.1 v0.1.1 2026-03-15 08:10:51 +08:00
jackwener 999d340a34 refactor: remove xiaohongshu me, add lessons learned, fix docs
- Remove xiaohongshu/me (profile page async loading too unreliable)
- CLI-CREATOR: add 4 lessons to 常见陷阱 (stale dist YAML, TS IIFE
  format, async polling, YAML vs TS threshold)
- Fix build: clean-yaml before copy to prevent stale overrides
- Fix docs: MCP token is configured via MCP config, not env var
- Update all command lists (README, README.zh-CN, SKILL.md)
2026-03-15 08:10:40 +08:00
jackwener fd94a5d27b fix: auto-close tabs after command, add login requirement reminders
- browser.ts: close all tabs opened during session (not just extension tabs)
  uses _initialTabCount to restore Chrome to pre-command state
- README/README.zh-CN: add ⚠️ login requirement warning with examples
- SKILL.md: add login note and tab auto-close mention
2026-03-15 07:57:12 +08:00
jackwener 129df91247 docs: fix site count from 13 to 8 in READMEs 2026-03-15 07:53:03 +08:00
jackwener 9df96db598 refactor: pipeline error propagation, me.yaml→me.ts, docs overhaul
Code:
- pipeline.ts: warn on stderr when step returns {error} object
- xiaohongshu/me.yaml → me.ts (evaluate code belongs in TS)
- index.ts: register xiaohongshu/me.ts

Docs:
- CLI-CREATOR: YAML vs TS decision tree, tap step docs with
  real example, 'explore store first' debugging workflow
- SKILL.md: add tap to Pipeline Steps table, update XHS commands
- README + README.zh-CN: update xiaohongshu command list
2026-03-15 07:51:20 +08:00
jackwener f26b906bd5 docs(CLI-CREATOR): add mandatory testing checklist and tap debugging guide
- build ≠ working: must run commands to verify
- added step-by-step testing checklist
- added tap step debugging tips for intercept strategy
2026-03-15 07:39:38 +08:00