jarvis-ai-assistant 0.1.193__py3-none-any.whl → 0.1.194__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 jarvis-ai-assistant might be problematic. Click here for more details.

Files changed (91) hide show
  1. jarvis/__init__.py +1 -1
  2. jarvis/jarvis_agent/__init__.py +34 -41
  3. jarvis/jarvis_agent/builtin_input_handler.py +26 -4
  4. jarvis/jarvis_agent/jarvis.py +38 -22
  5. jarvis/jarvis_agent/main.py +20 -12
  6. jarvis/jarvis_agent/output_handler.py +7 -7
  7. jarvis/jarvis_agent/shell_input_handler.py +14 -11
  8. jarvis/jarvis_code_agent/code_agent.py +91 -85
  9. jarvis/jarvis_code_agent/lint.py +92 -105
  10. jarvis/jarvis_code_analysis/checklists/__init__.py +1 -1
  11. jarvis/jarvis_code_analysis/checklists/c_cpp.py +1 -1
  12. jarvis/jarvis_code_analysis/checklists/csharp.py +1 -1
  13. jarvis/jarvis_code_analysis/checklists/data_format.py +1 -1
  14. jarvis/jarvis_code_analysis/checklists/devops.py +1 -1
  15. jarvis/jarvis_code_analysis/checklists/docs.py +1 -1
  16. jarvis/jarvis_code_analysis/checklists/go.py +1 -1
  17. jarvis/jarvis_code_analysis/checklists/infrastructure.py +1 -1
  18. jarvis/jarvis_code_analysis/checklists/java.py +1 -1
  19. jarvis/jarvis_code_analysis/checklists/javascript.py +1 -1
  20. jarvis/jarvis_code_analysis/checklists/kotlin.py +1 -1
  21. jarvis/jarvis_code_analysis/checklists/loader.py +51 -35
  22. jarvis/jarvis_code_analysis/checklists/php.py +1 -1
  23. jarvis/jarvis_code_analysis/checklists/python.py +1 -1
  24. jarvis/jarvis_code_analysis/checklists/ruby.py +1 -1
  25. jarvis/jarvis_code_analysis/checklists/rust.py +1 -1
  26. jarvis/jarvis_code_analysis/checklists/shell.py +1 -1
  27. jarvis/jarvis_code_analysis/checklists/sql.py +1 -1
  28. jarvis/jarvis_code_analysis/checklists/swift.py +1 -1
  29. jarvis/jarvis_code_analysis/checklists/web.py +1 -1
  30. jarvis/jarvis_code_analysis/code_review.py +293 -192
  31. jarvis/jarvis_dev/main.py +73 -56
  32. jarvis/jarvis_git_details/main.py +29 -33
  33. jarvis/jarvis_git_squash/main.py +13 -11
  34. jarvis/jarvis_git_utils/git_commiter.py +12 -3
  35. jarvis/jarvis_mcp/__init__.py +8 -10
  36. jarvis/jarvis_mcp/sse_mcp_client.py +182 -205
  37. jarvis/jarvis_mcp/stdio_mcp_client.py +93 -120
  38. jarvis/jarvis_mcp/streamable_mcp_client.py +117 -142
  39. jarvis/jarvis_methodology/main.py +75 -41
  40. jarvis/jarvis_multi_agent/__init__.py +24 -16
  41. jarvis/jarvis_multi_agent/main.py +10 -4
  42. jarvis/jarvis_platform/__init__.py +1 -1
  43. jarvis/jarvis_platform/base.py +49 -21
  44. jarvis/jarvis_platform/human.py +5 -3
  45. jarvis/jarvis_platform/kimi.py +96 -72
  46. jarvis/jarvis_platform/openai.py +23 -28
  47. jarvis/jarvis_platform/registry.py +50 -33
  48. jarvis/jarvis_platform/tongyi.py +16 -10
  49. jarvis/jarvis_platform/yuanbao.py +197 -144
  50. jarvis/jarvis_platform_manager/main.py +4 -2
  51. jarvis/jarvis_smart_shell/main.py +35 -29
  52. jarvis/jarvis_tools/ask_user.py +8 -16
  53. jarvis/jarvis_tools/base.py +3 -2
  54. jarvis/jarvis_tools/chdir.py +7 -19
  55. jarvis/jarvis_tools/cli/main.py +14 -10
  56. jarvis/jarvis_tools/code_plan.py +10 -31
  57. jarvis/jarvis_tools/create_code_agent.py +10 -13
  58. jarvis/jarvis_tools/create_sub_agent.py +10 -22
  59. jarvis/jarvis_tools/edit_file.py +98 -76
  60. jarvis/jarvis_tools/execute_script.py +46 -46
  61. jarvis/jarvis_tools/file_analyzer.py +22 -34
  62. jarvis/jarvis_tools/file_operation.py +69 -62
  63. jarvis/jarvis_tools/generate_new_tool.py +0 -2
  64. jarvis/jarvis_tools/methodology.py +19 -23
  65. jarvis/jarvis_tools/read_code.py +35 -35
  66. jarvis/jarvis_tools/read_webpage.py +7 -16
  67. jarvis/jarvis_tools/registry.py +63 -30
  68. jarvis/jarvis_tools/rewrite_file.py +26 -29
  69. jarvis/jarvis_tools/search_web.py +5 -8
  70. jarvis/jarvis_tools/virtual_tty.py +133 -122
  71. jarvis/jarvis_utils/__init__.py +0 -1
  72. jarvis/jarvis_utils/builtin_replace_map.py +9 -9
  73. jarvis/jarvis_utils/config.py +59 -32
  74. jarvis/jarvis_utils/embedding.py +17 -14
  75. jarvis/jarvis_utils/file_processors.py +16 -9
  76. jarvis/jarvis_utils/git_utils.py +140 -99
  77. jarvis/jarvis_utils/globals.py +1 -1
  78. jarvis/jarvis_utils/input.py +84 -52
  79. jarvis/jarvis_utils/methodology.py +28 -21
  80. jarvis/jarvis_utils/output.py +159 -78
  81. jarvis/jarvis_utils/tag.py +2 -1
  82. jarvis/jarvis_utils/utils.py +85 -51
  83. {jarvis_ai_assistant-0.1.193.dist-info → jarvis_ai_assistant-0.1.194.dist-info}/METADATA +314 -230
  84. jarvis_ai_assistant-0.1.194.dist-info/RECORD +97 -0
  85. jarvis/jarvis_agent/file_input_handler.py +0 -112
  86. jarvis/jarvis_event/__init__.py +0 -0
  87. jarvis_ai_assistant-0.1.193.dist-info/RECORD +0 -99
  88. {jarvis_ai_assistant-0.1.193.dist-info → jarvis_ai_assistant-0.1.194.dist-info}/WHEEL +0 -0
  89. {jarvis_ai_assistant-0.1.193.dist-info → jarvis_ai_assistant-0.1.194.dist-info}/entry_points.txt +0 -0
  90. {jarvis_ai_assistant-0.1.193.dist-info → jarvis_ai_assistant-0.1.194.dist-info}/licenses/LICENSE +0 -0
  91. {jarvis_ai_assistant-0.1.193.dist-info → jarvis_ai_assistant-0.1.194.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,97 @@
1
+ jarvis/__init__.py,sha256=ZxDM21PiElBnkamBrQo0d7x47my-F1Pj7ahg2etB7n4,75
2
+ jarvis/jarvis_agent/__init__.py,sha256=hxWqGX1QMOOo08zOdy4e6Yecq-Y491RZanDjMFWmHwQ,30412
3
+ jarvis/jarvis_agent/builtin_input_handler.py,sha256=4CCEtVLRBIpkhDUKd54VcX1JFCIWCvDqDh4B1H-eSn0,2187
4
+ jarvis/jarvis_agent/jarvis.py,sha256=7S_Y21-DoZtAk-Rg7ZJRnzqe_ig5QMvXwLCYFOKjMCg,6240
5
+ jarvis/jarvis_agent/main.py,sha256=c6bQe-8LXvW2-NBn9Rn_yPYdrwnkJ8KQaSFY2cPvkxw,2775
6
+ jarvis/jarvis_agent/output_handler.py,sha256=P7oWpXBGFfOsWq7cIhS_z9crkQ19ES7qU5pM92KKjAs,1172
7
+ jarvis/jarvis_agent/shell_input_handler.py,sha256=zVaKNthIHJh1j4g8_-d3w5ahNH9aH-ZNRSOourQpHR4,1328
8
+ jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ jarvis/jarvis_code_agent/code_agent.py,sha256=EzaDzJfa5jnibI2tqt5JMqc9BAp3GoGLkMjMmqmIubY,15209
10
+ jarvis/jarvis_code_agent/lint.py,sha256=j1kS-wFYigmkXyxOuUiaJ9cknYkraikQSSf51VWturE,4038
11
+ jarvis/jarvis_code_analysis/code_review.py,sha256=WO_3_C8M7JS0pGQzm2Cm5sPBocjZMESQla5Fn4LIjTw,31433
12
+ jarvis/jarvis_code_analysis/checklists/__init__.py,sha256=LIXAYa1sW3l7foP6kohLWnE98I_EQ0T7z5bYKHq6rJA,78
13
+ jarvis/jarvis_code_analysis/checklists/c_cpp.py,sha256=9t62bMqs6qTkFSio4SKkj88qyb5ZubWrw3MxJBQ4X1A,1317
14
+ jarvis/jarvis_code_analysis/checklists/csharp.py,sha256=ShPXrl2_UPAnGaCHAG2wLl90COG3HK2XCSr1UK2dxN4,2420
15
+ jarvis/jarvis_code_analysis/checklists/data_format.py,sha256=urCb9qiJBDGev6C-PXv30NKFoQeGdbtlOl1VSPbjCSA,3005
16
+ jarvis/jarvis_code_analysis/checklists/devops.py,sha256=tlKD75mbFx6HHk8H8eHL_I_WTusHvWA8Zfb5P6c_1w4,3542
17
+ jarvis/jarvis_code_analysis/checklists/docs.py,sha256=gxhxuw-w0puen2Hgwe9MsgO_kijtCJC6THXSoz3YgiA,3341
18
+ jarvis/jarvis_code_analysis/checklists/go.py,sha256=NDBFA0qPrjr1HOZYy5DYU0iIcKWCaevJRLw4fbHZwwQ,1388
19
+ jarvis/jarvis_code_analysis/checklists/infrastructure.py,sha256=7z5MZnOUT3FpMrTQw2QcxkkTHKdMblc_Rf2NjxSI39A,3765
20
+ jarvis/jarvis_code_analysis/checklists/java.py,sha256=gWRVhXfsNhRFdthjIiQTkviqLwisuKCrr6gjxP0S9Z4,2085
21
+ jarvis/jarvis_code_analysis/checklists/javascript.py,sha256=SQkw2I09DaaLxD_WTZjuHn4leUKil68IEPB03BoSYuo,2340
22
+ jarvis/jarvis_code_analysis/checklists/kotlin.py,sha256=dNSHM1u3R7lxe8BU8ADtDyKJxmj3NUh9ZQuC7HHWHGY,4436
23
+ jarvis/jarvis_code_analysis/checklists/loader.py,sha256=bjE4On6WMLt41bfkCZsHnBpfXF61VPthFPsgNcbH90c,1903
24
+ jarvis/jarvis_code_analysis/checklists/php.py,sha256=qW34sF9AqLuSVuOVP5yJUHnB9V3-YRQjNPuB3lFI5UY,2481
25
+ jarvis/jarvis_code_analysis/checklists/python.py,sha256=gjyJ0QPY1CAwqhbDnIyLYruvFduZU5hiKyehAXMHu-I,1452
26
+ jarvis/jarvis_code_analysis/checklists/ruby.py,sha256=kzwd7Wl6gKrkAANq7_MvA5X5du5r1MeE-EY2Xb43n7U,4274
27
+ jarvis/jarvis_code_analysis/checklists/rust.py,sha256=kzt6ARBzUaC2UCviIt5ybfhJjyCkK_V9Kd4e97Dbtd4,1646
28
+ jarvis/jarvis_code_analysis/checklists/shell.py,sha256=aRFYhQQvTgbYd-uY5pc8UHIUAHPtZeciTg4aDcwvRZE,2619
29
+ jarvis/jarvis_code_analysis/checklists/sql.py,sha256=vR0T6qC7b4dURjJVAd7kSVxyvZEQXPG1Jqc2sNTGp5c,2355
30
+ jarvis/jarvis_code_analysis/checklists/swift.py,sha256=TPx4I6Gupvs6tSerRKmTSKEPQpOLEbH2Y7LXg1uBgxc,2566
31
+ jarvis/jarvis_code_analysis/checklists/web.py,sha256=25gGD7pDadZQybNFvALYxWvK0VRjGQb1NVJQElwjyk0,3943
32
+ jarvis/jarvis_data/config_schema.json,sha256=u_I8KawgwUltW-tVw3t37rLv4TqdBynZaNGhOFH2Zf8,6397
33
+ jarvis/jarvis_data/huggingface.tar.gz,sha256=dWKnc_tvyx-I_ZkXo91O0b38KxDmLW1ZbmJ3E6fCl_k,1120205
34
+ jarvis/jarvis_dev/main.py,sha256=zzVDrPQlPJFnHxNjChBAYA8YwIaQYmPxG-bHjIxdL3s,40940
35
+ jarvis/jarvis_git_details/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
+ jarvis/jarvis_git_details/main.py,sha256=MjpUHB4ErR_SKPBx1TLLK_XLkH427RTtsyVn6EUd88Y,8907
37
+ jarvis/jarvis_git_squash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
+ jarvis/jarvis_git_squash/main.py,sha256=lx0WVOiaydYgwzWBDG7C8wJxYJwSb1SIxyoD-rgzgvA,2274
39
+ jarvis/jarvis_git_utils/git_commiter.py,sha256=NWqHNr1ibhdrV3_OONzaFWgxg1uh8hj4itfDOCLZSus,13219
40
+ jarvis/jarvis_mcp/__init__.py,sha256=OPMtjD-uq9xAaKCRIDyKIosaFfBe1GBPu1az-mQ0rVM,2048
41
+ jarvis/jarvis_mcp/sse_mcp_client.py,sha256=-3Qy1LyqgHswoc6YbadVRG3ias2op7lUp7Ne2-QUKBM,22474
42
+ jarvis/jarvis_mcp/stdio_mcp_client.py,sha256=armvgyHAv-AxF5lqiK-TbVLzg3XgSCwmTdWmxBSTLRk,11248
43
+ jarvis/jarvis_mcp/streamable_mcp_client.py,sha256=1OZpsG82U2MLbGuojllJAblFUAMmp1N0i5fsKM4n5Ts,14453
44
+ jarvis/jarvis_methodology/main.py,sha256=mABYBsI99LLkphxhDp5ZMG_fYCKelFTUIJN_7p9uDT8,12402
45
+ jarvis/jarvis_multi_agent/__init__.py,sha256=sDd3sK88dS7_qAz2ywIAaEWdQ4iRVCiuBu2rQQmrKbU,4512
46
+ jarvis/jarvis_multi_agent/main.py,sha256=h7VUSwoPrES0XTK8z5kt3XLX1mmcm8UEuFEHQOUWPH4,1696
47
+ jarvis/jarvis_platform/__init__.py,sha256=WLQHSiE87PPket2M50_hHzjdMIgPIBx2VF8JfB_NNRk,105
48
+ jarvis/jarvis_platform/base.py,sha256=IvCvZBfsNr5rL7hBIxGHEjTnPfm57lGl2kaDNG1RsMQ,7693
49
+ jarvis/jarvis_platform/human.py,sha256=YfW8HnUlf7UDXl6B6-LJNCGr1rWlRybQJ5HwpJ1e4YQ,2589
50
+ jarvis/jarvis_platform/kimi.py,sha256=20vwfmAYg2Fh_LkApjfs3-ctilLSPLoGYw4vL2lknJI,12323
51
+ jarvis/jarvis_platform/openai.py,sha256=uEjBikfFj7kp5wondLvOx4WdkmTX0aqF6kixxAufcHg,4806
52
+ jarvis/jarvis_platform/registry.py,sha256=48Z4lkFI7XLjJAGNW68uY1ex1S_C0_leYmafybkbmas,8010
53
+ jarvis/jarvis_platform/tongyi.py,sha256=zu1bE-LdF_Sohwb5FxoIkDOTI0Lv5G_XhuSOPI20Gf8,21190
54
+ jarvis/jarvis_platform/yuanbao.py,sha256=1PagfRWvGylUaeUe7yiBnGjYZ1HQk3uruogfKem84ss,21394
55
+ jarvis/jarvis_platform_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
+ jarvis/jarvis_platform_manager/main.py,sha256=BdBH2tPzq7p9Mvii7abu6M7uj4lfG05gwjYfMqU5HUA,29567
57
+ jarvis/jarvis_smart_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
+ jarvis/jarvis_smart_shell/main.py,sha256=UWrnEGe-ujF8cbxWttyNUDn3iIPzDp9XpTs0sSWWJFE,5296
59
+ jarvis/jarvis_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
+ jarvis/jarvis_tools/ask_user.py,sha256=dSnZbt2XXDxjDj17Mi7-Twg75yHhMzM_FEj_TazJvC8,2068
61
+ jarvis/jarvis_tools/base.py,sha256=tFVmK6ppsImW2BzHZmrNmMRiOJdW-4aZP6Me3VxdYcA,1194
62
+ jarvis/jarvis_tools/chdir.py,sha256=BlRvggcOeBM7UwHGL8U8hjuNm_WGkH5BdhxmPVJXejw,2509
63
+ jarvis/jarvis_tools/code_plan.py,sha256=XRXHdkN4O1A4qbShLa4VBHFdRl6YdyMgZxbPPotrqNs,7358
64
+ jarvis/jarvis_tools/create_code_agent.py,sha256=PiVcj7rH0_luy_QRYdGSkdNW8nc7X9oe8gnP9r2-R8k,3352
65
+ jarvis/jarvis_tools/create_sub_agent.py,sha256=ilnApbz7ptNz5o3IrhBTTiNMJGtdeUmkpYL2BFqyI6c,2874
66
+ jarvis/jarvis_tools/edit_file.py,sha256=cIaxWEW5ES1fiNp6Hm5f2MUXHLPzpeeKITukQaMRsKg,18717
67
+ jarvis/jarvis_tools/execute_script.py,sha256=gMarE5yCCSPU6Dp6HlcL2KT-2xCzR-1p-oQNlYOJK58,6157
68
+ jarvis/jarvis_tools/file_analyzer.py,sha256=SvNLve5AL2d3oQsWSoHouIsAsYanksBnl5RCCsrw2PQ,4604
69
+ jarvis/jarvis_tools/file_operation.py,sha256=b488jf0_l7aP0RkntaNE9WqZXtbdrQTJdmWawJbfC-A,9529
70
+ jarvis/jarvis_tools/generate_new_tool.py,sha256=2YAs8DC7fJnxOkjSmhmSAwqSpBlicVhYc06WZ8YVBls,7679
71
+ jarvis/jarvis_tools/methodology.py,sha256=_K4GIDUodGEma3SvNRo7Qs5rliijgNespVLyAPN35JU,5233
72
+ jarvis/jarvis_tools/read_code.py,sha256=6mQ3KNGc43FTiLFxMbAN28FTSVhVfkFJ6mob4heXBNM,6663
73
+ jarvis/jarvis_tools/read_webpage.py,sha256=NmDUboVZd4CGHBPRFK6dp3uqVhuGopW1bOi3TcaLDF4,2092
74
+ jarvis/jarvis_tools/registry.py,sha256=ZuD6x4znAGwB-Z7-43f-SAlrFPIVaLiHqzpZp6zc5r4,25729
75
+ jarvis/jarvis_tools/rewrite_file.py,sha256=w-NY9UfDopCLtaUmdOFHHzSQAvTOIYRuM1RbyV0k2Yg,6755
76
+ jarvis/jarvis_tools/search_web.py,sha256=C-TuBFy25WOSiwRCe7YiL0hnMx0DuHj6upHO5OtkHTA,925
77
+ jarvis/jarvis_tools/virtual_tty.py,sha256=KKr3jpvQWWMPr2o40hlmN6fuXJCN8H4_ma5QU40Citc,16089
78
+ jarvis/jarvis_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
+ jarvis/jarvis_tools/cli/main.py,sha256=Mg6TQDxMdzB1Ua1UrZ2EE-uQWsbaeojWaEGHJp2HimA,6375
80
+ jarvis/jarvis_utils/__init__.py,sha256=67h0ldisGlh3oK4DAeNEL2Bl_VsI3tSmfclasyVlueM,850
81
+ jarvis/jarvis_utils/builtin_replace_map.py,sha256=s7C5wKhoKkv-O4ltMcDzNpv5oGPC1EbXgiohPHAqksw,4892
82
+ jarvis/jarvis_utils/config.py,sha256=1C1ismlc2wUPPzbtk4NR07TLL2ecxG53BRO1KLQn-Mo,7125
83
+ jarvis/jarvis_utils/embedding.py,sha256=W9TEyQXE0ABIgrSZrutHPI5-MoTMmdtRFnxN-yJJ9bQ,3827
84
+ jarvis/jarvis_utils/file_processors.py,sha256=XiM248SHS7lLgQDCbORVFWqinbVDUawYxWDOsLXDxP8,3043
85
+ jarvis/jarvis_utils/git_utils.py,sha256=odDzGmzOczNdsNo8pEXvAHMOEIEMy8nmdj29wX6G7e8,15214
86
+ jarvis/jarvis_utils/globals.py,sha256=9NTMfCVd0jvtloOv14-KE6clhcVStFmyN9jWxLmQ5so,3369
87
+ jarvis/jarvis_utils/input.py,sha256=PXogBfI6SSg5pIMJy4qSKCuULjWXMgFJPDZcj_JQakw,7843
88
+ jarvis/jarvis_utils/methodology.py,sha256=UoNDo4icUtniAnRN8jtMfF-8E6lZ6gGIN3xYmSljNu4,8438
89
+ jarvis/jarvis_utils/output.py,sha256=FsKRLXXfKVNIfPAtJPwXxK7qx3ofiO5lO3lgxrZolyY,10677
90
+ jarvis/jarvis_utils/tag.py,sha256=f211opbbbTcSyzCDwuIK_oCnKhXPNK-RknYyGzY1yD0,431
91
+ jarvis/jarvis_utils/utils.py,sha256=-xsbXd647c15wc9zFEwDBdMN4Ejm8nsIFHW2Ng5ipco,11827
92
+ jarvis_ai_assistant-0.1.194.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
93
+ jarvis_ai_assistant-0.1.194.dist-info/METADATA,sha256=xbe7R57rZF5ER296fHjBDyyJiKaXRDYwBHP859GEYq4,19500
94
+ jarvis_ai_assistant-0.1.194.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
95
+ jarvis_ai_assistant-0.1.194.dist-info/entry_points.txt,sha256=Gy3DOP1PYLMK0GCj4rrP_9lkOyBQ39EK_lKGUSwn41E,869
96
+ jarvis_ai_assistant-0.1.194.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
97
+ jarvis_ai_assistant-0.1.194.dist-info/RECORD,,
@@ -1,112 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
-
4
- import os
5
- import re
6
- from typing import Any, Tuple
7
-
8
- from yaspin import yaspin
9
-
10
- from jarvis.jarvis_tools.file_operation import FileOperationTool
11
- from jarvis.jarvis_utils.output import OutputType, PrettyOutput
12
- from jarvis.jarvis_utils.utils import is_context_overflow
13
-
14
-
15
- def file_input_handler(user_input: str, agent: Any) -> Tuple[str, bool]:
16
- """处理包含文件引用的用户输入并读取文件内容。
17
-
18
- 参数:
19
- user_input: 可能包含文件引用的输入字符串,格式为:
20
- - 'file_path' (整个文件)
21
- - 'file_path:start_line,end_line' (行范围)
22
- - 'file_path:start_line:end_line' (替代范围格式)
23
- agent: 用于进一步处理的Agent对象(当前未使用)
24
-
25
- 返回:
26
- Tuple[str, bool]:
27
- - 处理后的提示字符串,前面附加文件内容
28
- - 布尔值,指示是否发生上下文溢出
29
- """
30
- prompt = user_input
31
- files = []
32
-
33
- file_refs = re.findall(r"'([^'\n]+)'", user_input)
34
- for ref in file_refs:
35
- # 处理 file:start,end 或 file:start:end 格式
36
- if ':' in ref:
37
- file_path, line_range = ref.split(':', 1)
38
- # 使用默认值初始化
39
- start_line = 1 # 1-based
40
- end_line = -1
41
-
42
- # 如果指定了行范围则进行处理
43
- if ',' in line_range or ':' in line_range:
44
- try:
45
- raw_start, raw_end = map(int, re.split(r'[,:]', line_range))
46
-
47
- # 处理特殊值和Python风格的负索引
48
- try:
49
- with open(file_path, 'r', encoding='utf-8', errors="ignore") as f:
50
- total_lines = len(f.readlines())
51
- except FileNotFoundError:
52
- PrettyOutput.print(f"文件不存在: {file_path}", OutputType.WARNING)
53
- continue
54
- # 处理起始行(0表示整个文件,负数表示从末尾开始)
55
- if raw_start == 0: # 0表示整个文件
56
- start_line = 1
57
- end_line = total_lines
58
- else:
59
- start_line = raw_start if raw_start > 0 else total_lines + raw_start + 1
60
-
61
- # 处理结束行
62
- if raw_end == 0: # 0表示整个文件(如果start也是0)
63
- end_line = total_lines
64
- else:
65
- end_line = raw_end if raw_end > 0 else total_lines + raw_end + 1
66
-
67
- # 自动校正范围
68
- start_line = max(1, min(start_line, total_lines))
69
- end_line = max(start_line, min(end_line, total_lines))
70
-
71
- # 最终验证
72
- if start_line < 1 or end_line > total_lines or start_line > end_line:
73
- raise ValueError
74
-
75
- except:
76
- continue
77
-
78
- # 如果文件存在则添加
79
- if os.path.isfile(file_path):
80
- files.append({
81
- "path": file_path,
82
- "start_line": start_line,
83
- "end_line": end_line
84
- })
85
- else:
86
- # 处理简单文件路径
87
- if os.path.isfile(ref):
88
- files.append({
89
- "path": ref,
90
- "start_line": 1, # 1-based
91
- "end_line": -1
92
- })
93
-
94
- # 如果找到文件则读取并处理
95
- if files:
96
- with yaspin(text="正在读取文件...", color="cyan") as spinner:
97
- old_prompt = prompt
98
- result = FileOperationTool().execute({"operation":"read","files": files, "agent": agent})
99
- if result["success"]:
100
- spinner.text = "文件读取完成"
101
- spinner.ok("✅")
102
- # Prepend file contents to prompt and check for overflow
103
- prompt = f"""{prompt}
104
-
105
- <file_context>
106
- {result["stdout"]}
107
- </file_context>"""
108
- if is_context_overflow(prompt):
109
- return old_prompt, False
110
-
111
- return prompt, False
112
-
File without changes
@@ -1,99 +0,0 @@
1
- jarvis/__init__.py,sha256=oHw83eIzlzJqE2Znlnyp9V52XTDkbZbDoc4YaousSQE,74
2
- jarvis/jarvis_agent/__init__.py,sha256=CGHvKB5M12j442PFJn490TXk_Y5i6s58Q7LKH5v8V5U,30964
3
- jarvis/jarvis_agent/builtin_input_handler.py,sha256=f4DaEHPakXcAbgykFP-tiOQP6fh_yGFlZx_h91_j2tQ,1529
4
- jarvis/jarvis_agent/file_input_handler.py,sha256=OfoYI5on6w5BDUUg4OadFcfWzMsUF70GNrlt9QyauvA,4181
5
- jarvis/jarvis_agent/jarvis.py,sha256=zfYlwXaZJYfwvNeU5IUSlURyY0pn7QxsHmXBqSptUo8,6105
6
- jarvis/jarvis_agent/main.py,sha256=miR8wnWBzmbhOfnscyiKo1oI4wZBRU6FEE-k1lkqtiI,2752
7
- jarvis/jarvis_agent/output_handler.py,sha256=7qori-RGrQmdiFepoEe3oPPKJIvRt90l_JDmvCoa4zA,1219
8
- jarvis/jarvis_agent/shell_input_handler.py,sha256=pi3AtPKrkKc6K9e99S1djKXQ_XrxtP6FrSWebQmRT6E,1261
9
- jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- jarvis/jarvis_code_agent/code_agent.py,sha256=r9X1eJ0nexqmSjyTrsvT0DKokeYDws0iu83HFjz8XPU,15501
11
- jarvis/jarvis_code_agent/lint.py,sha256=TZlhNbeaoLzO9DzExjN5GAjrt66owd8lyQV56LTfkrs,4370
12
- jarvis/jarvis_code_analysis/code_review.py,sha256=45MPcXullg55w6E0Xhm2dDj6TGmkUxNNI2LJWexnTKQ,30123
13
- jarvis/jarvis_code_analysis/checklists/__init__.py,sha256=cKQ_FOGy5TQgM-YkRCqORo-mUOZaPAJ9VDmZoFX58us,78
14
- jarvis/jarvis_code_analysis/checklists/c_cpp.py,sha256=SXPpYCNeCtU1PpKdKPiYDuOybfY9vaL0ejDn4imxDwA,1317
15
- jarvis/jarvis_code_analysis/checklists/csharp.py,sha256=vS-cu6RCGg5SyK9MJ3RE381gt3xYl-yea3Bj2UQEcwQ,2420
16
- jarvis/jarvis_code_analysis/checklists/data_format.py,sha256=0ljCQPNrhFq3Qzl7WQZy-5jRE5OQG-6fjK-ZMQhP7AE,3005
17
- jarvis/jarvis_code_analysis/checklists/devops.py,sha256=caupq-mZyXOfK5cSkpgcxdivqK89_2lWuDbXDuVndI8,3542
18
- jarvis/jarvis_code_analysis/checklists/docs.py,sha256=lOr69-3-wobyfx82NLYZmZKHfoAov_rF4D6YMjsmOkY,3341
19
- jarvis/jarvis_code_analysis/checklists/go.py,sha256=8Q16X08aj9pyLyi5c85xB2CcZI-eLlxw7TJDTij5BBY,1388
20
- jarvis/jarvis_code_analysis/checklists/infrastructure.py,sha256=KgyuZHJfKCbon1qxqoTDBnUbDrY7dfFnfPkTlH4BrlI,3765
21
- jarvis/jarvis_code_analysis/checklists/java.py,sha256=RReiw64i-o5yLIhZdFkkWzMl9yE4_SnQr7CwWz5dTas,2085
22
- jarvis/jarvis_code_analysis/checklists/javascript.py,sha256=i1srwYq0H-d9Ql98UpJSvceHe5jTJX3CFO_sgmw7_AU,2340
23
- jarvis/jarvis_code_analysis/checklists/kotlin.py,sha256=AgVEDHdDC4kD-XYjT5V3LNjRpcWeVCoPThVg1juD1Ns,4436
24
- jarvis/jarvis_code_analysis/checklists/loader.py,sha256=N9tSH4R_HYS5280CQoEcGJSGFq0WbAbYYQNQsKQTCDI,2102
25
- jarvis/jarvis_code_analysis/checklists/php.py,sha256=_EvpnWwHOGM3wAc9aXJrtwy3LQvYNR-oxPhtv71qZj4,2481
26
- jarvis/jarvis_code_analysis/checklists/python.py,sha256=rQ2jpDG0CPzeWiBc2Q6kJA0IBpyheL4-gtMwe6whgOM,1452
27
- jarvis/jarvis_code_analysis/checklists/ruby.py,sha256=JbU1eHafIhlV0qWtYxEltz6AaFzUSU_F3KuqylnMcgc,4274
28
- jarvis/jarvis_code_analysis/checklists/rust.py,sha256=oe_1wPaBgMScQTn-697aghWVsIvNO2v8E6m_lcP8_iU,1646
29
- jarvis/jarvis_code_analysis/checklists/shell.py,sha256=IXQkWHwA-4GUQz3WUs7l6hEy7Vrjd92egUYXGfu2FKQ,2619
30
- jarvis/jarvis_code_analysis/checklists/sql.py,sha256=ecKKT6wJAibn8R0NxGZDNlm4teYXvF3CAJvVk8mmX7w,2355
31
- jarvis/jarvis_code_analysis/checklists/swift.py,sha256=YcsYFxAitHqOtBZjG-RV9-KNM7X5lIcl6zlEI9XfmfM,2566
32
- jarvis/jarvis_code_analysis/checklists/web.py,sha256=-Pnj1FQTsGVZUQK7-4ptDsGd7a22Cs0585jRAPT2SdQ,3943
33
- jarvis/jarvis_data/config_schema.json,sha256=u_I8KawgwUltW-tVw3t37rLv4TqdBynZaNGhOFH2Zf8,6397
34
- jarvis/jarvis_data/huggingface.tar.gz,sha256=dWKnc_tvyx-I_ZkXo91O0b38KxDmLW1ZbmJ3E6fCl_k,1120205
35
- jarvis/jarvis_dev/main.py,sha256=MG2DhDwXsOgCya558o7TJRMZlN3Diprk7UjEEVNdm6A,40630
36
- jarvis/jarvis_event/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- jarvis/jarvis_git_details/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- jarvis/jarvis_git_details/main.py,sha256=4L60eVDBMv6RbocnVlzfOx7JZkHTzop3q7qui9d9LuU,9005
39
- jarvis/jarvis_git_squash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
- jarvis/jarvis_git_squash/main.py,sha256=q8-r0TtVOaCqY_uYwnWAY76k8YCDd5se_feB6ZWKo9M,2278
41
- jarvis/jarvis_git_utils/git_commiter.py,sha256=CPIBfTJw10VRZRxREqnSnUhooOVGwobUCOzEjZ1kWas,13076
42
- jarvis/jarvis_mcp/__init__.py,sha256=NF_vqRxaNyz8ColcpRh0bOkinV90YLAKHEN--jkP-B8,2114
43
- jarvis/jarvis_mcp/sse_mcp_client.py,sha256=QNA7HqFvLbvhNaFp3ZsXzs2Rm6_gHUMcpd4t4qAzymY,23485
44
- jarvis/jarvis_mcp/stdio_mcp_client.py,sha256=IEkas4ojP5J0TdVaUglvlEp61RyezBtuejv4lN3n1I4,11831
45
- jarvis/jarvis_mcp/streamable_mcp_client.py,sha256=t2uKiIbKlmMsaiN9xHCZC3WTdl7mmoBuIZ_ph-QshzE,15084
46
- jarvis/jarvis_methodology/main.py,sha256=-Xq1eMSIRPKdtt5hmGo9zbzNOYWGI-zZo8uYM_XbFX8,12129
47
- jarvis/jarvis_multi_agent/__init__.py,sha256=Xab5sFltJmX_9MoXqanmZs6FqKfUb2v_pG29Vk8ZXaw,4311
48
- jarvis/jarvis_multi_agent/main.py,sha256=KeGv8sdpSgTjW6VE4-tQ8BWDC_a0aE_4R3OqzPBd5N4,1646
49
- jarvis/jarvis_platform/__init__.py,sha256=0YnsUoM4JkIBOtImFdjfuDbrqQZT3dEaAwSJ62DrpCc,104
50
- jarvis/jarvis_platform/base.py,sha256=MAY2Xe8WECOfisd-7_F8LXqzsIswkVwlVzXEj-D5Vlg,7186
51
- jarvis/jarvis_platform/human.py,sha256=MkKdwZ8oY5eacjHOEjUCUwDCJJnXtlzU8o8_jJAMdaA,2566
52
- jarvis/jarvis_platform/kimi.py,sha256=m45UlTkE3XhZZ3XfQk4degpKWsy5yrdzBHi9pDvmoZk,12100
53
- jarvis/jarvis_platform/openai.py,sha256=iXsJ52e7zGaKNho1Lzg4_rjXUwLn0wpVmWCLZ0k4xU8,4985
54
- jarvis/jarvis_platform/registry.py,sha256=qq19f9HoISxpVf09t1oEuOgzLXP8QT1mDzWAI5ifIHc,7819
55
- jarvis/jarvis_platform/tongyi.py,sha256=Q0MCqKofuoQpp6XiYBdgO6LA4vJPEiTvVvKGgwJcpII,21062
56
- jarvis/jarvis_platform/yuanbao.py,sha256=sJ6wr92oGbTSzngttXRGQ-IeFWMEtSVNiHiQs0Buv7k,20935
57
- jarvis/jarvis_platform_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- jarvis/jarvis_platform_manager/main.py,sha256=klN8c0IItE1wg1V2tPkh2RoEJxXXCgO--Hf7mpmY39I,29558
59
- jarvis/jarvis_smart_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
- jarvis/jarvis_smart_shell/main.py,sha256=pUoRsAbY2_BNqtVGEOin8UJVb8gmL_-Aj_NITJ9k0eo,5290
61
- jarvis/jarvis_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
- jarvis/jarvis_tools/ask_user.py,sha256=qwxwJIL698rEWdi1txxlPgIr4UFuihfe--NqBEYhIQQ,2168
63
- jarvis/jarvis_tools/base.py,sha256=OdlvzUjYQBmZIMcAeBxAqIQo2urh126OerArK-wOPzU,1191
64
- jarvis/jarvis_tools/chdir.py,sha256=DNKVFrWqu6t_sZ2ipv99s6802QR4cSGlqKlmaI--arE,2707
65
- jarvis/jarvis_tools/code_plan.py,sha256=gWR0lzY62x2PxWKoMRBqW6jq7zQuO8vhpjC4TcHSYjk,7685
66
- jarvis/jarvis_tools/create_code_agent.py,sha256=-nHfo5O5pDIG5IX3w1ClQafGvGcdI2_w75-KGrD-gUQ,3458
67
- jarvis/jarvis_tools/create_sub_agent.py,sha256=lyFrrg4V0yXULmU3vldwGp_euZjwZzJcRU6mJ20zejY,3023
68
- jarvis/jarvis_tools/edit_file.py,sha256=s8HqG8qHDrYjCwIioeBpGvw7Aw-iEEZoUyRJFqdjcQA,18453
69
- jarvis/jarvis_tools/execute_script.py,sha256=IA1SkcnwBB9PKG2voBNx5N9GXL303OC7OOtdqRfqWOk,6428
70
- jarvis/jarvis_tools/file_analyzer.py,sha256=jl9phaN6BqMcgrikMeaxY-9VYXbXQOO1Zu61fZocGv0,4917
71
- jarvis/jarvis_tools/file_operation.py,sha256=WloC1-oPJLwgICu4WBc9f7XA8N_Ggl73QQ5CxM2XTlE,9464
72
- jarvis/jarvis_tools/generate_new_tool.py,sha256=KZX4wpSpBZ4S5817zAN5j7AAirtgBCrNUmjrpfL9dNI,7706
73
- jarvis/jarvis_tools/methodology.py,sha256=m7cQmVhhQpUUl_uYTVvcW0JBovQLx5pWTXh_8K77HsU,5237
74
- jarvis/jarvis_tools/read_code.py,sha256=QkwrZc0slAZSa8p3sfTkN4FoIGqvC6CTz3vGRAdDBdI,6627
75
- jarvis/jarvis_tools/read_webpage.py,sha256=PFAYuKjay9j6phWzyuZ99ZfNaHJljmRWAgS0bsvbcvE,2219
76
- jarvis/jarvis_tools/registry.py,sha256=mb_IcPRUNB85b41DMgoi72iWamaRbhWNZ5_UXgFJBe8,25188
77
- jarvis/jarvis_tools/rewrite_file.py,sha256=3V2l7kG5DG9iRimBce-1qCRuJPL0QM32SBTzOl2zCqM,7004
78
- jarvis/jarvis_tools/search_web.py,sha256=rzxrCOTEo-MmLQrKI4k-AbfidUfJUeCPK4f5ZJy48G8,952
79
- jarvis/jarvis_tools/virtual_tty.py,sha256=8E_n-eC-RRPTqYx6BI5Q2RnorY8dbhKFBfAjIiRQROA,16397
80
- jarvis/jarvis_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
- jarvis/jarvis_tools/cli/main.py,sha256=3UuU9tk5cQAS0rfNPXgdtnAd5uDB7v0Exo0_I9sJHRE,6355
82
- jarvis/jarvis_utils/__init__.py,sha256=x5lbQRH1uOulmWr1IEqNMLXNmDHbqQQot7d1uhKFg4M,851
83
- jarvis/jarvis_utils/builtin_replace_map.py,sha256=qvxnhDMnuflKvQiJgeMUi96sZgrNkZJl_MswAzOD4AA,4883
84
- jarvis/jarvis_utils/config.py,sha256=Z7pZsSYXJkc2RzUhJ-_VvQA3xOLo6LEo4nEE1ftyQY8,7104
85
- jarvis/jarvis_utils/embedding.py,sha256=J8YAqIEj16TJIPEG24uvUlPHeN-5zq0JW_hbNLizQug,3832
86
- jarvis/jarvis_utils/file_processors.py,sha256=G5kQI7vCGIDnjgAB5J1dYIR102u6WUv3IhcWFfDh_gs,2977
87
- jarvis/jarvis_utils/git_utils.py,sha256=k0rrMAbKwnD7hztmtegxtFFiCzyID4p2oHKTycE2Q-4,15070
88
- jarvis/jarvis_utils/globals.py,sha256=908DizIMrInuOlirTp5lsOfqbD6K2v18P_J7A8nrdus,3375
89
- jarvis/jarvis_utils/input.py,sha256=FkLW7MXL8awQUghFLQnW1r5F1wV8K3EZeVPwHFRHJTo,7458
90
- jarvis/jarvis_utils/methodology.py,sha256=6vf__ahwJZ2I62mWGAvh2C-G6pq930Dh_EkrY1VpduQ,8485
91
- jarvis/jarvis_utils/output.py,sha256=QboL42GtG_dnvd1O64sl8o72mEBhXNRADPXQMXgDE7Q,9661
92
- jarvis/jarvis_utils/tag.py,sha256=YJHmuedLb7_AiqvKQetHr4R1FxyzIh7HN0RRkWMmYbU,429
93
- jarvis/jarvis_utils/utils.py,sha256=r9Xnf84jR2E1CfHBtYVF_sPZ74-S4W63aPleBQZtdYo,11597
94
- jarvis_ai_assistant-0.1.193.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
95
- jarvis_ai_assistant-0.1.193.dist-info/METADATA,sha256=RJAXtk8b0Exd0ZgfEW7jzt9NE7M8iFFFN-uXrf7VYu4,18901
96
- jarvis_ai_assistant-0.1.193.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
97
- jarvis_ai_assistant-0.1.193.dist-info/entry_points.txt,sha256=Gy3DOP1PYLMK0GCj4rrP_9lkOyBQ39EK_lKGUSwn41E,869
98
- jarvis_ai_assistant-0.1.193.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
99
- jarvis_ai_assistant-0.1.193.dist-info/RECORD,,