Commit graph

34 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Daiyimo
9c6c04c800 feat: add uninstall command; fix utf-8 encoding and minor cleanups 2026-02-26 16:01:22 +08:00
Panniantong
a37e9aa190 refactor: strip to installer + doctor + docs, remove read/search wrapper layer
BREAKING CHANGE: Remove all `agent-reach read` and `agent-reach search-*` commands.

Agent Reach is now an installer, configuration tool, and doctor —
not a wrapper layer. After installation, agents call upstream tools
directly (bird CLI, yt-dlp, mcporter, gh CLI, Jina Reader, etc.).

What's kept:
- agent-reach install: one-shot installer
- agent-reach doctor: channel status overview
- agent-reach configure: cookies, proxy, credentials
- agent-reach setup: interactive wizard
- SKILL.md: complete guide for agents to use upstream tools directly

What's removed:
- agent-reach read URL (and all channel read() methods)
- agent-reach search-* commands (and all channel search() methods)
- ReadResult / SearchResult data classes
- URL routing system (get_channel_for_url)
- All parsing/conversion logic (VTT, Reddit JSON, bird text parser, etc.)
- MCP server read/search tools (kept only get_status)

Net change: -1790 lines. Less code = fewer bugs.
2026-02-26 08:15:56 +01:00
Panniantong
f70711e75e remove(instagram): 移除 Instagram 渠道
Instagram 反爬封杀导致所有开源工具(instaloader 等)失效,
无论有无 cookies 都无法正常使用。

- 删除 instagram.py 渠道文件
- 移除 CLI 中 search-instagram、configure instagram-cookies 等命令
- 移除 setup/doctor 中 instaloader 依赖检查
- 更新 README、docs、SKILL.md、pyproject.toml

上游 issue: instaloader#2585, instaloader#2648
Relates to: #13
2026-02-26 07:20:13 +01:00
Panniantong
12bd727e30 fix: Twitter bird CLI fetch failed — 自动代理注入 + 连通性检测 + Exa fallback
问题:bird CLI 用 Node.js 原生 fetch(),不走 HTTP_PROXY,
导致需要代理的用户(如 Windows + 本地代理)完全无法使用。

修复:
1. 自动代理注入:检测到 HTTP_PROXY/HTTPS_PROXY 时,通过 undici 的
   EnvHttpProxyAgent 让 Node.js fetch 自动走代理,用户无需任何额外配置
2. doctor 检测:实际跑 bird whoami 测连通性,失败时给出具体原因
3. search fallback:bird 搜索失败时自动 fallback 到 Exa
4. install:自动安装 undici(npm install -g undici)
5. 新增 troubleshooting.md:常见问题解决方案

Fixes #9
2026-02-25 21:35:21 +01:00
Panniantong
c642e18e1f release: v1.1.0 — 新增 Instagram、LinkedIn、Boss直聘 三个渠道
🆕 新渠道:
- 📷 Instagram — instaloader 读取帖子和 Profile
- 💼 LinkedIn — linkedin-scraper-mcp 读取 Profile、公司、职位
- 🏢 Boss直聘 — mcp-bosszp 搜索职位、向 HR 打招呼

📈 改进:
- 渠道数量 9 → 12
- 新增 CHANGELOG.md
- CLI 新增 search-instagram / search-linkedin / search-bosszhipin
- 安装指南更新
- 致谢列表更新
2026-02-25 14:14:30 +01:00
Panniantong
e8fe33c80c feat: Instagram 支持 Cookie-Editor 导入 + 超时 fallback 优化
- agent-reach configure instagram-cookies 支持 Cookie-Editor Header String
- Instagram cookie 保存到 ~/.agent-reach/instagram-cookies.txt
- instaloader 429 限速时 15 秒自动超时 fallback 到 Jina Reader
- LinkedIn/Boss直聘 保持使用各自 MCP 的原生登录流程(不侵入)
- doctor 提示信息更新
2026-02-25 11:13:52 +01:00
Panniantong
e3804108fe feat: 新增 Instagram、LinkedIn、Boss直聘 三个渠道
新增渠道:
- Instagram: 基于 instaloader (9.8K),读取帖子/Profile,Cookie 登录
- LinkedIn: 基于 linkedin-scraper-mcp (900+) MCP 服务,Jina Reader fallback
- Boss直聘: 基于 mcp-bosszp MCP 服务,Jina Reader fallback

代码改动:
- 新建 channels/instagram.py, linkedin.py, bosszhipin.py
- 注册到 channels/__init__.py
- cli.py 添加 search-instagram/linkedin/bosszhipin 子命令
- cli.py 安装逻辑添加 instaloader 自动安装
- core.py 添加 search_instagram/linkedin/bosszhipin 方法
- README.md + docs/README_en.md 更新平台表格和选型表格
- docs/install.md 添加三个新渠道的配置说明和 Quick Reference
2026-02-25 10:25:30 +01:00
Panniantong
a0ecd438ee fix: 完善所有渠道安装指引,修复文档错误
- 小红书: 添加 Docker 安装命令 (xpzouying/xiaohongshu-mcp),替换模糊的 'install xiaohongshu-mcp'
- Exa: 修正文档错误(实际免费无需 API Key,之前写要 Key)
- CLI: install 命令输出添加小红书 Docker 安装指引
- channel: xiaohongshu.py 所有错误信息添加完整安装步骤
- install.md: 添加小红书配置段落
- README: 修正小红书 GitHub 链接,Exa 描述改为免费无需 Key

Fixes user-reported issue: 安装后不知道怎么装小红书 MCP
2026-02-25 05:10:56 +01:00
Panniantong
25d869d3fe feat: Agent Reach 作为 Skill 安装
- 新增 agent-reach/SKILL.md — skills.sh 兼容格式
  安装: npx skills add Panniantong/Agent-Reach@agent-reach
- agent-reach install 自动检测 OpenClaw / Claude Code / 通用 Agent
  并在对应 skill 目录注册 SKILL.md
- SKILL.md 打包进 pip 包(agent_reach/skill/SKILL.md)
- README 中英文都加了 Skill 安装方式
2026-02-25 04:24:16 +01:00
Panniantong
93ad9c5722 fix: birdx → bird CLI (npm @steipete/bird)
birdx 从来不是 PyPI 包,pip install birdx 必然失败。
实际工具是 npm 包 @steipete/bird,一个 Twitter GraphQL CLI。

变更:
- 安装器改用 npm install -g @steipete/bird
- twitter.py 直接调 bird,通过环境变量传 AUTH_TOKEN/CT0
- 兼容已有的 birdx wrapper(shutil.which 回退)
- 更新所有文档引用
- 重写 setup-twitter.md 指南
2026-02-25 04:02:42 +01:00
Panniantong
17970b2789 feat: 添加 watch 和 check-update 命令 + OpenClaw 每日监控
- agent-reach check-update: 检查 GitHub 最新版本,展示更新内容
- agent-reach watch: 快速健康检查+版本检查,为定时任务设计
  - 全部正常只输出一行
  - 有问题才展开详情
- install.md 新增 Step 5: OpenClaw 用户可设置每日自动监控
  - Agent 主动问用户要不要设定时任务
  - 有问题才通知,没问题不打扰
2026-02-25 03:41:42 +01:00
Panniantong
0f4a59fdfc fix: Windows 控制台 emoji 编码崩溃
Windows 默认控制台编码是 cp936(中文)或 cp1252(西文),
print() 输出 emoji 字符时直接 UnicodeEncodeError 崩溃。

在 cli.py 入口处添加 UTF-8 encoding wrapper,
用 errors='replace' 确保不会因为编码问题导致整个程序崩溃。
2026-02-25 02:41:14 +01:00
Panniantong
05452e5b54 simplify: install.md 只说目标,不说怎么修——Agent 自己会
install.md 核心指令:
- 目标:所有渠道都 
- 遇到问题自己修,不要停
- 只有需要用户提供的东西(密码/cookie/key)才问用户
- 最后跑 doctor 汇报结果
2026-02-24 15:34:50 +01:00
Panniantong
db3f292228 feat: 添加 Agent 自修复提示——让用户的 Agent 自己解决安装问题
核心改动:
1. install.md 加入 Agent 指令:'You are a capable AI Agent. If a tool
   fails, try another method. Don't give up after one attempt.'
2. install.md 加入常见问题自修复表(9 种场景 + 对应解法)
3. CLI 错误输出改为 Agent-friendly 语气,给出替代方案而非只说失败
4. install 结束时如果有未激活渠道,提示 Agent 自行修复
2026-02-24 15:32:25 +01:00
Panniantong
d52520a17e fix: 修复 _install_mcporter 函数丢失 + browser-cookie3 硬依赖 + 自动装 birdx
关键修复:
1. _install_mcporter() 函数定义被上次编辑误删(NameError 崩溃)
   → 恢复为独立函数
2. browser-cookie3 作为硬依赖在服务器上安装失败(缺 dbus/secretstorage)
   → 改为 optional[cookies]
3. birdx 不在自动安装流程中
   → _install_system_deps 增加自动 pip install birdx

install 流程现在完整覆盖:
  gh CLI → Node.js → birdx → mcporter → Exa → XHS → cookies → test
2026-02-24 15:25:38 +01:00
Panniantong
51f73639e2 fix: install 自动安装 gh CLI + Node.js,加大 mcporter 超时
问题:新服务器上 gh CLI 和 Node.js 未安装,mcporter npm install 60s 超时
修复:
- 新增 _install_system_deps():自动安装 gh CLI (apt) + Node.js (nodesource)
- mcporter 超时从 60s → 120s
- install.md 更新:去掉过时的 exa-key/xhs-cookie 配置步骤
- install 流程:系统依赖 → mcporter → Exa 配置 → 环境检测 → 测试
2026-02-24 15:05:00 +01:00
Panniantong
7d0da09222 feat: 新增 YouTube/Bilibili/XHS 搜索 CLI 命令 + 修复 B站搜索
- cli.py: 新增 search-youtube / search-bilibili / search-xhs 子命令
- core.py: 新增 search_youtube / search_bilibili / search_xhs 方法
- bilibili.py: 搜索策略改为 yt-dlp → Exa fallback(服务器 IP 被 B站 412)
  - 本地机器走 yt-dlp bilisearch(有 title/uploader)
  - 服务器自动 fallback 到 Exa site:bilibili.com
  - 修复 mcporter 输出解析(Title:/URL: 格式)

测试结果: 15/15 全通(8 read + 7 search)
2026-02-24 13:39:21 +01:00
Panniantong
bb9ce6f7f1 refactor: XHS + Exa 全面切换到 mcporter MCP 后端
- xiaohongshu.py: 删除网页爬取代码,100% 走 mcporter + xiaohongshu-mcp
- exa_search.py: 删除直接 API 调用,100% 走 mcporter + exa MCP(免 Key)
- cli.py install: 新增 _install_mcporter(),自动装 mcporter + 配置 exa/xhs
- cli.py configure: 移除 exa-key 和 xhs-cookie(不再需要)
- doctor.py: 更新 tier 1 描述

净减 166 行代码,架构更简单:
之前: 每个渠道两套后端代码(mcporter + fallback)
现在: 每个渠道一套后端(mcporter only)
2026-02-24 13:20:23 +01:00
Panniantong
3efc8d1d55 fix: Reddit 子版块列表页支持 + --version 参数
- reddit.py: 新增 _parse_listing() 处理 /r/sub/hot|new|top 等列表页
  之前只能读单个帖子,列表页直接报 ValueError
- cli.py: 添加 --version flag (标准 CLI 惯例)
2026-02-24 12:49:58 +01:00
Panniantong
a5b7b93b1f fix: improve error handling for Twitter Jina fallback and invalid URL inputs
- Twitter _read_jina now detects unusable X.com responses (JS-required pages)
  and shows a friendly error instead of garbage HTML
- CLI read command now shows user-friendly messages for invalid URLs
  and connection errors instead of raw HTTP exception traces
2026-02-24 12:36:57 +01:00
Panniantong
5c62a21f32 rename: Agent Eyes → Agent Reach
全局重命名:
- 包名: agent_eyes → agent_reach
- CLI: agent-eyes → agent-reach
- 类名: AgentEyes → AgentReach
- 显示名: Agent Eyes → Agent Reach
- GitHub: Panniantong/agent-eyes → Panniantong/Agent-Reach

所有 36 个测试通过,CLI/doctor/read/search 全部正常。
2026-02-24 10:25:46 +01:00
Renamed from agent_eyes/cli.py (Browse further)