clawt 3.9.2 → 3.9.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/dist/index.js CHANGED
@@ -999,9 +999,14 @@ import { execSync as execSync2, execFileSync, spawn, spawnSync } from "child_pro
999
999
  import { join as join2, isAbsolute } from "path";
1000
1000
  import { execSync } from "child_process";
1001
1001
  var INDEX_LOCK_ERROR_PATTERNS = [
1002
+ // 英文错误消息
1002
1003
  /Unable to write.*index/i,
1003
1004
  /index\.lock/i,
1004
- /Unable to create.*index/i
1005
+ /Unable to create.*index/i,
1006
+ // 中文错误消息(Git 本地化)
1007
+ /不能写入索引/,
1008
+ /无法写入.*索引/,
1009
+ /无法创建.*index/i
1005
1010
  ];
1006
1011
  var INDEX_LOCK_PATH_EXTRACT_PATTERN = /'([^']*index\.lock)'/;
1007
1012
  function isGitIndexLockError(errorMessage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawt",
3
- "version": "3.9.2",
3
+ "version": "3.9.3",
4
4
  "description": "本地并行执行多个Claude Code Agent任务,融合 Git Worktree 与 Claude Code CLI 的命令行工具",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -7,11 +7,17 @@ import { MESSAGES } from '../constants/index.js';
7
7
  /**
8
8
  * index.lock 错误的关键词匹配模式
9
9
  * 每个模式同时要求包含 index 关键词,避免 "Unable to write" 单独匹配导致误报
10
+ * 同时支持英文和中文(Git 本地化)错误消息
10
11
  */
11
12
  const INDEX_LOCK_ERROR_PATTERNS = [
13
+ // 英文错误消息
12
14
  /Unable to write.*index/i,
13
15
  /index\.lock/i,
14
16
  /Unable to create.*index/i,
17
+ // 中文错误消息(Git 本地化)
18
+ /不能写入索引/,
19
+ /无法写入.*索引/,
20
+ /无法创建.*index/i,
15
21
  ];
16
22
 
17
23
  /** 从 Git 错误消息中提取 index.lock 文件路径的正则(路径被 ASCII 单引号包裹) */
@@ -76,6 +76,18 @@ describe('isGitIndexLockError', () => {
76
76
  it('大小写不敏感匹配 "unable to write"', () => {
77
77
  expect(isGitIndexLockError('FATAL: UNABLE TO WRITE INDEX.')).toBe(true);
78
78
  });
79
+
80
+ it('检测中文 "不能写入索引" 错误', () => {
81
+ expect(isGitIndexLockError('致命错误:不能写入索引。')).toBe(true);
82
+ });
83
+
84
+ it('检测中文 "无法写入索引" 错误', () => {
85
+ expect(isGitIndexLockError('致命错误:无法写入新索引文件')).toBe(true);
86
+ });
87
+
88
+ it('检测中文 "无法创建 index.lock" 错误', () => {
89
+ expect(isGitIndexLockError("致命错误:无法创建 '/repo/.git/index.lock':文件已存在")).toBe(true);
90
+ });
79
91
  });
80
92
 
81
93
  describe('findGitIndexLockPath', () => {