auto-coder 0.1.301__py3-none-any.whl → 0.1.303__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.301.dist-info → auto_coder-0.1.303.dist-info}/METADATA +2 -1
- {auto_coder-0.1.301.dist-info → auto_coder-0.1.303.dist-info}/RECORD +33 -25
- autocoder/auto_coder.py +6 -7
- autocoder/auto_coder_runner.py +9 -9
- autocoder/chat_auto_coder.py +6 -1
- autocoder/commands/auto_command.py +313 -205
- autocoder/commands/tools.py +123 -85
- autocoder/common/__init__.py +2 -0
- autocoder/common/action_yml_file_manager.py +28 -6
- autocoder/common/auto_coder_lang.py +2 -2
- autocoder/common/auto_configure.py +9 -4
- autocoder/common/code_auto_merge.py +1 -1
- autocoder/common/code_auto_merge_diff.py +1 -1
- autocoder/common/code_auto_merge_editblock.py +1 -1
- autocoder/common/code_auto_merge_strict_diff.py +1 -1
- autocoder/common/stream_out_type.py +7 -0
- autocoder/dispacher/actions/action.py +221 -101
- autocoder/dispacher/actions/plugins/action_regex_project.py +18 -0
- autocoder/events/__init__.py +57 -0
- autocoder/events/event_content.py +423 -0
- autocoder/events/event_manager.py +327 -0
- autocoder/events/event_manager_singleton.py +245 -0
- autocoder/events/event_store.py +376 -0
- autocoder/events/event_types.py +103 -0
- autocoder/index/entry.py +88 -60
- autocoder/index/filter/quick_filter.py +71 -3
- autocoder/run_context.py +62 -0
- autocoder/utils/auto_coder_utils/chat_stream_out.py +32 -1
- autocoder/version.py +1 -1
- {auto_coder-0.1.301.dist-info → auto_coder-0.1.303.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.301.dist-info → auto_coder-0.1.303.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.301.dist-info → auto_coder-0.1.303.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.301.dist-info → auto_coder-0.1.303.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.303
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -27,6 +27,7 @@ Requires-Dist: jupyter-client
|
|
|
27
27
|
Requires-Dist: prompt-toolkit
|
|
28
28
|
Requires-Dist: tokenizers
|
|
29
29
|
Requires-Dist: aiofiles
|
|
30
|
+
Requires-Dist: readerwriterlock
|
|
30
31
|
Requires-Dist: byzerllm[saas] >=0.1.177
|
|
31
32
|
Requires-Dist: patch
|
|
32
33
|
Requires-Dist: diff-match-patch
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
autocoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
autocoder/auto_coder.py,sha256=
|
|
2
|
+
autocoder/auto_coder.py,sha256=HWRWa5Emg1KH0Qa9OLHOhe6fTO9epodO7EUejnEVPGs,66022
|
|
3
3
|
autocoder/auto_coder_lang.py,sha256=Rtupq6N3_HT7JRhDKdgCBcwRaiAnyCOR_Gsp4jUomrI,3229
|
|
4
4
|
autocoder/auto_coder_rag.py,sha256=5TtAfbEBwyt-cB4WcI8eQ1G3AuKij0056wFYRViDhLs,34036
|
|
5
5
|
autocoder/auto_coder_rag_client_mcp.py,sha256=QRxUbjc6A8UmDMQ8lXgZkjgqtq3lgKYeatJbDY6rSo0,6270
|
|
6
6
|
autocoder/auto_coder_rag_mcp.py,sha256=-RrjNwFaS2e5v8XDIrKR-zlUNUE8UBaeOtojffBrvJo,8521
|
|
7
|
-
autocoder/auto_coder_runner.py,sha256=
|
|
7
|
+
autocoder/auto_coder_runner.py,sha256=Q07k05D8WaQfvQYX_rdLEKLk_i19Z79IhJIC4nFGkJE,100795
|
|
8
8
|
autocoder/auto_coder_server.py,sha256=E3Z829TPSooRSNhuh3_x9yaZi0f5G0Lm0ntoZhjGaoQ,20576
|
|
9
9
|
autocoder/benchmark.py,sha256=Ypomkdzd1T3GE6dRICY3Hj547dZ6_inqJbBJIp5QMco,4423
|
|
10
|
-
autocoder/chat_auto_coder.py,sha256=
|
|
10
|
+
autocoder/chat_auto_coder.py,sha256=SpRvpHJ5JfYcyoF12vAKa-QRUSwJ9sCRKOk5TyOjHLY,24790
|
|
11
11
|
autocoder/chat_auto_coder_lang.py,sha256=-vyKq02RGn6N275YA06JZqXpfJkNq6PNjQ8wy4MmITE,20833
|
|
12
12
|
autocoder/command_args.py,sha256=9aYJ-AmPxP1sQh6ciw04FWHjSn31f2W9afXFwo8wgx4,30441
|
|
13
13
|
autocoder/command_parser.py,sha256=fx1g9E6GaM273lGTcJqaFQ-hoksS_Ik2glBMnVltPCE,10013
|
|
14
14
|
autocoder/lang.py,sha256=U6AjVV8Rs1uLyjFCZ8sT6WWuNUxMBqkXXIOs4S120uk,14511
|
|
15
15
|
autocoder/models.py,sha256=AyoZ-Pzy0oyYUmWCxOIRiOImsqboSfRET7LO9-UOuxI,11172
|
|
16
|
-
autocoder/
|
|
16
|
+
autocoder/run_context.py,sha256=IUfSO6_gp2Wt1blFWAmOpN0b0nDrTTk4LmtCYUBIoro,1643
|
|
17
|
+
autocoder/version.py,sha256=p_6OyMQSVjSndn-7JBA-dNgRZ5tt_olX18DG1WKfBi8,23
|
|
17
18
|
autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
19
|
autocoder/agent/auto_demand_organizer.py,sha256=NWSAEsEk94vT3lGjfo25kKLMwYdPcpy9e-i21txPasQ,6942
|
|
19
20
|
autocoder/agent/auto_filegroup.py,sha256=CW7bqp0FW1GIEMnl-blyAc2UGT7O9Mom0q66ITz1ckM,6635
|
|
@@ -27,18 +28,18 @@ autocoder/agent/planner.py,sha256=SZTSZHxHzDmuWZo3K5fs79RwvJLWurg-nbJRRNbX65o,91
|
|
|
27
28
|
autocoder/agent/project_reader.py,sha256=tWLaPoLw1gI6kO_NzivQj28KbobU2ceOLuppHMbfGl8,18234
|
|
28
29
|
autocoder/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
30
|
autocoder/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
autocoder/commands/auto_command.py,sha256=
|
|
31
|
+
autocoder/commands/auto_command.py,sha256=q_6hD0XHmVkoo0pj9vN-x7qoqgrXWF7rlLs9n2yMGNk,62628
|
|
31
32
|
autocoder/commands/auto_web.py,sha256=_449f4rCoRG7Sv0SB0hIBRFLPLPJ5DgWW4DlI22a3XY,39383
|
|
32
|
-
autocoder/commands/tools.py,sha256=
|
|
33
|
+
autocoder/commands/tools.py,sha256=uSPyEcx6o1upuw6clHdL4yeqoXbywnvCxAPo2mt5rJk,28117
|
|
33
34
|
autocoder/common/JupyterClient.py,sha256=O-wi6pXeAEYhAY24kDa0BINrLYvKS6rKyWe98pDClS0,2816
|
|
34
35
|
autocoder/common/ShellClient.py,sha256=fM1q8t_XMSbLBl2zkCNC2J9xuyKN3eXzGm6hHhqL2WY,2286
|
|
35
|
-
autocoder/common/__init__.py,sha256=
|
|
36
|
-
autocoder/common/action_yml_file_manager.py,sha256=
|
|
36
|
+
autocoder/common/__init__.py,sha256=PDukO4-iFDdPUjMqsKVW2b055YpgWl1Oa4nJzeFoY3c,13931
|
|
37
|
+
autocoder/common/action_yml_file_manager.py,sha256=q0QBlptWtR9DhqguMBZJfHmmTP9fVGjI5DdDer29sis,16109
|
|
37
38
|
autocoder/common/anything2images.py,sha256=0ILBbWzY02M-CiWB-vzuomb_J1hVdxRcenAfIrAXq9M,25283
|
|
38
39
|
autocoder/common/anything2img.py,sha256=iZQmg8srXlD7N5uGl5b_ONKJMBjYoW8kPmokkG6ISF0,10118
|
|
39
40
|
autocoder/common/audio.py,sha256=Kn9nWKQddWnUrAz0a_ZUgjcu4VUU_IcZBigT7n3N3qc,7439
|
|
40
|
-
autocoder/common/auto_coder_lang.py,sha256=
|
|
41
|
-
autocoder/common/auto_configure.py,sha256=
|
|
41
|
+
autocoder/common/auto_coder_lang.py,sha256=xAizNW6PIRAIhCfmmJg_2cnfJkyQu73PFdw-K3DieYo,36321
|
|
42
|
+
autocoder/common/auto_configure.py,sha256=D4N-fl9v8bKM5-Ds-uhkC2uGDmHH_ZjLJ759F8KXMKs,13129
|
|
42
43
|
autocoder/common/buildin_tokenizer.py,sha256=L7d5t39ZFvUd6EoMPXUhYK1toD0FHlRH1jtjKRGokWU,1236
|
|
43
44
|
autocoder/common/chunk_validation.py,sha256=BrR_ZWavW8IANuueEE7hS8NFAwEvm8TX34WnPx_1hs8,3030
|
|
44
45
|
autocoder/common/cleaner.py,sha256=NU72i8C6o9m0vXExab7nao5bstBUsfJFcj11cXa9l4U,1089
|
|
@@ -47,10 +48,10 @@ autocoder/common/code_auto_generate.py,sha256=i0f0BPTvt8QN5-arC2PqfMs4sukGJqFw58
|
|
|
47
48
|
autocoder/common/code_auto_generate_diff.py,sha256=EYGHf24fVAk3M8kXllXukdUvzo2I2Fb8qNrTiU_Qtug,18759
|
|
48
49
|
autocoder/common/code_auto_generate_editblock.py,sha256=1XmoLZl-XrrPOyHkSfqe0pOxi0Lp4d69oDQX6zzqs_c,20523
|
|
49
50
|
autocoder/common/code_auto_generate_strict_diff.py,sha256=68fAks4S6Hz0wAeXrdI1PjdeCiy0gXRhgEeIlgxB04E,17539
|
|
50
|
-
autocoder/common/code_auto_merge.py,sha256=
|
|
51
|
-
autocoder/common/code_auto_merge_diff.py,sha256=
|
|
52
|
-
autocoder/common/code_auto_merge_editblock.py,sha256=
|
|
53
|
-
autocoder/common/code_auto_merge_strict_diff.py,sha256=
|
|
51
|
+
autocoder/common/code_auto_merge.py,sha256=6XSJbY6oAKPFoeYLbEyVDFH3kqeXCAJXcqK-olvlZWg,9454
|
|
52
|
+
autocoder/common/code_auto_merge_diff.py,sha256=FhgYKSNprZhdEXdrVyQdbpofduD_aCKFTXvAvHDnP5M,18764
|
|
53
|
+
autocoder/common/code_auto_merge_editblock.py,sha256=5iSV5IiZKr5LHtw0TO_2ALPf8F9sz7pHi9dHiuRuB9s,21223
|
|
54
|
+
autocoder/common/code_auto_merge_strict_diff.py,sha256=M0tTA0QKfY4qoihgH8ua5h8UJgp1Ut-VAR8DV0cia5k,12915
|
|
54
55
|
autocoder/common/code_modification_ranker.py,sha256=e1i8oNPN_PfG4O8HQnQWxh9tyOd-ur6jFTXfkHPVXYo,13152
|
|
55
56
|
autocoder/common/command_completer.py,sha256=xuCxYGKDccaozmzB6p3q0QI6mlzyM180g9mnVG5zvIk,35284
|
|
56
57
|
autocoder/common/command_generator.py,sha256=t1o1d7xEyfnPvY_MpG5usyx0eKW7WCUR0urKoqCex60,2761
|
|
@@ -81,6 +82,7 @@ autocoder/common/search.py,sha256=245iPFgWhMldoUK3CqCP89ltaxZiNPK73evoG6Fp1h8,16
|
|
|
81
82
|
autocoder/common/search_replace.py,sha256=GphFkc57Hb673CAwmbiocqTbw8vrV7TrZxtOhD0332g,22147
|
|
82
83
|
autocoder/common/shells.py,sha256=elminFpNosnV0hsEUcsugDxlGO8NfH96uah-8bkaBvA,19929
|
|
83
84
|
autocoder/common/stats_panel.py,sha256=wGl9O45pjVVDxhNumLv4_NfLYSlUP_18Tw4hcJSjw50,4596
|
|
85
|
+
autocoder/common/stream_out_type.py,sha256=F0fvsjE2LxQD8HKtyI1UfSbrN1vK0m_5Qp3se9GYMGs,187
|
|
84
86
|
autocoder/common/sys_prompt.py,sha256=JlexfjZt554faqbgkCmzOJqYUzDHfbnxly5ugFfHfEE,26403
|
|
85
87
|
autocoder/common/text.py,sha256=KGRQq314GHBmY4MWG8ossRoQi1_DTotvhxchpn78c-k,1003
|
|
86
88
|
autocoder/common/types.py,sha256=PXTETrsTvhLE49jqAeUKGySvxBN9pjeyCgRHLDYdd9U,664
|
|
@@ -94,20 +96,26 @@ autocoder/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
94
96
|
autocoder/db/store.py,sha256=tFT66bP2ZKIqZip-uhLkHRSLaaOAUUDZfozJwcqix3c,1908
|
|
95
97
|
autocoder/dispacher/__init__.py,sha256=YoA64dIxnx4jcE1pwSfg81sjkQtjDkhddkfac1-cMWo,1230
|
|
96
98
|
autocoder/dispacher/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
97
|
-
autocoder/dispacher/actions/action.py,sha256=
|
|
99
|
+
autocoder/dispacher/actions/action.py,sha256=neQQwF1q7M-HDYheyuIL-UfIqN_hPS0c6UEWKdRhZaI,28917
|
|
98
100
|
autocoder/dispacher/actions/copilot.py,sha256=2nQzKt8Sr40mIDOizZWyl4ekCwaHYklvgGlVfvhOlFM,13106
|
|
99
101
|
autocoder/dispacher/actions/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
100
|
-
autocoder/dispacher/actions/plugins/action_regex_project.py,sha256=
|
|
102
|
+
autocoder/dispacher/actions/plugins/action_regex_project.py,sha256=ZZ3bca55Js45at_lXHFtha7j8LMLLpYUtZ7URmx6eEk,7886
|
|
101
103
|
autocoder/dispacher/actions/plugins/action_translate.py,sha256=GEn7dZA22jy5WyzINomjmzzB795p2Olg-CJla97lRF8,7744
|
|
104
|
+
autocoder/events/__init__.py,sha256=1x_juwr9Ows2RADDa2LyI4QlmPxOVOXZeLO1cht-slM,1443
|
|
105
|
+
autocoder/events/event_content.py,sha256=0unVmskGrfvnsniLvNXobco9KG-r6cv_C-gXK3L5zXQ,11557
|
|
106
|
+
autocoder/events/event_manager.py,sha256=WsEog4diXPsidCcN-Ycm18iPbX21PBibkcmjee-aRcQ,11739
|
|
107
|
+
autocoder/events/event_manager_singleton.py,sha256=1fIVf4bf3l0TR7rJNcMAHmTtxm368oQS_cjqL6SQxo0,8797
|
|
108
|
+
autocoder/events/event_store.py,sha256=y6tT3P-o3yhDptrKi-UmqI_ZBNg7v21FriI3f7lo_ME,12709
|
|
109
|
+
autocoder/events/event_types.py,sha256=wONd3wC_BhGXTbXIlb4kFIr7gkhYSBjQE30JjTc8tnU,3558
|
|
102
110
|
autocoder/index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
103
|
-
autocoder/index/entry.py,sha256=
|
|
111
|
+
autocoder/index/entry.py,sha256=a8KhkNd6tKuD6W9fh9ohdri2r4UYeZWswi14pVwpr-Q,15740
|
|
104
112
|
autocoder/index/for_command.py,sha256=BFvljE4t6VaMBGboZAuhUCzVK0EitCy_n5D_7FEnihw,3204
|
|
105
113
|
autocoder/index/index.py,sha256=3-SHlmeQMv6SFxNj7vVcNRDAYj9ZshuJJ1zXwBi0cDc,30873
|
|
106
114
|
autocoder/index/symbols_utils.py,sha256=_EP7E_qWXxluAxq3FGZLlLfdrfwx3FmxCdulI8VGuac,2244
|
|
107
115
|
autocoder/index/types.py,sha256=a2s_KV5FJlq7jqA2ELSo9E1sjuLwDB-JJYMhSpzBAhU,596
|
|
108
116
|
autocoder/index/filter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
117
|
autocoder/index/filter/normal_filter.py,sha256=MI-8xdXCrniaxYCHVTLkq5tafvcUiauD3LN0b3ymRXI,8361
|
|
110
|
-
autocoder/index/filter/quick_filter.py,sha256=
|
|
118
|
+
autocoder/index/filter/quick_filter.py,sha256=QzBCBRuvcnoF-f3nzXXOzrrbCKz0MtMvQusDgkmHzi8,43171
|
|
111
119
|
autocoder/plugins/__init__.py,sha256=uc8UNSAVb9uQvr5zUSS-Xu_RhrdbO2i3w2NhkrVtODM,43023
|
|
112
120
|
autocoder/plugins/dynamic_completion_example.py,sha256=dDTeISsGqcWjxY_PzbFSZ4Q7_QwYUcuHUdWJT8x7q-4,4693
|
|
113
121
|
autocoder/plugins/git_helper_plugin.py,sha256=nKQWkU-nQ39A4WC8nC8KI-x68VjwVARQvtrtQQ1GTMI,8386
|
|
@@ -183,11 +191,11 @@ autocoder/utils/tests.py,sha256=BqphrwyycGAvs-5mhH8pKtMZdObwhFtJ5MC_ZAOiLq8,1340
|
|
|
183
191
|
autocoder/utils/thread_utils.py,sha256=tv9fhFZOjI18AxVUJbpe_xjBGMpkqgDcOlz9pnDtNik,8583
|
|
184
192
|
autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
185
193
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
186
|
-
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=
|
|
194
|
+
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=Wh_KSjYIxE3r4cU4sdFuSoNVxqcUw9c4-V-DaTVYWvg,13131
|
|
187
195
|
autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
188
|
-
auto_coder-0.1.
|
|
189
|
-
auto_coder-0.1.
|
|
190
|
-
auto_coder-0.1.
|
|
191
|
-
auto_coder-0.1.
|
|
192
|
-
auto_coder-0.1.
|
|
193
|
-
auto_coder-0.1.
|
|
196
|
+
auto_coder-0.1.303.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
197
|
+
auto_coder-0.1.303.dist-info/METADATA,sha256=V5TTsOMA70UO232vj9ssWRsynASPfPOBimzNyF8rhJQ,2721
|
|
198
|
+
auto_coder-0.1.303.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
199
|
+
auto_coder-0.1.303.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
|
|
200
|
+
auto_coder-0.1.303.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
201
|
+
auto_coder-0.1.303.dist-info/RECORD,,
|
autocoder/auto_coder.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import byzerllm
|
|
2
|
+
import yaml
|
|
3
|
+
import os
|
|
4
|
+
import time
|
|
2
5
|
from typing import List, Dict, Any, Optional
|
|
3
6
|
from autocoder.common import AutoCoderArgs
|
|
4
7
|
from autocoder.dispacher import Dispacher
|
|
@@ -14,9 +17,6 @@ from autocoder.utils.queue_communicate import (
|
|
|
14
17
|
CommunicateEventType,
|
|
15
18
|
)
|
|
16
19
|
|
|
17
|
-
import yaml
|
|
18
|
-
import os
|
|
19
|
-
import time
|
|
20
20
|
from byzerllm.utils.client import EventCallbackResult, EventName
|
|
21
21
|
from prompt_toolkit import prompt
|
|
22
22
|
from prompt_toolkit.formatted_text import FormattedText
|
|
@@ -50,6 +50,8 @@ from autocoder.common.printer import Printer
|
|
|
50
50
|
from autocoder.rag.token_counter import count_tokens
|
|
51
51
|
from autocoder.privacy.model_filter import ModelPathFilter
|
|
52
52
|
from autocoder.common.result_manager import ResultManager
|
|
53
|
+
from autocoder.events.event_manager_singleton import get_event_manager
|
|
54
|
+
from autocoder.events import event_content as EventContentCreator
|
|
53
55
|
|
|
54
56
|
console = Console()
|
|
55
57
|
|
|
@@ -120,12 +122,9 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
120
122
|
if raw_args.command == "revert":
|
|
121
123
|
repo_path = args.source_dir
|
|
122
124
|
|
|
123
|
-
file_content = open(args.file).read()
|
|
124
|
-
md5 = hashlib.md5(file_content.encode("utf-8")).hexdigest()
|
|
125
125
|
file_name = os.path.basename(args.file)
|
|
126
|
-
|
|
127
126
|
revert_result = git_utils.revert_changes(
|
|
128
|
-
repo_path, f"auto_coder_{file_name}
|
|
127
|
+
repo_path, f"auto_coder_{file_name}"
|
|
129
128
|
)
|
|
130
129
|
if revert_result:
|
|
131
130
|
print(f"Successfully reverted changes for {args.file}")
|
autocoder/auto_coder_runner.py
CHANGED
|
@@ -52,6 +52,7 @@ from autocoder.utils.thread_utils import run_in_raw_thread
|
|
|
52
52
|
from autocoder.common.command_completer import CommandCompleter,FileSystemModel as CCFileSystemModel,MemoryConfig as CCMemoryModel
|
|
53
53
|
from autocoder.common.conf_validator import ConfigValidator
|
|
54
54
|
from autocoder import command_parser as CommandParser
|
|
55
|
+
from loguru import logger
|
|
55
56
|
|
|
56
57
|
class SymbolItem(BaseModel):
|
|
57
58
|
symbol_name: str
|
|
@@ -83,7 +84,7 @@ memory = {
|
|
|
83
84
|
|
|
84
85
|
project_root = os.getcwd()
|
|
85
86
|
|
|
86
|
-
base_persist_dir = os.path.join(".auto-coder", "plugins", "chat-auto-coder")
|
|
87
|
+
base_persist_dir = os.path.join(project_root,".auto-coder", "plugins", "chat-auto-coder")
|
|
87
88
|
|
|
88
89
|
defaut_exclude_dirs = [".git", "node_modules", "dist", "build", "__pycache__"]
|
|
89
90
|
|
|
@@ -1362,7 +1363,7 @@ def commit(query: str):
|
|
|
1362
1363
|
return_paths=True
|
|
1363
1364
|
)
|
|
1364
1365
|
|
|
1365
|
-
if conf.get("enable_global_memory", "
|
|
1366
|
+
if conf.get("enable_global_memory", "false") in ["true", "True",True]:
|
|
1366
1367
|
yaml_config["urls"] += get_global_memory_file_paths()
|
|
1367
1368
|
|
|
1368
1369
|
# 临时保存yaml文件,然后读取yaml文件,转换为args
|
|
@@ -1402,7 +1403,7 @@ def commit(query: str):
|
|
|
1402
1403
|
md5 = hashlib.md5(file_content.encode("utf-8")).hexdigest()
|
|
1403
1404
|
file_name = os.path.basename(execute_file)
|
|
1404
1405
|
commit_result = git_utils.commit_changes(
|
|
1405
|
-
".", f"{commit_message}\nauto_coder_{file_name}
|
|
1406
|
+
".", f"{commit_message}\nauto_coder_{file_name}"
|
|
1406
1407
|
)
|
|
1407
1408
|
git_utils.print_commit_info(commit_result=commit_result)
|
|
1408
1409
|
if commit_message:
|
|
@@ -1470,7 +1471,7 @@ def coding(query: str):
|
|
|
1470
1471
|
return_paths=True
|
|
1471
1472
|
)
|
|
1472
1473
|
|
|
1473
|
-
if conf.get("enable_global_memory", "
|
|
1474
|
+
if conf.get("enable_global_memory", "false") in ["true", "True",True]:
|
|
1474
1475
|
yaml_config["urls"] += get_global_memory_file_paths()
|
|
1475
1476
|
|
|
1476
1477
|
# handle image
|
|
@@ -1542,7 +1543,7 @@ def coding(query: str):
|
|
|
1542
1543
|
cmd = ["--file", execute_file]
|
|
1543
1544
|
auto_coder_main(cmd)
|
|
1544
1545
|
result_manager = ResultManager()
|
|
1545
|
-
result_manager.append(content="", meta={"commit_message": f"auto_coder_{latest_yaml_file}
|
|
1546
|
+
result_manager.append(content="", meta={"commit_message": f"auto_coder_{latest_yaml_file}","action": "coding", "input":{
|
|
1546
1547
|
"query": query
|
|
1547
1548
|
}})
|
|
1548
1549
|
|
|
@@ -1591,7 +1592,7 @@ def chat(query: str):
|
|
|
1591
1592
|
return_paths=True
|
|
1592
1593
|
)
|
|
1593
1594
|
|
|
1594
|
-
if conf.get("enable_global_memory", "
|
|
1595
|
+
if conf.get("enable_global_memory", "false") in ["true", "True",True]:
|
|
1595
1596
|
current_files += get_global_memory_file_paths()
|
|
1596
1597
|
|
|
1597
1598
|
yaml_config["urls"] = current_files
|
|
@@ -2590,11 +2591,10 @@ def conf_import(path: str):
|
|
|
2590
2591
|
import_conf(os.getcwd(), path)
|
|
2591
2592
|
|
|
2592
2593
|
@run_in_raw_thread()
|
|
2593
|
-
def auto_command(
|
|
2594
|
+
def auto_command(query: str,extra_args: Dict[str,Any]={}):
|
|
2594
2595
|
"""处理/auto指令"""
|
|
2595
2596
|
from autocoder.commands.auto_command import CommandAutoTuner, AutoCommandRequest, CommandConfig, MemoryConfig
|
|
2596
|
-
args = get_final_config()
|
|
2597
|
-
# help(query)
|
|
2597
|
+
args = get_final_config()
|
|
2598
2598
|
|
|
2599
2599
|
# 准备请求参数
|
|
2600
2600
|
request = AutoCommandRequest(
|
autocoder/chat_auto_coder.py
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
from autocoder.run_context import get_run_context,RunMode
|
|
2
|
+
|
|
3
|
+
# 设置运行模式为终端模式
|
|
4
|
+
get_run_context().set_mode(RunMode.TERMINAL)
|
|
5
|
+
|
|
1
6
|
import argparse
|
|
2
7
|
import os
|
|
3
8
|
from prompt_toolkit import PromptSession
|
|
@@ -471,7 +476,7 @@ def main():
|
|
|
471
476
|
and user_input
|
|
472
477
|
and not user_input.startswith("/")
|
|
473
478
|
):
|
|
474
|
-
auto_command(
|
|
479
|
+
auto_command(user_input)
|
|
475
480
|
|
|
476
481
|
elif memory["mode"] == "voice_input" and not user_input.startswith("/"):
|
|
477
482
|
text = voice_input()
|