janito 2.6.1__py3-none-any.whl → 2.8.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/__init__.py +6 -7
- janito/__main__.py +4 -5
- janito/_version.py +55 -58
- janito/agent/setup_agent.py +308 -241
- janito/agent/templates/profiles/{system_prompt_template_software developer.txt.j2 → system_prompt_template_Developer_with_Python_Tools.txt.j2} +43 -39
- janito/agent/templates/profiles/system_prompt_template_developer.txt.j2 +3 -12
- janito/cli/__init__.py +9 -10
- janito/cli/chat_mode/bindings.py +38 -38
- janito/cli/chat_mode/chat_entry.py +21 -23
- janito/cli/chat_mode/prompt_style.py +22 -25
- janito/cli/chat_mode/script_runner.py +158 -154
- janito/cli/chat_mode/session.py +80 -35
- janito/cli/chat_mode/session_profile_select.py +61 -52
- janito/cli/chat_mode/shell/commands/__init__.py +1 -5
- janito/cli/chat_mode/shell/commands/_priv_check.py +1 -0
- janito/cli/chat_mode/shell/commands/bang.py +10 -3
- janito/cli/chat_mode/shell/commands/conversation_restart.py +24 -7
- janito/cli/chat_mode/shell/commands/execute.py +22 -7
- janito/cli/chat_mode/shell/commands/help.py +4 -1
- janito/cli/chat_mode/shell/commands/model.py +13 -5
- janito/cli/chat_mode/shell/commands/privileges.py +21 -0
- janito/cli/chat_mode/shell/commands/prompt.py +0 -2
- janito/cli/chat_mode/shell/commands/read.py +22 -5
- janito/cli/chat_mode/shell/commands/tools.py +15 -4
- janito/cli/chat_mode/shell/commands/write.py +22 -5
- janito/cli/chat_mode/shell/input_history.py +3 -1
- janito/cli/chat_mode/shell/session/manager.py +0 -2
- janito/cli/chat_mode/toolbar.py +25 -19
- janito/cli/cli_commands/list_models.py +1 -1
- janito/cli/cli_commands/list_providers.py +1 -0
- janito/cli/cli_commands/list_tools.py +35 -7
- janito/cli/cli_commands/model_utils.py +5 -3
- janito/cli/cli_commands/show_config.py +12 -0
- janito/cli/cli_commands/show_system_prompt.py +23 -9
- janito/cli/config.py +0 -13
- janito/cli/core/getters.py +2 -0
- janito/cli/core/runner.py +25 -8
- janito/cli/core/setters.py +13 -76
- janito/cli/main_cli.py +9 -25
- janito/cli/prompt_core.py +19 -18
- janito/cli/prompt_setup.py +6 -3
- janito/cli/rich_terminal_reporter.py +19 -5
- janito/cli/single_shot_mode/handler.py +104 -95
- janito/cli/verbose_output.py +5 -1
- janito/config_manager.py +4 -0
- janito/drivers/azure_openai/driver.py +27 -30
- janito/drivers/driver_registry.py +27 -27
- janito/drivers/openai/driver.py +452 -436
- janito/formatting_token.py +12 -4
- janito/llm/agent.py +15 -6
- janito/llm/driver.py +1 -0
- janito/provider_registry.py +139 -178
- janito/providers/__init__.py +2 -0
- janito/providers/anthropic/model_info.py +40 -41
- janito/providers/anthropic/provider.py +75 -80
- janito/providers/azure_openai/provider.py +9 -4
- janito/providers/deepseek/provider.py +5 -4
- janito/providers/google/model_info.py +4 -2
- janito/providers/google/provider.py +11 -5
- janito/providers/groq/__init__.py +1 -0
- janito/providers/groq/model_info.py +46 -0
- janito/providers/groq/provider.py +76 -0
- janito/providers/moonshotai/__init__.py +1 -0
- janito/providers/moonshotai/model_info.py +15 -0
- janito/providers/moonshotai/provider.py +89 -0
- janito/providers/openai/provider.py +6 -7
- janito/tools/__init__.py +2 -0
- janito/tools/adapters/local/__init__.py +67 -66
- janito/tools/adapters/local/adapter.py +21 -4
- janito/tools/adapters/local/ask_user.py +1 -0
- janito/tools/adapters/local/copy_file.py +1 -0
- janito/tools/adapters/local/create_directory.py +1 -0
- janito/tools/adapters/local/create_file.py +1 -0
- janito/tools/adapters/local/delete_text_in_file.py +2 -1
- janito/tools/adapters/local/fetch_url.py +1 -0
- janito/tools/adapters/local/find_files.py +7 -6
- janito/tools/adapters/local/get_file_outline/core.py +1 -0
- janito/tools/adapters/local/get_file_outline/java_outline.py +22 -15
- janito/tools/adapters/local/get_file_outline/search_outline.py +1 -0
- janito/tools/adapters/local/move_file.py +4 -3
- janito/tools/adapters/local/open_html_in_browser.py +15 -5
- janito/tools/adapters/local/open_url.py +1 -0
- janito/tools/adapters/local/python_code_run.py +1 -0
- janito/tools/adapters/local/python_command_run.py +1 -0
- janito/tools/adapters/local/python_file_run.py +1 -0
- janito/tools/adapters/local/read_files.py +55 -40
- janito/tools/adapters/local/remove_directory.py +1 -0
- janito/tools/adapters/local/remove_file.py +1 -0
- janito/tools/adapters/local/replace_text_in_file.py +4 -3
- janito/tools/adapters/local/run_bash_command.py +1 -0
- janito/tools/adapters/local/run_powershell_command.py +1 -0
- janito/tools/adapters/local/search_text/core.py +18 -17
- janito/tools/adapters/local/search_text/match_lines.py +5 -5
- janito/tools/adapters/local/search_text/pattern_utils.py +1 -1
- janito/tools/adapters/local/search_text/traverse_directory.py +7 -7
- janito/tools/adapters/local/validate_file_syntax/core.py +1 -1
- janito/tools/adapters/local/validate_file_syntax/html_validator.py +8 -1
- janito/tools/disabled_tools.py +68 -0
- janito/tools/path_security.py +18 -11
- janito/tools/permissions.py +6 -0
- janito/tools/permissions_parse.py +4 -3
- janito/tools/tool_base.py +11 -5
- janito/tools/tool_use_tracker.py +1 -4
- janito/tools/tool_utils.py +1 -1
- janito/tools/tools_adapter.py +57 -25
- {janito-2.6.1.dist-info → janito-2.8.0.dist-info}/METADATA +411 -417
- janito-2.8.0.dist-info/RECORD +202 -0
- janito/cli/chat_mode/shell/commands/livelogs.py +0 -49
- janito/drivers/mistralai/driver.py +0 -41
- janito/providers/mistralai/model_info.py +0 -37
- janito/providers/mistralai/provider.py +0 -72
- janito/providers/provider_static_info.py +0 -18
- janito-2.6.1.dist-info/RECORD +0 -199
- /janito/agent/templates/profiles/{system_prompt_template_assistant.txt.j2 → system_prompt_template_model_conversation_without_tools_or_context.txt.j2} +0 -0
- {janito-2.6.1.dist-info → janito-2.8.0.dist-info}/WHEEL +0 -0
- {janito-2.6.1.dist-info → janito-2.8.0.dist-info}/entry_points.txt +0 -0
- {janito-2.6.1.dist-info → janito-2.8.0.dist-info}/licenses/LICENSE +0 -0
- {janito-2.6.1.dist-info → janito-2.8.0.dist-info}/top_level.txt +0 -0
janito/__init__.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
"""
|
2
|
-
janito: A Python package for managing and interacting with Large Language Model (LLM) providers and their APIs.
|
3
|
-
Provides a CLI for credential management and an extensible driver system for LLMs.
|
4
|
-
"""
|
5
|
-
|
6
|
-
from ._version import __version__
|
7
|
-
|
1
|
+
"""
|
2
|
+
janito: A Python package for managing and interacting with Large Language Model (LLM) providers and their APIs.
|
3
|
+
Provides a CLI for credential management and an extensible driver system for LLMs.
|
4
|
+
"""
|
5
|
+
|
6
|
+
from ._version import __version__
|
janito/__main__.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
from .cli.main import main
|
2
|
-
|
3
|
-
if __name__ == "__main__":
|
4
|
-
main()
|
5
|
-
|
1
|
+
from .cli.main import main
|
2
|
+
|
3
|
+
if __name__ == "__main__":
|
4
|
+
main()
|
janito/_version.py
CHANGED
@@ -1,58 +1,55 @@
|
|
1
|
-
"""Version handling for Janito.
|
2
|
-
Attempts to obtain the package version in the following order:
|
3
|
-
1. If a janito.version module exists (generated when the package is built with
|
4
|
-
setuptools-scm), use the version attribute from that module.
|
5
|
-
2. Ask importlib.metadata for the installed distribution version – works for
|
6
|
-
both regular and editable installs handled by pip.
|
7
|
-
3. Fall back to calling setuptools_scm.get_version() directly, using the git
|
8
|
-
repository when running from source without an installed distribution.
|
9
|
-
4. If everything else fails, return the literal string ``"unknown"`` so that
|
10
|
-
the application continues to work even when the version cannot be
|
11
|
-
determined.
|
12
|
-
|
13
|
-
This layered approach guarantees that a meaningful version string is returned
|
14
|
-
in most development and production scenarios while keeping Janito free from
|
15
|
-
hard-coded version numbers.
|
16
|
-
"""
|
17
|
-
|
18
|
-
from __future__ import annotations
|
19
|
-
|
20
|
-
import pathlib
|
21
|
-
from importlib import metadata as importlib_metadata
|
22
|
-
|
23
|
-
__all__ = ["__version__"]
|
24
|
-
|
25
|
-
|
26
|
-
# 1. "janito.version" (generated at build time by setuptools-scm)
|
27
|
-
try:
|
28
|
-
from . import version as _generated_version # type: ignore
|
29
|
-
|
30
|
-
__version__: str = _generated_version.version # pytype: disable=module-attr
|
31
|
-
except ImportError: # pragma: no cover – not available in editable installs
|
32
|
-
|
33
|
-
def _resolve_version() -> str:
|
34
|
-
"""Resolve the version string using several fallbacks."""
|
35
|
-
|
36
|
-
# 2. importlib.metadata – works for both regular and `pip install -e`.
|
37
|
-
try:
|
38
|
-
return importlib_metadata.version("janito")
|
39
|
-
except importlib_metadata.PackageNotFoundError:
|
40
|
-
pass # Not installed – probably running from a source checkout.
|
41
|
-
|
42
|
-
# 3. setuptools_scm – query the VCS metadata directly.
|
43
|
-
try:
|
44
|
-
from setuptools_scm import get_version # Imported lazily.
|
45
|
-
|
46
|
-
package_root = pathlib.Path(__file__).resolve().parent.parent
|
47
|
-
return get_version(root=str(package_root), relative_to=__file__)
|
48
|
-
except Exception: # pragma: no cover – any failure here falls through
|
49
|
-
# Either setuptools_scm is not available or this is not a git repo.
|
50
|
-
pass
|
51
|
-
|
52
|
-
# 4. Ultimate fallback – return a placeholder.
|
53
|
-
return "unknown"
|
54
|
-
|
55
|
-
__version__ = _resolve_version()
|
56
|
-
|
57
|
-
|
58
|
-
|
1
|
+
"""Version handling for Janito.
|
2
|
+
Attempts to obtain the package version in the following order:
|
3
|
+
1. If a janito.version module exists (generated when the package is built with
|
4
|
+
setuptools-scm), use the version attribute from that module.
|
5
|
+
2. Ask importlib.metadata for the installed distribution version – works for
|
6
|
+
both regular and editable installs handled by pip.
|
7
|
+
3. Fall back to calling setuptools_scm.get_version() directly, using the git
|
8
|
+
repository when running from source without an installed distribution.
|
9
|
+
4. If everything else fails, return the literal string ``"unknown"`` so that
|
10
|
+
the application continues to work even when the version cannot be
|
11
|
+
determined.
|
12
|
+
|
13
|
+
This layered approach guarantees that a meaningful version string is returned
|
14
|
+
in most development and production scenarios while keeping Janito free from
|
15
|
+
hard-coded version numbers.
|
16
|
+
"""
|
17
|
+
|
18
|
+
from __future__ import annotations
|
19
|
+
|
20
|
+
import pathlib
|
21
|
+
from importlib import metadata as importlib_metadata
|
22
|
+
|
23
|
+
__all__ = ["__version__"]
|
24
|
+
|
25
|
+
|
26
|
+
# 1. "janito.version" (generated at build time by setuptools-scm)
|
27
|
+
try:
|
28
|
+
from . import version as _generated_version # type: ignore
|
29
|
+
|
30
|
+
__version__: str = _generated_version.version # pytype: disable=module-attr
|
31
|
+
except ImportError: # pragma: no cover – not available in editable installs
|
32
|
+
|
33
|
+
def _resolve_version() -> str:
|
34
|
+
"""Resolve the version string using several fallbacks."""
|
35
|
+
|
36
|
+
# 2. importlib.metadata – works for both regular and `pip install -e`.
|
37
|
+
try:
|
38
|
+
return importlib_metadata.version("janito")
|
39
|
+
except importlib_metadata.PackageNotFoundError:
|
40
|
+
pass # Not installed – probably running from a source checkout.
|
41
|
+
|
42
|
+
# 3. setuptools_scm – query the VCS metadata directly.
|
43
|
+
try:
|
44
|
+
from setuptools_scm import get_version # Imported lazily.
|
45
|
+
|
46
|
+
package_root = pathlib.Path(__file__).resolve().parent.parent
|
47
|
+
return get_version(root=str(package_root), relative_to=__file__)
|
48
|
+
except Exception: # pragma: no cover – any failure here falls through
|
49
|
+
# Either setuptools_scm is not available or this is not a git repo.
|
50
|
+
pass
|
51
|
+
|
52
|
+
# 4. Ultimate fallback – return a placeholder.
|
53
|
+
return "unknown"
|
54
|
+
|
55
|
+
__version__ = _resolve_version()
|