janito 1.10.0__py3-none-any.whl → 1.11.1__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.
- janito/__init__.py +1 -1
- janito/agent/conversation_api.py +178 -90
- janito/agent/conversation_ui.py +1 -1
- janito/agent/llm_conversation_history.py +12 -0
- janito/agent/templates/profiles/system_prompt_template_base.txt.j2 +19 -4
- janito/agent/tools/__init__.py +2 -0
- janito/agent/tools/create_directory.py +1 -1
- janito/agent/tools/create_file.py +1 -1
- janito/agent/tools/fetch_url.py +1 -1
- janito/agent/tools/find_files.py +26 -13
- janito/agent/tools/get_file_outline/core.py +1 -1
- janito/agent/tools/get_file_outline/python_outline.py +139 -95
- janito/agent/tools/get_lines.py +92 -63
- janito/agent/tools/move_file.py +58 -32
- janito/agent/tools/open_url.py +31 -0
- janito/agent/tools/python_command_runner.py +85 -86
- janito/agent/tools/python_file_runner.py +85 -86
- janito/agent/tools/python_stdin_runner.py +87 -88
- janito/agent/tools/remove_directory.py +1 -1
- janito/agent/tools/remove_file.py +1 -1
- janito/agent/tools/replace_file.py +2 -2
- janito/agent/tools/replace_text_in_file.py +193 -149
- janito/agent/tools/run_bash_command.py +1 -1
- janito/agent/tools/run_powershell_command.py +4 -0
- janito/agent/tools/search_text/__init__.py +1 -0
- janito/agent/tools/search_text/core.py +176 -0
- janito/agent/tools/search_text/match_lines.py +58 -0
- janito/agent/tools/search_text/pattern_utils.py +65 -0
- janito/agent/tools/search_text/traverse_directory.py +132 -0
- janito/agent/tools/validate_file_syntax/core.py +41 -30
- janito/agent/tools/validate_file_syntax/html_validator.py +21 -5
- janito/agent/tools/validate_file_syntax/markdown_validator.py +77 -34
- janito/agent/tools_utils/gitignore_utils.py +25 -2
- janito/agent/tools_utils/utils.py +7 -1
- janito/cli/config_commands.py +112 -109
- janito/shell/main.py +51 -8
- janito/shell/session/config.py +83 -75
- janito/shell/ui/interactive.py +97 -73
- janito/termweb/static/editor.css +32 -29
- janito/termweb/static/editor.css.bak +140 -22
- janito/termweb/static/editor.html +12 -7
- janito/termweb/static/editor.html.bak +16 -11
- janito/termweb/static/editor.js +94 -40
- janito/termweb/static/editor.js.bak +97 -65
- janito/termweb/static/index.html +1 -2
- janito/termweb/static/index.html.bak +1 -1
- janito/termweb/static/termweb.css +1 -22
- janito/termweb/static/termweb.css.bak +6 -4
- janito/termweb/static/termweb.js +0 -6
- janito/termweb/static/termweb.js.bak +1 -2
- {janito-1.10.0.dist-info → janito-1.11.1.dist-info}/METADATA +1 -1
- {janito-1.10.0.dist-info → janito-1.11.1.dist-info}/RECORD +56 -51
- {janito-1.10.0.dist-info → janito-1.11.1.dist-info}/WHEEL +1 -1
- janito/agent/tools/search_text.py +0 -254
- {janito-1.10.0.dist-info → janito-1.11.1.dist-info}/entry_points.txt +0 -0
- {janito-1.10.0.dist-info → janito-1.11.1.dist-info}/licenses/LICENSE +0 -0
- {janito-1.10.0.dist-info → janito-1.11.1.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
janito/__init__.py,sha256=
|
1
|
+
janito/__init__.py,sha256=K96Ieyj_pvPsWOfDSlFjBXqROLgyWEro-T06boxuOO8,24
|
2
2
|
janito/__main__.py,sha256=KKIoPBE9xPcb54PRYO2UOt0ti04iAwLeJlg8YY36vew,76
|
3
3
|
janito/rich_utils.py,sha256=x7OsZdwtAOtUu_HYbrAMga0LElFMPbQL8GZ62vw5Jh8,1825
|
4
4
|
janito/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -8,15 +8,15 @@ janito/agent/config_defaults.py,sha256=22MxI84GF8YL5avIjAWxHlvARxu4A2wD0oou_lqNC
|
|
8
8
|
janito/agent/config_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
janito/agent/content_handler.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
janito/agent/conversation.py,sha256=jxt3DmvuWDQRNObvHwiWkj74qsfrNAjn4Syh-QBXuAA,9564
|
11
|
-
janito/agent/conversation_api.py,sha256=
|
11
|
+
janito/agent/conversation_api.py,sha256=6iKlkLWnfgM4D_6ju-ReMprJSnMC1FdCHKqrSgOluhg,10706
|
12
12
|
janito/agent/conversation_exceptions.py,sha256=Aw7PRLb3eUfyDOGynKds5F48dgjyiOrTCEcWSprYC58,381
|
13
13
|
janito/agent/conversation_tool_calls.py,sha256=wz9FFtwNXgnyJQbcLzZfHfCPkiLfItE2vJ1JqjpKucA,1553
|
14
|
-
janito/agent/conversation_ui.py,sha256=
|
14
|
+
janito/agent/conversation_ui.py,sha256=YTqcY51Nu3gtw6NzcH4RmXSCWUr09iO7CKxJsVxsJPc,412
|
15
15
|
janito/agent/event.py,sha256=1jcua88NT-T4jA0mGIyIF1LvqXKu2GDT8NMjlelWmCI,517
|
16
16
|
janito/agent/event_dispatcher.py,sha256=eFNDfGY8o63yNLFdMe82LqfmDyGWjrAw9CpyUAcLJAM,856
|
17
17
|
janito/agent/event_handler_protocol.py,sha256=uIIf9u82BWm8pha4sZxydeEwgbxDoiWVSyplBPI0knE,130
|
18
18
|
janito/agent/event_system.py,sha256=QxPSQ2XeTyiWV6ejcmS8kTqTBrs7fLHRVXdhyeVHpas,608
|
19
|
-
janito/agent/llm_conversation_history.py,sha256=
|
19
|
+
janito/agent/llm_conversation_history.py,sha256=9i4GxYH4dF7IYV6ZzBVAm6BDQ2E9842-CIzHlQGSOxg,3055
|
20
20
|
janito/agent/message_handler.py,sha256=oZJ2u0C7OewHiHwlJslT2o3RPlvY2HhPXPoRcSsBv4M,856
|
21
21
|
janito/agent/message_handler_protocol.py,sha256=E8PLl9ucNvPK_xmhLEkV-vhQzfO_P_BMvzpqDvUkcVY,150
|
22
22
|
janito/agent/openai_client.py,sha256=Hd4Rzq4ZiwVWgT1NgSCs7U_1YrXbdypQ4Wa1A_MK090,5341
|
@@ -33,41 +33,46 @@ janito/agent/tool_base.py,sha256=KKWmMKyjxpWNukgdImLwZqs9cnS_tVzBt6cpQ532-KM,202
|
|
33
33
|
janito/agent/tool_executor.py,sha256=yizyu88QteTHtJ_ktj679IqsaMyS-TQYR7rXnWI6lOg,5114
|
34
34
|
janito/agent/tool_registry.py,sha256=AjxYgQTeG9wUTyi0h128AG7INCyziF0z3zux12BlXnE,1673
|
35
35
|
janito/agent/tool_use_tracker.py,sha256=bEHirQX79u1uHnkmXO7t3JrBt2tHaQhaOzII7Nqiq5A,2874
|
36
|
-
janito/agent/templates/profiles/system_prompt_template_base.txt.j2,sha256=
|
36
|
+
janito/agent/templates/profiles/system_prompt_template_base.txt.j2,sha256=0w1aN27wd6lo556Hq5a2CJkA80lLkugEdKONE2_THRM,2283
|
37
37
|
janito/agent/templates/profiles/system_prompt_template_base_pt.txt.j2,sha256=FX8piXbR9XNOEKkOSMt4ieZ2wn5fzQlffeQFf8d7gIc,723
|
38
38
|
janito/agent/tests/__init__.py,sha256=QuXHKEzUJ_DooaKqenv_tKuNH-HabuIVZhvW5JNaeIc,52
|
39
|
-
janito/agent/tools/__init__.py,sha256=
|
39
|
+
janito/agent/tools/__init__.py,sha256=LASzm6aHwqAtcDZnQFk9BW8HMn7s6yHDf4c5B4SXqs4,1248
|
40
40
|
janito/agent/tools/ask_user.py,sha256=DL-jBU-njSjwhNSbgi23RZCrRBt5beDgZq_PG4yzbWM,3217
|
41
|
-
janito/agent/tools/create_directory.py,sha256=
|
42
|
-
janito/agent/tools/create_file.py,sha256=
|
41
|
+
janito/agent/tools/create_directory.py,sha256=O-yCF-fRwI9m1IGuziqqHSl4-fiGeFwx4u1c7IoR1HE,2595
|
42
|
+
janito/agent/tools/create_file.py,sha256=YLjyhCvcUOci87Tr4ejml9W75HiIvotLAgDWTbQT-98,2420
|
43
43
|
janito/agent/tools/delete_text_in_file.py,sha256=WIUDPgaaPK2Dk1WzKTPdfyckcoA6p51cwAf0SMiJj8c,3494
|
44
|
-
janito/agent/tools/fetch_url.py,sha256=
|
45
|
-
janito/agent/tools/find_files.py,sha256=
|
46
|
-
janito/agent/tools/get_lines.py,sha256=
|
47
|
-
janito/agent/tools/move_file.py,sha256=
|
44
|
+
janito/agent/tools/fetch_url.py,sha256=GsSf5pdMEa_UYv_V5lJw7kClvypVDI96KOzt2k2cAeU,3863
|
45
|
+
janito/agent/tools/find_files.py,sha256=kx1mgpKd03yf9Zp_7vlqrHAyO1xJoE0gdoCjc8xCWhc,4493
|
46
|
+
janito/agent/tools/get_lines.py,sha256=5y5i1Y3CkKfudTSynFnR2w-xdSgUqJ3XSVwvOPsfoN0,6310
|
47
|
+
janito/agent/tools/move_file.py,sha256=65ndePzYCR0TpI3LPmvL6qt1Tsz9nU6i-YRr3Y7dzCY,5113
|
48
|
+
janito/agent/tools/open_url.py,sha256=xXGEonfvU3rCc8vOkdjeC1ibGfDnQEhHQ_qo0MIpPKk,1197
|
48
49
|
janito/agent/tools/present_choices.py,sha256=XVO9jhWOUry7TedGPkOU4CG3COV_YdTUp3YiKyNKo2U,2422
|
49
|
-
janito/agent/tools/python_command_runner.py,sha256=
|
50
|
-
janito/agent/tools/python_file_runner.py,sha256=
|
51
|
-
janito/agent/tools/python_stdin_runner.py,sha256=
|
52
|
-
janito/agent/tools/remove_directory.py,sha256=
|
53
|
-
janito/agent/tools/remove_file.py,sha256=
|
54
|
-
janito/agent/tools/replace_file.py,sha256=
|
55
|
-
janito/agent/tools/replace_text_in_file.py,sha256=
|
56
|
-
janito/agent/tools/run_bash_command.py,sha256=
|
57
|
-
janito/agent/tools/run_powershell_command.py,sha256=
|
58
|
-
janito/agent/tools/search_text.py,sha256=OHyJ3UTfrJjy7WLM1KXvjMxVVeK6nUYPMV-uzeDjY6E,10321
|
50
|
+
janito/agent/tools/python_command_runner.py,sha256=Lirx8VWY4A3uPQwkG6s3OT8de_rdSywbuW0aSj6VBX8,6102
|
51
|
+
janito/agent/tools/python_file_runner.py,sha256=vD8OeRiagZpKXZiXXcOU7Hn2_RtZ1nOLQ2smZQ-wfiY,5929
|
52
|
+
janito/agent/tools/python_stdin_runner.py,sha256=fpLDCVyIo3viecmmwzprzn1OxrSWLtKrbRnh8C55Z_E,6265
|
53
|
+
janito/agent/tools/remove_directory.py,sha256=9NmSqlSIGbm-uvundEQM89ZMGmcgPqygnnw-Cu9lQq8,2500
|
54
|
+
janito/agent/tools/remove_file.py,sha256=v6NJdECofBxYB2YRt3DCqHr91kSPVfMQlgpuL0svVEs,2409
|
55
|
+
janito/agent/tools/replace_file.py,sha256=SurwU_oR6HqZ2vsxNo8Ud-NT-gayg0XipoiCWlMESDI,3275
|
56
|
+
janito/agent/tools/replace_text_in_file.py,sha256=RPlTIdi_Ib7Nhrq_oEML79DeEFD9essOFqxZauVacSY,10678
|
57
|
+
janito/agent/tools/run_bash_command.py,sha256=XEyBGa5cSfjdi0sOklsaPNsEW_9oC9LZIir4FkxcO0M,5877
|
58
|
+
janito/agent/tools/run_powershell_command.py,sha256=qA27uMsF6CqFd3A81Gn8TzEj99MHr0C_12QM74fIRNc,9022
|
59
59
|
janito/agent/tools/get_file_outline/__init__.py,sha256=OKV_BHnoD9h-vkcVoW6AHmsuDjjauHPCKNK0nVFl4sU,37
|
60
|
-
janito/agent/tools/get_file_outline/core.py,sha256=
|
60
|
+
janito/agent/tools/get_file_outline/core.py,sha256=e75fij0Wx7mBveBIQirpkuu8WzMnxUIEwSylvS-UNzc,3312
|
61
61
|
janito/agent/tools/get_file_outline/markdown_outline.py,sha256=bXEBg0D93tEBDNy8t-wh4i7WxsxfpQ2C3dX1_rmtj08,434
|
62
|
-
janito/agent/tools/get_file_outline/python_outline.py,sha256=
|
62
|
+
janito/agent/tools/get_file_outline/python_outline.py,sha256=d_DKQjo5fbzOvQadc2A_58kmavUTVqkzpWRdFRO4sbU,5768
|
63
63
|
janito/agent/tools/get_file_outline/search_outline.py,sha256=_wPdylEFvl-iE3fuwY3MEUlaDKO5cbHxN1_DTJf5x8s,1079
|
64
|
+
janito/agent/tools/search_text/__init__.py,sha256=FEYpF5tTtf0fiAyRGIGSn-kV-MJDkhdFIbus16mYW8Y,34
|
65
|
+
janito/agent/tools/search_text/core.py,sha256=6B6ElILXKoupq29PTp9PIHD3-cySFDzRC4wLBxsvc-M,6740
|
66
|
+
janito/agent/tools/search_text/match_lines.py,sha256=OjYgX9vFphambv0SfTLGZoR5Cdzf-Fp5Ytbj4sGEgnI,1999
|
67
|
+
janito/agent/tools/search_text/pattern_utils.py,sha256=j_Svq_l-RT63VVAI9nj1ULm1qdU2JTsWKrVVaAgyRoo,2129
|
68
|
+
janito/agent/tools/search_text/traverse_directory.py,sha256=Ln_GaJFQ0DQ4A2qBZ1Y4tX7YMFROhonFgTHf48DDXHQ,3864
|
64
69
|
janito/agent/tools/validate_file_syntax/__init__.py,sha256=P53RHmas4BbHL90cMxH9m-RpMCJI8JquoJb0rpkPVVk,29
|
65
|
-
janito/agent/tools/validate_file_syntax/core.py,sha256=
|
70
|
+
janito/agent/tools/validate_file_syntax/core.py,sha256=jUT4m-4i6hcFh4U1eCpt4V5xbpKMrlCZyHdr2Ca25SY,3407
|
66
71
|
janito/agent/tools/validate_file_syntax/css_validator.py,sha256=tRnCzNkpiYKQ_X9yvPeDPqZvc59He2T-2CbXmCs8Hjw,1371
|
67
|
-
janito/agent/tools/validate_file_syntax/html_validator.py,sha256=
|
72
|
+
janito/agent/tools/validate_file_syntax/html_validator.py,sha256=YlAQUmBkuE9jMiN3uepYI8W9s3E0vwONXiAdNu9l5-U,3074
|
68
73
|
janito/agent/tools/validate_file_syntax/js_validator.py,sha256=oVkGxK9wBbZ3cFqwrV_aF76FDQwKPDvbXxXn1tL4We0,1018
|
69
74
|
janito/agent/tools/validate_file_syntax/json_validator.py,sha256=jfft16AjPqo4opIlv36Yc1QhpwiYVlMOyfeAJuhRZ8U,170
|
70
|
-
janito/agent/tools/validate_file_syntax/markdown_validator.py,sha256=
|
75
|
+
janito/agent/tools/validate_file_syntax/markdown_validator.py,sha256=cLyBS8P7xZIjp91V3wDaHStHOPHoxfsIYqaesO5rUAc,3540
|
71
76
|
janito/agent/tools/validate_file_syntax/ps1_validator.py,sha256=DQbsIIC3oaFkbeK7BMjZcIzy-zkPHX1JbhMMS3q_rmc,1172
|
72
77
|
janito/agent/tools/validate_file_syntax/python_validator.py,sha256=SN9eNgk9Uormr_kfyan9hCZClZ1LB5guObOzbZRyo6c,150
|
73
78
|
janito/agent/tools/validate_file_syntax/xml_validator.py,sha256=nDHMnrSdjAyQhbSIJZcDuqEkeiJmjvTALlKdtn_Ny0k,304
|
@@ -76,9 +81,9 @@ janito/agent/tools_utils/__init__.py,sha256=tMniEJ8rcFeiztKqidRe-sCRJh02gMw_s1Oj
|
|
76
81
|
janito/agent/tools_utils/action_type.py,sha256=_BzW1VnJB48WiJCyniKWVzk-M9_d14KBK5oV4VAJ30c,119
|
77
82
|
janito/agent/tools_utils/dir_walk_utils.py,sha256=MY0bdKfYhAZ-8bT5S9XfFqWiq2ZOzQl0NAqz0BkyIg4,1127
|
78
83
|
janito/agent/tools_utils/formatting.py,sha256=SMvOmL6bst3KGcI7OLa5D4DE127fQYuHZS3oY8OPsn8,2031
|
79
|
-
janito/agent/tools_utils/gitignore_utils.py,sha256=
|
84
|
+
janito/agent/tools_utils/gitignore_utils.py,sha256=P3iF9fMWAomqULq2xsoqHtI9uNIFSPcagljrxZshmLw,4110
|
80
85
|
janito/agent/tools_utils/test_gitignore_utils.py,sha256=ydA9mzza7QzgyEPjYsecKzPLyYFk0DGBVBz113LGklY,1891
|
81
|
-
janito/agent/tools_utils/utils.py,sha256=
|
86
|
+
janito/agent/tools_utils/utils.py,sha256=wLGOy0tGr-s9LmBOsU-04ZIpcQgFCWUoY8SEvT893j8,1247
|
82
87
|
janito/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
83
88
|
janito/cli/_livereload_log_utils.py,sha256=BGhf1VT3dVR2ZhyTnZeTFg4I8Zj2tAn2UslME-ouxXA,482
|
84
89
|
janito/cli/_print_config.py,sha256=fzrVy23Ppe-Dax97VU759bus-KRe1VycU5MAPbHE72g,3259
|
@@ -86,7 +91,7 @@ janito/cli/_termweb_log_utils.py,sha256=QpH40uxPhksrJHWqthW4cR7BhcSSYakpza_qTeFG
|
|
86
91
|
janito/cli/_utils.py,sha256=tRAUMDWKczd81ZvKYkwpsHWSeLzQoVlOoQ-lOw9Iujw,291
|
87
92
|
janito/cli/arg_parser.py,sha256=8cE0E6zHWy4VE1jio3E3hyBpULD2AKo8q6QkTjyeWiQ,8345
|
88
93
|
janito/cli/cli_main.py,sha256=egi9Ql8iskSlmP_QU6eGAVqbzRp4lU5dt97K9WrIsn0,10341
|
89
|
-
janito/cli/config_commands.py,sha256=
|
94
|
+
janito/cli/config_commands.py,sha256=7c1a-FMaRLHSUuH93NqLlao9plg3C220xe_MnhE1zMA,7561
|
90
95
|
janito/cli/config_runner.py,sha256=Nzam25C8P55dFlT_f6IlEj2ZvFwS63AAbnkIWe3oNsg,1702
|
91
96
|
janito/cli/formatting_runner.py,sha256=k0mtHoglqR8fKcebSK81iWTT_EL-gDl7eNfjlFZRY6g,287
|
92
97
|
janito/cli/livereload_starter.py,sha256=JivN7PRG9_dCEEOobXETQcJ7Ro9ELczg8AUbI8LHFPI,2285
|
@@ -101,7 +106,7 @@ janito/livereload/app.py,sha256=oJTKDN5vpix26d1MA5iQz9mPLDu4VaHisAW8wtOUEhY,666
|
|
101
106
|
janito/shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
102
107
|
janito/shell/commands.py,sha256=gqMKLvb6MrESPx51O28OP5I9hDZuBkRMaom3hT_ACqA,1586
|
103
108
|
janito/shell/input_history.py,sha256=JedB9TQoRf31l2XGadeQtyx1qAAFPLRyXSvMLltRwZE,2542
|
104
|
-
janito/shell/main.py,sha256=
|
109
|
+
janito/shell/main.py,sha256=9X8--rkh5v56VV7ttz9okHal9L8lNQ86L5Oth67cTCE,11413
|
105
110
|
janito/shell/commands/__init__.py,sha256=CJGXhVFEQdbIL214g3vF7vhyvlvtjqjFHjSMMTjXHjM,2016
|
106
111
|
janito/shell/commands/config.py,sha256=UTNbyNOLpIqlAle_JpCiffP7h5IOk7wxih-10_ok62w,959
|
107
112
|
janito/shell/commands/conversation_restart.py,sha256=b32vWa7rm43lA1SrFZ0v-OAB-zf4dTP307rEr52Mt9A,2825
|
@@ -120,29 +125,29 @@ janito/shell/commands/verbose.py,sha256=mg7BlsWTkNwbUBN2p_GME4ep3zzAp0jMSc6N4BT3
|
|
120
125
|
janito/shell/prompt/completer.py,sha256=6gNu0DNNSbUUVgjk8Y0hWwJwk-jbN8Lm6Y4u0mRu930,755
|
121
126
|
janito/shell/prompt/load_prompt.py,sha256=gHedc5TtaFBKiGgwRM_u9nVnBuLHDTSa8VPlPOtoMEA,2125
|
122
127
|
janito/shell/prompt/session_setup.py,sha256=ry4TqiXYyw3JmZfGRGIpvAgNMXGeWltCwz56NoiBqSY,1531
|
123
|
-
janito/shell/session/config.py,sha256=
|
128
|
+
janito/shell/session/config.py,sha256=5hBgPeYDrgxtVEyVaR8nmw1DYNmSqY8ilyuNyUXnnpQ,3684
|
124
129
|
janito/shell/session/history.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
125
130
|
janito/shell/session/manager.py,sha256=LGf2x9mprGOHAJhq7_OfIZM8Z2bmAEJ_KakaZr1XqXc,3116
|
126
|
-
janito/shell/ui/interactive.py,sha256=
|
131
|
+
janito/shell/ui/interactive.py,sha256=sD7z_kXKDW4sMVA3dZ9RslThuaJfLJh1mURgIsiTmVk,7716
|
127
132
|
janito/termweb/app.py,sha256=co4a7cw6pC2P79dMZaNxjPJrP_B9suTGRIWTgqK5ccw,3322
|
128
|
-
janito/termweb/static/editor.css,sha256=
|
129
|
-
janito/termweb/static/editor.css.bak,sha256=
|
130
|
-
janito/termweb/static/editor.html,sha256=
|
131
|
-
janito/termweb/static/editor.html.bak,sha256=
|
132
|
-
janito/termweb/static/editor.js,sha256=
|
133
|
-
janito/termweb/static/editor.js.bak,sha256=
|
133
|
+
janito/termweb/static/editor.css,sha256=i1kha-ZpAUaO-gc81lQKAYNQ_QETJ_KlT8JBwdgf2nc,2914
|
134
|
+
janito/termweb/static/editor.css.bak,sha256=S7tMjZFtcDZyx4asRf-WNclyuK9_rnemwOc6JpzSwdQ,2908
|
135
|
+
janito/termweb/static/editor.html,sha256=1gsMiBVPoIQF6saFnrkMIUcv7JkDLvmo7GspvGO3Bt8,2973
|
136
|
+
janito/termweb/static/editor.html.bak,sha256=31gL8ew2Yd9uwg0vEStd6-sJnqvh0Xs75rbq-TnOHGg,2715
|
137
|
+
janito/termweb/static/editor.js,sha256=_Qwvsna3lAMlb0N-pvDHs9DWIC3-Qz8zGgB6CZpG-44,10155
|
138
|
+
janito/termweb/static/editor.js.bak,sha256=O91nykKXaG2EwU4BtKmmR9Zqa42lRK-VYMQ00_a129M,9998
|
134
139
|
janito/termweb/static/explorer.html.bak,sha256=PM1fcbaQJm545WT94mVEekUNW3jduBAHOz6rwJBR1FA,2568
|
135
140
|
janito/termweb/static/favicon.ico,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
136
141
|
janito/termweb/static/favicon.ico.bak,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
137
|
-
janito/termweb/static/index.html,sha256=
|
138
|
-
janito/termweb/static/index.html.bak,sha256=
|
142
|
+
janito/termweb/static/index.html,sha256=Kt-fSp4Daefef8NOe-l034s8sFecmxexxmbHsd33rfI,2816
|
143
|
+
janito/termweb/static/index.html.bak,sha256=lwF9j4C0wL56rBEU3f0s3HzdSGOWxf64LbQhBUh5fxU,2934
|
139
144
|
janito/termweb/static/index.html.bak.bak,sha256=dsKoC2lE0oJCGUUDTWcnIQE3s5Uoqd12WoTkWEwbH_c,6626
|
140
145
|
janito/termweb/static/landing.html.bak,sha256=JGwIcATj0B8MhHXLoXg2clypqsKJwi54NtW-rRDUsMs,1403
|
141
146
|
janito/termweb/static/termicon.svg,sha256=vc2Z3q-ADVK3pLzE3wnw_qpR6vDguWKEdH_pWObPjbw,229
|
142
|
-
janito/termweb/static/termweb.css,sha256=
|
143
|
-
janito/termweb/static/termweb.css.bak,sha256=
|
144
|
-
janito/termweb/static/termweb.js,sha256=
|
145
|
-
janito/termweb/static/termweb.js.bak,sha256=
|
147
|
+
janito/termweb/static/termweb.css,sha256=yygj2xaFiT-0RNIQk0V8I-vNuzYAo5gUsq-Z8yVNwvs,4430
|
148
|
+
janito/termweb/static/termweb.css.bak,sha256=aYzXm6iawtaBzofeCw1KC74K003xUq4eRR2ET-OAbVE,4931
|
149
|
+
janito/termweb/static/termweb.js,sha256=6NfpyK9T8A2JccBvZ5FjQ--j-tYOpfF2nqxNvMSs4u8,7489
|
150
|
+
janito/termweb/static/termweb.js.bak,sha256=hVzFd4gGMPEPvJEicQsXQpePp9mTjKVB_tS29xfWPhs,7720
|
146
151
|
janito/termweb/static/termweb.js.bak.bak,sha256=SQeqc9YwdreCmFJ7LtCYlHOjRHi8rsoW_fZ3x5WroWQ,7692
|
147
152
|
janito/termweb/static/termweb_quickopen.js,sha256=HNT85JjWAvjI5ROwukOU-oI4ZVVjCO6yg5IT115pdXI,5379
|
148
153
|
janito/termweb/static/termweb_quickopen.js.bak,sha256=sk_zbEw6HJt1iZSAYlaW0qAhq0to-KcBsOKx0AZqkKA,4814
|
@@ -150,9 +155,9 @@ janito/tests/test_rich_utils.py,sha256=S_mGVynekAP0DM4A_ZaY-SseJGtdlBJxOlzc-v8lJ
|
|
150
155
|
janito/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
151
156
|
janito/web/__main__.py,sha256=5Ck6okOZmxKYkQ-ir4mxXDH7XWMNR-9szgsm0UyQLE0,734
|
152
157
|
janito/web/app.py,sha256=-zUBA1zlnrZdYbI421CSAgFZXOisLmIznNzUJrkSLQQ,4762
|
153
|
-
janito-1.
|
154
|
-
janito-1.
|
155
|
-
janito-1.
|
156
|
-
janito-1.
|
157
|
-
janito-1.
|
158
|
-
janito-1.
|
158
|
+
janito-1.11.1.dist-info/licenses/LICENSE,sha256=sHBqv0bvtrb29H7WRR-Z603YHm9pLtJIo3nHU_9cmgE,1091
|
159
|
+
janito-1.11.1.dist-info/METADATA,sha256=JFjzR6lOF5EZOsctt69XHOMdje-uaaJCh59aE4tFukQ,12879
|
160
|
+
janito-1.11.1.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
161
|
+
janito-1.11.1.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
|
162
|
+
janito-1.11.1.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
|
163
|
+
janito-1.11.1.dist-info/RECORD,,
|
@@ -1,254 +0,0 @@
|
|
1
|
-
from janito.agent.tool_base import ToolBase
|
2
|
-
from janito.agent.tools_utils.action_type import ActionType
|
3
|
-
from janito.agent.tool_registry import register_tool
|
4
|
-
from janito.agent.tools_utils.utils import pluralize
|
5
|
-
from janito.i18n import tr
|
6
|
-
import os
|
7
|
-
import re
|
8
|
-
from janito.agent.tools_utils.gitignore_utils import GitignoreFilter
|
9
|
-
|
10
|
-
|
11
|
-
def is_binary_file(path, blocksize=1024):
|
12
|
-
try:
|
13
|
-
with open(path, "rb") as f:
|
14
|
-
chunk = f.read(blocksize)
|
15
|
-
if b"\0" in chunk:
|
16
|
-
return True
|
17
|
-
text_characters = bytearray(
|
18
|
-
{7, 8, 9, 10, 12, 13, 27} | set(range(0x20, 0x100))
|
19
|
-
)
|
20
|
-
nontext = chunk.translate(None, text_characters)
|
21
|
-
if len(nontext) / max(1, len(chunk)) > 0.3:
|
22
|
-
return True
|
23
|
-
except Exception:
|
24
|
-
return True
|
25
|
-
return False
|
26
|
-
|
27
|
-
|
28
|
-
@register_tool(name="search_text")
|
29
|
-
class SearchTextTool(ToolBase):
|
30
|
-
"""
|
31
|
-
Search for a text pattern (regex or plain string) in all files within one or more directories or file paths and return matching lines. Respects .gitignore.
|
32
|
-
Args:
|
33
|
-
paths (str): String of one or more paths (space-separated) to search in. Each path can be a directory or a file.
|
34
|
-
pattern (str): Regex pattern or plain text substring to search for in files. Must not be empty. Tries regex first, falls back to substring if regex is invalid.
|
35
|
-
Note: When using regex mode, special characters (such as [, ], ., *, etc.) must be escaped if you want to match them literally (e.g., use '\\[DEBUG\\]' to match the literal string '[DEBUG]').
|
36
|
-
is_regex (bool): If True, treat pattern as a regular expression. If False, treat as plain text (default).
|
37
|
-
Only set is_regex=True if your pattern is a valid regular expression. Do NOT set is_regex=True for plain text patterns, as regex special characters (such as ., *, [, ], etc.) will be interpreted and may cause unexpected results.
|
38
|
-
For plain text substring search, leave is_regex as False or omit it.
|
39
|
-
max_depth (int, optional): Maximum directory depth to search. If 0 (default), search is recursive with no depth limit. If >0, limits recursion to that depth. Setting max_depth=1 disables recursion (only top-level directory). Ignored for file paths.
|
40
|
-
max_results (int): Maximum number of results to return. 0 means no limit (default).
|
41
|
-
ignore_utf8_errors (bool): If True, ignore utf-8 decode errors. Defaults to True.
|
42
|
-
Returns:
|
43
|
-
str: Matching lines from files as a newline-separated string, each formatted as 'filepath:lineno: line'.
|
44
|
-
If max_results is reached, appends a note to the output.
|
45
|
-
"""
|
46
|
-
|
47
|
-
def _prepare_pattern(self, pattern, is_regex):
|
48
|
-
if not pattern:
|
49
|
-
self.report_error(
|
50
|
-
tr("Error: Empty search pattern provided. Operation aborted.")
|
51
|
-
)
|
52
|
-
return (
|
53
|
-
None,
|
54
|
-
False,
|
55
|
-
tr("Error: Empty search pattern provided. Operation aborted."),
|
56
|
-
)
|
57
|
-
regex = None
|
58
|
-
use_regex = False
|
59
|
-
if is_regex:
|
60
|
-
try:
|
61
|
-
regex = re.compile(pattern)
|
62
|
-
use_regex = True
|
63
|
-
except re.error as e:
|
64
|
-
self.report_warning(tr("\u26a0\ufe0f Invalid regex pattern."))
|
65
|
-
return (
|
66
|
-
None,
|
67
|
-
False,
|
68
|
-
tr("Warning: Invalid regex pattern: {error}. No results.", error=e),
|
69
|
-
)
|
70
|
-
else:
|
71
|
-
try:
|
72
|
-
regex = re.compile(pattern)
|
73
|
-
use_regex = True
|
74
|
-
except re.error:
|
75
|
-
regex = None
|
76
|
-
use_regex = False
|
77
|
-
return regex, use_regex, None
|
78
|
-
|
79
|
-
def _search_file(
|
80
|
-
self,
|
81
|
-
path,
|
82
|
-
pattern,
|
83
|
-
regex,
|
84
|
-
use_regex,
|
85
|
-
max_results,
|
86
|
-
total_results,
|
87
|
-
ignore_utf8_errors,
|
88
|
-
):
|
89
|
-
dir_output = []
|
90
|
-
dir_limit_reached = False
|
91
|
-
if not is_binary_file(path):
|
92
|
-
try:
|
93
|
-
open_kwargs = {"mode": "r", "encoding": "utf-8"}
|
94
|
-
if ignore_utf8_errors:
|
95
|
-
open_kwargs["errors"] = "ignore"
|
96
|
-
with open(path, **open_kwargs) as f:
|
97
|
-
for lineno, line in enumerate(f, 1):
|
98
|
-
if use_regex:
|
99
|
-
if regex.search(line):
|
100
|
-
dir_output.append(f"{path}:{lineno}: {line.strip()}")
|
101
|
-
else:
|
102
|
-
if pattern in line:
|
103
|
-
dir_output.append(f"{path}:{lineno}: {line.strip()}")
|
104
|
-
if (
|
105
|
-
max_results > 0
|
106
|
-
and (total_results + len(dir_output)) >= max_results
|
107
|
-
):
|
108
|
-
dir_limit_reached = True
|
109
|
-
break
|
110
|
-
except Exception:
|
111
|
-
pass
|
112
|
-
return dir_output, dir_limit_reached
|
113
|
-
|
114
|
-
def _search_directory(
|
115
|
-
self,
|
116
|
-
search_path,
|
117
|
-
pattern,
|
118
|
-
regex,
|
119
|
-
use_regex,
|
120
|
-
max_depth,
|
121
|
-
max_results,
|
122
|
-
total_results,
|
123
|
-
ignore_utf8_errors,
|
124
|
-
):
|
125
|
-
dir_output = []
|
126
|
-
dir_limit_reached = False
|
127
|
-
if max_depth == 1:
|
128
|
-
walk_result = next(os.walk(search_path), None)
|
129
|
-
if walk_result is None:
|
130
|
-
walker = [(search_path, [], [])]
|
131
|
-
else:
|
132
|
-
_, dirs, files = walk_result
|
133
|
-
gitignore = GitignoreFilter()
|
134
|
-
dirs, files = gitignore.filter_ignored(search_path, dirs, files)
|
135
|
-
walker = [(search_path, dirs, files)]
|
136
|
-
else:
|
137
|
-
gitignore = GitignoreFilter()
|
138
|
-
walker = os.walk(search_path)
|
139
|
-
stop_search = False
|
140
|
-
for root, dirs, files in walker:
|
141
|
-
if stop_search:
|
142
|
-
break
|
143
|
-
rel_path = os.path.relpath(root, search_path)
|
144
|
-
depth = 0 if rel_path == "." else rel_path.count(os.sep) + 1
|
145
|
-
if max_depth == 1 and depth > 0:
|
146
|
-
break
|
147
|
-
if max_depth > 0 and depth > max_depth:
|
148
|
-
continue
|
149
|
-
dirs, files = gitignore.filter_ignored(root, dirs, files)
|
150
|
-
for filename in files:
|
151
|
-
if stop_search:
|
152
|
-
break
|
153
|
-
path = os.path.join(root, filename)
|
154
|
-
file_output, file_limit_reached = self._search_file(
|
155
|
-
path,
|
156
|
-
pattern,
|
157
|
-
regex,
|
158
|
-
use_regex,
|
159
|
-
max_results,
|
160
|
-
total_results + len(dir_output),
|
161
|
-
ignore_utf8_errors,
|
162
|
-
)
|
163
|
-
dir_output.extend(file_output)
|
164
|
-
if file_limit_reached:
|
165
|
-
dir_limit_reached = True
|
166
|
-
stop_search = True
|
167
|
-
break
|
168
|
-
return dir_output, dir_limit_reached
|
169
|
-
|
170
|
-
def _format_result(self, pattern, use_regex, output, limit_reached):
|
171
|
-
header = tr(
|
172
|
-
"[search_text] Pattern: '{pattern}' | Regex: {use_regex} | Results: {count}",
|
173
|
-
pattern=pattern,
|
174
|
-
use_regex=use_regex,
|
175
|
-
count=len(output),
|
176
|
-
)
|
177
|
-
result = header + "\n" + "\n".join(output)
|
178
|
-
if limit_reached:
|
179
|
-
result += tr("\n[Note: max_results limit reached, output truncated.]")
|
180
|
-
self.report_success(
|
181
|
-
tr(
|
182
|
-
" \u2705 {count} {line_word}{limit}",
|
183
|
-
count=len(output),
|
184
|
-
line_word=pluralize("line", len(output)),
|
185
|
-
limit=(" (limit reached)" if limit_reached else ""),
|
186
|
-
)
|
187
|
-
)
|
188
|
-
return result
|
189
|
-
|
190
|
-
def run(
|
191
|
-
self,
|
192
|
-
paths: str,
|
193
|
-
pattern: str,
|
194
|
-
is_regex: bool = False,
|
195
|
-
max_depth: int = 0,
|
196
|
-
max_results: int = 0,
|
197
|
-
ignore_utf8_errors: bool = True,
|
198
|
-
) -> str:
|
199
|
-
regex, use_regex, error_msg = self._prepare_pattern(pattern, is_regex)
|
200
|
-
if error_msg:
|
201
|
-
return error_msg
|
202
|
-
paths_list = paths.split()
|
203
|
-
results = []
|
204
|
-
total_results = 0
|
205
|
-
limit_reached = False
|
206
|
-
for search_path in paths_list:
|
207
|
-
from janito.agent.tools_utils.utils import display_path
|
208
|
-
|
209
|
-
info_str = tr(
|
210
|
-
"\U0001f50d Searching for {search_type} '{pattern}' in '{disp_path}'",
|
211
|
-
search_type=("regex" if use_regex else "text"),
|
212
|
-
pattern=pattern,
|
213
|
-
disp_path=display_path(search_path),
|
214
|
-
)
|
215
|
-
if max_depth > 0:
|
216
|
-
info_str += tr(" [max_depth={max_depth}]", max_depth=max_depth)
|
217
|
-
self.report_info(ActionType.READ, info_str)
|
218
|
-
dir_output = []
|
219
|
-
dir_limit_reached = False
|
220
|
-
if os.path.isfile(search_path):
|
221
|
-
dir_output, dir_limit_reached = self._search_file(
|
222
|
-
search_path,
|
223
|
-
pattern,
|
224
|
-
regex,
|
225
|
-
use_regex,
|
226
|
-
max_results,
|
227
|
-
total_results,
|
228
|
-
ignore_utf8_errors,
|
229
|
-
)
|
230
|
-
total_results += len(dir_output)
|
231
|
-
if dir_limit_reached:
|
232
|
-
limit_reached = True
|
233
|
-
else:
|
234
|
-
dir_output, dir_limit_reached = self._search_directory(
|
235
|
-
search_path,
|
236
|
-
pattern,
|
237
|
-
regex,
|
238
|
-
use_regex,
|
239
|
-
max_depth,
|
240
|
-
max_results,
|
241
|
-
total_results,
|
242
|
-
ignore_utf8_errors,
|
243
|
-
)
|
244
|
-
total_results += len(dir_output)
|
245
|
-
if dir_limit_reached:
|
246
|
-
limit_reached = True
|
247
|
-
# Format and append result for this path
|
248
|
-
result_str = self._format_result(
|
249
|
-
pattern, use_regex, dir_output, dir_limit_reached
|
250
|
-
)
|
251
|
-
results.append(info_str + "\n" + result_str)
|
252
|
-
if limit_reached:
|
253
|
-
break
|
254
|
-
return "\n\n".join(results)
|
File without changes
|
File without changes
|
File without changes
|