auto-coder 0.1.326__py3-none-any.whl → 0.1.327__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.326.dist-info → auto_coder-0.1.327.dist-info}/METADATA +1 -1
- {auto_coder-0.1.326.dist-info → auto_coder-0.1.327.dist-info}/RECORD +10 -10
- autocoder/common/stream_out_type.py +3 -0
- autocoder/events/event_content.py +29 -0
- autocoder/index/index.py +43 -9
- autocoder/version.py +1 -1
- {auto_coder-0.1.326.dist-info → auto_coder-0.1.327.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.326.dist-info → auto_coder-0.1.327.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.326.dist-info → auto_coder-0.1.327.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.326.dist-info → auto_coder-0.1.327.dist-info}/top_level.txt +0 -0
|
@@ -14,7 +14,7 @@ autocoder/command_parser.py,sha256=fx1g9E6GaM273lGTcJqaFQ-hoksS_Ik2glBMnVltPCE,1
|
|
|
14
14
|
autocoder/lang.py,sha256=U6AjVV8Rs1uLyjFCZ8sT6WWuNUxMBqkXXIOs4S120uk,14511
|
|
15
15
|
autocoder/models.py,sha256=AyoZ-Pzy0oyYUmWCxOIRiOImsqboSfRET7LO9-UOuxI,11172
|
|
16
16
|
autocoder/run_context.py,sha256=IUfSO6_gp2Wt1blFWAmOpN0b0nDrTTk4LmtCYUBIoro,1643
|
|
17
|
-
autocoder/version.py,sha256=
|
|
17
|
+
autocoder/version.py,sha256=miEiKBcN07ycv510z1gvZ9J70UiJ9CPTI0zhuZXmYxg,23
|
|
18
18
|
autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
autocoder/agent/auto_demand_organizer.py,sha256=URAq0gSEiHeV_W4zwhOI_83kHz0Ryfj1gcfh5jwCv_w,6501
|
|
20
20
|
autocoder/agent/auto_filegroup.py,sha256=pBsAkBcpFTff-9L5OwI8xhf2xPKpl-aZwz-skF2B6dc,6296
|
|
@@ -83,7 +83,7 @@ autocoder/common/search.py,sha256=245iPFgWhMldoUK3CqCP89ltaxZiNPK73evoG6Fp1h8,16
|
|
|
83
83
|
autocoder/common/search_replace.py,sha256=GphFkc57Hb673CAwmbiocqTbw8vrV7TrZxtOhD0332g,22147
|
|
84
84
|
autocoder/common/shells.py,sha256=elminFpNosnV0hsEUcsugDxlGO8NfH96uah-8bkaBvA,19929
|
|
85
85
|
autocoder/common/stats_panel.py,sha256=wGl9O45pjVVDxhNumLv4_NfLYSlUP_18Tw4hcJSjw50,4596
|
|
86
|
-
autocoder/common/stream_out_type.py,sha256=
|
|
86
|
+
autocoder/common/stream_out_type.py,sha256=PTkrY4_QEAFBPTcc_VUzb2dLL8XnRtV7MypNFGMjrHs,443
|
|
87
87
|
autocoder/common/sys_prompt.py,sha256=JlexfjZt554faqbgkCmzOJqYUzDHfbnxly5ugFfHfEE,26403
|
|
88
88
|
autocoder/common/text.py,sha256=KGRQq314GHBmY4MWG8ossRoQi1_DTotvhxchpn78c-k,1003
|
|
89
89
|
autocoder/common/token_cost_caculate.py,sha256=MSWJtl7YpQSUt-gFQoqUcJMblyPqHXe2ZioiZOFkV80,10085
|
|
@@ -117,7 +117,7 @@ autocoder/dispacher/actions/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQ
|
|
|
117
117
|
autocoder/dispacher/actions/plugins/action_regex_project.py,sha256=Vp07ANh0LlHoVPLM9ovTiIKv1gsUuCF57Gje4XiFVDA,8000
|
|
118
118
|
autocoder/dispacher/actions/plugins/action_translate.py,sha256=GEn7dZA22jy5WyzINomjmzzB795p2Olg-CJla97lRF8,7744
|
|
119
119
|
autocoder/events/__init__.py,sha256=1x_juwr9Ows2RADDa2LyI4QlmPxOVOXZeLO1cht-slM,1443
|
|
120
|
-
autocoder/events/event_content.py,sha256=
|
|
120
|
+
autocoder/events/event_content.py,sha256=g55Z55s-ud9IzYp6u7BnLSsHHAAg34w1jrHo-C1w68A,12280
|
|
121
121
|
autocoder/events/event_manager.py,sha256=WsEog4diXPsidCcN-Ycm18iPbX21PBibkcmjee-aRcQ,11739
|
|
122
122
|
autocoder/events/event_manager_singleton.py,sha256=8aBp97fgbas0KYrpHbljTg2n4RcWd85SOgQITu47ZWA,8809
|
|
123
123
|
autocoder/events/event_store.py,sha256=y6tT3P-o3yhDptrKi-UmqI_ZBNg7v21FriI3f7lo_ME,12709
|
|
@@ -127,7 +127,7 @@ autocoder/helper/project_creator.py,sha256=RITjVfZ_Y5zytSHTNYiwxfn2Eqfvf2Ywe13e6
|
|
|
127
127
|
autocoder/index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
128
128
|
autocoder/index/entry.py,sha256=a8KhkNd6tKuD6W9fh9ohdri2r4UYeZWswi14pVwpr-Q,15740
|
|
129
129
|
autocoder/index/for_command.py,sha256=BFvljE4t6VaMBGboZAuhUCzVK0EitCy_n5D_7FEnihw,3204
|
|
130
|
-
autocoder/index/index.py,sha256
|
|
130
|
+
autocoder/index/index.py,sha256=-_GtT67ERxqdI4ajDyWr2cTsordpG_G9SYSwbTxDAcA,32491
|
|
131
131
|
autocoder/index/symbols_utils.py,sha256=_EP7E_qWXxluAxq3FGZLlLfdrfwx3FmxCdulI8VGuac,2244
|
|
132
132
|
autocoder/index/types.py,sha256=a2s_KV5FJlq7jqA2ELSo9E1sjuLwDB-JJYMhSpzBAhU,596
|
|
133
133
|
autocoder/index/filter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -226,9 +226,9 @@ autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
226
226
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
227
227
|
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=xuBeWD0YOckqRo8JB1WkVIMOYH6c24m7JfV4svBfPDo,15113
|
|
228
228
|
autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
229
|
-
auto_coder-0.1.
|
|
230
|
-
auto_coder-0.1.
|
|
231
|
-
auto_coder-0.1.
|
|
232
|
-
auto_coder-0.1.
|
|
233
|
-
auto_coder-0.1.
|
|
234
|
-
auto_coder-0.1.
|
|
229
|
+
auto_coder-0.1.327.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
230
|
+
auto_coder-0.1.327.dist-info/METADATA,sha256=xGfc33ogoMBS7t9utBeDgZs3YW_7yRnJWaOb0tZuXX0,2747
|
|
231
|
+
auto_coder-0.1.327.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
232
|
+
auto_coder-0.1.327.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
|
|
233
|
+
auto_coder-0.1.327.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
234
|
+
auto_coder-0.1.327.dist-info/RECORD,,
|
|
@@ -119,6 +119,35 @@ class ResultTokenStatContent(BaseModel):
|
|
|
119
119
|
"""转换为JSON字符串"""
|
|
120
120
|
return self.model_dump_json()
|
|
121
121
|
|
|
122
|
+
class IndexBuildStartContent(BaseModel):
|
|
123
|
+
file_number:int = 0
|
|
124
|
+
total_files:int = 0
|
|
125
|
+
|
|
126
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
127
|
+
"""转换为字典"""
|
|
128
|
+
return self.model_dump()
|
|
129
|
+
|
|
130
|
+
def to_json(self) -> str:
|
|
131
|
+
"""转换为JSON字符串"""
|
|
132
|
+
return self.model_dump_json()
|
|
133
|
+
|
|
134
|
+
class IndexBuildEndContent(BaseModel):
|
|
135
|
+
updated_files:int = 0
|
|
136
|
+
removed_files:int = 0
|
|
137
|
+
input_tokens:int = 0
|
|
138
|
+
output_tokens:int = 0
|
|
139
|
+
input_cost:float = 0.0
|
|
140
|
+
output_cost:float = 0.0
|
|
141
|
+
|
|
142
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
143
|
+
"""转换为字典"""
|
|
144
|
+
return self.model_dump()
|
|
145
|
+
|
|
146
|
+
def to_json(self) -> str:
|
|
147
|
+
"""转换为JSON字符串"""
|
|
148
|
+
return self.model_dump_json()
|
|
149
|
+
|
|
150
|
+
|
|
122
151
|
|
|
123
152
|
class ResultCommandPrepareStatContent(BaseModel):
|
|
124
153
|
command:str = ""
|
autocoder/index/index.py
CHANGED
|
@@ -28,7 +28,9 @@ from autocoder.index.types import (
|
|
|
28
28
|
from autocoder.common.global_cancel import global_cancel
|
|
29
29
|
from autocoder.utils.llms import get_llm_names
|
|
30
30
|
from autocoder.rag.token_counter import count_tokens
|
|
31
|
-
|
|
31
|
+
from autocoder.common.stream_out_type import IndexStreamOutType
|
|
32
|
+
from autocoder.events.event_manager_singleton import get_event_manager
|
|
33
|
+
from autocoder.events import event_content as EventContentCreator
|
|
32
34
|
|
|
33
35
|
class IndexManager:
|
|
34
36
|
def __init__(
|
|
@@ -190,7 +192,7 @@ class IndexManager:
|
|
|
190
192
|
{{ code }}
|
|
191
193
|
|
|
192
194
|
## 输出
|
|
193
|
-
"""
|
|
195
|
+
"""
|
|
194
196
|
|
|
195
197
|
@byzerllm.prompt()
|
|
196
198
|
def jsp_get_all_file_symbols(self, path: str, code: str) -> str:
|
|
@@ -224,11 +226,11 @@ class IndexManager:
|
|
|
224
226
|
url : "admWorkingDay!updateAdmWorkingDayList.action", 中,那么对应的为 <ajax method="post" url="admWorkingDay!updateAdmWorkingDayList.action">
|
|
225
227
|
10. 导入语句中需要包含超连接,比如 <a href="admRiskLimits!queryAdmRiskLimitsById.action?admRiskLimits.id=${fn:escapeXml(item.id)}">${fn:escapeXml(item.classification)}, 对应的为 <a href="admRiskLimits!queryAdmRiskLimitsById.action"}
|
|
226
228
|
11. 导入语句中需要包含一些js函数里的值,比如 window.onbeforeunload = function() {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
var actionType = document.ap_ActionPlanForm.action.value;
|
|
230
|
+
if(typeof(window.opener.reloadApCount)!="undefined"&&(actionType&&actionType!='Discard')){
|
|
231
|
+
}
|
|
230
232
|
} 对应为 <window.onbeforeunload url="from 表单名字为ap_ActionPlanForm的action的值">
|
|
231
|
-
|
|
233
|
+
|
|
232
234
|
下面是一段示例:
|
|
233
235
|
|
|
234
236
|
## 输入
|
|
@@ -363,14 +365,14 @@ class IndexManager:
|
|
|
363
365
|
else:
|
|
364
366
|
meta_holder = byzerllm.MetaHolder()
|
|
365
367
|
ext = os.path.splitext(file_path)[1].lower()
|
|
366
|
-
|
|
368
|
+
# 需要有特殊prompt
|
|
367
369
|
if ext == ".jsp":
|
|
368
370
|
symbols = self.jsp_get_all_file_symbols.with_llm(
|
|
369
371
|
self.index_llm).with_meta(meta_holder).run(source.module_name, source_code)
|
|
370
372
|
else:
|
|
371
373
|
symbols = self.get_all_file_symbols.with_llm(
|
|
372
374
|
self.index_llm).with_meta(meta_holder).run(source.module_name, source_code)
|
|
373
|
-
|
|
375
|
+
|
|
374
376
|
time.sleep(self.anti_quota_limit)
|
|
375
377
|
|
|
376
378
|
if meta_holder.get_meta():
|
|
@@ -478,7 +480,8 @@ class IndexManager:
|
|
|
478
480
|
|
|
479
481
|
# 删除被排除的文件
|
|
480
482
|
try:
|
|
481
|
-
exclude_patterns = self.parse_exclude_files(
|
|
483
|
+
exclude_patterns = self.parse_exclude_files(
|
|
484
|
+
self.args.exclude_files)
|
|
482
485
|
for file_path in index_data:
|
|
483
486
|
if self.filter_exclude_files(file_path, exclude_patterns):
|
|
484
487
|
keys_to_remove.append(file_path)
|
|
@@ -546,6 +549,19 @@ class IndexManager:
|
|
|
546
549
|
num_files=num_files
|
|
547
550
|
)
|
|
548
551
|
|
|
552
|
+
get_event_manager(self.args.event_file).write_result(
|
|
553
|
+
EventContentCreator.create_result(
|
|
554
|
+
content=EventContentCreator.IndexBuildStartContent(
|
|
555
|
+
file_number=num_files,
|
|
556
|
+
total_files=total_files
|
|
557
|
+
).to_dict(),
|
|
558
|
+
metadata={
|
|
559
|
+
"stream_out_type": IndexStreamOutType.INDEX_BUILD.value,
|
|
560
|
+
"action_file": self.args.file
|
|
561
|
+
}
|
|
562
|
+
)
|
|
563
|
+
)
|
|
564
|
+
|
|
549
565
|
futures = [
|
|
550
566
|
executor.submit(self.build_index_for_single_source, source)
|
|
551
567
|
for source in wait_to_build_files
|
|
@@ -592,6 +608,24 @@ class IndexManager:
|
|
|
592
608
|
)
|
|
593
609
|
print("")
|
|
594
610
|
|
|
611
|
+
# 记录索引构建完成事件
|
|
612
|
+
get_event_manager(self.args.event_file).write_result(
|
|
613
|
+
EventContentCreator.create_result(
|
|
614
|
+
content=EventContentCreator.IndexBuildEndContent(
|
|
615
|
+
updated_files=len(updated_sources),
|
|
616
|
+
removed_files=len(keys_to_remove),
|
|
617
|
+
input_tokens=total_input_tokens,
|
|
618
|
+
output_tokens=total_output_tokens,
|
|
619
|
+
input_cost=total_input_cost,
|
|
620
|
+
output_cost=total_output_cost
|
|
621
|
+
).to_dict(),
|
|
622
|
+
metadata={}
|
|
623
|
+
).to_dict(),
|
|
624
|
+
metadata={
|
|
625
|
+
"stream_out_type": IndexStreamOutType.INDEX_BUILD.value,
|
|
626
|
+
"action_file": self.args.file
|
|
627
|
+
}
|
|
628
|
+
)
|
|
595
629
|
return index_data
|
|
596
630
|
|
|
597
631
|
def read_index_as_str(self):
|
autocoder/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.327"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|