@tencent-ai/agent-sdk 0.3.190 → 0.3.191

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.
Files changed (48) hide show
  1. package/cli/CHANGELOG.md +37 -0
  2. package/cli/dist/codebuddy-headless.js +248 -213
  3. package/cli/dist/web-ui/docs/cn/cli/cli-reference.md +2 -0
  4. package/cli/dist/web-ui/docs/cn/cli/common-workflows.md +1 -2
  5. package/cli/dist/web-ui/docs/cn/cli/costs.md +1 -1
  6. package/cli/dist/web-ui/docs/cn/cli/hooks.md +32 -0
  7. package/cli/dist/web-ui/docs/cn/cli/installation.md +7 -1
  8. package/cli/dist/web-ui/docs/cn/cli/interactive-mode.md +16 -8
  9. package/cli/dist/web-ui/docs/cn/cli/keybindings.md +2 -2
  10. package/cli/dist/web-ui/docs/cn/cli/permission-modes.md +2 -1
  11. package/cli/dist/web-ui/docs/cn/cli/quickstart.md +3 -4
  12. package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +4 -0
  13. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.109.1.md +21 -0
  14. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.109.2.md +21 -0
  15. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.109.3.md +23 -0
  16. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.110.0.md +39 -0
  17. package/cli/dist/web-ui/docs/cn/cli/slash-commands.md +5 -0
  18. package/cli/dist/web-ui/docs/cn/cli/troubleshooting.md +93 -0
  19. package/cli/dist/web-ui/docs/en/cli/cli-reference.md +2 -0
  20. package/cli/dist/web-ui/docs/en/cli/common-workflows.md +1 -2
  21. package/cli/dist/web-ui/docs/en/cli/costs.md +2 -2
  22. package/cli/dist/web-ui/docs/en/cli/hooks.md +35 -3
  23. package/cli/dist/web-ui/docs/en/cli/installation.md +6 -0
  24. package/cli/dist/web-ui/docs/en/cli/interactive-mode.md +17 -9
  25. package/cli/dist/web-ui/docs/en/cli/keybindings.md +2 -2
  26. package/cli/dist/web-ui/docs/en/cli/permission-modes.md +2 -1
  27. package/cli/dist/web-ui/docs/en/cli/quickstart.md +3 -4
  28. package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +9 -5
  29. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.109.1.md +21 -0
  30. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.109.2.md +21 -0
  31. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.109.3.md +23 -0
  32. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.110.0.md +39 -0
  33. package/cli/dist/web-ui/docs/en/cli/slash-commands.md +5 -0
  34. package/cli/dist/web-ui/docs/en/cli/troubleshooting.md +93 -0
  35. package/cli/dist/web-ui/docs/search-index-en.json +1 -1
  36. package/cli/dist/web-ui/docs/search-index-zh.json +1 -1
  37. package/cli/dist/web-ui/docs/sidebar-en.json +1 -1
  38. package/cli/dist/web-ui/docs/sidebar-zh.json +1 -1
  39. package/cli/package.json +1 -1
  40. package/cli/product.cloudhosted.json +2 -2
  41. package/cli/product.internal.json +2 -2
  42. package/cli/product.ioa.json +2 -2
  43. package/cli/product.json +3 -3
  44. package/cli/product.selfhosted.json +2 -2
  45. package/cli/vendor/shim/genie-safe-delete.cjs +50 -7
  46. package/cli/vendor/shim/safe-bin/safe-delete-common.sh +30 -11
  47. package/cli/vendor/shim/sitecustomize.py +20 -6
  48. package/package.json +1 -1
@@ -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_backup_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("~"):
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_backup_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_backup_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_backup_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_backup_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_backup_dir(abs_path):
574
588
  return _orig_path_rmdir(self)
575
589
  st = _safe_lstat(abs_path)
576
590
  if not st:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencent-ai/agent-sdk",
3
- "version": "0.3.190",
3
+ "version": "0.3.191",
4
4
  "description": "CodeBuddy Code SDK for JavaScript/TypeScript",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",