janito 3.4.0__py3-none-any.whl → 3.5.1__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 +3 -0
- janito/cli/chat_mode/bindings.py +50 -0
- janito/cli/chat_mode/session.py +12 -1
- janito/cli/chat_mode/shell/commands/multi.py +5 -0
- janito/cli/chat_mode/shell/commands/security/allowed_sites.py +47 -33
- 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/core/model_guesser.py +40 -24
- janito/cli/main_cli.py +9 -12
- janito/cli/prompt_core.py +47 -9
- janito/cli/rich_terminal_reporter.py +2 -2
- janito/drivers/openai/driver.py +1 -0
- janito/drivers/zai/driver.py +1 -0
- janito/i18n/it.py +46 -46
- janito/llm/agent.py +32 -16
- janito/llm/auth_utils.py +14 -5
- janito/llm/cancellation_manager.py +63 -0
- janito/llm/driver.py +8 -0
- janito/llm/enter_cancellation.py +107 -0
- janito/plugin_system/__init__.py +10 -0
- janito/{plugins → plugin_system}/base.py +5 -2
- janito/plugin_system/core_loader.py +217 -0
- janito/plugin_system/core_loader_fixed.py +225 -0
- janito/plugins/__init__.py +31 -12
- janito/plugins/auto_loader.py +12 -11
- 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/system/tools/run_bash_command.py +204 -0
- janito/plugins/core/system/tools/run_powershell_command.py +234 -0
- janito/plugins/core_adapter.py +89 -11
- 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/discovery_core.py +14 -9
- 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 +87 -0
- janito/plugins/tools/create_directory.py +70 -0
- janito/{tools/adapters/local → plugins/tools}/create_file.py +6 -6
- 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/{tools/adapters/local → plugins/tools}/python_code_run.py +23 -7
- janito/{tools/adapters/local → plugins/tools}/python_command_run.py +21 -5
- janito/{tools/adapters/local → plugins/tools}/python_file_run.py +21 -5
- 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/{tools/adapters/local → plugins/tools}/run_bash_command.py +3 -3
- janito/{tools/adapters/local → plugins/tools}/run_powershell_command.py +3 -3
- 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/providers/__init__.py +1 -0
- janito/providers/together/__init__.py +1 -0
- janito/providers/together/model_info.py +69 -0
- janito/providers/together/provider.py +108 -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/initialize.py +70 -0
- janito/tools/loop_protection_decorator.py +114 -117
- janito-3.5.1.dist-info/METADATA +229 -0
- {janito-3.4.0.dist-info → janito-3.5.1.dist-info}/RECORD +155 -86
- janito/plugins/core_loader.py +0 -120
- janito/plugins/core_loader_fixed.py +0 -125
- janito/tools/function_adapter.py +0 -65
- janito-3.4.0.dist-info/METADATA +0 -84
- /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/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-3.4.0.dist-info → janito-3.5.1.dist-info}/WHEEL +0 -0
- {janito-3.4.0.dist-info → janito-3.5.1.dist-info}/entry_points.txt +0 -0
- {janito-3.4.0.dist-info → janito-3.5.1.dist-info}/licenses/LICENSE +0 -0
- {janito-3.4.0.dist-info → janito-3.5.1.dist-info}/top_level.txt +0 -0
janito/tools/function_adapter.py
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Function-to-Tool adapter for core plugins.
|
3
|
-
|
4
|
-
This module provides a way to wrap function-based tools into proper ToolBase classes.
|
5
|
-
"""
|
6
|
-
|
7
|
-
import inspect
|
8
|
-
from typing import Any, Dict, List, Optional, get_type_hints
|
9
|
-
from janito.tools.tool_base import ToolBase, ToolPermissions
|
10
|
-
|
11
|
-
|
12
|
-
class FunctionToolAdapter(ToolBase):
|
13
|
-
"""Adapter that wraps a function into a ToolBase class."""
|
14
|
-
|
15
|
-
def __init__(self, func, tool_name: str = None, description: str = None):
|
16
|
-
super().__init__()
|
17
|
-
self._func = func
|
18
|
-
self.tool_name = tool_name or func.__name__
|
19
|
-
self._description = description or func.__doc__ or f"Tool: {self.tool_name}"
|
20
|
-
self.permissions = ToolPermissions(read=True, write=True, execute=True)
|
21
|
-
|
22
|
-
def run(self, **kwargs) -> Any:
|
23
|
-
"""Execute the wrapped function."""
|
24
|
-
return self._func(**kwargs)
|
25
|
-
|
26
|
-
def get_signature(self) -> Dict[str, Any]:
|
27
|
-
"""Get function signature for documentation."""
|
28
|
-
sig = inspect.signature(self._func)
|
29
|
-
type_hints = get_type_hints(self._func)
|
30
|
-
|
31
|
-
params = {}
|
32
|
-
for name, param in sig.parameters.items():
|
33
|
-
param_info = {
|
34
|
-
"type": str(type_hints.get(name, Any)),
|
35
|
-
"default": param.default if param.default != inspect.Parameter.empty else None,
|
36
|
-
"required": param.default == inspect.Parameter.empty,
|
37
|
-
}
|
38
|
-
params[name] = param_info
|
39
|
-
|
40
|
-
return {
|
41
|
-
"name": self.tool_name,
|
42
|
-
"description": self._description,
|
43
|
-
"parameters": params,
|
44
|
-
"return_type": str(type_hints.get("return", Any))
|
45
|
-
}
|
46
|
-
|
47
|
-
|
48
|
-
def create_function_tool(func, tool_name: str = None, description: str = None) -> type:
|
49
|
-
"""
|
50
|
-
Create a ToolBase class from a function.
|
51
|
-
|
52
|
-
Args:
|
53
|
-
func: The function to wrap
|
54
|
-
tool_name: Optional custom tool name
|
55
|
-
description: Optional custom description
|
56
|
-
|
57
|
-
Returns:
|
58
|
-
A ToolBase subclass that wraps the function
|
59
|
-
"""
|
60
|
-
|
61
|
-
class DynamicFunctionTool(FunctionToolAdapter):
|
62
|
-
def __init__(self):
|
63
|
-
super().__init__(func, tool_name, description)
|
64
|
-
|
65
|
-
return DynamicFunctionTool
|
janito-3.4.0.dist-info/METADATA
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: janito
|
3
|
-
Version: 3.4.0
|
4
|
-
Summary: A new Python package called janito.
|
5
|
-
Author-email: João Pinto <janito@ikignosis.org>
|
6
|
-
Project-URL: Homepage, https://github.com/ikignosis/janito
|
7
|
-
Requires-Python: >=3.7
|
8
|
-
Description-Content-Type: text/markdown
|
9
|
-
License-File: LICENSE
|
10
|
-
Requires-Dist: attrs==25.3.0
|
11
|
-
Requires-Dist: rich==14.0.0
|
12
|
-
Requires-Dist: pathspec==0.12.1
|
13
|
-
Requires-Dist: setuptools>=61.0
|
14
|
-
Requires-Dist: pyyaml>=6.0
|
15
|
-
Requires-Dist: jinja2>=3.0.0
|
16
|
-
Requires-Dist: prompt_toolkit>=3.0.51
|
17
|
-
Requires-Dist: lxml>=5.4.0
|
18
|
-
Requires-Dist: requests>=2.32.4
|
19
|
-
Requires-Dist: bs4>=0.0.2
|
20
|
-
Requires-Dist: questionary>=2.0.1
|
21
|
-
Requires-Dist: openai>=1.68.0
|
22
|
-
Requires-Dist: Pillow>=10.0.0
|
23
|
-
Provides-Extra: dev
|
24
|
-
Requires-Dist: pytest; extra == "dev"
|
25
|
-
Requires-Dist: pre-commit; extra == "dev"
|
26
|
-
Requires-Dist: ruff==0.11.9; extra == "dev"
|
27
|
-
Requires-Dist: detect-secrets==1.4.0; extra == "dev"
|
28
|
-
Requires-Dist: codespell==2.4.1; extra == "dev"
|
29
|
-
Requires-Dist: black; extra == "dev"
|
30
|
-
Requires-Dist: questionary>=2.0.1; extra == "dev"
|
31
|
-
Requires-Dist: setuptools_scm>=8.0; extra == "dev"
|
32
|
-
Provides-Extra: coder
|
33
|
-
Requires-Dist: janito-coder; extra == "coder"
|
34
|
-
Dynamic: license-file
|
35
|
-
|
36
|
-
# nctl
|
37
|
-
|
38
|
-
```bash
|
39
|
-
$ nctl --help
|
40
|
-
Usage: nctl <command>
|
41
|
-
|
42
|
-
Interact with Nine API resources. See https://docs.nineapis.ch for the full API docs.
|
43
|
-
|
44
|
-
Run "nctl <command> --help" for more information on a command.
|
45
|
-
```
|
46
|
-
|
47
|
-
## Setup
|
48
|
-
|
49
|
-
```bash
|
50
|
-
# If you have go already installed
|
51
|
-
go install github.com/ninech/nctl@latest
|
52
|
-
|
53
|
-
# Homebrew
|
54
|
-
brew install ninech/taps/nctl
|
55
|
-
|
56
|
-
# Debian/Ubuntu
|
57
|
-
echo "deb [trusted=yes] https://repo.nine.ch/deb/ /" | sudo tee /etc/apt/sources.list.d/repo.nine.ch.list
|
58
|
-
sudo apt-get update
|
59
|
-
sudo apt-get install nctl
|
60
|
-
|
61
|
-
# Fedora/RHEL
|
62
|
-
cat <<EOF > /etc/yum.repos.d/repo.nine.ch.repo
|
63
|
-
[repo.nine.ch]
|
64
|
-
name=Nine Repo
|
65
|
-
baseurl=https://repo.nine.ch/yum/
|
66
|
-
enabled=1
|
67
|
-
gpgcheck=0
|
68
|
-
EOF
|
69
|
-
dnf install nctl
|
70
|
-
|
71
|
-
# Arch
|
72
|
-
# Install yay: https://github.com/Jguer/yay#binary
|
73
|
-
yay --version
|
74
|
-
yay -S nctl-bin
|
75
|
-
```
|
76
|
-
|
77
|
-
For Windows users, nctl is also built for arm64 and amd64. You can download the
|
78
|
-
latest exe file from the [releases](https://github.com/ninech/nctl/releases) and
|
79
|
-
install it.
|
80
|
-
|
81
|
-
## Getting started
|
82
|
-
|
83
|
-
* login to the API using `nctl auth login`
|
84
|
-
* run `nctl --help` to get a list of all available commands
|
/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
|