u1s1-cli 1.2.9 → 1.3.1

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.
@@ -127,14 +127,14 @@ return { synthesis };
127
127
  },
128
128
  refactor: {
129
129
  name: "refactor",
130
- description: "批量重构/迁移:先由一个 agent 读代表文件制定统一规则,然后每个文件一个子 agent 在独立 worktree 里套用规则,互不冲突",
130
+ description: "批量重构/迁移:先由一个 agent 读代表文件制定统一规则,然后每个文件一个子 agent 在当前工作区套用规则",
131
131
  inputHint: '{ "instruction": "把所有 var 改为 const", "files": ["src/a.ts", ...] } — files 省略时用 git diff 改动文件',
132
132
  build(input) {
133
133
  const instruction = str(input.instruction);
134
134
  if (!instruction)
135
135
  throw new Error('refactor 模板需要 instruction,例如 { "instruction": "把 var 全部改为 const" }');
136
136
  // 与 review 模板一致:构建期取 git 改动文件,不花一个 subagent 在沙箱里跑 git
137
- let files = strArray(input.files);
137
+ let files = [...new Set(strArray(input.files))];
138
138
  if (files.length === 0)
139
139
  files = gitDiffFiles();
140
140
  if (files.length === 0)
@@ -150,8 +150,8 @@ const rule = await subagent({
150
150
  });
151
151
  const results = await parallel(targetFiles.map(f => () =>
152
152
  subagent({
153
- task: "按以下重构规则处理文件 " + f + ",改完检查该文件语法正确(必要时运行 tsc 或构建验证)。\\n\\n重构规则:\\n" + rule,
154
- worktree: true
153
+ task: "按以下重构规则处理文件 " + f + "。只修改这个目标文件,不要改动其他文件,避免与并行任务冲突。" +
154
+ "改完检查该文件语法正确(必要时运行 tsc 或构建验证)。\\n\\n重构规则:\\n" + rule
155
155
  })
156
156
  ));
157
157
  const done = targetFiles.filter((_, i) => results[i] !== null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u1s1-cli",
3
- "version": "1.2.9",
3
+ "version": "1.3.1",
4
4
  "description": "u1s1 — 有一说一,最省心的 AI 编程搭子。终端里用中文说需求,AI 帮你读文件、改代码、跑命令。",
5
5
  "type": "module",
6
6
  "bin": {