adam-community 1.0.19__tar.gz → 1.0.21__tar.gz

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 (37) hide show
  1. {adam_community-1.0.19 → adam_community-1.0.21}/PKG-INFO +2 -1
  2. adam_community-1.0.21/adam_community/__version__.py +1 -0
  3. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/build.py +1 -1
  4. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/init.py +23 -9
  5. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/tool.py +1 -1
  6. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community.egg-info/PKG-INFO +2 -1
  7. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community.egg-info/requires.txt +1 -0
  8. {adam_community-1.0.19 → adam_community-1.0.21}/setup.py +2 -1
  9. adam_community-1.0.19/adam_community/__version__.py +0 -1
  10. {adam_community-1.0.19 → adam_community-1.0.21}/README.md +0 -0
  11. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/__init__.py +0 -0
  12. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/__init__.py +0 -0
  13. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/cli.py +0 -0
  14. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/parser.py +0 -0
  15. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/Makefile.j2 +0 -0
  16. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/README_agent.md.j2 +0 -0
  17. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/README_kit.md.j2 +0 -0
  18. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/__init__.py +0 -0
  19. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/agent_python.py.j2 +0 -0
  20. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/configure.json.j2 +0 -0
  21. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/initial_assistant_message.md.j2 +0 -0
  22. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/initial_assistant_message_en.md.j2 +0 -0
  23. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/initial_system_prompt.md.j2 +0 -0
  24. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/initial_system_prompt_en.md.j2 +0 -0
  25. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/input.json.j2 +0 -0
  26. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/kit_python.py.j2 +0 -0
  27. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/long_description.md.j2 +0 -0
  28. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/long_description_en.md.j2 +0 -0
  29. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/templates/rag_python.py.j2 +0 -0
  30. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/cli/updater.py +0 -0
  31. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community/util.py +0 -0
  32. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community.egg-info/SOURCES.txt +0 -0
  33. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community.egg-info/dependency_links.txt +0 -0
  34. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community.egg-info/entry_points.txt +0 -0
  35. {adam_community-1.0.19 → adam_community-1.0.21}/adam_community.egg-info/top_level.txt +0 -0
  36. {adam_community-1.0.19 → adam_community-1.0.21}/setup.cfg +0 -0
  37. {adam_community-1.0.19 → adam_community-1.0.21}/test/test_util_tool.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: adam_community
3
- Version: 1.0.19
3
+ Version: 1.0.21
4
4
  Summary: Adam Community Tools and Utilities
5
5
  Home-page: https://github.com/yourusername/adam-community
6
6
  Author: Adam Community
@@ -17,6 +17,7 @@ Requires-Dist: rich>=13.0.0
17
17
  Requires-Dist: packaging>=21.0
18
18
  Requires-Dist: jsonschema>=4.0.0
19
19
  Requires-Dist: jinja2>=3.0.0
20
+ Requires-Dist: prompt-toolkit
20
21
  Dynamic: author
21
22
  Dynamic: author-email
22
23
  Dynamic: classifier
@@ -0,0 +1 @@
1
+ __version__ = "1.0.21"
@@ -266,7 +266,7 @@ def create_zip_package(directory: Path) -> str:
266
266
 
267
267
  for file in other_files:
268
268
  file_path = directory / "config" / file
269
- if file_path.exists():
269
+ if file_path.exists() and f"config/{file}" not in zipf.namelist():
270
270
  zipf.write(file_path, f"config/{file}")
271
271
  file_count += 1
272
272
 
@@ -1,4 +1,5 @@
1
1
  import click
2
+ from prompt_toolkit import prompt
2
3
  import re
3
4
  from pathlib import Path
4
5
  from jinja2 import Environment, FileSystemLoader
@@ -6,11 +7,11 @@ from typing import Dict, Any
6
7
 
7
8
 
8
9
  @click.command()
9
- @click.option('--name', prompt='项目名称(仅支持字母、数字、连字符,不能有空格)', help='项目的英文名称(用于文件夹和配置)')
10
- @click.option('--display-name', prompt='显示名称', help='项目的中文显示名称')
11
- @click.option('--description', prompt='项目描述', help='项目的简短描述')
12
- @click.option('--version', default='1.0.0', prompt='版本号', help='项目版本号')
13
- @click.option('--author', prompt='作者', help='项目作者')
10
+ @click.option('--name', help='项目的英文名称(用于文件夹和配置)')
11
+ @click.option('--display-name', help='项目的中文显示名称')
12
+ @click.option('--description', help='项目的简短描述')
13
+ @click.option('--version', help='项目版本号')
14
+ @click.option('--author', help='项目作者')
14
15
  @click.option('--type',
15
16
  type=click.Choice(['kit', 'agent'], case_sensitive=False),
16
17
  help='选择项目类型: kit(表单工具) 或 agent(智能体工具)')
@@ -18,7 +19,19 @@ from typing import Dict, Any
18
19
  @click.argument('directory', type=click.Path(exists=True, file_okay=False, dir_okay=True), default='.')
19
20
  def init(name: str, display_name: str, description: str, version: str, author: str, type: str, collection: str, directory: str):
20
21
  """初始化一个新的 Adam 工具项目"""
21
-
22
+ while not name:
23
+ name = prompt('项目名称(仅支持字母、数字、连字符,不能有空格): ')
24
+ while not display_name:
25
+ display_name = prompt('显示名称: ')
26
+ while not description:
27
+ description = prompt('项目描述: ')
28
+ if not version:
29
+ version = prompt('版本号 [1.0.0]: ')
30
+ if not version:
31
+ version = "1.0.0"
32
+ while not author:
33
+ author = prompt('作者: ')
34
+
22
35
  # 验证项目名称格式
23
36
  if not validate_project_name(name):
24
37
  click.echo(f"错误: 项目名称 '{name}' 格式不正确")
@@ -34,8 +47,9 @@ def init(name: str, display_name: str, description: str, version: str, author: s
34
47
  enable_rag = False
35
48
  if type == 'agent':
36
49
  enable_rag = click.confirm('是否需要启用 RAG 知识库搜索功能?', default=False)
37
- if enable_rag and not collection:
38
- collection = click.prompt('知识库名称')
50
+ if enable_rag:
51
+ while not collection:
52
+ collection = prompt('知识库名称: ')
39
53
 
40
54
  directory_path = Path(directory)
41
55
  project_path = directory_path / name
@@ -181,7 +195,7 @@ def select_project_type() -> str:
181
195
  click.echo("2. agent (智能体工具)")
182
196
 
183
197
  while True:
184
- choice = click.prompt("请输入选项编号 (1 或 2)", type=str)
198
+ choice = prompt("请输入选项编号 (1 或 2)")
185
199
  if choice == '1':
186
200
  return 'kit'
187
201
  elif choice == '2':
@@ -37,7 +37,7 @@ class Tool:
37
37
  """
38
38
  if self.calltype == "bash":
39
39
  os.environ["ADAM_OUTPUT_RAW"] = "true"
40
- scripts = self.call(self, kwargs)
40
+ scripts = self.call(kwargs)
41
41
  os.environ["ADAM_OUTPUT_RAW"] = "false"
42
42
 
43
43
  scripts = '\n'.join(['bash -s << EOF', scripts, 'EOF'])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: adam_community
3
- Version: 1.0.19
3
+ Version: 1.0.21
4
4
  Summary: Adam Community Tools and Utilities
5
5
  Home-page: https://github.com/yourusername/adam-community
6
6
  Author: Adam Community
@@ -17,6 +17,7 @@ Requires-Dist: rich>=13.0.0
17
17
  Requires-Dist: packaging>=21.0
18
18
  Requires-Dist: jsonschema>=4.0.0
19
19
  Requires-Dist: jinja2>=3.0.0
20
+ Requires-Dist: prompt-toolkit
20
21
  Dynamic: author
21
22
  Dynamic: author-email
22
23
  Dynamic: classifier
@@ -5,3 +5,4 @@ rich>=13.0.0
5
5
  packaging>=21.0
6
6
  jsonschema>=4.0.0
7
7
  jinja2>=3.0.0
8
+ prompt-toolkit
@@ -22,7 +22,8 @@ setup(
22
22
  "rich>=13.0.0",
23
23
  "packaging>=21.0",
24
24
  "jsonschema>=4.0.0",
25
- "jinja2>=3.0.0"
25
+ "jinja2>=3.0.0",
26
+ "prompt-toolkit"
26
27
  ],
27
28
  entry_points={
28
29
  'console_scripts': [
@@ -1 +0,0 @@
1
- __version__ = "1.0.19"