aient 1.1.36__py3-none-any.whl → 1.1.38__py3-none-any.whl

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.
@@ -48,6 +48,9 @@ Example: Requesting to write to frontend-config.json
48
48
  if content.startswith("##") and (path.endswith(".md") or path.endswith(".txt")):
49
49
  content = "\n\n" + content
50
50
 
51
+ if content.startswith("---\n") and (path.endswith(".md") or path.endswith(".txt")):
52
+ content = "\n" + content
53
+
51
54
  # 写入文件
52
55
  try:
53
56
  with open(path, mode, encoding='utf-8') as file:
aient/utils/scripts.py CHANGED
@@ -241,11 +241,11 @@ import fnmatch
241
241
  # 从环境变量 'SANDBOX_READONLY_PATHS' 读取只读路径列表(可以是文件或目录)。
242
242
  # 示例: export SANDBOX_READONLY_PATHS="/path/to/file.txt:/path/to/dir"
243
243
  readonly_paths_str = os.getenv('SANDBOX_READONLY_PATHS', '')
244
- READONLY_PATHS = [p for p in readonly_paths_str.split(os.pathsep) if p]
244
+ READONLY_PATHS = [p for p in readonly_paths_str.split(':') if p]
245
245
 
246
246
  # 新增: 从环境变量 'SANDBOX_NO_READ_PATHS' 读取禁止读取的路径列表
247
247
  no_read_paths_str = os.getenv('SANDBOX_NO_READ_PATHS', '')
248
- NO_READ_PATHS = [p for p in no_read_paths_str.split(os.pathsep) if p]
248
+ NO_READ_PATHS = [p for p in no_read_paths_str.split(':') if p]
249
249
 
250
250
  # --- 子进程注入代码 (更智能的版本) ---
251
251
  INJECTION_CODE = """
@@ -258,12 +258,12 @@ import fnmatch
258
258
  # 1. 从环境变量中获取沙箱规则并设置补丁
259
259
  # 子进程从和父进程完全相同的环境变量中读取配置
260
260
  readonly_paths_str = os.getenv('SANDBOX_READONLY_PATHS', '')
261
- readonly_paths = [os.path.abspath(p) for p in readonly_paths_str.split(os.pathsep) if p]
261
+ readonly_paths = [os.path.abspath(p) for p in readonly_paths_str.split(':') if p]
262
262
 
263
263
  # 优先使用执行命令专用的禁止读取路径
264
264
  no_read_paths_str = os.getenv('SANDBOX_EXEC_NO_READ_PATHS', '/**/*beswarm*/**')
265
265
 
266
- no_read_paths = [os.path.abspath(p) for p in no_read_paths_str.split(os.pathsep) if p]
266
+ no_read_paths = [os.path.abspath(p) for p in no_read_paths_str.split(':') if p]
267
267
  original_open = builtins.open
268
268
 
269
269
  def _is_path_protected(target_path):
@@ -418,7 +418,7 @@ class Sandbox:
418
418
 
419
419
  def _update_env_var(self, var_name, path_list):
420
420
  """辅助函数,用于更新环境变量,确保子进程能继承最新的沙箱规则。"""
421
- os.environ[var_name] = os.pathsep.join(path_list)
421
+ os.environ[var_name] = ':'.join(path_list)
422
422
 
423
423
  def add_readonly_path(self, path: str):
424
424
  """动态添加一个新的只读路径。如果沙箱因此从非激活状态变为激活状态,则会启用沙箱。"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.36
3
+ Version: 1.1.38
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -33,12 +33,12 @@ aient/plugins/readonly.py,sha256=qK5-kBM3NDH1b-otFxFHpAjV5BXEY_e7cTWBcpP7G5k,710
33
33
  aient/plugins/registry.py,sha256=YknzhieU_8nQ3oKlUSSWDB4X7t2Jx0JnqT2Jd9Xsvfk,3574
34
34
  aient/plugins/run_python.py,sha256=MohvdtZUTDLrHBDtJ9L2_Qu1pWAGrkbzsGmmn5tMN20,4614
35
35
  aient/plugins/websearch.py,sha256=FsUxM9GL4AAjmYJ8TS2jSqv4qfCAoOkCQZH59whtAXk,15304
36
- aient/plugins/write_file.py,sha256=7spYxloI_aUbeANEQK-oXrGPoBqSfsD7sdfMAWlNxhU,3656
36
+ aient/plugins/write_file.py,sha256=hExFLuoNPtjYxJI3pVbofZRpokvUabpXdEkd3mZJPPc,3778
37
37
  aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
39
- aient/utils/scripts.py,sha256=_43DEeoaiNVSA7ew1UUmp-gIV6XXe6rQPc2HTRuTzkw,40944
40
- aient-1.1.36.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
- aient-1.1.36.dist-info/METADATA,sha256=u-UNrKVDoYOocUU5VF-hi72Ej0bahPyP8SUKkj24LPU,4968
42
- aient-1.1.36.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- aient-1.1.36.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
- aient-1.1.36.dist-info/RECORD,,
39
+ aient/utils/scripts.py,sha256=h7EA2xBydUF_wdZLsPgjCq4Egdycx1gf2qrdrm0I7y0,40909
40
+ aient-1.1.38.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
+ aient-1.1.38.dist-info/METADATA,sha256=38zEAQdCebE6fWq7cMpup-k5yuPu1o73dXd7uOqAo8M,4968
42
+ aient-1.1.38.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
+ aient-1.1.38.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
+ aient-1.1.38.dist-info/RECORD,,
File without changes