auto-coder 0.1.400__py3-none-any.whl → 1.0.0__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.400.dist-info → auto_coder-1.0.0.dist-info}/METADATA +1 -1
- {auto_coder-0.1.400.dist-info → auto_coder-1.0.0.dist-info}/RECORD +48 -31
- autocoder/agent/agentic_filter.py +1 -1
- autocoder/agent/base_agentic/tools/read_file_tool_resolver.py +1 -1
- autocoder/auto_coder_runner.py +120 -26
- autocoder/chat_auto_coder.py +81 -22
- autocoder/commands/auto_command.py +1 -1
- autocoder/common/__init__.py +2 -2
- autocoder/common/file_monitor/test_file_monitor.py +307 -0
- autocoder/common/git_utils.py +7 -2
- autocoder/common/pruner/__init__.py +0 -0
- autocoder/common/pruner/agentic_conversation_pruner.py +197 -0
- autocoder/common/pruner/context_pruner.py +574 -0
- autocoder/common/pruner/conversation_pruner.py +132 -0
- autocoder/common/pruner/test_agentic_conversation_pruner.py +342 -0
- autocoder/common/pruner/test_context_pruner.py +546 -0
- autocoder/common/tokens/__init__.py +15 -0
- autocoder/common/tokens/counter.py +20 -0
- autocoder/common/v2/agent/agentic_edit.py +372 -538
- autocoder/common/v2/agent/agentic_edit_tools/__init__.py +8 -1
- autocoder/common/v2/agent/agentic_edit_tools/ac_mod_read_tool_resolver.py +40 -0
- autocoder/common/v2/agent/agentic_edit_tools/ac_mod_write_tool_resolver.py +43 -0
- autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py +8 -0
- autocoder/common/v2/agent/agentic_edit_tools/execute_command_tool_resolver.py +1 -1
- autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py +1 -1
- autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py +33 -88
- autocoder/common/v2/agent/agentic_edit_tools/test_write_to_file_tool_resolver.py +8 -8
- autocoder/common/v2/agent/agentic_edit_tools/todo_read_tool_resolver.py +118 -0
- autocoder/common/v2/agent/agentic_edit_tools/todo_write_tool_resolver.py +324 -0
- autocoder/common/v2/agent/agentic_edit_types.py +46 -4
- autocoder/common/v2/agent/runner/__init__.py +31 -0
- autocoder/common/v2/agent/runner/base_runner.py +106 -0
- autocoder/common/v2/agent/runner/event_runner.py +216 -0
- autocoder/common/v2/agent/runner/sdk_runner.py +40 -0
- autocoder/common/v2/agent/runner/terminal_runner.py +283 -0
- autocoder/common/v2/agent/runner/tool_display.py +191 -0
- autocoder/index/entry.py +1 -1
- autocoder/plugins/token_helper_plugin.py +107 -7
- autocoder/run_context.py +9 -0
- autocoder/sdk/__init__.py +114 -81
- autocoder/sdk/cli/main.py +5 -0
- autocoder/sdk/core/auto_coder_core.py +0 -158
- autocoder/sdk/core/bridge.py +2 -4
- autocoder/version.py +1 -1
- {auto_coder-0.1.400.dist-info → auto_coder-1.0.0.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.400.dist-info → auto_coder-1.0.0.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.400.dist-info → auto_coder-1.0.0.dist-info}/licenses/LICENSE +0 -0
- {auto_coder-0.1.400.dist-info → auto_coder-1.0.0.dist-info}/top_level.txt +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
auto_coder-0.
|
|
1
|
+
auto_coder-1.0.0.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
2
2
|
autocoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
autocoder/auto_coder.py,sha256=giCjH2IJhNicfvx45LxBcOakj6LnJKi7S-GAQT3QenA,46262
|
|
4
4
|
autocoder/auto_coder_rag.py,sha256=nniuWo2DCRtttAm59ef8C_9xFZzD5nKi3gSSPJMJHbM,43696
|
|
5
|
-
autocoder/auto_coder_runner.py,sha256=
|
|
5
|
+
autocoder/auto_coder_runner.py,sha256=4o59GLwwk13vt9PhyHXVbbYrds3piweXTgM8l59WCEs,138922
|
|
6
6
|
autocoder/auto_coder_server.py,sha256=bLORGEclcVdbBVfM140JCI8WtdrU0jbgqdJIVVupiEU,20578
|
|
7
7
|
autocoder/benchmark.py,sha256=Ypomkdzd1T3GE6dRICY3Hj547dZ6_inqJbBJIp5QMco,4423
|
|
8
|
-
autocoder/chat_auto_coder.py,sha256=
|
|
8
|
+
autocoder/chat_auto_coder.py,sha256=KndmI2Sypt1Vh2mhY_aNLLwp1wRy6TmU5y6ojgL2zC0,29443
|
|
9
9
|
autocoder/chat_auto_coder_lang.py,sha256=ylLr1GskchU6kIUJY2TiznrBg-ckc1o-8fDsKZZ0iQU,29337
|
|
10
10
|
autocoder/command_args.py,sha256=HxflngkYtTrV17Vfgk6lyUyiG68jP2ftSc7FYr9AXwY,30585
|
|
11
11
|
autocoder/lang.py,sha256=PFtATuOhHRnfpqHQkXr6p4C893JvpsgwTMif3l-GEi0,14321
|
|
12
12
|
autocoder/models.py,sha256=pD5u6gcMKRwWaLxeVin18g25k-ERyeHOFsRpOgO_Ae0,13788
|
|
13
13
|
autocoder/rags.py,sha256=3hn8cUUdncE7FABV9RPNLxhRzLnIxC8IPcBXnEvE4g0,11955
|
|
14
|
-
autocoder/run_context.py,sha256=
|
|
15
|
-
autocoder/version.py,sha256=
|
|
14
|
+
autocoder/run_context.py,sha256=Oiw0fIdpbnNGdcTPVWF5aC-SPErCDUQ0JgbHVrfXkK0,1925
|
|
15
|
+
autocoder/version.py,sha256=uyfGiipFnhOCQlqywx7wsgp6d-SYnqPqsPQd_xePZl8,23
|
|
16
16
|
autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
autocoder/agent/agentic_filter.py,sha256=
|
|
17
|
+
autocoder/agent/agentic_filter.py,sha256=Gn83A-TqTDpeMNFhnfZsBxM-R-8YXGb86_JECRrv1uQ,39831
|
|
18
18
|
autocoder/agent/auto_demand_organizer.py,sha256=URAq0gSEiHeV_W4zwhOI_83kHz0Ryfj1gcfh5jwCv_w,6501
|
|
19
19
|
autocoder/agent/auto_filegroup.py,sha256=pBsAkBcpFTff-9L5OwI8xhf2xPKpl-aZwz-skF2B6dc,6296
|
|
20
20
|
autocoder/agent/auto_guess_query.py,sha256=rDSdhpPHcOGE5MuDXvIrhCXAPR4ARS1LqpyoLsx2Jhw,11374
|
|
@@ -44,7 +44,7 @@ autocoder/agent/base_agentic/tools/example_tool_resolver.py,sha256=8WBIqEH_76S0i
|
|
|
44
44
|
autocoder/agent/base_agentic/tools/execute_command_tool_resolver.py,sha256=w-_8NCtT2TRlBi8ZcU4gKksbbQFicZ4vAakCC0HOziQ,3223
|
|
45
45
|
autocoder/agent/base_agentic/tools/list_files_tool_resolver.py,sha256=SCAYAiqmgwuCLMwRwroUQFfVS_hbcuAoG9-jIJxiB1c,8061
|
|
46
46
|
autocoder/agent/base_agentic/tools/plan_mode_respond_tool_resolver.py,sha256=hiLdMRknR_Aljd7Ic2bOWZKs11aFHdhkRTKTlP3IIgw,1461
|
|
47
|
-
autocoder/agent/base_agentic/tools/read_file_tool_resolver.py,sha256=
|
|
47
|
+
autocoder/agent/base_agentic/tools/read_file_tool_resolver.py,sha256=nMIuRSTFCcW2es-r0dDLqDEEmoef-9EemtbK3wuPT0M,5083
|
|
48
48
|
autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py,sha256=6TRoZ-ct6oDLBuMzmhFLkd8f0uTY1-Q__fUQfISbNz8,12739
|
|
49
49
|
autocoder/agent/base_agentic/tools/search_files_tool_resolver.py,sha256=cMcfA_3swonPvQiDl_73fPgcQgr5BaUVwMJfj2Btqak,9528
|
|
50
50
|
autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py,sha256=uf_KGvL4xo6Aj4D03xvR95jpF6nzpSsymb7D74mMqBI,3549
|
|
@@ -63,12 +63,12 @@ autocoder/chat/conf_command.py,sha256=sqsZEjFXUCaCydXbqLU_ockpwQ7efQCicEd-hjD29t
|
|
|
63
63
|
autocoder/chat/models_command.py,sha256=yISjvqNbKHVapGcXMcsIwRFfPruJ5ruSqR_e8TqhaPw,20105
|
|
64
64
|
autocoder/chat/rules_command.py,sha256=btA6Od0t2e7iMOFIkR4cfhy95AdE81ffqfUrabU1QCQ,17412
|
|
65
65
|
autocoder/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
|
-
autocoder/commands/auto_command.py,sha256=
|
|
66
|
+
autocoder/commands/auto_command.py,sha256=f7HX4NDUwcyGNLi240QKgryyT5qv_ubwar33qFXBNjQ,65731
|
|
67
67
|
autocoder/commands/auto_web.py,sha256=K0Gv7lil5UqmExr_sAJNOcwNxw_q1vhvre1jjQ7tA3w,39050
|
|
68
68
|
autocoder/commands/tools.py,sha256=IX_zx5mWAvQDED7wUHTqNtrCmLNo9ztFV1aZ6AflY4o,34292
|
|
69
69
|
autocoder/common/JupyterClient.py,sha256=O-wi6pXeAEYhAY24kDa0BINrLYvKS6rKyWe98pDClS0,2816
|
|
70
70
|
autocoder/common/ShellClient.py,sha256=fM1q8t_XMSbLBl2zkCNC2J9xuyKN3eXzGm6hHhqL2WY,2286
|
|
71
|
-
autocoder/common/__init__.py,sha256=
|
|
71
|
+
autocoder/common/__init__.py,sha256=WGzFpA0DT5L-w2o5NjyjiTIqaCCgoHlYqNt8D0D2aLg,15000
|
|
72
72
|
autocoder/common/action_yml_file_manager.py,sha256=DdF5P1R_B_chCnnqoA2IgogakWLZk_nItiJZUfX0_Wo,17857
|
|
73
73
|
autocoder/common/anything2images.py,sha256=0ILBbWzY02M-CiWB-vzuomb_J1hVdxRcenAfIrAXq9M,25283
|
|
74
74
|
autocoder/common/anything2img.py,sha256=iZQmg8srXlD7N5uGl5b_ONKJMBjYoW8kPmokkG6ISF0,10118
|
|
@@ -100,7 +100,7 @@ autocoder/common/const.py,sha256=eTjhjh4Aj4CUzviJ81jaf3Y5cwqsLATySn2wJxaS6RQ,291
|
|
|
100
100
|
autocoder/common/context_pruner.py,sha256=HlU5BmxpCX7uVTJUsTFLlXvkwcOQuidI9uCKZaFxh6s,19874
|
|
101
101
|
autocoder/common/conversation_pruner.py,sha256=pzmrQEa7pFzA66eYSS_h7VqP6ZwUABeooDQzm0PGu0A,5770
|
|
102
102
|
autocoder/common/files.py,sha256=nPiKcnUcYZbSUn3TskKeTVnAxCJRtuehPuB_5d2imX8,4618
|
|
103
|
-
autocoder/common/git_utils.py,sha256=
|
|
103
|
+
autocoder/common/git_utils.py,sha256=S4ZRlSJtxOS7ebkYGG_PbtMGlIsIbqYjiahNjEWZlAQ,27231
|
|
104
104
|
autocoder/common/global_cancel.py,sha256=EYMIzdIJHQjoYP4grxhBxSIT3tCJOy3ESULNd-cR-AY,4751
|
|
105
105
|
autocoder/common/image_to_page.py,sha256=yWiTJQ49Lm3j0FngiJhQ9u7qayqE_bOGb8Rk0TmSWx0,14123
|
|
106
106
|
autocoder/common/index_import_export.py,sha256=h758AYY1df6JMTKUXYmMkSgxItfymDt82XT7O-ygEuw,4565
|
|
@@ -181,12 +181,19 @@ autocoder/common/file_checkpoint/test_utils.py,sha256=wN0VZaM5gc2ltu-c3OPKgKDXqO
|
|
|
181
181
|
autocoder/common/file_checkpoint/utils.py,sha256=lWchNqiQNH13sSi5Tn9g9zit8mlWdYSdiiT59nWeFJE,3273
|
|
182
182
|
autocoder/common/file_monitor/__init__.py,sha256=9reL3IEnyLWU77WjPzeprM8-4lCetlSMZ94Nuxk5KNg,85
|
|
183
183
|
autocoder/common/file_monitor/monitor.py,sha256=biS9TJyNKga2dE-CeYAi9xfXvA9aMeMl0tBf68G-SBE,16609
|
|
184
|
+
autocoder/common/file_monitor/test_file_monitor.py,sha256=xXyxPxAlX-uMydScEqT11rAOTiSyypfOkQhkiC0cMvQ,10495
|
|
184
185
|
autocoder/common/ignorefiles/__init__.py,sha256=P0hq7Avu1IeXBYEkPBZLsJhFzhzyktUWTqaRIXiAFLY,75
|
|
185
186
|
autocoder/common/ignorefiles/ignore_file_utils.py,sha256=glNZo60SwLScVFfsZQTeTz1mMz03THl43SCmxc5XQko,3871
|
|
186
187
|
autocoder/common/ignorefiles/test_ignore_file_utils.py,sha256=EydHG6E2iPsnbt-Jt8Go-WvRgFtBW6QkHUQ9nI4cF-w,3111
|
|
187
188
|
autocoder/common/mcp_servers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
188
189
|
autocoder/common/mcp_servers/mcp_server_gpt4o_mini_search.py,sha256=TApShxgoozLluobXHOK1-oAE1zm0-9jdRoPLQB1qwMI,5688
|
|
189
190
|
autocoder/common/mcp_servers/mcp_server_perplexity.py,sha256=CIC26UkfH1lYoVCjfyY5xGGYVx8h0oz0Uj1c7YJ3OPw,5560
|
|
191
|
+
autocoder/common/pruner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
192
|
+
autocoder/common/pruner/agentic_conversation_pruner.py,sha256=y6QmEsdgTfS50o9__JwNywuYI8e-hgowt1YMj843Wn0,8719
|
|
193
|
+
autocoder/common/pruner/context_pruner.py,sha256=npf3tRUAcA3LdM1YGBSjjvKqsScZiA-4OLqXjOhYNPg,26872
|
|
194
|
+
autocoder/common/pruner/conversation_pruner.py,sha256=pzmrQEa7pFzA66eYSS_h7VqP6ZwUABeooDQzm0PGu0A,5770
|
|
195
|
+
autocoder/common/pruner/test_agentic_conversation_pruner.py,sha256=dmRQHvXqWo-M1O3G_PUjZ6HpaKEWbIbESOYGWYhzioc,16851
|
|
196
|
+
autocoder/common/pruner/test_context_pruner.py,sha256=e5MXPR2eypPF4FwmsB4TL_2x9xFDMP4_7gs6AS5sAOY,22597
|
|
190
197
|
autocoder/common/pull_requests/__init__.py,sha256=dfl_GPLnwRYiby0Jjt2CspfWeIQppa3YjG1ei4uQYio,8351
|
|
191
198
|
autocoder/common/pull_requests/base_provider.py,sha256=X5ynD-RLDfhzY4-RUaqhrWWyN48ZbZhoIM3_sz-rsV4,7541
|
|
192
199
|
autocoder/common/pull_requests/config.py,sha256=z9hExfs85ATN1h_OrC0rWr-siao9ct9tbpHRwBWuKGM,1617
|
|
@@ -205,8 +212,8 @@ autocoder/common/rag_manager/__init__.py,sha256=PR2LIdyFdF3XOFewd2VYuEFNp5ZUMrwA
|
|
|
205
212
|
autocoder/common/rag_manager/rag_manager.py,sha256=958DTIHgXN_tw-vMLtuUL1TnhbZbPL0pZior_gYjgR0,5990
|
|
206
213
|
autocoder/common/rulefiles/__init__.py,sha256=babSbPdFaXk1NvdHtH2zrJLb_tWd7d2ELIyS8NApY_Y,221
|
|
207
214
|
autocoder/common/rulefiles/autocoderrules_utils.py,sha256=TvzKt41wa1uPnYXHkUaJRCuxCJL9IB-Zx6FsEwdSExg,19454
|
|
208
|
-
autocoder/common/tokens/__init__.py,sha256=
|
|
209
|
-
autocoder/common/tokens/counter.py,sha256=
|
|
215
|
+
autocoder/common/tokens/__init__.py,sha256=IqdxyvFqF7d4jFsKDDy-90dxSDzo6INgcV9X7U8FH4M,1799
|
|
216
|
+
autocoder/common/tokens/counter.py,sha256=dvn9lV9ZEwEHHkFnX-d8YiOkfZ0-a6nthkSxaujz-OE,7744
|
|
210
217
|
autocoder/common/tokens/file_detector.py,sha256=AKMy-9kCWUl2NVeJtsXj5J7UJ4YPP-8t_bTbDWAJtVw,3483
|
|
211
218
|
autocoder/common/tokens/filters.py,sha256=g0kC6LDmiYZCZVr8RN9ing6njSpjyXzEs1GfKfsF1CE,3477
|
|
212
219
|
autocoder/common/tokens/models.py,sha256=JCuV1sRLRSwluwDv7OulDgCqqdx3LAosPCGB7NiKcmg,610
|
|
@@ -225,28 +232,38 @@ autocoder/common/v2/code_editblock_manager.py,sha256=DMwJw-FAM6VyaBQV3p4xespHpgZ
|
|
|
225
232
|
autocoder/common/v2/code_manager.py,sha256=C403bS-f6urixwitlKHcml-J03hci-UyNwHJOqBiY6Q,9182
|
|
226
233
|
autocoder/common/v2/code_strict_diff_manager.py,sha256=Bys7tFAq4G03R1zUZuxrszBTvP4QB96jIw2y5BDLyRM,9424
|
|
227
234
|
autocoder/common/v2/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
228
|
-
autocoder/common/v2/agent/agentic_edit.py,sha256=
|
|
229
|
-
autocoder/common/v2/agent/agentic_edit_types.py,sha256=
|
|
235
|
+
autocoder/common/v2/agent/agentic_edit.py,sha256=G6FwPQPzoD60xhl4I0zuQPJgzbDJ4X34cztlXRk-Ibw,130894
|
|
236
|
+
autocoder/common/v2/agent/agentic_edit_types.py,sha256=sMrbOt1iq2sfHux1A9YHr9c05lw8fTQaYqIadONjuUw,6747
|
|
230
237
|
autocoder/common/v2/agent/agentic_tool_display.py,sha256=-a-JTQLc4q03E_rdIILKMI0B6DHN-5gcGlrqq-mBYK4,7239
|
|
231
|
-
autocoder/common/v2/agent/agentic_edit_tools/__init__.py,sha256=
|
|
232
|
-
autocoder/common/v2/agent/agentic_edit_tools/
|
|
238
|
+
autocoder/common/v2/agent/agentic_edit_tools/__init__.py,sha256=wI42CthaJn0MNugsi-jytMsWGlyRyyxwdA9QFtgy5xw,1702
|
|
239
|
+
autocoder/common/v2/agent/agentic_edit_tools/ac_mod_read_tool_resolver.py,sha256=shuOYUiYtIe1VI4UQPqOzci1yPUZVpeW1ULymznrMAY,1885
|
|
240
|
+
autocoder/common/v2/agent/agentic_edit_tools/ac_mod_write_tool_resolver.py,sha256=yjIKaCo_U_X_tzgS0Vw2eNWkzU57wBcBH_IjWopPbv0,2006
|
|
241
|
+
autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py,sha256=HmLXTVle6snsi4BozrjrE_-7PoqgydLq4eHJYVy1JDQ,3728
|
|
233
242
|
autocoder/common/v2/agent/agentic_edit_tools/attempt_completion_tool_resolver.py,sha256=82ZGKeRBSDKeead_XVBW4FxpiE-5dS7tBOk_3RZ6B5s,1511
|
|
234
243
|
autocoder/common/v2/agent/agentic_edit_tools/base_tool_resolver.py,sha256=Zid2m1uZd-2wVFGc_n_KAViXZyNjbdLSpI5n7ut1RUQ,1036
|
|
235
244
|
autocoder/common/v2/agent/agentic_edit_tools/dangerous_command_checker.py,sha256=XeFKuZrxbmSNk04GrL2U_PzIjRbqWYlGvGLhcYv-Jeg,7831
|
|
236
|
-
autocoder/common/v2/agent/agentic_edit_tools/execute_command_tool_resolver.py,sha256=
|
|
245
|
+
autocoder/common/v2/agent/agentic_edit_tools/execute_command_tool_resolver.py,sha256=Tw1A8ROy_TsC7bFZEkrlIu2ztXJMwFUmtACHV3kZOHo,6146
|
|
237
246
|
autocoder/common/v2/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py,sha256=8QoMsADUDWliqiDt_dpguz31403syB8eeW0Pcw-qfb8,3842
|
|
238
247
|
autocoder/common/v2/agent/agentic_edit_tools/list_files_tool_resolver.py,sha256=R2FOkMuJYBiT8NdQRlyGMmt_s79jNWZXYqjbCURNwQc,8553
|
|
239
248
|
autocoder/common/v2/agent/agentic_edit_tools/list_package_info_tool_resolver.py,sha256=dIdV12VuczHpHuHgx2B1j_3BZYc9PL0jfHCuBk9ryk8,2005
|
|
240
249
|
autocoder/common/v2/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py,sha256=lGT4_QYJK6Fa9f6HVSGo0cSsGK7qCsDYgJGUowNxPzk,1499
|
|
241
|
-
autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py,sha256=
|
|
250
|
+
autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py,sha256=oHWQy1hvZNV9h7aphP5seGZTil4R8yBM1JAo0yNKt48,6728
|
|
242
251
|
autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py,sha256=ZTdImTBK7KTYH98JVUioBNtIz-dqSfhkmNEBhajt7hk,12686
|
|
243
|
-
autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py,sha256=
|
|
252
|
+
autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py,sha256=J_LdvW2UuKyU_0iQzl-T8WmWjuUnvdEhRv3P2xRGFxk,6500
|
|
244
253
|
autocoder/common/v2/agent/agentic_edit_tools/test_execute_command_tool_resolver.py,sha256=cG4TBqJX0RP1w67xElt_KH8XzgAhSUbIhuOQFvSnDDE,2864
|
|
245
254
|
autocoder/common/v2/agent/agentic_edit_tools/test_search_files_tool_resolver.py,sha256=9eBo3WLkrr77iNotwIwVmH1ZL3UY0JQgLpdAIc9wTTM,6127
|
|
246
|
-
autocoder/common/v2/agent/agentic_edit_tools/test_write_to_file_tool_resolver.py,sha256=
|
|
255
|
+
autocoder/common/v2/agent/agentic_edit_tools/test_write_to_file_tool_resolver.py,sha256=79k_3duIoXkUTJk6T_9xmHzrhBBWL7m8s3CIWqNg_3s,15625
|
|
256
|
+
autocoder/common/v2/agent/agentic_edit_tools/todo_read_tool_resolver.py,sha256=_X8X5pVam6ljOD35WQQoH_vIR58Yt2G0eunsbZpmTDQ,4744
|
|
257
|
+
autocoder/common/v2/agent/agentic_edit_tools/todo_write_tool_resolver.py,sha256=dItKO1qbvOOQcTkWoSRV4chtI-uT6nWKSvDYOkTUKXs,13387
|
|
247
258
|
autocoder/common/v2/agent/agentic_edit_tools/use_mcp_tool_resolver.py,sha256=wM2Xy4bcnD0TSLEmcM8rvvyyWenN5_KQnJMO6hJ8lTE,1716
|
|
248
259
|
autocoder/common/v2/agent/agentic_edit_tools/use_rag_tool_resolver.py,sha256=frVkXws__fDO2kXETi4NI7eKR_lz2i0C26MPsoYftp8,3901
|
|
249
260
|
autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py,sha256=lPESPLoe9P_bEXXNqqHAkVlqMrIH0XziJ6XeILIejUo,8084
|
|
261
|
+
autocoder/common/v2/agent/runner/__init__.py,sha256=WfNa5RUpdxghhLzR1sbrmipKbDPnrY0AvrAOQnBhGf0,966
|
|
262
|
+
autocoder/common/v2/agent/runner/base_runner.py,sha256=CoY_HjM6CULgH4MV9sHmmKVx6-arN01UXQrAJUkh1P0,3588
|
|
263
|
+
autocoder/common/v2/agent/runner/event_runner.py,sha256=0Q8lDVi7OsG3CY1aTtldduJ4yo2nNAtvkOoJwquIZRM,10806
|
|
264
|
+
autocoder/common/v2/agent/runner/sdk_runner.py,sha256=vu6BpxuN04Lq99vIEEihVTM40VFc0Bp2a3gauDwszFg,1444
|
|
265
|
+
autocoder/common/v2/agent/runner/terminal_runner.py,sha256=lAJGQW1MTaCiTQQlrwWl22c-0rwVwIzvw2Ic4IfplCI,14670
|
|
266
|
+
autocoder/common/v2/agent/runner/tool_display.py,sha256=cYcEPtm6MltQBbmnT8EGWp5pNwwx4fhmBh5at25I5rA,7416
|
|
250
267
|
autocoder/compilers/__init__.py,sha256=C0HOms70QA747XD0uZEMmGtRFcIPenohyqECNStv0Bw,1647
|
|
251
268
|
autocoder/compilers/base_compiler.py,sha256=dsTzMO4H_RoqWfE-SntIk2B52hWuvSlWVLtkdCbHgGs,3244
|
|
252
269
|
autocoder/compilers/compiler_config_api.py,sha256=QRSwWm_EX7jSeZ3dtQqM9HI__x5aZ7U0c3fHIW_2N48,13839
|
|
@@ -280,7 +297,7 @@ autocoder/helper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
|
280
297
|
autocoder/helper/project_creator.py,sha256=sgXrZyAaGc84aUT7K7d7N1ztT-mSNGoLnsT-uKMUvVw,21472
|
|
281
298
|
autocoder/helper/rag_doc_creator.py,sha256=A3lB_jr1KU4bxLbBTX9-nxyylwDirxSi1NXmbPTnp90,4386
|
|
282
299
|
autocoder/index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
283
|
-
autocoder/index/entry.py,sha256=
|
|
300
|
+
autocoder/index/entry.py,sha256=gBYBfXk-qr3A2nptTwcK1cBDGZmfppUZnQ6J_8BA9gU,15313
|
|
284
301
|
autocoder/index/for_command.py,sha256=BFvljE4t6VaMBGboZAuhUCzVK0EitCy_n5D_7FEnihw,3204
|
|
285
302
|
autocoder/index/index.py,sha256=xHm9jrAGy3qErS6GlUli3uFaEzHu_PZLjda8Sp0i0hw,33234
|
|
286
303
|
autocoder/index/symbols_utils.py,sha256=_EP7E_qWXxluAxq3FGZLlLfdrfwx3FmxCdulI8VGuac,2244
|
|
@@ -313,7 +330,7 @@ autocoder/plugins/__init__.py,sha256=T71wGXBP24NhFyf9BntKDXWPIvKp5hWhq_-xK7C-ptE
|
|
|
313
330
|
autocoder/plugins/dynamic_completion_example.py,sha256=dDTeISsGqcWjxY_PzbFSZ4Q7_QwYUcuHUdWJT8x7q-4,4693
|
|
314
331
|
autocoder/plugins/git_helper_plugin.py,sha256=nKQWkU-nQ39A4WC8nC8KI-x68VjwVARQvtrtQQ1GTMI,8386
|
|
315
332
|
autocoder/plugins/sample_plugin.py,sha256=0Hn1SdLovSPwMamooXyfcX5JGzsROt238bMbBhE6aIk,5215
|
|
316
|
-
autocoder/plugins/token_helper_plugin.py,sha256=
|
|
333
|
+
autocoder/plugins/token_helper_plugin.py,sha256=jlNCVDUX6uEH-pAqoLGKp3TyU2DugvAAiVQYZqC5jpw,17334
|
|
317
334
|
autocoder/plugins/utils.py,sha256=ht_BM5V4b161PatTTbGkpW6TBddC23fR7uW-Ywb2zU4,263
|
|
318
335
|
autocoder/privacy/__init__.py,sha256=LnIVvGu_K66zCE-yhN_-dPO8R80pQyedCsXJ7wRqQaI,72
|
|
319
336
|
autocoder/privacy/model_filter.py,sha256=RyGh_uWWE6hHqvaYZGjFylDJldDLxBz5LDZP7CG3sTo,14178
|
|
@@ -366,7 +383,7 @@ autocoder/rag/tools/__init__.py,sha256=3U91ZI4wZh8UYYl_D11IyLxBLseemmPVfBnmh4ZzN
|
|
|
366
383
|
autocoder/rag/tools/recall_tool.py,sha256=z-EEyfeD1JR5Mdk9Obi3FJyW-5Q7ljH97Rtd_vlk-Tk,6487
|
|
367
384
|
autocoder/rag/tools/search_tool.py,sha256=HaIA-H66oJwUisk_mpDJQw28TgVHzNxA5JOBbX1y6q8,4702
|
|
368
385
|
autocoder/regexproject/__init__.py,sha256=QMXphSxjuv_LDIx0L_0jnnvCzMfmrOl0VMTVmXabeL0,8976
|
|
369
|
-
autocoder/sdk/__init__.py,sha256=
|
|
386
|
+
autocoder/sdk/__init__.py,sha256=fCK4dqXXjYr_zZza-4iVotjzSOLhq0FUOHExf9BoCgs,6444
|
|
370
387
|
autocoder/sdk/constants.py,sha256=7kD_Q_yJ0tTGPZN32UBec-ImhJsg-vafJ8WSM_N_A2Y,2195
|
|
371
388
|
autocoder/sdk/example.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
372
389
|
autocoder/sdk/exceptions.py,sha256=O7ow2qfTRuHMyIHmtmDcxHsAuT-a6bxjYPhMH12684k,1861
|
|
@@ -376,11 +393,11 @@ autocoder/sdk/cli/completion_wrapper.py,sha256=dvrY1tDvYwPXpbD6EXBxkb5ByhEdtHcm3
|
|
|
376
393
|
autocoder/sdk/cli/formatters.py,sha256=XsSr7lL1I5ySh9tNmOduHhJwLt3WB8LnUC0Ua5_qd0Y,6552
|
|
377
394
|
autocoder/sdk/cli/handlers.py,sha256=YtAmrmIAeyUt1VFwbKrbChWzIkRY5hMKu-BVDG1d5LA,6095
|
|
378
395
|
autocoder/sdk/cli/install_completion.py,sha256=rjmbj5C0HCz_AqTpTe6mk5dVqCEq4O8AXD8RyC4YkVI,10741
|
|
379
|
-
autocoder/sdk/cli/main.py,sha256=
|
|
396
|
+
autocoder/sdk/cli/main.py,sha256=LbECwcYBDKzUZJj3S05s27yTtx-P8yMyZKBM4nIF5MQ,10590
|
|
380
397
|
autocoder/sdk/cli/options.py,sha256=mbShv36ytTWvxS84hHvIiH3B3lXkCWfiDWCa4ONwN0k,2970
|
|
381
398
|
autocoder/sdk/core/__init__.py,sha256=sRY7QTYLef6TVc0uvip24U6gKn8WUBv6X8ZwkSC4Vm8,254
|
|
382
|
-
autocoder/sdk/core/auto_coder_core.py,sha256=
|
|
383
|
-
autocoder/sdk/core/bridge.py,sha256=
|
|
399
|
+
autocoder/sdk/core/auto_coder_core.py,sha256=xcrhrG7GHYGUY27nIUNDzWk2vJqZGkgob9KlbjhxuFw,30454
|
|
400
|
+
autocoder/sdk/core/bridge.py,sha256=Aiv2GXQFH9BdnhwrvQ5y-XecF1QYGux2kkQlKO6dC64,16896
|
|
384
401
|
autocoder/sdk/models/__init__.py,sha256=5YD4iKXzberhbrF587c1i9UmUbmK8QNRWZeDGM1Ktsk,307
|
|
385
402
|
autocoder/sdk/models/messages.py,sha256=lexCQlvy4doDvOJmJpK5xw8w85LDJ4xAYvJFEiGJ068,6454
|
|
386
403
|
autocoder/sdk/models/options.py,sha256=aspVyCmJhDDSUVpcHthhCxKtiUVIxykj26bo0Y3kjz0,6696
|
|
@@ -418,8 +435,8 @@ autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
418
435
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
419
436
|
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=t902pKxQ5xM7zgIHiAOsTPLwxhE6VuvXAqPy751S7fg,14096
|
|
420
437
|
autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
421
|
-
auto_coder-0.
|
|
422
|
-
auto_coder-0.
|
|
423
|
-
auto_coder-0.
|
|
424
|
-
auto_coder-0.
|
|
425
|
-
auto_coder-0.
|
|
438
|
+
auto_coder-1.0.0.dist-info/METADATA,sha256=dj5rsP5zdzpFxEW3xQUocCMBB00s8utjK9t4DaGsiIM,7933
|
|
439
|
+
auto_coder-1.0.0.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
|
|
440
|
+
auto_coder-1.0.0.dist-info/entry_points.txt,sha256=8lbxiJQDA1WWkn9FHNri1V2HJhEc7oCfBzAV_EkGrZ0,430
|
|
441
|
+
auto_coder-1.0.0.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
442
|
+
auto_coder-1.0.0.dist-info/RECORD,,
|
|
@@ -859,7 +859,7 @@ class AgenticFilter:
|
|
|
859
859
|
total_tokens=total_tokens,
|
|
860
860
|
safe_zone=self.args.conversation_prune_safe_zone_tokens,
|
|
861
861
|
)
|
|
862
|
-
from autocoder.common.conversation_pruner import ConversationPruner
|
|
862
|
+
from autocoder.common.pruner.conversation_pruner import ConversationPruner
|
|
863
863
|
|
|
864
864
|
pruner = ConversationPruner(self.args, self.llm)
|
|
865
865
|
conversations = pruner.prune_conversations(conversations)
|
|
@@ -5,7 +5,7 @@ from autocoder.agent.base_agentic.types import ReadFileTool, ToolResult # Impor
|
|
|
5
5
|
from loguru import logger
|
|
6
6
|
import typing
|
|
7
7
|
from autocoder.common import AutoCoderArgs
|
|
8
|
-
from autocoder.common.context_pruner import PruneContext
|
|
8
|
+
from autocoder.common.pruner.context_pruner import PruneContext
|
|
9
9
|
from autocoder.common import SourceCode
|
|
10
10
|
from autocoder.rag.token_counter import count_tokens
|
|
11
11
|
from loguru import logger
|
autocoder/auto_coder_runner.py
CHANGED
|
@@ -24,7 +24,7 @@ from autocoder.version import __version__
|
|
|
24
24
|
from autocoder.auto_coder import main as auto_coder_main
|
|
25
25
|
from autocoder.utils import get_last_yaml_file
|
|
26
26
|
from autocoder.commands.auto_command import CommandAutoTuner, AutoCommandRequest, CommandConfig, MemoryConfig
|
|
27
|
-
from autocoder.common.v2.agent.agentic_edit import
|
|
27
|
+
from autocoder.common.v2.agent.agentic_edit import AgenticEditRequest
|
|
28
28
|
from autocoder.common.v2.agent.agentic_edit_types import AgenticEditConversationConfig
|
|
29
29
|
from autocoder.index.symbols_utils import (
|
|
30
30
|
extract_symbols,
|
|
@@ -69,7 +69,7 @@ from autocoder.common import SourceCodeList,SourceCode
|
|
|
69
69
|
from autocoder.common.file_monitor import FileMonitor
|
|
70
70
|
from filelock import FileLock
|
|
71
71
|
from autocoder.common.command_file_manager import CommandManager
|
|
72
|
-
|
|
72
|
+
from autocoder.common.v2.agent.runner import SdkRunner,TerminalRunner,EventRunner
|
|
73
73
|
|
|
74
74
|
## 对外API,用于第三方集成 auto-coder 使用。
|
|
75
75
|
class SymbolItem(BaseModel):
|
|
@@ -836,6 +836,84 @@ def _handle_post_commit_and_pr(post_commit: bool, pr: bool, query: str, args, ll
|
|
|
836
836
|
except Exception as e:
|
|
837
837
|
printer.print_in_terminal("post_commit_pr_failed", style="red", error=str(e))
|
|
838
838
|
|
|
839
|
+
def init_project_if_required(target_dir: str,project_type:str):
|
|
840
|
+
"""
|
|
841
|
+
如果项目没有初始化,则自动初始化项目
|
|
842
|
+
|
|
843
|
+
Args:
|
|
844
|
+
target_dir: 目标目录路径
|
|
845
|
+
"""
|
|
846
|
+
|
|
847
|
+
# 确保目标目录是绝对路径
|
|
848
|
+
if not os.path.isabs(target_dir):
|
|
849
|
+
target_dir = os.path.abspath(target_dir)
|
|
850
|
+
|
|
851
|
+
actions_dir = os.path.join(target_dir, "actions")
|
|
852
|
+
auto_coder_dir = os.path.join(target_dir, ".auto-coder")
|
|
853
|
+
|
|
854
|
+
# 检查是否已经初始化
|
|
855
|
+
if os.path.exists(actions_dir) and os.path.exists(auto_coder_dir):
|
|
856
|
+
return # 已经初始化,无需再次初始化
|
|
857
|
+
|
|
858
|
+
printer = Printer()
|
|
859
|
+
|
|
860
|
+
try:
|
|
861
|
+
# 创建必要的目录
|
|
862
|
+
os.makedirs(actions_dir, exist_ok=True)
|
|
863
|
+
os.makedirs(auto_coder_dir, exist_ok=True)
|
|
864
|
+
|
|
865
|
+
# 导入并使用 create_actions 创建默认的 action 文件
|
|
866
|
+
from autocoder.common.command_templates import create_actions
|
|
867
|
+
|
|
868
|
+
create_actions(
|
|
869
|
+
source_dir=target_dir,
|
|
870
|
+
params={
|
|
871
|
+
"project_type": project_type,
|
|
872
|
+
"source_dir": target_dir
|
|
873
|
+
},
|
|
874
|
+
)
|
|
875
|
+
|
|
876
|
+
# 初始化 git 仓库
|
|
877
|
+
try:
|
|
878
|
+
git_utils.init(target_dir)
|
|
879
|
+
except Exception as e:
|
|
880
|
+
global_logger.warning(f"Failed to initialize git repository: {e}")
|
|
881
|
+
|
|
882
|
+
# 创建或更新 .gitignore 文件
|
|
883
|
+
gitignore_path = os.path.join(target_dir, ".gitignore")
|
|
884
|
+
gitignore_entries = ["\n.auto-coder/", "\n/actions/", "\n/output.txt"]
|
|
885
|
+
|
|
886
|
+
try:
|
|
887
|
+
# 检查现有的 .gitignore 内容,避免重复添加
|
|
888
|
+
existing_content = ""
|
|
889
|
+
if os.path.exists(gitignore_path):
|
|
890
|
+
with open(gitignore_path, "r", encoding="utf-8") as f:
|
|
891
|
+
existing_content = f.read()
|
|
892
|
+
|
|
893
|
+
with open(gitignore_path, "a", encoding="utf-8") as f:
|
|
894
|
+
for entry in gitignore_entries:
|
|
895
|
+
if entry.strip() not in existing_content:
|
|
896
|
+
f.write(entry)
|
|
897
|
+
except Exception as e:
|
|
898
|
+
global_logger.warning(f"Failed to update .gitignore: {e}")
|
|
899
|
+
|
|
900
|
+
# 创建 .autocoderignore 文件
|
|
901
|
+
try:
|
|
902
|
+
autocoderignore_path = os.path.join(target_dir, ".autocoderignore")
|
|
903
|
+
if not os.path.exists(autocoderignore_path):
|
|
904
|
+
autocoderignore_content = "target\n"
|
|
905
|
+
with open(autocoderignore_path, "w", encoding="utf-8") as f:
|
|
906
|
+
f.write(autocoderignore_content)
|
|
907
|
+
except Exception as e:
|
|
908
|
+
global_logger.warning(f"Failed to create .autocoderignore: {e}")
|
|
909
|
+
|
|
910
|
+
configure(f"project_type:{project_type}")
|
|
911
|
+
global_logger.info(f"Successfully initialized auto-coder project in {target_dir}")
|
|
912
|
+
|
|
913
|
+
except Exception as e:
|
|
914
|
+
global_logger.error(f"Failed to initialize project in {target_dir}: {e}")
|
|
915
|
+
printer.print_in_terminal("init_project_error", style="red", error=str(e))
|
|
916
|
+
|
|
839
917
|
|
|
840
918
|
def _create_pull_request(commit_result, original_query: str, llm):
|
|
841
919
|
"""
|
|
@@ -1677,7 +1755,7 @@ def code_next(query: str):
|
|
|
1677
1755
|
|
|
1678
1756
|
|
|
1679
1757
|
@run_in_raw_thread()
|
|
1680
|
-
def commit(query: str):
|
|
1758
|
+
def commit(query: Optional[str] = None):
|
|
1681
1759
|
conf = memory.get("conf", {})
|
|
1682
1760
|
product_mode = conf.get("product_mode", "lite")
|
|
1683
1761
|
def prepare_commit_yaml():
|
|
@@ -1740,7 +1818,7 @@ def commit(query: str):
|
|
|
1740
1818
|
try:
|
|
1741
1819
|
uncommitted_changes = git_utils.get_uncommitted_changes(".")
|
|
1742
1820
|
commit_message = git_utils.generate_commit_message.with_llm(llm).run(
|
|
1743
|
-
uncommitted_changes
|
|
1821
|
+
uncommitted_changes, query=query
|
|
1744
1822
|
)
|
|
1745
1823
|
# memory["conversation"].append(
|
|
1746
1824
|
# {"role": "user", "content": commit_message})
|
|
@@ -3228,18 +3306,31 @@ def auto_command(query: str,extra_args: Dict[str,Any]={}):
|
|
|
3228
3306
|
|
|
3229
3307
|
conversation_config.query = task_query
|
|
3230
3308
|
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3309
|
+
if get_run_context().mode == RunMode.WEB:
|
|
3310
|
+
runner = EventRunner(llm=llm,
|
|
3311
|
+
args=args,
|
|
3312
|
+
files=SourceCodeList(sources=sources),
|
|
3313
|
+
conversation_history=conversation_history,
|
|
3314
|
+
memory_config=MemoryConfig(memory=memory,
|
|
3315
|
+
save_memory_func=save_memory),
|
|
3316
|
+
command_config=CommandConfig,
|
|
3317
|
+
conversation_name="current",
|
|
3318
|
+
conversation_config=conversation_config
|
|
3319
|
+
)
|
|
3320
|
+
runner.run(AgenticEditRequest(user_input=task_query))
|
|
3240
3321
|
|
|
3241
|
-
if get_run_context().mode == RunMode.TERMINAL:
|
|
3242
|
-
|
|
3322
|
+
if get_run_context().mode == RunMode.TERMINAL:
|
|
3323
|
+
runner = TerminalRunner(llm=llm,
|
|
3324
|
+
args=args,
|
|
3325
|
+
files=SourceCodeList(sources=sources),
|
|
3326
|
+
conversation_history=conversation_history,
|
|
3327
|
+
memory_config=MemoryConfig(memory=memory,
|
|
3328
|
+
save_memory_func=save_memory),
|
|
3329
|
+
command_config=CommandConfig,
|
|
3330
|
+
conversation_name="current",
|
|
3331
|
+
conversation_config=conversation_config
|
|
3332
|
+
)
|
|
3333
|
+
runner.run(AgenticEditRequest(user_input=task_query))
|
|
3243
3334
|
|
|
3244
3335
|
completer.refresh_files()
|
|
3245
3336
|
return
|
|
@@ -3358,19 +3449,22 @@ def run_auto_command(query: str,
|
|
|
3358
3449
|
task_query = render_command_file_with_variables(command_infos)
|
|
3359
3450
|
|
|
3360
3451
|
conversation_config.query = task_query
|
|
3361
|
-
conversation_config.pull_request = pr
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3452
|
+
conversation_config.pull_request = pr
|
|
3453
|
+
|
|
3454
|
+
runner = SdkRunner(llm=llm,
|
|
3455
|
+
args=args,
|
|
3456
|
+
files=SourceCodeList(sources=sources),
|
|
3457
|
+
conversation_history=conversation_history,
|
|
3458
|
+
memory_config=MemoryConfig(memory=memory,
|
|
3459
|
+
save_memory_func=save_memory),
|
|
3460
|
+
command_config=CommandConfig,
|
|
3461
|
+
conversation_name="current",
|
|
3462
|
+
conversation_config=conversation_config
|
|
3463
|
+
)
|
|
3370
3464
|
if pre_commit:
|
|
3371
|
-
|
|
3465
|
+
runner.apply_pre_changes()
|
|
3372
3466
|
|
|
3373
|
-
events =
|
|
3467
|
+
events = runner.run(AgenticEditRequest(user_input=task_query))
|
|
3374
3468
|
|
|
3375
3469
|
for event in events:
|
|
3376
3470
|
yield event
|
autocoder/chat_auto_coder.py
CHANGED
|
@@ -170,9 +170,14 @@ def show_help():
|
|
|
170
170
|
print(" \033[94mCommand\033[0m - \033[93mDescription\033[0m")
|
|
171
171
|
for cmd, (_, desc, plugin_id) in plugin_manager.command_handlers.items():
|
|
172
172
|
plugin = plugin_manager.get_plugin(plugin_id)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
if plugin:
|
|
174
|
+
print(
|
|
175
|
+
f" \033[94m{cmd}\033[0m - \033[92m{desc} (from {plugin.plugin_name()})\033[0m"
|
|
176
|
+
)
|
|
177
|
+
else:
|
|
178
|
+
print(
|
|
179
|
+
f" \033[94m{cmd}\033[0m - \033[92m{desc} (from unknown plugin)\033[0m"
|
|
180
|
+
)
|
|
176
181
|
print()
|
|
177
182
|
|
|
178
183
|
|
|
@@ -274,6 +279,41 @@ class EnhancedCompleter(Completer):
|
|
|
274
279
|
ARGS = None
|
|
275
280
|
|
|
276
281
|
|
|
282
|
+
def load_builtin_plugins():
|
|
283
|
+
"""加载内置插件"""
|
|
284
|
+
try:
|
|
285
|
+
# 发现所有可用的插件
|
|
286
|
+
discovered_plugins = plugin_manager.discover_plugins()
|
|
287
|
+
|
|
288
|
+
# 排除的示例插件列表
|
|
289
|
+
excluded_plugins = {
|
|
290
|
+
"autocoder.plugins.dynamic_completion_example",
|
|
291
|
+
"autocoder.plugins.sample_plugin"
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
# 自动加载内置插件(在autocoder.plugins模块中的插件)
|
|
295
|
+
builtin_loaded = 0
|
|
296
|
+
for plugin_class in discovered_plugins:
|
|
297
|
+
module_name = plugin_class.__module__
|
|
298
|
+
if (module_name.startswith("autocoder.plugins.")
|
|
299
|
+
and not module_name.endswith(".__init__")
|
|
300
|
+
and module_name not in excluded_plugins):
|
|
301
|
+
try:
|
|
302
|
+
if plugin_manager.load_plugin(plugin_class):
|
|
303
|
+
builtin_loaded += 1
|
|
304
|
+
print(f"✓ Loaded builtin plugin: {plugin_class.plugin_name()}")
|
|
305
|
+
except Exception as e:
|
|
306
|
+
print(f"✗ Failed to load builtin plugin {plugin_class.plugin_name()}: {e}")
|
|
307
|
+
|
|
308
|
+
if builtin_loaded > 0:
|
|
309
|
+
print(f"Loaded {builtin_loaded} builtin plugin(s)")
|
|
310
|
+
else:
|
|
311
|
+
print("No builtin plugins loaded")
|
|
312
|
+
|
|
313
|
+
except Exception as e:
|
|
314
|
+
print(f"Error loading builtin plugins: {e}")
|
|
315
|
+
|
|
316
|
+
|
|
277
317
|
def main():
|
|
278
318
|
load_tokenizer()
|
|
279
319
|
ARGS = parse_arguments()
|
|
@@ -305,6 +345,9 @@ def main():
|
|
|
305
345
|
|
|
306
346
|
# 加载保存的运行时配置
|
|
307
347
|
plugin_manager.load_runtime_cfg()
|
|
348
|
+
|
|
349
|
+
# 自动加载内置插件(如果还没有被配置文件加载)
|
|
350
|
+
load_builtin_plugins()
|
|
308
351
|
|
|
309
352
|
memory = get_memory()
|
|
310
353
|
|
|
@@ -320,7 +363,13 @@ def main():
|
|
|
320
363
|
|
|
321
364
|
@kb.add("c-c")
|
|
322
365
|
def _(event):
|
|
323
|
-
|
|
366
|
+
# 如果在历史搜索模式中
|
|
367
|
+
if event.app.layout.is_searching:
|
|
368
|
+
event.app.current_buffer.history_search_text = None
|
|
369
|
+
# 清除当前缓冲区
|
|
370
|
+
event.app.current_buffer.reset()
|
|
371
|
+
else:
|
|
372
|
+
event.app.exit()
|
|
324
373
|
|
|
325
374
|
@kb.add("tab")
|
|
326
375
|
def _(event):
|
|
@@ -481,14 +530,21 @@ def main():
|
|
|
481
530
|
if temp_user_input.startswith("/"):
|
|
482
531
|
user_input = temp_user_input
|
|
483
532
|
|
|
484
|
-
#
|
|
533
|
+
# 修复插件命令处理逻辑
|
|
534
|
+
plugin_handled = False
|
|
485
535
|
if user_input.startswith("/"):
|
|
486
536
|
plugin_result = plugin_manager.process_command(user_input)
|
|
487
537
|
if plugin_result:
|
|
488
538
|
plugin_name, handler, args = plugin_result
|
|
489
539
|
if handler:
|
|
490
540
|
handler(*args)
|
|
491
|
-
|
|
541
|
+
plugin_handled = True
|
|
542
|
+
|
|
543
|
+
# 如果插件已处理命令,直接继续下一轮循环
|
|
544
|
+
if plugin_handled:
|
|
545
|
+
continue
|
|
546
|
+
|
|
547
|
+
# 如果插件未处理,继续处理内置命令
|
|
492
548
|
if (
|
|
493
549
|
memory["mode"] == "auto_detect"
|
|
494
550
|
and user_input
|
|
@@ -654,24 +710,27 @@ def main():
|
|
|
654
710
|
except Exception as e:
|
|
655
711
|
print(f"Debug error: {str(e)}")
|
|
656
712
|
|
|
657
|
-
|
|
713
|
+
elif user_input.startswith("/shell"):
|
|
714
|
+
command = user_input[len("/shell") :].strip()
|
|
715
|
+
if not command:
|
|
716
|
+
print("Please enter a shell command to execute.")
|
|
717
|
+
else:
|
|
718
|
+
if command.startswith("/chat"):
|
|
719
|
+
event_file, file_id = gengerate_event_file_path()
|
|
720
|
+
global_cancel.register_token(event_file)
|
|
721
|
+
configure(f"event_file:{event_file}")
|
|
722
|
+
command = command[len("/chat") :].strip()
|
|
723
|
+
gen_and_exec_shell_command(command)
|
|
724
|
+
else:
|
|
725
|
+
execute_shell_command(command)
|
|
658
726
|
else:
|
|
659
|
-
|
|
660
|
-
if user_input.
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
print("
|
|
727
|
+
# 对于未识别的命令,显示提示信息而不是执行auto_command
|
|
728
|
+
if user_input and user_input.strip():
|
|
729
|
+
if user_input.startswith("/"):
|
|
730
|
+
print(f"\033[91mUnknown command: {user_input}\033[0m")
|
|
731
|
+
print("Type /help to see available commands.")
|
|
664
732
|
else:
|
|
665
|
-
|
|
666
|
-
event_file, file_id = gengerate_event_file_path()
|
|
667
|
-
global_cancel.register_token(event_file)
|
|
668
|
-
configure(f"event_file:{event_file}")
|
|
669
|
-
command = command[len("/chat") :].strip()
|
|
670
|
-
gen_and_exec_shell_command(command)
|
|
671
|
-
else:
|
|
672
|
-
execute_shell_command(command)
|
|
673
|
-
else:
|
|
674
|
-
if user_input and user_input.strip():
|
|
733
|
+
# 只有非命令输入才执行auto_command
|
|
675
734
|
auto_command(user_input)
|
|
676
735
|
|
|
677
736
|
except KeyboardInterrupt:
|
|
@@ -543,7 +543,7 @@ class CommandAutoTuner:
|
|
|
543
543
|
total_tokens=total_tokens,
|
|
544
544
|
safe_zone=self.args.conversation_prune_safe_zone_tokens
|
|
545
545
|
)
|
|
546
|
-
from autocoder.common.conversation_pruner import ConversationPruner
|
|
546
|
+
from autocoder.common.pruner.conversation_pruner import ConversationPruner
|
|
547
547
|
pruner = ConversationPruner(self.args, self.llm)
|
|
548
548
|
conversations = pruner.prune_conversations(conversations)
|
|
549
549
|
|
autocoder/common/__init__.py
CHANGED
|
@@ -397,13 +397,13 @@ class AutoCoderArgs(pydantic.BaseModel):
|
|
|
397
397
|
in_code_apply: bool = False
|
|
398
398
|
model_filter_path: Optional[str] = None
|
|
399
399
|
|
|
400
|
-
conversation_prune_safe_zone_tokens:
|
|
400
|
+
conversation_prune_safe_zone_tokens: int = 50*1024
|
|
401
401
|
conversation_prune_group_size: Optional[int] = 4
|
|
402
402
|
conversation_prune_strategy: Optional[str] = "summarize"
|
|
403
403
|
|
|
404
404
|
context_prune_strategy: Optional[str] = "extract"
|
|
405
405
|
context_prune: Optional[bool] = True
|
|
406
|
-
context_prune_safe_zone_tokens: Optional[int] =
|
|
406
|
+
context_prune_safe_zone_tokens: Optional[int] = 24*1024
|
|
407
407
|
context_prune_sliding_window_size: Optional[int] = 1000
|
|
408
408
|
context_prune_sliding_window_overlap: Optional[int] = 100
|
|
409
409
|
|