auto-coder 0.1.374__py3-none-any.whl → 0.1.376__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.374.dist-info → auto_coder-0.1.376.dist-info}/METADATA +2 -2
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/RECORD +27 -57
- autocoder/agent/base_agentic/base_agent.py +202 -52
- autocoder/agent/base_agentic/default_tools.py +38 -6
- autocoder/agent/base_agentic/tools/list_files_tool_resolver.py +83 -43
- autocoder/agent/base_agentic/tools/read_file_tool_resolver.py +88 -25
- autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py +171 -62
- autocoder/agent/base_agentic/tools/search_files_tool_resolver.py +101 -56
- autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py +5 -0
- autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py +5 -0
- autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py +145 -32
- autocoder/auto_coder_rag.py +80 -11
- autocoder/models.py +2 -2
- autocoder/rag/agentic_rag.py +217 -0
- autocoder/rag/cache/local_duckdb_storage_cache.py +63 -33
- autocoder/rag/conversation_to_queries.py +37 -5
- autocoder/rag/long_context_rag.py +161 -41
- autocoder/rag/tools/__init__.py +10 -0
- autocoder/rag/tools/recall_tool.py +163 -0
- autocoder/rag/tools/search_tool.py +126 -0
- autocoder/rag/types.py +36 -0
- autocoder/utils/_markitdown.py +59 -13
- autocoder/version.py +1 -1
- autocoder/agent/agentic_edit.py +0 -833
- autocoder/agent/agentic_edit_tools/__init__.py +0 -28
- autocoder/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py +0 -32
- autocoder/agent/agentic_edit_tools/attempt_completion_tool_resolver.py +0 -29
- autocoder/agent/agentic_edit_tools/base_tool_resolver.py +0 -29
- autocoder/agent/agentic_edit_tools/execute_command_tool_resolver.py +0 -84
- autocoder/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py +0 -75
- autocoder/agent/agentic_edit_tools/list_files_tool_resolver.py +0 -62
- autocoder/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py +0 -30
- autocoder/agent/agentic_edit_tools/read_file_tool_resolver.py +0 -36
- autocoder/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +0 -95
- autocoder/agent/agentic_edit_tools/search_files_tool_resolver.py +0 -70
- autocoder/agent/agentic_edit_tools/use_mcp_tool_resolver.py +0 -55
- autocoder/agent/agentic_edit_tools/write_to_file_tool_resolver.py +0 -98
- autocoder/agent/agentic_edit_types.py +0 -124
- autocoder/auto_coder_lang.py +0 -60
- autocoder/auto_coder_rag_client_mcp.py +0 -170
- autocoder/auto_coder_rag_mcp.py +0 -193
- autocoder/common/llm_rerank.py +0 -84
- autocoder/common/model_speed_test.py +0 -392
- autocoder/common/v2/agent/agentic_edit_conversation.py +0 -188
- autocoder/common/v2/agent/ignore_utils.py +0 -50
- autocoder/dispacher/actions/plugins/action_translate.py +0 -214
- autocoder/ignorefiles/__init__.py +0 -4
- autocoder/ignorefiles/ignore_file_utils.py +0 -63
- autocoder/ignorefiles/test_ignore_file_utils.py +0 -91
- autocoder/linters/code_linter.py +0 -588
- autocoder/rag/loaders/test_image_loader.py +0 -209
- autocoder/rag/raw_rag.py +0 -96
- autocoder/rag/simple_directory_reader.py +0 -646
- autocoder/rag/simple_rag.py +0 -404
- autocoder/regex_project/__init__.py +0 -162
- autocoder/utils/coder.py +0 -125
- autocoder/utils/tests.py +0 -37
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.374.dist-info → auto_coder-0.1.376.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auto-coder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.376
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -28,7 +28,7 @@ Requires-Dist: prompt-toolkit
|
|
|
28
28
|
Requires-Dist: tokenizers
|
|
29
29
|
Requires-Dist: aiofiles
|
|
30
30
|
Requires-Dist: readerwriterlock
|
|
31
|
-
Requires-Dist: byzerllm[saas] >=0.1.
|
|
31
|
+
Requires-Dist: byzerllm[saas] >=0.1.185
|
|
32
32
|
Requires-Dist: patch
|
|
33
33
|
Requires-Dist: diff-match-patch
|
|
34
34
|
Requires-Dist: GitPython
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
autocoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
autocoder/auto_coder.py,sha256=7602L3tG0JErNxh8vkLAmGUgv2c-DGPzPCkmWIQt9bs,69757
|
|
3
|
-
autocoder/
|
|
4
|
-
autocoder/auto_coder_rag.py,sha256=ru5o86IaKylyVRlVORmnrdf3Q1To2eWi2KLdT9FMW0k,37580
|
|
5
|
-
autocoder/auto_coder_rag_client_mcp.py,sha256=QRxUbjc6A8UmDMQ8lXgZkjgqtq3lgKYeatJbDY6rSo0,6270
|
|
6
|
-
autocoder/auto_coder_rag_mcp.py,sha256=-RrjNwFaS2e5v8XDIrKR-zlUNUE8UBaeOtojffBrvJo,8521
|
|
3
|
+
autocoder/auto_coder_rag.py,sha256=tRAKfo3jIhcaQKN_3g7DZRKtDJSZXJxMRdT6Zz8W9nw,41173
|
|
7
4
|
autocoder/auto_coder_runner.py,sha256=VktQIEWjVMmraVjD7W73eZmYtdfm9Ma2w_Ib-cWZYhM,112263
|
|
8
5
|
autocoder/auto_coder_server.py,sha256=bLORGEclcVdbBVfM140JCI8WtdrU0jbgqdJIVVupiEU,20578
|
|
9
6
|
autocoder/benchmark.py,sha256=Ypomkdzd1T3GE6dRICY3Hj547dZ6_inqJbBJIp5QMco,4423
|
|
@@ -12,12 +9,10 @@ autocoder/chat_auto_coder_lang.py,sha256=ylLr1GskchU6kIUJY2TiznrBg-ckc1o-8fDsKZZ
|
|
|
12
9
|
autocoder/command_args.py,sha256=HxflngkYtTrV17Vfgk6lyUyiG68jP2ftSc7FYr9AXwY,30585
|
|
13
10
|
autocoder/command_parser.py,sha256=fx1g9E6GaM273lGTcJqaFQ-hoksS_Ik2glBMnVltPCE,10013
|
|
14
11
|
autocoder/lang.py,sha256=PFtATuOhHRnfpqHQkXr6p4C893JvpsgwTMif3l-GEi0,14321
|
|
15
|
-
autocoder/models.py,sha256=
|
|
12
|
+
autocoder/models.py,sha256=pD5u6gcMKRwWaLxeVin18g25k-ERyeHOFsRpOgO_Ae0,13788
|
|
16
13
|
autocoder/run_context.py,sha256=IUfSO6_gp2Wt1blFWAmOpN0b0nDrTTk4LmtCYUBIoro,1643
|
|
17
|
-
autocoder/version.py,sha256=
|
|
14
|
+
autocoder/version.py,sha256=WlQ9-Qe6RwJ6NWkzY0CcSmVY8liKGWp46Zr1N44Ch2Q,25
|
|
18
15
|
autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
-
autocoder/agent/agentic_edit.py,sha256=XsfePZ-t6M-uBSdG1VLZXk1goqXk2HPeJ_A8IYyBuWQ,58896
|
|
20
|
-
autocoder/agent/agentic_edit_types.py,sha256=oFcDd_cxJ2yH9Ed1uTpD3BipudgoIEWDMPb5pAkq4gI,3288
|
|
21
16
|
autocoder/agent/agentic_filter.py,sha256=zlInIRhawKIYTJjCiJBWqPCOV5UtMbh5VnvszfTy2vo,39824
|
|
22
17
|
autocoder/agent/auto_demand_organizer.py,sha256=URAq0gSEiHeV_W4zwhOI_83kHz0Ryfj1gcfh5jwCv_w,6501
|
|
23
18
|
autocoder/agent/auto_filegroup.py,sha256=pBsAkBcpFTff-9L5OwI8xhf2xPKpl-aZwz-skF2B6dc,6296
|
|
@@ -30,25 +25,12 @@ autocoder/agent/coder.py,sha256=x6bdJwDuETGg9ebQnYlUWCxCtQcDGg73LtI6McpWslQ,7203
|
|
|
30
25
|
autocoder/agent/designer.py,sha256=EpRbzO58Xym3GrnppIT1Z8ZFAlnNfgzHbIzZ3PX-Yv8,27037
|
|
31
26
|
autocoder/agent/planner.py,sha256=2OgJsPVGmp_koEZsdcp2pvtdDzegiMAwxraPc_5GYvo,9215
|
|
32
27
|
autocoder/agent/project_reader.py,sha256=WVl-xvrzseWmv-YBg-bDbdy_OtLdqz0xdadkHc70Lf8,17747
|
|
33
|
-
autocoder/agent/agentic_edit_tools/__init__.py,sha256=wGICCc1dYh07osB21j62zOQ9Ws0PyyOQ12UYRHmHrtI,1229
|
|
34
|
-
autocoder/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py,sha256=8yQq9ypKpq8eU-P-8-p8Pia_9mLRdrqj7s9joRjGDog,1468
|
|
35
|
-
autocoder/agent/agentic_edit_tools/attempt_completion_tool_resolver.py,sha256=Y4E6KTnalEABKmSwWTA_isRITVlBz1LvDHBAOh-rkWM,1297
|
|
36
|
-
autocoder/agent/agentic_edit_tools/base_tool_resolver.py,sha256=BUvm1s0MjYAPOAapEmBHtS8SNH3HLbxf2V7KOmsszAw,909
|
|
37
|
-
autocoder/agent/agentic_edit_tools/execute_command_tool_resolver.py,sha256=XX0EawKIv8uMf9M8U84pmmOHxfh_zBfihqueJTw1GNQ,3886
|
|
38
|
-
autocoder/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py,sha256=5m9uYX2GEVzD5_2xbx9IjnykILjIemGr8SjwOArDZBo,3635
|
|
39
|
-
autocoder/agent/agentic_edit_tools/list_files_tool_resolver.py,sha256=jJUhqCqUVeaQMCOu9cNZQdJmk7NaYrORfq_NnxbtmzY,3529
|
|
40
|
-
autocoder/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py,sha256=CPQgNwx0ztBklWAXYT8rX6NoZOfega6oFL3YGP2Oh1s,1279
|
|
41
|
-
autocoder/agent/agentic_edit_tools/read_file_tool_resolver.py,sha256=YFAcudkhotv8vkiRukuOlKLTuqcas97z976dZmuzXB8,1895
|
|
42
|
-
autocoder/agent/agentic_edit_tools/replace_in_file_tool_resolver.py,sha256=A2ODUC5YQ2K3ze-Mw5QqriWYlEe8Z3pXW8nJacizpNk,5095
|
|
43
|
-
autocoder/agent/agentic_edit_tools/search_files_tool_resolver.py,sha256=Xx0nqrgBUP7MZuigdy_hjO89v1CgQEDE75O9la3VJbE,3754
|
|
44
|
-
autocoder/agent/agentic_edit_tools/use_mcp_tool_resolver.py,sha256=5WWH8-lEZO29dLOby9GNjkr-JH5rW8UT-7JZ1LuUtM8,2531
|
|
45
|
-
autocoder/agent/agentic_edit_tools/write_to_file_tool_resolver.py,sha256=HPX1g7Nh7H8I3P2MNmIK4HXLh8IZYaedQgRZAeGxNdc,5135
|
|
46
28
|
autocoder/agent/base_agentic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
29
|
autocoder/agent/base_agentic/agent_hub.py,sha256=3Al9rCKu-SRgAs1kvnMe4VIIErTIw85QTkhfFu5omO8,5605
|
|
48
30
|
autocoder/agent/base_agentic/agentic_lang.py,sha256=UCq1NY9USaYJakTWc-3cv_MeHxAb6se1PI4lsSwGrPM,3657
|
|
49
31
|
autocoder/agent/base_agentic/agentic_tool_display.py,sha256=UnAq8ovvpu88KLk19Ff0TW-Dq-k7YiRwZiIJgcYPwiY,6989
|
|
50
|
-
autocoder/agent/base_agentic/base_agent.py,sha256=
|
|
51
|
-
autocoder/agent/base_agentic/default_tools.py,sha256=
|
|
32
|
+
autocoder/agent/base_agentic/base_agent.py,sha256=fEmyoN1CGtioT1BlgrHWO4F4UyAnr_4IUqO7cEvijvc,93163
|
|
33
|
+
autocoder/agent/base_agentic/default_tools.py,sha256=gCzw6pJA95ERXWwSlAm1SVxmzAvJmi-O6nrmLcNStCc,34200
|
|
52
34
|
autocoder/agent/base_agentic/test_base_agent.py,sha256=jok9f-DoEagzZRWjk-Zpy3gKw2ztZrsNzEc0XlvE7HU,2804
|
|
53
35
|
autocoder/agent/base_agentic/tool_registry.py,sha256=YFnUXJ78y7g3pm3yGgrhZ-0mx-C1ctdcA0r_ljGiE6o,14292
|
|
54
36
|
autocoder/agent/base_agentic/types.py,sha256=y9BvgN1a38EWB3cIGYTgxPYsrHql09HyqdFmL7e76jQ,4159
|
|
@@ -59,15 +41,15 @@ autocoder/agent/base_agentic/tools/attempt_completion_tool_resolver.py,sha256=9a
|
|
|
59
41
|
autocoder/agent/base_agentic/tools/base_tool_resolver.py,sha256=Y0PmRPhBLLdZpr2DNV0W5goGfAqylM5m1bHxa3T6vAY,1009
|
|
60
42
|
autocoder/agent/base_agentic/tools/example_tool_resolver.py,sha256=8WBIqEH_76S0iBHBM3RhLkk14UpJ28lRAw6dNUT-0no,1388
|
|
61
43
|
autocoder/agent/base_agentic/tools/execute_command_tool_resolver.py,sha256=FDWheOy2NVG1RDeG2lhMlj0cFjG4UpqCkWPRMEM7Atc,3755
|
|
62
|
-
autocoder/agent/base_agentic/tools/list_files_tool_resolver.py,sha256=
|
|
44
|
+
autocoder/agent/base_agentic/tools/list_files_tool_resolver.py,sha256=SCAYAiqmgwuCLMwRwroUQFfVS_hbcuAoG9-jIJxiB1c,8061
|
|
63
45
|
autocoder/agent/base_agentic/tools/plan_mode_respond_tool_resolver.py,sha256=hiLdMRknR_Aljd7Ic2bOWZKs11aFHdhkRTKTlP3IIgw,1461
|
|
64
|
-
autocoder/agent/base_agentic/tools/read_file_tool_resolver.py,sha256=
|
|
65
|
-
autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py,sha256=
|
|
66
|
-
autocoder/agent/base_agentic/tools/search_files_tool_resolver.py,sha256=
|
|
67
|
-
autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py,sha256=
|
|
68
|
-
autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py,sha256=
|
|
46
|
+
autocoder/agent/base_agentic/tools/read_file_tool_resolver.py,sha256=egcxrXv32stvhB3QawE2k62-9W5U3TNuY3qoTyKKhs0,5076
|
|
47
|
+
autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py,sha256=rc1tVaCMfhtpB0qxep4SBFSklRYHgfOATEPlIEFT_G8,12745
|
|
48
|
+
autocoder/agent/base_agentic/tools/search_files_tool_resolver.py,sha256=cMcfA_3swonPvQiDl_73fPgcQgr5BaUVwMJfj2Btqak,9528
|
|
49
|
+
autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py,sha256=uf_KGvL4xo6Aj4D03xvR95jpF6nzpSsymb7D74mMqBI,3549
|
|
50
|
+
autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py,sha256=1uEtR2e0Eq5ckOPqHn6K0BKgyZL6Lk-BP0V4-awvNhg,2790
|
|
69
51
|
autocoder/agent/base_agentic/tools/use_mcp_tool_resolver.py,sha256=Ph63zm6973nxRdRINV3ME0rhDWqtaEveHqLjEEMN02I,1554
|
|
70
|
-
autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py,sha256=
|
|
52
|
+
autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py,sha256=ZvNt6HIBHo0KhYbrGa_-2LOntjsXFKUIrmy8V-rIMfs,7996
|
|
71
53
|
autocoder/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
54
|
autocoder/chat/conf_command.py,sha256=sqsZEjFXUCaCydXbqLU_ockpwQ7efQCicEd-hjD29ts,11353
|
|
73
55
|
autocoder/chat/models_command.py,sha256=yISjvqNbKHVapGcXMcsIwRFfPruJ5ruSqR_e8TqhaPw,20105
|
|
@@ -115,14 +97,12 @@ autocoder/common/global_cancel.py,sha256=EYMIzdIJHQjoYP4grxhBxSIT3tCJOy3ESULNd-c
|
|
|
115
97
|
autocoder/common/image_to_page.py,sha256=yWiTJQ49Lm3j0FngiJhQ9u7qayqE_bOGb8Rk0TmSWx0,14123
|
|
116
98
|
autocoder/common/index_import_export.py,sha256=h758AYY1df6JMTKUXYmMkSgxItfymDt82XT7O-ygEuw,4565
|
|
117
99
|
autocoder/common/interpreter.py,sha256=62-dIakOunYB4yjmX8SHC0Gdy2h8NtxdgbpdqRZJ5vk,2833
|
|
118
|
-
autocoder/common/llm_rerank.py,sha256=FbvtCzaR661Mt2wn0qsuiEL1Y3puD6jeIJS4zg_e7Bs,3260
|
|
119
100
|
autocoder/common/mcp_hub.py,sha256=grf51bZbZDXQIqlruIxXZjfat8MoVwK7NvHTHMaxKrg,23614
|
|
120
101
|
autocoder/common/mcp_server.py,sha256=Aj6snmB4XXEcLpcm7SC-KBbNLOlEmiNW6hFtMLltpt8,17624
|
|
121
102
|
autocoder/common/mcp_server_install.py,sha256=vQOWWZsl6MZ2qz3b7Y2zctKOEGO69Ph2Nrof4p_1SOg,11599
|
|
122
103
|
autocoder/common/mcp_server_types.py,sha256=ijGnMID7Egq3oOn2t7_BJj7JUisDwhUyClZCUsEMsdY,4393
|
|
123
104
|
autocoder/common/mcp_tools.py,sha256=YdEhDzRnwAr2J3D-23ExIQFWbrNO-EUpIxg179qs9Sw,12666
|
|
124
105
|
autocoder/common/memory_manager.py,sha256=Xx6Yv0ULxVfcFfmD36hdHFFhxCgRAs-5fTd0fLHJrpQ,3773
|
|
125
|
-
autocoder/common/model_speed_test.py,sha256=U48xUUpOnbwUal1cdij4YAn_H2PD2pNaqrMHaYtQRfI,15200
|
|
126
106
|
autocoder/common/model_speed_tester.py,sha256=U48xUUpOnbwUal1cdij4YAn_H2PD2pNaqrMHaYtQRfI,15200
|
|
127
107
|
autocoder/common/openai_content.py,sha256=M_V_UyHrqNVWjgrYvxfAupZw2I0Nr3iilYv6SxSvfLA,8091
|
|
128
108
|
autocoder/common/printer.py,sha256=T4XTAcQp5w1ZWYx5NAUXlIGd-9500Vl0JaG1JJXMdkg,2030
|
|
@@ -193,10 +173,8 @@ autocoder/common/v2/code_manager.py,sha256=C403bS-f6urixwitlKHcml-J03hci-UyNwHJO
|
|
|
193
173
|
autocoder/common/v2/code_strict_diff_manager.py,sha256=Bys7tFAq4G03R1zUZuxrszBTvP4QB96jIw2y5BDLyRM,9424
|
|
194
174
|
autocoder/common/v2/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
195
175
|
autocoder/common/v2/agent/agentic_edit.py,sha256=GqzwD-YIuftxz6IGPonE8spxcPBCAiImHPsKuVLQIJE,116459
|
|
196
|
-
autocoder/common/v2/agent/agentic_edit_conversation.py,sha256=pFgWPWHKhZ4J9EcFmIdiGsrSolTZuYcH1qkgKdD8nwk,7726
|
|
197
176
|
autocoder/common/v2/agent/agentic_edit_types.py,sha256=nEcZc2MOZ_fQLaJX-YDha_x9Iim22ao4tykYM2iIy4k,4908
|
|
198
177
|
autocoder/common/v2/agent/agentic_tool_display.py,sha256=-a-JTQLc4q03E_rdIILKMI0B6DHN-5gcGlrqq-mBYK4,7239
|
|
199
|
-
autocoder/common/v2/agent/ignore_utils.py,sha256=gnUchRzKMLbUm_jvnKL-r-K9MWKPtt-6iiuzijY7Es0,1717
|
|
200
178
|
autocoder/common/v2/agent/agentic_edit_tools/__init__.py,sha256=RbPZZcZg_VnGssL577GxSyFrYrxQ_LopJ4G_-mY3z_Q,1337
|
|
201
179
|
autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py,sha256=-HFXo3RR6CH8xXjDaE2mYV4XasTLAmvXe6WutL7qbwA,3208
|
|
202
180
|
autocoder/common/v2/agent/agentic_edit_tools/attempt_completion_tool_resolver.py,sha256=82ZGKeRBSDKeead_XVBW4FxpiE-5dS7tBOk_3RZ6B5s,1511
|
|
@@ -236,7 +214,6 @@ autocoder/dispacher/actions/action.py,sha256=lszFrNZOmmFMJC0QaIjS-OEE2du5i6a81Nj
|
|
|
236
214
|
autocoder/dispacher/actions/copilot.py,sha256=2nQzKt8Sr40mIDOizZWyl4ekCwaHYklvgGlVfvhOlFM,13106
|
|
237
215
|
autocoder/dispacher/actions/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
238
216
|
autocoder/dispacher/actions/plugins/action_regex_project.py,sha256=mziGcOtGafeABVITyNdHzCuI_-rorUlWoo1JfsXnPuk,7863
|
|
239
|
-
autocoder/dispacher/actions/plugins/action_translate.py,sha256=GEn7dZA22jy5WyzINomjmzzB795p2Olg-CJla97lRF8,7744
|
|
240
217
|
autocoder/events/__init__.py,sha256=1x_juwr9Ows2RADDa2LyI4QlmPxOVOXZeLO1cht-slM,1443
|
|
241
218
|
autocoder/events/event_content.py,sha256=eLHf5M1BifSqhzzEBgAWKn3JD5_z_1mWeNdZ53TpMqk,12240
|
|
242
219
|
autocoder/events/event_manager.py,sha256=--V3sEdoSmYDCXqJXRMaMa1qWR9umuv9Cjd5Czjpavc,11887
|
|
@@ -246,9 +223,6 @@ autocoder/events/event_types.py,sha256=W_S6PTDIBdufcuPosgz64iITzQy79flL8s3hWB-vZ
|
|
|
246
223
|
autocoder/helper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
247
224
|
autocoder/helper/project_creator.py,sha256=sgXrZyAaGc84aUT7K7d7N1ztT-mSNGoLnsT-uKMUvVw,21472
|
|
248
225
|
autocoder/helper/rag_doc_creator.py,sha256=A3lB_jr1KU4bxLbBTX9-nxyylwDirxSi1NXmbPTnp90,4386
|
|
249
|
-
autocoder/ignorefiles/__init__.py,sha256=P0hq7Avu1IeXBYEkPBZLsJhFzhzyktUWTqaRIXiAFLY,75
|
|
250
|
-
autocoder/ignorefiles/ignore_file_utils.py,sha256=atJ_LEhRn-3NamBFl0Y9hJPG0cEt3nL9lVGHBweEOW0,1782
|
|
251
|
-
autocoder/ignorefiles/test_ignore_file_utils.py,sha256=961_5ilCgzyo09Luj457A4694OzZDggmQEoiAkldMcU,3104
|
|
252
226
|
autocoder/index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
253
227
|
autocoder/index/entry.py,sha256=Eb0SmwrgshQte3_IGL4GAB4_HXC2jbatrgrd2uPxQng,15306
|
|
254
228
|
autocoder/index/for_command.py,sha256=BFvljE4t6VaMBGboZAuhUCzVK0EitCy_n5D_7FEnihw,3204
|
|
@@ -260,7 +234,6 @@ autocoder/index/filter/normal_filter.py,sha256=W8UD2a8yWRx41PBx-GzlLETEkU9uhDnQc
|
|
|
260
234
|
autocoder/index/filter/quick_filter.py,sha256=ozESEgy506FQ5ecjOumyo4D_KMrterB1QLmnVtiyOiM,43264
|
|
261
235
|
autocoder/linters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
262
236
|
autocoder/linters/base_linter.py,sha256=1_0DPESnSyF3ZcQhoFkBYJylT5w-B61Rx-3A9uhuPlg,3066
|
|
263
|
-
autocoder/linters/code_linter.py,sha256=JylTj-Mj4jl9-XSH3PVlbQ4l55Y6E1FG-glv860CGSs,22462
|
|
264
237
|
autocoder/linters/linter_factory.py,sha256=BgGeXPdli7BgiN9BifWoosyn9BGeJnRwSqX0G1R8qvU,10471
|
|
265
238
|
autocoder/linters/models.py,sha256=GBdayu_p50KBxoRms4X68zrDK-OsKDEKKjo926FevwE,9838
|
|
266
239
|
autocoder/linters/normal_linter.py,sha256=ezToVW33psvBXsGhE7y1ng7ucf7yT_1YuIULns6TXYM,13011
|
|
@@ -283,21 +256,19 @@ autocoder/privacy/__init__.py,sha256=LnIVvGu_K66zCE-yhN_-dPO8R80pQyedCsXJ7wRqQaI
|
|
|
283
256
|
autocoder/privacy/model_filter.py,sha256=RyGh_uWWE6hHqvaYZGjFylDJldDLxBz5LDZP7CG3sTo,14178
|
|
284
257
|
autocoder/pyproject/__init__.py,sha256=qn0_-6O_LP-ZH91nneYrn3yaIMYCYYRD1Z3MSNhXUXI,13754
|
|
285
258
|
autocoder/rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
259
|
+
autocoder/rag/agentic_rag.py,sha256=v9UuihbUXcQLXi1u_WLPhtZIzKigHJNQot8DpcAV4Zc,8344
|
|
286
260
|
autocoder/rag/api_server.py,sha256=TNN5CmR1nlMgeuZVYZ1U3a48XBp647Io9P-VvCkdI9o,13936
|
|
287
|
-
autocoder/rag/conversation_to_queries.py,sha256=
|
|
261
|
+
autocoder/rag/conversation_to_queries.py,sha256=QUeRacDZVVd5XiDvKZ1G71h2QpfmfZldc27Is6sTMdU,6508
|
|
288
262
|
autocoder/rag/doc_filter.py,sha256=UduVO2mlrngwJICrefjDJTYfdmQ4GcRXrfWDQ7xXksk,14206
|
|
289
263
|
autocoder/rag/document_retriever.py,sha256=rFwbAuHTvEFJq16HQNlmRLyJp2ddn2RNFslw_ncU7NI,8847
|
|
290
264
|
autocoder/rag/lang.py,sha256=HvcMeu6jReEJOGxyLMn4rwBoD-myFwmykS3VLceBJLs,3364
|
|
291
265
|
autocoder/rag/llm_wrapper.py,sha256=LsNv8maCnvazyXjjtkO9aN3OT7Br20V1ilHV8Lt45Os,4245
|
|
292
|
-
autocoder/rag/long_context_rag.py,sha256=
|
|
266
|
+
autocoder/rag/long_context_rag.py,sha256=s00w7Ep6nWjRS0Xy8m2qUCvAaH3CgqLLvh6N5d5ssII,50029
|
|
293
267
|
autocoder/rag/qa_conversation_strategy.py,sha256=4CiMK88apKbJ2YM4HHq1KGpr5jUkTh0_m_aCyt-JYgc,10568
|
|
294
268
|
autocoder/rag/rag_config.py,sha256=8LwFcTd8OJWWwi1_WY4IzjqgtT6RyE2j4PjxS5cCTDE,802
|
|
295
269
|
autocoder/rag/rag_entry.py,sha256=QOdUX_nd1Qak2NyOW0CYcLRDB26AZ6MeByHJaMMGgqs,2316
|
|
296
|
-
autocoder/rag/raw_rag.py,sha256=BOr0YGf3umjqXOIDVO1LXQ0bIHx8hzBdiubND2ezyxc,2946
|
|
297
270
|
autocoder/rag/relevant_utils.py,sha256=25wRiX-CrBsratASLGHsZE3ux7VjwaQoDNtl74UlV5U,1749
|
|
298
271
|
autocoder/rag/searchable.py,sha256=miO2U-3J9JDYFOEv85vs9JExDQ0goLIeI20Ob2rNqU4,2067
|
|
299
|
-
autocoder/rag/simple_directory_reader.py,sha256=LkKreCkNdEOoL4fNhc3_hDoyyWTQUte4uqextISRz4U,24485
|
|
300
|
-
autocoder/rag/simple_rag.py,sha256=I902EUqOK1WM0Y2WFd7RzDJYofElvTZNLVCBtX5A9rc,14885
|
|
301
272
|
autocoder/rag/test_doc_filter.py,sha256=eE6IiMknCHDMVbdyOBQQVTKiyAnX1tAm7qFyfxmXSN0,15301
|
|
302
273
|
autocoder/rag/test_long_context_rag.py,sha256=hn50GKhXyRrlJ1mP9RI4bnObR6pZb2yDmJRcZmVSzVU,18365
|
|
303
274
|
autocoder/rag/test_token_limiter.py,sha256=rJmLUqPalkznL7PskKabuqu5dC6Yj-kWa498TaVMjAY,13744
|
|
@@ -305,7 +276,7 @@ autocoder/rag/token_checker.py,sha256=jc76x6KWmvVxds6W8juZfQGaoErudc2HenG3sNQfSL
|
|
|
305
276
|
autocoder/rag/token_counter.py,sha256=C-Lwc4oIjJpZDEqp9WLHGOe6hb4yhrdJpMtkrtp_1qc,2125
|
|
306
277
|
autocoder/rag/token_limiter.py,sha256=3VgJF4may3ESyATmBIiOe05oc3VsidJcJTJ5EhoSvH8,18854
|
|
307
278
|
autocoder/rag/token_limiter_utils.py,sha256=FATNEXBnFJy8IK3PWNt1pspIv8wuTgy3F_ACNvqoc4I,404
|
|
308
|
-
autocoder/rag/types.py,sha256=
|
|
279
|
+
autocoder/rag/types.py,sha256=G6A3P5YN-VBUgUX2TFSWRCKRDJq42fUxVIf46DL8fNI,3280
|
|
309
280
|
autocoder/rag/utils.py,sha256=FPK3Vvk9X9tUuOu4_LctZN5WnRVuEjFiffRtE-pHn0s,6318
|
|
310
281
|
autocoder/rag/variable_holder.py,sha256=PFvBjFcR7-fNDD4Vcsc8CpH2Te057vcpwJMxtrfUgKI,75
|
|
311
282
|
autocoder/rag/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -315,7 +286,7 @@ autocoder/rag/cache/cache_result_merge.py,sha256=VnTdbT2OMBmWl_83bqds97d9_M33IhP
|
|
|
315
286
|
autocoder/rag/cache/failed_files_utils.py,sha256=kITguXANLC3EEJy5JoKzNXrtwvTkmZT-ANPwcno42Ck,1183
|
|
316
287
|
autocoder/rag/cache/file_monitor_cache.py,sha256=lwNrm8epdA3ubc3X3q_BCU1zr_Ul5gEOaM5X5ICeeeQ,9580
|
|
317
288
|
autocoder/rag/cache/local_byzer_storage_cache.py,sha256=iekuUFacUZOVeIqp9Sjgm0DuAeBOmmW3eMk3HQtG0fE,31197
|
|
318
|
-
autocoder/rag/cache/local_duckdb_storage_cache.py,sha256=
|
|
289
|
+
autocoder/rag/cache/local_duckdb_storage_cache.py,sha256=8nViKW4oBtDXmoWGgi97jQ3KGWYJzdWfWzxWp3yCZzI,36753
|
|
319
290
|
autocoder/rag/cache/rag_file_meta.py,sha256=RQ3n4wfkHlB-1ljS3sFSi8ijbsUPeIqBSgjmmbRuwRI,20521
|
|
320
291
|
autocoder/rag/cache/simple_cache.py,sha256=oT5tBSsBkUQ5DNVBzz5P3QJih-wKWdPyCAjmtFgl90Q,18270
|
|
321
292
|
autocoder/rag/loaders/__init__.py,sha256=EQHEZ5Cmz-mGP2SllUTvcIbYCnF7W149dNpNItfs0yE,304
|
|
@@ -325,20 +296,20 @@ autocoder/rag/loaders/filter_utils.py,sha256=Y-m8ckhCQvwTaPtcnlY66dhaHBzNtyhXbXE
|
|
|
325
296
|
autocoder/rag/loaders/image_loader.py,sha256=953bS8u6CeZzFF8CAH4M38N9ZjwG8ghsWOGNAyBnX5I,23318
|
|
326
297
|
autocoder/rag/loaders/pdf_loader.py,sha256=S9hYCC-4XAKliKVbCrVkuNLetOvJVRtIzef_gjbNJpM,779
|
|
327
298
|
autocoder/rag/loaders/ppt_loader.py,sha256=7VEYc-bqgK8VHCoGC3DIUcqbpda-E5jQF9lYLqP256I,1681
|
|
328
|
-
autocoder/rag/loaders/test_image_loader.py,sha256=oy_j8xkFgPZ0vhz6czTVPh7IwdVWkgh5gE-UA2xCATQ,5753
|
|
329
299
|
autocoder/rag/stream_event/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
330
300
|
autocoder/rag/stream_event/event_writer.py,sha256=l7kq_LnDDE8E5dZ-73C7J2MgzSL7WrozdXk0eV-k55Q,409
|
|
331
301
|
autocoder/rag/stream_event/types.py,sha256=rtLwOE8rShmi1dJdxyBpAV5ZjLBGG9vptMiSzMxGuIA,318
|
|
332
|
-
autocoder/
|
|
302
|
+
autocoder/rag/tools/__init__.py,sha256=3U91ZI4wZh8UYYl_D11IyLxBLseemmPVfBnmh4ZzNgw,376
|
|
303
|
+
autocoder/rag/tools/recall_tool.py,sha256=z-EEyfeD1JR5Mdk9Obi3FJyW-5Q7ljH97Rtd_vlk-Tk,6487
|
|
304
|
+
autocoder/rag/tools/search_tool.py,sha256=HaIA-H66oJwUisk_mpDJQw28TgVHzNxA5JOBbX1y6q8,4702
|
|
333
305
|
autocoder/regexproject/__init__.py,sha256=QMXphSxjuv_LDIx0L_0jnnvCzMfmrOl0VMTVmXabeL0,8976
|
|
334
306
|
autocoder/shadows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
335
307
|
autocoder/shadows/shadow_manager.py,sha256=atY6d9Si4twe3pqQ56SjMje5W1VxamPSZs_WzQtAQvM,19165
|
|
336
308
|
autocoder/suffixproject/__init__.py,sha256=Rew-M9W4pgO9cvw9UCdrc6QVCPdBhVcIpPBnJxrLJ3M,10374
|
|
337
309
|
autocoder/tsproject/__init__.py,sha256=e_TWVyXQQxYKsXqdQZuFVqNCQLdtBVNJRTs0fgLXVdA,11055
|
|
338
310
|
autocoder/utils/__init__.py,sha256=W47ac6IOZhNR1rdbho9fvhHnPI_N1i4oMcZOwxLelbU,1123
|
|
339
|
-
autocoder/utils/_markitdown.py,sha256=
|
|
311
|
+
autocoder/utils/_markitdown.py,sha256=zrhWztp3cwChtOZ66aCtq7xX-w25cT_eaX5qX-7OaVo,54730
|
|
340
312
|
autocoder/utils/auto_project_type.py,sha256=9_-wE9aavjbPiNSUVKxttJAdu5i5fu-zHyPYHr5XtWk,4422
|
|
341
|
-
autocoder/utils/coder.py,sha256=rK8e0svQBe0NOP26dIGToUXgha_hUDgxlWoC_p_r7oc,5698
|
|
342
313
|
autocoder/utils/conversation_store.py,sha256=esd9zLarKYe0ZsYqjjwHc_ksmVQDDEhVt-Ejul2oyys,1178
|
|
343
314
|
autocoder/utils/llm_client_interceptors.py,sha256=FEHNXoFZlCjAHQcjPRyX8FOMjo6rPXpO2AJ2zn2KTTo,901
|
|
344
315
|
autocoder/utils/llms.py,sha256=CQRNsX8SJBpeHl_zJ1N-Nj-MYyqkFCi3zETYSurCMkU,4021
|
|
@@ -353,15 +324,14 @@ autocoder/utils/request_event_queue.py,sha256=r3lo5qGsB1dIjzVQ05dnr0z_9Z3zOkBdP1
|
|
|
353
324
|
autocoder/utils/request_queue.py,sha256=nwp6PMtgTCiuwJI24p8OLNZjUiprC-TsefQrhMI-yPE,3889
|
|
354
325
|
autocoder/utils/rest.py,sha256=hLBhr78y-WVnV0oQf9Rxc22EwqF78KINkScvYa1MuYA,6435
|
|
355
326
|
autocoder/utils/stream_thinking.py,sha256=vbDObflBFW53eWEjMTEHf3nyL167_cqpDLh9zRx7Yk8,7015
|
|
356
|
-
autocoder/utils/tests.py,sha256=BqphrwyycGAvs-5mhH8pKtMZdObwhFtJ5MC_ZAOiLq8,1340
|
|
357
327
|
autocoder/utils/thread_utils.py,sha256=1x17W-xkbUCInrdXDBStbkJbpGHLbWHhCpZLjz95Lrw,4579
|
|
358
328
|
autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
359
329
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
360
330
|
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=t902pKxQ5xM7zgIHiAOsTPLwxhE6VuvXAqPy751S7fg,14096
|
|
361
331
|
autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
362
|
-
auto_coder-0.1.
|
|
363
|
-
auto_coder-0.1.
|
|
364
|
-
auto_coder-0.1.
|
|
365
|
-
auto_coder-0.1.
|
|
366
|
-
auto_coder-0.1.
|
|
367
|
-
auto_coder-0.1.
|
|
332
|
+
auto_coder-0.1.376.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
333
|
+
auto_coder-0.1.376.dist-info/METADATA,sha256=jMYPZc3mVRfyM_z1gb-53unRBkj65IIOv3MFSXC8ffw,2775
|
|
334
|
+
auto_coder-0.1.376.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
335
|
+
auto_coder-0.1.376.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
|
|
336
|
+
auto_coder-0.1.376.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
337
|
+
auto_coder-0.1.376.dist-info/RECORD,,
|
|
@@ -24,7 +24,7 @@ from autocoder.common.printer import Printer
|
|
|
24
24
|
from autocoder.utils.auto_project_type import ProjectTypeAnalyzer
|
|
25
25
|
from autocoder.common.mcp_server import get_mcp_server, McpServerInfoRequest
|
|
26
26
|
from autocoder.common.file_monitor.monitor import FileMonitor
|
|
27
|
-
from autocoder.common.rulefiles.autocoderrules_utils import
|
|
27
|
+
from autocoder.common.rulefiles.autocoderrules_utils import get_required_and_index_rules
|
|
28
28
|
from autocoder.auto_coder_runner import load_tokenizer
|
|
29
29
|
from autocoder.linters.shadow_linter import ShadowLinter
|
|
30
30
|
from autocoder.compilers.shadow_compiler import ShadowCompiler
|
|
@@ -34,6 +34,10 @@ from autocoder.events.event_types import Event, EventType, EventMetadata
|
|
|
34
34
|
from autocoder.events import event_content as EventContentCreator
|
|
35
35
|
from autocoder.memory.active_context_manager import ActiveContextManager
|
|
36
36
|
from autocoder.common.action_yml_file_manager import ActionYmlFileManager
|
|
37
|
+
from autocoder.common.file_checkpoint.models import FileChange as CheckpointFileChange
|
|
38
|
+
from autocoder.common.file_checkpoint.manager import FileChangeManager as CheckpointFileChangeManager
|
|
39
|
+
from autocoder.linters.normal_linter import NormalLinter
|
|
40
|
+
from autocoder.compilers.normal_compiler import NormalCompiler
|
|
37
41
|
|
|
38
42
|
from .types import (
|
|
39
43
|
BaseTool, ToolResult, AgentRequest, FileChangeEntry,
|
|
@@ -64,6 +68,7 @@ class BaseAgent(ABC):
|
|
|
64
68
|
files: SourceCodeList,
|
|
65
69
|
args: AutoCoderArgs,
|
|
66
70
|
conversation_history: Optional[List[Dict[str, Any]]] = None,
|
|
71
|
+
default_tools_list: Optional[List[str]] = None
|
|
67
72
|
):
|
|
68
73
|
"""
|
|
69
74
|
初始化代理
|
|
@@ -102,9 +107,21 @@ class BaseAgent(ABC):
|
|
|
102
107
|
|
|
103
108
|
# 5. 初始化其他组件
|
|
104
109
|
self.project_type_analyzer = ProjectTypeAnalyzer(args=args, llm=self.llm)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
self.
|
|
110
|
+
# self.shadow_manager = ShadowManager(
|
|
111
|
+
# args.source_dir, args.event_file, args.ignore_clean_shadows)
|
|
112
|
+
self.shadow_manager = None
|
|
113
|
+
# self.shadow_linter = ShadowLinter(self.shadow_manager, verbose=False)
|
|
114
|
+
self.shadow_compiler = None
|
|
115
|
+
# self.shadow_compiler = ShadowCompiler(self.shadow_manager, verbose=False)
|
|
116
|
+
self.shadow_linter = None
|
|
117
|
+
|
|
118
|
+
self.checkpoint_manager = CheckpointFileChangeManager(
|
|
119
|
+
project_dir=args.source_dir,
|
|
120
|
+
backup_dir=os.path.join(args.source_dir,".auto-coder","checkpoint"),
|
|
121
|
+
store_dir=os.path.join(args.source_dir,".auto-coder","checkpoint_store"),
|
|
122
|
+
max_history=50)
|
|
123
|
+
self.linter = NormalLinter(args.source_dir,verbose=False)
|
|
124
|
+
self.compiler = NormalCompiler(args.source_dir,verbose=False)
|
|
108
125
|
|
|
109
126
|
|
|
110
127
|
|
|
@@ -138,7 +155,7 @@ class BaseAgent(ABC):
|
|
|
138
155
|
self._chat_lock = threading.RLock() # 保护 private_chats
|
|
139
156
|
# 自动注册到AgentHub
|
|
140
157
|
AgentHub.register_agent(self)
|
|
141
|
-
register_default_tools(params=self._render_context())
|
|
158
|
+
register_default_tools(params=self._render_context(), default_tools_list=default_tools_list)
|
|
142
159
|
|
|
143
160
|
|
|
144
161
|
def who_am_i(self, role: str) -> 'BaseAgent':
|
|
@@ -494,15 +511,16 @@ class BaseAgent(ABC):
|
|
|
494
511
|
{%endif%}
|
|
495
512
|
|
|
496
513
|
# Tool Use Examples
|
|
497
|
-
{
|
|
498
|
-
{
|
|
499
|
-
{
|
|
500
|
-
{
|
|
514
|
+
{% set example_count = 0 %}
|
|
515
|
+
{% for tool_tag, example in tool_examples.items() %}
|
|
516
|
+
{% if example %}
|
|
517
|
+
{% set example_count = example_count + 1 %}
|
|
501
518
|
## Example {{ example_count }}: {{ example.title }}
|
|
502
519
|
{{ example.body }}
|
|
503
|
-
{
|
|
504
|
-
{
|
|
520
|
+
{% endif %}
|
|
521
|
+
{% endfor %}
|
|
505
522
|
|
|
523
|
+
|
|
506
524
|
# Tool Use Guidelines
|
|
507
525
|
|
|
508
526
|
1. In <thinking> tags, assess what information you already have and what information you need to proceed with the task.
|
|
@@ -515,9 +533,9 @@ class BaseAgent(ABC):
|
|
|
515
533
|
- New terminal output in reaction to the changes, which you may need to consider or act upon.
|
|
516
534
|
- Any other relevant feedback or information related to the tool use.
|
|
517
535
|
6. ALWAYS wait for user confirmation after each tool use before proceeding. Never assume the success of a tool use without explicit confirmation of the result from the user.
|
|
518
|
-
{
|
|
536
|
+
{% for tool_name, guideline in tool_guidelines.items() %}
|
|
519
537
|
{{ loop.index + 6 }}. **{{ tool_name }}**: {{ guideline }}
|
|
520
|
-
{
|
|
538
|
+
{% endfor %}
|
|
521
539
|
|
|
522
540
|
It is crucial to proceed step-by-step, waiting for the user's message after each tool use before moving forward with the task. This approach allows you to:
|
|
523
541
|
1. Confirm the success of each step before proceeding.
|
|
@@ -536,28 +554,7 @@ class BaseAgent(ABC):
|
|
|
536
554
|
|
|
537
555
|
{{ case_info.doc }}
|
|
538
556
|
{% endfor %}
|
|
539
|
-
|
|
540
|
-
====
|
|
541
|
-
|
|
542
|
-
ACT MODE V.S. PLAN MODE
|
|
543
|
-
|
|
544
|
-
In each user message, the environment_details will specify the current mode. There are two modes:
|
|
545
|
-
|
|
546
|
-
- ACT MODE: In this mode, you have access to all tools EXCEPT the plan_mode_respond tool.
|
|
547
|
-
- In ACT MODE, you use tools to accomplish the user's task. Once you've completed the user's task, you use the attempt_completion tool to present the result of the task to the user.
|
|
548
|
-
- PLAN MODE: In this special mode, you have access to the plan_mode_respond tool.
|
|
549
|
-
- In PLAN MODE, the goal is to gather information and get context to create a detailed plan for accomplishing the task, which the user will review and approve before they switch you to ACT MODE to implement the solution.
|
|
550
|
-
- In PLAN MODE, when you need to converse with the user or present a plan, you should use the plan_mode_respond tool to deliver your response directly, rather than using <thinking> tags to analyze when to respond. Do not talk about using plan_mode_respond - just use it directly to share your thoughts and provide helpful answers.
|
|
551
|
-
|
|
552
|
-
## What is PLAN MODE?
|
|
553
|
-
|
|
554
|
-
- While you are usually in ACT MODE, the user may switch to PLAN MODE in order to have a back and forth with you to plan how to best accomplish the task.
|
|
555
|
-
- When starting in PLAN MODE, depending on the user's request, you may need to do some information gathering e.g. using read_file or search_files to get more context about the task. You may also ask the user clarifying questions to get a better understanding of the task. You may return mermaid diagrams to visually display your understanding.
|
|
556
|
-
- Once you've gained more context about the user's request, you should architect a detailed plan for how you will accomplish the task. Returning mermaid diagrams may be helpful here as well.
|
|
557
|
-
- Then you might ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and plan the best way to accomplish it.
|
|
558
|
-
- If at any point a mermaid diagram would make your plan clearer to help the user quickly see the structure, you are encouraged to include a Mermaid code block in the response. (Note: if you use colors in your mermaid diagrams, be sure to use high contrast colors so the text is readable.)
|
|
559
|
-
- Finally once it seems like you've reached a good plan, ask the user to switch you back to ACT MODE to implement the solution.
|
|
560
|
-
|
|
557
|
+
|
|
561
558
|
{% if enable_active_context_in_generate %}
|
|
562
559
|
====
|
|
563
560
|
|
|
@@ -623,16 +620,20 @@ class BaseAgent(ABC):
|
|
|
623
620
|
{% if extra_docs %}
|
|
624
621
|
====
|
|
625
622
|
|
|
626
|
-
RULES PROVIDED BY USER
|
|
623
|
+
RULES OR DOCUMENTS PROVIDED BY USER
|
|
627
624
|
|
|
628
625
|
The following rules are provided by the user, and you must follow them strictly.
|
|
629
626
|
|
|
627
|
+
<user_rule_or_document_files>
|
|
630
628
|
{% for key, value in extra_docs.items() %}
|
|
631
|
-
<
|
|
629
|
+
<user_rule_or_document_file>
|
|
632
630
|
##File: {{ key }}
|
|
633
631
|
{{ value }}
|
|
634
|
-
</
|
|
635
|
-
{% endfor %}
|
|
632
|
+
</user_rule_or_document_file>
|
|
633
|
+
{% endfor %}
|
|
634
|
+
</user_rule_or_document_files>
|
|
635
|
+
|
|
636
|
+
Make sure you always start your task by using the read_file tool to get the relevant RULE files listed in index.md based on the user's specific requirements.
|
|
636
637
|
{% endif %}
|
|
637
638
|
|
|
638
639
|
====
|
|
@@ -675,7 +676,7 @@ class BaseAgent(ABC):
|
|
|
675
676
|
tool_case_docs = ToolRegistry.get_all_tools_case_docs()
|
|
676
677
|
tool_guidelines = ToolRegistry.get_all_tool_use_guidelines()
|
|
677
678
|
|
|
678
|
-
extra_docs =
|
|
679
|
+
extra_docs = get_required_and_index_rules()
|
|
679
680
|
|
|
680
681
|
env_info = detect_env()
|
|
681
682
|
shell_type = "bash"
|
|
@@ -763,6 +764,10 @@ class BaseAgent(ABC):
|
|
|
763
764
|
|
|
764
765
|
iteration_count = 0
|
|
765
766
|
tool_executed = False
|
|
767
|
+
|
|
768
|
+
should_yield_completion_event = False
|
|
769
|
+
completion_event = None
|
|
770
|
+
|
|
766
771
|
while True:
|
|
767
772
|
iteration_count += 1
|
|
768
773
|
logger.info(f"Starting LLM interaction cycle #{iteration_count}")
|
|
@@ -770,10 +775,14 @@ class BaseAgent(ABC):
|
|
|
770
775
|
last_message = conversations[-1]
|
|
771
776
|
if last_message["role"] == "assistant":
|
|
772
777
|
logger.info(f"Last message is assistant, skipping LLM interaction cycle")
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
778
|
+
if should_yield_completion_event:
|
|
779
|
+
if completion_event is None:
|
|
780
|
+
yield CompletionEvent(completion=AttemptCompletionTool(
|
|
781
|
+
result=last_message["content"],
|
|
782
|
+
command=""
|
|
783
|
+
), completion_xml="")
|
|
784
|
+
else:
|
|
785
|
+
yield completion_event
|
|
777
786
|
break
|
|
778
787
|
logger.info(
|
|
779
788
|
f"Starting LLM interaction cycle. History size: {len(conversations)}")
|
|
@@ -834,11 +843,13 @@ class BaseAgent(ABC):
|
|
|
834
843
|
logger.info(
|
|
835
844
|
"AttemptCompletionTool received. Finalizing session.")
|
|
836
845
|
logger.info(f"Completion result: {tool_obj.result[:50]}...")
|
|
837
|
-
|
|
846
|
+
completion_event = CompletionEvent(completion=tool_obj, completion_xml=tool_xml)
|
|
838
847
|
logger.info(
|
|
839
848
|
"AgenticEdit analyze loop finished due to AttemptCompletion.")
|
|
840
849
|
save_formatted_log(self.args.source_dir, json.dumps(conversations, ensure_ascii=False), "agentic_conversation")
|
|
841
|
-
|
|
850
|
+
mark_event_should_finish = True
|
|
851
|
+
should_yield_completion_event = True
|
|
852
|
+
continue
|
|
842
853
|
|
|
843
854
|
if isinstance(tool_obj, PlanModeRespondTool):
|
|
844
855
|
logger.info(
|
|
@@ -848,7 +859,7 @@ class BaseAgent(ABC):
|
|
|
848
859
|
logger.info(
|
|
849
860
|
"AgenticEdit analyze loop finished due to PlanModeRespond.")
|
|
850
861
|
save_formatted_log(self.args.source_dir, json.dumps(conversations, ensure_ascii=False), "agentic_conversation")
|
|
851
|
-
|
|
862
|
+
continue
|
|
852
863
|
|
|
853
864
|
# Resolve the tool
|
|
854
865
|
resolver_cls = ToolRegistry.get_resolver_for_tool(tool_obj)
|
|
@@ -1184,7 +1195,7 @@ class BaseAgent(ABC):
|
|
|
1184
1195
|
base_url = "/agent/base"
|
|
1185
1196
|
|
|
1186
1197
|
try:
|
|
1187
|
-
event_stream = self.
|
|
1198
|
+
event_stream = self.agentic_run(request)
|
|
1188
1199
|
for agent_event in event_stream:
|
|
1189
1200
|
content = None
|
|
1190
1201
|
metadata = EventMetadata(
|
|
@@ -1308,6 +1319,148 @@ class BaseAgent(ABC):
|
|
|
1308
1319
|
event_manager.write_error(
|
|
1309
1320
|
content=error_content.to_dict(), metadata=metadata.to_dict())
|
|
1310
1321
|
raise e
|
|
1322
|
+
|
|
1323
|
+
def run_with_generator(self, request: AgentRequest):
|
|
1324
|
+
start_time = time.time()
|
|
1325
|
+
project_name = os.path.basename(os.path.abspath(self.args.source_dir))
|
|
1326
|
+
yield ("thinking",agentic_lang.get_message_with_format("agent_start", project_name=project_name))
|
|
1327
|
+
|
|
1328
|
+
# 添加token累计变量
|
|
1329
|
+
total_input_tokens = 0
|
|
1330
|
+
total_output_tokens = 0
|
|
1331
|
+
total_input_cost = 0.0
|
|
1332
|
+
total_output_cost = 0.0
|
|
1333
|
+
model_name = ""
|
|
1334
|
+
|
|
1335
|
+
try:
|
|
1336
|
+
event_stream = self.agentic_run(request)
|
|
1337
|
+
for event in event_stream:
|
|
1338
|
+
if isinstance(event, TokenUsageEvent):
|
|
1339
|
+
# 获取模型信息以计算价格
|
|
1340
|
+
from autocoder.utils import llms as llm_utils
|
|
1341
|
+
model_name = ",".join(llm_utils.get_llm_names(self.llm))
|
|
1342
|
+
model_info = llm_utils.get_model_info(
|
|
1343
|
+
model_name, self.args.product_mode) or {}
|
|
1344
|
+
input_price = model_info.get(
|
|
1345
|
+
"input_price", 0.0) if model_info else 0.0
|
|
1346
|
+
output_price = model_info.get(
|
|
1347
|
+
"output_price", 0.0) if model_info else 0.0
|
|
1348
|
+
|
|
1349
|
+
# 计算成本
|
|
1350
|
+
last_meta = event.usage
|
|
1351
|
+
input_cost = (last_meta.input_tokens_count *
|
|
1352
|
+
input_price) / 1000000 # 转换为百万
|
|
1353
|
+
output_cost = (
|
|
1354
|
+
last_meta.generated_tokens_count * output_price) / 1000000
|
|
1355
|
+
|
|
1356
|
+
# 累计token使用情况
|
|
1357
|
+
total_input_tokens += last_meta.input_tokens_count
|
|
1358
|
+
total_output_tokens += last_meta.generated_tokens_count
|
|
1359
|
+
total_input_cost += input_cost
|
|
1360
|
+
total_output_cost += output_cost
|
|
1361
|
+
|
|
1362
|
+
# 记录日志
|
|
1363
|
+
logger.info(agentic_lang.get_message_with_format(
|
|
1364
|
+
"token_usage_log",
|
|
1365
|
+
model=model_name,
|
|
1366
|
+
input_tokens=last_meta.input_tokens_count,
|
|
1367
|
+
output_tokens=last_meta.generated_tokens_count,
|
|
1368
|
+
input_cost=input_cost,
|
|
1369
|
+
output_cost=output_cost))
|
|
1370
|
+
|
|
1371
|
+
elif isinstance(event, LLMThinkingEvent):
|
|
1372
|
+
# 以较不显眼的样式呈现思考内容
|
|
1373
|
+
yield ("thinking",f"{event.text}")
|
|
1374
|
+
elif isinstance(event, LLMOutputEvent):
|
|
1375
|
+
# 打印常规LLM输出
|
|
1376
|
+
yield ("thinking",event.text)
|
|
1377
|
+
elif isinstance(event, ToolCallEvent):
|
|
1378
|
+
# 跳过显示完成工具的调用
|
|
1379
|
+
if hasattr(event.tool, "result") and hasattr(event.tool, "command"):
|
|
1380
|
+
continue # 不显示完成工具的调用
|
|
1381
|
+
|
|
1382
|
+
tool_name = type(event.tool).__name__
|
|
1383
|
+
# 使用工具展示函数(需要自行实现)
|
|
1384
|
+
display_content = get_tool_display_message(event.tool)
|
|
1385
|
+
yield ("thinking", agentic_lang.get_message_with_format("tool_operation_title", tool_name=tool_name))
|
|
1386
|
+
yield ("thinking",display_content)
|
|
1387
|
+
|
|
1388
|
+
elif isinstance(event, ToolResultEvent):
|
|
1389
|
+
# 跳过显示完成工具的结果
|
|
1390
|
+
if event.tool_name == "AttemptCompletionTool":
|
|
1391
|
+
continue
|
|
1392
|
+
|
|
1393
|
+
result = event.result
|
|
1394
|
+
success_status = agentic_lang.get_message("success_status") if result.success else agentic_lang.get_message("failure_status")
|
|
1395
|
+
base_content = agentic_lang.get_message_with_format("status", status=success_status) + "\n"
|
|
1396
|
+
base_content += agentic_lang.get_message_with_format("message", message=result.message) + "\n"
|
|
1397
|
+
|
|
1398
|
+
# 格式化内容函数
|
|
1399
|
+
def _format_content(content):
|
|
1400
|
+
if len(content) > 200:
|
|
1401
|
+
return f"{content[:100]}\n...\n{content[-100:]}"
|
|
1402
|
+
else:
|
|
1403
|
+
return content
|
|
1404
|
+
|
|
1405
|
+
# 首先准备基本信息面板
|
|
1406
|
+
panel_content = [base_content]
|
|
1407
|
+
syntax_content = None
|
|
1408
|
+
|
|
1409
|
+
if result.content is not None:
|
|
1410
|
+
content_str = ""
|
|
1411
|
+
try:
|
|
1412
|
+
if isinstance(result.content, (dict, list)):
|
|
1413
|
+
import json
|
|
1414
|
+
content_str = json.dumps(
|
|
1415
|
+
result.content, indent=2, ensure_ascii=False)
|
|
1416
|
+
syntax_content = _format_content(content_str)
|
|
1417
|
+
elif isinstance(result.content, str) and ('\n' in result.content or result.content.strip().startswith('<')):
|
|
1418
|
+
syntax_content = _format_content(result.content)
|
|
1419
|
+
else:
|
|
1420
|
+
content_str = str(result.content)
|
|
1421
|
+
# 直接附加简单字符串内容
|
|
1422
|
+
panel_content.append(
|
|
1423
|
+
_format_content(content_str))
|
|
1424
|
+
except Exception as e:
|
|
1425
|
+
logger.warning(agentic_lang.get_message_with_format("format_tool_error", error=str(e)))
|
|
1426
|
+
panel_content.append(
|
|
1427
|
+
# 备用
|
|
1428
|
+
_format_content(str(result.content)))
|
|
1429
|
+
|
|
1430
|
+
# 打印基本信息面板
|
|
1431
|
+
yield ("thinking",_format_content("\n".join(panel_content)))
|
|
1432
|
+
# 单独打印语法高亮内容(如果存在)
|
|
1433
|
+
if syntax_content:
|
|
1434
|
+
yield ("thinking",syntax_content)
|
|
1435
|
+
|
|
1436
|
+
elif isinstance(event, CompletionEvent):
|
|
1437
|
+
yield ("result",event.completion.result)
|
|
1438
|
+
if event.completion.command:
|
|
1439
|
+
yield ("result", agentic_lang.get_message_with_format("suggested_command", command=event.completion.command))
|
|
1440
|
+
elif isinstance(event, ErrorEvent):
|
|
1441
|
+
yield ("result", agentic_lang.get_message("error_title"))
|
|
1442
|
+
yield ("result", agentic_lang.get_message_with_format("error_content", message=event.message))
|
|
1443
|
+
|
|
1444
|
+
time.sleep(0.1) # 小延迟以获得更好的视觉流
|
|
1445
|
+
|
|
1446
|
+
except Exception as e:
|
|
1447
|
+
logger.exception(agentic_lang.get_message("unexpected_error"))
|
|
1448
|
+
yield ("result",agentic_lang.get_message("fatal_error_title"))
|
|
1449
|
+
yield ("result",agentic_lang.get_message_with_format("fatal_error_content", error=str(e)))
|
|
1450
|
+
raise e
|
|
1451
|
+
finally:
|
|
1452
|
+
# 在结束时打印累计的token使用情况
|
|
1453
|
+
duration = time.time() - start_time
|
|
1454
|
+
yield ("result","\n" + self.printer.get_message_from_key_with_format("code_generation_complete",
|
|
1455
|
+
duration=duration,
|
|
1456
|
+
input_tokens=total_input_tokens,
|
|
1457
|
+
output_tokens=total_output_tokens,
|
|
1458
|
+
input_cost=total_input_cost,
|
|
1459
|
+
output_cost=total_output_cost,
|
|
1460
|
+
speed=0.0,
|
|
1461
|
+
model_names=model_name,
|
|
1462
|
+
sampling_count=1))
|
|
1463
|
+
yield ("result", "\n" + agentic_lang.get_message("agent_execution_complete"))
|
|
1311
1464
|
|
|
1312
1465
|
def run_in_terminal(self, request: AgentRequest):
|
|
1313
1466
|
"""
|
|
@@ -1402,10 +1555,7 @@ class BaseAgent(ABC):
|
|
|
1402
1555
|
|
|
1403
1556
|
# 格式化内容函数
|
|
1404
1557
|
def _format_content(content):
|
|
1405
|
-
|
|
1406
|
-
return f"{content[:100]}\n...\n{content[-100:]}"
|
|
1407
|
-
else:
|
|
1408
|
-
return content
|
|
1558
|
+
return content[:200]
|
|
1409
1559
|
|
|
1410
1560
|
# 首先准备基本信息面板
|
|
1411
1561
|
panel_content = [base_content]
|