@tencent-ai/codebuddy-code 2.107.0 → 2.108.0

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": "@tencent-ai/codebuddy-code",
3
- "version": "2.107.0",
3
+ "version": "2.108.0",
4
4
  "description": "Use CodeBuddy, Tencent's AI assistant, right from your terminal. CodeBuddy can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.",
5
5
  "main": "lib/node/index.js",
6
6
  "typings": "lib/node/index.d.ts",
@@ -814,6 +814,6 @@
814
814
  "SelectImage": true,
815
815
  "SkipToolCallSupportCheck": true
816
816
  },
817
- "commit": "f9310f2ab0f56f757d14e3134384f5d92bde70f3",
818
- "date": "2026-06-17T14:39:57.886Z"
817
+ "commit": "9af02dff1911a67fdd05b518f8ed01dd0d1c80e6",
818
+ "date": "2026-06-18T04:20:37.806Z"
819
819
  }
@@ -693,6 +693,6 @@
693
693
  }
694
694
  }
695
695
  },
696
- "commit": "f9310f2ab0f56f757d14e3134384f5d92bde70f3",
697
- "date": "2026-06-17T14:39:57.871Z"
696
+ "commit": "9af02dff1911a67fdd05b518f8ed01dd0d1c80e6",
697
+ "date": "2026-06-18T04:20:37.783Z"
698
698
  }
package/product.ioa.json CHANGED
@@ -1075,6 +1075,6 @@
1075
1075
  }
1076
1076
  }
1077
1077
  },
1078
- "commit": "f9310f2ab0f56f757d14e3134384f5d92bde70f3",
1079
- "date": "2026-06-17T14:39:57.827Z"
1078
+ "commit": "9af02dff1911a67fdd05b518f8ed01dd0d1c80e6",
1079
+ "date": "2026-06-18T04:20:37.795Z"
1080
1080
  }
package/product.json CHANGED
@@ -1738,6 +1738,6 @@
1738
1738
  "deferLoading": true
1739
1739
  }
1740
1740
  ],
1741
- "commit": "f9310f2ab0f56f757d14e3134384f5d92bde70f3",
1742
- "date": "2026-06-17T14:39:57.770Z"
1741
+ "commit": "9af02dff1911a67fdd05b518f8ed01dd0d1c80e6",
1742
+ "date": "2026-06-18T04:20:37.819Z"
1743
1743
  }
@@ -329,6 +329,6 @@
329
329
  "ScheduledTasks": true,
330
330
  "SkipToolCallSupportCheck": true
331
331
  },
332
- "commit": "f9310f2ab0f56f757d14e3134384f5d92bde70f3",
333
- "date": "2026-06-17T14:39:57.784Z"
332
+ "commit": "9af02dff1911a67fdd05b518f8ed01dd0d1c80e6",
333
+ "date": "2026-06-18T04:20:37.796Z"
334
334
  }
@@ -35,6 +35,25 @@ if (!SESSION_ID) {
35
35
  // ---------------------------------------------------------------------------
36
36
 
37
37
  const PLATFORM = process.platform; // 'darwin' | 'win32' | 'linux' | ...
38
+ const REPORT_PATH = process.env.CODEBUDDY_SAFE_DELETE_REPORT_PATH;
39
+
40
+ function recordTrash(absPath) {
41
+ if (!REPORT_PATH) return;
42
+ try {
43
+ fs.appendFileSync(
44
+ REPORT_PATH,
45
+ JSON.stringify({
46
+ operation: 'trash',
47
+ runtime: 'node',
48
+ path: absPath,
49
+ timestamp: Date.now(),
50
+ }) + '\n',
51
+ 'utf8',
52
+ );
53
+ } catch (_) {
54
+ // Reporting is best-effort and must never change delete semantics.
55
+ }
56
+ }
38
57
 
39
58
  // ---------------------------------------------------------------------------
40
59
  // 平台分发
@@ -355,6 +374,7 @@ function writeTrashInfo(absPath, baseName) {
355
374
  */
356
375
  function tryTrash(absPath) {
357
376
  trashItem(absPath); // 成功静默;失败抛错,调用方不应继续真删
377
+ recordTrash(absPath);
358
378
  return true;
359
379
  }
360
380
 
@@ -35,6 +35,16 @@ safe_delete_json_string() {
35
35
  printf '"%s"' "$escaped"
36
36
  }
37
37
 
38
+ safe_delete_record_trash() {
39
+ local p="$1"
40
+ [ -n "${CODEBUDDY_SAFE_DELETE_REPORT_PATH:-}" ] || return 0
41
+ local path_json timestamp
42
+ path_json="$(safe_delete_json_string "$p")"
43
+ timestamp="$(date +%s 2>/dev/null || printf '0')"
44
+ printf '{"operation":"trash","runtime":"bash","path":%s,"timestamp":%s}\n' \
45
+ "$path_json" "$timestamp" >> "$CODEBUDDY_SAFE_DELETE_REPORT_PATH" 2>/dev/null || true
46
+ }
47
+
38
48
  is_dir_empty() {
39
49
  local p="$1"
40
50
  [ -z "$(ls -A "$p" 2>/dev/null)" ]
@@ -250,7 +260,13 @@ trash_one() {
250
260
 
251
261
  try_trash() {
252
262
  local p="$1"
263
+ local abs="$p"
264
+ case "$abs" in
265
+ /*|[A-Za-z]:/*) ;;
266
+ *) abs="$PWD/$abs" ;;
267
+ esac
253
268
  if trash_one "$p"; then
269
+ safe_delete_record_trash "$abs"
254
270
  return 0
255
271
  fi
256
272
  local target_json trash_bin_json genie_trash_dir_json
@@ -17,6 +17,7 @@ import json
17
17
  import os
18
18
  import stat
19
19
  import sys
20
+ import time
20
21
 
21
22
  # ---------------------------------------------------------------------------
22
23
  # 触发条件
@@ -272,6 +273,21 @@ if _SESSION_ID:
272
273
  _orig_shutil_rmtree = shutil.rmtree
273
274
  _orig_path_unlink = pathlib.Path.unlink
274
275
  _orig_path_rmdir = pathlib.Path.rmdir
276
+ _report_path = os.environ.get("CODEBUDDY_SAFE_DELETE_REPORT_PATH")
277
+
278
+ def _record_trash(abs_path):
279
+ if not _report_path:
280
+ return
281
+ try:
282
+ with open(_report_path, "a", encoding="utf-8") as f:
283
+ f.write(json.dumps({
284
+ "operation": "trash",
285
+ "runtime": "python",
286
+ "path": abs_path,
287
+ "timestamp": int(time.time() * 1000),
288
+ }, ensure_ascii=False, separators=(",", ":")) + "\n")
289
+ except Exception:
290
+ pass
275
291
 
276
292
  # -----------------------------------------------------------------------
277
293
  # genie-trash native binary 支持(优先路径,不可用自动降级)
@@ -351,8 +367,10 @@ if _SESSION_ID:
351
367
  pass
352
368
  raise OSError(message)
353
369
  if _try_trash_via_binary(abs_path):
370
+ _record_trash(abs_path)
354
371
  return True
355
372
  _platform_trash(abs_path)
373
+ _record_trash(abs_path)
356
374
  return True
357
375
 
358
376
  def _safe_lstat(abs_path):