janito 3.3.0__py3-none-any.whl → 3.5.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 +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/list_plugins.py +13 -8
- janito/cli/core/model_guesser.py +40 -24
- janito/cli/prompt_core.py +47 -9
- janito/cli/rich_terminal_reporter.py +2 -2
- janito/hello.txt +0 -0
- janito/i18n/it.py +46 -46
- janito/llm/agent.py +32 -16
- janito/llm/cancellation_manager.py +63 -0
- janito/llm/driver.py +8 -0
- janito/llm/enter_cancellation.py +107 -0
- janito/{plugin_system_backup_20250825_070018 → plugin_system}/core_loader.py +76 -3
- janito/{plugin_system_backup_20250825_070018 → plugin_system}/core_loader_fixed.py +79 -3
- janito/plugins/__init__.py +29 -21
- janito/{plugins_backup_20250825_070018 → plugins}/auto_loader.py +12 -11
- janito/plugins/builtin.py +1 -1
- janito/plugins/core/filemanager/tools/copy_file.py +1 -25
- janito/plugins/core/filemanager/tools/create_directory.py +1 -28
- janito/plugins/core/filemanager/tools/create_file.py +3 -27
- janito/plugins/core/filemanager/tools/delete_text_in_file.py +0 -1
- janito/plugins/core/imagedisplay/plugin.py +1 -1
- janito/plugins/core_adapter.py +131 -0
- janito/plugins/discovery.py +3 -3
- janito/{plugins_backup_20250825_070018 → plugins}/discovery_core.py +14 -9
- janito/plugins/example_plugin.py +1 -1
- janito/plugins/manager.py +1 -1
- janito/{plugins_backup_20250825_070018 → plugins}/tools/core_tools_plugin.py +9 -10
- janito/{plugins_backup_20250825_070018 → plugins}/tools/create_file.py +2 -2
- janito/{plugins_backup_20250825_070018 → plugins}/tools/delete_text_in_file.py +0 -1
- 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/base.py +1 -31
- janito/tools/cli_initializer.py +1 -1
- janito/tools/initialize.py +1 -1
- janito/tools/loop_protection_decorator.py +114 -117
- janito/tools/tool_base.py +114 -142
- janito/tools/tools_schema.py +6 -12
- janito-3.5.0.dist-info/METADATA +229 -0
- {janito-3.3.0.dist-info → janito-3.5.0.dist-info}/RECORD +98 -162
- janito/plugins/__main__.py +0 -85
- janito/plugins/base.py +0 -57
- janito/plugins/core_loader.py +0 -144
- janito/plugins_backup_20250825_070018/__init__.py +0 -36
- janito/plugins_backup_20250825_070018/builtin.py +0 -102
- janito/plugins_backup_20250825_070018/config.py +0 -84
- janito/plugins_backup_20250825_070018/core/__init__.py +0 -7
- janito/plugins_backup_20250825_070018/core/codeanalyzer/__init__.py +0 -43
- janito/plugins_backup_20250825_070018/core/codeanalyzer/tools/get_file_outline/__init__.py +0 -1
- janito/plugins_backup_20250825_070018/core/codeanalyzer/tools/get_file_outline/core.py +0 -122
- janito/plugins_backup_20250825_070018/core/codeanalyzer/tools/search_text/__init__.py +0 -1
- janito/plugins_backup_20250825_070018/core/codeanalyzer/tools/search_text/core.py +0 -205
- janito/plugins_backup_20250825_070018/core/filemanager/__init__.py +0 -124
- janito/plugins_backup_20250825_070018/core/filemanager/tools/copy_file.py +0 -87
- janito/plugins_backup_20250825_070018/core/filemanager/tools/create_directory.py +0 -70
- janito/plugins_backup_20250825_070018/core/filemanager/tools/create_file.py +0 -87
- janito/plugins_backup_20250825_070018/core/filemanager/tools/delete_text_in_file.py +0 -135
- janito/plugins_backup_20250825_070018/core/filemanager/tools/find_files.py +0 -143
- janito/plugins_backup_20250825_070018/core/filemanager/tools/move_file.py +0 -131
- janito/plugins_backup_20250825_070018/core/filemanager/tools/read_files.py +0 -58
- janito/plugins_backup_20250825_070018/core/filemanager/tools/remove_directory.py +0 -55
- janito/plugins_backup_20250825_070018/core/filemanager/tools/remove_file.py +0 -58
- janito/plugins_backup_20250825_070018/core/filemanager/tools/replace_text_in_file.py +0 -270
- janito/plugins_backup_20250825_070018/core/filemanager/tools/validate_file_syntax/__init__.py +0 -1
- janito/plugins_backup_20250825_070018/core/filemanager/tools/validate_file_syntax/core.py +0 -114
- janito/plugins_backup_20250825_070018/core/filemanager/tools/view_file.py +0 -172
- janito/plugins_backup_20250825_070018/core/imagedisplay/__init__.py +0 -14
- janito/plugins_backup_20250825_070018/core/imagedisplay/plugin.py +0 -51
- janito/plugins_backup_20250825_070018/core/imagedisplay/tools/__init__.py +0 -1
- janito/plugins_backup_20250825_070018/core/imagedisplay/tools/show_image.py +0 -83
- janito/plugins_backup_20250825_070018/core/imagedisplay/tools/show_image_grid.py +0 -84
- janito/plugins_backup_20250825_070018/core/system/__init__.py +0 -23
- janito/plugins_backup_20250825_070018/core/system/tools/run_bash_command.py +0 -183
- janito/plugins_backup_20250825_070018/core/system/tools/run_powershell_command.py +0 -218
- janito/plugins_backup_20250825_070018/core_adapter.py +0 -55
- janito/plugins_backup_20250825_070018/dev/__init__.py +0 -7
- janito/plugins_backup_20250825_070018/dev/pythondev/__init__.py +0 -37
- janito/plugins_backup_20250825_070018/dev/pythondev/tools/python_code_run.py +0 -172
- janito/plugins_backup_20250825_070018/dev/pythondev/tools/python_command_run.py +0 -171
- janito/plugins_backup_20250825_070018/dev/pythondev/tools/python_file_run.py +0 -172
- janito/plugins_backup_20250825_070018/dev/visualization/__init__.py +0 -23
- janito/plugins_backup_20250825_070018/dev/visualization/tools/read_chart.py +0 -259
- janito/plugins_backup_20250825_070018/discovery.py +0 -289
- janito/plugins_backup_20250825_070018/example_plugin.py +0 -108
- janito/plugins_backup_20250825_070018/manager.py +0 -243
- janito/plugins_backup_20250825_070018/tools/get_file_outline/java_outline.py +0 -47
- janito/plugins_backup_20250825_070018/tools/get_file_outline/markdown_outline.py +0 -14
- janito/plugins_backup_20250825_070018/tools/get_file_outline/python_outline.py +0 -303
- janito/plugins_backup_20250825_070018/tools/get_file_outline/search_outline.py +0 -36
- janito/plugins_backup_20250825_070018/tools/search_text/match_lines.py +0 -67
- janito/plugins_backup_20250825_070018/tools/search_text/pattern_utils.py +0 -73
- janito/plugins_backup_20250825_070018/tools/search_text/traverse_directory.py +0 -145
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/css_validator.py +0 -35
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/html_validator.py +0 -100
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/jinja2_validator.py +0 -50
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/js_validator.py +0 -27
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/json_validator.py +0 -6
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/markdown_validator.py +0 -109
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/ps1_validator.py +0 -32
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/python_validator.py +0 -5
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/xml_validator.py +0 -11
- janito/plugins_backup_20250825_070018/tools/validate_file_syntax/yaml_validator.py +0 -6
- janito/plugins_backup_20250825_070018/ui/__init__.py +0 -7
- janito/plugins_backup_20250825_070018/ui/userinterface/__init__.py +0 -16
- janito/plugins_backup_20250825_070018/ui/userinterface/tools/ask_user.py +0 -110
- janito/plugins_backup_20250825_070018/web/__init__.py +0 -7
- janito/plugins_backup_20250825_070018/web/webtools/__init__.py +0 -33
- janito/plugins_backup_20250825_070018/web/webtools/tools/fetch_url.py +0 -458
- janito/plugins_backup_20250825_070018/web/webtools/tools/open_html_in_browser.py +0 -51
- janito/plugins_backup_20250825_070018/web/webtools/tools/open_url.py +0 -37
- janito/tools/function_adapter.py +0 -176
- janito-3.3.0.dist-info/METADATA +0 -83
- /janito/{plugin_system_backup_20250825_070018 → plugin_system}/__init__.py +0 -0
- /janito/{plugin_system_backup_20250825_070018 → plugin_system}/base.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/auto_loader_fixed.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/__init__.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/ask_user.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/copy_file.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/create_directory.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/decorators.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/fetch_url.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/find_files.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/get_file_outline/__init__.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/get_file_outline/core.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/codeanalyzer → plugins}/tools/get_file_outline/java_outline.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/codeanalyzer → plugins}/tools/get_file_outline/markdown_outline.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/codeanalyzer → plugins}/tools/get_file_outline/python_outline.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/codeanalyzer → plugins}/tools/get_file_outline/search_outline.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/move_file.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/open_html_in_browser.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/open_url.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/python_code_run.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/python_command_run.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/python_file_run.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/read_chart.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/read_files.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/remove_directory.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/remove_file.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/replace_text_in_file.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/run_bash_command.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/run_powershell_command.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/search_text/__init__.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/search_text/core.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/codeanalyzer → plugins}/tools/search_text/match_lines.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/codeanalyzer → plugins}/tools/search_text/pattern_utils.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/codeanalyzer → plugins}/tools/search_text/traverse_directory.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/show_image.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/show_image_grid.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/validate_file_syntax/__init__.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/validate_file_syntax/core.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/css_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/html_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/jinja2_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/js_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/json_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/markdown_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/ps1_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/python_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/xml_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018/core/filemanager → plugins}/tools/validate_file_syntax/yaml_validator.py +0 -0
- /janito/{plugins_backup_20250825_070018 → plugins}/tools/view_file.py +0 -0
- {janito-3.3.0.dist-info → janito-3.5.0.dist-info}/WHEEL +0 -0
- {janito-3.3.0.dist-info → janito-3.5.0.dist-info}/entry_points.txt +0 -0
- {janito-3.3.0.dist-info → janito-3.5.0.dist-info}/licenses/LICENSE +0 -0
- {janito-3.3.0.dist-info → janito-3.5.0.dist-info}/top_level.txt +0 -0
@@ -1,37 +0,0 @@
|
|
1
|
-
import webbrowser
|
2
|
-
from janito.tools.adapters.local.adapter import register_local_tool
|
3
|
-
from janito.tools.tool_base import ToolBase, ToolPermissions
|
4
|
-
from janito.report_events import ReportAction
|
5
|
-
from janito.i18n import tr
|
6
|
-
from janito.tools.loop_protection_decorator import protect_against_loops
|
7
|
-
|
8
|
-
|
9
|
-
@register_local_tool
|
10
|
-
class OpenUrlTool(ToolBase):
|
11
|
-
"""
|
12
|
-
Open the supplied URL or local file in the default web browser.
|
13
|
-
|
14
|
-
Args:
|
15
|
-
url (str): The URL or local file path (as a file:// URL) to open. Supports both web URLs (http, https) and local files (file://).
|
16
|
-
Returns:
|
17
|
-
str: Status message indicating the result.
|
18
|
-
"""
|
19
|
-
|
20
|
-
permissions = ToolPermissions(read=True)
|
21
|
-
tool_name = "open_url"
|
22
|
-
|
23
|
-
@protect_against_loops(max_calls=5, time_window=10.0, key_field="url")
|
24
|
-
def run(self, url: str) -> str:
|
25
|
-
if not url.strip():
|
26
|
-
self.report_warning(tr("ℹ️ Empty URL provided."))
|
27
|
-
return tr("Warning: Empty URL provided. Operation skipped.")
|
28
|
-
self.report_action(tr("🌐 Opening URL '{url}' ...", url=url), ReportAction.READ)
|
29
|
-
try:
|
30
|
-
webbrowser.open(url)
|
31
|
-
except Exception as err:
|
32
|
-
self.report_error(
|
33
|
-
tr("❗ Error opening URL: {url}: {err}", url=url, err=str(err))
|
34
|
-
)
|
35
|
-
return tr("Warning: Error opening URL: {url}: {err}", url=url, err=str(err))
|
36
|
-
self.report_success(tr("✅ URL opened in browser: {url}", url=url))
|
37
|
-
return tr("URL opened in browser: {url}", url=url)
|
janito/tools/function_adapter.py
DELETED
@@ -1,176 +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
|
-
"""
|
14
|
-
Adapter that wraps a function into a ToolBase class.
|
15
|
-
|
16
|
-
This adapter provides a unified interface for function-based tools by wrapping
|
17
|
-
individual functions with the ToolBase protocol. It handles parameter mapping
|
18
|
-
and validation automatically.
|
19
|
-
|
20
|
-
Parameters:
|
21
|
-
path (str): Target file path for file operations
|
22
|
-
content (str): File content to write or process
|
23
|
-
overwrite (bool): Whether to overwrite existing files (default: False)
|
24
|
-
sources (str): Source file(s) to copy from
|
25
|
-
target (str): Destination path for copy operations
|
26
|
-
recursive (bool): Whether to process directories recursively
|
27
|
-
from_line (int): Starting line number for file reading
|
28
|
-
to_line (int): Ending line number for file reading
|
29
|
-
search_text (str): Text to search for in files
|
30
|
-
replacement_text (str): Text to replace search matches with
|
31
|
-
use_regex (bool): Whether to treat search as regex pattern
|
32
|
-
case_sensitive (bool): Whether search should be case sensitive
|
33
|
-
max_depth (int): Maximum directory depth to search
|
34
|
-
include_gitignored (bool): Whether to include .gitignored files
|
35
|
-
timeout (int): Timeout in seconds for operations
|
36
|
-
require_confirmation (bool): Whether to require user confirmation
|
37
|
-
data (dict): Chart data for visualization tools
|
38
|
-
title (str): Chart title
|
39
|
-
width (int): Chart width in pixels
|
40
|
-
height (int): Chart height in pixels
|
41
|
-
query (str): Search query for text search
|
42
|
-
paths (str): Directory or file paths to search in
|
43
|
-
src_path (str): Source path for move operations
|
44
|
-
dest_path (str): Destination path for move operations
|
45
|
-
code (str): Python code to execute
|
46
|
-
pattern (str): File pattern to match (e.g., '*.py')
|
47
|
-
"""
|
48
|
-
|
49
|
-
def __init__(self, func, tool_name: str = None, description: str = None):
|
50
|
-
super().__init__()
|
51
|
-
self._func = func
|
52
|
-
self.tool_name = tool_name or getattr(func, "tool_name", func.__name__)
|
53
|
-
self._description = description or func.__doc__ or f"Tool: {self.tool_name}"
|
54
|
-
self.permissions = ToolPermissions(read=True, write=True, execute=True)
|
55
|
-
|
56
|
-
def run(
|
57
|
-
self,
|
58
|
-
path: str = None,
|
59
|
-
content: str = None,
|
60
|
-
overwrite: bool = None,
|
61
|
-
sources: str = None,
|
62
|
-
target: str = None,
|
63
|
-
recursive: bool = None,
|
64
|
-
from_line: int = None,
|
65
|
-
to_line: int = None,
|
66
|
-
search_text: str = None,
|
67
|
-
replacement_text: str = None,
|
68
|
-
use_regex: bool = None,
|
69
|
-
case_sensitive: bool = None,
|
70
|
-
max_depth: int = None,
|
71
|
-
include_gitignored: bool = None,
|
72
|
-
timeout: int = None,
|
73
|
-
require_confirmation: bool = None,
|
74
|
-
data: dict = None,
|
75
|
-
title: str = None,
|
76
|
-
width: int = None,
|
77
|
-
height: int = None,
|
78
|
-
query: str = None,
|
79
|
-
paths: str = None,
|
80
|
-
src_path: str = None,
|
81
|
-
dest_path: str = None,
|
82
|
-
code: str = None,
|
83
|
-
pattern: str = None,
|
84
|
-
) -> str:
|
85
|
-
"""Execute the wrapped function."""
|
86
|
-
# Build kwargs from non-None parameters
|
87
|
-
import inspect
|
88
|
-
|
89
|
-
sig = inspect.signature(self._func)
|
90
|
-
filtered_kwargs = {}
|
91
|
-
|
92
|
-
# Map parameter names to their actual values
|
93
|
-
param_map = {
|
94
|
-
"path": path,
|
95
|
-
"content": content,
|
96
|
-
"overwrite": overwrite,
|
97
|
-
"sources": sources,
|
98
|
-
"target": target,
|
99
|
-
"recursive": recursive,
|
100
|
-
"from_line": from_line,
|
101
|
-
"to_line": to_line,
|
102
|
-
"search_text": search_text,
|
103
|
-
"replacement_text": replacement_text,
|
104
|
-
"use_regex": use_regex,
|
105
|
-
"case_sensitive": case_sensitive,
|
106
|
-
"max_depth": max_depth,
|
107
|
-
"include_gitignored": include_gitignored,
|
108
|
-
"timeout": timeout,
|
109
|
-
"require_confirmation": require_confirmation,
|
110
|
-
"data": data,
|
111
|
-
"title": title,
|
112
|
-
"width": width,
|
113
|
-
"height": height,
|
114
|
-
"query": query,
|
115
|
-
"paths": paths,
|
116
|
-
"src_path": src_path,
|
117
|
-
"dest_path": dest_path,
|
118
|
-
"code": code,
|
119
|
-
"pattern": pattern,
|
120
|
-
}
|
121
|
-
|
122
|
-
# Only include parameters that exist in the function signature
|
123
|
-
for name, param in sig.parameters.items():
|
124
|
-
if name in param_map and param_map[name] is not None:
|
125
|
-
filtered_kwargs[name] = param_map[name]
|
126
|
-
|
127
|
-
result = self._func(**filtered_kwargs)
|
128
|
-
return str(result) if result is not None else ""
|
129
|
-
|
130
|
-
def get_signature(self) -> Dict[str, Any]:
|
131
|
-
"""Get function signature for documentation."""
|
132
|
-
sig = inspect.signature(self._func)
|
133
|
-
type_hints = get_type_hints(self._func)
|
134
|
-
|
135
|
-
params = {}
|
136
|
-
for name, param in sig.parameters.items():
|
137
|
-
param_info = {
|
138
|
-
"type": str(type_hints.get(name, Any)),
|
139
|
-
"default": (
|
140
|
-
param.default if param.default != inspect.Parameter.empty else None
|
141
|
-
),
|
142
|
-
"required": param.default == inspect.Parameter.empty,
|
143
|
-
}
|
144
|
-
params[name] = param_info
|
145
|
-
|
146
|
-
return {
|
147
|
-
"name": self.tool_name,
|
148
|
-
"description": self._description,
|
149
|
-
"parameters": params,
|
150
|
-
"return_type": str(type_hints.get("return", Any)),
|
151
|
-
}
|
152
|
-
|
153
|
-
|
154
|
-
def create_function_tool(func, tool_name: str = None, description: str = None) -> type:
|
155
|
-
"""
|
156
|
-
Create a ToolBase class from a function.
|
157
|
-
|
158
|
-
Args:
|
159
|
-
func: The function to wrap
|
160
|
-
tool_name: Optional custom tool name
|
161
|
-
description: Optional custom description
|
162
|
-
|
163
|
-
Returns:
|
164
|
-
A ToolBase subclass that wraps the function
|
165
|
-
"""
|
166
|
-
# Resolve tool_name in outer scope
|
167
|
-
resolved_tool_name = tool_name or getattr(func, "tool_name", func.__name__)
|
168
|
-
|
169
|
-
class DynamicFunctionTool(FunctionToolAdapter):
|
170
|
-
permissions = ToolPermissions(read=True, write=True, execute=True)
|
171
|
-
tool_name = resolved_tool_name
|
172
|
-
|
173
|
-
def __init__(self):
|
174
|
-
super().__init__(func, DynamicFunctionTool.tool_name, description)
|
175
|
-
|
176
|
-
return DynamicFunctionTool
|
janito-3.3.0.dist-info/METADATA
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: janito
|
3
|
-
Version: 3.3.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
|
-
Dynamic: license-file
|
34
|
-
|
35
|
-
# nctl
|
36
|
-
|
37
|
-
```bash
|
38
|
-
$ nctl --help
|
39
|
-
Usage: nctl <command>
|
40
|
-
|
41
|
-
Interact with Nine API resources. See https://docs.nineapis.ch for the full API docs.
|
42
|
-
|
43
|
-
Run "nctl <command> --help" for more information on a command.
|
44
|
-
```
|
45
|
-
|
46
|
-
## Setup
|
47
|
-
|
48
|
-
```bash
|
49
|
-
# If you have go already installed
|
50
|
-
go install github.com/ninech/nctl@latest
|
51
|
-
|
52
|
-
# Homebrew
|
53
|
-
brew install ninech/taps/nctl
|
54
|
-
|
55
|
-
# Debian/Ubuntu
|
56
|
-
echo "deb [trusted=yes] https://repo.nine.ch/deb/ /" | sudo tee /etc/apt/sources.list.d/repo.nine.ch.list
|
57
|
-
sudo apt-get update
|
58
|
-
sudo apt-get install nctl
|
59
|
-
|
60
|
-
# Fedora/RHEL
|
61
|
-
cat <<EOF > /etc/yum.repos.d/repo.nine.ch.repo
|
62
|
-
[repo.nine.ch]
|
63
|
-
name=Nine Repo
|
64
|
-
baseurl=https://repo.nine.ch/yum/
|
65
|
-
enabled=1
|
66
|
-
gpgcheck=0
|
67
|
-
EOF
|
68
|
-
dnf install nctl
|
69
|
-
|
70
|
-
# Arch
|
71
|
-
# Install yay: https://github.com/Jguer/yay#binary
|
72
|
-
yay --version
|
73
|
-
yay -S nctl-bin
|
74
|
-
```
|
75
|
-
|
76
|
-
For Windows users, nctl is also built for arm64 and amd64. You can download the
|
77
|
-
latest exe file from the [releases](https://github.com/ninech/nctl/releases) and
|
78
|
-
install it.
|
79
|
-
|
80
|
-
## Getting started
|
81
|
-
|
82
|
-
* login to the API using `nctl auth login`
|
83
|
-
* run `nctl --help` to get a list of all available commands
|
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
|
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
|
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
|