auto-coder 0.1.352__py3-none-any.whl → 0.1.354__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.352.dist-info → auto_coder-0.1.354.dist-info}/METADATA +1 -1
- {auto_coder-0.1.352.dist-info → auto_coder-0.1.354.dist-info}/RECORD +43 -30
- autocoder/auto_coder_rag.py +37 -1
- autocoder/auto_coder_runner.py +8 -0
- autocoder/commands/auto_command.py +59 -131
- autocoder/commands/tools.py +1 -1
- autocoder/common/__init__.py +1 -1
- autocoder/common/conversations/__init__.py +52 -0
- autocoder/common/conversations/compatibility.py +303 -0
- autocoder/common/conversations/conversation_manager.py +502 -0
- autocoder/common/conversations/example.py +152 -0
- autocoder/common/file_monitor/__init__.py +5 -0
- autocoder/common/file_monitor/monitor.py +383 -0
- autocoder/common/git_utils.py +1 -1
- autocoder/common/ignorefiles/__init__.py +4 -0
- autocoder/common/ignorefiles/ignore_file_utils.py +103 -0
- autocoder/common/ignorefiles/test_ignore_file_utils.py +91 -0
- autocoder/common/rulefiles/__init__.py +15 -0
- autocoder/common/rulefiles/autocoderrules_utils.py +173 -0
- autocoder/common/save_formatted_log.py +54 -0
- autocoder/common/v2/agent/agentic_edit.py +40 -36
- autocoder/common/v2/agent/agentic_edit_tools/list_files_tool_resolver.py +1 -1
- autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py +73 -43
- autocoder/common/v2/agent/agentic_edit_tools/test_search_files_tool_resolver.py +163 -0
- autocoder/common/v2/code_editblock_manager.py +20 -8
- autocoder/index/index.py +1 -1
- autocoder/models.py +22 -9
- autocoder/rag/api_server.py +14 -2
- autocoder/rag/cache/simple_cache.py +63 -33
- autocoder/rag/loaders/docx_loader.py +1 -1
- autocoder/rag/loaders/filter_utils.py +133 -76
- autocoder/rag/loaders/image_loader.py +15 -3
- autocoder/rag/loaders/pdf_loader.py +2 -2
- autocoder/rag/long_context_rag.py +11 -0
- autocoder/rag/qa_conversation_strategy.py +5 -31
- autocoder/rag/utils.py +21 -2
- autocoder/utils/_markitdown.py +66 -25
- autocoder/utils/auto_coder_utils/chat_stream_out.py +1 -0
- autocoder/version.py +1 -1
- {auto_coder-0.1.352.dist-info → auto_coder-0.1.354.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.352.dist-info → auto_coder-0.1.354.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.352.dist-info → auto_coder-0.1.354.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.352.dist-info → auto_coder-0.1.354.dist-info}/top_level.txt +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
autocoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
autocoder/auto_coder.py,sha256=mRNIZn7f410j33e0Y15aJeVO9fLwjG2LtaS4pF1oenY,66736
|
|
3
3
|
autocoder/auto_coder_lang.py,sha256=Rtupq6N3_HT7JRhDKdgCBcwRaiAnyCOR_Gsp4jUomrI,3229
|
|
4
|
-
autocoder/auto_coder_rag.py,sha256=
|
|
4
|
+
autocoder/auto_coder_rag.py,sha256=ru5o86IaKylyVRlVORmnrdf3Q1To2eWi2KLdT9FMW0k,37580
|
|
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=HclbkzO8Y_nkeek-wnvjObLbGdkzL99ljs2qjGhIm-U,112408
|
|
8
8
|
autocoder/auto_coder_server.py,sha256=bLORGEclcVdbBVfM140JCI8WtdrU0jbgqdJIVVupiEU,20578
|
|
9
9
|
autocoder/benchmark.py,sha256=Ypomkdzd1T3GE6dRICY3Hj547dZ6_inqJbBJIp5QMco,4423
|
|
10
10
|
autocoder/chat_auto_coder.py,sha256=CthuvdjVjTQOVv-zREsl8OCsZHPSP9OQcIgHULrW2Ro,25842
|
|
@@ -12,9 +12,9 @@ autocoder/chat_auto_coder_lang.py,sha256=LecXAvbNFVURwXFF1QOs-n04vto37QwUvoeDMeF
|
|
|
12
12
|
autocoder/command_args.py,sha256=HxflngkYtTrV17Vfgk6lyUyiG68jP2ftSc7FYr9AXwY,30585
|
|
13
13
|
autocoder/command_parser.py,sha256=fx1g9E6GaM273lGTcJqaFQ-hoksS_Ik2glBMnVltPCE,10013
|
|
14
14
|
autocoder/lang.py,sha256=PFtATuOhHRnfpqHQkXr6p4C893JvpsgwTMif3l-GEi0,14321
|
|
15
|
-
autocoder/models.py,sha256=
|
|
15
|
+
autocoder/models.py,sha256=Gu50IATQtZtgEir1PpCfwgH6o4ygw6XqqbQRj3lx5dU,13798
|
|
16
16
|
autocoder/run_context.py,sha256=IUfSO6_gp2Wt1blFWAmOpN0b0nDrTTk4LmtCYUBIoro,1643
|
|
17
|
-
autocoder/version.py,sha256=
|
|
17
|
+
autocoder/version.py,sha256=tFfJssCdeIVfyFWZOP6a4jLfrYeXV_CDgE0yvGrG33M,23
|
|
18
18
|
autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
autocoder/agent/agentic_edit.py,sha256=XsfePZ-t6M-uBSdG1VLZXk1goqXk2HPeJ_A8IYyBuWQ,58896
|
|
20
20
|
autocoder/agent/agentic_edit_types.py,sha256=oFcDd_cxJ2yH9Ed1uTpD3BipudgoIEWDMPb5pAkq4gI,3288
|
|
@@ -44,12 +44,12 @@ autocoder/agent/agentic_edit_tools/use_mcp_tool_resolver.py,sha256=5WWH8-lEZO29d
|
|
|
44
44
|
autocoder/agent/agentic_edit_tools/write_to_file_tool_resolver.py,sha256=HPX1g7Nh7H8I3P2MNmIK4HXLh8IZYaedQgRZAeGxNdc,5135
|
|
45
45
|
autocoder/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
46
|
autocoder/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
|
-
autocoder/commands/auto_command.py,sha256=
|
|
47
|
+
autocoder/commands/auto_command.py,sha256=v62n4t4Efku2opO0HPY5dOZ8FiaJZQZt7Atb0_AyEaE,62073
|
|
48
48
|
autocoder/commands/auto_web.py,sha256=Cc0eb6JN3SvFy3GD_lpSLvIqj7F1eFDTcwg1t-zDcKg,39024
|
|
49
|
-
autocoder/commands/tools.py,sha256=
|
|
49
|
+
autocoder/commands/tools.py,sha256=IX_zx5mWAvQDED7wUHTqNtrCmLNo9ztFV1aZ6AflY4o,34292
|
|
50
50
|
autocoder/common/JupyterClient.py,sha256=O-wi6pXeAEYhAY24kDa0BINrLYvKS6rKyWe98pDClS0,2816
|
|
51
51
|
autocoder/common/ShellClient.py,sha256=fM1q8t_XMSbLBl2zkCNC2J9xuyKN3eXzGm6hHhqL2WY,2286
|
|
52
|
-
autocoder/common/__init__.py,sha256=
|
|
52
|
+
autocoder/common/__init__.py,sha256=npjde5Djp3xcy0BcZ6sxBmPG4Xa3c-VfuGzIGlTDUE0,14600
|
|
53
53
|
autocoder/common/action_yml_file_manager.py,sha256=DdF5P1R_B_chCnnqoA2IgogakWLZk_nItiJZUfX0_Wo,17857
|
|
54
54
|
autocoder/common/anything2images.py,sha256=0ILBbWzY02M-CiWB-vzuomb_J1hVdxRcenAfIrAXq9M,25283
|
|
55
55
|
autocoder/common/anything2img.py,sha256=iZQmg8srXlD7N5uGl5b_ONKJMBjYoW8kPmokkG6ISF0,10118
|
|
@@ -80,7 +80,7 @@ autocoder/common/const.py,sha256=eTjhjh4Aj4CUzviJ81jaf3Y5cwqsLATySn2wJxaS6RQ,291
|
|
|
80
80
|
autocoder/common/context_pruner.py,sha256=HlU5BmxpCX7uVTJUsTFLlXvkwcOQuidI9uCKZaFxh6s,19874
|
|
81
81
|
autocoder/common/conversation_pruner.py,sha256=pzmrQEa7pFzA66eYSS_h7VqP6ZwUABeooDQzm0PGu0A,5770
|
|
82
82
|
autocoder/common/files.py,sha256=nPiKcnUcYZbSUn3TskKeTVnAxCJRtuehPuB_5d2imX8,4618
|
|
83
|
-
autocoder/common/git_utils.py,sha256=
|
|
83
|
+
autocoder/common/git_utils.py,sha256=lGFLxxoyMKjIRgLeE_9176T3rdKI13DZMd28Lowk218,27093
|
|
84
84
|
autocoder/common/global_cancel.py,sha256=TyjYQPESwo04D1BOTmC9hH7IbkKDDM-b2zPacEHGIQ8,3264
|
|
85
85
|
autocoder/common/image_to_page.py,sha256=yWiTJQ49Lm3j0FngiJhQ9u7qayqE_bOGb8Rk0TmSWx0,14123
|
|
86
86
|
autocoder/common/index_import_export.py,sha256=h758AYY1df6JMTKUXYmMkSgxItfymDt82XT7O-ygEuw,4565
|
|
@@ -99,6 +99,7 @@ autocoder/common/printer.py,sha256=T4XTAcQp5w1ZWYx5NAUXlIGd-9500Vl0JaG1JJXMdkg,2
|
|
|
99
99
|
autocoder/common/recall_validation.py,sha256=Avt9Q9dX3kG6Pf2zsdlOHmsjd-OeSj7U1PFBDp_Cve0,1700
|
|
100
100
|
autocoder/common/result_manager.py,sha256=nBcFRj5reBC7vp13M91f4B8iPW8B8OehayHlUdeAt1g,3776
|
|
101
101
|
autocoder/common/run_cmd.py,sha256=2VrJpeqooasUoc-WKVrvFfesmRR55kOpPmmYgpQrKVc,8283
|
|
102
|
+
autocoder/common/save_formatted_log.py,sha256=oI5Ge2Xk1yeutH92pgYd6amZ3N_2v6CNb6blqfUF9sc,1756
|
|
102
103
|
autocoder/common/screenshots.py,sha256=_gA-z1HxGjPShBrtgkdideq58MG6rqFB2qMUJKjrycs,3769
|
|
103
104
|
autocoder/common/search.py,sha256=245iPFgWhMldoUK3CqCP89ltaxZiNPK73evoG6Fp1h8,16518
|
|
104
105
|
autocoder/common/search_replace.py,sha256=GphFkc57Hb673CAwmbiocqTbw8vrV7TrZxtOhD0332g,22147
|
|
@@ -111,9 +112,20 @@ autocoder/common/text.py,sha256=KGRQq314GHBmY4MWG8ossRoQi1_DTotvhxchpn78c-k,1003
|
|
|
111
112
|
autocoder/common/token_cost_caculate.py,sha256=MSWJtl7YpQSUt-gFQoqUcJMblyPqHXe2ZioiZOFkV80,10085
|
|
112
113
|
autocoder/common/types.py,sha256=Cw_4RH-rGmAgQE-Ck69maMAMqlPCDA4Yj37QmuUY0mQ,713
|
|
113
114
|
autocoder/common/utils_code_auto_generate.py,sha256=Tvb3Mqxedj0Jhi0faKyWvILuNCty9fZi341fyIs33tA,4550
|
|
115
|
+
autocoder/common/conversations/__init__.py,sha256=xGZeOFrDsgg2fkPK1zmvYBDhAyX66FtgOcZaxhYKJXU,1338
|
|
116
|
+
autocoder/common/conversations/compatibility.py,sha256=WuBXB4-dw5X9LUMsB16VWbihvRZQ1tT99m6zuBwDfqE,9606
|
|
117
|
+
autocoder/common/conversations/conversation_manager.py,sha256=ZhuhfSdOTncqgy3nHPoEU7Cg0dCsSl-VPcvLbUlL2Tk,18295
|
|
118
|
+
autocoder/common/conversations/example.py,sha256=Pz_EhO6qneUFMfHZiDmGAClZ6b0V4T1sbC8tIMxX2RM,5437
|
|
119
|
+
autocoder/common/file_monitor/__init__.py,sha256=9reL3IEnyLWU77WjPzeprM8-4lCetlSMZ94Nuxk5KNg,85
|
|
120
|
+
autocoder/common/file_monitor/monitor.py,sha256=lnav8TkNHEK_XqQGWpHIrw6l0U5s99ZoB94NH1AEHa4,16623
|
|
121
|
+
autocoder/common/ignorefiles/__init__.py,sha256=P0hq7Avu1IeXBYEkPBZLsJhFzhzyktUWTqaRIXiAFLY,75
|
|
122
|
+
autocoder/common/ignorefiles/ignore_file_utils.py,sha256=H1gUjjYLHZ_4GZel9bN5lEgpTlOyfPdIhyNRqd7no4c,3484
|
|
123
|
+
autocoder/common/ignorefiles/test_ignore_file_utils.py,sha256=EydHG6E2iPsnbt-Jt8Go-WvRgFtBW6QkHUQ9nI4cF-w,3111
|
|
114
124
|
autocoder/common/mcp_servers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
115
125
|
autocoder/common/mcp_servers/mcp_server_gpt4o_mini_search.py,sha256=TApShxgoozLluobXHOK1-oAE1zm0-9jdRoPLQB1qwMI,5688
|
|
116
126
|
autocoder/common/mcp_servers/mcp_server_perplexity.py,sha256=CIC26UkfH1lYoVCjfyY5xGGYVx8h0oz0Uj1c7YJ3OPw,5560
|
|
127
|
+
autocoder/common/rulefiles/__init__.py,sha256=babSbPdFaXk1NvdHtH2zrJLb_tWd7d2ELIyS8NApY_Y,221
|
|
128
|
+
autocoder/common/rulefiles/autocoderrules_utils.py,sha256=yQy52jNBxfTYcgOnuuEYdvyOLKdKJWkfDSNQsjUKYMs,6572
|
|
117
129
|
autocoder/common/v2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
118
130
|
autocoder/common/v2/code_agentic_editblock_manager.py,sha256=G0CIuV9Ki0FqMLnpA8nBT4pnkCNRvBN_4k_ZV1U1WHU,34781
|
|
119
131
|
autocoder/common/v2/code_auto_generate.py,sha256=hdhTTb0r1A8_OSuUIkxSXrwf47pXnazphufMu1vpkhI,9327
|
|
@@ -125,11 +137,11 @@ autocoder/common/v2/code_auto_merge_diff.py,sha256=DcljWrtlejq2cb9Gj-jBjvUQzRbCE
|
|
|
125
137
|
autocoder/common/v2/code_auto_merge_editblock.py,sha256=rVohrpjTzgvWEX09GNRAQ0fbjjNjcxeP1bqczhFT8F8,20741
|
|
126
138
|
autocoder/common/v2/code_auto_merge_strict_diff.py,sha256=C35pFxhkgypsm50VDAFOBAT6YXMtzKTvIpEUH1GjZZg,13209
|
|
127
139
|
autocoder/common/v2/code_diff_manager.py,sha256=dG7dqZQHarsyPYQ0-NHbHDCvgk3ATtwBgQ8oVVjCGE4,13091
|
|
128
|
-
autocoder/common/v2/code_editblock_manager.py,sha256=
|
|
140
|
+
autocoder/common/v2/code_editblock_manager.py,sha256=1VBIo3z_J-rUwJYlLwSGCxznOv6aXcMDZvPdAwfd0Iw,35351
|
|
129
141
|
autocoder/common/v2/code_manager.py,sha256=C403bS-f6urixwitlKHcml-J03hci-UyNwHJOqBiY6Q,9182
|
|
130
142
|
autocoder/common/v2/code_strict_diff_manager.py,sha256=v-J1kDyLg7tLGg_6_lbO9S4fNkx7M_L8Xr2G7fPptiU,9347
|
|
131
143
|
autocoder/common/v2/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
132
|
-
autocoder/common/v2/agent/agentic_edit.py,sha256=
|
|
144
|
+
autocoder/common/v2/agent/agentic_edit.py,sha256=yNQvIAnjbQnQHZWcu3Ztkn-hGAsux5twaLffp-gYi7s,98446
|
|
133
145
|
autocoder/common/v2/agent/agentic_edit_conversation.py,sha256=pFgWPWHKhZ4J9EcFmIdiGsrSolTZuYcH1qkgKdD8nwk,7726
|
|
134
146
|
autocoder/common/v2/agent/agentic_edit_types.py,sha256=VJMrictg6hJ3mC45VgQGRd43DyDUPDUvPV1Rf3z72NI,4776
|
|
135
147
|
autocoder/common/v2/agent/agentic_tool_display.py,sha256=WKirt-2V346KLnbHgH3NVJiK3xvriD9oaCWj2IdvzLU,7309
|
|
@@ -140,12 +152,13 @@ autocoder/common/v2/agent/agentic_edit_tools/attempt_completion_tool_resolver.py
|
|
|
140
152
|
autocoder/common/v2/agent/agentic_edit_tools/base_tool_resolver.py,sha256=Zid2m1uZd-2wVFGc_n_KAViXZyNjbdLSpI5n7ut1RUQ,1036
|
|
141
153
|
autocoder/common/v2/agent/agentic_edit_tools/execute_command_tool_resolver.py,sha256=sX00xzczfmyW6yPG3nMm0xO8p-WARQTiD4jcoUiTxsg,3844
|
|
142
154
|
autocoder/common/v2/agent/agentic_edit_tools/list_code_definition_names_tool_resolver.py,sha256=8QoMsADUDWliqiDt_dpguz31403syB8eeW0Pcw-qfb8,3842
|
|
143
|
-
autocoder/common/v2/agent/agentic_edit_tools/list_files_tool_resolver.py,sha256=
|
|
155
|
+
autocoder/common/v2/agent/agentic_edit_tools/list_files_tool_resolver.py,sha256=FvpEyBwAfrYvnxcQ_gt7vTmfgoFoR7qr-r1OPx13Xks,5475
|
|
144
156
|
autocoder/common/v2/agent/agentic_edit_tools/list_package_info_tool_resolver.py,sha256=dIdV12VuczHpHuHgx2B1j_3BZYc9PL0jfHCuBk9ryk8,2005
|
|
145
157
|
autocoder/common/v2/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py,sha256=lGT4_QYJK6Fa9f6HVSGo0cSsGK7qCsDYgJGUowNxPzk,1499
|
|
146
158
|
autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py,sha256=9Bh0KVbL0qiIqwChlb77biiBiETQ3zekxGe5Fj7hXAg,2800
|
|
147
159
|
autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py,sha256=lpD4fCbVR8GTrynqXON69IjM94nPy3nuUL62Ashm5O4,7988
|
|
148
|
-
autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py,sha256=
|
|
160
|
+
autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py,sha256=ACvygitMVOroQ8I-07v9fIvX9Xm9bO1HrIW--Xv9qKw,6894
|
|
161
|
+
autocoder/common/v2/agent/agentic_edit_tools/test_search_files_tool_resolver.py,sha256=9eBo3WLkrr77iNotwIwVmH1ZL3UY0JQgLpdAIc9wTTM,6127
|
|
149
162
|
autocoder/common/v2/agent/agentic_edit_tools/use_mcp_tool_resolver.py,sha256=wM2Xy4bcnD0TSLEmcM8rvvyyWenN5_KQnJMO6hJ8lTE,1716
|
|
150
163
|
autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py,sha256=UO4SrkDek3WDlRdlHH022W1roSNMdMcipJqDxRBlheM,3044
|
|
151
164
|
autocoder/compilers/__init__.py,sha256=C0HOms70QA747XD0uZEMmGtRFcIPenohyqECNStv0Bw,1647
|
|
@@ -186,7 +199,7 @@ autocoder/ignorefiles/test_ignore_file_utils.py,sha256=961_5ilCgzyo09Luj457A4694
|
|
|
186
199
|
autocoder/index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
187
200
|
autocoder/index/entry.py,sha256=Eb0SmwrgshQte3_IGL4GAB4_HXC2jbatrgrd2uPxQng,15306
|
|
188
201
|
autocoder/index/for_command.py,sha256=BFvljE4t6VaMBGboZAuhUCzVK0EitCy_n5D_7FEnihw,3204
|
|
189
|
-
autocoder/index/index.py,sha256=
|
|
202
|
+
autocoder/index/index.py,sha256=7ZVkcbc8I-meXdSUqa19mMs4IjQzqZy2OSzF6AyKJoI,32751
|
|
190
203
|
autocoder/index/symbols_utils.py,sha256=_EP7E_qWXxluAxq3FGZLlLfdrfwx3FmxCdulI8VGuac,2244
|
|
191
204
|
autocoder/index/types.py,sha256=a2s_KV5FJlq7jqA2ELSo9E1sjuLwDB-JJYMhSpzBAhU,596
|
|
192
205
|
autocoder/index/filter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -216,14 +229,14 @@ autocoder/privacy/__init__.py,sha256=LnIVvGu_K66zCE-yhN_-dPO8R80pQyedCsXJ7wRqQaI
|
|
|
216
229
|
autocoder/privacy/model_filter.py,sha256=-N9ZvxxDKpxU7hkn-tKv-QHyXjvkCopUaKgvJwTOGQs,3369
|
|
217
230
|
autocoder/pyproject/__init__.py,sha256=qn0_-6O_LP-ZH91nneYrn3yaIMYCYYRD1Z3MSNhXUXI,13754
|
|
218
231
|
autocoder/rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
219
|
-
autocoder/rag/api_server.py,sha256=
|
|
232
|
+
autocoder/rag/api_server.py,sha256=WyX4lHfHrs6_jovFfZTbXGaewyd0127J_PaI6VtgGic,13677
|
|
220
233
|
autocoder/rag/conversation_to_queries.py,sha256=xwmErn4WbdADnhK1me-h_6fV3KYrl_y1qPNQl1aoI6o,4810
|
|
221
234
|
autocoder/rag/doc_filter.py,sha256=UduVO2mlrngwJICrefjDJTYfdmQ4GcRXrfWDQ7xXksk,14206
|
|
222
235
|
autocoder/rag/document_retriever.py,sha256=rFwbAuHTvEFJq16HQNlmRLyJp2ddn2RNFslw_ncU7NI,8847
|
|
223
236
|
autocoder/rag/lang.py,sha256=HvcMeu6jReEJOGxyLMn4rwBoD-myFwmykS3VLceBJLs,3364
|
|
224
237
|
autocoder/rag/llm_wrapper.py,sha256=Ht5GF5yJtrztoliujsZzx_ooWZmHkd5xLZKcGEiicZw,4303
|
|
225
|
-
autocoder/rag/long_context_rag.py,sha256=
|
|
226
|
-
autocoder/rag/qa_conversation_strategy.py,sha256=
|
|
238
|
+
autocoder/rag/long_context_rag.py,sha256=SuCqKKYzlQYknqPOxZlToub4duiRzLhcoJLbdYjAQrI,42847
|
|
239
|
+
autocoder/rag/qa_conversation_strategy.py,sha256=4CiMK88apKbJ2YM4HHq1KGpr5jUkTh0_m_aCyt-JYgc,10568
|
|
227
240
|
autocoder/rag/rag_config.py,sha256=8LwFcTd8OJWWwi1_WY4IzjqgtT6RyE2j4PjxS5cCTDE,802
|
|
228
241
|
autocoder/rag/rag_entry.py,sha256=6TKtErZ0Us9XSV6HgRKXA6yR3SiZGPHpynOKSaR1wgE,2463
|
|
229
242
|
autocoder/rag/raw_rag.py,sha256=BOr0YGf3umjqXOIDVO1LXQ0bIHx8hzBdiubND2ezyxc,2946
|
|
@@ -236,7 +249,7 @@ autocoder/rag/token_counter.py,sha256=C-Lwc4oIjJpZDEqp9WLHGOe6hb4yhrdJpMtkrtp_1q
|
|
|
236
249
|
autocoder/rag/token_limiter.py,sha256=3VgJF4may3ESyATmBIiOe05oc3VsidJcJTJ5EhoSvH8,18854
|
|
237
250
|
autocoder/rag/token_limiter_utils.py,sha256=FATNEXBnFJy8IK3PWNt1pspIv8wuTgy3F_ACNvqoc4I,404
|
|
238
251
|
autocoder/rag/types.py,sha256=WPgLpUTwbk0BAikyDOc0NOEwV5k73myF38zWdOuYdC4,2499
|
|
239
|
-
autocoder/rag/utils.py,sha256=
|
|
252
|
+
autocoder/rag/utils.py,sha256=FPK3Vvk9X9tUuOu4_LctZN5WnRVuEjFiffRtE-pHn0s,6318
|
|
240
253
|
autocoder/rag/variable_holder.py,sha256=PFvBjFcR7-fNDD4Vcsc8CpH2Te057vcpwJMxtrfUgKI,75
|
|
241
254
|
autocoder/rag/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
242
255
|
autocoder/rag/cache/base_cache.py,sha256=EaYYYbclMBvnlOUoM7qonnluwZX5oSvUjdvGvFun8_8,742
|
|
@@ -247,13 +260,13 @@ autocoder/rag/cache/file_monitor_cache.py,sha256=lwNrm8epdA3ubc3X3q_BCU1zr_Ul5gE
|
|
|
247
260
|
autocoder/rag/cache/local_byzer_storage_cache.py,sha256=KtJimtBxsX2YC6OtznZ3tzp32zW6XjzEtF78EAEqlDY,31187
|
|
248
261
|
autocoder/rag/cache/local_duckdb_storage_cache.py,sha256=Kh0K9uu0JvU8u_kOfTzjHbsPmeK4b9dDoEyTLXV4-cE,35695
|
|
249
262
|
autocoder/rag/cache/rag_file_meta.py,sha256=RQ3n4wfkHlB-1ljS3sFSi8ijbsUPeIqBSgjmmbRuwRI,20521
|
|
250
|
-
autocoder/rag/cache/simple_cache.py,sha256=
|
|
263
|
+
autocoder/rag/cache/simple_cache.py,sha256=oT5tBSsBkUQ5DNVBzz5P3QJih-wKWdPyCAjmtFgl90Q,18270
|
|
251
264
|
autocoder/rag/loaders/__init__.py,sha256=EQHEZ5Cmz-mGP2SllUTvcIbYCnF7W149dNpNItfs0yE,304
|
|
252
|
-
autocoder/rag/loaders/docx_loader.py,sha256=
|
|
265
|
+
autocoder/rag/loaders/docx_loader.py,sha256=fDwFMfQcrjuiNXlc4NDpEygtg88rclqSPCcPYRSphhE,622
|
|
253
266
|
autocoder/rag/loaders/excel_loader.py,sha256=Ue8YB1z_kBs8SjIPuBskyM08Q1JiONs_BJZPrzi59oo,896
|
|
254
|
-
autocoder/rag/loaders/filter_utils.py,sha256=
|
|
255
|
-
autocoder/rag/loaders/image_loader.py,sha256=
|
|
256
|
-
autocoder/rag/loaders/pdf_loader.py,sha256=
|
|
267
|
+
autocoder/rag/loaders/filter_utils.py,sha256=Y-m8ckhCQvwTaPtcnlY66dhaHBzNtyhXbXEzzudUbho,6169
|
|
268
|
+
autocoder/rag/loaders/image_loader.py,sha256=GVBMWwLWUaGYcYYe_gUwVHmz71C1Cz3mFsCk4FnKtfE,22622
|
|
269
|
+
autocoder/rag/loaders/pdf_loader.py,sha256=S9hYCC-4XAKliKVbCrVkuNLetOvJVRtIzef_gjbNJpM,779
|
|
257
270
|
autocoder/rag/loaders/ppt_loader.py,sha256=7VEYc-bqgK8VHCoGC3DIUcqbpda-E5jQF9lYLqP256I,1681
|
|
258
271
|
autocoder/rag/loaders/test_image_loader.py,sha256=oy_j8xkFgPZ0vhz6czTVPh7IwdVWkgh5gE-UA2xCATQ,5753
|
|
259
272
|
autocoder/rag/stream_event/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -266,7 +279,7 @@ autocoder/shadows/shadow_manager.py,sha256=_DINnvD3oPaHopagL3B3PL0FFfEz7U6DYSEvE
|
|
|
266
279
|
autocoder/suffixproject/__init__.py,sha256=Rew-M9W4pgO9cvw9UCdrc6QVCPdBhVcIpPBnJxrLJ3M,10374
|
|
267
280
|
autocoder/tsproject/__init__.py,sha256=e_TWVyXQQxYKsXqdQZuFVqNCQLdtBVNJRTs0fgLXVdA,11055
|
|
268
281
|
autocoder/utils/__init__.py,sha256=W47ac6IOZhNR1rdbho9fvhHnPI_N1i4oMcZOwxLelbU,1123
|
|
269
|
-
autocoder/utils/_markitdown.py,sha256=
|
|
282
|
+
autocoder/utils/_markitdown.py,sha256=nxchvmt1hEtJsdXfwnMN-6OY0XhctE2ZftQsxXcaZh8,51296
|
|
270
283
|
autocoder/utils/auto_project_type.py,sha256=9_-wE9aavjbPiNSUVKxttJAdu5i5fu-zHyPYHr5XtWk,4422
|
|
271
284
|
autocoder/utils/coder.py,sha256=rK8e0svQBe0NOP26dIGToUXgha_hUDgxlWoC_p_r7oc,5698
|
|
272
285
|
autocoder/utils/conversation_store.py,sha256=esd9zLarKYe0ZsYqjjwHc_ksmVQDDEhVt-Ejul2oyys,1178
|
|
@@ -287,11 +300,11 @@ autocoder/utils/tests.py,sha256=BqphrwyycGAvs-5mhH8pKtMZdObwhFtJ5MC_ZAOiLq8,1340
|
|
|
287
300
|
autocoder/utils/thread_utils.py,sha256=VQCDrkTdij_5-01FE_X2Fprz_0uA-GahUY4h7DnAlw0,5426
|
|
288
301
|
autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
289
302
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
290
|
-
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=
|
|
303
|
+
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=BRgHta1JYBlHufmM5EtbwuMQfqw_g_Uwa6GZd0VpF18,14065
|
|
291
304
|
autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
292
|
-
auto_coder-0.1.
|
|
293
|
-
auto_coder-0.1.
|
|
294
|
-
auto_coder-0.1.
|
|
295
|
-
auto_coder-0.1.
|
|
296
|
-
auto_coder-0.1.
|
|
297
|
-
auto_coder-0.1.
|
|
305
|
+
auto_coder-0.1.354.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
306
|
+
auto_coder-0.1.354.dist-info/METADATA,sha256=H8D3PzblFwRpyTlTTMPqb2VBMOB1zMidbwnYr_aDxbw,2751
|
|
307
|
+
auto_coder-0.1.354.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
308
|
+
auto_coder-0.1.354.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
|
|
309
|
+
auto_coder-0.1.354.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
310
|
+
auto_coder-0.1.354.dist-info/RECORD,,
|
autocoder/auto_coder_rag.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
logging.getLogger("ppocr").setLevel(logging.WARNING)
|
|
3
|
+
|
|
1
4
|
import argparse
|
|
2
5
|
from typing import Optional, List
|
|
3
6
|
import byzerllm
|
|
@@ -19,8 +22,11 @@ from rich.table import Table
|
|
|
19
22
|
import os
|
|
20
23
|
import hashlib
|
|
21
24
|
from loguru import logger
|
|
25
|
+
import sys
|
|
22
26
|
import asyncio
|
|
23
27
|
from datetime import datetime
|
|
28
|
+
from autocoder.common.file_monitor.monitor import FileMonitor
|
|
29
|
+
from autocoder.common.rulefiles.autocoderrules_utils import get_rules
|
|
24
30
|
|
|
25
31
|
from autocoder.rag.utils import process_file_local
|
|
26
32
|
import pkg_resources
|
|
@@ -567,6 +573,7 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
567
573
|
# Generate unique name for RAG build if doc_dir exists
|
|
568
574
|
if server_args.doc_dir:
|
|
569
575
|
auto_coder_args.rag_build_name = generate_unique_name_from_path(server_args.doc_dir)
|
|
576
|
+
auto_coder_args.source_dir = server_args.doc_dir
|
|
570
577
|
logger.info(f"Generated RAG build name: {auto_coder_args.rag_build_name}")
|
|
571
578
|
|
|
572
579
|
if auto_coder_args.enable_hybrid_index and args.product_mode == "pro":
|
|
@@ -741,9 +748,38 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
741
748
|
service_info.save()
|
|
742
749
|
except Exception as e:
|
|
743
750
|
logger.warning(f"Failed to save service info: {str(e)}")
|
|
751
|
+
|
|
752
|
+
# Start FileMonitor if monitor_mode is enabled and source_dir is provided
|
|
753
|
+
if server_args.doc_dir:
|
|
754
|
+
try:
|
|
755
|
+
# Use singleton pattern to get/create monitor instance
|
|
756
|
+
# FileMonitor ensures only one instance runs per root_dir
|
|
757
|
+
monitor = FileMonitor(server_args.doc_dir)
|
|
758
|
+
if not monitor.is_running():
|
|
759
|
+
# TODO: Register specific callbacks here if needed in the future
|
|
760
|
+
# Example: monitor.register(os.path.join(args.source_dir, "specific_file.py"), my_callback)
|
|
761
|
+
monitor.start()
|
|
762
|
+
logger.info(f"File monitor started for directory: {server_args.doc_dir}")
|
|
763
|
+
else:
|
|
764
|
+
# Log if monitor was already running (e.g., started by another part of the app)
|
|
765
|
+
# Check if the existing monitor's root matches the current request
|
|
766
|
+
if monitor.root_dir == os.path.abspath(server_args.doc_dir):
|
|
767
|
+
logger.info(f"File monitor already running for directory: {monitor.root_dir}")
|
|
768
|
+
else:
|
|
769
|
+
logger.warning(f"File monitor is running for a different directory ({monitor.root_dir}), cannot start a new one for {args.source_dir}.")
|
|
770
|
+
|
|
771
|
+
logger.info(f"Getting rules for {server_args.doc_dir}")
|
|
772
|
+
_ = get_rules(server_args.doc_dir)
|
|
773
|
+
|
|
774
|
+
except ValueError as ve: # Catch specific error if root_dir is invalid during init
|
|
775
|
+
logger.error(f"Failed to initialize file monitor for {args.source_dir}: {ve}")
|
|
776
|
+
except ImportError as ie: # Catch if watchfiles is not installed
|
|
777
|
+
logger.error(f"Failed to start file monitor: {ie}")
|
|
778
|
+
except Exception as e:
|
|
779
|
+
logger.error(f"An unexpected error occurred while starting file monitor for {args.source_dir}: {e}")
|
|
744
780
|
|
|
745
781
|
serve(llm=llm_wrapper, args=server_args)
|
|
746
|
-
elif args.command == "build_hybrid_index":
|
|
782
|
+
elif args.command == "build_hybrid_index":
|
|
747
783
|
auto_coder_args = AutoCoderArgs(
|
|
748
784
|
**{
|
|
749
785
|
arg: getattr(args, arg)
|
autocoder/auto_coder_runner.py
CHANGED
|
@@ -63,6 +63,7 @@ from autocoder import command_parser as CommandParser
|
|
|
63
63
|
from loguru import logger as global_logger
|
|
64
64
|
from autocoder.utils.project_structure import EnhancedFileAnalyzer
|
|
65
65
|
from autocoder.common import SourceCodeList,SourceCode
|
|
66
|
+
from autocoder.common.file_monitor import FileMonitor
|
|
66
67
|
|
|
67
68
|
|
|
68
69
|
## 对外API,用于第三方集成 auto-coder 使用。
|
|
@@ -96,6 +97,7 @@ memory = {
|
|
|
96
97
|
|
|
97
98
|
project_root = os.getcwd()
|
|
98
99
|
|
|
100
|
+
|
|
99
101
|
base_persist_dir = os.path.join(project_root,".auto-coder", "plugins", "chat-auto-coder")
|
|
100
102
|
|
|
101
103
|
defaut_exclude_dirs = [".git", "node_modules", "dist", "build", "__pycache__",".auto-coder"]
|
|
@@ -255,6 +257,12 @@ def configure_logger():
|
|
|
255
257
|
|
|
256
258
|
configure_logger()
|
|
257
259
|
|
|
260
|
+
try:
|
|
261
|
+
FileMonitor(project_root).start()
|
|
262
|
+
except Exception as e:
|
|
263
|
+
global_logger.error(f"Failed to start file monitor: {e}")
|
|
264
|
+
global_logger.exception(e)
|
|
265
|
+
|
|
258
266
|
def initialize_system(args:InitializeSystemRequest):
|
|
259
267
|
from autocoder.utils.model_provider_selector import ModelProviderSelector
|
|
260
268
|
from autocoder import models as models_module
|
|
@@ -21,7 +21,7 @@ from autocoder.common import shells
|
|
|
21
21
|
from loguru import logger
|
|
22
22
|
from autocoder.utils import llms as llms_utils
|
|
23
23
|
from autocoder.rag.token_counter import count_tokens
|
|
24
|
-
from autocoder.common.global_cancel import global_cancel
|
|
24
|
+
from autocoder.common.global_cancel import global_cancel,CancelRequestedException
|
|
25
25
|
from autocoder.common.auto_configure import config_readme
|
|
26
26
|
from autocoder.utils.auto_project_type import ProjectTypeAnalyzer
|
|
27
27
|
from rich.text import Text
|
|
@@ -29,105 +29,10 @@ from autocoder.common.mcp_server import get_mcp_server, McpServerInfoRequest
|
|
|
29
29
|
from autocoder.common.action_yml_file_manager import ActionYmlFileManager
|
|
30
30
|
from autocoder.events.event_manager_singleton import get_event_manager
|
|
31
31
|
from autocoder.events import event_content as EventContentCreator
|
|
32
|
+
from autocoder.events.event_types import Event, EventType, EventMetadata
|
|
32
33
|
from autocoder.run_context import get_run_context
|
|
33
34
|
from autocoder.common.stream_out_type import AutoCommandStreamOutType
|
|
34
|
-
|
|
35
|
-
role: str
|
|
36
|
-
content: str
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
class ExtendedCommandMessage(BaseModel):
|
|
40
|
-
message: CommandMessage
|
|
41
|
-
timestamp: str
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class CommandConversation(BaseModel):
|
|
45
|
-
history: Dict[str, ExtendedCommandMessage]
|
|
46
|
-
current_conversation: List[ExtendedCommandMessage]
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def load_memory_file(args: AutoCoderArgs) -> CommandConversation:
|
|
50
|
-
"""Load command conversations from memory file"""
|
|
51
|
-
|
|
52
|
-
memory_dir = os.path.join(".auto-coder", "memory")
|
|
53
|
-
file_path = os.path.join(memory_dir, "command_chat_history.json")
|
|
54
|
-
if os.path.exists(file_path):
|
|
55
|
-
with open(file_path, "r", encoding="utf-8") as f:
|
|
56
|
-
try:
|
|
57
|
-
conversation = CommandConversation.model_validate_json(
|
|
58
|
-
f.read())
|
|
59
|
-
return conversation
|
|
60
|
-
except Exception:
|
|
61
|
-
return CommandConversation(history={}, current_conversation=[])
|
|
62
|
-
return CommandConversation(history={}, current_conversation=[])
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
class TimeBasedStrategy:
|
|
66
|
-
def __init__(self, max_idle_time=3600*24): # 24 hour in seconds
|
|
67
|
-
self.max_idle_time = max_idle_time
|
|
68
|
-
|
|
69
|
-
def should_archive(self, last_message_time):
|
|
70
|
-
"""Check if the conversation should be archived based on last message time"""
|
|
71
|
-
current_time = time.time()
|
|
72
|
-
return current_time - last_message_time > self.max_idle_time
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def save_to_memory_file(query: str, response: str):
|
|
76
|
-
"""Save command conversation to memory file using CommandConversation structure"""
|
|
77
|
-
memory_dir = os.path.join(".auto-coder", "memory")
|
|
78
|
-
os.makedirs(memory_dir, exist_ok=True)
|
|
79
|
-
file_path = os.path.join(memory_dir, "command_chat_history.json")
|
|
80
|
-
|
|
81
|
-
# Initialize time-based strategy
|
|
82
|
-
time_strategy = TimeBasedStrategy()
|
|
83
|
-
|
|
84
|
-
# Create new message objects
|
|
85
|
-
current_time = time.time()
|
|
86
|
-
user_msg = CommandMessage(role="user", content=query)
|
|
87
|
-
assistant_msg = CommandMessage(role="assistant", content=response)
|
|
88
|
-
|
|
89
|
-
extended_user_msg = ExtendedCommandMessage(
|
|
90
|
-
message=user_msg,
|
|
91
|
-
timestamp=str(int(current_time))
|
|
92
|
-
)
|
|
93
|
-
extended_assistant_msg = ExtendedCommandMessage(
|
|
94
|
-
message=assistant_msg,
|
|
95
|
-
timestamp=str(int(current_time))
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
# Load existing conversation or create new
|
|
99
|
-
if os.path.exists(file_path):
|
|
100
|
-
with open(file_path, "r", encoding="utf-8") as f:
|
|
101
|
-
try:
|
|
102
|
-
existing_conv = CommandConversation.model_validate_json(
|
|
103
|
-
f.read())
|
|
104
|
-
# Check if we should archive current conversation
|
|
105
|
-
if existing_conv.current_conversation:
|
|
106
|
-
last_message_time = float(
|
|
107
|
-
existing_conv.current_conversation[-1].timestamp)
|
|
108
|
-
if time_strategy.should_archive(last_message_time):
|
|
109
|
-
# Move current conversation to history
|
|
110
|
-
timestamp = str(int(last_message_time))
|
|
111
|
-
existing_conv.history[timestamp] = existing_conv.current_conversation
|
|
112
|
-
existing_conv.current_conversation = []
|
|
113
|
-
except Exception:
|
|
114
|
-
existing_conv = CommandConversation(
|
|
115
|
-
history={},
|
|
116
|
-
current_conversation=[]
|
|
117
|
-
)
|
|
118
|
-
else:
|
|
119
|
-
existing_conv = CommandConversation(
|
|
120
|
-
history={},
|
|
121
|
-
current_conversation=[]
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
existing_conv.current_conversation.append(extended_user_msg)
|
|
125
|
-
existing_conv.current_conversation.append(extended_assistant_msg)
|
|
126
|
-
# Save updated conversation
|
|
127
|
-
with open(file_path, "w", encoding="utf-8") as f:
|
|
128
|
-
f.write(existing_conv.model_dump_json(indent=2))
|
|
129
|
-
|
|
130
|
-
|
|
35
|
+
from autocoder.common.rulefiles.autocoderrules_utils import get_rules
|
|
131
36
|
class CommandSuggestion(BaseModel):
|
|
132
37
|
command: str
|
|
133
38
|
parameters: Dict[str, Any]
|
|
@@ -203,17 +108,14 @@ class CommandAutoTuner:
|
|
|
203
108
|
self.mcp_server_info = mcp_server_info_response.result
|
|
204
109
|
except Exception as e:
|
|
205
110
|
logger.error(f"Error getting MCP server info: {str(e)}")
|
|
206
|
-
self.mcp_server_info = ""
|
|
207
|
-
|
|
208
|
-
def get_conversations(self) -> List[CommandMessage]:
|
|
209
|
-
"""Get conversation history from memory file"""
|
|
210
|
-
conversation = load_memory_file(args=self.args)
|
|
211
|
-
return [command_message.message for command_message in conversation.current_conversation]
|
|
111
|
+
self.mcp_server_info = ""
|
|
212
112
|
|
|
213
113
|
@byzerllm.prompt()
|
|
214
114
|
def _analyze(self, request: AutoCommandRequest) -> str:
|
|
215
115
|
"""
|
|
216
116
|
你是 auto-coder.chat 软件,帮助用户完成编程方面的需求。我们的目标是根据用户输入和当前上下文,组合多个函数来完成用户的需求。
|
|
117
|
+
|
|
118
|
+
====
|
|
217
119
|
|
|
218
120
|
## 当前用户环境信息如下:
|
|
219
121
|
<os_info>
|
|
@@ -254,6 +156,8 @@ class CommandAutoTuner:
|
|
|
254
156
|
{{ current_conf }}
|
|
255
157
|
</current_conf>
|
|
256
158
|
|
|
159
|
+
====
|
|
160
|
+
|
|
257
161
|
## 可用函数列表:
|
|
258
162
|
{{ available_commands }}
|
|
259
163
|
|
|
@@ -263,6 +167,8 @@ class CommandAutoTuner:
|
|
|
263
167
|
## 函数组合说明:
|
|
264
168
|
{{ command_combination_readme }}
|
|
265
169
|
|
|
170
|
+
====
|
|
171
|
+
|
|
266
172
|
## active-context 项目追踪文档系统
|
|
267
173
|
|
|
268
174
|
在 {{ current_project }}/.auto-coder/active-context 下,我们提供了对该项目每个文件目录的追踪。
|
|
@@ -279,9 +185,10 @@ class CommandAutoTuner:
|
|
|
279
185
|
- query: 用户需求
|
|
280
186
|
- urls: 用户提供的上下文文件列表
|
|
281
187
|
- dynamic_urls: auto-coder.chat 自动感知的一些文件列表
|
|
282
|
-
- add_updated_urls: 这次需求发生变更的文件列表
|
|
283
|
-
|
|
188
|
+
- add_updated_urls: 这次需求发生变更的文件列表
|
|
189
|
+
|
|
284
190
|
{% if conversation_history %}
|
|
191
|
+
====
|
|
285
192
|
## 历史对话:
|
|
286
193
|
<conversation_history>
|
|
287
194
|
{% for conv in conversation_history %}
|
|
@@ -289,6 +196,18 @@ class CommandAutoTuner:
|
|
|
289
196
|
{% endfor %}
|
|
290
197
|
</conversation_history>
|
|
291
198
|
{% endif %}
|
|
199
|
+
|
|
200
|
+
{% if rules %}
|
|
201
|
+
====
|
|
202
|
+
|
|
203
|
+
用户提供的规则文件,你必须严格遵守。
|
|
204
|
+
{% for key, value in rules.items() %}
|
|
205
|
+
<user_rule>
|
|
206
|
+
##File: {{ key }}
|
|
207
|
+
{{ value }}
|
|
208
|
+
</user_rule>
|
|
209
|
+
{% endfor %}
|
|
210
|
+
{% endif %}
|
|
292
211
|
|
|
293
212
|
## 用户需求:
|
|
294
213
|
<user_input>
|
|
@@ -326,7 +245,8 @@ class CommandAutoTuner:
|
|
|
326
245
|
return {
|
|
327
246
|
"user_input": request.user_input,
|
|
328
247
|
"current_files": self.memory_config.memory["current_files"]["files"],
|
|
329
|
-
"conversation_history":
|
|
248
|
+
"conversation_history": [],
|
|
249
|
+
"rules": get_rules(),
|
|
330
250
|
"available_commands": self._command_readme.prompt(),
|
|
331
251
|
"current_conf": json.dumps(self.memory_config.memory["conf"], indent=2),
|
|
332
252
|
"env_info": env_info,
|
|
@@ -461,7 +381,8 @@ class CommandAutoTuner:
|
|
|
461
381
|
display_func=extract_command_response,
|
|
462
382
|
args=self.args,
|
|
463
383
|
extra_meta={
|
|
464
|
-
"stream_out_type": AutoCommandStreamOutType.COMMAND_SUGGESTION.value
|
|
384
|
+
"stream_out_type": AutoCommandStreamOutType.COMMAND_SUGGESTION.value,
|
|
385
|
+
"path": "/agentic/agent/command_suggestion"
|
|
465
386
|
}
|
|
466
387
|
)
|
|
467
388
|
|
|
@@ -515,12 +436,7 @@ class CommandAutoTuner:
|
|
|
515
436
|
conversations.append({"role": "assistant", "content": result})
|
|
516
437
|
# 提取 JSON 并转换为 AutoCommandResponse
|
|
517
438
|
response = to_model(result, AutoCommandResponse)
|
|
518
|
-
|
|
519
|
-
# 保存对话记录
|
|
520
|
-
save_to_memory_file(
|
|
521
|
-
query=request.user_input,
|
|
522
|
-
response=response.model_dump_json(indent=2)
|
|
523
|
-
)
|
|
439
|
+
|
|
524
440
|
result_manager = ResultManager()
|
|
525
441
|
|
|
526
442
|
while True:
|
|
@@ -539,7 +455,11 @@ class CommandAutoTuner:
|
|
|
539
455
|
EventContentCreator.ResultCommandPrepareStatContent(
|
|
540
456
|
command=command,
|
|
541
457
|
parameters=parameters
|
|
542
|
-
).to_dict())
|
|
458
|
+
).to_dict()),metadata=EventMetadata(
|
|
459
|
+
stream_out_type="command_prepare",
|
|
460
|
+
path="/agentic/agent/command_prepare",
|
|
461
|
+
action_file=self.args.file
|
|
462
|
+
).to_dict())
|
|
543
463
|
|
|
544
464
|
self.execute_auto_command(command, parameters)
|
|
545
465
|
content = ""
|
|
@@ -566,7 +486,13 @@ class CommandAutoTuner:
|
|
|
566
486
|
"auto_command_action_break", command=command, action=action)
|
|
567
487
|
printer.print_str_in_terminal(temp_content,style="yellow")
|
|
568
488
|
get_event_manager(self.args.event_file).write_result(
|
|
569
|
-
EventContentCreator.create_result(content=temp_content)
|
|
489
|
+
EventContentCreator.create_result(content=temp_content),
|
|
490
|
+
metadata=EventMetadata(
|
|
491
|
+
stream_out_type="command_break",
|
|
492
|
+
path="/agentic/agent/command_break",
|
|
493
|
+
action_file=self.args.file
|
|
494
|
+
).to_dict()
|
|
495
|
+
)
|
|
570
496
|
break
|
|
571
497
|
|
|
572
498
|
if command == "response_user":
|
|
@@ -576,7 +502,12 @@ class CommandAutoTuner:
|
|
|
576
502
|
EventContentCreator.create_result(content=EventContentCreator.ResultCommandExecuteStatContent(
|
|
577
503
|
command=command,
|
|
578
504
|
content=content
|
|
579
|
-
).to_dict())
|
|
505
|
+
).to_dict()),metadata=EventMetadata(
|
|
506
|
+
stream_out_type="command_execute",
|
|
507
|
+
path="/agentic/agent/command_execute",
|
|
508
|
+
action_file=self.args.file
|
|
509
|
+
).to_dict()
|
|
510
|
+
)
|
|
580
511
|
|
|
581
512
|
# 打印执行结果
|
|
582
513
|
console = Console()
|
|
@@ -678,17 +609,18 @@ class CommandAutoTuner:
|
|
|
678
609
|
# 提取 JSON 并转换为 AutoCommandResponse
|
|
679
610
|
response = to_model(result, AutoCommandResponse)
|
|
680
611
|
if not response or not response.suggestions:
|
|
681
|
-
break
|
|
682
|
-
|
|
683
|
-
save_to_memory_file(
|
|
684
|
-
query=request.user_input,
|
|
685
|
-
response=response.model_dump_json(indent=2)
|
|
686
|
-
)
|
|
612
|
+
break
|
|
687
613
|
else:
|
|
688
614
|
temp_content = printer.get_message_from_key_with_format("auto_command_break", command=command)
|
|
689
615
|
printer.print_str_in_terminal(temp_content,style="yellow")
|
|
690
616
|
get_event_manager(self.args.event_file).write_result(
|
|
691
|
-
EventContentCreator.create_result(content=temp_content)
|
|
617
|
+
EventContentCreator.create_result(content=temp_content),
|
|
618
|
+
metadata=EventMetadata(
|
|
619
|
+
stream_out_type="command_break",
|
|
620
|
+
path="/agentic/agent/command_break",
|
|
621
|
+
action_file=self.args.file
|
|
622
|
+
).to_dict()
|
|
623
|
+
)
|
|
692
624
|
break
|
|
693
625
|
|
|
694
626
|
return response
|
|
@@ -1517,18 +1449,14 @@ class CommandAutoTuner:
|
|
|
1517
1449
|
command_map[command](**parameters)
|
|
1518
1450
|
else:
|
|
1519
1451
|
command_map[command]()
|
|
1452
|
+
except CancelRequestedException as e:
|
|
1453
|
+
raise e
|
|
1520
1454
|
|
|
1521
1455
|
except Exception as e:
|
|
1522
1456
|
error_msg = str(e)
|
|
1523
1457
|
self.printer.print_in_terminal(
|
|
1524
1458
|
"auto_command_failed", style="red", command=command, error=error_msg)
|
|
1525
|
-
|
|
1526
|
-
# Save failed command execution
|
|
1527
|
-
save_to_memory_file(
|
|
1528
|
-
query=f"Command: {command} Parameters: {json.dumps(parameters) if parameters else 'None'}",
|
|
1529
|
-
response=f"Command execution failed: {error_msg}"
|
|
1530
|
-
)
|
|
1531
|
-
|
|
1459
|
+
|
|
1532
1460
|
self.result_manager = ResultManager()
|
|
1533
1461
|
result = f"command {command} with parameters {parameters} execution failed with error {error_msg}"
|
|
1534
1462
|
self.result_manager.add_result(content=result, meta={
|
autocoder/commands/tools.py
CHANGED
|
@@ -48,7 +48,7 @@ from autocoder.common.mcp_server_types import (
|
|
|
48
48
|
McpListRunningRequest, McpRefreshRequest
|
|
49
49
|
)
|
|
50
50
|
|
|
51
|
-
from autocoder.ignorefiles.ignore_file_utils import should_ignore
|
|
51
|
+
from autocoder.common.ignorefiles.ignore_file_utils import should_ignore
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
@byzerllm.prompt()
|
autocoder/common/__init__.py
CHANGED
|
@@ -368,7 +368,7 @@ class AutoCoderArgs(pydantic.BaseModel):
|
|
|
368
368
|
segment_ratio: Optional[float] = 0.2
|
|
369
369
|
buff_ratio: Optional[float] = 0.1
|
|
370
370
|
|
|
371
|
-
disable_inference_enhance: Optional[bool] =
|
|
371
|
+
disable_inference_enhance: Optional[bool] = True
|
|
372
372
|
inference_deep_thought: Optional[bool] = False
|
|
373
373
|
inference_slow_without_deep_thought: Optional[bool] = False
|
|
374
374
|
inference_compute_precision: int = 64
|