myagent-ai 1.3.2 → 1.3.3

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/core/version.py CHANGED
@@ -11,7 +11,7 @@ import subprocess
11
11
  from pathlib import Path
12
12
 
13
13
  # ── 基线版本(与 setup.py / package.json 保持一致) ──
14
- BASE_VERSION = "1.3.2"
14
+ BASE_VERSION = "1.3.3"
15
15
 
16
16
 
17
17
  def _version_from_git() -> str:
@@ -9,7 +9,7 @@ param(
9
9
 
10
10
  $ErrorActionPreference = "Stop"
11
11
  $PKG_NAME = "myagent-ai"
12
- $PKG_VERSION = "1.3.2"
12
+ $PKG_VERSION = "1.3.3"
13
13
 
14
14
  # Allow running scripts for the current process
15
15
  if ($PSVersionTable.PSVersion.Major -ge 5) {
@@ -21,7 +21,7 @@ NO_DEPS=false
21
21
  DRY_RUN=false
22
22
  SCRIPT_URL="https://raw.githubusercontent.com/ctz168/myagent/main/install/install.sh"
23
23
  PKG_NAME="myagent-ai"
24
- PKG_VERSION="1.3.2"
24
+ PKG_VERSION="1.3.3"
25
25
 
26
26
  for arg in "$@"; do
27
27
  case "$arg" in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {
package/requirements.txt CHANGED
@@ -4,76 +4,54 @@
4
4
  # ============================================================
5
5
  # 核心依赖 (必需)
6
6
  # ============================================================
7
- openai>=1.12.0 # OpenAI GPT 系列 + 兼容API
8
- aiohttp>=3.9.0 # 异步 HTTP (聊天平台接入 + Web服务器)
9
- requests>=2.31.0 # HTTP 请求 (LLM备用、更新检查)
10
-
11
- # ============================================================
12
- # Web 管理后台
13
- # ============================================================
14
- # Web 服务器使用 aiohttp,无额外依赖
15
- # aiohttp 已在核心依赖中
16
-
17
- # ============================================================
18
- # 记忆系统
19
- # ============================================================
20
- # SQLite3 为 Python 内置模块,无需额外安装
21
-
22
- # ============================================================
23
- # 执行引擎
24
- # ============================================================
25
- # subprocess, tempfile 为 Python 内置模块
7
+ openai>=1.12.0
8
+ aiohttp>=3.9.0
9
+ requests>=2.31.0
26
10
 
27
11
  # ============================================================
28
12
  # 技能系统 - 搜索
29
13
  # ============================================================
30
- duckduckgo-search>=6.0.0 # 网络搜索 (无需 API Key)
31
- beautifulsoup4>=4.12.0 # HTML 解析
32
- lxml>=5.0.0 # HTML/XML 高性能解析
33
- psutil>=5.9.0 # 系统信息
14
+ duckduckgo-search>=6.0.0
15
+ beautifulsoup4>=4.12.0
16
+ lxml>=5.0.0
17
+ psutil>=5.9.0
34
18
 
35
19
  # ============================================================
36
20
  # 技能系统 - 浏览器自动化 (Playwright)
37
21
  # ============================================================
38
- playwright>=1.41.0 # 浏览器自动化 (内置技能)
22
+ playwright>=1.41.0
39
23
 
40
24
  # ============================================================
41
25
  # 技能系统 - 桌面 GUI 自动化
42
26
  # ============================================================
43
- pynput>=1.7.6 # 鼠标/键盘控制 (跨平台, ~500KB)
44
- pygetwindow>=0.0.9 # 窗口管理 (Windows + macOS)
45
- mss>=9.0.0 # 屏幕截图 (跨平台, ~1MB)
27
+ pynput>=1.7.6
28
+ pygetwindow>=0.0.9
29
+ mss>=9.0.0
46
30
 
47
31
  # ============================================================
48
32
  # 系统托盘 (默认启用)
49
33
  # ============================================================
50
- pystray>=0.19.5 # 系统托盘图标
51
- Pillow>=10.0.0 # 图标生成
34
+ pystray>=0.19.5
35
+ Pillow>=10.0.0
52
36
 
53
37
  # ============================================================
54
38
  # 聊天平台 (按需使用,默认安装)
55
39
  # ============================================================
56
- python-telegram-bot>=21.0 # Telegram Bot
57
- discord.py>=2.3.0 # Discord Bot
58
- # 飞书/QQ/微信 通过 aiohttp 实现,无需额外安装
40
+ python-telegram-bot>=21.0
41
+ discord.py>=2.3.0
59
42
 
60
43
  # ============================================================
61
44
  # 语音合成 (默认启用)
62
45
  # ============================================================
63
- edge-tts>=6.1.0 # 微软 Edge TTS (免费, 中英文)
46
+ edge-tts>=6.1.0
64
47
 
65
48
  # ============================================================
66
49
  # Anthropic Claude (可选)
67
50
  # ============================================================
68
- anthropic>=0.18.0 # Claude 系列
51
+ anthropic>=0.18.0
69
52
 
70
53
  # ============================================================
71
54
  # Agent 间通信 (可选)
72
55
  # ============================================================
73
- cryptography>=41.0.0 # Ed25519, X25519, AES-256-GCM
74
- websockets>=12.0 # 异步 WebSocket (远程通信)
75
-
76
- # ============================================================
77
- # 打包 (可选, 仅开发用)
78
- # ============================================================
79
- # pyinstaller>=6.0.0 # 打包为 exe/app (按需安装)
56
+ cryptography>=41.0.0
57
+ websockets>=12.0
package/setup.py CHANGED
@@ -9,7 +9,7 @@ from pathlib import Path
9
9
  _version_path = Path(__file__).parent / "core" / "version.py"
10
10
  _version_vars = {}
11
11
  exec(_version_path.read_text(), _version_vars)
12
- __version__ = _version_vars.get("BASE_VERSION", "1.3.2")
12
+ __version__ = _version_vars.get("BASE_VERSION", "1.3.3")
13
13
 
14
14
  setup(
15
15
  name="myagent",
package/start.js CHANGED
@@ -151,6 +151,50 @@ function buildArgs(userArgs) {
151
151
  }
152
152
  }
153
153
 
154
+ // ── Windows: pip 安装依赖(带升级和 fallback) ──────────────
155
+ // 核心依赖包名列表(直接安装,不依赖 requirements.txt 解析)
156
+ const CORE_PACKAGES = [
157
+ "openai>=1.12.0",
158
+ "aiohttp>=3.9.0",
159
+ "requests>=2.31.0",
160
+ "duckduckgo-search>=6.0.0",
161
+ "beautifulsoup4>=4.12.0",
162
+ "lxml>=5.0.0",
163
+ "psutil>=5.9.0",
164
+ ];
165
+
166
+ function pipInstall(pythonCmd, packages, cwd) {
167
+ const args = ["-m", "pip", "install", "--quiet", "--disable-pip-version-check", ...packages];
168
+ return execFileSync(pythonCmd, args, {
169
+ encoding: "utf8",
170
+ stdio: "inherit",
171
+ timeout: 180000,
172
+ cwd,
173
+ });
174
+ }
175
+
176
+ function pipInstallReqFile(pythonCmd, reqFile, cwd) {
177
+ return execFileSync(pythonCmd, ["-m", "pip", "install", "-r", reqFile, "--disable-pip-version-check"], {
178
+ encoding: "utf8",
179
+ stdio: "inherit",
180
+ timeout: 300000,
181
+ cwd,
182
+ });
183
+ }
184
+
185
+ function upgradePip(pythonCmd) {
186
+ try {
187
+ console.log(" \x1b[90m[i]\x1b[0m 升级 pip...");
188
+ execFileSync(pythonCmd, ["-m", "pip", "install", "--upgrade", "pip", "--quiet"], {
189
+ encoding: "utf8",
190
+ stdio: ["pipe", "pipe", "pipe"],
191
+ timeout: 120000,
192
+ });
193
+ } catch (_) {
194
+ // 升级失败不阻断,继续尝试安装
195
+ }
196
+ }
197
+
154
198
  // ── Windows 快速依赖检查 ───────────────────────────────────
155
199
  function checkDepsWin(pkgDir) {
156
200
  const required = ["openai", "aiohttp", "requests"];
@@ -174,28 +218,46 @@ function checkDepsWin(pkgDir) {
174
218
  ["-c", `import ${mod}`],
175
219
  { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"], timeout: 5000, cwd: pkgDir }
176
220
  );
177
- console.log(`\x1b[32m[✓]\x1b[0m ${mod}`);
221
+ console.log(` \x1b[32m[✓]\x1b[0m ${mod}`);
178
222
  } catch (_) {
179
- console.log(`\x1b[33m[!]\x1b[0m ${mod} 未安装`);
223
+ console.log(` \x1b[33m[!]\x1b[0m ${mod}`);
180
224
  missing.push(mod);
181
225
  }
182
226
  }
183
227
 
184
228
  if (missing.length > 0) {
229
+ console.log(`\x1b[33m[!]\x1b[0m 正在安装 ${missing.length} 个缺失依赖...`);
185
230
  const reqFile = path.join(pkgDir, "requirements.txt");
231
+
232
+ // 策略1: 先升级 pip(旧版 pip 无法解析 requirements.txt)
233
+ upgradePip(pythonCmd);
234
+
235
+ // 策略2: 尝试 pip install -r requirements.txt
236
+ let installed = false;
186
237
  if (fs.existsSync(reqFile)) {
187
- console.log(`\x1b[33m[!]\x1b[0m 正在安装 ${missing.length} 个缺失依赖...`);
188
238
  try {
189
- execFileSync(pythonCmd, ["-m", "pip", "install", "-r", reqFile], {
190
- encoding: "utf8",
191
- stdio: "inherit",
192
- timeout: 180000,
193
- cwd: pkgDir,
194
- });
195
- console.log(`\x1b[32m[✓]\x1b[0m 依赖安装完成`);
239
+ pipInstallReqFile(pythonCmd, reqFile, pkgDir);
240
+ console.log(` \x1b[32m[✓]\x1b[0m 依赖安装完成`);
241
+ installed = true;
196
242
  } catch (_) {
197
- console.error(`\x1b[33m[!]\x1b[0m 部分依赖安装失败,请手动运行:`);
198
- console.error(` ${pythonCmd} -m pip install -r "${reqFile}"`);
243
+ // requirements.txt 安装失败,进入 fallback
244
+ console.log(` \x1b[33m[!]\x1b[0m requirements.txt 安装失败,尝试直接安装核心依赖...`);
245
+ }
246
+ }
247
+
248
+ // 策略3: 直接按包名安装核心依赖(不依赖 requirements.txt 解析)
249
+ if (!installed) {
250
+ try {
251
+ pipInstall(pythonCmd, CORE_PACKAGES, pkgDir);
252
+ console.log(` \x1b[32m[✓]\x1b[0m 核心依赖安装完成`);
253
+ console.log(` \x1b[90m[i]\x1b[0m 其他依赖将在 MyAgent 启动时自动安装`);
254
+ } catch (_) {
255
+ console.error(` \x1b[31m[✗]\x1b[0m 依赖安装失败,请手动运行:`);
256
+ console.error(` ${pythonCmd} -m pip install -r "${reqFile}"`);
257
+ console.error(` 或逐个安装:`);
258
+ for (const pkg of CORE_PACKAGES) {
259
+ console.error(` ${pythonCmd} -m pip install ${pkg}`);
260
+ }
199
261
  }
200
262
  }
201
263
  }