adam-community 1.0.6__py3-none-any.whl → 1.0.8__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.
@@ -1 +1 @@
1
- __version__ = "1.0.6"
1
+ __version__ = "1.0.8"
@@ -263,6 +263,31 @@ def validate_description_length(description: str, function_name: str, file_path:
263
263
  f"超过了1024字符限制。请缩短描述长度。"
264
264
  )
265
265
 
266
+ def _inherits_from_tool(class_node: ast.ClassDef) -> bool:
267
+ """检查类是否继承了 adam_community.Tool
268
+
269
+ Args:
270
+ class_node: AST 类定义节点
271
+
272
+ Returns:
273
+ bool: 如果类继承了 adam_community.Tool 则返回 True,否则返回 False
274
+ """
275
+ for base in class_node.bases:
276
+ if isinstance(base, ast.Name):
277
+ # 直接继承 Tool 类
278
+ if base.id == 'Tool':
279
+ return True
280
+ elif isinstance(base, ast.Attribute):
281
+ # 继承 adam_community.Tool 或类似的形式
282
+ if (isinstance(base.value, ast.Name) and
283
+ base.value.id == 'adam_community' and
284
+ base.attr == 'Tool'):
285
+ return True
286
+ # 继承 Tool 类(可能是通过 from adam_community import Tool 导入的)
287
+ if base.attr == 'Tool':
288
+ return True
289
+ return False
290
+
266
291
  def parse_python_file(file_path: Path) -> List[Dict[str, Any]]:
267
292
  """解析单个 Python 文件,提取类信息
268
293
 
@@ -281,6 +306,10 @@ def parse_python_file(file_path: Path) -> List[Dict[str, Any]]:
281
306
 
282
307
  for node in ast.walk(tree):
283
308
  if isinstance(node, ast.ClassDef):
309
+ # 检查类是否继承了 adam_community.Tool
310
+ if not _inherits_from_tool(node):
311
+ continue
312
+
284
313
  # 获取类的文档字符串
285
314
  docstring = ast.get_docstring(node) or ""
286
315
 
@@ -51,7 +51,7 @@ echo "结果: {result}" >> output.txt
51
51
  echo "处理完成,结果已保存到 output.txt"
52
52
  '''
53
53
 
54
- return bash_script
54
+ return runCmd(bash_script)
55
55
 
56
56
  def outputShow(self, kwargs):
57
57
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: adam_community
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: Adam Community Tools and Utilities
5
5
  Home-page: https://github.com/yourusername/adam-community
6
6
  Author: Adam Community
@@ -1,12 +1,12 @@
1
1
  adam_community/__init__.py,sha256=vAmF9VQR6D4peppH0hnrHDmZK5cFeFPh11GIsTKUXhE,429
2
- adam_community/__version__.py,sha256=mqMuQB3aqJVPrHHqJMLjqiMKUiJjozc7EPLcX5DpKHg,22
2
+ adam_community/__version__.py,sha256=NND_6JDYnYnGzN3-RTpS5F7wzv62vDf7hAxiyTSBJfE,22
3
3
  adam_community/tool.py,sha256=CCzWosxtuZ0yk7mupmnlgMpO59jr1hl-a_brSGIqhDI,4867
4
4
  adam_community/util.py,sha256=W4SD4x-Tg_JVAINoi2Q2j5FqbWrQxvg0TRYfE9Yh2WI,11031
5
5
  adam_community/cli/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
6
6
  adam_community/cli/build.py,sha256=qs7DGTanMrs0ZH-oqLIzbm2ArkKssDrzdS2pJnd877E,10699
7
7
  adam_community/cli/cli.py,sha256=L_V09KMWuasgdce6zrB2yNOpCl8G7k7C_oKWvLEzS5k,2810
8
8
  adam_community/cli/init.py,sha256=ukdIXm1V75xRDWRnQaiKRhkmGDGKp4GASQjTroRan8I,6552
9
- adam_community/cli/parser.py,sha256=DeNNB6Gqs1J3Cha3BSu1DOosQNTij8pyZOmW5ls_xqY,16362
9
+ adam_community/cli/parser.py,sha256=gB7cVrt-tDFO0nO9-2dKI0WG44_n-01FagIPxnJZfn8,17433
10
10
  adam_community/cli/updater.py,sha256=zN521c-G20MKz63wm7h16quBxiEZp4vQ6AbyV-IqtXk,6304
11
11
  adam_community/cli/templates/Makefile.j2,sha256=arpo9AzOZTmjxIYiya9S_G_ldHYVVvf4cVOxNooQeGs,113
12
12
  adam_community/cli/templates/README_kit.md.j2,sha256=5_1ISGUxJKdDild2vNSWTC_hNhZHnEHvyN9Ez4Xbqwk,5715
@@ -18,9 +18,9 @@ adam_community/cli/templates/initial_system_prompt.md.j2,sha256=mF7wdVVfvPmPgosk
18
18
  adam_community/cli/templates/input.json.j2,sha256=LRkIhPln3BnmPRrFebsjUa5t9vcED_7Uimp1Esb1ThU,607
19
19
  adam_community/cli/templates/kit_python.py.j2,sha256=fVQ8EVDMaxPCv9CzYjjoV8NLJMmtVCx5tFaM9eO7f8M,2788
20
20
  adam_community/cli/templates/long_description.md.j2,sha256=Rj6hcuNzEL0Sp17GQVCRJyNytxO22KcKFvEnZlGpevE,1385
21
- adam_community/cli/templates/toolbox_python.py.j2,sha256=88qn3C5qvtU6mXqhWu1YzB_VV2vBRXrxig1tGEOFVz0,4184
22
- adam_community-1.0.6.dist-info/METADATA,sha256=pZzWWtmg7LGRiw3Qg9NdBimk-PUWStU04RQMnM7gMeI,2171
23
- adam_community-1.0.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
24
- adam_community-1.0.6.dist-info/entry_points.txt,sha256=4I7yRkn7cHwPY8-fWQLeAvKjc24zUy8Z65VsZNs0Wos,56
25
- adam_community-1.0.6.dist-info/top_level.txt,sha256=MS8jbePXKZChih9kGizNVX0I1MFZFGWBMCIW_r86qhU,15
26
- adam_community-1.0.6.dist-info/RECORD,,
21
+ adam_community/cli/templates/toolbox_python.py.j2,sha256=EOnmsJUvQRrcO7K7c88kI42gMmcM0Z4ab46qwOJXbH8,4192
22
+ adam_community-1.0.8.dist-info/METADATA,sha256=LGI5BQUvpABeQk9vJopA2XFJHasaqJEQGpSTXvD2CZU,2171
23
+ adam_community-1.0.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
24
+ adam_community-1.0.8.dist-info/entry_points.txt,sha256=4I7yRkn7cHwPY8-fWQLeAvKjc24zUy8Z65VsZNs0Wos,56
25
+ adam_community-1.0.8.dist-info/top_level.txt,sha256=MS8jbePXKZChih9kGizNVX0I1MFZFGWBMCIW_r86qhU,15
26
+ adam_community-1.0.8.dist-info/RECORD,,