myagent-ai 1.26.1 → 1.26.2
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/package.json +1 -1
- package/skills/registry.py +4 -20
- package/start.js +15 -2
package/package.json
CHANGED
package/skills/registry.py
CHANGED
|
@@ -33,11 +33,11 @@ logger = get_logger("myagent.skills")
|
|
|
33
33
|
BUILTIN_TOOLS: List[Dict[str, Any]] = [
|
|
34
34
|
{
|
|
35
35
|
"name": "command",
|
|
36
|
-
"description": "执行 Shell 命令 —
|
|
36
|
+
"description": "执行 Shell 命令 — 所有操作均通过此工具完成。Shell 原生命令(ls/cat/grep/ps/df/uname/python3/pip/npm/git 等)直接执行,不要加 myagent-ai 前缀。只有 myagent 专有命令(docx-create/search/ocr 等)才需要 myagent-ai 前缀。",
|
|
37
37
|
"category": "platform",
|
|
38
38
|
"handler": "ToolDispatcher._exec_command",
|
|
39
39
|
"parameters": [
|
|
40
|
-
{"name": "command", "type": "string", "description": "Shell 命令(如 myagent-ai search xxx, python3 script.py 等)", "required": True},
|
|
40
|
+
{"name": "command", "type": "string", "description": "Shell 命令(如 ls -la, grep -r pattern dir, myagent-ai search xxx, python3 script.py 等)", "required": True},
|
|
41
41
|
],
|
|
42
42
|
},
|
|
43
43
|
{
|
|
@@ -134,18 +134,7 @@ CLI_COMMANDS: List[Dict[str, Any]] = [
|
|
|
134
134
|
{"name": "fetch-url", "category": "search", "cli": "myagent-ai fetch-url <url> [-m METHOD] [-H 'K:V'] [-d DATA]",
|
|
135
135
|
"description": "获取 URL 原始内容 (API 调用)"},
|
|
136
136
|
# ── 文件操作 ──
|
|
137
|
-
|
|
138
|
-
"description": "读取文件内容"},
|
|
139
|
-
{"name": "write", "category": "file", "cli": "myagent-ai write <path> -c 'content' [--append]",
|
|
140
|
-
"description": "写入文件(自动触发文件发送)"},
|
|
141
|
-
{"name": "ls", "category": "file", "cli": "myagent-ai ls <dir> [-p '*.py'] [-r] [--max N]",
|
|
142
|
-
"description": "列出目录内容"},
|
|
143
|
-
{"name": "rm", "category": "file", "cli": "myagent-ai rm <path> [-r]",
|
|
144
|
-
"description": "删除文件或目录"},
|
|
145
|
-
{"name": "grep", "category": "file", "cli": "myagent-ai grep <query> <dir> [-p '*.py']",
|
|
146
|
-
"description": "搜索文件内容"},
|
|
147
|
-
{"name": "mv", "category": "file", "cli": "myagent-ai mv <source> <dest>",
|
|
148
|
-
"description": "移动/重命名文件"},
|
|
137
|
+
# [v1.26.1] read/write/ls/rm/grep/mv 为原生命令,直接用 cat/tee/ls/rm/grep/mv,不再包装
|
|
149
138
|
{"name": "send-file", "category": "file", "cli": "myagent-ai send-file <path> [description]",
|
|
150
139
|
"description": "发送文件给用户"},
|
|
151
140
|
# ── 文档生成 ──
|
|
@@ -168,12 +157,7 @@ CLI_COMMANDS: List[Dict[str, Any]] = [
|
|
|
168
157
|
{"name": "pdf-read", "category": "document", "cli": "myagent-ai pdf-read <path> [--start N] [--end N]",
|
|
169
158
|
"description": "读取 PDF 文件内容"},
|
|
170
159
|
# ── 系统 ──
|
|
171
|
-
|
|
172
|
-
"description": "获取系统信息(OS/内存/磁盘/CPU)", "aliases": ["system-info"]},
|
|
173
|
-
{"name": "ps", "category": "system", "cli": "myagent-ai ps [--filter name] [--limit N]",
|
|
174
|
-
"description": "列出系统进程", "aliases": ["process-list"]},
|
|
175
|
-
{"name": "env", "category": "system", "cli": "myagent-ai env [KEY]",
|
|
176
|
-
"description": "获取环境变量"},
|
|
160
|
+
# [v1.26.1] sysinfo/ps/env 为原生命令,直接用 uname/ps/env/free/df 等,不再包装
|
|
177
161
|
{"name": "pathinfo", "category": "system", "cli": "myagent-ai pathinfo <path>",
|
|
178
162
|
"description": "获取路径详细信息"},
|
|
179
163
|
# ── 浏览器 ──
|
package/start.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
"use strict";
|
|
21
21
|
|
|
22
|
-
const { spawn, execSync, execFileSync } = require("child_process");
|
|
22
|
+
const { spawn, spawnSync, execSync, execFileSync } = require("child_process");
|
|
23
23
|
const path = require("path");
|
|
24
24
|
const fs = require("fs");
|
|
25
25
|
const os = require("os");
|
|
@@ -854,7 +854,20 @@ function main() {
|
|
|
854
854
|
return;
|
|
855
855
|
}
|
|
856
856
|
|
|
857
|
-
//
|
|
857
|
+
// [v1.26.1] 未知命令 → 透传 shell 执行(避免 myagent-ai ls -la 被误传给 main.py)
|
|
858
|
+
// 仅当无参数或以 -- 开头时才启动 myagent 服务
|
|
859
|
+
if (cmd && !cmd.startsWith("-")) {
|
|
860
|
+
const cmdStr = args.join(" ");
|
|
861
|
+
const result = spawnSync(
|
|
862
|
+
process.platform === "win32" ? "cmd.exe" : "bash",
|
|
863
|
+
[process.platform === "win32" ? "/c" : "-c", cmdStr],
|
|
864
|
+
{ stdio: "inherit", env: process.env },
|
|
865
|
+
);
|
|
866
|
+
process.exit(result.status || 0);
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
// 无参数 / --web / --tray / --server / --debug 等 → 启动 myagent 服务
|
|
858
871
|
cmdRun(pkgDir, args);
|
|
859
872
|
}
|
|
860
873
|
|