janito 2.0.0__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/get_file_outline/core.py +2 -2
- janito/tools/adapters/local/open_html_in_browser.py +43 -0
- janito/version.py +1 -1
- {janito-2.0.0.dist-info → janito-2.1.0.dist-info}/METADATA +1 -1
- {janito-2.0.0.dist-info → janito-2.1.0.dist-info}/RECORD +10 -9
- {janito-2.0.0.dist-info → janito-2.1.0.dist-info}/WHEEL +0 -0
- {janito-2.0.0.dist-info → janito-2.1.0.dist-info}/entry_points.txt +0 -0
- {janito-2.0.0.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
|
+
|
@@ -88,7 +88,7 @@ class GetFileOutlineTool(ToolBase):
|
|
88
88
|
except Exception as e:
|
89
89
|
self.report_error(
|
90
90
|
tr("❌ Error reading file: {error}", error=e),
|
91
|
-
ReportAction.
|
91
|
+
ReportAction.READ,
|
92
92
|
)
|
93
93
|
return tr("Error reading file: {error}", error=e)
|
94
94
|
|
@@ -146,6 +146,6 @@ class GetFileOutlineTool(ToolBase):
|
|
146
146
|
except Exception as e:
|
147
147
|
self.report_error(
|
148
148
|
tr("❌ Error reading file: {error}", error=e),
|
149
|
-
ReportAction.
|
149
|
+
ReportAction.READ,
|
150
150
|
)
|
151
151
|
return tr("Error reading file: {error}", error=e)
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from janito.tools.tool_base import ToolBase
|
2
|
+
from janito.tools.adapters.local.adapter import register_local_tool
|
3
|
+
from janito.report_events import ReportAction
|
4
|
+
import webbrowser
|
5
|
+
import os
|
6
|
+
|
7
|
+
@register_local_tool
|
8
|
+
class OpenHtmlInBrowserTool(ToolBase):
|
9
|
+
"""
|
10
|
+
Opens an HTML file in the default web browser.
|
11
|
+
|
12
|
+
Args:
|
13
|
+
file_path (str): The path to the HTML file to open.
|
14
|
+
|
15
|
+
Returns:
|
16
|
+
str: Status message indicating the result. Example:
|
17
|
+
- "✅ Successfully opened the file in the default browser."
|
18
|
+
- "⚠️ Error: The specified file does not exist."
|
19
|
+
- "⚠️ Error: The specified file is not an HTML file."
|
20
|
+
"""
|
21
|
+
|
22
|
+
tool_name = "open_html_in_browser"
|
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
|
+
|
29
|
+
if not os.path.exists(file_path):
|
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
|
+
|
33
|
+
if not file_path.lower().endswith('.html'):
|
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
|
+
|
37
|
+
try:
|
38
|
+
webbrowser.open(f"file://{os.path.abspath(file_path)}")
|
39
|
+
self.report_success(tr("✅ Ok"))
|
40
|
+
return "✅ Ok"
|
41
|
+
except Exception as e:
|
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,6 +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=uQ_RtxpmHid0AHLGmSoSl3nsgEczx-SbiZEHFH-NRi0,1775
|
144
145
|
janito/tools/adapters/local/open_url.py,sha256=gzueNkGLNWikWzbB32X4VQUGyBq31xuZ11t-qKioHAk,1221
|
145
146
|
janito/tools/adapters/local/python_code_run.py,sha256=sUKZcXcdNyGD9XL5Ydk3q_Mu7uf7MRTLYtrnuQqhwi0,6616
|
146
147
|
janito/tools/adapters/local/python_command_run.py,sha256=PgPa68GQMbwfiH2Lxg1bXOiFJDtXi1bbKT7c9gIAYxc,6556
|
@@ -152,7 +153,7 @@ janito/tools/adapters/local/run_bash_command.py,sha256=mfYeZMlvEIdPVQaeGeeMc7gBM
|
|
152
153
|
janito/tools/adapters/local/run_powershell_command.py,sha256=Gaz--9vkKfST09fiMNuWhdZvD2-wd-GDqhxVudec8IM,9229
|
153
154
|
janito/tools/adapters/local/view_file.py,sha256=MzGUjnOM-eMBANisAkNSvANn2UpA-GDqlE96KuCOkC4,7134
|
154
155
|
janito/tools/adapters/local/get_file_outline/__init__.py,sha256=OKV_BHnoD9h-vkcVoW6AHmsuDjjauHPCKNK0nVFl4sU,37
|
155
|
-
janito/tools/adapters/local/get_file_outline/core.py,sha256=
|
156
|
+
janito/tools/adapters/local/get_file_outline/core.py,sha256=9fhPok7uMKz38pUHDDdza7pySXdtGvM-4MS5hKk_boU,6013
|
156
157
|
janito/tools/adapters/local/get_file_outline/markdown_outline.py,sha256=bXEBg0D93tEBDNy8t-wh4i7WxsxfpQ2C3dX1_rmtj08,434
|
157
158
|
janito/tools/adapters/local/get_file_outline/python_outline.py,sha256=RAcf9Vxec08lA06drYaNre5HCJ2lTzrRAskZ3rlyE-U,10326
|
158
159
|
janito/tools/adapters/local/get_file_outline/python_outline_v2.py,sha256=OOHKDGbOwxiCtr3i5m5ZAnELvoF12fKdzO2RCDuTsCs,5453
|
@@ -173,8 +174,8 @@ janito/tools/adapters/local/validate_file_syntax/ps1_validator.py,sha256=cP1jsMh
|
|
173
174
|
janito/tools/adapters/local/validate_file_syntax/python_validator.py,sha256=lHzjlA4g9nCF9hXkGx3izWF0b0vJH3yV7Pu3buLyBbI,140
|
174
175
|
janito/tools/adapters/local/validate_file_syntax/xml_validator.py,sha256=3CK7BEGO7gKI3bpeTtCFe0kJ5aKDZVh3Kh67bGIhcuc,294
|
175
176
|
janito/tools/adapters/local/validate_file_syntax/yaml_validator.py,sha256=XLmOp7Ef6pLd97ICVnF3PxNKL1Yo5tLZsasvxPY478Y,165
|
176
|
-
janito-2.
|
177
|
-
janito-2.
|
178
|
-
janito-2.
|
179
|
-
janito-2.
|
180
|
-
janito-2.
|
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
|