janito 3.2.0__py3-none-any.whl → 3.4.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 +0 -3
- janito/cli/chat_mode/bindings.py +0 -26
- janito/cli/chat_mode/session.py +1 -12
- janito/cli/chat_mode/shell/commands/security/allowed_sites.py +33 -47
- janito/cli/cli_commands/list_plugins.py +43 -52
- janito/cli/core/getters.py +0 -3
- janito/cli/core/model_guesser.py +24 -40
- janito/cli/main_cli.py +12 -9
- janito/cli/prompt_core.py +9 -20
- janito/drivers/openai/driver.py +0 -1
- janito/drivers/zai/driver.py +0 -1
- janito/hello.txt +0 -0
- janito/i18n/it.py +46 -46
- janito/llm/agent.py +16 -32
- janito/llm/auth_utils.py +5 -14
- janito/llm/driver.py +0 -8
- janito/plugins/__init__.py +12 -31
- janito/plugins/auto_loader.py +11 -12
- janito/plugins/auto_loader_fixed.py +11 -12
- janito/{plugin_system → plugins}/base.py +2 -5
- janito/plugins/builtin.py +1 -15
- janito/plugins/core_adapter.py +11 -89
- janito/plugins/core_loader.py +120 -0
- janito/plugins/core_loader_fixed.py +125 -0
- janito/plugins/discovery.py +5 -5
- janito/plugins/discovery_core.py +9 -14
- janito/plugins/manager.py +1 -1
- janito/providers/__init__.py +0 -1
- janito/tools/__init__.py +7 -31
- janito/tools/adapters/__init__.py +1 -6
- janito/tools/adapters/local/__init__.py +70 -7
- janito/{plugins/tools → tools/adapters/local}/ask_user.py +3 -3
- janito/{plugins/tools → tools/adapters/local}/create_file.py +6 -6
- janito/{plugins/tools → tools/adapters/local}/fetch_url.py +3 -3
- janito/{plugins/tools → tools/adapters/local}/replace_text_in_file.py +4 -4
- janito/{plugins/tools → tools/adapters/local}/show_image.py +6 -15
- janito/{plugins/core/imagedisplay/tools → tools/adapters/local}/show_image_grid.py +5 -13
- janito/tools/function_adapter.py +65 -0
- janito/tools/loop_protection_decorator.py +117 -114
- {janito-3.2.0.dist-info → janito-3.4.0.dist-info}/METADATA +2 -1
- {janito-3.2.0.dist-info → janito-3.4.0.dist-info}/RECORD +85 -156
- janito/cli/cli_commands/check_tools.py +0 -212
- janito/llm/cancellation_manager.py +0 -63
- janito/llm/enter_cancellation.py +0 -107
- janito/plugin_system/__init__.py +0 -10
- janito/plugin_system/core_loader.py +0 -217
- janito/plugin_system/core_loader_fixed.py +0 -225
- janito/plugins/core/__init__.py +0 -7
- janito/plugins/core/codeanalyzer/__init__.py +0 -43
- janito/plugins/core/filemanager/__init__.py +0 -124
- janito/plugins/core/filemanager/tools/create_file.py +0 -87
- janito/plugins/core/filemanager/tools/replace_text_in_file.py +0 -270
- janito/plugins/core/imagedisplay/__init__.py +0 -14
- janito/plugins/core/imagedisplay/plugin.py +0 -51
- janito/plugins/core/imagedisplay/tools/__init__.py +0 -1
- janito/plugins/core/imagedisplay/tools/show_image.py +0 -83
- janito/plugins/core/system/__init__.py +0 -23
- janito/plugins/dev/__init__.py +0 -7
- janito/plugins/dev/pythondev/__init__.py +0 -37
- janito/plugins/dev/visualization/__init__.py +0 -23
- janito/plugins/example_plugin.py +0 -108
- janito/plugins/tools/__init__.py +0 -10
- janito/plugins/tools/copy_file.py +0 -87
- janito/plugins/tools/core_tools_plugin.py +0 -87
- janito/plugins/tools/create_directory.py +0 -70
- janito/plugins/tools/decorators.py +0 -19
- janito/plugins/tools/delete_text_in_file.py +0 -134
- janito/plugins/tools/find_files.py +0 -143
- janito/plugins/tools/get_file_outline/__init__.py +0 -7
- janito/plugins/tools/get_file_outline/core.py +0 -122
- janito/plugins/tools/get_file_outline/java_outline.py +0 -47
- janito/plugins/tools/get_file_outline/markdown_outline.py +0 -14
- janito/plugins/tools/get_file_outline/python_outline.py +0 -303
- janito/plugins/tools/get_file_outline/search_outline.py +0 -36
- janito/plugins/tools/move_file.py +0 -131
- janito/plugins/tools/open_html_in_browser.py +0 -51
- janito/plugins/tools/open_url.py +0 -37
- janito/plugins/tools/python_code_run.py +0 -172
- janito/plugins/tools/python_command_run.py +0 -171
- janito/plugins/tools/python_file_run.py +0 -172
- janito/plugins/tools/read_chart.py +0 -259
- janito/plugins/tools/read_files.py +0 -58
- janito/plugins/tools/remove_directory.py +0 -55
- janito/plugins/tools/remove_file.py +0 -58
- janito/plugins/tools/run_bash_command.py +0 -183
- janito/plugins/tools/run_powershell_command.py +0 -218
- janito/plugins/tools/search_text/__init__.py +0 -7
- janito/plugins/tools/search_text/core.py +0 -205
- janito/plugins/tools/search_text/match_lines.py +0 -67
- janito/plugins/tools/search_text/pattern_utils.py +0 -73
- janito/plugins/tools/search_text/traverse_directory.py +0 -145
- janito/plugins/tools/show_image_grid.py +0 -85
- janito/plugins/tools/validate_file_syntax/__init__.py +0 -7
- janito/plugins/tools/validate_file_syntax/core.py +0 -114
- janito/plugins/tools/validate_file_syntax/css_validator.py +0 -35
- janito/plugins/tools/validate_file_syntax/html_validator.py +0 -100
- janito/plugins/tools/validate_file_syntax/jinja2_validator.py +0 -50
- janito/plugins/tools/validate_file_syntax/js_validator.py +0 -27
- janito/plugins/tools/validate_file_syntax/json_validator.py +0 -6
- janito/plugins/tools/validate_file_syntax/markdown_validator.py +0 -109
- janito/plugins/tools/validate_file_syntax/ps1_validator.py +0 -32
- janito/plugins/tools/validate_file_syntax/python_validator.py +0 -5
- janito/plugins/tools/validate_file_syntax/xml_validator.py +0 -11
- janito/plugins/tools/validate_file_syntax/yaml_validator.py +0 -6
- janito/plugins/tools/view_file.py +0 -172
- janito/plugins/ui/__init__.py +0 -7
- janito/plugins/ui/userinterface/__init__.py +0 -16
- janito/plugins/ui/userinterface/tools/ask_user.py +0 -110
- janito/plugins/web/__init__.py +0 -7
- janito/plugins/web/webtools/__init__.py +0 -33
- janito/plugins/web/webtools/tools/fetch_url.py +0 -458
- janito/providers/together/__init__.py +0 -1
- janito/providers/together/model_info.py +0 -69
- janito/providers/together/provider.py +0 -108
- janito/tools/cli_initializer.py +0 -88
- janito/tools/initialize.py +0 -70
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/copy_file.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/create_directory.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/delete_text_in_file.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/find_files.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/__init__.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/core.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/java_outline.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/markdown_outline.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/python_outline.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/search_outline.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/move_file.py +0 -0
- /janito/{plugins/web/webtools/tools → tools/adapters/local}/open_html_in_browser.py +0 -0
- /janito/{plugins/web/webtools/tools → tools/adapters/local}/open_url.py +0 -0
- /janito/{plugins/dev/pythondev/tools → tools/adapters/local}/python_code_run.py +0 -0
- /janito/{plugins/dev/pythondev/tools → tools/adapters/local}/python_command_run.py +0 -0
- /janito/{plugins/dev/pythondev/tools → tools/adapters/local}/python_file_run.py +0 -0
- /janito/{plugins/dev/visualization/tools → tools/adapters/local}/read_chart.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/read_files.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/remove_directory.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/remove_file.py +0 -0
- /janito/{plugins/core/system/tools → tools/adapters/local}/run_bash_command.py +0 -0
- /janito/{plugins/core/system/tools → tools/adapters/local}/run_powershell_command.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/search_text/__init__.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/search_text/core.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/search_text/match_lines.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/search_text/pattern_utils.py +0 -0
- /janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/search_text/traverse_directory.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/__init__.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/core.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/css_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/html_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/jinja2_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/js_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/json_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/markdown_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/ps1_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/python_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/xml_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/yaml_validator.py +0 -0
- /janito/{plugins/core/filemanager/tools → tools/adapters/local}/view_file.py +0 -0
- {janito-3.2.0.dist-info → janito-3.4.0.dist-info}/WHEEL +0 -0
- {janito-3.2.0.dist-info → janito-3.4.0.dist-info}/entry_points.txt +0 -0
- {janito-3.2.0.dist-info → janito-3.4.0.dist-info}/licenses/LICENSE +0 -0
- {janito-3.2.0.dist-info → janito-3.4.0.dist-info}/top_level.txt +0 -0
janito/tools/cli_initializer.py
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
CLI-specific tool initialization for janito.
|
3
|
-
|
4
|
-
This module provides functions to initialize tools specifically for CLI usage,
|
5
|
-
handling circular imports and ensuring proper registration.
|
6
|
-
"""
|
7
|
-
|
8
|
-
import sys
|
9
|
-
from pathlib import Path
|
10
|
-
from typing import List, Optional
|
11
|
-
|
12
|
-
# Ensure current directory is in path
|
13
|
-
sys.path.insert(0, str(Path.cwd()))
|
14
|
-
|
15
|
-
|
16
|
-
def initialize_cli_tools():
|
17
|
-
"""Initialize tools for CLI usage, avoiding circular imports."""
|
18
|
-
try:
|
19
|
-
from janito.tools.adapters.local.adapter import LocalToolsAdapter
|
20
|
-
from janito.plugin_system.core_loader_fixed import load_core_plugin
|
21
|
-
from janito.tools.permissions import set_global_allowed_permissions
|
22
|
-
from janito.tools.tool_base import ToolPermissions
|
23
|
-
|
24
|
-
# Create adapter
|
25
|
-
adapter = LocalToolsAdapter()
|
26
|
-
|
27
|
-
# Set permissions for CLI
|
28
|
-
set_global_allowed_permissions(
|
29
|
-
ToolPermissions(read=True, write=True, execute=True)
|
30
|
-
)
|
31
|
-
|
32
|
-
# Core plugins to load
|
33
|
-
core_plugins = [
|
34
|
-
"core.filemanager",
|
35
|
-
"core.codeanalyzer",
|
36
|
-
"core.system",
|
37
|
-
"core.imagedisplay",
|
38
|
-
"dev.pythondev",
|
39
|
-
"dev.visualization",
|
40
|
-
]
|
41
|
-
|
42
|
-
loaded_count = 0
|
43
|
-
for plugin_name in core_plugins:
|
44
|
-
plugin = load_core_plugin(plugin_name)
|
45
|
-
if plugin:
|
46
|
-
tools = plugin.get_tools()
|
47
|
-
for tool_class in tools:
|
48
|
-
try:
|
49
|
-
adapter.register_tool(tool_class)
|
50
|
-
loaded_count += 1
|
51
|
-
except ValueError:
|
52
|
-
# Tool already registered, skip
|
53
|
-
pass
|
54
|
-
|
55
|
-
return adapter, loaded_count
|
56
|
-
|
57
|
-
except Exception as e:
|
58
|
-
print(f"Error initializing CLI tools: {e}", file=sys.stderr)
|
59
|
-
return None, 0
|
60
|
-
|
61
|
-
|
62
|
-
def get_cli_tools_adapter():
|
63
|
-
"""Get a CLI-initialized tools adapter."""
|
64
|
-
adapter, count = initialize_cli_tools()
|
65
|
-
if adapter and count > 0:
|
66
|
-
return adapter
|
67
|
-
return None
|
68
|
-
|
69
|
-
|
70
|
-
def list_cli_tools():
|
71
|
-
"""List all available CLI tools."""
|
72
|
-
adapter = get_cli_tools_adapter()
|
73
|
-
if not adapter:
|
74
|
-
return []
|
75
|
-
|
76
|
-
return adapter.list_tools()
|
77
|
-
|
78
|
-
|
79
|
-
if __name__ == "__main__":
|
80
|
-
adapter, count = initialize_cli_tools()
|
81
|
-
if adapter:
|
82
|
-
tools = adapter.list_tools()
|
83
|
-
print(f"CLI initialized {count} tools")
|
84
|
-
print(f"Available tools: {len(tools)}")
|
85
|
-
for tool in sorted(tools):
|
86
|
-
print(f" - {tool}")
|
87
|
-
else:
|
88
|
-
print("Failed to initialize CLI tools")
|
janito/tools/initialize.py
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Initialize janito tools for CLI and programmatic usage.
|
3
|
-
|
4
|
-
This module provides functions to load core plugins and register their tools
|
5
|
-
with the local tools adapter.
|
6
|
-
"""
|
7
|
-
|
8
|
-
import sys
|
9
|
-
from pathlib import Path
|
10
|
-
from typing import List, Optional
|
11
|
-
|
12
|
-
from janito.plugin_system.core_loader_fixed import load_core_plugin
|
13
|
-
from janito.tools.adapters.local.adapter import LocalToolsAdapter
|
14
|
-
|
15
|
-
|
16
|
-
def initialize_tools(adapter: Optional[LocalToolsAdapter] = None) -> LocalToolsAdapter:
|
17
|
-
"""
|
18
|
-
Initialize all janito tools by loading core plugins and registering tools.
|
19
|
-
|
20
|
-
Args:
|
21
|
-
adapter: LocalToolsAdapter instance to register tools with.
|
22
|
-
If None, creates a new instance.
|
23
|
-
|
24
|
-
Returns:
|
25
|
-
LocalToolsAdapter with all tools registered.
|
26
|
-
"""
|
27
|
-
if adapter is None:
|
28
|
-
adapter = LocalToolsAdapter()
|
29
|
-
|
30
|
-
# Core plugins to load
|
31
|
-
core_plugins = [
|
32
|
-
"core.filemanager",
|
33
|
-
"core.codeanalyzer",
|
34
|
-
"core.system",
|
35
|
-
"core.imagedisplay",
|
36
|
-
"dev.pythondev",
|
37
|
-
"dev.visualization",
|
38
|
-
]
|
39
|
-
|
40
|
-
loaded_count = 0
|
41
|
-
for plugin_name in core_plugins:
|
42
|
-
plugin = load_core_plugin(plugin_name)
|
43
|
-
if plugin:
|
44
|
-
tools = plugin.get_tools()
|
45
|
-
for tool_class in tools:
|
46
|
-
adapter.register_tool(tool_class)
|
47
|
-
loaded_count += 1
|
48
|
-
|
49
|
-
return adapter
|
50
|
-
|
51
|
-
|
52
|
-
def get_initialized_adapter() -> LocalToolsAdapter:
|
53
|
-
"""Get a pre-initialized LocalToolsAdapter with all tools registered."""
|
54
|
-
return initialize_tools()
|
55
|
-
|
56
|
-
|
57
|
-
def list_available_tools() -> List[str]:
|
58
|
-
"""Get a list of all available tool names."""
|
59
|
-
adapter = get_initialized_adapter()
|
60
|
-
return sorted(list(adapter._tools.keys()))
|
61
|
-
|
62
|
-
|
63
|
-
if __name__ == "__main__":
|
64
|
-
adapter = initialize_tools()
|
65
|
-
tools = sorted(list(adapter._tools.keys()))
|
66
|
-
|
67
|
-
print(f"Initialized {len(tools)} tools")
|
68
|
-
print("Available tools:")
|
69
|
-
for tool_name in tools:
|
70
|
-
print(f" - {tool_name}")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/__init__.py
RENAMED
File without changes
|
File without changes
|
/janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/java_outline.py
RENAMED
File without changes
|
File without changes
|
/janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/python_outline.py
RENAMED
File without changes
|
/janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/get_file_outline/search_outline.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/search_text/pattern_utils.py
RENAMED
File without changes
|
/janito/{plugins/core/codeanalyzer/tools → tools/adapters/local}/search_text/traverse_directory.py
RENAMED
File without changes
|
/janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/__init__.py
RENAMED
File without changes
|
/janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/core.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/janito/{plugins/core/filemanager/tools → tools/adapters/local}/validate_file_syntax/js_validator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|