auto-coder 0.1.334__py3-none-any.whl → 0.1.340__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.
Potentially problematic release.
This version of auto-coder might be problematic. Click here for more details.
- {auto_coder-0.1.334.dist-info → auto_coder-0.1.340.dist-info}/METADATA +2 -2
- {auto_coder-0.1.334.dist-info → auto_coder-0.1.340.dist-info}/RECORD +70 -34
- autocoder/agent/agentic_edit.py +833 -0
- autocoder/agent/agentic_edit_tools/__init__.py +28 -0
- autocoder/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py +32 -0
- autocoder/agent/agentic_edit_tools/attempt_completion_tool_resolver.py +29 -0
- autocoder/agent/agentic_edit_tools/base_tool_resolver.py +29 -0
- autocoder/agent/agentic_edit_tools/execute_command_tool_resolver.py +84 -0
- autocoder/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py +75 -0
- autocoder/agent/agentic_edit_tools/list_files_tool_resolver.py +62 -0
- autocoder/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py +30 -0
- autocoder/agent/agentic_edit_tools/read_file_tool_resolver.py +36 -0
- autocoder/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +95 -0
- autocoder/agent/agentic_edit_tools/search_files_tool_resolver.py +70 -0
- autocoder/agent/agentic_edit_tools/use_mcp_tool_resolver.py +55 -0
- autocoder/agent/agentic_edit_tools/write_to_file_tool_resolver.py +98 -0
- autocoder/agent/agentic_edit_types.py +124 -0
- autocoder/agent/agentic_filter.py +14 -7
- autocoder/auto_coder.py +39 -18
- autocoder/auto_coder_rag.py +18 -9
- autocoder/auto_coder_runner.py +107 -8
- autocoder/chat_auto_coder.py +1 -2
- autocoder/chat_auto_coder_lang.py +18 -2
- autocoder/commands/tools.py +5 -1
- autocoder/common/__init__.py +2 -0
- autocoder/common/auto_coder_lang.py +84 -8
- autocoder/common/code_auto_generate_diff.py +1 -1
- autocoder/common/code_auto_generate_editblock.py +1 -1
- autocoder/common/code_auto_generate_strict_diff.py +1 -1
- autocoder/common/mcp_hub.py +185 -2
- autocoder/common/mcp_server.py +243 -306
- autocoder/common/mcp_server_install.py +269 -0
- autocoder/common/mcp_server_types.py +169 -0
- autocoder/common/stream_out_type.py +3 -0
- autocoder/common/v2/agent/__init__.py +0 -0
- autocoder/common/v2/agent/agentic_edit.py +1433 -0
- autocoder/common/v2/agent/agentic_edit_conversation.py +179 -0
- autocoder/common/v2/agent/agentic_edit_tools/__init__.py +28 -0
- autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py +70 -0
- autocoder/common/v2/agent/agentic_edit_tools/attempt_completion_tool_resolver.py +35 -0
- autocoder/common/v2/agent/agentic_edit_tools/base_tool_resolver.py +33 -0
- autocoder/common/v2/agent/agentic_edit_tools/execute_command_tool_resolver.py +88 -0
- autocoder/common/v2/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py +80 -0
- autocoder/common/v2/agent/agentic_edit_tools/list_files_tool_resolver.py +105 -0
- autocoder/common/v2/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py +35 -0
- autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py +51 -0
- autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +153 -0
- autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py +104 -0
- autocoder/common/v2/agent/agentic_edit_tools/use_mcp_tool_resolver.py +46 -0
- autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py +58 -0
- autocoder/common/v2/agent/agentic_edit_types.py +167 -0
- autocoder/common/v2/agent/agentic_tool_display.py +184 -0
- autocoder/common/v2/code_agentic_editblock_manager.py +812 -0
- autocoder/common/v2/code_auto_generate.py +1 -1
- autocoder/common/v2/code_auto_generate_diff.py +1 -1
- autocoder/common/v2/code_auto_generate_editblock.py +1 -1
- autocoder/common/v2/code_auto_generate_strict_diff.py +1 -1
- autocoder/common/v2/code_editblock_manager.py +151 -178
- autocoder/compilers/provided_compiler.py +3 -2
- autocoder/events/event_manager.py +4 -4
- autocoder/events/event_types.py +1 -0
- autocoder/memory/active_context_manager.py +2 -29
- autocoder/models.py +10 -2
- autocoder/shadows/shadow_manager.py +1 -1
- autocoder/utils/llms.py +4 -2
- autocoder/version.py +1 -1
- {auto_coder-0.1.334.dist-info → auto_coder-0.1.340.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.334.dist-info → auto_coder-0.1.340.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.334.dist-info → auto_coder-0.1.340.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.334.dist-info → auto_coder-0.1.340.dist-info}/top_level.txt +0 -0
|
@@ -99,37 +99,10 @@ class ActiveContextManager:
|
|
|
99
99
|
if self._is_initialized:
|
|
100
100
|
return
|
|
101
101
|
self.source_dir = source_dir
|
|
102
|
-
|
|
103
|
-
log_dir = os.path.join(source_dir, ".auto-coder", "active-context")
|
|
104
|
-
os.makedirs(log_dir, exist_ok=True)
|
|
105
|
-
log_file = os.path.join(log_dir, "active.log")
|
|
106
|
-
|
|
107
|
-
# 配置全局日志输出到文件,不输出到控制台
|
|
108
|
-
global_logger.configure(
|
|
109
|
-
handlers=[
|
|
110
|
-
# 移除控制台输出,只保留文件输出
|
|
111
|
-
# 文件 Handler
|
|
112
|
-
{
|
|
113
|
-
"sink": log_file,
|
|
114
|
-
"level": "INFO",
|
|
115
|
-
"rotation": "10 MB",
|
|
116
|
-
"retention": "1 week",
|
|
117
|
-
"format": "{time:YYYY-MM-DD HH:mm:ss} | {level} | {name} | {message}",
|
|
118
|
-
"filter": lambda record: record["extra"].get("name") in ["DirectoryMapper", "ActiveContextManager","ActivePackage","AsyncProcessor"]
|
|
119
|
-
},
|
|
120
|
-
# 控制台 Handler
|
|
121
|
-
{
|
|
122
|
-
"sink": sys.stdout,
|
|
123
|
-
"level": "INFO",
|
|
124
|
-
"format": "{time:YYYY-MM-DD HH:mm:ss} | {name} | {message}",
|
|
125
|
-
"filter": lambda record: record["extra"].get("name") not in ["DirectoryMapper", "ActiveContextManager","ActivePackage","AsyncProcessor","TokenCostCalculator"]
|
|
126
|
-
}
|
|
127
|
-
]
|
|
128
|
-
)
|
|
129
|
-
|
|
102
|
+
|
|
130
103
|
# 创建专用的logger实例
|
|
131
104
|
self.logger = global_logger.bind(name="ActiveContextManager")
|
|
132
|
-
|
|
105
|
+
|
|
133
106
|
|
|
134
107
|
self.llm = llm
|
|
135
108
|
self.directory_mapper = DirectoryMapper()
|
autocoder/models.py
CHANGED
|
@@ -17,7 +17,8 @@ default_models_list = [
|
|
|
17
17
|
"is_reasoning": True,
|
|
18
18
|
"input_price": 0.0, # 单位:M/百万 input tokens
|
|
19
19
|
"output_price": 0.0, # 单位:M/百万 output tokens
|
|
20
|
-
"average_speed": 0.0 # 单位:秒/请求
|
|
20
|
+
"average_speed": 0.0, # 单位:秒/请求
|
|
21
|
+
"max_output_tokens": 8096
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
24
|
"name": "deepseek_chat",
|
|
@@ -29,7 +30,8 @@ default_models_list = [
|
|
|
29
30
|
"is_reasoning": False,
|
|
30
31
|
"input_price": 0.0,
|
|
31
32
|
"output_price": 0.0,
|
|
32
|
-
"average_speed": 0.0
|
|
33
|
+
"average_speed": 0.0,
|
|
34
|
+
"max_output_tokens": 8096
|
|
33
35
|
},
|
|
34
36
|
{
|
|
35
37
|
"name":"o1",
|
|
@@ -302,6 +304,8 @@ def update_model(name: str, model_data: Dict) -> Dict:
|
|
|
302
304
|
- is_reasoning: 是否为推理模型
|
|
303
305
|
- input_price: 输入价格
|
|
304
306
|
- output_price: 输出价格
|
|
307
|
+
- max_output_tokens: 最大输出tokens
|
|
308
|
+
- average_speed: 平均速度
|
|
305
309
|
|
|
306
310
|
Returns:
|
|
307
311
|
Dict: 更新后的模型信息,如果未找到则返回None
|
|
@@ -327,6 +331,10 @@ def update_model(name: str, model_data: Dict) -> Dict:
|
|
|
327
331
|
model["input_price"] = float(model_data["input_price"])
|
|
328
332
|
if "output_price" in model_data:
|
|
329
333
|
model["output_price"] = float(model_data["output_price"])
|
|
334
|
+
if "max_output_tokens" in model_data:
|
|
335
|
+
model["max_output_tokens"] = int(model_data["max_output_tokens"])
|
|
336
|
+
if "average_speed" in model_data:
|
|
337
|
+
model["average_speed"] = float(model_data["average_speed"])
|
|
330
338
|
|
|
331
339
|
# 保存更新后的模型
|
|
332
340
|
models[i] = model
|
|
@@ -84,7 +84,7 @@ class ShadowManager:
|
|
|
84
84
|
abs_path = os.path.abspath(path)
|
|
85
85
|
|
|
86
86
|
# 检查路径是否在源目录内
|
|
87
|
-
if not abs_path.startswith(self.source_dir):
|
|
87
|
+
if not abs_path.startswith(self.source_dir):
|
|
88
88
|
raise ValueError(f"路径 {path} 不在源目录 {self.source_dir} 内")
|
|
89
89
|
|
|
90
90
|
# 获取相对于source_dir的相对路径
|
autocoder/utils/llms.py
CHANGED
|
@@ -69,7 +69,8 @@ def get_single_llm(model_names: str, product_mode: str):
|
|
|
69
69
|
"saas.base_url": model_info["base_url"],
|
|
70
70
|
"saas.api_key": model_info["api_key"],
|
|
71
71
|
"saas.model": model_info["model_name"],
|
|
72
|
-
"saas.is_reasoning": model_info["is_reasoning"]
|
|
72
|
+
"saas.is_reasoning": model_info["is_reasoning"],
|
|
73
|
+
"saas.max_output_tokens": model_info.get("max_output_tokens", 8096)
|
|
73
74
|
}
|
|
74
75
|
)
|
|
75
76
|
return target_llm
|
|
@@ -87,7 +88,8 @@ def get_single_llm(model_names: str, product_mode: str):
|
|
|
87
88
|
"saas.base_url": model_info["base_url"],
|
|
88
89
|
"saas.api_key": model_info["api_key"],
|
|
89
90
|
"saas.model": model_info["model_name"],
|
|
90
|
-
"saas.is_reasoning": model_info["is_reasoning"]
|
|
91
|
+
"saas.is_reasoning": model_info["is_reasoning"],
|
|
92
|
+
"saas.max_output_tokens": model_info.get("max_output_tokens", 8096)
|
|
91
93
|
}
|
|
92
94
|
)
|
|
93
95
|
return target_llm
|
autocoder/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.340"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|