Commit graph

154 commits

Author SHA1 Message Date
AICodeLion
db20c5d5d3
feat: add Weibo channel via mcp-server-weibo (#107)
Adds WeiboChannel integrating qinyuanpei/mcp-server-weibo (34+ stars,
MIT, 10 tools) via mcporter. Addresses #75.

Files changed (3 files, +57 lines):
- agent_reach/channels/weibo.py — new channel (54 lines)
- agent_reach/channels/__init__.py — register WeiboChannel
- tests/test_channel_contracts.py — add weibo URL sample

Co-authored-by: AICodeLion <AICodeLion@users.noreply.github.com>
2026-03-08 21:54:35 +08:00
Shawn
3a3d38acce
fix: YouTube JS runtime check, Douyin health check, cli bare except, config permission race (#104)
- YouTube: warn when only Node.js is installed but yt-dlp config file
  is missing (previously returned "ok" incorrectly)
- Douyin: use `mcporter list` instead of calling with a hardcoded
  invalid share URL that always fails
- cli: replace bare `except:` with `except Exception:` in
  `_detect_environment` to avoid catching KeyboardInterrupt/SystemExit
- cli: fix unclosed file handle for cloud VM detection
- config: use `os.open()` with 0o600 mode to eliminate permission
  race window when saving credentials
2026-03-08 21:24:05 +08:00
Pnant
4b7d55111f
feat: add 'agent-reach configure xhs-cookies' command (#108) (#113)
Adds a proper way for AI agents to import XiaoHongShu cookies into
the xiaohongshu-mcp Docker container. Previously agents had no clear
command to use, leading to confusion loops (issue #108).

Supports two input formats:
- Cookie-Editor JSON export (array of cookie objects)
- Header String format (key1=val1; key2=val2; ...)

The command:
1. Parses and validates the cookie input
2. Finds the running xiaohongshu-mcp container
3. Reads COOKIES_PATH from container env
4. Writes cookies via docker cp
5. Verifies login status via mcporter

Also updates install.md with the new command.

Closes #108

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-08 21:19:33 +08:00
Pnant
eda80b89b5
fix: sync xfetch session.json when using --from-browser (closes #109) (#112)
Previously, Extracting cookies from chrome...

   Twitter/X: auth_token + ct0

 Cookies configured! Run `agent-reach doctor` to see updated status. stored Twitter
cookies in ~/.agent-reach/config.yaml but did NOT write them to
~/.config/xfetch/session.json. This caused xreach CLI to report
'Not authenticated' even after a successful configure.

The xfetch bridge existed only in the manual
code path (cli.py:829). This commit extracts it into a shared helper
_sync_xfetch_session() in cookie_extract.py and calls it from
configure_from_browser() too, so both paths behave consistently.

Fix is non-fatal: if the xfetch dir/file cannot be written, the error
is swallowed silently (agent-reach config.yaml remains the source of truth).

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-08 14:32:24 +08:00
Pnant
75a2213510
fix: remove isatty guard in _ensure_utf8_console (#95) (#101)
The isatty() check skipped UTF-8 wrapping when agent-reach was called
as a subprocess by AI agents (non-TTY). On Windows with GBK encoding,
any remaining non-ASCII chars would crash with UnicodeEncodeError.

Now UTF-8 wrapping applies in all environments on Windows.

Closes #95

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-07 12:58:18 +08:00
Pnant
8a90e52fde
Merge pull request #102 from Panniantong/fix/remove-emojis
fix: remove emoji from CLI output for Windows GBK compatibility
2026-03-07 12:56:39 +08:00
Panniantong
9d0191d5eb fix: remove emoji from CLI output for Windows GBK compatibility
- Remove all decorative emoji (👁️🔍📦🍪💡🔧📥🧩🛡️📡💻🤖🙏🆕ℹ️) from cli.py and doctor.py
- Replace ⚠️ with [!] and  with [X] (ASCII-safe status markers)
- Replace  with -- (ASCII-safe)
- Keep  only for final success confirmations
- Fixes Windows GBK encoding crash during 'agent-reach install' (issue #95)

Closes #95
2026-03-07 05:46:38 +01:00
Pnant
f3d11fe89d
feat: add star reminder after install completes (#89)
A friendly, non-intrusive message after successful installation
asking users to star the repo.

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-07 01:55:26 +08:00
Pnant
df34436942
docs: add Star History chart to README (#81)
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-05 21:33:40 +08:00
Pnant
cd94706d3b
feat: auto-install WeChat article tools during install (#80)
* feat: auto-install WeChat article tools during agent-reach install

WeChat (微信公众号) deps are now auto-installed during 'agent-reach install':
- Python packages: camoufox[geoip], markdownify, beautifulsoup4, httpx, miku_ai
- Tool repo: wechat-article-for-ai cloned to ~/.agent-reach/tools/

No login or configuration needed — works out of the box like YouTube/RSS.
Updated README tables to reflect zero-config status.
Also covers safe mode and dry-run.

* feat: auto-install WeChat + add channel-setup reference to SKILL.md

1. WeChat auto-install during 'agent-reach install':
   - pip install camoufox[geoip], markdownify, bs4, httpx, miku_ai
   - clone wechat-article-for-ai to ~/.agent-reach/tools/
   - covers safe mode and dry-run
   - README tables: WeChat → zero-config

2. SKILL.md improvements:
   - Added 'configure' triggers to description
   - Added references/channel-setup.md with install steps for all
     login-required platforms (Twitter, XHS, Douyin, LinkedIn, Boss)
   - Principle: user only provides cookies, agent does everything else

* simplify: point to install.md URL instead of bundled reference

No need to maintain a separate channel-setup.md. Just tell agents
to fetch install.md when they need setup instructions.

---------

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-05 18:29:33 +08:00
Pnant
35073aed54
docs: make WeChat row consistent with other channels (#79)
Changed '怎么配' column from raw pip command to '告诉 Agent「帮我配微信公众号」',
matching the pattern of all other channels. Updated both Chinese and English READMEs.

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-05 18:08:35 +08:00
Pnant
94b428b0b9
refactor: rewrite SKILL.md as pure usage guide (324→160 lines) (#78)
SKILL.md was mixing installation/configuration with usage commands.
Now it's a pure usage guide per skill-creator conventions:

- Description includes ALL platform trigger words (search, read,
  browse for each of 13 channels) so agents load it when users
  ask to search/read any platform
- Body is concise command reference only — no install/config
  instructions (those belong in install.md)
- Removed duplicate workspace rules explanation
- Removed cookie setup, proxy config, and channel setup sections
- 324 → 160 lines (51% reduction in context tokens)

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-05 17:19:23 +08:00
Pnant
105b477a31
docs: add update one-liner to English README + update.md (#77)
- English README: added update one-liner in hero section and Quick Start
- update.md: added English version of the one-liner for humans

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-05 15:43:57 +08:00
Sense_wang
92963f0496
ci: add Python 3.13 to test matrix (#76)
Co-authored-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
2026-03-05 15:13:32 +08:00
Pnant
e5e20a1154
fix(windows): use shutil.which() for npm subprocess calls (#73)
Two subprocess.run(["npm", ...]) calls in undici installation were
using bare command name, which fails on Windows where npm is
installed as npm.cmd. Now resolves full path via shutil.which()
first, consistent with all other subprocess calls.

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-05 10:32:02 +08:00
Pnant
b4d189b536
fix: enforce workspace isolation to prevent agent pollution (#57) (#72)
Problem: After installing Agent Reach, agents may clone repos, create
files, or write output into the workspace directory, gradually polluting
the user's project. Over time this degrades the agent experience.

Fix:
- SKILL.md: add Workspace Rules section — never create files in workspace
- install.md: add Directory Rules table, explicit boundary about workspace
- install.md: all git clone commands now target ~/.agent-reach/tools/
- update.md: add workspace warning
- cli.py: install creates ~/.agent-reach/tools/ directory

All agent-facing docs now enforce: /tmp for temp, ~/.agent-reach/ for
persistent data, workspace stays untouched.

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-04 18:40:31 +08:00
Pnant
27d3d545e6
docs: add one-line update guide (#71)
- New docs/update.md for AI agents to follow
- README: add update one-liner next to install one-liner
- Same pattern: copy one line to your agent, it handles the rest

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-04 18:25:17 +08:00
Pnant
ca29c4fee5
release: v1.3.0 (#70)
New:
- WeChat Official Account channel (search + read)
  - Search via miku_ai (Sogou WeChat search)
  - Read via Camoufox (stealth Firefox, bypasses anti-bot)
- 13 channels total

Fixed:
- Windows encoding: text=True → encoding='utf-8' in all subprocess calls (#64)
- Windows .cmd resolution: use shutil.which() paths (#64)

Docs:
- Clarified agent-reach has no read/search commands (#58, #59)
- Fixed xiaohongshu API function names in SKILL.md (#65)
- Added CONTRIBUTING.md (#62)
- Updated README (zh + en) with WeChat channel

Version bumps: pyproject.toml, __init__.py, test_cli.py

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-04 18:18:18 +08:00
Pnant
49d05b7023
docs: add WeChat channel to README (zh + en) (#69)
Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-04 18:06:47 +08:00
Pnant
476935be92
feat: add WeChat search via miku_ai (sogou) (#68)
- wechat channel now supports both search and read
- Search: miku_ai (sogou weixin search) → article list with URLs
- Read: camoufox (stealth Firefox) → full Markdown content
- Doctor shows granular status (search only / read only / both)
- SKILL.md updated with search + read workflow examples

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-04 18:02:05 +08:00
Pnant
4f4ad99d49
feat: add WeChat Official Account channel (#54) (#67)
New channel: wechat (微信公众号文章)
- Backend: wechat-article-for-ai (Camoufox stealth browser)
- Can read mp.weixin.qq.com article URLs → clean Markdown
- Bypasses WeChat anti-bot detection via stealth Firefox
- Doctor checks for camoufox package availability
- SKILL.md updated with usage examples

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-04 17:53:39 +08:00
Sense_wang
561b248a2b
docs: add CONTRIBUTING.md with development guidelines (#62)
Add contribution guidelines including:
- Development setup instructions
- Code style guidelines (ruff, mypy, pytest)
- Channel development guide
- PR guidelines
- Issue reporting template
- Bilingual (EN/CN) documentation

Co-authored-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
2026-03-04 17:30:15 +08:00
Pnant
a91a74d880
fix: Windows encoding + .cmd subprocess resolution (#64) (#66)
- Replace text=True with encoding='utf-8', errors='replace' in all
  subprocess.run calls (channels + cli.py) to fix GBK decode errors
  on Chinese Windows systems
- Use shutil.which() resolved paths in channel subprocess calls to
  handle Windows .cmd wrappers (npm global installs)

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-04 17:30:11 +08:00
Yves
7434c3cb9f
docs: fix xiaohongshu API in SKILL.md — replace non-existent functions with correct ones (#65) 2026-03-04 17:18:13 +08:00
Pnant
1a61a2cc81
docs: clarify agent-reach has no read/search commands (#59)
- Remove dead '# ── read ──' placeholder comment in cli.py
- Reword SKILL.md to make it explicit that agent-reach is an
  installer/config tool, not a content fetcher
- Addresses confusion from issue #58

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
2026-03-04 14:33:38 +08:00
Pnant
932837ff9a
Merge pull request #52 from Panniantong/fix/twitter-cookie-sync-issue50
fix: sync Twitter cookies to xreach session.json on configure
2026-02-28 20:29:38 +08:00
Panniantong
4f52942260 improve: add chmod 0o600 for session.json (from PR #51 suggestion) 2026-02-28 13:28:14 +01:00
Panniantong
3c1a04a587 fix: sync Twitter cookies to xreach session.json on configure
When running 'agent-reach configure twitter-cookies', credentials are now
automatically written to ~/.config/xfetch/session.json so that 'xreach auth
check' works without manual intervention.

Preserves existing session.json fields if the file already exists.
Falls back gracefully if the sync fails (still saves to agent-reach config).

Fixes #50
2026-02-28 11:11:55 +01:00
Pnant
6a28b215af
Merge pull request #49 from Panniantong/fix/ci-test-github-check
fix: CI 测试修复 — gh CLI 在 CI 环境不存在
2026-02-27 20:41:30 +08:00
Panniantong
a881db4261 fix: CI test — allow github channel 'warn' when gh CLI not installed
GitHub Actions runners don't have gh CLI pre-installed, so the doctor
check returns 'warn' instead of 'ok'. Allow both in the test assertion.
2026-02-27 13:39:34 +01:00
Pnant
875f0987a6
Merge pull request #48 from Panniantong/fix/yt-bilibili-cookie-docs
fix: YouTube 需要 JS runtime — install 自动配置 Node.js
2026-02-27 18:46:32 +08:00
Panniantong
0d1a33236e fix: YouTube requires JS runtime — auto-configure Node.js in install
yt-dlp now requires an external JS runtime (deno or Node.js) for YouTube.
Since agent-reach already installs Node.js, we configure yt-dlp to use it:

1. cli.py: install writes '--js-runtimes node' to ~/.config/yt-dlp/config
2. youtube.py: doctor checks JS runtime availability and config
3. SKILL.md: updated YouTube section with accurate troubleshooting

Bilibili note: 412 errors are IP-based (needs proxy), not cookie-related.

Fixes #47
2026-02-27 11:45:39 +01:00
Panniantong
e620a1db8f docs: add cookie/proxy warnings for YouTube and Bilibili in SKILL.md
YouTube may trigger 'Sign in to confirm you're not a bot' on server IPs.
Bilibili may return 412 on non-residential IPs.

Added --cookies-from-browser fallback examples for both channels.

Fixes #47
2026-02-27 11:25:29 +01:00
Pnant
15a2961dfa
Merge pull request #46 from Panniantong/migrate-bird-to-xreach
feat: 迁移 Twitter 后端 bird → xreach CLI
2026-02-27 15:21:25 +08:00
Pnant
4bc860c74d
Merge pull request #45 from Panniantong/fix/xiaohongshu-arm64-support
fix: ARM64/Apple Silicon support for xiaohongshu-mcp Docker setup
2026-02-27 15:21:21 +08:00
Panniantong
62aacf38b5 feat: migrate Twitter backend from bird CLI to xreach CLI
bird CLI (@steipete/bird) is deprecated and no longer maintained.
xreach CLI (xreach-cli on npm) is our maintained fork with:
- Fixed SearchTimeline (POST + updated query ID)
- Built-in proxy rotation support
- Additional features (DMs, notifications, lists)

Changes across 11 files:
- channels/twitter.py: detect xreach instead of bird/birdx
- cli.py: install/doctor/uninstall all reference xreach-cli
- SKILL.md: updated command examples (bird read → xreach tweet)
- guides/setup-twitter.md: rewritten for xreach
- docs/troubleshooting.md: updated proxy guidance
- README.md + README_en.md: all references updated
- config.py: twitter_bird → twitter_xreach
- core.py, mcp_server.py: comment updates

npm package: https://www.npmjs.com/package/xreach-cli
Source: https://github.com/Panniantong/xfetch
2026-02-27 08:17:51 +01:00
Panniantong
d4e437bf2c fix: add ARM64/Apple Silicon support for xiaohongshu-mcp Docker setup
- Detect ARM64 architecture and auto-add --platform linux/amd64 to
  docker run hints in doctor/check output
- Add ARM64 FAQ section to setup guide with two options:
  Rosetta emulation (--platform linux/amd64) or build from source
- Closes #44
2026-02-27 08:06:06 +01:00
Pnant
dbcc668f47
Merge pull request #40 from peter941221/fix/security-hardening-split-v2
fix: split security hardening and setup mcporter config checks
2026-02-27 13:30:52 +08:00
Pnant
40f833d0d1
Merge pull request #41 from peter941221/chore/quality-infra-split-v3
chore: split quality infrastructure into focused PR
2026-02-27 13:26:49 +08:00
Pnant
dc4d7cd7a5
Merge pull request #24 from Daiyimo/main
feat: add uninstall command; fix utf-8 encoding and minor cleanups
2026-02-27 13:24:21 +08:00
Pnant
60f5ddf4f0
Merge pull request #35 from Panniantong/fix/mcporter-list-hang
fix: replace 'mcporter list' with 'mcporter config list' to prevent hangs
2026-02-27 12:56:40 +08:00
Your Name
a726aa7fe1 chore: add quality infra matrix, constraints, and test baseline fixes 2026-02-27 12:27:07 +08:00
Your Name
4b2e6f2ffb fix: split security hardening and setup mcporter config checks 2026-02-27 12:16:00 +08:00
Panniantong
39f76ee4dc fix: replace 'mcporter list' with 'mcporter config list' to prevent hangs
mcporter list probes all configured servers sequentially, which can hang
indefinitely when servers are slow/offline. mcporter config list reads
config without probing — sufficient for checking if a server is configured.

Affected: doctor checks (4 channels) and install command (2 calls).

Fixes #34
2026-02-27 03:06:27 +01:00
Pnant
a5682716ec
Merge pull request #31 from Panniantong/docs/cookie-ban-warning
docs: 添加 Cookie 登录封号风险提醒
2026-02-26 22:41:53 +08:00
Panniantong
f269667a34 docs: 添加 Cookie 登录封号风险提醒,强调使用小号
- README: Cookie 安全建议新增封号风险说明
- install.md: Security tip 补充 account ban 风险
- SKILL.md: Cookie 导入段落加封号提醒
2026-02-26 15:13:25 +01:00
Pnant
090b01c909
Merge pull request #30 from Panniantong/fix/sync-version-string
fix: sync __version__ with pyproject.toml (1.0.0 → 1.2.0)
2026-02-26 22:08:35 +08:00
Panniantong
58b3a4dcb3 fix: sync __version__ with pyproject.toml (1.0.0 → 1.2.0)
Fixes #29 — __version__ in __init__.py was still '1.0.0' while pyproject.toml
had already been bumped to '1.2.0'. This caused misleading output in
'agent-reach --version' and 'agent-reach doctor'.
2026-02-26 15:07:24 +01:00
Panniantong
37b4cdeddc bump: v1.2.0 2026-02-26 13:34:41 +01:00
Pnant
bf6dc7084b
Merge pull request #28 from Panniantong/feat/douyin-channel
feat: 新增抖音(Douyin)渠道
2026-02-26 20:34:17 +08:00