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 +1 -1
- package/install/install.ps1 +1 -1
- package/install/install.sh +1 -1
- package/package.json +1 -1
- package/requirements.txt +19 -41
- package/setup.py +1 -1
- package/start.js +74 -12
package/core/version.py
CHANGED
package/install/install.ps1
CHANGED
package/install/install.sh
CHANGED
package/package.json
CHANGED
package/requirements.txt
CHANGED
|
@@ -4,76 +4,54 @@
|
|
|
4
4
|
# ============================================================
|
|
5
5
|
# 核心依赖 (必需)
|
|
6
6
|
# ============================================================
|
|
7
|
-
openai>=1.12.0
|
|
8
|
-
aiohttp>=3.9.0
|
|
9
|
-
requests>=2.31.0
|
|
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
|
|
31
|
-
beautifulsoup4>=4.12.0
|
|
32
|
-
lxml>=5.0.0
|
|
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
|
|
44
|
-
pygetwindow>=0.0.9
|
|
45
|
-
mss>=9.0.0
|
|
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
|
|
57
|
-
discord.py>=2.3.0
|
|
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
|
|
46
|
+
edge-tts>=6.1.0
|
|
64
47
|
|
|
65
48
|
# ============================================================
|
|
66
49
|
# Anthropic Claude (可选)
|
|
67
50
|
# ============================================================
|
|
68
|
-
anthropic>=0.18.0
|
|
51
|
+
anthropic>=0.18.0
|
|
69
52
|
|
|
70
53
|
# ============================================================
|
|
71
54
|
# Agent 间通信 (可选)
|
|
72
55
|
# ============================================================
|
|
73
|
-
cryptography>=41.0.0
|
|
74
|
-
websockets>=12.0
|
|
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.
|
|
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(
|
|
221
|
+
console.log(` \x1b[32m[✓]\x1b[0m ${mod}`);
|
|
178
222
|
} catch (_) {
|
|
179
|
-
console.log(
|
|
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
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
198
|
-
console.
|
|
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
|
}
|