jarvis-ai-assistant 0.1.98__py3-none-any.whl → 0.1.100__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 (45) hide show
  1. jarvis/__init__.py +1 -1
  2. jarvis/agent.py +199 -157
  3. jarvis/jarvis_code_agent/__init__.py +0 -0
  4. jarvis/jarvis_code_agent/main.py +202 -0
  5. jarvis/jarvis_codebase/main.py +415 -287
  6. jarvis/jarvis_coder/file_select.py +209 -0
  7. jarvis/jarvis_coder/git_utils.py +64 -2
  8. jarvis/jarvis_coder/main.py +13 -397
  9. jarvis/jarvis_coder/patch_handler.py +229 -81
  10. jarvis/jarvis_coder/plan_generator.py +49 -7
  11. jarvis/jarvis_platform/main.py +2 -2
  12. jarvis/jarvis_rag/main.py +11 -11
  13. jarvis/jarvis_smart_shell/main.py +5 -5
  14. jarvis/models/base.py +6 -1
  15. jarvis/models/kimi.py +2 -2
  16. jarvis/models/ollama.py +2 -2
  17. jarvis/models/openai.py +1 -1
  18. jarvis/models/registry.py +38 -18
  19. jarvis/tools/ask_user.py +12 -9
  20. jarvis/tools/chdir.py +9 -5
  21. jarvis/tools/create_code_sub_agent.py +56 -0
  22. jarvis/tools/{sub_agent.py → create_sub_agent.py} +6 -2
  23. jarvis/tools/execute_code_modification.py +70 -0
  24. jarvis/tools/{shell.py → execute_shell.py} +2 -2
  25. jarvis/tools/{file_ops.py → file_operation.py} +19 -15
  26. jarvis/tools/find_files.py +119 -0
  27. jarvis/tools/{generator.py → generate_tool.py} +27 -25
  28. jarvis/tools/methodology.py +32 -26
  29. jarvis/tools/rag.py +37 -33
  30. jarvis/tools/{webpage.py → read_webpage.py} +4 -2
  31. jarvis/tools/registry.py +94 -48
  32. jarvis/tools/search.py +19 -16
  33. jarvis/tools/select_code_files.py +61 -0
  34. jarvis/tools/thinker.py +7 -5
  35. jarvis/utils.py +155 -32
  36. {jarvis_ai_assistant-0.1.98.dist-info → jarvis_ai_assistant-0.1.100.dist-info}/METADATA +9 -8
  37. jarvis_ai_assistant-0.1.100.dist-info/RECORD +51 -0
  38. {jarvis_ai_assistant-0.1.98.dist-info → jarvis_ai_assistant-0.1.100.dist-info}/entry_points.txt +2 -1
  39. jarvis/main.py +0 -155
  40. jarvis/tools/codebase_qa.py +0 -74
  41. jarvis/tools/coder.py +0 -69
  42. jarvis_ai_assistant-0.1.98.dist-info/RECORD +0 -47
  43. {jarvis_ai_assistant-0.1.98.dist-info → jarvis_ai_assistant-0.1.100.dist-info}/LICENSE +0 -0
  44. {jarvis_ai_assistant-0.1.98.dist-info → jarvis_ai_assistant-0.1.100.dist-info}/WHEEL +0 -0
  45. {jarvis_ai_assistant-0.1.98.dist-info → jarvis_ai_assistant-0.1.100.dist-info}/top_level.txt +0 -0
jarvis/tools/coder.py DELETED
@@ -1,69 +0,0 @@
1
- import os
2
- from typing import Dict, Any, Optional
3
- from jarvis.jarvis_coder.main import JarvisCoder
4
- from jarvis.utils import PrettyOutput, OutputType
5
-
6
- class CoderTool:
7
- """代码修改工具"""
8
-
9
- name = "coder"
10
- description = "Analyze and modify existing code for implementing new features, fixing bugs, refactoring code, etc. Can understand code context and perform precise code edits."
11
- parameters = {
12
- "feature": {
13
- "type": "string",
14
- "description": "Description of the feature to implement or content to modify, e.g., 'add logging functionality', 'fix memory leak', 'optimize performance', etc.",
15
- "required": True
16
- },
17
- "dir": {
18
- "type": "string",
19
- "description": "Project root directory, defaults to current directory",
20
- "required": False
21
- },
22
- "language": {
23
- "type": "string",
24
- "description": "Main programming language of the project, defaults to python",
25
- "required": False
26
- }
27
- }
28
-
29
- def __init__(self):
30
- self._coder = None
31
-
32
-
33
- def _init_coder(self, dir: Optional[str] = None, language: Optional[str] = "python") -> None:
34
- """初始化JarvisCoder实例"""
35
- if not self._coder:
36
- import os
37
- work_dir = dir or os.getcwd()
38
- self._coder = JarvisCoder(work_dir, language)
39
-
40
- def execute(self, args: Dict) -> Dict[str, Any]:
41
- """执行代码修改
42
-
43
- Args:
44
- feature: 要实现的功能描述
45
- dir: 可选,项目根目录
46
- language: 可选,编程语言
47
-
48
- Returns:
49
- Dict[str, Any]: 执行结果
50
- """
51
- feature = args.get("feature")
52
- dir = args.get("dir")
53
- language = args.get("language", "python")
54
-
55
- try:
56
- self.current_dir = os.getcwd()
57
- self._init_coder(dir, language)
58
- result = self._coder.execute(str(feature)) # type: ignore
59
- return result
60
- except Exception as e:
61
- PrettyOutput.print(f"代码修改失败: {str(e)}", OutputType.ERROR)
62
- return {
63
- "success": False,
64
- "stdout": "",
65
- "stderr": f"执行失败: {str(e)}",
66
- "error": e
67
- }
68
- finally:
69
- os.chdir(self.current_dir)
@@ -1,47 +0,0 @@
1
- jarvis/__init__.py,sha256=LaazWaS94sRO9a8aOdOMwKl05JkbI63DYYlhGFXw32M,50
2
- jarvis/agent.py,sha256=9dfXBYO2QPYpiIXJixgoc1-CKHBDQcBlhskWrb0ZNYc,19636
3
- jarvis/main.py,sha256=mV_rW268R2CWnwDLUqmCqVOzEZBodwJoTzPiz979QF8,5919
4
- jarvis/utils.py,sha256=nqmOuQtmoIsc67iQNuWADwbXf2D3cbGjXan5VXLaTYk,11373
5
- jarvis/jarvis_codebase/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- jarvis/jarvis_codebase/main.py,sha256=8A4VwK_MjAknT6ANj5Ptgf3wDD6e8rFOQVcU4gcVvH8,31183
7
- jarvis/jarvis_coder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- jarvis/jarvis_coder/git_utils.py,sha256=91Kv7Q4SFNXj-SJ5L-5Bv5UQVXEPnR7LCLXPNygGViA,2334
9
- jarvis/jarvis_coder/main.py,sha256=Rjjq8pBhKaSpsjPJ-qbehYq_7wLjmeeZUjlXGgamuhI,25853
10
- jarvis/jarvis_coder/patch_handler.py,sha256=YOTG-OZa-J6Zhp7IzSTCLQn90vyN3eSbOQyqzT7LZiE,9768
11
- jarvis/jarvis_coder/plan_generator.py,sha256=nAaBFwPPI5Lu89hsZRYad0m_hTELnRQZ2plSx6VJU3Q,4585
12
- jarvis/jarvis_platform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- jarvis/jarvis_platform/main.py,sha256=Hb40MmN4We9oY8BHzLyrNTm-p7Mg50s2nqLaLxflC48,4981
14
- jarvis/jarvis_rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- jarvis/jarvis_rag/main.py,sha256=z6D-2nNVptp7YGHhU4O8gSfFsEXhNkPvj6ZMJztQuuU,33490
16
- jarvis/jarvis_smart_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- jarvis/jarvis_smart_shell/main.py,sha256=MOTSlE09YqwV4smWjHTGLKPf--hFMWfGrgD1LMb1FGU,3988
18
- jarvis/models/__init__.py,sha256=mrOt67nselz_H1gX9wdAO4y2DY5WPXzABqJbr5Des8k,63
19
- jarvis/models/ai8.py,sha256=ZRNO3aRjmICRjCXl-_F9pTNQTY4j1tUd-WJoJpb9n4Y,11958
20
- jarvis/models/base.py,sha256=5QQAghMmVsg7jXvQN9ZzVoqCmMR0jb9bKgAVR3eOjQ8,2005
21
- jarvis/models/kimi.py,sha256=wLXEA-17yLVvMRn-SAMGwQ_gx6mBaGhlSsP8F5pfoL0,16391
22
- jarvis/models/ollama.py,sha256=E8JDe378yMreglSVN5c_9lHAGBbuzHcYG05v07mS2BI,5724
23
- jarvis/models/openai.py,sha256=tAvz2Pne7woDXUppD7Ina461mVQCxy0vG5cwv5MHpLg,4404
24
- jarvis/models/oyi.py,sha256=iA8E5vzN9VIt-rlzpT5wmbyl7umVU1_y5yo_5gz3DXc,14534
25
- jarvis/models/registry.py,sha256=wswPmR8gzsyFnJ6TcTh58Py4uj6N0vApblyuXI7NeOQ,9062
26
- jarvis/tools/__init__.py,sha256=7Rqyj5hBAv5cWDVr5T9ZTZASO7ssBHeQNm2_4ZARdkA,72
27
- jarvis/tools/ask_user.py,sha256=u1opLhuHUmqz7bvlpj44x0vgMlKrTzFuFqc6YFaajW0,1953
28
- jarvis/tools/base.py,sha256=c0DMoDDPxmsqUYJR989zgUs7nIYRY6GWBrAdusIZKjc,656
29
- jarvis/tools/chdir.py,sha256=YMrzj6V3JHxX94e8adz97x1_E5aWjUoEwkhDM4T2DEs,2793
30
- jarvis/tools/codebase_qa.py,sha256=AJEJYnmw3ro5PEqUQGbNEpqY7YwwjXvYpEzmZheMptk,2446
31
- jarvis/tools/coder.py,sha256=HKBIbDwkpK05Zh4-ZDhmkB4x0HL-wNZL8T_ojwCk7KM,2383
32
- jarvis/tools/file_ops.py,sha256=lRoKl6d53wT3-sun_JqGLY6MO4RiXfxJL3ybP-chzTQ,3845
33
- jarvis/tools/generator.py,sha256=5iw8-uLwMcwSzQ2DouoWYa4WYm_7ZmYfdJBU50z9SUE,6040
34
- jarvis/tools/methodology.py,sha256=zsEr-i5mifJH1BXg0JgrmPaToTBcbjGdm_aM88vVmug,5199
35
- jarvis/tools/rag.py,sha256=zUrAJNis_HmTDCfSztmulqYt4ulaYHRb6fd-EMXRO9c,4528
36
- jarvis/tools/registry.py,sha256=-Qwt_2wcahN2XBwRtziZgm6eVF18jOvtLwgXgwre1nA,9471
37
- jarvis/tools/search.py,sha256=qbSfHJ5RHx8cHSdcmOfTFMQCNg6IxztKH5Vg4FtVTdE,9075
38
- jarvis/tools/shell.py,sha256=6XIDzdTf67PDIObUZqLtHvhnlOLSyuV_GlfFwQJsSaU,2580
39
- jarvis/tools/sub_agent.py,sha256=7YPY3qUocH7RjE3MDKFGlXKlAMIQv3-ufPRzlNXwo7w,2676
40
- jarvis/tools/thinker.py,sha256=VFq0z9geAtGsRCbd8S73Rk7afAuGm3KQp6t5nayUJVg,4800
41
- jarvis/tools/webpage.py,sha256=_ts9ioSFR2wcMwjId_aV-jqSWpbiydU_beJQyn_aAv4,2405
42
- jarvis_ai_assistant-0.1.98.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
43
- jarvis_ai_assistant-0.1.98.dist-info/METADATA,sha256=-s5OHAXkUGAVfb8oL5VJLIC2NUQRk2Vn0WoSaHVaxX0,12766
44
- jarvis_ai_assistant-0.1.98.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
45
- jarvis_ai_assistant-0.1.98.dist-info/entry_points.txt,sha256=1D14s9v6rwpNzVD0muwe0tCKffJDEvLRBlEShbSFSbQ,331
46
- jarvis_ai_assistant-0.1.98.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
47
- jarvis_ai_assistant-0.1.98.dist-info/RECORD,,