aiecs 1.1.0__tar.gz → 1.1.1__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.
Potentially problematic release.
This version of aiecs might be problematic. Click here for more details.
- {aiecs-1.1.0/aiecs.egg-info → aiecs-1.1.1}/PKG-INFO +1 -1
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/__init__.py +1 -1
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/main.py +2 -2
- aiecs-1.1.1/aiecs/scripts/aid/VERSION_MANAGEMENT.md +97 -0
- aiecs-1.1.1/aiecs/scripts/aid/__init__.py +15 -0
- aiecs-1.1.1/aiecs/scripts/aid/version_manager.py +224 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/__init__.py +23 -23
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/docs/__init__.py +5 -2
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/schema_generator.py +56 -56
- {aiecs-1.1.0 → aiecs-1.1.1/aiecs.egg-info}/PKG-INFO +1 -1
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs.egg-info/SOURCES.txt +3 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs.egg-info/entry_points.txt +1 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/pyproject.toml +2 -1
- {aiecs-1.1.0 → aiecs-1.1.1}/LICENSE +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/MANIFEST.in +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/README.md +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/__main__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/aiecs_client.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/application/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/application/executors/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/application/executors/operation_executor.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/config/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/config/config.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/config/registry.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/core/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/core/interface/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/core/interface/execution_interface.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/core/interface/storage_interface.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/community/collaborative_workflow.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/community/community_integration.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/community/community_manager.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/community/decision_engine.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/community/models/community_models.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/community/resource_manager.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/context/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/context/context_engine.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/context/conversation_models.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/execution/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/execution/model.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/task/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/task/dsl_processor.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/task/model.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/domain/task/task_context.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/messaging/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/messaging/celery_task_manager.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/messaging/websocket_manager.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/monitoring/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/monitoring/executor_metrics.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/monitoring/structured_logger.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/monitoring/tracing_manager.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/persistence/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/persistence/context_engine_client.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/persistence/database_manager.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/persistence/file_storage.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/infrastructure/persistence/redis_client.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/llm/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/llm/base_client.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/llm/client_factory.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/llm/custom_callbacks.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/llm/googleai_client.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/llm/openai_client.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/llm/vertex_client.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/llm/xai_client.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_check/DEPENDENCY_SYSTEM_SUMMARY.md +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_check/README_DEPENDENCY_CHECKER.md +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_check/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_check/dependency_checker.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_check/dependency_fixer.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_check/download_nlp_data.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_check/quick_dependency_check.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_check/setup_nlp_data.sh +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_patch/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_patch/fix_weasel/README_WEASEL_PATCH.md +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_patch/fix_weasel/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_patch/fix_weasel/fix_weasel_validator.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_patch/fix_weasel/fix_weasel_validator.sh +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_patch/fix_weasel/patch_weasel_library.sh +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/dependance_patch/fix_weasel/run_weasel_patch.sh +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/tools_develop/README.md +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/tools_develop/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/tools_develop/check_type_annotations.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/scripts/tools_develop/validate_tool_schemas.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tasks/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tasks/worker.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/base_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/docs/ai_document_orchestrator.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/docs/ai_document_writer_orchestrator.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/docs/content_insertion_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/docs/document_creator_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/docs/document_layout_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/docs/document_parser_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/docs/document_writer_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/langchain_adapter.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/chart_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/classfire_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/image_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/office_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/pandas_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/report_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/research_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/scraper_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/search_api.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/task_tools/stats_tool.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/temp_file_manager.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/tool_executor/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/tools/tool_executor/tool_executor.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/utils/LLM_output_structor.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/utils/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/utils/base_callback.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/utils/execution_utils.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/utils/logging.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/utils/prompt_loader.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/utils/token_usage_repository.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/ws/__init__.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs/ws/socket_server.py +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs.egg-info/dependency_links.txt +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs.egg-info/requires.txt +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/aiecs.egg-info/top_level.txt +0 -0
- {aiecs-1.1.0 → aiecs-1.1.1}/setup.cfg +0 -0
|
@@ -5,7 +5,7 @@ A powerful Python middleware framework for building AI-powered applications
|
|
|
5
5
|
with tool orchestration, task execution, and multi-provider LLM support.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "1.1.
|
|
8
|
+
__version__ = "1.1.1"
|
|
9
9
|
__author__ = "AIECS Team"
|
|
10
10
|
__email__ = "iretbl@gmail.com"
|
|
11
11
|
|
|
@@ -124,7 +124,7 @@ async def lifespan(app: FastAPI):
|
|
|
124
124
|
app = FastAPI(
|
|
125
125
|
title="AIECS - AI Execute Services",
|
|
126
126
|
description="Middleware service for AI-powered task execution and tool orchestration",
|
|
127
|
-
version="1.1.
|
|
127
|
+
version="1.1.1",
|
|
128
128
|
lifespan=lifespan
|
|
129
129
|
)
|
|
130
130
|
|
|
@@ -149,7 +149,7 @@ async def health_check():
|
|
|
149
149
|
return {
|
|
150
150
|
"status": "healthy",
|
|
151
151
|
"service": "aiecs",
|
|
152
|
-
"version": "1.1.
|
|
152
|
+
"version": "1.1.1"
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# AIECS 版本管理
|
|
2
|
+
|
|
3
|
+
AIECS 提供了一个统一的版本管理工具,可以同时更新项目中所有相关文件的版本号。
|
|
4
|
+
|
|
5
|
+
## 支持的文件
|
|
6
|
+
|
|
7
|
+
版本管理工具会自动更新以下文件中的版本号:
|
|
8
|
+
|
|
9
|
+
1. **`aiecs/__init__.py`** - 更新 `__version__` 变量
|
|
10
|
+
2. **`aiecs/main.py`** - 更新 FastAPI 应用版本和健康检查端点版本
|
|
11
|
+
3. **`pyproject.toml`** - 更新项目版本
|
|
12
|
+
|
|
13
|
+
## 使用方法
|
|
14
|
+
|
|
15
|
+
### 1. 显示当前版本
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
poetry run python -m aiecs.scripts.aid.version_manager --show
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. 设置特定版本
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
poetry run python -m aiecs.scripts.aid.version_manager --version 1.2.0
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 3. 自动递增版本
|
|
28
|
+
|
|
29
|
+
#### 补丁版本 (Patch)
|
|
30
|
+
```bash
|
|
31
|
+
poetry run python -m aiecs.scripts.aid.version_manager --bump patch
|
|
32
|
+
# 1.1.0 -> 1.1.1
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
#### 次版本 (Minor)
|
|
36
|
+
```bash
|
|
37
|
+
poetry run python -m aiecs.scripts.aid.version_manager --bump minor
|
|
38
|
+
# 1.1.0 -> 1.2.0
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### 主版本 (Major)
|
|
42
|
+
```bash
|
|
43
|
+
poetry run python -m aiecs.scripts.aid.version_manager --bump major
|
|
44
|
+
# 1.1.0 -> 2.0.0
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 版本号格式
|
|
48
|
+
|
|
49
|
+
版本号遵循 [语义化版本控制](https://semver.org/) 规范:
|
|
50
|
+
|
|
51
|
+
- **主版本号 (Major)**: 不兼容的API修改
|
|
52
|
+
- **次版本号 (Minor)**: 向下兼容的功能性新增
|
|
53
|
+
- **补丁版本号 (Patch)**: 向下兼容的问题修正
|
|
54
|
+
|
|
55
|
+
格式:`X.Y.Z` (例如:1.2.3)
|
|
56
|
+
|
|
57
|
+
## 命令行选项
|
|
58
|
+
|
|
59
|
+
- `--version, -v`: 设置特定版本号
|
|
60
|
+
- `--bump, -b`: 自动递增版本 (major/minor/patch)
|
|
61
|
+
- `--show, -s`: 显示当前版本
|
|
62
|
+
- `--help, -h`: 显示帮助信息
|
|
63
|
+
|
|
64
|
+
## 示例
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# 查看当前版本
|
|
68
|
+
poetry run python -m aiecs.scripts.aid.version_manager --show
|
|
69
|
+
|
|
70
|
+
# 发布补丁版本
|
|
71
|
+
poetry run python -m aiecs.scripts.aid.version_manager --bump patch
|
|
72
|
+
|
|
73
|
+
# 发布新功能版本
|
|
74
|
+
poetry run python -m aiecs.scripts.aid.version_manager --bump minor
|
|
75
|
+
|
|
76
|
+
# 发布重大更新版本
|
|
77
|
+
poetry run python -m aiecs.scripts.aid.version_manager --bump major
|
|
78
|
+
|
|
79
|
+
# 手动设置版本
|
|
80
|
+
poetry run python -m aiecs.scripts.aid.version_manager --version 2.1.0
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 注意事项
|
|
84
|
+
|
|
85
|
+
1. 版本管理工具会自动验证版本号格式
|
|
86
|
+
2. 所有相关文件会同时更新,确保版本号一致性
|
|
87
|
+
3. 更新前建议先提交当前更改到版本控制系统
|
|
88
|
+
4. 工具会显示详细的更新日志,确认所有文件都已正确更新
|
|
89
|
+
|
|
90
|
+
## 故障排除
|
|
91
|
+
|
|
92
|
+
如果遇到问题,请检查:
|
|
93
|
+
|
|
94
|
+
1. 确保在项目根目录下运行命令
|
|
95
|
+
2. 确保所有目标文件存在且可写
|
|
96
|
+
3. 检查版本号格式是否正确 (X.Y.Z)
|
|
97
|
+
4. 确保没有其他进程正在编辑这些文件
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AIECS Development Tools (AID)
|
|
3
|
+
|
|
4
|
+
This module contains development and maintenance tools for the AIECS project.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# Lazy import to avoid circular import issues
|
|
8
|
+
def get_version_manager_main():
|
|
9
|
+
"""Get the version manager main function"""
|
|
10
|
+
from .version_manager import main
|
|
11
|
+
return main
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
'get_version_manager_main',
|
|
15
|
+
]
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
AIECS Version Manager
|
|
4
|
+
|
|
5
|
+
A script to manage version numbers across multiple files in the AIECS project.
|
|
6
|
+
Updates version numbers in:
|
|
7
|
+
- aiecs/__init__.py (__version__)
|
|
8
|
+
- aiecs/main.py (FastAPI app version and health check version)
|
|
9
|
+
- pyproject.toml (project version)
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
aiecs-version --version 1.2.0
|
|
13
|
+
aiecs-version --bump patch
|
|
14
|
+
aiecs-version --bump minor
|
|
15
|
+
aiecs-version --bump major
|
|
16
|
+
aiecs-version --show
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
import argparse
|
|
20
|
+
import re
|
|
21
|
+
import sys
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from typing import Optional, Tuple
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class VersionManager:
|
|
27
|
+
"""Manages version numbers across AIECS project files"""
|
|
28
|
+
|
|
29
|
+
def __init__(self, project_root: Optional[Path] = None):
|
|
30
|
+
"""Initialize the version manager with project root path"""
|
|
31
|
+
if project_root is None:
|
|
32
|
+
# Find project root by looking for pyproject.toml
|
|
33
|
+
current = Path(__file__).parent
|
|
34
|
+
while current != current.parent:
|
|
35
|
+
if (current / "pyproject.toml").exists():
|
|
36
|
+
project_root = current
|
|
37
|
+
break
|
|
38
|
+
current = current.parent
|
|
39
|
+
|
|
40
|
+
if project_root is None:
|
|
41
|
+
raise RuntimeError("Could not find project root (pyproject.toml)")
|
|
42
|
+
|
|
43
|
+
self.project_root = project_root
|
|
44
|
+
self.files = {
|
|
45
|
+
'init': project_root / "aiecs" / "__init__.py",
|
|
46
|
+
'main': project_root / "aiecs" / "main.py",
|
|
47
|
+
'pyproject': project_root / "pyproject.toml"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
def get_current_version(self) -> str:
|
|
51
|
+
"""Get the current version from __init__.py"""
|
|
52
|
+
init_file = self.files['init']
|
|
53
|
+
if not init_file.exists():
|
|
54
|
+
raise FileNotFoundError(f"Could not find {init_file}")
|
|
55
|
+
|
|
56
|
+
content = init_file.read_text(encoding='utf-8')
|
|
57
|
+
match = re.search(r'__version__\s*=\s*["\']([^"\']+)["\']', content)
|
|
58
|
+
if not match:
|
|
59
|
+
raise ValueError("Could not find __version__ in __init__.py")
|
|
60
|
+
|
|
61
|
+
return match.group(1)
|
|
62
|
+
|
|
63
|
+
def parse_version(self, version: str) -> Tuple[int, int, int]:
|
|
64
|
+
"""Parse version string into major, minor, patch components"""
|
|
65
|
+
match = re.match(r'^(\d+)\.(\d+)\.(\d+)$', version)
|
|
66
|
+
if not match:
|
|
67
|
+
raise ValueError(f"Invalid version format: {version}. Expected format: X.Y.Z")
|
|
68
|
+
|
|
69
|
+
return int(match.group(1)), int(match.group(2)), int(match.group(3))
|
|
70
|
+
|
|
71
|
+
def bump_version(self, current_version: str, bump_type: str) -> str:
|
|
72
|
+
"""Bump version based on type (major, minor, patch)"""
|
|
73
|
+
major, minor, patch = self.parse_version(current_version)
|
|
74
|
+
|
|
75
|
+
if bump_type == 'major':
|
|
76
|
+
major += 1
|
|
77
|
+
minor = 0
|
|
78
|
+
patch = 0
|
|
79
|
+
elif bump_type == 'minor':
|
|
80
|
+
minor += 1
|
|
81
|
+
patch = 0
|
|
82
|
+
elif bump_type == 'patch':
|
|
83
|
+
patch += 1
|
|
84
|
+
else:
|
|
85
|
+
raise ValueError(f"Invalid bump type: {bump_type}. Use 'major', 'minor', or 'patch'")
|
|
86
|
+
|
|
87
|
+
return f"{major}.{minor}.{patch}"
|
|
88
|
+
|
|
89
|
+
def update_init_file(self, new_version: str) -> None:
|
|
90
|
+
"""Update version in aiecs/__init__.py"""
|
|
91
|
+
init_file = self.files['init']
|
|
92
|
+
content = init_file.read_text(encoding='utf-8')
|
|
93
|
+
|
|
94
|
+
# Update __version__ line
|
|
95
|
+
content = re.sub(
|
|
96
|
+
r'(__version__\s*=\s*["\'])([^"\']+)(["\'])',
|
|
97
|
+
rf'\g<1>{new_version}\g<3>',
|
|
98
|
+
content
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
init_file.write_text(content, encoding='utf-8')
|
|
102
|
+
print(f"✓ Updated {init_file.relative_to(self.project_root)}: __version__ = \"{new_version}\"")
|
|
103
|
+
|
|
104
|
+
def update_main_file(self, new_version: str) -> None:
|
|
105
|
+
"""Update version in aiecs/main.py"""
|
|
106
|
+
main_file = self.files['main']
|
|
107
|
+
content = main_file.read_text(encoding='utf-8')
|
|
108
|
+
|
|
109
|
+
# Update FastAPI app version
|
|
110
|
+
content = re.sub(
|
|
111
|
+
r'(version=")([^"]+)(")',
|
|
112
|
+
rf'\g<1>{new_version}\g<3>',
|
|
113
|
+
content
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
# Update health check version
|
|
117
|
+
content = re.sub(
|
|
118
|
+
r'("version":\s*")([^"]+)(")',
|
|
119
|
+
rf'\g<1>{new_version}\g<3>',
|
|
120
|
+
content
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
main_file.write_text(content, encoding='utf-8')
|
|
124
|
+
print(f"✓ Updated {main_file.relative_to(self.project_root)}: FastAPI version and health check version")
|
|
125
|
+
|
|
126
|
+
def update_pyproject_file(self, new_version: str) -> None:
|
|
127
|
+
"""Update version in pyproject.toml"""
|
|
128
|
+
pyproject_file = self.files['pyproject']
|
|
129
|
+
content = pyproject_file.read_text(encoding='utf-8')
|
|
130
|
+
|
|
131
|
+
# Update project version (only in [project] section, not in [project.scripts])
|
|
132
|
+
# Use a more specific pattern to avoid updating script entry points
|
|
133
|
+
content = re.sub(
|
|
134
|
+
r'^(\s*version\s*=\s*")([^"]+)(")',
|
|
135
|
+
rf'\g<1>{new_version}\g<3>',
|
|
136
|
+
content,
|
|
137
|
+
flags=re.MULTILINE
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
pyproject_file.write_text(content, encoding='utf-8')
|
|
141
|
+
print(f"✓ Updated {pyproject_file.relative_to(self.project_root)}: project version")
|
|
142
|
+
|
|
143
|
+
def update_version(self, new_version: str) -> None:
|
|
144
|
+
"""Update version in all files"""
|
|
145
|
+
# Validate version format
|
|
146
|
+
self.parse_version(new_version)
|
|
147
|
+
|
|
148
|
+
print(f"Updating version to {new_version}...")
|
|
149
|
+
print()
|
|
150
|
+
|
|
151
|
+
# Update all files
|
|
152
|
+
self.update_init_file(new_version)
|
|
153
|
+
self.update_main_file(new_version)
|
|
154
|
+
self.update_pyproject_file(new_version)
|
|
155
|
+
|
|
156
|
+
print()
|
|
157
|
+
print(f"✓ Successfully updated version to {new_version} in all files!")
|
|
158
|
+
|
|
159
|
+
def show_version(self) -> None:
|
|
160
|
+
"""Show current version"""
|
|
161
|
+
try:
|
|
162
|
+
version = self.get_current_version()
|
|
163
|
+
print(f"Current version: {version}")
|
|
164
|
+
except Exception as e:
|
|
165
|
+
print(f"Error getting current version: {e}", file=sys.stderr)
|
|
166
|
+
sys.exit(1)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def main():
|
|
170
|
+
"""Main entry point for the version manager"""
|
|
171
|
+
parser = argparse.ArgumentParser(
|
|
172
|
+
description="AIECS Version Manager - Update version numbers across project files",
|
|
173
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
174
|
+
epilog="""
|
|
175
|
+
Examples:
|
|
176
|
+
aiecs-version --version 1.2.0 # Set specific version
|
|
177
|
+
aiecs-version --bump patch # Bump patch version (1.1.0 -> 1.1.1)
|
|
178
|
+
aiecs-version --bump minor # Bump minor version (1.1.0 -> 1.2.0)
|
|
179
|
+
aiecs-version --bump major # Bump major version (1.1.0 -> 2.0.0)
|
|
180
|
+
aiecs-version --show # Show current version
|
|
181
|
+
"""
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
# Create mutually exclusive group for version options
|
|
185
|
+
version_group = parser.add_mutually_exclusive_group(required=True)
|
|
186
|
+
version_group.add_argument(
|
|
187
|
+
'--version', '-v',
|
|
188
|
+
type=str,
|
|
189
|
+
help='Set specific version (e.g., 1.2.0)'
|
|
190
|
+
)
|
|
191
|
+
version_group.add_argument(
|
|
192
|
+
'--bump', '-b',
|
|
193
|
+
choices=['major', 'minor', 'patch'],
|
|
194
|
+
help='Bump version: major (X.0.0), minor (X.Y.0), or patch (X.Y.Z)'
|
|
195
|
+
)
|
|
196
|
+
version_group.add_argument(
|
|
197
|
+
'--show', '-s',
|
|
198
|
+
action='store_true',
|
|
199
|
+
help='Show current version'
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
args = parser.parse_args()
|
|
203
|
+
|
|
204
|
+
try:
|
|
205
|
+
manager = VersionManager()
|
|
206
|
+
|
|
207
|
+
if args.show:
|
|
208
|
+
manager.show_version()
|
|
209
|
+
elif args.version:
|
|
210
|
+
manager.update_version(args.version)
|
|
211
|
+
elif args.bump:
|
|
212
|
+
current_version = manager.get_current_version()
|
|
213
|
+
new_version = manager.bump_version(current_version, args.bump)
|
|
214
|
+
print(f"Bumping {args.bump} version: {current_version} -> {new_version}")
|
|
215
|
+
print()
|
|
216
|
+
manager.update_version(new_version)
|
|
217
|
+
|
|
218
|
+
except Exception as e:
|
|
219
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
220
|
+
sys.exit(1)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
if __name__ == '__main__':
|
|
224
|
+
main()
|
|
@@ -11,25 +11,25 @@ from aiecs.tools.base_tool import BaseTool
|
|
|
11
11
|
|
|
12
12
|
logger = logging.getLogger(__name__)
|
|
13
13
|
|
|
14
|
-
#
|
|
14
|
+
# Global tool registry
|
|
15
15
|
TOOL_REGISTRY = {}
|
|
16
16
|
TOOL_CLASSES = {}
|
|
17
17
|
TOOL_CONFIGS = {}
|
|
18
18
|
|
|
19
19
|
def register_tool(name):
|
|
20
20
|
"""
|
|
21
|
-
|
|
21
|
+
Decorator for registering tool classes
|
|
22
22
|
|
|
23
23
|
Args:
|
|
24
|
-
name:
|
|
24
|
+
name: Tool name
|
|
25
25
|
|
|
26
26
|
Returns:
|
|
27
|
-
|
|
27
|
+
Decorated class
|
|
28
28
|
"""
|
|
29
29
|
def wrapper(cls):
|
|
30
|
-
#
|
|
30
|
+
# Store tool class but don't instantiate immediately
|
|
31
31
|
TOOL_CLASSES[name] = cls
|
|
32
|
-
#
|
|
32
|
+
# Backward compatibility: if class inherits from BaseTool, don't instantiate immediately
|
|
33
33
|
if not issubclass(cls, BaseTool):
|
|
34
34
|
TOOL_REGISTRY[name] = cls()
|
|
35
35
|
return cls
|
|
@@ -37,25 +37,25 @@ def register_tool(name):
|
|
|
37
37
|
|
|
38
38
|
def get_tool(name):
|
|
39
39
|
"""
|
|
40
|
-
|
|
40
|
+
Get tool instance
|
|
41
41
|
|
|
42
42
|
Args:
|
|
43
|
-
name:
|
|
43
|
+
name: Tool name
|
|
44
44
|
|
|
45
45
|
Returns:
|
|
46
|
-
|
|
46
|
+
Tool instance
|
|
47
47
|
|
|
48
48
|
Raises:
|
|
49
|
-
ValueError:
|
|
49
|
+
ValueError: If tool is not registered
|
|
50
50
|
"""
|
|
51
|
-
#
|
|
51
|
+
# Check if placeholder needs to be replaced or lazy instantiation is needed
|
|
52
52
|
if name in TOOL_CLASSES:
|
|
53
|
-
#
|
|
53
|
+
# If TOOL_REGISTRY contains placeholder or doesn't exist, instantiate real tool class
|
|
54
54
|
current_tool = TOOL_REGISTRY.get(name)
|
|
55
55
|
is_placeholder = getattr(current_tool, 'is_placeholder', False)
|
|
56
56
|
|
|
57
57
|
if current_tool is None or is_placeholder:
|
|
58
|
-
#
|
|
58
|
+
# Lazy instantiation of BaseTool subclasses, replace placeholder
|
|
59
59
|
tool_class = TOOL_CLASSES[name]
|
|
60
60
|
config = TOOL_CONFIGS.get(name, {})
|
|
61
61
|
TOOL_REGISTRY[name] = tool_class(config)
|
|
@@ -68,17 +68,17 @@ def get_tool(name):
|
|
|
68
68
|
|
|
69
69
|
def list_tools():
|
|
70
70
|
"""
|
|
71
|
-
|
|
71
|
+
List all registered tools
|
|
72
72
|
|
|
73
73
|
Returns:
|
|
74
|
-
|
|
74
|
+
List of tool information dictionaries
|
|
75
75
|
"""
|
|
76
76
|
tools = []
|
|
77
77
|
all_tool_names = list(set(list(TOOL_REGISTRY.keys()) + list(TOOL_CLASSES.keys())))
|
|
78
78
|
|
|
79
79
|
for tool_name in all_tool_names:
|
|
80
80
|
try:
|
|
81
|
-
#
|
|
81
|
+
# Prefer using information from existing instances
|
|
82
82
|
if tool_name in TOOL_REGISTRY:
|
|
83
83
|
tool_instance = TOOL_REGISTRY[tool_name]
|
|
84
84
|
tool_info = {
|
|
@@ -90,7 +90,7 @@ def list_tools():
|
|
|
90
90
|
"status": "loaded"
|
|
91
91
|
}
|
|
92
92
|
elif tool_name in TOOL_CLASSES:
|
|
93
|
-
#
|
|
93
|
+
# Get information from class definition but don't instantiate
|
|
94
94
|
tool_class = TOOL_CLASSES[tool_name]
|
|
95
95
|
tool_info = {
|
|
96
96
|
"name": tool_name,
|
|
@@ -107,7 +107,7 @@ def list_tools():
|
|
|
107
107
|
|
|
108
108
|
except Exception as e:
|
|
109
109
|
logger.warning(f"Failed to get info for tool {tool_name}: {e}")
|
|
110
|
-
#
|
|
110
|
+
# Provide basic information
|
|
111
111
|
tools.append({
|
|
112
112
|
"name": tool_name,
|
|
113
113
|
"description": f"{tool_name} (info unavailable)",
|
|
@@ -121,26 +121,26 @@ def list_tools():
|
|
|
121
121
|
|
|
122
122
|
def discover_tools(package_path: str = "aiecs.tools"):
|
|
123
123
|
"""
|
|
124
|
-
|
|
124
|
+
Discover and register all tools in the package
|
|
125
125
|
|
|
126
126
|
Args:
|
|
127
|
-
package_path:
|
|
127
|
+
package_path: Package path to search
|
|
128
128
|
"""
|
|
129
129
|
package = importlib.import_module(package_path)
|
|
130
130
|
package_dir = os.path.dirname(package.__file__)
|
|
131
131
|
|
|
132
132
|
for _, module_name, is_pkg in pkgutil.iter_modules([package_dir]):
|
|
133
133
|
if is_pkg:
|
|
134
|
-
#
|
|
134
|
+
# Recursively search for tools in subpackages
|
|
135
135
|
discover_tools(f"{package_path}.{module_name}")
|
|
136
136
|
else:
|
|
137
|
-
#
|
|
137
|
+
# Import module
|
|
138
138
|
try:
|
|
139
139
|
importlib.import_module(f"{package_path}.{module_name}")
|
|
140
140
|
except Exception as e:
|
|
141
141
|
logger.error(f"Error importing module {module_name}: {e}")
|
|
142
142
|
|
|
143
|
-
#
|
|
143
|
+
# Import base tool class for inheritance
|
|
144
144
|
from aiecs.tools.base_tool import BaseTool
|
|
145
145
|
|
|
146
146
|
# Lazy loading strategy: don't import all tools at package init
|
|
@@ -30,6 +30,9 @@ def _lazy_load_doc_tool(tool_name: str):
|
|
|
30
30
|
if tool_name in _LOADED_DOC_TOOLS:
|
|
31
31
|
return
|
|
32
32
|
|
|
33
|
+
# Mark as loading to prevent infinite recursion
|
|
34
|
+
_LOADED_DOC_TOOLS.add(tool_name)
|
|
35
|
+
|
|
33
36
|
try:
|
|
34
37
|
if tool_name == 'document_parser_tool':
|
|
35
38
|
from . import document_parser_tool
|
|
@@ -53,9 +56,9 @@ def _lazy_load_doc_tool(tool_name: str):
|
|
|
53
56
|
from . import content_insertion_tool
|
|
54
57
|
globals()['content_insertion_tool'] = content_insertion_tool
|
|
55
58
|
|
|
56
|
-
_LOADED_DOC_TOOLS.add(tool_name)
|
|
57
|
-
|
|
58
59
|
except ImportError as e:
|
|
60
|
+
# Remove from loaded set if import failed
|
|
61
|
+
_LOADED_DOC_TOOLS.discard(tool_name)
|
|
59
62
|
print(f"Warning: Could not import {tool_name}: {e}")
|
|
60
63
|
|
|
61
64
|
def __getattr__(name: str):
|