@tencent-ai/agent-sdk 0.3.190 → 0.3.192
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/cli/CHANGELOG.md +55 -0
- package/cli/dist/codebuddy-headless.js +267 -232
- package/cli/dist/web-ui/docs/cn/cli/cli-reference.md +2 -0
- package/cli/dist/web-ui/docs/cn/cli/common-workflows.md +1 -2
- package/cli/dist/web-ui/docs/cn/cli/costs.md +1 -1
- package/cli/dist/web-ui/docs/cn/cli/hooks.md +32 -0
- package/cli/dist/web-ui/docs/cn/cli/installation.md +7 -1
- package/cli/dist/web-ui/docs/cn/cli/interactive-mode.md +16 -8
- package/cli/dist/web-ui/docs/cn/cli/keybindings.md +2 -2
- package/cli/dist/web-ui/docs/cn/cli/permission-modes.md +2 -1
- package/cli/dist/web-ui/docs/cn/cli/quickstart.md +3 -4
- package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +4 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.109.1.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.109.2.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.109.3.md +23 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.110.0.md +39 -0
- package/cli/dist/web-ui/docs/cn/cli/slash-commands.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/troubleshooting.md +93 -0
- package/cli/dist/web-ui/docs/en/cli/cli-reference.md +2 -0
- package/cli/dist/web-ui/docs/en/cli/common-workflows.md +1 -2
- package/cli/dist/web-ui/docs/en/cli/costs.md +2 -2
- package/cli/dist/web-ui/docs/en/cli/hooks.md +35 -3
- package/cli/dist/web-ui/docs/en/cli/installation.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/interactive-mode.md +17 -9
- package/cli/dist/web-ui/docs/en/cli/keybindings.md +2 -2
- package/cli/dist/web-ui/docs/en/cli/permission-modes.md +2 -1
- package/cli/dist/web-ui/docs/en/cli/quickstart.md +3 -4
- package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +9 -5
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.109.1.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.109.2.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.109.3.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.110.0.md +39 -0
- package/cli/dist/web-ui/docs/en/cli/slash-commands.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/troubleshooting.md +93 -0
- package/cli/dist/web-ui/docs/search-index-en.json +1 -1
- package/cli/dist/web-ui/docs/search-index-zh.json +1 -1
- package/cli/dist/web-ui/docs/sidebar-en.json +1 -1
- package/cli/dist/web-ui/docs/sidebar-zh.json +1 -1
- package/cli/package.json +1 -1
- package/cli/product.cloudhosted.json +2 -2
- package/cli/product.internal.json +2 -2
- package/cli/product.ioa.json +12 -5
- package/cli/product.json +13 -6
- package/cli/product.selfhosted.json +2 -2
- package/cli/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/cli/vendor/shim/genie-safe-delete.cjs +99 -7
- package/cli/vendor/shim/safe-bin/safe-delete-common.sh +30 -11
- package/cli/vendor/shim/sitecustomize.py +20 -6
- package/package.json +1 -1
|
@@ -72,6 +72,11 @@ safe_delete_normalize_path() {
|
|
|
72
72
|
while [ "$p" != "/" ] && [ "${p%/}" != "$p" ]; do
|
|
73
73
|
p="${p%/}"
|
|
74
74
|
done
|
|
75
|
+
case "$OS" in
|
|
76
|
+
MINGW*|MSYS*|CYGWIN*)
|
|
77
|
+
p="$(printf '%s' "$p" | tr '[:upper:]' '[:lower:]')"
|
|
78
|
+
;;
|
|
79
|
+
esac
|
|
75
80
|
printf '%s' "$p"
|
|
76
81
|
}
|
|
77
82
|
|
|
@@ -456,9 +461,7 @@ safe_delete_rm() {
|
|
|
456
461
|
_exit=1
|
|
457
462
|
fi
|
|
458
463
|
done
|
|
459
|
-
|
|
460
|
-
return 1
|
|
461
|
-
fi
|
|
464
|
+
local guarded_targets=()
|
|
462
465
|
for p in "${trash_targets[@]}"; do
|
|
463
466
|
if safe_delete_is_under_os_tmp_dir "$p"; then
|
|
464
467
|
local native_args=()
|
|
@@ -468,7 +471,16 @@ safe_delete_rm() {
|
|
|
468
471
|
if ! "$REAL_RM" "${native_args[@]}" -- "$p"; then
|
|
469
472
|
_exit=1
|
|
470
473
|
fi
|
|
471
|
-
|
|
474
|
+
else
|
|
475
|
+
guarded_targets+=("$p")
|
|
476
|
+
fi
|
|
477
|
+
done
|
|
478
|
+
|
|
479
|
+
if ! safe_delete_bulk_guard_check "${guarded_targets[@]}"; then
|
|
480
|
+
return 1
|
|
481
|
+
fi
|
|
482
|
+
for p in "${guarded_targets[@]}"; do
|
|
483
|
+
if ! try_trash "$p"; then
|
|
472
484
|
_exit=1
|
|
473
485
|
fi
|
|
474
486
|
done
|
|
@@ -506,13 +518,13 @@ safe_delete_unlink() {
|
|
|
506
518
|
return 1
|
|
507
519
|
fi
|
|
508
520
|
|
|
509
|
-
if ! safe_delete_bulk_guard_check "$target"; then
|
|
510
|
-
return 1
|
|
511
|
-
fi
|
|
512
521
|
if safe_delete_is_under_os_tmp_dir "$target"; then
|
|
513
522
|
"$REAL_UNLINK" -- "$target"
|
|
514
523
|
return $?
|
|
515
524
|
fi
|
|
525
|
+
if ! safe_delete_bulk_guard_check "$target"; then
|
|
526
|
+
return 1
|
|
527
|
+
fi
|
|
516
528
|
|
|
517
529
|
try_trash "$target"
|
|
518
530
|
return $?
|
|
@@ -571,15 +583,22 @@ safe_delete_rmdir() {
|
|
|
571
583
|
fi
|
|
572
584
|
trash_targets+=("$p")
|
|
573
585
|
done
|
|
574
|
-
|
|
575
|
-
return 1
|
|
576
|
-
fi
|
|
586
|
+
local guarded_targets=()
|
|
577
587
|
for p in "${trash_targets[@]}"; do
|
|
578
588
|
if safe_delete_is_under_os_tmp_dir "$p"; then
|
|
579
589
|
if ! "$REAL_RMDIR" -- "$p"; then
|
|
580
590
|
_exit=1
|
|
581
591
|
fi
|
|
582
|
-
|
|
592
|
+
else
|
|
593
|
+
guarded_targets+=("$p")
|
|
594
|
+
fi
|
|
595
|
+
done
|
|
596
|
+
|
|
597
|
+
if ! safe_delete_bulk_guard_check "${guarded_targets[@]}"; then
|
|
598
|
+
return 1
|
|
599
|
+
fi
|
|
600
|
+
for p in "${guarded_targets[@]}"; do
|
|
601
|
+
if ! try_trash "$p"; then
|
|
583
602
|
_exit=1
|
|
584
603
|
fi
|
|
585
604
|
done
|
|
@@ -277,7 +277,7 @@ if _SESSION_ID:
|
|
|
277
277
|
_report_path = os.environ.get("CODEBUDDY_SAFE_DELETE_REPORT_PATH")
|
|
278
278
|
|
|
279
279
|
def _path_for_compare(path):
|
|
280
|
-
return os.path.normcase(os.path.abspath(path))
|
|
280
|
+
return os.path.normcase(os.path.realpath(os.path.abspath(path)))
|
|
281
281
|
|
|
282
282
|
def _is_usable_temp_root(path):
|
|
283
283
|
try:
|
|
@@ -475,6 +475,20 @@ if _SESSION_ID:
|
|
|
475
475
|
return True
|
|
476
476
|
return False
|
|
477
477
|
|
|
478
|
+
def _is_pip_site_packages_temp_dir(abs_path):
|
|
479
|
+
try:
|
|
480
|
+
target = _path_for_compare(os.fsdecode(abs_path))
|
|
481
|
+
except (TypeError, UnicodeError):
|
|
482
|
+
return False
|
|
483
|
+
parts = target.split(os.sep)
|
|
484
|
+
for index, part in enumerate(parts[:-1]):
|
|
485
|
+
if part not in ("site-packages", "dist-packages"):
|
|
486
|
+
continue
|
|
487
|
+
backup_root = parts[index + 1]
|
|
488
|
+
if backup_root.startswith("~") or backup_root.startswith("accesstest_deleteme"):
|
|
489
|
+
return True
|
|
490
|
+
return False
|
|
491
|
+
|
|
478
492
|
# -----------------------------------------------------------------------
|
|
479
493
|
# 包装:os.remove / os.unlink (文件,不能是目录)
|
|
480
494
|
# -----------------------------------------------------------------------
|
|
@@ -484,7 +498,7 @@ if _SESSION_ID:
|
|
|
484
498
|
if dir_fd is not None:
|
|
485
499
|
return _orig_remove(path, dir_fd=dir_fd)
|
|
486
500
|
abs_path = os.path.abspath(os.fspath(path))
|
|
487
|
-
if _is_under_os_tmp_dir(abs_path):
|
|
501
|
+
if _is_under_os_tmp_dir(abs_path) or _is_pip_site_packages_temp_dir(abs_path):
|
|
488
502
|
return _orig_remove(path)
|
|
489
503
|
st = _safe_lstat(abs_path)
|
|
490
504
|
if not st:
|
|
@@ -501,7 +515,7 @@ if _SESSION_ID:
|
|
|
501
515
|
if dir_fd is not None:
|
|
502
516
|
return _orig_rmdir(path, dir_fd=dir_fd)
|
|
503
517
|
abs_path = os.path.abspath(os.fspath(path))
|
|
504
|
-
if _is_under_os_tmp_dir(abs_path):
|
|
518
|
+
if _is_under_os_tmp_dir(abs_path) or _is_pip_site_packages_temp_dir(abs_path):
|
|
505
519
|
return _orig_rmdir(path)
|
|
506
520
|
st = _safe_lstat(abs_path)
|
|
507
521
|
if not st:
|
|
@@ -525,7 +539,7 @@ if _SESSION_ID:
|
|
|
525
539
|
path, ignore_errors=ignore_errors, onerror=onerror, **kwargs
|
|
526
540
|
)
|
|
527
541
|
|
|
528
|
-
if _is_under_os_tmp_dir(abs_path):
|
|
542
|
+
if _is_under_os_tmp_dir(abs_path) or _is_pip_site_packages_temp_dir(abs_path):
|
|
529
543
|
return _orig_shutil_rmtree(
|
|
530
544
|
path, ignore_errors=ignore_errors, onerror=onerror, **kwargs
|
|
531
545
|
)
|
|
@@ -557,7 +571,7 @@ if _SESSION_ID:
|
|
|
557
571
|
|
|
558
572
|
def _safe_path_unlink(self, missing_ok=False):
|
|
559
573
|
abs_path = os.path.abspath(str(self))
|
|
560
|
-
if _is_under_os_tmp_dir(abs_path):
|
|
574
|
+
if _is_under_os_tmp_dir(abs_path) or _is_pip_site_packages_temp_dir(abs_path):
|
|
561
575
|
return _orig_path_unlink(self, missing_ok=missing_ok)
|
|
562
576
|
st = _safe_lstat(abs_path)
|
|
563
577
|
if not st:
|
|
@@ -570,7 +584,7 @@ if _SESSION_ID:
|
|
|
570
584
|
|
|
571
585
|
def _safe_path_rmdir(self):
|
|
572
586
|
abs_path = os.path.abspath(str(self))
|
|
573
|
-
if _is_under_os_tmp_dir(abs_path):
|
|
587
|
+
if _is_under_os_tmp_dir(abs_path) or _is_pip_site_packages_temp_dir(abs_path):
|
|
574
588
|
return _orig_path_rmdir(self)
|
|
575
589
|
st = _safe_lstat(abs_path)
|
|
576
590
|
if not st:
|