janito 2.0.1__py3-none-any.whl → 2.1.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/tools/adapters/local/__init__.py +3 -0
- janito/tools/adapters/local/open_html_in_browser.py +15 -6
- janito/version.py +1 -1
- {janito-2.0.1.dist-info → janito-2.1.0.dist-info}/METADATA +1 -1
- {janito-2.0.1.dist-info → janito-2.1.0.dist-info}/RECORD +9 -9
- {janito-2.0.1.dist-info → janito-2.1.0.dist-info}/WHEEL +0 -0
- {janito-2.0.1.dist-info → janito-2.1.0.dist-info}/entry_points.txt +0 -0
- {janito-2.0.1.dist-info → janito-2.1.0.dist-info}/top_level.txt +0 -0
janito/__init__.py
CHANGED
@@ -9,6 +9,7 @@ from .find_files import FindFilesTool
|
|
9
9
|
from .view_file import ViewFileTool
|
10
10
|
from .move_file import MoveFileTool
|
11
11
|
from .open_url import OpenUrlTool
|
12
|
+
from .open_html_in_browser import OpenHtmlInBrowserTool
|
12
13
|
from .python_code_run import PythonCodeRunTool
|
13
14
|
from .python_command_run import PythonCommandRunTool
|
14
15
|
from .python_file_run import PythonFileRunTool
|
@@ -36,6 +37,7 @@ for tool_class in [
|
|
36
37
|
ViewFileTool,
|
37
38
|
MoveFileTool,
|
38
39
|
OpenUrlTool,
|
40
|
+
OpenHtmlInBrowserTool,
|
39
41
|
PythonCodeRunTool,
|
40
42
|
PythonCommandRunTool,
|
41
43
|
PythonFileRunTool,
|
@@ -52,3 +54,4 @@ for tool_class in [
|
|
52
54
|
local_tools_adapter.register_tool(tool_class)
|
53
55
|
|
54
56
|
# DEBUG: Print registered tools at startup
|
57
|
+
|
@@ -1,5 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase
|
2
2
|
from janito.tools.adapters.local.adapter import register_local_tool
|
3
|
+
from janito.report_events import ReportAction
|
3
4
|
import webbrowser
|
4
5
|
import os
|
5
6
|
|
@@ -21,14 +22,22 @@ class OpenHtmlInBrowserTool(ToolBase):
|
|
21
22
|
tool_name = "open_html_in_browser"
|
22
23
|
|
23
24
|
def run(self, file_path: str) -> str:
|
25
|
+
from janito.i18n import tr
|
26
|
+
disp_path = file_path
|
27
|
+
self.report_action(tr("📖 Opening HTML file: '{disp_path}'", disp_path=disp_path), ReportAction.EXECUTE)
|
28
|
+
|
24
29
|
if not os.path.exists(file_path):
|
25
|
-
|
26
|
-
|
30
|
+
self.report_error(tr("⚠️ The specified file does not exist: '{disp_path}'", disp_path=disp_path))
|
31
|
+
return "⚠️ The specified file does not exist."
|
32
|
+
|
27
33
|
if not file_path.lower().endswith('.html'):
|
28
|
-
|
29
|
-
|
34
|
+
self.report_error(tr("⚠️ The specified file is not an HTML file: '{disp_path}'", disp_path=disp_path))
|
35
|
+
return "⚠️ The specified file is not an HTML file."
|
36
|
+
|
30
37
|
try:
|
31
38
|
webbrowser.open(f"file://{os.path.abspath(file_path)}")
|
32
|
-
|
39
|
+
self.report_success(tr("✅ Ok"))
|
40
|
+
return "✅ Ok"
|
33
41
|
except Exception as e:
|
34
|
-
|
42
|
+
self.report_error(tr("⚠️ Failed to open the HTML file: {err}", err=str(e)))
|
43
|
+
return f"⚠️ Failed to open the file: {str(e)}"
|
janito/version.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
janito/__init__.py,sha256=
|
1
|
+
janito/__init__.py,sha256=LPIMGN0aKEWl2rT_sMRWHEuSr-y95F1kB08ljrwOtIM,232
|
2
2
|
janito/__main__.py,sha256=lPQ8kAyYfyeS1KopmJ8EVY5g1YswlIqCS615mM_B_rM,70
|
3
3
|
janito/config.py,sha256=HJh0CmZEx7AbMQOmFkiYHFNzc-fO7fqpZ9rh6RenxK8,201
|
4
4
|
janito/config_manager.py,sha256=bbviXlbrSyQSVsYjcNo--ZLr_jFuAVL6ntuuWrvHbjs,4297
|
@@ -16,7 +16,7 @@ janito/provider_config.py,sha256=dzYvxWg3Smjt9Jbkw0CNdXmBMwSTgoFTOAajdPL2w5w,304
|
|
16
16
|
janito/provider_registry.py,sha256=Heg6Kq59ObBLcTHvQc8VrTn6I0glzRmELjdsT5Y69mk,6411
|
17
17
|
janito/report_events.py,sha256=q4OR_jTZNfcqaQF_fzTjgqo6_VlUIxSGWfhpT4nJWcw,938
|
18
18
|
janito/utils.py,sha256=eXSsMgM69YyzahgCNrJQLcEbB8ssLI1MQqaa20ONxbE,376
|
19
|
-
janito/version.py,sha256=
|
19
|
+
janito/version.py,sha256=N70_J7dPtgmHMvQB8geb1wT5TOwdt0lURaxMFId72uM,108
|
20
20
|
janito/agent/setup_agent.py,sha256=4TdZeutRKsjjWx5qIqEId4VY1rUUXED8XiWKdY1n4ac,4940
|
21
21
|
janito/agent/templates/profiles/system_prompt_template_base_pt.txt.j2,sha256=FX8piXbR9XNOEKkOSMt4ieZ2wn5fzQlffeQFf8d7gIc,723
|
22
22
|
janito/agent/templates/profiles/system_prompt_template_main.txt.j2,sha256=1MRFx_NRXAoBWFq_2c-CXGUCuWwmlGGcnbdpWv9x0pQ,2497
|
@@ -131,7 +131,7 @@ janito/tools/tool_utils.py,sha256=57nfiq0XKTxzSy7ZqgmR_ItMt0-Ri3sENQzCiLWDR_M,13
|
|
131
131
|
janito/tools/tools_adapter.py,sha256=5UXiL0F1oADFDaV2UQRviMYpylfZPl8AKrGVW0RkdAw,8410
|
132
132
|
janito/tools/tools_schema.py,sha256=rGrKrmpPNR07VXHAJ_haGBRRO-YGLOF51BlYRep9AAQ,4415
|
133
133
|
janito/tools/adapters/__init__.py,sha256=XKixOKtUJs1R-rGwGDXSLVLg5-Kp090gvWbsseWT4LI,92
|
134
|
-
janito/tools/adapters/local/__init__.py,sha256=
|
134
|
+
janito/tools/adapters/local/__init__.py,sha256=3S-boSbyG1BG-pbSvarUA9ItlkVI2bfUAKGJoIB4UDY,1850
|
135
135
|
janito/tools/adapters/local/adapter.py,sha256=O7xWMeLrPzjPk4j-06EMKZWRVuiubl8Buyz7NmLh_xc,3434
|
136
136
|
janito/tools/adapters/local/ask_user.py,sha256=ZX4MD-Tgz8FDVZBvFYOKzJaQ2s5xejteE-JNcy8UlsE,3894
|
137
137
|
janito/tools/adapters/local/copy_file.py,sha256=wNr6mQBxYxGMGZFJmDnWXm5ogJ8iskpA6izBJH4cQvk,3507
|
@@ -141,7 +141,7 @@ janito/tools/adapters/local/delete_text_in_file.py,sha256=ZPCBMDPHlxi5eUuILyAJQ1
|
|
141
141
|
janito/tools/adapters/local/fetch_url.py,sha256=b5eRFRTG2L5rVIQAGXrPNm4j0kSUszhuG9pRVwnl_L0,3806
|
142
142
|
janito/tools/adapters/local/find_files.py,sha256=5_7YxzxPWigNEvIG9kKwzaPB1n-Gt0TkWEHY3ynJUd4,6137
|
143
143
|
janito/tools/adapters/local/move_file.py,sha256=_Pn34fYbRq7Ax2kSv0LeTHKRn0LnNScxaM7jA_QTjR8,5213
|
144
|
-
janito/tools/adapters/local/open_html_in_browser.py,sha256=
|
144
|
+
janito/tools/adapters/local/open_html_in_browser.py,sha256=uQ_RtxpmHid0AHLGmSoSl3nsgEczx-SbiZEHFH-NRi0,1775
|
145
145
|
janito/tools/adapters/local/open_url.py,sha256=gzueNkGLNWikWzbB32X4VQUGyBq31xuZ11t-qKioHAk,1221
|
146
146
|
janito/tools/adapters/local/python_code_run.py,sha256=sUKZcXcdNyGD9XL5Ydk3q_Mu7uf7MRTLYtrnuQqhwi0,6616
|
147
147
|
janito/tools/adapters/local/python_command_run.py,sha256=PgPa68GQMbwfiH2Lxg1bXOiFJDtXi1bbKT7c9gIAYxc,6556
|
@@ -174,8 +174,8 @@ janito/tools/adapters/local/validate_file_syntax/ps1_validator.py,sha256=cP1jsMh
|
|
174
174
|
janito/tools/adapters/local/validate_file_syntax/python_validator.py,sha256=lHzjlA4g9nCF9hXkGx3izWF0b0vJH3yV7Pu3buLyBbI,140
|
175
175
|
janito/tools/adapters/local/validate_file_syntax/xml_validator.py,sha256=3CK7BEGO7gKI3bpeTtCFe0kJ5aKDZVh3Kh67bGIhcuc,294
|
176
176
|
janito/tools/adapters/local/validate_file_syntax/yaml_validator.py,sha256=XLmOp7Ef6pLd97ICVnF3PxNKL1Yo5tLZsasvxPY478Y,165
|
177
|
-
janito-2.0.
|
178
|
-
janito-2.0.
|
179
|
-
janito-2.0.
|
180
|
-
janito-2.0.
|
181
|
-
janito-2.0.
|
177
|
+
janito-2.1.0.dist-info/METADATA,sha256=9CnyvyK4lWbuVX1ZyQtWO-qnLkxx410Fq9CwhL6zA5M,10494
|
178
|
+
janito-2.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
179
|
+
janito-2.1.0.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
|
180
|
+
janito-2.1.0.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
|
181
|
+
janito-2.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|