myagent-ai 1.16.18 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile CHANGED
@@ -1,14 +1,38 @@
1
1
  # MyAgent - 本地桌面端执行型 AI 助手
2
2
  # Docker 构建文件 (主要用于服务器部署)
3
- FROM python:3.11-slim
3
+ FROM python:3.13-slim
4
4
 
5
5
  WORKDIR /app
6
6
 
7
7
  # 安装系统依赖
8
+ # [v1.16.18] 包含 poppler-utils (PDF提取)、Chrome 共享库 (浏览器自动化)
8
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
10
  python3-pip \
11
+ poppler-utils \
12
+ # Chrome/Chromium 运行所需的共享库
13
+ libnss3 \
14
+ libatk1.0-0 \
15
+ libatk-bridge2.0-0 \
16
+ libcups2 \
17
+ libdrm2 \
18
+ libxkbcommon0 \
19
+ libxcomposite1 \
20
+ libxdamage1 \
21
+ libxfixes3 \
22
+ libxrandr2 \
23
+ libgbm1 \
24
+ libpango-1.0-0 \
25
+ libcairo2 \
26
+ libasound2 \
27
+ libatspi2.0-0 \
28
+ # Node.js (浏览器自动化 MCP 需要)
29
+ nodejs \
30
+ npm \
10
31
  && rm -rf /var/lib/apt/lists/*
11
32
 
33
+ # 安装 Puppeteer 的 Chrome (自包含,容器环境最可靠)
34
+ RUN npx -y puppeteer browsers install chrome@stable || true
35
+
12
36
  # 安装 Python 依赖
13
37
  COPY requirements.txt .
14
38
  RUN pip install --no-cache-dir -r requirements.txt
@@ -1570,15 +1570,14 @@ class MainAgent(BaseAgent):
1570
1570
  logger.warning(f"[{task_id}] recall_memory 工具异常: {re_err}")
1571
1571
 
1572
1572
  elif tool_name == "file_send":
1573
- # [v1.16.17] 文件发送工具 — 让 Agent 向用户发送文件
1573
+ # [v1.16.17→18] 文件发送工具 — 让 Agent 向用户发送文件
1574
1574
  try:
1575
1575
  from skills.file_send import FileSendSkill
1576
1576
  _fskill = FileSendSkill()
1577
1577
  _fpath = params.get("file_path", "")
1578
1578
  _fdesc = params.get("description", "")
1579
- # Extract stream_callback from context if available
1580
- _stream_cb = getattr(context, '_stream_callback', None) if hasattr(self, '_current_stream_callback') else None
1581
- _fresult = _fskill.execute(_fpath, _fdesc, stream_callback=_stream_cb)
1579
+ # [v1.16.18] 使用当前作用域的 stream_callback(而非 context._stream_callback)
1580
+ _fresult = await _fskill.execute(_fpath, _fdesc, stream_callback=stream_callback)
1582
1581
  result = {"success": True, "output": json.dumps(_fresult, ensure_ascii=False, indent=2), "data": _fresult}
1583
1582
  except Exception as _fse:
1584
1583
  result = {"success": False, "error": f"文件发送失败: {_fse}"}
@@ -13,7 +13,8 @@ core/deps_checker.py - 自动依赖检测与安装
13
13
  依赖映射:
14
14
  核心功能: openai, aiohttp, requests
15
15
  搜索技能: bs4
16
- 系统技能: psutil
16
+ PDF 处理: PyPDF2
17
+ 系统技能: psutil, chardet
17
18
  托盘功能: pystray, PIL
18
19
  语音合成: edge_tts
19
20
  浏览器自动化: chrome-devtools-mcp (Node.js, Chrome DevTools Protocol)
@@ -64,6 +65,24 @@ DEPENDENCIES: List[DepInfo] = [
64
65
  # ── 搜索技能 ──
65
66
  DepInfo("bs4", "beautifulsoup4", "4.12.0", "search", "all"),
66
67
 
68
+ # ── PDF 处理 ──
69
+ DepInfo("PyPDF2", "PyPDF2", "3.0.0", "pdf", "all",
70
+ note="纯 Python PDF 文本提取(pdftotext 失败时的备用方案)"),
71
+
72
+ # ── 文档处理 (Excel/Word/PPT) ──
73
+ DepInfo("openpyxl", "openpyxl", "3.1.0", "doc", "all",
74
+ note="Excel (.xlsx) 文件读取"),
75
+ DepInfo("docx", "python-docx", "1.1.0", "doc", "all",
76
+ note="Word (.docx) 文件读取"),
77
+ DepInfo("pptx", "python-pptx", "0.6.21", "doc", "all",
78
+ note="PowerPoint (.pptx) 文件读取"),
79
+ DepInfo("xlrd", "xlrd", "2.0.0", "doc", "all",
80
+ note="旧版 Excel (.xls) 文件读取"),
81
+
82
+ # ── 文件编码检测 ──
83
+ DepInfo("chardet", "chardet", "5.0.0", "system", "all",
84
+ note="文件编码自动检测"),
85
+
67
86
  # ── 系统技能 ──
68
87
  DepInfo("psutil", "psutil", "5.9.0", "system", "all"),
69
88
 
@@ -91,6 +110,10 @@ DEPENDENCIES: List[DepInfo] = [
91
110
  note="鼠标/键盘控制 (~500KB)"),
92
111
  DepInfo("pygetwindow", "pygetwindow", "0.0.9", "gui", "windows_macos",
93
112
  note="窗口管理 (仅 Windows/macOS)"),
113
+
114
+ # ── 远程桌面 (VNC) [v1.17.0] ──
115
+ # VNC 依赖通过 apt 安装 (xvfb, x11vnc),websockify 通过 pip 安装
116
+ # 实际检测和安装在 VNCManager.ensure_dependencies() 中完成
94
117
  ]
95
118
 
96
119
 
@@ -404,6 +427,8 @@ def ensure_skill_deps(skill_category: str) -> bool:
404
427
  "tts": {"tts"},
405
428
  "stt": {"stt"},
406
429
  "tray": {"tray"},
430
+ "pdf": {"pdf"},
431
+ "doc": {"doc"},
407
432
  }
408
433
 
409
434
  cats = category_map.get(skill_category, {skill_category})