beswarm 0.1.68__py3-none-any.whl → 0.1.70__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.
beswarm/aient/setup.py CHANGED
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
4
4
 
5
5
  setup(
6
6
  name="aient",
7
- version="1.1.20",
7
+ version="1.1.21",
8
8
  description="Aient: The Awakening of Agent.",
9
9
  long_description=Path.open(Path("README.md"), encoding="utf-8").read(),
10
10
  long_description_content_type="text/markdown",
@@ -178,13 +178,13 @@ def excute_command(command):
178
178
  if line.strip() == "":
179
179
  continue
180
180
  # aaa = last_line.strip()
181
- is_same = compare_line(repr(line.strip()))
182
- if not is_same:
183
- # print(f"{repr(aaa)}", flush=True)
184
- # print(f"{repr(line.strip())}", flush=True)
185
- # print(f"is_same: {is_same}", flush=True)
186
- # print(f"\n\n\n", flush=True)
187
- new_output_lines.append(line)
181
+ # is_same = compare_line(repr(line.strip()))
182
+ # if not is_same:
183
+ # # print(f"{repr(aaa)}", flush=True)
184
+ # # print(f"{repr(line.strip())}", flush=True)
185
+ # # print(f"is_same: {is_same}", flush=True)
186
+ # # print(f"\n\n\n", flush=True)
187
+ new_output_lines.append(line)
188
188
  # 限制输出行数
189
189
  if len(new_output_lines) > 500:
190
190
  new_output_lines = new_output_lines[:250] + new_output_lines[-250:]
@@ -5,23 +5,27 @@ from ..aient.src.aient.plugins import register_tool
5
5
  @register_tool()
6
6
  def edit_file(file_path, diff_content, match_precision=0.8):
7
7
  """
8
- 使用diff模式编辑代码文件,支持Git的diff格式,每次修改一处。
9
- 你应该清楚地表明编辑内容,同时最小化你写的未更改代码。
10
- 你仍应倾向于尽可能少地重复原始文件的行来传达更改。
11
- 但是,编辑应包含足够的未更改行上下文,以消除你正在编辑的代码的歧义。
8
+ 使用diff模式编辑代码文件。**重要:此函数每次调用只能对文件进行一处修改。**
12
9
 
13
- 参数:
14
- file_path: 要编辑的文件路径
15
- diff_content: diff内容,格式为:
10
+ 你需要提供一个diff块来指定要修改的内容,格式如下:
16
11
  <<<<<<< SEARCH
17
- 原始代码
12
+ 要被替换的原始代码
18
13
  =======
19
- 替换代码
14
+ 新的代码
20
15
  >>>>>>> REPLACE
21
- match_precision: 匹配精度 (0.0-1.0),值越高要求匹配越精确,默认0.8
16
+
17
+ **使用规则:**
18
+ 1. **单次修改:** `diff_content`参数中**必须只包含一个** `<<<<<<< SEARCH ... >>>>>>> REPLACE` 块。如果检测到多个块,函数将返回错误。
19
+ 2. **上下文:** `SEARCH`块中的原始代码应包含足够的上下文,以确保在文件中能够唯一地定位到修改点,但也要尽量简洁。
20
+ 3. **精确性:** `SEARCH`块中的内容需要与文件中的代码精确匹配(包括缩进和换行符)。如果无法精确匹配,函数会尝试模糊匹配。
21
+
22
+ 参数:
23
+ file_path: 要编辑的文件路径。
24
+ diff_content: 包含单次修改信息的diff字符串,格式必须符合上述要求。
25
+ match_precision: 匹配精度 (0.0-1.0),值越高要求匹配越精确,默认0.8。当完全精确匹配失败时,此参数生效。
22
26
 
23
27
  返回:
24
- 编辑结果的状态信息,包括成功或错误信息
28
+ 编辑结果的状态信息,包括成功或错误信息。
25
29
  """
26
30
  try:
27
31
  # 检查文件是否存在
beswarm/tools/worker.py CHANGED
@@ -137,7 +137,7 @@ async def worker(goal, tools, work_dir, cache_messages=None):
137
137
  next_instruction = await instruction_agent_task()
138
138
 
139
139
  # 检查任务是否完成
140
- if "任务已完成" in next_instruction:
140
+ if "任务已完成" in next_instruction and len(next_instruction) < 10:
141
141
  print("\n✅ 任务已完成!")
142
142
  break
143
143
  if "find_and_click_element" in str(tools_json):
@@ -265,7 +265,7 @@ async def worker_gen(goal, tools, work_dir, cache_messages=None):
265
265
  yield {"user": next_instruction}
266
266
 
267
267
  # 检查任务是否完成
268
- if "任务已完成" in next_instruction:
268
+ if "任务已完成" in next_instruction and len(next_instruction) < 10:
269
269
  print("\n✅ 任务已完成!")
270
270
  break
271
271
  if "find_and_click_element" in str(tools_json):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.1.68
3
+ Version: 0.1.70
4
4
  Summary: MAS
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,7 +1,7 @@
1
1
  beswarm/__init__.py,sha256=HZjUOJtZR5QhMuDbq-wukQQn1VrBusNWai_ysGo-VVI,20
2
2
  beswarm/utils.py,sha256=Z2Kuus2BLp9EHUC2ZNL9iUsb6NWnPj-MTA7SYzGyg24,1755
3
3
  beswarm/aient/main.py,sha256=SiYAIgQlLJqYusnTVEJOx1WNkSJKMImhgn5aWjfroxg,3814
4
- beswarm/aient/setup.py,sha256=jQ5DUcJ18TvQ4Dn8B4Q-ATQKYCxTdIqgBDZAhUAL3ak,487
4
+ beswarm/aient/setup.py,sha256=qAA0xNh-3PrTMh8w92_J3i6ezKq9SQjNdo-9zPVcxJk,487
5
5
  beswarm/aient/src/aient/__init__.py,sha256=SRfF7oDVlOOAi6nGKiJIUK6B_arqYLO9iSMp-2IZZps,21
6
6
  beswarm/aient/src/aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeACe8KvHJnjPg,34
7
7
  beswarm/aient/src/aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
@@ -25,7 +25,7 @@ beswarm/aient/src/aient/models/vertex.py,sha256=qVD5l1Q538xXUPulxG4nmDjXE1VoV4yu
25
25
  beswarm/aient/src/aient/plugins/__init__.py,sha256=p3KO6Aa3Lupos4i2SjzLQw1hzQTigOAfEHngsldrsyk,986
26
26
  beswarm/aient/src/aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
27
27
  beswarm/aient/src/aient/plugins/config.py,sha256=Vp6CG9ocdC_FAlCMEGtKj45xamir76DFxdJVvURNtog,6539
28
- beswarm/aient/src/aient/plugins/excute_command.py,sha256=9t7RB8ikltZZRv8NcjoxfaD8FkPuWbJTZ2Vwk7hEwTA,10683
28
+ beswarm/aient/src/aient/plugins/excute_command.py,sha256=i5AUSfnYe05cS4YZuNIhuCy-Cfxil7RJG372YwzteXs,10691
29
29
  beswarm/aient/src/aient/plugins/get_time.py,sha256=Ih5XIW5SDAIhrZ9W4Qe5Hs1k4ieKPUc_LAd6ySNyqZk,654
30
30
  beswarm/aient/src/aient/plugins/image.py,sha256=ZElCIaZznE06TN9xW3DrSukS7U3A5_cjk1Jge4NzPxw,2072
31
31
  beswarm/aient/src/aient/plugins/list_directory.py,sha256=JZVuImecMSfEv6jLqii-0uQJ1UCsrpMNmYlwW3PEDg4,1374
@@ -121,15 +121,15 @@ beswarm/queries/tree-sitter-languages/scala-tags.scm,sha256=UxQjz80JIrrJ7Pm56uUn
121
121
  beswarm/queries/tree-sitter-languages/typescript-tags.scm,sha256=OMdCeedPiA24ky82DpgTMKXK_l2ySTuF2zrQ2fJAi9E,1253
122
122
  beswarm/tools/__init__.py,sha256=IJExt6D58d2yxBOjHVC6wYGhV7Pb7okmX61RvyqSCSY,1150
123
123
  beswarm/tools/click.py,sha256=TygaekCXTmU3fIu6Uom7ZcyzEgYMlCC_GX-5SmWHuLI,20762
124
- beswarm/tools/edit_file.py,sha256=xlAD0HB_xM0yZYc0eJwLE-9mAkywXa2UQPNHzG1OaW4,7664
124
+ beswarm/tools/edit_file.py,sha256=hxyVLiyndInX6hUeXwvX5u1mC3sq3cp8E-Q8UYy5Ffo,8145
125
125
  beswarm/tools/planner.py,sha256=lguBCS6kpwNPoXQvqH-WySabVubT82iyWOkJnjt6dXw,1265
126
126
  beswarm/tools/repomap.py,sha256=N09K0UgwjCN7Zjg_5TYlVsulp3n2fztYlS8twalChU8,45003
127
127
  beswarm/tools/screenshot.py,sha256=u6t8FCgW5YHJ_Oc4coo8e0F3wTusWE_-H8dFh1rBq9Q,1011
128
128
  beswarm/tools/search_arxiv.py,sha256=9slwBemXjEqrd7-YgVmyMijPXlkhZCybEDRVhWVQ9B0,7937
129
129
  beswarm/tools/search_web.py,sha256=B24amOnGHnmdV_6S8bw8O2PdhZRRIDtJjg-wXcfP7dQ,11859
130
130
  beswarm/tools/think.py,sha256=WLw-7jNIsnS6n8MMSYUin_f-BGLENFmnKM2LISEp0co,1760
131
- beswarm/tools/worker.py,sha256=qu6Bchk1CmAudNzJSKLQGjInXNAWMOd_tkM6rDUh7qg,12847
132
- beswarm-0.1.68.dist-info/METADATA,sha256=2KbalF-OUeHWSIUGTPsX1y06Da2Jcm6yonrRxHG-TyI,3553
133
- beswarm-0.1.68.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
134
- beswarm-0.1.68.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
135
- beswarm-0.1.68.dist-info/RECORD,,
131
+ beswarm/tools/worker.py,sha256=DLYzMgKzpf4UYGNKKJix__DHw6LHtX_T9CLVaexDQMg,12909
132
+ beswarm-0.1.70.dist-info/METADATA,sha256=bP0bacAMHQsIyrQd73s3e-ldVJhZIO9Oxu6-5B_9L5w,3553
133
+ beswarm-0.1.70.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
134
+ beswarm-0.1.70.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
135
+ beswarm-0.1.70.dist-info/RECORD,,