File tree Expand file tree Collapse file tree 6 files changed +20
-12
lines changed
Expand file tree Collapse file tree 6 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 11"""Public API for the package."""
22
3- from .config import get_config_value
4- from .decorators import tool
3+ from toolit .config import get_config_value
4+ from toolit .decorators import tool
55
66__all__ = [
77 "get_config_value" ,
Original file line number Diff line number Diff line change 1313import pathlib
1414import importlib
1515import importlib .metadata
16- from toolit .constants import MARKER_TOOL , ToolitTypesEnum
16+ from toolit .constants import MARKER_TOOL , RichHelpPanelNames , ToolitTypesEnum
1717from toolit .create_apps_and_register import register_command
1818from types import FunctionType , ModuleType
1919from typing import Any , Callable
@@ -56,7 +56,7 @@ def load_tools_from_plugins() -> list[FunctionType]:
5656 """Discover and return plugin commands via entry points."""
5757 plugins = get_plugin_tools ()
5858 for plugin in plugins :
59- register_command (plugin , rich_help_panel = "Commands from Plugins" )
59+ register_command (plugin , rich_help_panel = RichHelpPanelNames . NAME_OF_THE_RICH_GROUP_HELP_PANEL_PLUGINS )
6060 return plugins
6161
6262
@@ -83,7 +83,7 @@ def load_tools_from_folder(folder_path: pathlib.Path) -> list[FunctionType]:
8383 tool_groups : list [FunctionType ] = get_items_from_folder (folder_path , tool_group_strategy )
8484 # Register each tool as a command
8585 for tool in tools :
86- register_command (tool , rich_help_panel = "Commands Local Tools" )
86+ register_command (tool , rich_help_panel = RichHelpPanelNames . NAME_OF_THE_RICH_GROUP_HELP_PANEL_PROJECT )
8787 return tools + tool_groups
8888
8989
Original file line number Diff line number Diff line change 11"""CLI entry point for the toolit package."""
2- from .auto_loader import load_tools_from_folder , load_tools_from_plugins , register_command
3- from .config import load_devtools_folder
4- from .create_apps_and_register import app
5- from .create_tasks_json import create_vscode_tasks_json
2+ from toolit .auto_loader import load_tools_from_folder , load_tools_from_plugins , register_command
3+ from toolit .config import load_devtools_folder
4+ from toolit .constants import RichHelpPanelNames
5+ from toolit .create_apps_and_register import app
6+ from toolit .create_tasks_json import create_vscode_tasks_json
67
78load_tools_from_folder (load_devtools_folder ())
89load_tools_from_plugins ()
9- register_command (create_vscode_tasks_json )
10+ register_command (create_vscode_tasks_json , rich_help_panel = RichHelpPanelNames . NAME_OF_THE_RICH_GROUP_HELP_PANEL_PLUGINS )
1011
1112
1213if __name__ == "__main__" :
Original file line number Diff line number Diff line change 1010
1111import toml
1212import pathlib
13- from .constants import ConfigFileKeys
1413from functools import lru_cache
14+ from toolit .constants import ConfigFileKeys
1515from typing import Callable , overload
1616
1717
Original file line number Diff line number Diff line change 55MARKER_TOOL = "__toolit_tool_type__"
66
77
8+ class RichHelpPanelNames :
9+ """Namespace for the different rich help panel names."""
10+
11+ NAME_OF_THE_RICH_GROUP_HELP_PANEL_PROJECT = "Commands from Project"
12+ NAME_OF_THE_RICH_GROUP_HELP_PANEL_PLUGINS = "Commands from Plugins"
13+
14+
815class ConfigFileKeys :
916 """Namespace for the different configuration file keys for user configuration."""
1017
Original file line number Diff line number Diff line change 11"""Decorator to tell if a function is a tool."""
22
3- from .constants import MARKER_TOOL , ToolitTypesEnum
3+ from toolit .constants import MARKER_TOOL , ToolitTypesEnum
44from typing import Any , Callable , TypeVar
55
66T = TypeVar ("T" , bound = Callable [..., Any ])
You can’t perform that action at this time.
0 commit comments