From d52520a17e7557064a1494fc4cdb6c965127bdf1 Mon Sep 17 00:00:00 2001 From: Panniantong Date: Tue, 24 Feb 2026 15:25:38 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20=5Finstall=5Fmcport?= =?UTF-8?q?er=20=E5=87=BD=E6=95=B0=E4=B8=A2=E5=A4=B1=20+=20browser-cookie3?= =?UTF-8?q?=20=E7=A1=AC=E4=BE=9D=E8=B5=96=20+=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=A3=85=20birdx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关键修复: 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 --- agent_reach/cli.py | 19 +++++++++++++++++++ pyproject.toml | 2 -- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/agent_reach/cli.py b/agent_reach/cli.py index 6a287b6..396468c 100644 --- a/agent_reach/cli.py +++ b/agent_reach/cli.py @@ -283,7 +283,26 @@ def _install_system_deps(): except Exception: print(" ⚠️ Node.js install failed. Install manually: https://nodejs.org") + # ── birdx (for Twitter search) ── + if shutil.which("birdx"): + print(" ✅ birdx already installed") + else: + if shutil.which("pip3") or shutil.which("pip"): + pip_cmd = "pip3" if shutil.which("pip3") else "pip" + try: + subprocess.run( + [pip_cmd, "install", "-q", "birdx"], + capture_output=True, text=True, timeout=120, + ) + if shutil.which("birdx"): + print(" ✅ birdx installed (Twitter search + timeline)") + else: + print(" ⬜ birdx install failed (optional — Twitter reading still works via Jina)") + except Exception: + print(" ⬜ birdx install failed (optional — Twitter reading still works via Jina)") + +def _install_mcporter(): """Install mcporter and configure Exa + XiaoHongShu MCP servers.""" import shutil import subprocess diff --git a/pyproject.toml b/pyproject.toml index 659e8d3..4f87f4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,13 +27,11 @@ dependencies = [ "pyyaml>=6.0", "rich>=13.0", "yt-dlp>=2024.0", - "browser-cookie3>=0.19", ] [project.optional-dependencies] browser = ["playwright>=1.40"] cookies = ["browser-cookie3>=0.19"] -mcp = ["mcp[cli]>=1.0"] all = ["playwright>=1.40", "mcp[cli]>=1.0", "browser-cookie3>=0.19"] [project.scripts]