janito 1.12.1__py3-none-any.whl → 1.13.0__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.py +1 -1
- janito/agent/tools/find_files.py +13 -3
- janito/agent/tools/get_lines.py +7 -7
- janito/agent/tools/python_command_runner.py +80 -28
- janito/agent/tools/python_file_runner.py +79 -27
- janito/agent/tools/python_stdin_runner.py +83 -28
- janito/agent/tools/replace_text_in_file.py +13 -8
- janito/agent/tools/run_bash_command.py +172 -82
- janito/agent/tools/run_powershell_command.py +149 -111
- janito/agent/tools/search_text/core.py +6 -1
- janito/agent/tools/search_text/pattern_utils.py +1 -1
- janito/agent/tools/validate_file_syntax/core.py +8 -8
- janito/agent/tools/validate_file_syntax/markdown_validator.py +2 -2
- janito/cli/arg_parser.py +5 -0
- janito/cli/cli_main.py +28 -17
- janito/shell/commands/utility.py +3 -0
- janito/shell/main.py +56 -31
- {janito-1.12.1.dist-info → janito-1.13.0.dist-info}/METADATA +1 -1
- {janito-1.12.1.dist-info → janito-1.13.0.dist-info}/RECORD +24 -25
- {janito-1.12.1.dist-info → janito-1.13.0.dist-info}/WHEEL +1 -1
- janito/shell/commands.py +0 -40
- {janito-1.12.1.dist-info → janito-1.13.0.dist-info}/entry_points.txt +0 -0
- {janito-1.12.1.dist-info → janito-1.13.0.dist-info}/licenses/LICENSE +0 -0
- {janito-1.12.1.dist-info → janito-1.13.0.dist-info}/top_level.txt +0 -0
@@ -102,8 +102,8 @@ def _check_unclosed_inline_code(content):
|
|
102
102
|
def _build_markdown_result(errors):
|
103
103
|
if errors:
|
104
104
|
msg = tr(
|
105
|
-
"
|
105
|
+
"⚠️ Warning: Markdown syntax issues found:\n{errors}",
|
106
106
|
errors="\n".join(errors),
|
107
107
|
)
|
108
108
|
return msg
|
109
|
-
return "
|
109
|
+
return "✅ Syntax valid"
|
janito/cli/arg_parser.py
CHANGED
@@ -258,6 +258,11 @@ def create_parser():
|
|
258
258
|
action="store_true",
|
259
259
|
help="Disable tool call reason tracking (no tools tracking)",
|
260
260
|
)
|
261
|
+
parser.add_argument(
|
262
|
+
"--all-out",
|
263
|
+
action="store_true",
|
264
|
+
help="Stream all output live to both the model and the screen, and do not store output in files. (use --all-out)",
|
265
|
+
)
|
261
266
|
parser.add_argument(
|
262
267
|
"--tool-user",
|
263
268
|
action="store_true",
|
janito/cli/cli_main.py
CHANGED
@@ -18,32 +18,43 @@ def is_port_free(port):
|
|
18
18
|
return s.connect_ex(("localhost", port)) != 0
|
19
19
|
|
20
20
|
|
21
|
+
def _set_runtime_flags(args, flags):
|
22
|
+
for flag in flags:
|
23
|
+
if hasattr(args, flag):
|
24
|
+
runtime_config.set(flag, getattr(args, flag, False))
|
25
|
+
|
26
|
+
|
27
|
+
def _set_runtime_if_present(args, attr, config_key=None):
|
28
|
+
if getattr(args, attr, None) is not None:
|
29
|
+
runtime_config.set(config_key or attr, getattr(args, attr))
|
30
|
+
|
31
|
+
|
21
32
|
def normalize_args(args):
|
22
33
|
if getattr(args, "vanilla", False):
|
23
34
|
runtime_config.set("vanilla_mode", True)
|
24
35
|
if getattr(args, "ntt", False):
|
25
36
|
runtime_config.set("no_tools_tracking", True)
|
26
|
-
|
27
|
-
"
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
if getattr(args, "all_out", False):
|
38
|
+
runtime_config.set("all_out", True)
|
39
|
+
_set_runtime_flags(
|
40
|
+
args,
|
41
|
+
[
|
42
|
+
"verbose_http",
|
43
|
+
"verbose_http_raw",
|
44
|
+
"verbose_response",
|
45
|
+
"verbose_reason",
|
46
|
+
"verbose_tools",
|
47
|
+
"verbose_events",
|
48
|
+
"verbose_messages",
|
49
|
+
],
|
50
|
+
)
|
37
51
|
if getattr(args, "trust_tools", False):
|
38
52
|
runtime_config.set("trust_tools", True)
|
39
|
-
|
40
|
-
|
41
|
-
if getattr(args, "max_tools", None) is not None:
|
42
|
-
runtime_config.set("max_tools", args.max_tools)
|
53
|
+
_set_runtime_if_present(args, "model")
|
54
|
+
_set_runtime_if_present(args, "max_tools")
|
43
55
|
if getattr(args, "verbose_reason", False):
|
44
56
|
runtime_config.set("verbose_reason", True)
|
45
|
-
|
46
|
-
runtime_config.set("max_tokens", args.max_tokens)
|
57
|
+
_set_runtime_if_present(args, "max_tokens")
|
47
58
|
|
48
59
|
|
49
60
|
def setup_profile_manager(args, role, interaction_mode, profile, lang):
|
janito/shell/commands/utility.py
CHANGED
@@ -6,6 +6,9 @@ def handle_help(console, **kwargs):
|
|
6
6
|
help_text = getattr(handler, "help_text", None)
|
7
7
|
if help_text:
|
8
8
|
console.print(f" {cmd} - {help_text}")
|
9
|
+
console.print(
|
10
|
+
"[bold cyan]!command[/]: Run a shell/cmd command without exiting the shell (e.g., !dir or !ls)"
|
11
|
+
)
|
9
12
|
|
10
13
|
|
11
14
|
def handle_clear(console, **kwargs):
|
janito/shell/main.py
CHANGED
@@ -87,6 +87,51 @@ def load_session(shell_state, continue_session, session_id, profile_manager):
|
|
87
87
|
return True
|
88
88
|
|
89
89
|
|
90
|
+
def _handle_exit_confirmation(session, message_handler, conversation_history):
|
91
|
+
try:
|
92
|
+
confirm = (
|
93
|
+
session.prompt(
|
94
|
+
HTML("<inputline>Do you really want to exit? (y/n): </inputline>")
|
95
|
+
)
|
96
|
+
.strip()
|
97
|
+
.lower()
|
98
|
+
)
|
99
|
+
except KeyboardInterrupt:
|
100
|
+
message_handler.handle_message({"type": "error", "message": "Exiting..."})
|
101
|
+
return True
|
102
|
+
if confirm == "y":
|
103
|
+
message_handler.handle_message({"type": "error", "message": "Exiting..."})
|
104
|
+
conversation_history.add_message(
|
105
|
+
{"role": "system", "content": "[Session ended by user]"}
|
106
|
+
)
|
107
|
+
return True
|
108
|
+
return False
|
109
|
+
|
110
|
+
|
111
|
+
def _handle_shell_command(user_input, console):
|
112
|
+
command = user_input.strip()[1:].strip()
|
113
|
+
if command:
|
114
|
+
console.print(f"[bold cyan]Executing shell command:[/] {command}")
|
115
|
+
exit_code = os.system(command)
|
116
|
+
console.print(f"[green]Command exited with code {exit_code}[/green]")
|
117
|
+
else:
|
118
|
+
console.print("[red]No command provided after ![/red]")
|
119
|
+
|
120
|
+
|
121
|
+
def _handle_prompt_command(user_input, console, shell_state, conversation_history):
|
122
|
+
result = handle_command(
|
123
|
+
user_input.strip(),
|
124
|
+
console,
|
125
|
+
shell_state=shell_state,
|
126
|
+
)
|
127
|
+
if result == "exit":
|
128
|
+
conversation_history.add_message(
|
129
|
+
{"role": "system", "content": "[Session ended by user]"}
|
130
|
+
)
|
131
|
+
return True
|
132
|
+
return False
|
133
|
+
|
134
|
+
|
90
135
|
def handle_prompt_loop(
|
91
136
|
shell_state, session, profile_manager, agent, max_rounds, session_id
|
92
137
|
):
|
@@ -110,42 +155,22 @@ def handle_prompt_loop(
|
|
110
155
|
break
|
111
156
|
except KeyboardInterrupt:
|
112
157
|
console.print()
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
HTML(
|
117
|
-
"<inputline>Do you really want to exit? (y/n): </inputline>"
|
118
|
-
)
|
119
|
-
)
|
120
|
-
.strip()
|
121
|
-
.lower()
|
122
|
-
)
|
123
|
-
except KeyboardInterrupt:
|
124
|
-
message_handler.handle_message(
|
125
|
-
{"type": "error", "message": "Exiting..."}
|
126
|
-
)
|
127
|
-
break
|
128
|
-
if confirm == "y":
|
129
|
-
message_handler.handle_message(
|
130
|
-
{"type": "error", "message": "Exiting..."}
|
131
|
-
)
|
132
|
-
conversation_history.add_message(
|
133
|
-
{"role": "system", "content": "[Session ended by user]"}
|
134
|
-
)
|
158
|
+
if _handle_exit_confirmation(
|
159
|
+
session, message_handler, conversation_history
|
160
|
+
):
|
135
161
|
break
|
136
162
|
else:
|
137
163
|
continue
|
164
|
+
# Handle !cmd command: execute shell command with os.system
|
165
|
+
if user_input.strip().startswith("!"):
|
166
|
+
_handle_shell_command(user_input, console)
|
167
|
+
continue
|
168
|
+
|
138
169
|
cmd_input = user_input.strip().lower()
|
139
170
|
if not was_paste_mode and (cmd_input.startswith("/") or cmd_input == "exit"):
|
140
|
-
|
141
|
-
user_input
|
142
|
-
|
143
|
-
shell_state=shell_state,
|
144
|
-
)
|
145
|
-
if result == "exit":
|
146
|
-
conversation_history.add_message(
|
147
|
-
{"role": "system", "content": "[Session ended by user]"}
|
148
|
-
)
|
171
|
+
if _handle_prompt_command(
|
172
|
+
user_input, console, shell_state, conversation_history
|
173
|
+
):
|
149
174
|
break
|
150
175
|
continue
|
151
176
|
if not user_input.strip():
|
@@ -1,4 +1,4 @@
|
|
1
|
-
janito/__init__.py,sha256=
|
1
|
+
janito/__init__.py,sha256=3Vxl6FAJt_13oY3p4Zx-Yd9-94VF7otXCDoEarA5jhA,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
|
@@ -7,7 +7,7 @@ janito/agent/config.py,sha256=dO64nxiiHj-tLJLN8sfY10GUuIaOmWu-NX73n9zVHfg,4609
|
|
7
7
|
janito/agent/config_defaults.py,sha256=22MxI84GF8YL5avIjAWxHlvARxu4A2wD0oou_lqNCeA,460
|
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
|
-
janito/agent/conversation.py,sha256=
|
10
|
+
janito/agent/conversation.py,sha256=HqjZaXtnoQtKet7MRISDOqnWsjvAXlgKKf4E6LjjVNk,9558
|
11
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
|
@@ -42,37 +42,37 @@ janito/agent/tools/create_directory.py,sha256=O-yCF-fRwI9m1IGuziqqHSl4-fiGeFwx4u
|
|
42
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
44
|
janito/agent/tools/fetch_url.py,sha256=GsSf5pdMEa_UYv_V5lJw7kClvypVDI96KOzt2k2cAeU,3863
|
45
|
-
janito/agent/tools/find_files.py,sha256=
|
46
|
-
janito/agent/tools/get_lines.py,sha256=
|
45
|
+
janito/agent/tools/find_files.py,sha256=ZzPB3Pk0JzqZjzeonY3OghfyBGJu5UuppduS2D178h8,4926
|
46
|
+
janito/agent/tools/get_lines.py,sha256=OO53g0tz1TnWXL8DqabQPEJhI_rYYp1VDjuSElhBPJI,6289
|
47
47
|
janito/agent/tools/move_file.py,sha256=65ndePzYCR0TpI3LPmvL6qt1Tsz9nU6i-YRr3Y7dzCY,5113
|
48
48
|
janito/agent/tools/open_url.py,sha256=xXGEonfvU3rCc8vOkdjeC1ibGfDnQEhHQ_qo0MIpPKk,1197
|
49
49
|
janito/agent/tools/present_choices.py,sha256=XVO9jhWOUry7TedGPkOU4CG3COV_YdTUp3YiKyNKo2U,2422
|
50
|
-
janito/agent/tools/python_command_runner.py,sha256=
|
51
|
-
janito/agent/tools/python_file_runner.py,sha256=
|
52
|
-
janito/agent/tools/python_stdin_runner.py,sha256=
|
50
|
+
janito/agent/tools/python_command_runner.py,sha256=cu2EHwhgRKYERZ7Wjz-x0E_6NhNQUWnxcg1wqU4Jg_Q,8511
|
51
|
+
janito/agent/tools/python_file_runner.py,sha256=nLIG4CSqMNKJyZyQ5js23LpRP8BAGjTTI1s36-YnUXg,8345
|
52
|
+
janito/agent/tools/python_stdin_runner.py,sha256=rWWAX2l7vPG1poV0wnIy7K983Eft15kf-RvORxqJ1gk,8795
|
53
53
|
janito/agent/tools/remove_directory.py,sha256=9NmSqlSIGbm-uvundEQM89ZMGmcgPqygnnw-Cu9lQq8,2500
|
54
54
|
janito/agent/tools/remove_file.py,sha256=v6NJdECofBxYB2YRt3DCqHr91kSPVfMQlgpuL0svVEs,2409
|
55
55
|
janito/agent/tools/replace_file.py,sha256=SurwU_oR6HqZ2vsxNo8Ud-NT-gayg0XipoiCWlMESDI,3275
|
56
|
-
janito/agent/tools/replace_text_in_file.py,sha256=
|
57
|
-
janito/agent/tools/run_bash_command.py,sha256=
|
58
|
-
janito/agent/tools/run_powershell_command.py,sha256=
|
56
|
+
janito/agent/tools/replace_text_in_file.py,sha256=gOZOE-gIZ9Dxdzy1mQBue465kYSyAB8LTFQSh4APqoo,10974
|
57
|
+
janito/agent/tools/run_bash_command.py,sha256=ea694qpN1M0bwkHkxPqRao1pSKyNmbjQnDGZgjRLZ9Q,8582
|
58
|
+
janito/agent/tools/run_powershell_command.py,sha256=2s4YjsUzgElwX6KgUFq3xZcFj5wosPJ4F0nPXke6M6s,10306
|
59
59
|
janito/agent/tools/get_file_outline/__init__.py,sha256=OKV_BHnoD9h-vkcVoW6AHmsuDjjauHPCKNK0nVFl4sU,37
|
60
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
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
64
|
janito/agent/tools/search_text/__init__.py,sha256=FEYpF5tTtf0fiAyRGIGSn-kV-MJDkhdFIbus16mYW8Y,34
|
65
|
-
janito/agent/tools/search_text/core.py,sha256=
|
65
|
+
janito/agent/tools/search_text/core.py,sha256=7x4hXKXQD7OGeE2zwjWoksGxJrFT6SpTDaw3fJsu8wc,6879
|
66
66
|
janito/agent/tools/search_text/match_lines.py,sha256=OjYgX9vFphambv0SfTLGZoR5Cdzf-Fp5Ytbj4sGEgnI,1999
|
67
|
-
janito/agent/tools/search_text/pattern_utils.py,sha256=
|
67
|
+
janito/agent/tools/search_text/pattern_utils.py,sha256=x8ZUVIu_yC5urafcp4f11T--2hiuLTGvjcAevOAKYOI,2123
|
68
68
|
janito/agent/tools/search_text/traverse_directory.py,sha256=Ln_GaJFQ0DQ4A2qBZ1Y4tX7YMFROhonFgTHf48DDXHQ,3864
|
69
69
|
janito/agent/tools/validate_file_syntax/__init__.py,sha256=P53RHmas4BbHL90cMxH9m-RpMCJI8JquoJb0rpkPVVk,29
|
70
|
-
janito/agent/tools/validate_file_syntax/core.py,sha256=
|
70
|
+
janito/agent/tools/validate_file_syntax/core.py,sha256=tmX1kaZP_W6xQbNAnXKl6V9D-MVsiKz9tads3H3W5dI,3359
|
71
71
|
janito/agent/tools/validate_file_syntax/css_validator.py,sha256=tRnCzNkpiYKQ_X9yvPeDPqZvc59He2T-2CbXmCs8Hjw,1371
|
72
72
|
janito/agent/tools/validate_file_syntax/html_validator.py,sha256=YlAQUmBkuE9jMiN3uepYI8W9s3E0vwONXiAdNu9l5-U,3074
|
73
73
|
janito/agent/tools/validate_file_syntax/js_validator.py,sha256=oVkGxK9wBbZ3cFqwrV_aF76FDQwKPDvbXxXn1tL4We0,1018
|
74
74
|
janito/agent/tools/validate_file_syntax/json_validator.py,sha256=jfft16AjPqo4opIlv36Yc1QhpwiYVlMOyfeAJuhRZ8U,170
|
75
|
-
janito/agent/tools/validate_file_syntax/markdown_validator.py,sha256=
|
75
|
+
janito/agent/tools/validate_file_syntax/markdown_validator.py,sha256=IppdzFV3d9WK17VqWEal-kQXUVUuZDlR00AZ2OlVHzM,3531
|
76
76
|
janito/agent/tools/validate_file_syntax/ps1_validator.py,sha256=DQbsIIC3oaFkbeK7BMjZcIzy-zkPHX1JbhMMS3q_rmc,1172
|
77
77
|
janito/agent/tools/validate_file_syntax/python_validator.py,sha256=SN9eNgk9Uormr_kfyan9hCZClZ1LB5guObOzbZRyo6c,150
|
78
78
|
janito/agent/tools/validate_file_syntax/xml_validator.py,sha256=nDHMnrSdjAyQhbSIJZcDuqEkeiJmjvTALlKdtn_Ny0k,304
|
@@ -89,8 +89,8 @@ janito/cli/_livereload_log_utils.py,sha256=BGhf1VT3dVR2ZhyTnZeTFg4I8Zj2tAn2UslME
|
|
89
89
|
janito/cli/_print_config.py,sha256=fzrVy23Ppe-Dax97VU759bus-KRe1VycU5MAPbHE72g,3259
|
90
90
|
janito/cli/_termweb_log_utils.py,sha256=QpH40uxPhksrJHWqthW4cR7BhcSSYakpza_qTeFGABs,722
|
91
91
|
janito/cli/_utils.py,sha256=tRAUMDWKczd81ZvKYkwpsHWSeLzQoVlOoQ-lOw9Iujw,291
|
92
|
-
janito/cli/arg_parser.py,sha256=
|
93
|
-
janito/cli/cli_main.py,sha256=
|
92
|
+
janito/cli/arg_parser.py,sha256=4VzEBI6PPXsHQLHyH4HCax8M-6wWRryNgnr6W4n96Y4,8554
|
93
|
+
janito/cli/cli_main.py,sha256=emvt6R6Ou1caIeb82W6CfjLo9L14m-UtfpUKk7vDnNI,10572
|
94
94
|
janito/cli/config_commands.py,sha256=7c1a-FMaRLHSUuH93NqLlao9plg3C220xe_MnhE1zMA,7561
|
95
95
|
janito/cli/config_runner.py,sha256=Nzam25C8P55dFlT_f6IlEj2ZvFwS63AAbnkIWe3oNsg,1702
|
96
96
|
janito/cli/formatting_runner.py,sha256=k0mtHoglqR8fKcebSK81iWTT_EL-gDl7eNfjlFZRY6g,287
|
@@ -104,9 +104,8 @@ janito/i18n/messages.py,sha256=fBuwOTFoygyHPkYphm6Y0r1iE8497Z4iryVAmPhMEkg,1851
|
|
104
104
|
janito/i18n/pt.py,sha256=52-ENCIrPW4A1tXFRT28xA8TwuUFoihs6ezJj-m3-Y4,4260
|
105
105
|
janito/livereload/app.py,sha256=oJTKDN5vpix26d1MA5iQz9mPLDu4VaHisAW8wtOUEhY,666
|
106
106
|
janito/shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
107
|
-
janito/shell/commands.py,sha256=gqMKLvb6MrESPx51O28OP5I9hDZuBkRMaom3hT_ACqA,1586
|
108
107
|
janito/shell/input_history.py,sha256=JedB9TQoRf31l2XGadeQtyx1qAAFPLRyXSvMLltRwZE,2542
|
109
|
-
janito/shell/main.py,sha256=
|
108
|
+
janito/shell/main.py,sha256=ZMVAMvUAbbfYqdSdQwe6fSeHsc82rGmwZhzR9n4f-zY,12169
|
110
109
|
janito/shell/commands/__init__.py,sha256=CJGXhVFEQdbIL214g3vF7vhyvlvtjqjFHjSMMTjXHjM,2016
|
111
110
|
janito/shell/commands/config.py,sha256=UTNbyNOLpIqlAle_JpCiffP7h5IOk7wxih-10_ok62w,959
|
112
111
|
janito/shell/commands/conversation_restart.py,sha256=b32vWa7rm43lA1SrFZ0v-OAB-zf4dTP307rEr52Mt9A,2825
|
@@ -120,7 +119,7 @@ janito/shell/commands/session_control.py,sha256=PAFg00vXQvIhAuCtd4L149hrj8jGguB0
|
|
120
119
|
janito/shell/commands/termweb_log.py,sha256=xxFz2GhFRI7w7jNk0D0Gq6RFBuzIZF1paDMK2MBeNWA,3519
|
121
120
|
janito/shell/commands/tools.py,sha256=Z6kB0Lu87gzWYiUcjNB_kkX-jCNSRpZZh_qgetzhFMU,970
|
122
121
|
janito/shell/commands/track.py,sha256=xOqVHjcnrMWZ_vhP1gpT0-2NUvJqPVT-MGdC38NJatg,1577
|
123
|
-
janito/shell/commands/utility.py,sha256=
|
122
|
+
janito/shell/commands/utility.py,sha256=DKcEbBIDmtxxZgWtT9-qBUVmFbCbRUILDo0kecmGJBE,992
|
124
123
|
janito/shell/commands/verbose.py,sha256=mg7BlsWTkNwbUBN2p_GME4ep3zzAp0jMSc6N4BT3Ebg,980
|
125
124
|
janito/shell/prompt/completer.py,sha256=6gNu0DNNSbUUVgjk8Y0hWwJwk-jbN8Lm6Y4u0mRu930,755
|
126
125
|
janito/shell/prompt/load_prompt.py,sha256=gHedc5TtaFBKiGgwRM_u9nVnBuLHDTSa8VPlPOtoMEA,2125
|
@@ -155,9 +154,9 @@ janito/tests/test_rich_utils.py,sha256=S_mGVynekAP0DM4A_ZaY-SseJGtdlBJxOlzc-v8lJ
|
|
155
154
|
janito/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
156
155
|
janito/web/__main__.py,sha256=5Ck6okOZmxKYkQ-ir4mxXDH7XWMNR-9szgsm0UyQLE0,734
|
157
156
|
janito/web/app.py,sha256=-zUBA1zlnrZdYbI421CSAgFZXOisLmIznNzUJrkSLQQ,4762
|
158
|
-
janito-1.
|
159
|
-
janito-1.
|
160
|
-
janito-1.
|
161
|
-
janito-1.
|
162
|
-
janito-1.
|
163
|
-
janito-1.
|
157
|
+
janito-1.13.0.dist-info/licenses/LICENSE,sha256=sHBqv0bvtrb29H7WRR-Z603YHm9pLtJIo3nHU_9cmgE,1091
|
158
|
+
janito-1.13.0.dist-info/METADATA,sha256=er7ySO_CJRytKqwmORgEU7zFtTJqyt4bGPxms4to_RE,12879
|
159
|
+
janito-1.13.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
160
|
+
janito-1.13.0.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
|
161
|
+
janito-1.13.0.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
|
162
|
+
janito-1.13.0.dist-info/RECORD,,
|
janito/shell/commands.py
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
from janito.agent.tool_registry import get_tool_schemas
|
2
|
-
from rich.console import Console
|
3
|
-
|
4
|
-
|
5
|
-
def handle_command(cmd, console: Console, shell_state=None):
|
6
|
-
cmd = cmd.strip().lower()
|
7
|
-
if cmd in ("/exit", "exit"):
|
8
|
-
return "exit"
|
9
|
-
if cmd in ("/help", "help"):
|
10
|
-
console.print("[bold cyan]/help[/]: Show this help message")
|
11
|
-
console.print("[bold cyan]/exit[/]: Exit the shell")
|
12
|
-
console.print("[bold cyan]/tools[/]: List available tools")
|
13
|
-
return
|
14
|
-
if cmd in ("/tools", "tools"):
|
15
|
-
table = None
|
16
|
-
try:
|
17
|
-
from rich.table import Table
|
18
|
-
|
19
|
-
table = Table(
|
20
|
-
title="Available Tools", show_lines=True, style="bold magenta"
|
21
|
-
)
|
22
|
-
table.add_column("Name", style="cyan", no_wrap=True)
|
23
|
-
table.add_column("Description", style="green")
|
24
|
-
table.add_column("Parameters", style="yellow")
|
25
|
-
for schema in get_tool_schemas():
|
26
|
-
fn = schema["function"]
|
27
|
-
params = "\n".join(
|
28
|
-
[
|
29
|
-
f"[bold]{k}[/]: {v['type']}"
|
30
|
-
for k, v in fn["parameters"].get("properties", {}).items()
|
31
|
-
]
|
32
|
-
)
|
33
|
-
table.add_row(f"[b]{fn['name']}[/b]", fn["description"], params or "-")
|
34
|
-
except Exception as e:
|
35
|
-
console.print(f"[red]Error loading tools: {e}[/red]")
|
36
|
-
if table:
|
37
|
-
console.print(table)
|
38
|
-
return
|
39
|
-
# Unknown command
|
40
|
-
console.print(f"[yellow]Unknown command:[/] {cmd}")
|
File without changes
|
File without changes
|
File without changes
|