adam-community 1.0.14__tar.gz → 1.0.16__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 (34) hide show
  1. {adam_community-1.0.14 → adam_community-1.0.16}/PKG-INFO +1 -1
  2. adam_community-1.0.16/adam_community/__version__.py +1 -0
  3. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/build.py +35 -7
  4. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community.egg-info/PKG-INFO +1 -1
  5. adam_community-1.0.14/adam_community/__version__.py +0 -1
  6. {adam_community-1.0.14 → adam_community-1.0.16}/README.md +0 -0
  7. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/__init__.py +0 -0
  8. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/__init__.py +0 -0
  9. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/cli.py +0 -0
  10. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/init.py +0 -0
  11. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/parser.py +0 -0
  12. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/Makefile.j2 +0 -0
  13. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/README_agent.md.j2 +0 -0
  14. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/README_kit.md.j2 +0 -0
  15. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/__init__.py +0 -0
  16. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/agent_python.py.j2 +0 -0
  17. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/configure.json.j2 +0 -0
  18. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/initial_assistant_message.md.j2 +0 -0
  19. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/initial_system_prompt.md.j2 +0 -0
  20. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/input.json.j2 +0 -0
  21. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/kit_python.py.j2 +0 -0
  22. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/long_description.md.j2 +0 -0
  23. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/templates/rag_python.py.j2 +0 -0
  24. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/cli/updater.py +0 -0
  25. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/tool.py +0 -0
  26. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community/util.py +0 -0
  27. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community.egg-info/SOURCES.txt +0 -0
  28. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community.egg-info/dependency_links.txt +0 -0
  29. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community.egg-info/entry_points.txt +0 -0
  30. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community.egg-info/requires.txt +0 -0
  31. {adam_community-1.0.14 → adam_community-1.0.16}/adam_community.egg-info/top_level.txt +0 -0
  32. {adam_community-1.0.14 → adam_community-1.0.16}/setup.cfg +0 -0
  33. {adam_community-1.0.14 → adam_community-1.0.16}/setup.py +0 -0
  34. {adam_community-1.0.14 → adam_community-1.0.16}/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.14
3
+ Version: 1.0.16
4
4
  Summary: Adam Community Tools and Utilities
5
5
  Home-page: https://github.com/yourusername/adam-community
6
6
  Author: Adam Community
@@ -0,0 +1 @@
1
+ __version__ = "1.0.16"
@@ -123,9 +123,13 @@ def check_configuration(directory: Path) -> Tuple[bool, List[str]]:
123
123
  console.print(f" ✓ 包信息: {config['name']} v{config['version']}")
124
124
 
125
125
  return len(errors) == 0, errors
126
- except json.JSONDecodeError:
127
- console.print(" ❌ 配置文件格式错误")
128
- return False, ["configure.json 文件格式错误"]
126
+ except json.JSONDecodeError as e:
127
+ console.print(Panel.fit(
128
+ f"[bold red]❌ configure.json 解析失败[/bold red]\n{str(e)}",
129
+ border_style="red"
130
+ ))
131
+ console.print("[red]构建失败,请检查并修复 configure.json 文件后重试。[/red]")
132
+ sys.exit(1)
129
133
 
130
134
  def check_markdown_files(directory: Path) -> Tuple[bool, List[str]]:
131
135
  """检查必要的 Markdown 文件"""
@@ -140,8 +144,13 @@ def check_markdown_files(directory: Path) -> Tuple[bool, List[str]]:
140
144
  with open(config_path, 'r', encoding='utf-8') as f:
141
145
  config = json.load(f)
142
146
  config_type = config.get("type", "agent")
143
- except json.JSONDecodeError:
144
- pass # 配置文件格式错误时使用默认值
147
+ except json.JSONDecodeError as e:
148
+ console.print(Panel.fit(
149
+ f"[bold red]❌ configure.json 解析失败[/bold red]\n{str(e)}",
150
+ border_style="red"
151
+ ))
152
+ console.print("[red]构建失败,请检查并修复 configure.json 文件后重试。[/red]")
153
+ sys.exit(1)
145
154
 
146
155
  # 根据 type 设置不同的 required_files
147
156
  if config_type == "kit":
@@ -187,8 +196,16 @@ def check_markdown_files(directory: Path) -> Tuple[bool, List[str]]:
187
196
 
188
197
  def create_zip_package(directory: Path) -> str:
189
198
  """创建 zip 包"""
190
- with open(directory / "config" / "configure.json", 'r', encoding='utf-8') as f:
191
- config = json.load(f)
199
+ try:
200
+ with open(directory / "config" / "configure.json", 'r', encoding='utf-8') as f:
201
+ config = json.load(f)
202
+ except json.JSONDecodeError as e:
203
+ console.print(Panel.fit(
204
+ f"[bold red]❌ configure.json 解析失败[/bold red]\n{str(e)}",
205
+ border_style="red"
206
+ ))
207
+ console.print("[red]构建失败,请检查并修复 configure.json 文件后重试。[/red]")
208
+ sys.exit(1)
192
209
 
193
210
  zip_name = f"{config['name']}_{config['version']}.zip"
194
211
  zip_path = directory / zip_name
@@ -207,6 +224,16 @@ def create_zip_package(directory: Path) -> str:
207
224
  zipf.write(py_file, py_file.relative_to(directory))
208
225
  file_count += 1
209
226
 
227
+ # 添加其他文件(Markdown 和 Jinja2 模板)
228
+ other_files = []
229
+ for pattern in ['*.md', '*.jinja2']:
230
+ files = [f for f in directory.rglob(pattern) if not f.name.startswith('_')]
231
+ other_files.extend(files)
232
+
233
+ for other_file in other_files:
234
+ zipf.write(other_file, other_file.relative_to(directory))
235
+ file_count += 1
236
+
210
237
  # 添加配置文件
211
238
  zipf.write(directory / "config" / "configure.json", "config/configure.json")
212
239
  file_count += 1
@@ -244,6 +271,7 @@ def create_zip_package(directory: Path) -> str:
244
271
  file_count += 1
245
272
 
246
273
  console.print(f" ✓ Python 文件: {len(py_files)} 个")
274
+ console.print(f" ✓ 其他文件: {len(other_files)} 个")
247
275
  console.print(f" ✓ 配置文件: 1 个")
248
276
  if demos_files > 0:
249
277
  console.print(f" ✓ 演示文件: {demos_files} 个")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: adam_community
3
- Version: 1.0.14
3
+ Version: 1.0.16
4
4
  Summary: Adam Community Tools and Utilities
5
5
  Home-page: https://github.com/yourusername/adam-community
6
6
  Author: Adam Community
@@ -1 +0,0 @@
1
- __version__ = "1.0.14"