janito 2.33.0__py3-none-any.whl → 3.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/cli/chat_mode/bindings.py +26 -0
- janito/cli/chat_mode/session.py +7 -1
- janito/cli/cli_commands/check_tools.py +212 -0
- janito/cli/cli_commands/list_plugins.py +52 -43
- janito/cli/core/getters.py +3 -0
- janito/cli/main_cli.py +9 -12
- janito/cli/prompt_core.py +19 -9
- janito/drivers/openai/driver.py +1 -0
- janito/drivers/zai/driver.py +1 -0
- janito/llm/agent.py +30 -17
- janito/llm/auth_utils.py +14 -5
- janito/llm/cancellation_manager.py +62 -0
- janito/llm/driver.py +7 -0
- janito/llm/enter_cancellation.py +93 -0
- janito/plugin_system/__init__.py +10 -0
- janito/{plugins → plugin_system}/base.py +5 -2
- janito/{plugins/core_loader_fixed.py → plugin_system/core_loader.py} +45 -26
- janito/plugin_system/core_loader_fixed.py +149 -0
- janito/plugins/__init__.py +31 -12
- janito/plugins/auto_loader_fixed.py +12 -11
- janito/plugins/builtin.py +15 -1
- janito/plugins/core/__init__.py +7 -0
- janito/plugins/core/codeanalyzer/__init__.py +43 -0
- janito/plugins/core/filemanager/__init__.py +124 -0
- janito/plugins/core/filemanager/tools/create_file.py +87 -0
- janito/plugins/core/filemanager/tools/replace_text_in_file.py +270 -0
- janito/plugins/core/imagedisplay/__init__.py +14 -0
- janito/plugins/core/imagedisplay/plugin.py +51 -0
- janito/plugins/core/imagedisplay/tools/__init__.py +1 -0
- janito/plugins/core/imagedisplay/tools/show_image.py +83 -0
- janito/{tools/adapters/local → plugins/core/imagedisplay/tools}/show_image_grid.py +13 -5
- janito/plugins/core/system/__init__.py +23 -0
- janito/plugins/core_adapter.py +11 -9
- janito/plugins/dev/__init__.py +7 -0
- janito/plugins/dev/pythondev/__init__.py +37 -0
- janito/plugins/dev/visualization/__init__.py +23 -0
- janito/plugins/discovery.py +5 -5
- janito/plugins/example_plugin.py +108 -0
- janito/plugins/manager.py +1 -1
- janito/plugins/tools/__init__.py +10 -0
- janito/{tools/adapters/local → plugins/tools}/ask_user.py +3 -3
- janito/plugins/tools/copy_file.py +87 -0
- janito/plugins/tools/core_tools_plugin.py +88 -0
- janito/plugins/tools/create_directory.py +70 -0
- janito/{tools/adapters/local → plugins/tools}/create_file.py +4 -4
- janito/plugins/tools/decorators.py +19 -0
- janito/plugins/tools/delete_text_in_file.py +134 -0
- janito/{tools/adapters/local → plugins/tools}/fetch_url.py +3 -3
- janito/plugins/tools/find_files.py +143 -0
- janito/plugins/tools/get_file_outline/__init__.py +7 -0
- janito/plugins/tools/get_file_outline/core.py +122 -0
- janito/plugins/tools/get_file_outline/java_outline.py +47 -0
- janito/plugins/tools/get_file_outline/markdown_outline.py +14 -0
- janito/plugins/tools/get_file_outline/python_outline.py +303 -0
- janito/plugins/tools/get_file_outline/search_outline.py +36 -0
- janito/plugins/tools/move_file.py +131 -0
- janito/plugins/tools/open_html_in_browser.py +51 -0
- janito/plugins/tools/open_url.py +37 -0
- janito/plugins/tools/python_code_run.py +172 -0
- janito/plugins/tools/python_command_run.py +171 -0
- janito/plugins/tools/python_file_run.py +172 -0
- janito/plugins/tools/read_chart.py +259 -0
- janito/plugins/tools/read_files.py +58 -0
- janito/plugins/tools/remove_directory.py +55 -0
- janito/plugins/tools/remove_file.py +58 -0
- janito/{tools/adapters/local → plugins/tools}/replace_text_in_file.py +4 -4
- janito/plugins/tools/run_bash_command.py +183 -0
- janito/plugins/tools/run_powershell_command.py +218 -0
- janito/plugins/tools/search_text/__init__.py +7 -0
- janito/plugins/tools/search_text/core.py +205 -0
- janito/plugins/tools/search_text/match_lines.py +67 -0
- janito/plugins/tools/search_text/pattern_utils.py +73 -0
- janito/plugins/tools/search_text/traverse_directory.py +145 -0
- janito/{tools/adapters/local → plugins/tools}/show_image.py +15 -6
- janito/plugins/tools/show_image_grid.py +85 -0
- janito/plugins/tools/validate_file_syntax/__init__.py +7 -0
- janito/plugins/tools/validate_file_syntax/core.py +114 -0
- janito/plugins/tools/validate_file_syntax/css_validator.py +35 -0
- janito/plugins/tools/validate_file_syntax/html_validator.py +100 -0
- janito/plugins/tools/validate_file_syntax/jinja2_validator.py +50 -0
- janito/plugins/tools/validate_file_syntax/js_validator.py +27 -0
- janito/plugins/tools/validate_file_syntax/json_validator.py +6 -0
- janito/plugins/tools/validate_file_syntax/markdown_validator.py +109 -0
- janito/plugins/tools/validate_file_syntax/ps1_validator.py +32 -0
- janito/plugins/tools/validate_file_syntax/python_validator.py +5 -0
- janito/plugins/tools/validate_file_syntax/xml_validator.py +11 -0
- janito/plugins/tools/validate_file_syntax/yaml_validator.py +6 -0
- janito/plugins/tools/view_file.py +172 -0
- janito/plugins/ui/__init__.py +7 -0
- janito/plugins/ui/userinterface/__init__.py +16 -0
- janito/plugins/ui/userinterface/tools/ask_user.py +110 -0
- janito/plugins/web/__init__.py +7 -0
- janito/plugins/web/webtools/__init__.py +33 -0
- janito/plugins/web/webtools/tools/fetch_url.py +458 -0
- janito/tools/__init__.py +31 -7
- janito/tools/adapters/__init__.py +6 -1
- janito/tools/adapters/local/__init__.py +7 -70
- janito/tools/cli_initializer.py +88 -0
- janito/tools/function_adapter.py +93 -16
- janito/tools/initialize.py +70 -0
- {janito-2.33.0.dist-info → janito-3.1.0.dist-info}/METADATA +1 -2
- {janito-2.33.0.dist-info → janito-3.1.0.dist-info}/RECORD +146 -76
- janito/plugins/core_loader.py +0 -120
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/__init__.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/core.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/java_outline.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/markdown_outline.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/python_outline.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/search_outline.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/search_text/__init__.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/search_text/core.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/search_text/match_lines.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/search_text/pattern_utils.py +0 -0
- /janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/search_text/traverse_directory.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/copy_file.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/create_directory.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/delete_text_in_file.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/find_files.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/move_file.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/read_files.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/remove_directory.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/remove_file.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/__init__.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/core.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/css_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/html_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/jinja2_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/js_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/json_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/markdown_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/ps1_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/python_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/xml_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/yaml_validator.py +0 -0
- /janito/{tools/adapters/local → plugins/core/filemanager/tools}/view_file.py +0 -0
- /janito/{tools/adapters/local → plugins/core/system/tools}/run_bash_command.py +0 -0
- /janito/{tools/adapters/local → plugins/core/system/tools}/run_powershell_command.py +0 -0
- /janito/{tools/adapters/local → plugins/dev/pythondev/tools}/python_code_run.py +0 -0
- /janito/{tools/adapters/local → plugins/dev/pythondev/tools}/python_command_run.py +0 -0
- /janito/{tools/adapters/local → plugins/dev/pythondev/tools}/python_file_run.py +0 -0
- /janito/{tools/adapters/local → plugins/dev/visualization/tools}/read_chart.py +0 -0
- /janito/{tools/adapters/local → plugins/web/webtools/tools}/open_html_in_browser.py +0 -0
- /janito/{tools/adapters/local → plugins/web/webtools/tools}/open_url.py +0 -0
- {janito-2.33.0.dist-info → janito-3.1.0.dist-info}/WHEEL +0 -0
- {janito-2.33.0.dist-info → janito-3.1.0.dist-info}/entry_points.txt +0 -0
- {janito-2.33.0.dist-info → janito-3.1.0.dist-info}/licenses/LICENSE +0 -0
- {janito-2.33.0.dist-info → janito-3.1.0.dist-info}/top_level.txt +0 -0
janito/plugins/core_loader.py
DELETED
@@ -1,120 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Core plugin loader that properly handles function-based plugins.
|
3
|
-
|
4
|
-
This module provides a simplified approach to load core plugins
|
5
|
-
without the complex discovery mechanism.
|
6
|
-
"""
|
7
|
-
|
8
|
-
import importlib.util
|
9
|
-
import sys
|
10
|
-
from pathlib import Path
|
11
|
-
from typing import Optional
|
12
|
-
|
13
|
-
from janito.plugins.base import Plugin, PluginMetadata
|
14
|
-
from janito.tools.function_adapter import create_function_tool
|
15
|
-
from janito.tools.tool_base import ToolBase
|
16
|
-
|
17
|
-
|
18
|
-
class CorePlugin(Plugin):
|
19
|
-
"""Simple core plugin implementation."""
|
20
|
-
|
21
|
-
def __init__(self, name: str, description: str, tools: list):
|
22
|
-
super().__init__()
|
23
|
-
self._plugin_name = name
|
24
|
-
self._description = description
|
25
|
-
self._tools = tools
|
26
|
-
self._tool_classes = []
|
27
|
-
|
28
|
-
def get_metadata(self) -> PluginMetadata:
|
29
|
-
return PluginMetadata(
|
30
|
-
name=self._plugin_name,
|
31
|
-
version="1.0.0",
|
32
|
-
description=self._description,
|
33
|
-
author="Janito",
|
34
|
-
license="MIT",
|
35
|
-
)
|
36
|
-
|
37
|
-
def get_tools(self) -> list:
|
38
|
-
return self._tool_classes
|
39
|
-
|
40
|
-
def initialize(self):
|
41
|
-
"""Initialize by creating tool classes."""
|
42
|
-
self._tool_classes = []
|
43
|
-
for tool_func in self._tools:
|
44
|
-
if callable(tool_func):
|
45
|
-
tool_class = create_function_tool(tool_func)
|
46
|
-
self._tool_classes.append(tool_class)
|
47
|
-
|
48
|
-
|
49
|
-
def load_core_plugin(plugin_name: str) -> Optional[Plugin]:
|
50
|
-
"""
|
51
|
-
Load a core plugin by name.
|
52
|
-
|
53
|
-
Args:
|
54
|
-
plugin_name: Name of the plugin (e.g., 'core.filemanager')
|
55
|
-
|
56
|
-
Returns:
|
57
|
-
Plugin instance if loaded successfully
|
58
|
-
"""
|
59
|
-
try:
|
60
|
-
# Parse plugin name
|
61
|
-
if "." not in plugin_name:
|
62
|
-
return None
|
63
|
-
|
64
|
-
parts = plugin_name.split(".")
|
65
|
-
if len(parts) != 2:
|
66
|
-
return None
|
67
|
-
|
68
|
-
package_name, submodule_name = parts
|
69
|
-
|
70
|
-
# Build path to plugin
|
71
|
-
plugin_path = Path("plugins") / package_name / submodule_name / "__init__.py"
|
72
|
-
if not plugin_path.exists():
|
73
|
-
return None
|
74
|
-
|
75
|
-
# Load the module
|
76
|
-
spec = importlib.util.spec_from_file_location(plugin_name, plugin_path)
|
77
|
-
if spec is None or spec.loader is None:
|
78
|
-
return None
|
79
|
-
|
80
|
-
module = importlib.util.module_from_spec(spec)
|
81
|
-
spec.loader.exec_module(module)
|
82
|
-
|
83
|
-
# Get plugin info
|
84
|
-
name = getattr(module, "__plugin_name__", plugin_name)
|
85
|
-
description = getattr(module, "__plugin_description__", f"Core plugin: {plugin_name}")
|
86
|
-
tools = getattr(module, "__plugin_tools__", [])
|
87
|
-
|
88
|
-
if not tools:
|
89
|
-
return None
|
90
|
-
|
91
|
-
# Create plugin
|
92
|
-
plugin = CorePlugin(name, description, tools)
|
93
|
-
plugin.initialize()
|
94
|
-
return plugin
|
95
|
-
|
96
|
-
except Exception as e:
|
97
|
-
print(f"Error loading core plugin {plugin_name}: {e}")
|
98
|
-
return None
|
99
|
-
|
100
|
-
|
101
|
-
def get_core_plugins() -> list:
|
102
|
-
"""Get list of all available core plugins."""
|
103
|
-
core_plugins = [
|
104
|
-
"core.filemanager",
|
105
|
-
"core.codeanalyzer",
|
106
|
-
"core.system",
|
107
|
-
"core.imagedisplay",
|
108
|
-
"dev.pythondev",
|
109
|
-
"dev.visualization",
|
110
|
-
"ui.userinterface",
|
111
|
-
"web.webtools",
|
112
|
-
]
|
113
|
-
|
114
|
-
available = []
|
115
|
-
for plugin_name in core_plugins:
|
116
|
-
plugin = load_core_plugin(plugin_name)
|
117
|
-
if plugin:
|
118
|
-
available.append(plugin_name)
|
119
|
-
|
120
|
-
return available
|
/janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/__init__.py
RENAMED
File without changes
|
File without changes
|
/janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/java_outline.py
RENAMED
File without changes
|
File without changes
|
/janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/python_outline.py
RENAMED
File without changes
|
/janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/get_file_outline/search_outline.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/search_text/pattern_utils.py
RENAMED
File without changes
|
/janito/{tools/adapters/local → plugins/core/codeanalyzer/tools}/search_text/traverse_directory.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
|
/janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/__init__.py
RENAMED
File without changes
|
/janito/{tools/adapters/local → plugins/core/filemanager/tools}/validate_file_syntax/core.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/janito/{tools/adapters/local → plugins/core/filemanager/tools}/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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|