@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/CHANGELOG.md +11 -0
- package/dist/codebuddy-headless.js +81 -59
- package/dist/codebuddy.js +75 -53
- package/package.json +1 -1
- package/product.cloudhosted.json +2 -2
- package/product.internal.json +2 -2
- package/product.ioa.json +2 -2
- package/product.json +2 -2
- package/product.selfhosted.json +2 -2
- package/vendor/shim/genie-safe-delete.cjs +20 -0
- package/vendor/shim/safe-bin/safe-delete-common.sh +16 -0
- package/vendor/shim/sitecustomize.py +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencent-ai/codebuddy-code",
|
|
3
|
-
"version": "2.
|
|
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",
|
package/product.cloudhosted.json
CHANGED
|
@@ -814,6 +814,6 @@
|
|
|
814
814
|
"SelectImage": true,
|
|
815
815
|
"SkipToolCallSupportCheck": true
|
|
816
816
|
},
|
|
817
|
-
"commit": "
|
|
818
|
-
"date": "2026-06-
|
|
817
|
+
"commit": "9af02dff1911a67fdd05b518f8ed01dd0d1c80e6",
|
|
818
|
+
"date": "2026-06-18T04:20:37.806Z"
|
|
819
819
|
}
|
package/product.internal.json
CHANGED
package/product.ioa.json
CHANGED
package/product.json
CHANGED
package/product.selfhosted.json
CHANGED
|
@@ -329,6 +329,6 @@
|
|
|
329
329
|
"ScheduledTasks": true,
|
|
330
330
|
"SkipToolCallSupportCheck": true
|
|
331
331
|
},
|
|
332
|
-
"commit": "
|
|
333
|
-
"date": "2026-06-
|
|
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):
|