auto-coder 0.1.295__py3-none-any.whl → 0.1.296__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.295.dist-info → auto_coder-0.1.296.dist-info}/METADATA +1 -1
- {auto_coder-0.1.295.dist-info → auto_coder-0.1.296.dist-info}/RECORD +13 -13
- autocoder/commands/auto_command.py +3 -1
- autocoder/commands/tools.py +2 -0
- autocoder/common/mcp_hub.py +12 -8
- autocoder/common/mcp_servers/mcp_server_gpt4o_mini_search.py +5 -3
- autocoder/common/mcp_servers/mcp_server_perplexity.py +3 -1
- autocoder/common/mcp_tools.py +7 -2
- autocoder/version.py +1 -1
- {auto_coder-0.1.295.dist-info → auto_coder-0.1.296.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.295.dist-info → auto_coder-0.1.296.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.295.dist-info → auto_coder-0.1.296.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.295.dist-info → auto_coder-0.1.296.dist-info}/top_level.txt +0 -0
|
@@ -12,7 +12,7 @@ autocoder/chat_auto_coder_lang.py,sha256=-vyKq02RGn6N275YA06JZqXpfJkNq6PNjQ8wy4M
|
|
|
12
12
|
autocoder/command_args.py,sha256=9aYJ-AmPxP1sQh6ciw04FWHjSn31f2W9afXFwo8wgx4,30441
|
|
13
13
|
autocoder/lang.py,sha256=U6AjVV8Rs1uLyjFCZ8sT6WWuNUxMBqkXXIOs4S120uk,14511
|
|
14
14
|
autocoder/models.py,sha256=AyoZ-Pzy0oyYUmWCxOIRiOImsqboSfRET7LO9-UOuxI,11172
|
|
15
|
-
autocoder/version.py,sha256=
|
|
15
|
+
autocoder/version.py,sha256=ihc06tTR_94f1_ktAvLzOrOQwItQGilOeekInep7SCU,23
|
|
16
16
|
autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
autocoder/agent/auto_demand_organizer.py,sha256=NWSAEsEk94vT3lGjfo25kKLMwYdPcpy9e-i21txPasQ,6942
|
|
18
18
|
autocoder/agent/auto_filegroup.py,sha256=CW7bqp0FW1GIEMnl-blyAc2UGT7O9Mom0q66ITz1ckM,6635
|
|
@@ -26,9 +26,9 @@ autocoder/agent/planner.py,sha256=SZTSZHxHzDmuWZo3K5fs79RwvJLWurg-nbJRRNbX65o,91
|
|
|
26
26
|
autocoder/agent/project_reader.py,sha256=tWLaPoLw1gI6kO_NzivQj28KbobU2ceOLuppHMbfGl8,18234
|
|
27
27
|
autocoder/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
autocoder/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
-
autocoder/commands/auto_command.py,sha256=
|
|
29
|
+
autocoder/commands/auto_command.py,sha256=VGPVPf9jz3rcoOg7QNjoC70aSm1tIqLvJiY02JcQnFI,54175
|
|
30
30
|
autocoder/commands/auto_web.py,sha256=_449f4rCoRG7Sv0SB0hIBRFLPLPJ5DgWW4DlI22a3XY,39383
|
|
31
|
-
autocoder/commands/tools.py,sha256=
|
|
31
|
+
autocoder/commands/tools.py,sha256=iBcGdTAOCoWk1wX05EbEfkzIEZiTMAKRthap0q1rM5E,21384
|
|
32
32
|
autocoder/common/JupyterClient.py,sha256=O-wi6pXeAEYhAY24kDa0BINrLYvKS6rKyWe98pDClS0,2816
|
|
33
33
|
autocoder/common/ShellClient.py,sha256=fM1q8t_XMSbLBl2zkCNC2J9xuyKN3eXzGm6hHhqL2WY,2286
|
|
34
34
|
autocoder/common/__init__.py,sha256=LE-HHb_HwpWwRKwbwDlTqRzMV6nTzqF3RB55zVMDS3c,13656
|
|
@@ -66,9 +66,9 @@ autocoder/common/image_to_page.py,sha256=yWiTJQ49Lm3j0FngiJhQ9u7qayqE_bOGb8Rk0Tm
|
|
|
66
66
|
autocoder/common/index_import_export.py,sha256=h758AYY1df6JMTKUXYmMkSgxItfymDt82XT7O-ygEuw,4565
|
|
67
67
|
autocoder/common/interpreter.py,sha256=62-dIakOunYB4yjmX8SHC0Gdy2h8NtxdgbpdqRZJ5vk,2833
|
|
68
68
|
autocoder/common/llm_rerank.py,sha256=FbvtCzaR661Mt2wn0qsuiEL1Y3puD6jeIJS4zg_e7Bs,3260
|
|
69
|
-
autocoder/common/mcp_hub.py,sha256=
|
|
69
|
+
autocoder/common/mcp_hub.py,sha256=9f55EOViYyhJSE8coZ5USXQBaCjg71nbdy9iwg3q2Z0,16764
|
|
70
70
|
autocoder/common/mcp_server.py,sha256=1SCtpBRmN299xWX-0aV0imWS2CX6zBUOZBocbV_J6B8,17415
|
|
71
|
-
autocoder/common/mcp_tools.py,sha256=
|
|
71
|
+
autocoder/common/mcp_tools.py,sha256=YdEhDzRnwAr2J3D-23ExIQFWbrNO-EUpIxg179qs9Sw,12666
|
|
72
72
|
autocoder/common/memory_manager.py,sha256=2ZjYG7BPyvbYalZBF6AM_G5e10Qkw_zrqtD4Zd7GSsQ,3663
|
|
73
73
|
autocoder/common/model_speed_test.py,sha256=U48xUUpOnbwUal1cdij4YAn_H2PD2pNaqrMHaYtQRfI,15200
|
|
74
74
|
autocoder/common/printer.py,sha256=P1WU0QjlfnjqTP5uA55GkHZCpFzRPFkc34DMMandreg,2023
|
|
@@ -84,8 +84,8 @@ autocoder/common/text.py,sha256=KGRQq314GHBmY4MWG8ossRoQi1_DTotvhxchpn78c-k,1003
|
|
|
84
84
|
autocoder/common/types.py,sha256=PXTETrsTvhLE49jqAeUKGySvxBN9pjeyCgRHLDYdd9U,664
|
|
85
85
|
autocoder/common/utils_code_auto_generate.py,sha256=oiBjdCgdcQErfhMozFdHxkU84WmDo2euBA86yezha-g,3597
|
|
86
86
|
autocoder/common/mcp_servers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
87
|
-
autocoder/common/mcp_servers/mcp_server_gpt4o_mini_search.py,sha256=
|
|
88
|
-
autocoder/common/mcp_servers/mcp_server_perplexity.py,sha256=
|
|
87
|
+
autocoder/common/mcp_servers/mcp_server_gpt4o_mini_search.py,sha256=TApShxgoozLluobXHOK1-oAE1zm0-9jdRoPLQB1qwMI,5688
|
|
88
|
+
autocoder/common/mcp_servers/mcp_server_perplexity.py,sha256=CIC26UkfH1lYoVCjfyY5xGGYVx8h0oz0Uj1c7YJ3OPw,5560
|
|
89
89
|
autocoder/data/byzerllm.md,sha256=SGCMpEaUQ0ysPxQsgzyyp5sgvEr8dZsxEGAfVcPBIq0,47741
|
|
90
90
|
autocoder/data/tokenizer.json,sha256=7Lb5_DaYlDRvBRH0B0ynXO5c1fOwbQLxujX805-OEh0,7847602
|
|
91
91
|
autocoder/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -183,9 +183,9 @@ autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
183
183
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
184
184
|
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=lkJ_A-sYU36JMzjFWkk3pR6uos8oZHYt9GPsPe_CPAo,11766
|
|
185
185
|
autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
186
|
-
auto_coder-0.1.
|
|
187
|
-
auto_coder-0.1.
|
|
188
|
-
auto_coder-0.1.
|
|
189
|
-
auto_coder-0.1.
|
|
190
|
-
auto_coder-0.1.
|
|
191
|
-
auto_coder-0.1.
|
|
186
|
+
auto_coder-0.1.296.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
187
|
+
auto_coder-0.1.296.dist-info/METADATA,sha256=XLlbDjwZ0CnGmPaWfozGzZMSKCJWvZn4wNBxuqz4vlo,2665
|
|
188
|
+
auto_coder-0.1.296.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
189
|
+
auto_coder-0.1.296.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
|
|
190
|
+
auto_coder-0.1.296.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
191
|
+
auto_coder-0.1.296.dist-info/RECORD,,
|
|
@@ -241,6 +241,7 @@ class CommandAutoTuner:
|
|
|
241
241
|
而对于分析一个超大文件推荐组合 read_files 带上 line_ranges 参数来读取,或者组合 read_file_withread_file_with_keyword_ranges 等来读取,
|
|
242
242
|
每个函数你还可以使用多次来获取更多信息。
|
|
243
243
|
9. 根据操作系统,终端类型,脚本类型等各种信息,在涉及到路径或者脚本的时候,需要考虑平台差异性。
|
|
244
|
+
10. 使用 read_files 时,一次性读取文件数量不要超过1个,每次只读取200行。如果发现读取的内容不够,则继续读取下面200行。
|
|
244
245
|
</function_combination_readme>
|
|
245
246
|
|
|
246
247
|
|
|
@@ -1057,7 +1058,8 @@ class CommandAutoTuner:
|
|
|
1057
1058
|
|
|
1058
1059
|
你可以使用 get_project_structure 函数获取项目结构后,然后再通过 get_project_map 函数获取某个文件的用途,符号列表,以及
|
|
1059
1060
|
文件大小(tokens数),最后再通过 read_files 函数来读取文件内容,从而帮你做更好的决策。如果需要读取的文件过大,
|
|
1060
|
-
|
|
1061
|
+
|
|
1062
|
+
特别注意:使用 read_files 时,一次性读取文件数量不要超过1个,每次只读取200行。如果发现读取的内容不够,则继续读取下面200行。
|
|
1061
1063
|
|
|
1062
1064
|
</usage>
|
|
1063
1065
|
</command>
|
autocoder/commands/tools.py
CHANGED
|
@@ -450,6 +450,8 @@ class AutoCommandTools:
|
|
|
450
450
|
content = "".join(lines[start:end])
|
|
451
451
|
filtered_lines.extend(f"##File: {absolute_path}\n##Line: {start}-{end}\n\n{content}")
|
|
452
452
|
source_code = "".join(filtered_lines)
|
|
453
|
+
# Add source_code to source_code_str
|
|
454
|
+
source_code_str += source_code
|
|
453
455
|
else:
|
|
454
456
|
# Read entire file if no range specified
|
|
455
457
|
content = files_utils.read_file(absolute_path)
|
autocoder/common/mcp_hub.py
CHANGED
|
@@ -10,15 +10,21 @@ from datetime import datetime, timedelta
|
|
|
10
10
|
from typing import Dict, List, Optional, Any, Set, Optional, Tuple
|
|
11
11
|
from pathlib import Path
|
|
12
12
|
from pydantic import BaseModel, Field
|
|
13
|
-
|
|
14
|
-
from mcp import ClientSession
|
|
15
|
-
from mcp.client.stdio import stdio_client, StdioServerParameters
|
|
16
|
-
from mcp.client.sse import sse_client
|
|
17
|
-
import mcp.types as mcp_types
|
|
18
13
|
from loguru import logger
|
|
19
14
|
from contextlib import AsyncExitStack
|
|
20
15
|
from datetime import timedelta
|
|
21
16
|
|
|
17
|
+
try:
|
|
18
|
+
from mcp import ClientSession
|
|
19
|
+
from mcp.client.stdio import stdio_client, StdioServerParameters
|
|
20
|
+
from mcp.client.sse import sse_client
|
|
21
|
+
import mcp.types as mcp_types
|
|
22
|
+
except ImportError:
|
|
23
|
+
mcp_types = None
|
|
24
|
+
stdio_client = None
|
|
25
|
+
sse_client = None
|
|
26
|
+
ClientSession = None
|
|
27
|
+
logger.error("mcp is not installed(which requires python>=3.11), please install it by `pip install mcp`")
|
|
22
28
|
|
|
23
29
|
class McpTool(BaseModel):
|
|
24
30
|
"""Represents an MCP tool configuration"""
|
|
@@ -101,9 +107,7 @@ def _generate_server_configs() -> Tuple[Dict[str, Any], Dict[str, str]]:
|
|
|
101
107
|
|
|
102
108
|
# Store in dictionaries
|
|
103
109
|
servers[friendly_name] = config
|
|
104
|
-
templates[friendly_name] = json.dumps({friendly_name: config}, indent=4)
|
|
105
|
-
|
|
106
|
-
logger.info(f"Detected MCP server: {friendly_name}")
|
|
110
|
+
templates[friendly_name] = json.dumps({friendly_name: config}, indent=4)
|
|
107
111
|
|
|
108
112
|
except Exception as e:
|
|
109
113
|
logger.error(f"Error generating server configs: {e}")
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
from os import getenv
|
|
2
2
|
from textwrap import dedent
|
|
3
3
|
import sys
|
|
4
|
-
|
|
4
|
+
import json
|
|
5
|
+
from openai import OpenAI
|
|
6
|
+
from loguru import logger
|
|
5
7
|
import mcp.server.stdio
|
|
6
8
|
import mcp.types as types
|
|
7
9
|
from mcp.server import NotificationOptions, Server
|
|
8
10
|
from mcp.server.models import InitializationOptions
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
OPENAI_API_KEY = getenv("OPENAI_API_KEY")
|
|
13
15
|
# Check if API key is empty or None
|
|
@@ -2,11 +2,13 @@ from os import getenv
|
|
|
2
2
|
from textwrap import dedent
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
|
+
import json
|
|
6
|
+
from loguru import logger
|
|
7
|
+
|
|
5
8
|
import mcp.server.stdio
|
|
6
9
|
import mcp.types as types
|
|
7
10
|
from mcp.server import NotificationOptions, Server
|
|
8
11
|
from mcp.server.models import InitializationOptions
|
|
9
|
-
import json
|
|
10
12
|
|
|
11
13
|
PERPLEXITY_API_KEY = getenv("PERPLEXITY_API_KEY")
|
|
12
14
|
PERPLEXITY_API_BASE_URL = "https://api.perplexity.ai"
|
autocoder/common/mcp_tools.py
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
from typing import Dict, Any, List, Optional, Union
|
|
2
2
|
from byzerllm import prompt
|
|
3
|
-
from ..common.mcp_hub import McpHub
|
|
4
3
|
import json
|
|
5
4
|
import byzerllm
|
|
6
5
|
import re
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
from loguru import logger
|
|
9
|
-
import mcp.types as mcp_types
|
|
10
8
|
import os
|
|
11
9
|
import time
|
|
10
|
+
try:
|
|
11
|
+
import mcp.types as mcp_types
|
|
12
|
+
except ImportError:
|
|
13
|
+
mcp_types = None
|
|
14
|
+
logger.error("mcp is not installed(which requires python>=3.11), please install it by `pip install mcp`")
|
|
15
|
+
from autocoder.common.mcp_hub import McpHub
|
|
16
|
+
|
|
12
17
|
|
|
13
18
|
class McpToolCall(BaseModel):
|
|
14
19
|
server_name: str = Field(..., description="The name of the MCP server")
|
autocoder/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.296"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|