@yeaft/webchat-agent 0.1.1016 → 0.1.1018

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.1.1016",
3
+ "version": "0.1.1018",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -216,7 +216,8 @@ export function tickAgent(agentId, delta = {}, now = Date.now()) {
216
216
  export default defineTool({
217
217
  name: 'SpawnAgent',
218
218
  aliases: ['Agent'],
219
- description: `Create a sub-agent to work on an independent task in parallel.
219
+ description: {
220
+ en: `Create a sub-agent to work on an independent task in parallel.
220
221
 
221
222
  Sub-agents run in their own context and can be given a concrete mission
222
223
  with an optional expected_output schema. Optional budget limits
@@ -242,42 +243,97 @@ Async orchestration:
242
243
  Completion/failure is delivered through sub-agent notifications on later parent
243
244
  turns. WaitAgent remains available only as a short compatibility poll; do not
244
245
  use it as the default workflow or call it repeatedly in a loop.`,
246
+ zh: `创建一个子 Agent 并行处理独立任务。
247
+
248
+ 子 Agent 在独立上下文中运行,可给定具体 mission 和可选的 expected_output schema。
249
+ 可选的预算限制(max_tokens/max_turns/wall_time_ms)仅在设置后作为安全截止。
250
+ 选择预设 persona 来预配置工具子集和模型层级:
251
+ - explorer : 快速只读侦察(Read/Grep/Glob/ListDir)
252
+ - implementer: 具备完整工作工具的构建者(主模型)
253
+ - reviewer : 只读审查者(主模型)
254
+ - researcher : 面向网络的信息收集者(WebSearch/WebFetch/Read)
255
+
256
+ 使用指南:
257
+ - 给出清晰聚焦的 mission——"完成"是什么样子
258
+ - 当返回结构重要时使用 expected_output
259
+ - 仅在需要明确安全截止时添加 budget
260
+
261
+ 异步编排流程:
262
+ 1. SpawnAgent — 启动子 Agent 作为后台任务并立即返回。
263
+ 2. Continue — 父 VP 继续工作;不要仅仅为了轮询而阻塞。
264
+ 3. ListAgents — 需要进度信息时的非阻塞状态检查。
265
+ 4. WaitAgent — 短轮询(<5s)或仅在真正需要结果时才明确长等待。
266
+ 5. CloseAgent — 完成后销毁子 Agent。
267
+
268
+ 不要在循环中无终止条件地调用 WaitAgent。如果短检查后子 Agent 仍在运行,继续前进,
269
+ 让 notification 在下个 turn 告知你。`
270
+ },
245
271
  parameters: {
246
272
  type: 'object',
247
273
  properties: {
248
274
  name: {
249
275
  type: 'string',
250
- description: 'A descriptive name for the sub-agent (e.g. "test-writer", "refactor-auth")',
276
+ description: {
277
+ en: 'A descriptive name for the sub-agent (e.g. "test-writer", "refactor-auth")',
278
+ zh: '子 Agent 的描述性名称(如 "test-writer"、"refactor-auth")',
279
+ },
251
280
  },
252
281
  task: {
253
282
  type: 'string',
254
- description: 'Legacy one-line task description (used if `mission` is omitted)',
283
+ description: {
284
+ en: 'Legacy one-line task description (used if `mission` is omitted)',
285
+ zh: '旧式单行任务描述(当 `mission` 省略时使用)',
286
+ },
255
287
  },
256
288
  mission: {
257
289
  type: 'string',
258
- description: 'Concrete mission statement — what this agent must accomplish',
290
+ description: {
291
+ en: 'Concrete mission statement — what this agent must accomplish',
292
+ zh: '具体任务陈述 — 该 Agent 必须完成什么',
293
+ },
259
294
  },
260
295
  expected_output: {
261
296
  type: 'object',
262
- description: 'JSON schema describing the structure the agent should return',
297
+ description: {
298
+ en: 'JSON schema describing the structure the agent should return',
299
+ zh: '描述 Agent 应返回结构的 JSON schema',
300
+ },
263
301
  },
264
302
  persona: {
265
303
  type: 'string',
266
304
  enum: ['explorer', 'implementer', 'reviewer', 'researcher'],
267
- description: 'Preset persona that pre-wires tool subset + model tier',
305
+ description: {
306
+ en: 'Preset persona that pre-wires tool subset + model tier',
307
+ zh: '预设 persona,预装工具子集和模型等级',
308
+ },
268
309
  },
269
310
  budget: {
270
311
  type: 'object',
271
312
  properties: {
272
- max_tokens: { type: 'number', description: 'Optional token ceiling; no default limit is applied' },
273
- max_turns: { type: 'number', description: 'Optional turn ceiling; no default limit is applied' },
274
- wall_time_ms: { type: 'number', description: 'Optional elapsed-time ceiling in milliseconds; no default limit is applied' },
313
+ max_tokens: { type: 'number', description: {
314
+ en: 'Optional token ceiling; no default limit is applied',
315
+ zh: '可选 token 上限;默认不设限制',
316
+ } },
317
+ max_turns: { type: 'number', description: {
318
+ en: 'Optional turn ceiling; no default limit is applied',
319
+ zh: '可选 turn 上限;默认不设限制',
320
+ } },
321
+ wall_time_ms: { type: 'number', description: {
322
+ en: 'Optional elapsed-time ceiling in milliseconds; no default limit is applied',
323
+ zh: '可选耗时上限(毫秒);默认不设限制',
324
+ } },
325
+ },
326
+ description: {
327
+ en: 'Optional safety limits; no max_tokens/max_turns/wall_time_ms defaults are applied. Exceeding an explicit limit returns { status: "budget_exceeded", partial_output, reason }',
328
+ zh: '可选安全限制;默认不限制 max_tokens/max_turns/wall_time_ms。超过显式限制会返回 { status: "budget_exceeded", partial_output, reason }',
275
329
  },
276
- description: 'Optional safety limits; no max_tokens/max_turns/wall_time_ms defaults are applied. Exceeding an explicit limit returns { status: "budget_exceeded", partial_output, reason }',
277
330
  },
278
331
  cwd: {
279
332
  type: 'string',
280
- description: 'Working directory for the sub-agent (optional, defaults to parent cwd)',
333
+ description: {
334
+ en: 'Working directory for the sub-agent (optional, defaults to parent cwd)',
335
+ zh: '子 Agent 的工作目录(可选,默认使用父级当前工作目录)',
336
+ },
281
337
  },
282
338
  },
283
339
  required: ['name'],
@@ -96,7 +96,8 @@ function applyHunks(content, hunks) {
96
96
 
97
97
  export default defineTool({
98
98
  name: 'ApplyPatch',
99
- description: `Apply a unified diff patch to files.
99
+ description: {
100
+ en: `Apply a unified diff patch to files.
100
101
 
101
102
  Parses unified diff format (like git diff output) and applies changes.
102
103
  Supports patching multiple files in a single diff.
@@ -105,12 +106,24 @@ Guidelines:
105
106
  - Provide standard unified diff format (--- a/file, +++ b/file, @@ hunks)
106
107
  - Ensure the diff matches the current file content exactly
107
108
  - New files are created automatically with parent directories`,
109
+ zh: `将 unified diff 补丁应用到文件。
110
+
111
+ 解析 unified diff 格式(如 git diff 输出)并应用更改。支持单个 diff 修补多个文件。
112
+
113
+ 使用指南:
114
+ - 提供标准 unified diff 格式(--- a/file, +++ b/file, @@ 块)
115
+ - 确保 diff 与当前文件内容精确匹配
116
+ - 新文件自动创建并创建父目录`
117
+ },
108
118
  parameters: {
109
119
  type: 'object',
110
120
  properties: {
111
121
  patch: {
112
122
  type: 'string',
113
- description: 'The unified diff patch content',
123
+ description: {
124
+ en: 'The unified diff patch content',
125
+ zh: 'unified diff 补丁内容',
126
+ },
114
127
  },
115
128
  },
116
129
  required: ['patch'],
@@ -13,7 +13,8 @@ import { randomUUID } from 'crypto';
13
13
 
14
14
  export default defineTool({
15
15
  name: 'AskUser',
16
- description: `Ask the user a question and wait for their response.
16
+ description: {
17
+ en: `Ask the user a question and wait for their response.
17
18
 
18
19
  Use this tool when you need additional information or clarification from the user.
19
20
  The user will see your question in the chat interface and can type a response.
@@ -23,17 +24,33 @@ Guidelines:
23
24
  - Provide context about why you need the information
24
25
  - If presenting options, list them clearly
25
26
  - Don't use this for rhetorical questions — only when you genuinely need user input`,
27
+ zh: `向用户提问并等待回复。
28
+
29
+ 当你需要用户提供更多信息或澄清时使用此工具。用户会在聊天界面中看到你的问题并输入回复。
30
+
31
+ 使用指南:
32
+ - 提出具体、聚焦的问题
33
+ - 说明你为什么需要这些信息
34
+ - 如果提供选项,请清晰列出
35
+ - 不要用于反问句——只有真正需要用户输入时才使用`
36
+ },
26
37
  parameters: {
27
38
  type: 'object',
28
39
  properties: {
29
40
  question: {
30
41
  type: 'string',
31
- description: 'The question to ask the user',
42
+ description: {
43
+ en: 'The question to ask the user',
44
+ zh: '向用户提出的问题',
45
+ },
32
46
  },
33
47
  options: {
34
48
  type: 'array',
35
49
  items: { type: 'string' },
36
- description: 'Optional list of choices for the user to pick from',
50
+ description: {
51
+ en: 'Optional list of choices for the user to pick from',
52
+ zh: '供用户选择的选项列表(可选)',
53
+ },
37
54
  },
38
55
  },
39
56
  required: ['question'],
@@ -155,7 +155,8 @@ function runCommand(command, { cwd, timeout, signal, runtimePlatform }) {
155
155
 
156
156
  export default defineTool({
157
157
  name: 'Bash',
158
- description: `Execute a shell command and return its output.
158
+ description: {
159
+ en: `Execute a shell command and return its output.
159
160
 
160
161
  Use this tool to run CLI commands, scripts, and system operations. The tool name
161
162
  is kept as Bash for compatibility; on Windows the command is executed through
@@ -170,20 +171,42 @@ Guidelines:
170
171
  - Avoid interactive commands (no stdin support)
171
172
  - For long-running tasks, consider redirecting output to a file
172
173
  - stderr is captured separately and included in the result`,
174
+ zh: `执行 Shell 命令并返回输出。
175
+
176
+ 用于运行 CLI 命令、脚本和系统操作。
177
+
178
+ 使用指南:
179
+ - 命令在工作目录中执行(上下文中的 cwd)
180
+ - 默认超时 2 分钟(最大 10 分钟)
181
+ - 大输出在 256KB 处截断
182
+ - 尽量使用绝对路径
183
+ - 避免交互式命令(不支持 stdin)
184
+ - 长时间任务建议重定向输出到文件
185
+ - stderr 单独捕获并包含在结果中`
186
+ },
173
187
  parameters: {
174
188
  type: 'object',
175
189
  properties: {
176
190
  command: {
177
191
  type: 'string',
178
- description: 'The shell command to execute using the Agent OS default shell',
192
+ description: {
193
+ en: 'The shell command to execute using the Agent OS default shell',
194
+ zh: '要使用 Agent 操作系统默认 shell 执行的命令',
195
+ },
179
196
  },
180
197
  cwd: {
181
198
  type: 'string',
182
- description: 'Working directory for the command (default: engine cwd)',
199
+ description: {
200
+ en: 'Working directory for the command (default: engine cwd)',
201
+ zh: '命令的工作目录(默认为引擎当前目录)',
202
+ },
183
203
  },
184
204
  timeout_ms: {
185
205
  type: 'number',
186
- description: `Timeout in milliseconds (default: ${DEFAULT_TIMEOUT_MS}, max: ${MAX_TIMEOUT_MS})`,
206
+ description: {
207
+ en: `Timeout in milliseconds (default: ${DEFAULT_TIMEOUT_MS}, max: ${MAX_TIMEOUT_MS})`,
208
+ zh: `超时时间,单位毫秒(默认 ${DEFAULT_TIMEOUT_MS},最大 ${MAX_TIMEOUT_MS})`,
209
+ },
187
210
  },
188
211
  },
189
212
  required: ['command'],
@@ -15,7 +15,8 @@ import { snapshotLiveness } from '../sub-agent/liveness.js';
15
15
 
16
16
  export default defineTool({
17
17
  name: 'CloseAgent',
18
- description: `Close a sub-agent and release its resources.
18
+ description: {
19
+ en: `Close a sub-agent and release its resources.
19
20
 
20
21
  Use when a sub-agent's task is complete or no longer needed.
21
22
  The agent's final \`result\` (if any) is returned in the envelope before closing.
@@ -24,16 +25,29 @@ CRITICAL — closing the sub-agent is NOT the end of YOUR turn. After CloseAgent
24
25
  you MUST relay the \`result\` to the user in your own reply (or summarize what
25
26
  was accomplished). The user has not seen the sub-agent's reply — only you have.
26
27
  Do NOT end your turn silently right after CloseAgent.`,
28
+ zh: `关闭子 Agent 并释放其资源。
29
+
30
+ 当子 Agent 的任务完成或不再需要时使用。关闭前会返回子 Agent 的最终 result(如有)。
31
+
32
+ 关键——关闭子 Agent 不是你 turn 的结束。CloseAgent 后你必须用自己的回复将 result 传达给用户
33
+ (或总结已完成的内容)。用户看不到子 Agent 的回复——只有你能看到。不要在 CloseAgent 后默默结束 turn。`
34
+ },
27
35
  parameters: {
28
36
  type: 'object',
29
37
  properties: {
30
38
  agent_id: {
31
39
  type: 'string',
32
- description: 'The sub-agent ID to close',
40
+ description: {
41
+ en: 'The sub-agent ID to close',
42
+ zh: '要关闭的子 Agent ID',
43
+ },
33
44
  },
34
45
  result: {
35
46
  type: 'string',
36
- description: 'Optional final result to set before closing',
47
+ description: {
48
+ en: 'Optional final result to set before closing',
49
+ zh: '关闭前设置的可选最终结果',
50
+ },
37
51
  },
38
52
  },
39
53
  required: ['agent_id'],
@@ -16,7 +16,8 @@ import { randomUUID } from 'crypto';
16
16
 
17
17
  export default defineTool({
18
18
  name: 'EnterWorktree',
19
- description: `Create an isolated git worktree for development.
19
+ description: {
20
+ en: `Create an isolated git worktree for development.
20
21
 
21
22
  Creates a new git worktree with a dedicated branch, allowing parallel
22
23
  development without file conflicts. Useful for:
@@ -26,16 +27,31 @@ development without file conflicts. Useful for:
26
27
 
27
28
  The worktree is created in .yeaft/worktrees/ with a new branch based on HEAD.
28
29
  Returns the worktree path and branch name.`,
30
+ zh: `创建一个独立的 git worktree 用于开发。
31
+
32
+ 创建带独立分支的新 git worktree,允许并行开发无文件冲突。适用于:
33
+ - 子 Agent 处理独立子任务
34
+ - 合并前隔离测试改动
35
+ - 并行功能开发
36
+
37
+ Worktree 创建在 .yeaft/worktrees/ 中,基于 HEAD 创建新分支。返回 worktree 路径和分支名。`
38
+ },
29
39
  parameters: {
30
40
  type: 'object',
31
41
  properties: {
32
42
  name: {
33
43
  type: 'string',
34
- description: 'Name for the worktree (used in path and branch name). If omitted, a random name is generated.',
44
+ description: {
45
+ en: 'Name for the worktree (used in path and branch name). If omitted, a random name is generated.',
46
+ zh: 'worktree 名称(用于路径和分支名)。如省略,自动生成随机名。',
47
+ },
35
48
  },
36
49
  base_ref: {
37
50
  type: 'string',
38
- description: 'Git ref to base the worktree on (default: HEAD)',
51
+ description: {
52
+ en: 'Git ref to base the worktree on (default: HEAD)',
53
+ zh: '基于哪个 Git 引用创建(默认 HEAD)',
54
+ },
39
55
  },
40
56
  },
41
57
  },
@@ -14,7 +14,8 @@ import { resolve } from 'path';
14
14
 
15
15
  export default defineTool({
16
16
  name: 'ExitWorktree',
17
- description: `Exit a git worktree session.
17
+ description: {
18
+ en: `Exit a git worktree session.
18
19
 
19
20
  Options:
20
21
  - "keep": Leave the worktree and branch on disk (can return later)
@@ -22,21 +23,38 @@ Options:
22
23
 
23
24
  If removing and there are uncommitted changes, the operation will fail
24
25
  unless discard_changes is set to true.`,
26
+ zh: `退出 git worktree 会话。
27
+
28
+ 选项:
29
+ - "keep":保留 worktree 和分支在磁盘上(之后可返回)
30
+ - "remove":删除 worktree 目录及其分支
31
+
32
+ 如果删除时有未提交的更改,操作会失败,除非设置 discard_changes 为 true。`
33
+ },
25
34
  parameters: {
26
35
  type: 'object',
27
36
  properties: {
28
37
  path: {
29
38
  type: 'string',
30
- description: 'Path to the worktree to exit (required)',
39
+ description: {
40
+ en: 'Path to the worktree to exit (required)',
41
+ zh: '要退出的 worktree 路径(必填)',
42
+ },
31
43
  },
32
44
  action: {
33
45
  type: 'string',
34
46
  enum: ['keep', 'remove'],
35
- description: '"keep" leaves the worktree on disk; "remove" deletes it',
47
+ description: {
48
+ en: '"keep" leaves the worktree on disk; "remove" deletes it',
49
+ zh: '"keep" 在磁盘上保留 worktree;"remove" 删除它',
50
+ },
36
51
  },
37
52
  discard_changes: {
38
53
  type: 'boolean',
39
- description: 'Force remove even with uncommitted changes (default: false)',
54
+ description: {
55
+ en: 'Force remove even with uncommitted changes (default: false)',
56
+ zh: '即使有未提交改动也强制删除(默认 false)',
57
+ },
40
58
  },
41
59
  },
42
60
  required: ['path', 'action'],
@@ -13,7 +13,8 @@ import { resolve } from 'path';
13
13
 
14
14
  export default defineTool({
15
15
  name: 'FileEdit',
16
- description: `Make surgical text replacements in an existing file.
16
+ description: {
17
+ en: `Make surgical text replacements in an existing file.
17
18
 
18
19
  Replaces exact occurrences of old_string with new_string.
19
20
  The old_string must be unique in the file unless replace_all is true.
@@ -24,24 +25,47 @@ Guidelines:
24
25
  - Use replace_all: true to replace ALL occurrences
25
26
  - For creating new files or full rewrites, use FileWrite instead
26
27
  - Always read the file first to understand its current content`,
28
+ zh: `在已有文件中做精确文本替换。
29
+
30
+ 用 new_string 替换 old_string 的精确出现。old_string 在文件中必须唯一,除非设置 replace_all 为 true。
31
+
32
+ 使用指南:
33
+ - old_string 必须完全匹配(包括空白和缩进)
34
+ - 若 old_string 找不到或不唯一,编辑失败
35
+ - 使用 replace_all: true 替换所有出现位置
36
+ - 创建新文件或全量重写请用 FileWrite
37
+ - 始终先读文件了解其当前内容`
38
+ },
27
39
  parameters: {
28
40
  type: 'object',
29
41
  properties: {
30
42
  file_path: {
31
43
  type: 'string',
32
- description: 'Path to the file to edit (absolute or relative to cwd)',
44
+ description: {
45
+ en: 'Path to the file to edit (absolute or relative to cwd)',
46
+ zh: '要编辑的文件路径(绝对路径或相对于工作目录)',
47
+ },
33
48
  },
34
49
  old_string: {
35
50
  type: 'string',
36
- description: 'The exact text to find and replace',
51
+ description: {
52
+ en: 'The exact text to find and replace',
53
+ zh: '要查找并替换的精确文本',
54
+ },
37
55
  },
38
56
  new_string: {
39
57
  type: 'string',
40
- description: 'The replacement text',
58
+ description: {
59
+ en: 'The replacement text',
60
+ zh: '替换后的文本',
61
+ },
41
62
  },
42
63
  replace_all: {
43
64
  type: 'boolean',
44
- description: 'Replace all occurrences (default: false — fails if not unique)',
65
+ description: {
66
+ en: 'Replace all occurrences (default: false — fails if not unique)',
67
+ zh: '替换所有出现(默认 false — 不唯一时失败)',
68
+ },
45
69
  },
46
70
  },
47
71
  required: ['file_path', 'old_string', 'new_string'],
@@ -36,7 +36,8 @@ const DEFAULT_LIMIT = 3000;
36
36
 
37
37
  export default defineTool({
38
38
  name: 'FileRead',
39
- description: `Read a file from the filesystem with line numbers.
39
+ description: {
40
+ en: `Read a file from the filesystem with line numbers.
40
41
 
41
42
  Returns file contents with line numbers (like \`cat -n\`).
42
43
  Supports offset and limit for reading specific portions of large files.
@@ -47,20 +48,40 @@ Guidelines:
47
48
  - Binary files are detected by extension and rejected
48
49
  - Maximum file size: 10MB
49
50
  - Default limit: 3000 lines (matches the "large file = >3000 lines" threshold)`,
51
+ zh: `读取文件系统中的文件内容,带行号。
52
+
53
+ 返回带行号的文件内容(类似 cat -n)。支持 offset/limit 读取大文件的特定部分。
54
+
55
+ 使用指南:
56
+ - 尽量使用绝对路径
57
+ - 超过 3000 行才算大文件。默认读完整文件;仅在超过此阈值或已知精确行范围时使用 offset/limit
58
+ - 二进制文件通过扩展名识别并拒绝
59
+ - 最大文件大小:10MB
60
+ - 默认行数限制:3000 行`
61
+ },
50
62
  parameters: {
51
63
  type: 'object',
52
64
  properties: {
53
65
  file_path: {
54
66
  type: 'string',
55
- description: 'Path to the file to read (absolute or relative to cwd)',
67
+ description: {
68
+ en: 'Path to the file to read (absolute or relative to cwd)',
69
+ zh: '要读取的文件路径(绝对路径或相对于当前工作目录)',
70
+ },
56
71
  },
57
72
  offset: {
58
73
  type: 'number',
59
- description: 'Line number to start reading from (0-based, default: 0)',
74
+ description: {
75
+ en: 'Line number to start reading from (0-based, default: 0)',
76
+ zh: '起始行号(从 0 开始计数,默认 0)',
77
+ },
60
78
  },
61
79
  limit: {
62
80
  type: 'number',
63
- description: `Maximum number of lines to read (default: ${DEFAULT_LIMIT})`,
81
+ description: {
82
+ en: `Maximum number of lines to read (default: ${DEFAULT_LIMIT})`,
83
+ zh: `最多读取行数(默认 ${DEFAULT_LIMIT} 行)`,
84
+ },
64
85
  },
65
86
  },
66
87
  required: ['file_path'],
@@ -11,7 +11,8 @@ import { resolve, dirname } from 'path';
11
11
 
12
12
  export default defineTool({
13
13
  name: 'FileWrite',
14
- description: `Write content to a file, creating it if it doesn't exist.
14
+ description: {
15
+ en: `Write content to a file, creating it if it doesn't exist.
15
16
 
16
17
  Creates parent directories automatically. Overwrites existing files.
17
18
 
@@ -20,16 +21,32 @@ Guidelines:
20
21
  - For modifying existing files, prefer FileEdit (surgical edits) over FileWrite (full overwrite)
21
22
  - Parent directories are created automatically
22
23
  - Content should be the complete file content`,
24
+ zh: `将内容写入文件,若文件不存在则创建。
25
+
26
+ 自动创建父目录。覆盖已存在的文件。
27
+
28
+ 使用指南:
29
+ - 尽量使用绝对路径
30
+ - 修改已有文件时优先使用 FileEdit(精确编辑)而非 FileWrite(全量覆盖)
31
+ - 父目录自动创建
32
+ - 内容应为完整文件内容`
33
+ },
23
34
  parameters: {
24
35
  type: 'object',
25
36
  properties: {
26
37
  file_path: {
27
38
  type: 'string',
28
- description: 'Path to the file to write (absolute or relative to cwd)',
39
+ description: {
40
+ en: 'Path to the file to write (absolute or relative to cwd)',
41
+ zh: '要写入的文件路径(绝对路径或相对于工作目录)',
42
+ },
29
43
  },
30
44
  content: {
31
45
  type: 'string',
32
- description: 'The complete file content to write',
46
+ description: {
47
+ en: 'The complete file content to write',
48
+ zh: '要写入的完整文件内容',
49
+ },
33
50
  },
34
51
  },
35
52
  required: ['file_path', 'content'],
@@ -67,7 +67,8 @@ async function* walkDir(dir, baseDir, maxDepth = 10, depth = 0) {
67
67
 
68
68
  export default defineTool({
69
69
  name: 'Glob',
70
- description: `Find files matching a glob pattern.
70
+ description: {
71
+ en: `Find files matching a glob pattern.
71
72
 
72
73
  Supports glob patterns like "**/*.js", "src/**/*.ts", "*.md".
73
74
  Results are sorted by modification time (newest first).
@@ -77,20 +78,39 @@ Guidelines:
77
78
  - Common directories (node_modules, .git, etc.) are skipped
78
79
  - Returns file paths relative to the search directory
79
80
  - Limited to 500 results by default`,
81
+ zh: `查找匹配 glob 模式的文件。
82
+
83
+ 支持如 "**/*.js"、"src/**/*.ts"、"*.md" 等 glob 模式。结果按修改时间排序(最新优先)。
84
+
85
+ 使用指南:
86
+ - 用 "**/" 进行递归目录匹配
87
+ - 常见目录(node_modules、.git 等)被跳过
88
+ - 返回相对于搜索目录的文件路径
89
+ - 默认限制 500 条结果`
90
+ },
80
91
  parameters: {
81
92
  type: 'object',
82
93
  properties: {
83
94
  pattern: {
84
95
  type: 'string',
85
- description: 'Glob pattern to match files (e.g. "**/*.js")',
96
+ description: {
97
+ en: 'Glob pattern to match files (e.g. "**/*.js")',
98
+ zh: '匹配文件的 glob 模式(如 "**/*.js")',
99
+ },
86
100
  },
87
101
  path: {
88
102
  type: 'string',
89
- description: 'Directory to search in (default: cwd)',
103
+ description: {
104
+ en: 'Directory to search in (default: cwd)',
105
+ zh: '搜索目录(默认当前工作目录)',
106
+ },
90
107
  },
91
108
  limit: {
92
109
  type: 'number',
93
- description: 'Maximum number of results (default: 500)',
110
+ description: {
111
+ en: 'Maximum number of results (default: 500)',
112
+ zh: '最多返回结果数(默认 500)',
113
+ },
94
114
  },
95
115
  },
96
116
  required: ['pattern'],