@yeaft/webchat-agent 1.0.355 → 1.0.356
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.356"}
|
package/package.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
## General Rules
|
|
6
6
|
|
|
7
7
|
- Always read a file before editing it — never edit blind
|
|
8
|
-
- Use the most specific tool for the job: `
|
|
8
|
+
- Use the most specific tool for the job: the `Grep` tool for content search, `Glob` for file patterns, `FileRead` for reading
|
|
9
9
|
- Prefer editing existing files over creating new ones
|
|
10
10
|
- Use `bash` for shell commands; avoid interactive commands (no `vim`, no `less`, no `git rebase -i`)
|
|
11
11
|
- When output is too large, extract the relevant portion rather than dumping everything
|
|
12
|
-
- **Batch independent tool calls in a single turn.** When the next few steps don't depend on each other's output (e.g. reading three sibling files, or running `
|
|
12
|
+
- **Batch independent tool calls in a single turn.** When the next few steps don't depend on each other's output (e.g. reading three sibling files, or running the `Grep` + `Glob` tools to triangulate), emit them as parallel tool calls in one assistant turn instead of one-per-turn.
|
|
13
13
|
|
|
14
14
|
## File Operations
|
|
15
15
|
|
|
@@ -24,15 +24,16 @@
|
|
|
24
24
|
- Avoid destructive operations without confirmation
|
|
25
25
|
- Quote file paths that contain spaces
|
|
26
26
|
- Set reasonable timeouts for long-running commands
|
|
27
|
-
- Use `
|
|
27
|
+
- Use the `Grep` tool for content search — never run `grep` or `rg` inside `bash` for file search. The tool skips binaries and `node_modules`/`.git`, enforces output budgets, and is concurrency-safe; a bare shell `grep` gets none of that
|
|
28
|
+
- Don't edit files with `sed -i`; use the `FileEdit` / `ApplyPatch` tools so changes are precise and reviewable
|
|
28
29
|
|
|
29
30
|
## Search Strategy
|
|
30
31
|
|
|
31
32
|
Pick the shortest path that gets you the answer — don't always start at step 1.
|
|
32
33
|
|
|
33
|
-
1. **If you already know the file path** → go straight to `
|
|
34
|
-
2. **If you know roughly which directory but not the file** → `
|
|
35
|
-
3. **If you have nothing but a pattern of file names** → start with `
|
|
34
|
+
1. **If you already know the file path** → go straight to `FileRead` (or the `Grep` tool for a pattern within it). Skip `Glob`.
|
|
35
|
+
2. **If you know roughly which directory but not the file** → use the `Grep` tool directly with a `glob` or `type` filter; that's one tool call, not two.
|
|
36
|
+
3. **If you have nothing but a pattern of file names** → start with `Glob`, then `Grep` / `FileRead`.
|
|
36
37
|
4. Use `bash` only when no dedicated tool can do the job.
|
|
37
38
|
|
|
38
39
|
When several of these steps are independent (e.g. reading three files you already know the paths of), issue them as **parallel tool calls in one turn**, not three sequential turns.
|
|
@@ -80,11 +81,11 @@ or pure conversational/question turns — the checklist becomes noise.
|
|
|
80
81
|
## 通用规则
|
|
81
82
|
|
|
82
83
|
- 编辑文件前必须先读取 — 不要盲目编辑
|
|
83
|
-
- 使用最具体的工具:`
|
|
84
|
+
- 使用最具体的工具:`Grep` 工具搜索内容、`Glob` 搜索文件模式、`FileRead` 读取文件
|
|
84
85
|
- 优先编辑现有文件而非创建新文件
|
|
85
86
|
- 使用 `bash` 执行 shell 命令;避免交互式命令(不用 `vim`、不用 `less`、不用 `git rebase -i`)
|
|
86
87
|
- 当输出过大时,提取相关部分而非倾倒所有内容
|
|
87
|
-
- **同一个回合内并行调用互不依赖的工具。** 接下来几步如果彼此输出不依赖(比如读三个并列文件,或者 `
|
|
88
|
+
- **同一个回合内并行调用互不依赖的工具。** 接下来几步如果彼此输出不依赖(比如读三个并列文件,或者 `Grep` + `Glob` 两个工具一起定位),就在一个助手回合里并行发出多个工具调用,不要一次一个回合地串行。
|
|
88
89
|
|
|
89
90
|
## 文件操作
|
|
90
91
|
|
|
@@ -99,15 +100,16 @@ or pure conversational/question turns — the checklist becomes noise.
|
|
|
99
100
|
- 未经确认不执行破坏性操作
|
|
100
101
|
- 对包含空格的文件路径加引号
|
|
101
102
|
- 为长时间运行的命令设置合理的超时
|
|
102
|
-
-
|
|
103
|
+
- 内容搜索一律用 `Grep` 工具 — 不要在 `bash` 里跑 `grep` 或 `rg` 做文件搜索。Grep 工具会跳过二进制和 `node_modules`/`.git`,自带输出预算,且并发安全;裸 shell `grep` 没有这些保护
|
|
104
|
+
- 不要用 `sed -i` 改文件;用 `FileEdit` / `ApplyPatch` 工具,改动精确且可审查
|
|
103
105
|
|
|
104
106
|
## 搜索策略
|
|
105
107
|
|
|
106
108
|
挑能拿到答案的最短路径,不必每次都从第 1 步开始。
|
|
107
109
|
|
|
108
|
-
1. **已经知道文件路径** → 直接 `
|
|
109
|
-
2. **大致知道目录但不知道文件** →
|
|
110
|
-
3. **只有文件名模式** → 先 `
|
|
110
|
+
1. **已经知道文件路径** → 直接 `FileRead`(或在该文件里用 `Grep` 工具找模式)。跳过 `Glob`。
|
|
111
|
+
2. **大致知道目录但不知道文件** → 直接用 `Grep` 工具配合 `glob` / `type` 过滤;这一步本身就够,不用先 `Glob` 再 `Grep`。
|
|
112
|
+
3. **只有文件名模式** → 先 `Glob`,再 `Grep` / `FileRead`。
|
|
111
113
|
4. 只有当专用工具都做不到的时候才用 `bash`。
|
|
112
114
|
|
|
113
115
|
如果上面这些步骤里有几个互不依赖(比如要读三个你已经知道路径的文件),**在同一个 turn 里并行调用**,不要串成三个回合。
|