auto-coder 0.1.207__py3-none-any.whl → 0.1.209__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.

Files changed (37) hide show
  1. {auto_coder-0.1.207.dist-info → auto_coder-0.1.209.dist-info}/METADATA +4 -3
  2. {auto_coder-0.1.207.dist-info → auto_coder-0.1.209.dist-info}/RECORD +37 -34
  3. autocoder/agent/auto_demand_organizer.py +212 -0
  4. autocoder/agent/auto_guess_query.py +284 -0
  5. autocoder/auto_coder.py +64 -19
  6. autocoder/auto_coder_rag.py +6 -0
  7. autocoder/chat_auto_coder.py +119 -16
  8. autocoder/command_args.py +21 -5
  9. autocoder/common/__init__.py +7 -1
  10. autocoder/common/code_auto_generate.py +32 -10
  11. autocoder/common/code_auto_generate_diff.py +85 -47
  12. autocoder/common/code_auto_generate_editblock.py +50 -28
  13. autocoder/common/code_auto_generate_strict_diff.py +79 -45
  14. autocoder/common/code_auto_merge.py +51 -15
  15. autocoder/common/code_auto_merge_diff.py +55 -2
  16. autocoder/common/code_auto_merge_editblock.py +84 -14
  17. autocoder/common/code_auto_merge_strict_diff.py +69 -32
  18. autocoder/common/code_modification_ranker.py +100 -0
  19. autocoder/common/command_completer.py +6 -4
  20. autocoder/common/types.py +10 -2
  21. autocoder/dispacher/actions/action.py +141 -94
  22. autocoder/dispacher/actions/plugins/action_regex_project.py +35 -25
  23. autocoder/lang.py +9 -1
  24. autocoder/pyproject/__init__.py +4 -0
  25. autocoder/rag/cache/simple_cache.py +8 -2
  26. autocoder/rag/loaders/docx_loader.py +3 -2
  27. autocoder/rag/loaders/pdf_loader.py +3 -1
  28. autocoder/rag/long_context_rag.py +12 -2
  29. autocoder/rag/rag_entry.py +2 -2
  30. autocoder/rag/utils.py +14 -9
  31. autocoder/suffixproject/__init__.py +2 -0
  32. autocoder/tsproject/__init__.py +4 -0
  33. autocoder/version.py +1 -1
  34. {auto_coder-0.1.207.dist-info → auto_coder-0.1.209.dist-info}/LICENSE +0 -0
  35. {auto_coder-0.1.207.dist-info → auto_coder-0.1.209.dist-info}/WHEEL +0 -0
  36. {auto_coder-0.1.207.dist-info → auto_coder-0.1.209.dist-info}/entry_points.txt +0 -0
  37. {auto_coder-0.1.207.dist-info → auto_coder-0.1.209.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.207
3
+ Version: 0.1.209
4
4
  Summary: AutoCoder: AutoCoder
5
5
  Author: allwefantasy
6
6
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
@@ -26,7 +26,7 @@ Requires-Dist: tabulate
26
26
  Requires-Dist: jupyter-client
27
27
  Requires-Dist: prompt-toolkit
28
28
  Requires-Dist: tokenizers
29
- Requires-Dist: byzerllm[saas] >=0.1.140
29
+ Requires-Dist: byzerllm[saas] >=0.1.143
30
30
  Requires-Dist: patch
31
31
  Requires-Dist: diff-match-patch
32
32
  Requires-Dist: GitPython
@@ -69,13 +69,14 @@ Auto-Coder (powered by Byzer-LLM)
69
69
  </h3>
70
70
 
71
71
  <p align="center">
72
- | <a href="./docs/en"><b>English</b></a> | <a href="https://uelng8wukz.feishu.cn/wiki/QIpkwpQo2iSdkwk9nP6cNSPlnPc"><b>中文</b></a> |
72
+ <a href="https://uelng8wukz.feishu.cn/wiki/QIpkwpQo2iSdkwk9nP6cNSPlnPc"><b>中文</b></a> |
73
73
 
74
74
  </p>
75
75
 
76
76
  ---
77
77
 
78
78
  *Latest News* 🔥
79
+ - [2025/01] Release Auto-Coder 0.1.208
79
80
  - [2024/09] Release Auto-Coder 0.1.163
80
81
  - [2024/08] Release Auto-Coder 0.1.143
81
82
  - [2024/07] Release Auto-Coder 0.1.115
@@ -1,16 +1,18 @@
1
1
  autocoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- autocoder/auto_coder.py,sha256=IP4aSmuZh3HaIzLIThTKHF0PB38eTPUU1GDdfuJBam4,38971
2
+ autocoder/auto_coder.py,sha256=JD8wsideQo1TYAs7tw4sHETRh4EKgB2TqGcrKjzVz2g,41215
3
3
  autocoder/auto_coder_lang.py,sha256=Rtupq6N3_HT7JRhDKdgCBcwRaiAnyCOR_Gsp4jUomrI,3229
4
- autocoder/auto_coder_rag.py,sha256=UNP69PTJA_Iz0MIF_RS26o9slSUvm3f3D7yQBxGYKAY,21578
4
+ autocoder/auto_coder_rag.py,sha256=hU7NmCUIM__918p1RbGFlJKPVEqdr4NXjD6b1dBgEVU,21743
5
5
  autocoder/auto_coder_server.py,sha256=XU9b4SBH7zjPPXaTWWHV4_zJm-XYa6njuLQaplYJH_c,20290
6
6
  autocoder/benchmark.py,sha256=Ypomkdzd1T3GE6dRICY3Hj547dZ6_inqJbBJIp5QMco,4423
7
- autocoder/chat_auto_coder.py,sha256=PtES0XppQ4OTuMucQZFXN5j-6rXS4Rc7RL5gmBy3GZU,87182
7
+ autocoder/chat_auto_coder.py,sha256=zWmkG6b3-18unROg2u7cEkziJlyKIoDYIclW0fWDbCQ,90645
8
8
  autocoder/chat_auto_coder_lang.py,sha256=zU9VRY-l80fZnLJ0Op8A3wq27UhQHh9WcpSYU4SmnqU,8708
9
- autocoder/command_args.py,sha256=nmVD3xgLKKNt3fLJ4wVNUdJBtBOkfAdZ2ZmaRMlS7qg,29891
10
- autocoder/lang.py,sha256=Ajng6m7towmx-cvQfEHPFp43iEfddPvr8ju5GH4H8qA,13819
11
- autocoder/version.py,sha256=Zou96E1H6FClEDuqHKcUc9kgUuTRvVu0lQVcFzPxZRY,24
9
+ autocoder/command_args.py,sha256=BpMbPceBzjCftPB0yOVsSmTmt61xS3gtc1WGKtcDHQs,30449
10
+ autocoder/lang.py,sha256=U6AjVV8Rs1uLyjFCZ8sT6WWuNUxMBqkXXIOs4S120uk,14511
11
+ autocoder/version.py,sha256=MoW2qh2N2F6fwWURhZTEXjwmdvPGpyt7_C-0W39jD7A,24
12
12
  autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ autocoder/agent/auto_demand_organizer.py,sha256=NWSAEsEk94vT3lGjfo25kKLMwYdPcpy9e-i21txPasQ,6942
13
14
  autocoder/agent/auto_filegroup.py,sha256=CW7bqp0FW1GIEMnl-blyAc2UGT7O9Mom0q66ITz1ckM,6635
15
+ autocoder/agent/auto_guess_query.py,sha256=rDSdhpPHcOGE5MuDXvIrhCXAPR4ARS1LqpyoLsx2Jhw,11374
14
16
  autocoder/agent/auto_tool.py,sha256=DBzip-P_T6ZtT2eHexPcusmKYD0h7ufzp7TLwXAY10E,11554
15
17
  autocoder/agent/coder.py,sha256=x6bdJwDuETGg9ebQnYlUWCxCtQcDGg73LtI6McpWslQ,72034
16
18
  autocoder/agent/designer.py,sha256=EpRbzO58Xym3GrnppIT1Z8ZFAlnNfgzHbIzZ3PX-Yv8,27037
@@ -19,21 +21,22 @@ autocoder/agent/project_reader.py,sha256=tWLaPoLw1gI6kO_NzivQj28KbobU2ceOLuppHMb
19
21
  autocoder/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
22
  autocoder/common/JupyterClient.py,sha256=O-wi6pXeAEYhAY24kDa0BINrLYvKS6rKyWe98pDClS0,2816
21
23
  autocoder/common/ShellClient.py,sha256=fM1q8t_XMSbLBl2zkCNC2J9xuyKN3eXzGm6hHhqL2WY,2286
22
- autocoder/common/__init__.py,sha256=szE6bhkWT_KDTxY73hDQDRYCaH7DDTrBuEQBxzqAEOM,11201
24
+ autocoder/common/__init__.py,sha256=Itx7HWrrMEMszf4hpUZ7YhIGbpWQVtJjQOWOEqRsa-Q,11458
23
25
  autocoder/common/anything2images.py,sha256=0ILBbWzY02M-CiWB-vzuomb_J1hVdxRcenAfIrAXq9M,25283
24
26
  autocoder/common/audio.py,sha256=Kn9nWKQddWnUrAz0a_ZUgjcu4VUU_IcZBigT7n3N3qc,7439
25
27
  autocoder/common/chunk_validation.py,sha256=BrR_ZWavW8IANuueEE7hS8NFAwEvm8TX34WnPx_1hs8,3030
26
28
  autocoder/common/cleaner.py,sha256=NU72i8C6o9m0vXExab7nao5bstBUsfJFcj11cXa9l4U,1089
27
29
  autocoder/common/code_auto_execute.py,sha256=4KXGmiGObr_B1d6tzV9dwS6MifCSc3Gm4j2d6ildBXQ,6867
28
- autocoder/common/code_auto_generate.py,sha256=bREGPj2yNQ1oy35ivHRHQSXAdmIsPaW4HQ9BkO7Ytco,8099
29
- autocoder/common/code_auto_generate_diff.py,sha256=sItR67cGIY0QXOgJcK28HCHhhloFpAALIDC7zz5DpBM,13215
30
- autocoder/common/code_auto_generate_editblock.py,sha256=X-F13eEjM5Gl778FdyFQo-Khvvr3mOdbROxA7f6bK-Y,15844
31
- autocoder/common/code_auto_generate_strict_diff.py,sha256=APSAbH6cKDQwAOLkhoNNvenY1s7fehZxc5_YBKkJghg,11825
32
- autocoder/common/code_auto_merge.py,sha256=3PB2fQtqgA0wPQSdwFqoOHfNT-mORgGfOXjfRGflikQ,5141
33
- autocoder/common/code_auto_merge_diff.py,sha256=b5INrBJJ2EI0uj5AIiMobCS5S9xevCvdescs3nzCPhY,12594
34
- autocoder/common/code_auto_merge_editblock.py,sha256=gIM90aZLKLHft4OzfUuAB6dWx7ntbnrqzZiJuOVukJQ,13774
35
- autocoder/common/code_auto_merge_strict_diff.py,sha256=iwVEcPSER1NY0g59SVJPQ-PcSIyO6bkO3zK4jjocIL8,7571
36
- autocoder/common/command_completer.py,sha256=pmPpdfGhpNV3v4u3KadL1BEG5H0QRO6eGv98uQjXXRQ,8947
30
+ autocoder/common/code_auto_generate.py,sha256=Vd3NWLUp4L8L87HbtJeuEaB2aWFgYbtzmtiU05LqclI,9453
31
+ autocoder/common/code_auto_generate_diff.py,sha256=ZpqVpzqFLT_Jwp3cWoytK2_KkEM_5j_QQG6gzUjjHSk,15344
32
+ autocoder/common/code_auto_generate_editblock.py,sha256=9ZZydJyR_vw1A6mP6Fc0CkyS28s3r0KcW_CJj3lLQ40,16925
33
+ autocoder/common/code_auto_generate_strict_diff.py,sha256=4Cshu6R72VkH-EkBS7rfwHQtaR8t5fgln8RnCrSJK98,13870
34
+ autocoder/common/code_auto_merge.py,sha256=1tiKrram8GCCuPYrNvHFbr-Tic-f84Y8H13fDTdcg6c,7142
35
+ autocoder/common/code_auto_merge_diff.py,sha256=5SI6ggklJ0QDHvsS0cpNXFuIkFRQxp1i08k6iwWbPJc,15242
36
+ autocoder/common/code_auto_merge_editblock.py,sha256=l6yEiZqXyIlUNIIPXvkHOnLCIInXR78TzSjF-jtJkkg,17035
37
+ autocoder/common/code_auto_merge_strict_diff.py,sha256=ABYOTDUQYA4Bn4BwT1Rw812y49cHW3UH_JSpM9uJ6ig,9399
38
+ autocoder/common/code_modification_ranker.py,sha256=KDJA2788spgegCn_9LehD4wtyVchdZQ_pbcdNfJmI9g,4031
39
+ autocoder/common/command_completer.py,sha256=Eo3V9fRIIX74YdLxz1pZ3wAqdXhFirWoQ0zXkB5R198,8999
37
40
  autocoder/common/command_generator.py,sha256=v4LmU7sO-P7jEZIXCWHUC6P-vT7AvBi_x_PTwCqBAE8,1323
38
41
  autocoder/common/command_templates.py,sha256=3G-pCNbL6iHbnkG6v1JZpbIK3Mc9d373_RYGmCcDPMY,8548
39
42
  autocoder/common/const.py,sha256=eTjhjh4Aj4CUzviJ81jaf3Y5cwqsLATySn2wJxaS6RQ,2911
@@ -47,30 +50,30 @@ autocoder/common/search.py,sha256=_ZX03ph89rDPGMY1OrfqaDfxsDR-flh6YEHixherjwM,16
47
50
  autocoder/common/search_replace.py,sha256=GphFkc57Hb673CAwmbiocqTbw8vrV7TrZxtOhD0332g,22147
48
51
  autocoder/common/sys_prompt.py,sha256=JlexfjZt554faqbgkCmzOJqYUzDHfbnxly5ugFfHfEE,26403
49
52
  autocoder/common/text.py,sha256=KGRQq314GHBmY4MWG8ossRoQi1_DTotvhxchpn78c-k,1003
50
- autocoder/common/types.py,sha256=_kl8q2oCAZe-HqU9LjQgSqVHAw4ojMojlF58-bp2xiE,354
53
+ autocoder/common/types.py,sha256=oQKPE1TG0O7DQQLaBSMp6CP3Bbvg0K8elFdidlV52Lg,631
51
54
  autocoder/data/tokenizer.json,sha256=QfO_ZCE9qMAS2L0IcaWKH99wRj6PCPEQ3bsQgvUp9mk,4607451
52
55
  autocoder/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
56
  autocoder/db/store.py,sha256=tFT66bP2ZKIqZip-uhLkHRSLaaOAUUDZfozJwcqix3c,1908
54
57
  autocoder/dispacher/__init__.py,sha256=YoA64dIxnx4jcE1pwSfg81sjkQtjDkhddkfac1-cMWo,1230
55
58
  autocoder/dispacher/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
- autocoder/dispacher/actions/action.py,sha256=imQGeS7hUv1PTT2d0iuYGrF-Okp5DAZBZQz394sU2kg,14881
59
+ autocoder/dispacher/actions/action.py,sha256=lCQNm0BrFgQlWf8ssQ8euEUXhGNBklA5f7tUrEMgEoo,17430
57
60
  autocoder/dispacher/actions/copilot.py,sha256=BdD-L0LFb5YUH2C87IVCm446SJLyOltaaG9shmsQ25Q,13072
58
61
  autocoder/dispacher/actions/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
- autocoder/dispacher/actions/plugins/action_regex_project.py,sha256=kbmNjvPzuKaZ2exjjyrf9Yc8oW2zzJPL1WuHcO_klFk,4350
62
+ autocoder/dispacher/actions/plugins/action_regex_project.py,sha256=ZvU3hsxFPSZTfdyZF-_tAwaFQvk7cnDIJ7Ip1x6Tc-I,4993
60
63
  autocoder/dispacher/actions/plugins/action_translate.py,sha256=nVAtRSQpdGNmZxg1R_9zXG3AuTv3CHf2v7ODgj8u65c,7727
61
64
  autocoder/index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
65
  autocoder/index/for_command.py,sha256=zfbvQnhHjsAqBc4Ce1kMGIu0jPEk_rtH7fntg89_4z0,3092
63
66
  autocoder/index/index.py,sha256=EpS3ZsCL6WuMk2hLiUe5J_XIny5uvlEuQLw68WzYxKk,31823
64
67
  autocoder/index/symbols_utils.py,sha256=CjcjUVajmJZB75Ty3a7kMv1BZphrm-tIBAdOJv6uo-0,2037
65
- autocoder/pyproject/__init__.py,sha256=RrCY_gyUHK7IFhjOvNRs_ckMsO6Mw7pRymWEjzpr2Rw,14354
68
+ autocoder/pyproject/__init__.py,sha256=7ZuIxD2QBYIwhjmpva8eL2knorKo03yNqUhSyecpt7c,14448
66
69
  autocoder/rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
70
  autocoder/rag/api_server.py,sha256=dRbhAZVRAOlZ64Cnxf4_rKb4iJwHnrWS9Zr67IVORw0,7288
68
71
  autocoder/rag/doc_filter.py,sha256=H0g4s-Q8gJDUbYk9b1qkEyl7RgNzLbRF4UWELVKPDwk,9865
69
72
  autocoder/rag/document_retriever.py,sha256=5oThtxukGuRFF96o3pHKsk306a8diXbhgSrbqyU2BvM,8894
70
73
  autocoder/rag/llm_wrapper.py,sha256=sbDxCANiZyWb_ocqNgqu2oy3c2t8orPNRGleEs-Uwl8,2649
71
- autocoder/rag/long_context_rag.py,sha256=nrARGBJkqA8S5aiEE3jDjVdB_M2n3FDix6hmCygGGBA,24626
74
+ autocoder/rag/long_context_rag.py,sha256=x8ZPg9cwTdFmz6CIzjA1ZPX7_5k3G-ZleL6v3B9CO6Y,24921
72
75
  autocoder/rag/rag_config.py,sha256=8LwFcTd8OJWWwi1_WY4IzjqgtT6RyE2j4PjxS5cCTDE,802
73
- autocoder/rag/rag_entry.py,sha256=V1RJ8RGqM30DNPmzymv64rZjNRGWn6kfc8sRy_LECg0,2451
76
+ autocoder/rag/rag_entry.py,sha256=6TKtErZ0Us9XSV6HgRKXA6yR3SiZGPHpynOKSaR1wgE,2463
74
77
  autocoder/rag/raw_rag.py,sha256=yS2Ur6kG0IRjhCj2_VonwxjY_xls_E62jO5Gz5j2nqE,2952
75
78
  autocoder/rag/relevant_utils.py,sha256=OGfp98OXG4jr3jNmtHIeXGPF8mOlIbTnolPIVTZzYZU,929
76
79
  autocoder/rag/simple_directory_reader.py,sha256=LkKreCkNdEOoL4fNhc3_hDoyyWTQUte4uqextISRz4U,24485
@@ -79,25 +82,25 @@ autocoder/rag/token_checker.py,sha256=jc76x6KWmvVxds6W8juZfQGaoErudc2HenG3sNQfSL
79
82
  autocoder/rag/token_counter.py,sha256=C-Lwc4oIjJpZDEqp9WLHGOe6hb4yhrdJpMtkrtp_1qc,2125
80
83
  autocoder/rag/token_limiter.py,sha256=dtIxCtHswZ2ut-XKbx8_SiWyv-xqnR1WAIcmh6f8Ktw,11137
81
84
  autocoder/rag/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
82
- autocoder/rag/utils.py,sha256=MOMy0l2_YQ8foWnQQSvYmYAwghAWJ8_wVrdZh5DSaTg,4822
85
+ autocoder/rag/utils.py,sha256=x5L8gskxUUGkVEP5K-0C-iYntE84asuDXOCqdzdNUoA,4956
83
86
  autocoder/rag/variable_holder.py,sha256=PFvBjFcR7-fNDD4Vcsc8CpH2Te057vcpwJMxtrfUgKI,75
84
87
  autocoder/rag/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
88
  autocoder/rag/cache/base_cache.py,sha256=KxrPKP-PunL7reXh5txT97DYLzGKm9M5O4CnOLDyX-c,403
86
89
  autocoder/rag/cache/byzer_storage_cache.py,sha256=LS-Z8x5HBL5u8Zrn0kniFX-tdR1ZsMp8fKoKFluSwuU,15375
87
90
  autocoder/rag/cache/file_monitor_cache.py,sha256=ZfWFEzhanwM78sj87dnDWS_mj1SjvK4U_-XdqMZOnhM,4947
88
- autocoder/rag/cache/simple_cache.py,sha256=Wb6udIAm3R0QO6ouSFDGdUowqvkuqOCHi2ncQNbMZ2U,8857
91
+ autocoder/rag/cache/simple_cache.py,sha256=4ZnDHuQyNDxaJ70_OlRMiuwPbjYId8ZaukTRfKAtzCw,9279
89
92
  autocoder/rag/loaders/__init__.py,sha256=EQHEZ5Cmz-mGP2SllUTvcIbYCnF7W149dNpNItfs0yE,304
90
- autocoder/rag/loaders/docx_loader.py,sha256=FMRwmbACevcjTdhr5slVfXgq6SRoWPlEILMAfmQbQSI,547
93
+ autocoder/rag/loaders/docx_loader.py,sha256=ejonb3OFxeMBEV_qRRh556SrjlBbDIsU7lTuxuXCQXg,610
91
94
  autocoder/rag/loaders/excel_loader.py,sha256=Ue8YB1z_kBs8SjIPuBskyM08Q1JiONs_BJZPrzi59oo,896
92
- autocoder/rag/loaders/pdf_loader.py,sha256=0-42afOpanFZZOFmuTmuu7AqZyzaOsLPnXRlPlHOnoM,650
95
+ autocoder/rag/loaders/pdf_loader.py,sha256=9cLPdhfSiedvEUFFM7I-PkZ-9klJmj8AtuihETfzO_o,706
93
96
  autocoder/rag/loaders/ppt_loader.py,sha256=7VEYc-bqgK8VHCoGC3DIUcqbpda-E5jQF9lYLqP256I,1681
94
97
  autocoder/rag/stream_event/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
98
  autocoder/rag/stream_event/event_writer.py,sha256=l7kq_LnDDE8E5dZ-73C7J2MgzSL7WrozdXk0eV-k55Q,409
96
99
  autocoder/rag/stream_event/types.py,sha256=rtLwOE8rShmi1dJdxyBpAV5ZjLBGG9vptMiSzMxGuIA,318
97
100
  autocoder/regex_project/__init__.py,sha256=EBZeCL5ORyD_9_5u_UuG4s7XtpXOu0y1sWDmxWFtufE,6781
98
101
  autocoder/regexproject/__init__.py,sha256=lHTpHfYkguCMtczXoH4bMr-IMNZQtXIjmtSvjtfX0Ro,9674
99
- autocoder/suffixproject/__init__.py,sha256=bEPW9AyGSQ8kNzrgKEXyRikrUCUEuJ6b6vCLzO8Ja6g,11017
100
- autocoder/tsproject/__init__.py,sha256=avSnMA3uSdZmv5MxTilDPFLRFmtfzFr1NPhHaRMFhX4,11625
102
+ autocoder/suffixproject/__init__.py,sha256=2dBat5ZuYIPVCuDwYC58yuzHP5R79JLzGXnZHisLLGo,11061
103
+ autocoder/tsproject/__init__.py,sha256=77hu4rBcicnXHBwKtBo8RQnd61R--gQbo9s00w-ICvg,11719
101
104
  autocoder/utils/__init__.py,sha256=KtcGElFNBgZPF7dEL8zF9JpXkCAjoyDrzaREJBhJrcs,994
102
105
  autocoder/utils/_markitdown.py,sha256=RU88qn4eZfYIy0GDrPxlI8oYXIypbi63VRJjdlnE0VU,47431
103
106
  autocoder/utils/coder.py,sha256=rK8e0svQBe0NOP26dIGToUXgha_hUDgxlWoC_p_r7oc,5698
@@ -112,9 +115,9 @@ autocoder/utils/request_event_queue.py,sha256=r3lo5qGsB1dIjzVQ05dnr0z_9Z3zOkBdP1
112
115
  autocoder/utils/request_queue.py,sha256=nwp6PMtgTCiuwJI24p8OLNZjUiprC-TsefQrhMI-yPE,3889
113
116
  autocoder/utils/rest.py,sha256=HawagAap3wMIDROGhY1730zSZrJR_EycODAA5qOj83c,8807
114
117
  autocoder/utils/tests.py,sha256=BqphrwyycGAvs-5mhH8pKtMZdObwhFtJ5MC_ZAOiLq8,1340
115
- auto_coder-0.1.207.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
116
- auto_coder-0.1.207.dist-info/METADATA,sha256=CIJPaXnDWOPKCFvDnjZHWQEmftK9Jde99NTbFdxANng,2575
117
- auto_coder-0.1.207.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
118
- auto_coder-0.1.207.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
119
- auto_coder-0.1.207.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
120
- auto_coder-0.1.207.dist-info/RECORD,,
118
+ auto_coder-0.1.209.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
119
+ auto_coder-0.1.209.dist-info/METADATA,sha256=W5eS6nakqpiW7JSoDFCgCbqFw8iN4vzzqoYXLOFmgzI,2571
120
+ auto_coder-0.1.209.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
121
+ auto_coder-0.1.209.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
122
+ auto_coder-0.1.209.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
123
+ auto_coder-0.1.209.dist-info/RECORD,,
@@ -0,0 +1,212 @@
1
+ from typing import List, Dict, Optional, Tuple
2
+ import os
3
+ import yaml
4
+ from loguru import logger
5
+ import byzerllm
6
+ import pydantic
7
+ import git
8
+
9
+
10
+ class DemandItem(pydantic.BaseModel):
11
+ """单个需求项"""
12
+ type: str = pydantic.Field(description="需求类型:New/Update/Delete/Other")
13
+ description: str = pydantic.Field(description="需求描述")
14
+ reason: Optional[str] = pydantic.Field(description="需求原因", default=None)
15
+
16
+
17
+ class OrganizedDemands(pydantic.BaseModel):
18
+ """整理后的需求列表,按组织划分"""
19
+ group_name: str = pydantic.Field(description="需求组名")
20
+ demands: List[DemandItem]
21
+
22
+
23
+ def load_yaml_config(yaml_file: str) -> Dict:
24
+ """加载YAML配置文件"""
25
+ try:
26
+ with open(yaml_file, 'r', encoding='utf-8') as f:
27
+ return yaml.safe_load(f)
28
+ except Exception as e:
29
+ logger.error(f"Error loading yaml file {yaml_file}: {str(e)}")
30
+ return {}
31
+
32
+
33
+ class AutoDemandOrganizer:
34
+ def __init__(self, llm: byzerllm.ByzerLLM,
35
+ project_dir: str,
36
+ skip_diff: bool = False,
37
+ file_size_limit: int = 100):
38
+ """
39
+ 初始化需求整理器
40
+
41
+ Args:
42
+ llm: ByzerLLM 实例
43
+ project_dir: 项目根目录
44
+ file_size_limit: 最多分析多少历史任务
45
+ """
46
+ self.project_dir = project_dir
47
+ self.actions_dir = os.path.join(project_dir, "actions")
48
+ self.llm = llm
49
+ self.file_size_limit = file_size_limit
50
+ self.skip_diff = skip_diff
51
+
52
+ @byzerllm.prompt()
53
+ def organize_demands(self, querie_with_urls: List[Tuple[str, List[str], str]]) -> str:
54
+ """
55
+ 根据历史开发任务,整理出清晰的产品需求变更记录。
56
+
57
+ 输入数据格式:
58
+ querie_with_urls 包含多个历史任务信息,每个任务由以下部分组成:
59
+ 1. query: 任务需求描述
60
+ 2. urls: 修改的文件路径列表
61
+ 3. diff: Git diff信息,展示具体的代码修改
62
+
63
+ 示例数据:
64
+ <queries>
65
+ {% for query,urls,diff in querie_with_urls %}
66
+ ## {{ query }}
67
+
68
+ 修改的文件:
69
+ {% for url in urls %}
70
+ - {{ url }}
71
+ {% endfor %}
72
+ {% if diff %}
73
+
74
+ 代码变更:
75
+ ```diff
76
+ {{ diff }}
77
+ ```
78
+ {% endif %}
79
+ {% endfor %}
80
+ </queries>
81
+
82
+ 整理规则:
83
+ 1. 将每个任务拆分为多个独立的需求点
84
+ 2. 为每个需求点添加类型标签:
85
+ - New: 新增功能
86
+ - Update: 功能更新
87
+ - Delete: 功能删除
88
+ - Other: 不确定的变更
89
+ 3. 每个需求点应包含:
90
+ - 清晰的描述
91
+ - 相关原因(如果有)
92
+ - 涉及的文件列表(如果有)
93
+ 4. 保持原始信息的完整性,不要遗漏任何细节
94
+
95
+ 返回格式说明:
96
+ 返回符合以下格式的JSON:
97
+ {
98
+ "group_name": "需求组名称",
99
+ "demands": [
100
+ {
101
+ "type": "需求类型",
102
+ "description": "需求描述",
103
+ "reason": "需求原因(可选)"
104
+ }
105
+ ]
106
+ }
107
+
108
+ 示例返回:
109
+ {
110
+ "group_name": "用户系统优化",
111
+ "demands": [
112
+ {
113
+ "type": "New",
114
+ "description": "新增用户登录功能",
115
+ "reason": "满足用户身份验证需求"
116
+ },
117
+ {
118
+ "type": "Update",
119
+ "description": "优化登录页面UI"
120
+ }
121
+ ]
122
+ }
123
+ """
124
+ pass
125
+
126
+ def parse_history_tasks(self) -> List[Dict]:
127
+ """
128
+ 解析历史任务信息
129
+
130
+ Returns:
131
+ List[Dict]: 每个字典包含一个历史任务的信息
132
+ """
133
+ # 获取所有YAML文件
134
+ action_files = [
135
+ f for f in os.listdir(self.actions_dir)
136
+ if f[:3].isdigit() and "_" in f and f.endswith('.yml')
137
+ ]
138
+
139
+ # 按序号排序
140
+ def get_seq(name):
141
+ return int(name.split("_")[0])
142
+
143
+ # 获取最新的action文件列表
144
+ action_files = sorted(action_files, key=get_seq)
145
+ action_files.reverse()
146
+
147
+ action_files = action_files[:self.file_size_limit]
148
+
149
+ querie_with_urls_and_diffs = []
150
+ repo = git.Repo(self.project_dir)
151
+
152
+ # 收集所有query、urls和对应的commit diff
153
+ for yaml_file in action_files:
154
+ yaml_path = os.path.join(self.actions_dir, yaml_file)
155
+ config = load_yaml_config(yaml_path)
156
+
157
+ if not config:
158
+ continue
159
+
160
+ query = config.get('query', '')
161
+ urls = config.get('urls', [])
162
+
163
+ if query and urls:
164
+ commit_diff = ""
165
+ if not self.skip_diff:
166
+ # 计算文件的MD5用于匹配commit
167
+ import hashlib
168
+ file_md5 = hashlib.md5(open(yaml_path, 'rb').read()).hexdigest()
169
+ response_id = f"auto_coder_{yaml_file}_{file_md5}"
170
+ # 查找对应的commit
171
+ try:
172
+ for commit in repo.iter_commits():
173
+ if response_id in commit.message:
174
+ if commit.parents:
175
+ parent = commit.parents[0]
176
+ commit_diff = repo.git.diff(
177
+ parent.hexsha, commit.hexsha)
178
+ else:
179
+ commit_diff = repo.git.show(commit.hexsha)
180
+ break
181
+ except git.exc.GitCommandError as e:
182
+ logger.error(f"Git命令执行错误: {str(e)}")
183
+ except Exception as e:
184
+ logger.error(f"获取commit diff时出错: {str(e)}")
185
+
186
+ querie_with_urls_and_diffs.append((query, urls, commit_diff))
187
+
188
+ return querie_with_urls_and_diffs
189
+
190
+ def organize(self) -> Optional[OrganizedDemands]:
191
+ """
192
+ 整理需求变更
193
+
194
+ Returns:
195
+ OrganizedDemands: 整理后的需求列表,如果整理失败则返回None
196
+ """
197
+ history_tasks = self.parse_history_tasks()
198
+
199
+ if not history_tasks:
200
+ logger.warning("No history tasks found")
201
+ return None
202
+
203
+ try:
204
+ result = self.organize_demands.with_llm(self.llm).with_return_type(OrganizedDemands).run(
205
+ querie_with_urls=history_tasks
206
+ )
207
+ return result
208
+ except Exception as e:
209
+ import traceback
210
+ traceback.print_exc()
211
+ logger.error(f"Error organizing demands: {str(e)}")
212
+ return None
@@ -0,0 +1,284 @@
1
+ from typing import List, Dict, Any, Tuple, Optional
2
+ import os
3
+ import yaml
4
+ from loguru import logger
5
+ import byzerllm
6
+ import pydantic
7
+ import git
8
+ from rich.console import Console
9
+ from rich.panel import Panel
10
+ from prompt_toolkit import prompt
11
+ from prompt_toolkit.formatted_text import FormattedText
12
+ from rich.console import Console
13
+
14
+
15
+ class NextQuery(pydantic.BaseModel):
16
+ """下一个开发任务的描述和相关信息"""
17
+ query: str = pydantic.Field(description="任务需求描述")
18
+ urls: List[str] = pydantic.Field(description="预测可能需要修改的文件路径列表")
19
+ priority: int = pydantic.Field(description="任务优先级,1-5,5为最高优先级")
20
+ reason: str = pydantic.Field(description="为什么需要这个任务,以及为什么需要修改这些文件")
21
+ dependency_queries: List[str] = pydantic.Field(description="依赖的历史任务列表", default_factory=list)
22
+
23
+
24
+ def load_yaml_config(yaml_file: str) -> Dict:
25
+ """加载YAML配置文件"""
26
+ try:
27
+ with open(yaml_file, 'r', encoding='utf-8') as f:
28
+ return yaml.safe_load(f)
29
+ except Exception as e:
30
+ logger.error(f"Error loading yaml file {yaml_file}: {str(e)}")
31
+ return {}
32
+
33
+
34
+ class AutoGuessQuery:
35
+ def __init__(self, llm: byzerllm.ByzerLLM,
36
+ project_dir: str,
37
+ skip_diff: bool = False,
38
+ file_size_limit: int = 100):
39
+ """
40
+ 初始化 AutoGuessQuery
41
+
42
+ Args:
43
+ llm: ByzerLLM 实例,用于生成下一步任务预测
44
+ project_dir: 项目根目录
45
+ skip_diff: 是否跳过获取 diff 信息
46
+ file_size_limit: 最多分析多少历史任务
47
+ """
48
+ self.project_dir = project_dir
49
+ self.actions_dir = os.path.join(project_dir, "actions")
50
+ self.llm = llm
51
+ self.file_size_limit = file_size_limit
52
+ self.skip_diff = skip_diff
53
+
54
+ @byzerllm.prompt()
55
+ def guess_next_query(self, querie_with_urls: List[Tuple[str, List[str], str]], task_limit_size: int = 5) -> str:
56
+ """
57
+ 根据历史开发任务,预测接下来可能的多个开发任务,按照可能性从高到低排序。
58
+
59
+ 输入数据格式:
60
+ querie_with_urls 包含多个历史任务信息,每个任务由以下部分组成:
61
+ 1. query: 任务需求描述
62
+ 2. urls: 修改的文件路径列表
63
+ 3. diff: Git diff信息,展示具体的代码修改
64
+
65
+ 示例数据:
66
+ <queries>
67
+ {% for query,urls,diff in querie_with_urls %}
68
+ ## {{ query }}
69
+
70
+ 修改的文件:
71
+ {% for url in urls %}
72
+ - {{ url }}
73
+ {% endfor %}
74
+ {% if diff %}
75
+
76
+ 代码变更:
77
+ ```diff
78
+ {{ diff }}
79
+ ```
80
+ {% endif %}
81
+ {% endfor %}
82
+ </queries>
83
+
84
+ 分析要求:
85
+ 1. 分析历史任务的模式和规律
86
+ - 功能演进路径:项目功能是如何逐步完善的
87
+ - 代码变更模式:相似功能通常涉及哪些文件
88
+ - 依赖关系:新功能和已有功能的关联
89
+
90
+ 2. 预测可能的任务时考虑:
91
+ - 完整性:现有功能是否有待完善的地方
92
+ - 扩展性:是否需要支持新的场景
93
+ - 健壮性:是否需要增加容错和异常处理
94
+ - 性能:是否有性能优化空间
95
+ - 交互性:是否需要改善用户体验
96
+ - 可维护性:是否需要重构或优化代码结构
97
+
98
+ 返回格式说明:
99
+ 返回一个JSON数组,数组中每个元素是一个NextQuery对象,按照可能性从高到低排序。每个对象包含:
100
+ 1. query: 任务的具体描述
101
+ 2. urls: 预计需要修改的文件列表
102
+ 3. priority: 优先级(1-5)
103
+ 4. reason: 为什么建议这个任务
104
+ 5. dependency_queries: 相关的历史任务列表
105
+
106
+ 示例返回:
107
+ [
108
+ {
109
+ "query": "添加任务预测的单元测试",
110
+ "urls": ["tests/test_auto_guess_query.py"],
111
+ "priority": 5,
112
+ "reason": "确保任务预测功能的正确性和稳定性对项目质量至关重要",
113
+ "dependency_queries": ["实现任务预测功能"]
114
+ },
115
+ {
116
+ "query": "优化向量搜索性能",
117
+ "urls": ["src/autocoder/utils/search.py"],
118
+ "priority": 4,
119
+ "reason": "当前搜索速度较慢,需要添加向量索引提升性能",
120
+ "dependency_queries": ["实现向量搜索基础功能"]
121
+ }
122
+ ]
123
+
124
+ 注意:
125
+ 1. 每个预测的任务都应该具体且可执行,而不是抽象的目标
126
+ 2. 文件路径预测应该基于已有文件的实际路径
127
+ 3. reason应该详细解释为什么这个任务重要,以及为什么需要修改这些文件
128
+ 4. priority的指定需要考虑任务的紧迫性和重要性
129
+ 3. 建议返回最多{{ task_limit_size }}个不同优先级的任务,覆盖不同的改进方向
130
+ """
131
+ pass
132
+
133
+ def parse_history_tasks(self) -> List[Dict]:
134
+ """
135
+ 解析历史任务信息
136
+
137
+ Returns:
138
+ List[Dict]: 每个字典包含一个历史任务的信息
139
+ """
140
+ # 获取所有YAML文件
141
+ action_files = [
142
+ f for f in os.listdir(self.actions_dir)
143
+ if f[:3].isdigit() and "_" in f and f.endswith('.yml')
144
+ ]
145
+
146
+ # 按序号排序
147
+ def get_seq(name):
148
+ return int(name.split("_")[0])
149
+
150
+ # 获取最新的action文件列表
151
+ action_files = sorted(action_files, key=get_seq)
152
+ action_files.reverse()
153
+
154
+ action_files = action_files[:self.file_size_limit]
155
+
156
+ querie_with_urls_and_diffs = []
157
+ repo = git.Repo(self.project_dir)
158
+
159
+ # 收集所有query、urls和对应的commit diff
160
+ for yaml_file in action_files:
161
+ yaml_path = os.path.join(self.actions_dir, yaml_file)
162
+ config = load_yaml_config(yaml_path)
163
+
164
+ if not config:
165
+ continue
166
+
167
+ query = config.get('query', '')
168
+ urls = config.get('urls', [])
169
+
170
+ if query and urls:
171
+ commit_diff = ""
172
+ if not self.skip_diff:
173
+ # 计算文件的MD5用于匹配commit
174
+ import hashlib
175
+ file_md5 = hashlib.md5(open(yaml_path, 'rb').read()).hexdigest()
176
+ response_id = f"auto_coder_{yaml_file}_{file_md5}"
177
+ # 查找对应的commit
178
+ try:
179
+ for commit in repo.iter_commits():
180
+ if response_id in commit.message:
181
+ if commit.parents:
182
+ parent = commit.parents[0]
183
+ commit_diff = repo.git.diff(
184
+ parent.hexsha, commit.hexsha)
185
+ else:
186
+ commit_diff = repo.git.show(commit.hexsha)
187
+ break
188
+ except git.exc.GitCommandError as e:
189
+ logger.error(f"Git命令执行错误: {str(e)}")
190
+ except Exception as e:
191
+ logger.error(f"获取commit diff时出错: {str(e)}")
192
+
193
+ querie_with_urls_and_diffs.append((query, urls, commit_diff))
194
+
195
+ return querie_with_urls_and_diffs
196
+
197
+ def predict_next_tasks(self, task_limit_size: int = 5, is_human_as_model: bool = False) -> Optional[List[NextQuery]]:
198
+ """
199
+ 预测接下来可能的开发任务列表,按照可能性从高到低排序
200
+
201
+ Args:
202
+ task_limit_size: 返回的任务数量限制,默认5个
203
+ is_human_as_model: 是否人工模式,如果为True则输出prompt供人工编写结果
204
+
205
+ Returns:
206
+ List[NextQuery]: 预测的任务列表,如果预测失败则返回None
207
+ """
208
+ history_tasks = self.parse_history_tasks()
209
+
210
+ if not history_tasks:
211
+ logger.warning("No history tasks found")
212
+ return None
213
+
214
+ try:
215
+ if is_human_as_model:
216
+ console = Console()
217
+
218
+ # 生成prompt
219
+ prompt_content = self.guess_next_query.prompt(
220
+ querie_with_urls=history_tasks,
221
+ task_limit_size=task_limit_size
222
+ )
223
+
224
+ try:
225
+ import pyperclip
226
+ pyperclip.copy(prompt_content)
227
+ console.print(
228
+ Panel(
229
+ "The prompt has been copied to clipboard. Please paste it into the LLM and input the response below.",
230
+ title="Instructions",
231
+ border_style="blue",
232
+ expand=False,
233
+ )
234
+ )
235
+ except Exception:
236
+ logger.warning("Clipboard not supported")
237
+ console.print(
238
+ Panel(
239
+ "The prompt could not be copied to clipboard. Please manually copy the following content:",
240
+ title="Instructions",
241
+ border_style="blue",
242
+ expand=False,
243
+ )
244
+ )
245
+ console.print(prompt_content)
246
+
247
+ lines = []
248
+ while True:
249
+ line = prompt(FormattedText([("#00FF00", "> ")]), multiline=False)
250
+ line_lower = line.strip().lower()
251
+ if line_lower in ["eof", "/eof"]:
252
+ break
253
+ elif line_lower in ["/clear"]:
254
+ lines = []
255
+ print("\033[2J\033[H") # Clear terminal screen
256
+ continue
257
+ elif line_lower in ["/break"]:
258
+ raise Exception("User requested to break the operation.")
259
+ lines.append(line)
260
+
261
+ result = "\n".join(lines)
262
+
263
+ # 从输入中抽取JSON字符串并解析
264
+ from byzerllm.utils.client import code_utils
265
+ import json
266
+
267
+ try:
268
+ json_str = code_utils.extract_code(result)[0][1]
269
+ task_list = json.loads(json_str)
270
+ return [NextQuery(**task) for task in task_list]
271
+ except Exception as e:
272
+ logger.error(f"Error parsing input: {str(e)}")
273
+ return None
274
+ else:
275
+ result = self.guess_next_query.with_llm(self.llm).with_return_type(NextQuery).run(
276
+ querie_with_urls=history_tasks,
277
+ task_limit_size=task_limit_size
278
+ )
279
+ return result
280
+ except Exception as e:
281
+ import traceback
282
+ traceback.print_exc()
283
+ logger.error(f"Error predicting next task: {str(e)}")
284
+ return None