janito 3.7.0__py3-none-any.whl → 3.9.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/README.md +1 -1
- janito/cli/cli_commands/list_tools.py +1 -1
- janito/cli/prompt_core.py +48 -3
- janito/cli/rich_terminal_reporter.py +10 -2
- janito/docs/GETTING_STARTED.md +1 -1
- janito/llm/agent.py +6 -0
- janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/core.py +7 -2
- janito/plugins/core/filemanager/tools/validate_file_syntax/txt_validator.py +28 -0
- janito/plugins/manager.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/adapter.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/ask_user.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/copy_file.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/create_directory.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/create_file.py +10 -6
- janito/{tools/adapters → plugins/tools}/local/delete_text_in_file.py +2 -2
- janito/{tools/adapters → plugins/tools}/local/fetch_url.py +3 -3
- janito/{tools/adapters → plugins/tools}/local/find_files.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/get_file_outline/core.py +2 -2
- janito/{tools/adapters → plugins/tools}/local/move_file.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/open_html_in_browser.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/open_url.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/python_code_run.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/python_command_run.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/python_file_run.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/read_chart.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/read_files.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/remove_directory.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/remove_file.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/replace_text_in_file.py +2 -2
- janito/{tools/adapters → plugins/tools}/local/run_bash_command.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/run_powershell_command.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/search_text/core.py +2 -2
- janito/{tools/adapters → plugins/tools}/local/show_image.py +1 -1
- janito/{tools/adapters → plugins/tools}/local/show_image_grid.py +1 -1
- janito/plugins/tools/local/validate_file_syntax/__init__.py +1 -0
- janito/plugins/tools/local/validate_file_syntax/core.py +119 -0
- janito/plugins/tools/local/validate_file_syntax/txt_validator.py +28 -0
- janito/{tools/adapters → plugins/tools}/local/view_file.py +1 -1
- janito/providers/alibaba/model_info.py +10 -0
- janito/providers/alibaba/provider.py +1 -3
- janito/providers/moonshot/model_info.py +8 -8
- janito/providers/moonshot/provider.py +1 -1
- janito/tools/__init__.py +2 -2
- janito/tools/inspect_registry.py +1 -1
- janito/tools/tool_base.py +8 -1
- {janito-3.7.0.dist-info → janito-3.9.0.dist-info}/METADATA +14 -14
- {janito-3.7.0.dist-info → janito-3.9.0.dist-info}/RECORD +73 -69
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/__init__.py +0 -0
- /janito/{tools/adapters → plugins/tools}/__init__.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/__init__.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/get_file_outline/__init__.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/get_file_outline/java_outline.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/get_file_outline/markdown_outline.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/get_file_outline/python_outline.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/get_file_outline/search_outline.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/search_text/__init__.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/search_text/match_lines.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/search_text/pattern_utils.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/search_text/traverse_directory.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/css_validator.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/html_validator.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/jinja2_validator.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/js_validator.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/json_validator.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/markdown_validator.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/ps1_validator.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/python_validator.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/xml_validator.py +0 -0
- /janito/{tools/adapters → plugins/tools}/local/validate_file_syntax/yaml_validator.py +0 -0
- {janito-3.7.0.dist-info → janito-3.9.0.dist-info}/WHEEL +0 -0
- {janito-3.7.0.dist-info → janito-3.9.0.dist-info}/entry_points.txt +0 -0
- {janito-3.7.0.dist-info → janito-3.9.0.dist-info}/licenses/LICENSE +0 -0
- {janito-3.7.0.dist-info → janito-3.9.0.dist-info}/top_level.txt +0 -0
janito/README.md
CHANGED
@@ -79,7 +79,7 @@ janito --set model=kimi-k1-8k
|
|
79
79
|
|
80
80
|
### Moonshot (Recommended)
|
81
81
|
|
82
|
-
- **Models**: kimi-k1-8k, kimi-k1-32k, kimi-k1-128k, kimi-k2-turbo-preview
|
82
|
+
- **Models**: kimi-k1-8k, kimi-k1-32k, kimi-k1-128k, kimi-k2-turbo-preview
|
83
83
|
- **Strengths**: Excellent Chinese/English support, competitive pricing, fast responses
|
84
84
|
- **Setup**: Get API key from [Moonshot AI Platform](https://platform.moonshot.cn/)
|
85
85
|
|
@@ -53,7 +53,7 @@ def _print_tools_table(console, title, tools_info):
|
|
53
53
|
|
54
54
|
|
55
55
|
def handle_list_tools(args=None):
|
56
|
-
from janito.tools.
|
56
|
+
from janito.plugins.tools.local.adapter import LocalToolsAdapter
|
57
57
|
import janito.tools # Ensure all tools are registered
|
58
58
|
from janito.tools.tool_base import ToolPermissions
|
59
59
|
|
janito/cli/prompt_core.py
CHANGED
@@ -14,7 +14,7 @@ from janito.driver_events import (
|
|
14
14
|
RequestStatus,
|
15
15
|
RateLimitRetry,
|
16
16
|
)
|
17
|
-
from janito.tools.tool_events import ToolCallError
|
17
|
+
from janito.tools.tool_events import ToolCallError, ToolCallStarted
|
18
18
|
import threading
|
19
19
|
from janito.cli.verbose_output import print_verbose_header
|
20
20
|
from janito.event_bus import event_bus as global_event_bus
|
@@ -52,8 +52,10 @@ class PromptHandler:
|
|
52
52
|
def _handle_inner_event(self, inner_event, on_event, status):
|
53
53
|
if on_event:
|
54
54
|
on_event(inner_event)
|
55
|
-
from janito.tools.tool_events import ToolCallFinished
|
55
|
+
from janito.tools.tool_events import ToolCallFinished, ToolCallStarted
|
56
56
|
|
57
|
+
if isinstance(inner_event, ToolCallStarted):
|
58
|
+
return self._handle_tool_call_started(inner_event, status)
|
57
59
|
if isinstance(inner_event, ToolCallFinished):
|
58
60
|
return self._handle_tool_call_finished(inner_event)
|
59
61
|
if isinstance(inner_event, RateLimitRetry):
|
@@ -76,6 +78,14 @@ class PromptHandler:
|
|
76
78
|
)
|
77
79
|
return None
|
78
80
|
|
81
|
+
def _handle_tool_call_started(self, inner_event, status):
|
82
|
+
"""Handle ToolCallStarted event - pause the timer when ask_user tool is called."""
|
83
|
+
if hasattr(inner_event, 'tool_name') and inner_event.tool_name == 'ask_user':
|
84
|
+
# Pause the status timer by clearing the status
|
85
|
+
if status:
|
86
|
+
status.update("")
|
87
|
+
return None
|
88
|
+
|
79
89
|
def _handle_tool_call_finished(self, inner_event):
|
80
90
|
if hasattr(self.args, "verbose_tools") and self.args.verbose_tools:
|
81
91
|
self.console.print(
|
@@ -207,7 +217,42 @@ class PromptHandler:
|
|
207
217
|
"""
|
208
218
|
try:
|
209
219
|
self._print_verbose_debug("Calling agent.chat()...")
|
210
|
-
|
220
|
+
|
221
|
+
# Show waiting status with elapsed time
|
222
|
+
start_time = time.time()
|
223
|
+
|
224
|
+
# Get provider and model info for status display
|
225
|
+
provider_name = self.agent.get_provider_name() if hasattr(self.agent, 'get_provider_name') else 'LLM'
|
226
|
+
model_name = self.agent.get_model_name() if hasattr(self.agent, 'get_model_name') else 'unknown'
|
227
|
+
|
228
|
+
status = Status(f"[bold blue]Waiting for {provider_name} (model: {model_name})...[/bold blue]")
|
229
|
+
|
230
|
+
# Thread coordination event
|
231
|
+
stop_updater = threading.Event()
|
232
|
+
|
233
|
+
def update_status():
|
234
|
+
elapsed = time.time() - start_time
|
235
|
+
status.update(f"[bold blue]Waiting for {provider_name} (model: {model_name})... ({elapsed:.1f}s)[/bold blue]")
|
236
|
+
|
237
|
+
# Start status display and update timer
|
238
|
+
with status:
|
239
|
+
# Update status every second in a separate thread
|
240
|
+
def status_updater():
|
241
|
+
while not stop_updater.is_set():
|
242
|
+
update_status()
|
243
|
+
stop_updater.wait(1.0) # Wait for 1 second or until stopped
|
244
|
+
|
245
|
+
updater_thread = threading.Thread(target=status_updater, daemon=True)
|
246
|
+
updater_thread.start()
|
247
|
+
|
248
|
+
try:
|
249
|
+
final_event = self.agent.chat(prompt=user_prompt)
|
250
|
+
finally:
|
251
|
+
# Signal the updater thread to stop
|
252
|
+
stop_updater.set()
|
253
|
+
# Wait a bit for the thread to clean up
|
254
|
+
updater_thread.join(timeout=0.1)
|
255
|
+
|
211
256
|
if hasattr(self.agent, "set_latest_event"):
|
212
257
|
self.agent.set_latest_event(final_event)
|
213
258
|
self.agent.last_event = final_event
|
@@ -74,8 +74,16 @@ class RichTerminalReporter(EventHandlerBase):
|
|
74
74
|
"""
|
75
75
|
Clears the entire current line in the terminal and returns the cursor to column 1.
|
76
76
|
"""
|
77
|
-
|
78
|
-
|
77
|
+
# Use raw ANSI escape sequences but write directly to the underlying file
|
78
|
+
# to bypass Rich's escaping/interpretation
|
79
|
+
if hasattr(self.console, 'file') and hasattr(self.console.file, 'write'):
|
80
|
+
self.console.file.write("\r\033[2K")
|
81
|
+
self.console.file.flush()
|
82
|
+
else:
|
83
|
+
# Fallback to sys.stdout if console.file is not available
|
84
|
+
import sys
|
85
|
+
sys.stdout.write("\r\033[2K")
|
86
|
+
sys.stdout.flush()
|
79
87
|
|
80
88
|
def on_RequestFinished(self, event):
|
81
89
|
self.delete_current_line()
|
janito/docs/GETTING_STARTED.md
CHANGED
@@ -124,7 +124,7 @@ export JANITO_MODEL=ibm/granite-3-3-8b-instruct
|
|
124
124
|
- **kimi-k1-32k**: Better for longer contexts
|
125
125
|
- **kimi-k1-128k**: Best for very long documents
|
126
126
|
- **kimi-k2-turbo-preview**: Latest model with enhanced capabilities
|
127
|
-
- **kimi-k2-
|
127
|
+
- **kimi-k2-turbo-preview**: Turbo version of the advanced reasoning model
|
128
128
|
|
129
129
|
### OpenAI Models
|
130
130
|
- **gpt-5**: Latest GPT model with advanced capabilities
|
janito/llm/agent.py
CHANGED
@@ -183,6 +183,9 @@ class LLMAgent:
|
|
183
183
|
elapsed = 0.0
|
184
184
|
if getattr(self, "verbose_agent", False):
|
185
185
|
print("[agent] [DEBUG] Waiting for event from output_queue...")
|
186
|
+
# Show initial wait message
|
187
|
+
if getattr(self, "verbose_agent", False):
|
188
|
+
print(f"[agent] [DEBUG] Starting to wait for LLM response... (timeout: {max_wait_time}s)")
|
186
189
|
# Let KeyboardInterrupt propagate to caller
|
187
190
|
return self._poll_for_event(poll_timeout, max_wait_time)
|
188
191
|
|
@@ -197,6 +200,9 @@ class LLMAgent:
|
|
197
200
|
print(error_msg)
|
198
201
|
print("[DEBUG] Exiting _process_next_response due to timeout")
|
199
202
|
return None, False
|
203
|
+
# Show elapsed time info while waiting
|
204
|
+
if getattr(self, "verbose_agent", False):
|
205
|
+
print(f"[agent] [DEBUG] Waiting for LLM response... ({elapsed:.1f}s elapsed)")
|
200
206
|
continue
|
201
207
|
if getattr(self, "verbose_agent", False):
|
202
208
|
print(f"[agent] [DEBUG] Received event from output_queue: {event}")
|
@@ -3,9 +3,9 @@ from janito.tools.path_utils import expand_path
|
|
3
3
|
from janito.i18n import tr
|
4
4
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
5
5
|
from janito.report_events import ReportAction
|
6
|
-
from janito.tools.
|
6
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
7
7
|
from janito.tools.tool_utils import display_path
|
8
|
-
from janito.tools.
|
8
|
+
from janito.plugins.tools.local.adapter import register_local_tool as register_tool
|
9
9
|
|
10
10
|
from .python_validator import validate_python
|
11
11
|
from .json_validator import validate_json
|
@@ -17,6 +17,7 @@ from .markdown_validator import validate_markdown
|
|
17
17
|
from .js_validator import validate_js
|
18
18
|
from .css_validator import validate_css
|
19
19
|
from .jinja2_validator import validate_jinja2
|
20
|
+
from .txt_validator import validate_txt
|
20
21
|
from janito.tools.loop_protection_decorator import protect_against_loops
|
21
22
|
|
22
23
|
|
@@ -37,6 +38,8 @@ def _get_validator(ext):
|
|
37
38
|
".css": validate_css,
|
38
39
|
".j2": validate_jinja2,
|
39
40
|
".jinja2": validate_jinja2,
|
41
|
+
".txt": validate_txt,
|
42
|
+
".text": validate_txt,
|
40
43
|
}
|
41
44
|
return mapping.get(ext)
|
42
45
|
|
@@ -79,6 +82,7 @@ class ValidateFileSyntaxTool(ToolBase):
|
|
79
82
|
- Markdown (.md)
|
80
83
|
- JavaScript (.js)
|
81
84
|
- Jinja2 templates (.j2, .jinja2)
|
85
|
+
- Text files (.txt, .text) [UTF-8 validation]
|
82
86
|
|
83
87
|
Args:
|
84
88
|
path (str): Path to the file to validate.
|
@@ -86,6 +90,7 @@ class ValidateFileSyntaxTool(ToolBase):
|
|
86
90
|
str: Validation status message. Example:
|
87
91
|
- "✅ Syntax OK"
|
88
92
|
- "⚠️ Warning: Syntax error: <error message>"
|
93
|
+
- "⚠️ Warning: UTF-8 decoding error: <error details>"
|
89
94
|
- "⚠️ Warning: Unsupported file extension: <ext>"
|
90
95
|
"""
|
91
96
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"""Text file validator for UTF-8 encoding validation."""
|
2
|
+
|
3
|
+
import codecs
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
|
7
|
+
def validate_txt(path: str) -> str:
|
8
|
+
"""
|
9
|
+
Validate a text file for UTF-8 encoding issues.
|
10
|
+
|
11
|
+
Args:
|
12
|
+
path (str): Path to the text file to validate
|
13
|
+
|
14
|
+
Returns:
|
15
|
+
str: Validation status message
|
16
|
+
- "✅ Syntax OK" if file is valid UTF-8
|
17
|
+
- "⚠️ Warning: UTF-8 decoding error: <error details>" if invalid
|
18
|
+
"""
|
19
|
+
try:
|
20
|
+
# Try to read the file with UTF-8 encoding
|
21
|
+
with codecs.open(path, 'r', encoding='utf-8') as f:
|
22
|
+
# Read the entire file to trigger any decoding errors
|
23
|
+
f.read()
|
24
|
+
return "✅ Syntax OK"
|
25
|
+
except UnicodeDecodeError as e:
|
26
|
+
return f"⚠️ Warning: UTF-8 decoding error: {e}"
|
27
|
+
except Exception as e:
|
28
|
+
return f"⚠️ Warning: File read error: {e}"
|
janito/plugins/manager.py
CHANGED
@@ -14,7 +14,7 @@ from .base import Plugin, PluginMetadata
|
|
14
14
|
from .discovery import discover_plugins
|
15
15
|
from .config import load_plugins_config, get_user_plugins_dir
|
16
16
|
from .builtin import BuiltinPluginRegistry, load_builtin_plugin
|
17
|
-
from janito.tools.
|
17
|
+
from janito.plugins.tools.local import LocalToolsAdapter
|
18
18
|
|
19
19
|
logger = logging.getLogger(__name__)
|
20
20
|
|
@@ -207,7 +207,7 @@ def register_local_tool(tool=None):
|
|
207
207
|
# Register the tool on a *fresh* adapter instance to avoid circular
|
208
208
|
# import issues during package initialisation. This keeps behaviour
|
209
209
|
# identical to the original implementation while still allowing
|
210
|
-
# immediate use via the singleton in janito.tools.
|
210
|
+
# immediate use via the singleton in janito.plugins.tools.local.
|
211
211
|
LocalToolsAdapter().register_tool(cls)
|
212
212
|
return cls
|
213
213
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
|
-
from janito.tools.
|
2
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
3
3
|
from janito.tools.loop_protection_decorator import protect_against_loops
|
4
4
|
|
5
5
|
from rich import print as rich_print
|
@@ -2,7 +2,7 @@ import os
|
|
2
2
|
from janito.tools.path_utils import expand_path
|
3
3
|
import shutil
|
4
4
|
from typing import List, Union
|
5
|
-
from janito.tools.
|
5
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
6
6
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
7
7
|
from janito.tools.tool_utils import display_path
|
8
8
|
from janito.report_events import ReportAction
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import os
|
2
2
|
from janito.tools.path_utils import expand_path
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
|
5
5
|
from janito.tools.tool_utils import display_path
|
6
6
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
@@ -8,7 +8,7 @@ from janito.report_events import ReportAction
|
|
8
8
|
from janito.i18n import tr
|
9
9
|
from janito.tools.loop_protection_decorator import protect_against_loops
|
10
10
|
|
11
|
-
from janito.tools.
|
11
|
+
from janito.plugins.tools.local.validate_file_syntax.core import validate_file_syntax
|
12
12
|
|
13
13
|
|
14
14
|
@register_local_tool
|
@@ -30,12 +30,12 @@ class CreateFileTool(ToolBase):
|
|
30
30
|
- Cross-platform path handling (Windows, macOS, Linux)
|
31
31
|
|
32
32
|
Args:
|
33
|
-
path (str): Target file path. Supports relative and absolute paths, with automatic
|
33
|
+
path (str, required): Target file path. Supports relative and absolute paths, with automatic
|
34
34
|
expansion of user home directory (~) and environment variables.
|
35
35
|
Examples: "src/main.py", "~/Documents/config.json", "$HOME/.env"
|
36
|
-
content (str): File content to write. Empty string creates empty file.
|
36
|
+
content (str, optional): File content to write. Empty string creates empty file.
|
37
37
|
Supports any text content including Unicode characters, newlines,
|
38
|
-
and binary-safe text representation.
|
38
|
+
and binary-safe text representation. Default: "" (empty file)
|
39
39
|
overwrite (bool, optional): If True, allows overwriting existing files. Default: False.
|
40
40
|
When False, prevents accidental overwrites by checking
|
41
41
|
file existence and showing current content. Always review
|
@@ -71,6 +71,10 @@ class CreateFileTool(ToolBase):
|
|
71
71
|
✅ Created file 2 lines.
|
72
72
|
✅ Syntax OK
|
73
73
|
|
74
|
+
Creating empty file:
|
75
|
+
>>> create_file("empty.txt", "")
|
76
|
+
✅ Created file 0 lines.
|
77
|
+
|
74
78
|
Overwrite protection:
|
75
79
|
>>> create_file("existing.txt", "new content")
|
76
80
|
❗ Cannot create file: file already exists at 'existing.txt'.
|
@@ -85,7 +89,7 @@ class CreateFileTool(ToolBase):
|
|
85
89
|
tool_name = "create_file"
|
86
90
|
|
87
91
|
@protect_against_loops(max_calls=5, time_window=10.0, key_field="path")
|
88
|
-
def run(self, path: str, content: str, overwrite: bool = False) -> str:
|
92
|
+
def run(self, path: str, content: str = "", overwrite: bool = False) -> str:
|
89
93
|
path = expand_path(path)
|
90
94
|
disp_path = display_path(path)
|
91
95
|
if os.path.exists(path) and not overwrite:
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.i18n import tr
|
5
5
|
import shutil
|
6
|
-
from janito.tools.
|
6
|
+
from janito.plugins.tools.local.validate_file_syntax.core import validate_file_syntax
|
7
7
|
|
8
8
|
|
9
9
|
@register_local_tool
|
@@ -5,7 +5,7 @@ import json
|
|
5
5
|
from pathlib import Path
|
6
6
|
from bs4 import BeautifulSoup
|
7
7
|
from typing import Dict, Any, Optional
|
8
|
-
from janito.tools.
|
8
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
9
9
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
10
10
|
from janito.report_events import ReportAction
|
11
11
|
from janito.i18n import tr
|
@@ -33,7 +33,7 @@ class FetchUrlTool(ToolBase):
|
|
33
33
|
|
34
34
|
**Error Cache Behavior:**
|
35
35
|
- HTTP 403 errors: Cached for 24 hours (more permanent)
|
36
|
-
- HTTP 404 errors: Cached for 1 hour (
|
36
|
+
- HTTP 404 errors: Cached for 1 hour (shorter duration)
|
37
37
|
- Other 4xx errors: Cached for 30 minutes
|
38
38
|
- 5xx errors: Not cached (retried on each request)
|
39
39
|
|
@@ -151,7 +151,7 @@ class FetchUrlTool(ToolBase):
|
|
151
151
|
# Cache 403 errors for 24 hours (more permanent)
|
152
152
|
expiration_time = 24 * 3600
|
153
153
|
elif entry["status_code"] == 404:
|
154
|
-
# Cache 404 errors for 1 hour (
|
154
|
+
# Cache 404 errors for 1 hour (shorter duration)
|
155
155
|
expiration_time = 3600
|
156
156
|
else:
|
157
157
|
# Cache other 4xx errors for 30 minutes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.tools.tool_utils import pluralize, display_path
|
5
5
|
from janito.dir_walk_utils import walk_dir_with_gitignore
|
6
6
|
from janito.i18n import tr
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from janito.tools.
|
1
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
2
2
|
from .python_outline import parse_python_outline
|
3
3
|
from .markdown_outline import parse_markdown_outline
|
4
4
|
from janito.formatting import OutlineFormatter
|
@@ -10,7 +10,7 @@ from janito.report_events import ReportAction
|
|
10
10
|
from janito.tools.tool_utils import display_path, pluralize
|
11
11
|
from janito.i18n import tr
|
12
12
|
|
13
|
-
from janito.tools.
|
13
|
+
from janito.plugins.tools.local.adapter import register_local_tool as register_tool
|
14
14
|
from janito.tools.loop_protection_decorator import protect_against_loops
|
15
15
|
|
16
16
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import os
|
2
2
|
from janito.tools.path_utils import expand_path
|
3
3
|
import shutil
|
4
|
-
from janito.tools.
|
4
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
5
5
|
from janito.tools.tool_utils import display_path
|
6
6
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
7
7
|
from janito.report_events import ReportAction
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import os
|
2
2
|
import webbrowser
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
5
5
|
from janito.report_events import ReportAction
|
6
6
|
from janito.i18n import tr
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import webbrowser
|
2
|
-
from janito.tools.
|
2
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
3
3
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
4
4
|
from janito.report_events import ReportAction
|
5
5
|
from janito.i18n import tr
|
@@ -5,7 +5,7 @@ import tempfile
|
|
5
5
|
import threading
|
6
6
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
7
7
|
from janito.report_events import ReportAction
|
8
|
-
from janito.tools.
|
8
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
9
9
|
from janito.i18n import tr
|
10
10
|
|
11
11
|
|
@@ -5,7 +5,7 @@ import tempfile
|
|
5
5
|
import threading
|
6
6
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
7
7
|
from janito.report_events import ReportAction
|
8
|
-
from janito.tools.
|
8
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
9
9
|
from janito.i18n import tr
|
10
10
|
|
11
11
|
|
@@ -5,7 +5,7 @@ import tempfile
|
|
5
5
|
import threading
|
6
6
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
7
7
|
from janito.report_events import ReportAction
|
8
|
-
from janito.tools.
|
8
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
9
9
|
from janito.i18n import tr
|
10
10
|
|
11
11
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.tools.tool_utils import display_path
|
5
5
|
from janito.i18n import tr
|
6
6
|
import json
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.tools.tool_utils import pluralize
|
5
5
|
from janito.i18n import tr
|
6
6
|
from janito.tools.loop_protection_decorator import protect_against_loops
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.tools.tool_utils import pluralize, display_path
|
5
5
|
from janito.i18n import tr
|
6
6
|
import shutil
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import os
|
2
2
|
from janito.tools.path_utils import expand_path
|
3
3
|
import shutil
|
4
|
-
from janito.tools.
|
4
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
5
5
|
|
6
6
|
from janito.tools.tool_utils import display_path
|
7
7
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
@@ -1,10 +1,10 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.i18n import tr
|
5
5
|
import shutil
|
6
6
|
import re
|
7
|
-
from janito.tools.
|
7
|
+
from janito.plugins.tools.local.validate_file_syntax.core import validate_file_syntax
|
8
8
|
|
9
9
|
|
10
10
|
@register_local_tool
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.i18n import tr
|
5
5
|
import subprocess
|
6
6
|
import tempfile
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.i18n import tr
|
5
5
|
import subprocess
|
6
6
|
import os
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.tools.tool_utils import pluralize, display_path
|
5
5
|
from janito.i18n import tr
|
6
6
|
import os
|
@@ -11,7 +11,7 @@ from .traverse_directory import traverse_directory
|
|
11
11
|
from janito.tools.loop_protection_decorator import protect_against_loops
|
12
12
|
|
13
13
|
|
14
|
-
from janito.tools.
|
14
|
+
from janito.plugins.tools.local.adapter import register_local_tool as register_tool
|
15
15
|
|
16
16
|
|
17
17
|
@register_tool
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.i18n import tr
|
5
5
|
from janito.tools.loop_protection_decorator import protect_against_loops
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from janito.tools.tool_base import ToolBase, ToolPermissions
|
2
2
|
from janito.report_events import ReportAction
|
3
|
-
from janito.tools.
|
3
|
+
from janito.plugins.tools.local.adapter import register_local_tool
|
4
4
|
from janito.i18n import tr
|
5
5
|
from janito.tools.loop_protection_decorator import protect_against_loops
|
6
6
|
from typing import Sequence
|
@@ -0,0 +1 @@
|
|
1
|
+
# Validation syntax package
|