alita-sdk 0.3.465__py3-none-any.whl → 0.3.497__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.
Potentially problematic release.
This version of alita-sdk might be problematic. Click here for more details.
- alita_sdk/cli/agent/__init__.py +5 -0
- alita_sdk/cli/agent/default.py +83 -1
- alita_sdk/cli/agent_loader.py +22 -4
- alita_sdk/cli/agent_ui.py +13 -3
- alita_sdk/cli/agents.py +1876 -186
- alita_sdk/cli/callbacks.py +96 -25
- alita_sdk/cli/cli.py +10 -1
- alita_sdk/cli/config.py +151 -9
- alita_sdk/cli/context/__init__.py +30 -0
- alita_sdk/cli/context/cleanup.py +198 -0
- alita_sdk/cli/context/manager.py +731 -0
- alita_sdk/cli/context/message.py +285 -0
- alita_sdk/cli/context/strategies.py +289 -0
- alita_sdk/cli/context/token_estimation.py +127 -0
- alita_sdk/cli/input_handler.py +167 -4
- alita_sdk/cli/inventory.py +1256 -0
- alita_sdk/cli/toolkit.py +14 -17
- alita_sdk/cli/toolkit_loader.py +35 -5
- alita_sdk/cli/tools/__init__.py +8 -1
- alita_sdk/cli/tools/filesystem.py +910 -64
- alita_sdk/cli/tools/planning.py +143 -157
- alita_sdk/cli/tools/terminal.py +154 -20
- alita_sdk/community/__init__.py +64 -8
- alita_sdk/community/inventory/__init__.py +224 -0
- alita_sdk/community/inventory/config.py +257 -0
- alita_sdk/community/inventory/enrichment.py +2137 -0
- alita_sdk/community/inventory/extractors.py +1469 -0
- alita_sdk/community/inventory/ingestion.py +3172 -0
- alita_sdk/community/inventory/knowledge_graph.py +1457 -0
- alita_sdk/community/inventory/parsers/__init__.py +218 -0
- alita_sdk/community/inventory/parsers/base.py +295 -0
- alita_sdk/community/inventory/parsers/csharp_parser.py +907 -0
- alita_sdk/community/inventory/parsers/go_parser.py +851 -0
- alita_sdk/community/inventory/parsers/html_parser.py +389 -0
- alita_sdk/community/inventory/parsers/java_parser.py +593 -0
- alita_sdk/community/inventory/parsers/javascript_parser.py +629 -0
- alita_sdk/community/inventory/parsers/kotlin_parser.py +768 -0
- alita_sdk/community/inventory/parsers/markdown_parser.py +362 -0
- alita_sdk/community/inventory/parsers/python_parser.py +604 -0
- alita_sdk/community/inventory/parsers/rust_parser.py +858 -0
- alita_sdk/community/inventory/parsers/swift_parser.py +832 -0
- alita_sdk/community/inventory/parsers/text_parser.py +322 -0
- alita_sdk/community/inventory/parsers/yaml_parser.py +370 -0
- alita_sdk/community/inventory/patterns/__init__.py +61 -0
- alita_sdk/community/inventory/patterns/ast_adapter.py +380 -0
- alita_sdk/community/inventory/patterns/loader.py +348 -0
- alita_sdk/community/inventory/patterns/registry.py +198 -0
- alita_sdk/community/inventory/presets.py +535 -0
- alita_sdk/community/inventory/retrieval.py +1403 -0
- alita_sdk/community/inventory/toolkit.py +169 -0
- alita_sdk/community/inventory/visualize.py +1370 -0
- alita_sdk/configurations/bitbucket.py +0 -3
- alita_sdk/runtime/clients/client.py +108 -31
- alita_sdk/runtime/langchain/assistant.py +4 -2
- alita_sdk/runtime/langchain/constants.py +3 -1
- alita_sdk/runtime/langchain/document_loaders/AlitaExcelLoader.py +103 -60
- alita_sdk/runtime/langchain/document_loaders/constants.py +10 -6
- alita_sdk/runtime/langchain/langraph_agent.py +123 -31
- alita_sdk/runtime/llms/preloaded.py +2 -6
- alita_sdk/runtime/toolkits/__init__.py +2 -0
- alita_sdk/runtime/toolkits/application.py +1 -1
- alita_sdk/runtime/toolkits/mcp.py +107 -91
- alita_sdk/runtime/toolkits/planning.py +173 -0
- alita_sdk/runtime/toolkits/tools.py +59 -7
- alita_sdk/runtime/tools/artifact.py +46 -17
- alita_sdk/runtime/tools/function.py +2 -1
- alita_sdk/runtime/tools/llm.py +320 -32
- alita_sdk/runtime/tools/mcp_remote_tool.py +23 -7
- alita_sdk/runtime/tools/planning/__init__.py +36 -0
- alita_sdk/runtime/tools/planning/models.py +246 -0
- alita_sdk/runtime/tools/planning/wrapper.py +607 -0
- alita_sdk/runtime/tools/vectorstore_base.py +44 -9
- alita_sdk/runtime/utils/AlitaCallback.py +106 -20
- alita_sdk/runtime/utils/mcp_client.py +465 -0
- alita_sdk/runtime/utils/mcp_oauth.py +80 -0
- alita_sdk/runtime/utils/mcp_tools_discovery.py +124 -0
- alita_sdk/runtime/utils/streamlit.py +6 -10
- alita_sdk/runtime/utils/toolkit_utils.py +14 -5
- alita_sdk/tools/__init__.py +54 -27
- alita_sdk/tools/ado/repos/repos_wrapper.py +1 -2
- alita_sdk/tools/base_indexer_toolkit.py +99 -20
- alita_sdk/tools/bitbucket/__init__.py +2 -2
- alita_sdk/tools/chunkers/__init__.py +3 -1
- alita_sdk/tools/chunkers/sematic/json_chunker.py +1 -0
- alita_sdk/tools/chunkers/sematic/markdown_chunker.py +97 -6
- alita_sdk/tools/chunkers/universal_chunker.py +270 -0
- alita_sdk/tools/code/loaders/codesearcher.py +3 -2
- alita_sdk/tools/code_indexer_toolkit.py +55 -22
- alita_sdk/tools/confluence/api_wrapper.py +63 -14
- alita_sdk/tools/elitea_base.py +86 -21
- alita_sdk/tools/jira/__init__.py +1 -1
- alita_sdk/tools/jira/api_wrapper.py +91 -40
- alita_sdk/tools/non_code_indexer_toolkit.py +1 -0
- alita_sdk/tools/qtest/__init__.py +1 -1
- alita_sdk/tools/sharepoint/api_wrapper.py +2 -2
- alita_sdk/tools/vector_adapters/VectorStoreAdapter.py +17 -13
- alita_sdk/tools/zephyr_essential/api_wrapper.py +12 -13
- {alita_sdk-0.3.465.dist-info → alita_sdk-0.3.497.dist-info}/METADATA +2 -1
- {alita_sdk-0.3.465.dist-info → alita_sdk-0.3.497.dist-info}/RECORD +103 -61
- {alita_sdk-0.3.465.dist-info → alita_sdk-0.3.497.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.465.dist-info → alita_sdk-0.3.497.dist-info}/entry_points.txt +0 -0
- {alita_sdk-0.3.465.dist-info → alita_sdk-0.3.497.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.465.dist-info → alita_sdk-0.3.497.dist-info}/top_level.txt +0 -0
alita_sdk/cli/toolkit.py
CHANGED
|
@@ -10,6 +10,7 @@ import logging
|
|
|
10
10
|
from typing import Optional, Dict, Any
|
|
11
11
|
|
|
12
12
|
from .cli import get_client
|
|
13
|
+
from .toolkit_loader import load_toolkit_config
|
|
13
14
|
|
|
14
15
|
logger = logging.getLogger(__name__)
|
|
15
16
|
|
|
@@ -140,24 +141,15 @@ def toolkit_schema(ctx, toolkit_name: str):
|
|
|
140
141
|
@click.pass_context
|
|
141
142
|
def toolkit_test(ctx, toolkit_type: str, tool: str, config_file, params,
|
|
142
143
|
param, llm_model: str, temperature: float, max_tokens: int):
|
|
143
|
-
"""
|
|
144
|
-
Test a specific tool from a toolkit.
|
|
144
|
+
"""Test a specific tool from a toolkit.
|
|
145
145
|
|
|
146
146
|
TOOLKIT_TYPE: Type of toolkit (e.g., 'jira', 'github', 'confluence')
|
|
147
147
|
|
|
148
|
+
\b
|
|
148
149
|
Examples:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
--config jira-config.json --params params.json
|
|
153
|
-
|
|
154
|
-
# Test with inline parameters
|
|
155
|
-
alita-cli toolkit test jira --tool get_issue \\
|
|
156
|
-
--config jira-config.json --param issue_key=PROJ-123
|
|
157
|
-
|
|
158
|
-
# Test with JSON output for scripting
|
|
159
|
-
alita-cli --output json toolkit test github --tool get_issue \\
|
|
160
|
-
--config github-config.json --param owner=user --param repo=myrepo
|
|
150
|
+
alita toolkit test jira --tool get_issue --config jira.json --params params.json
|
|
151
|
+
alita toolkit test jira --tool get_issue --config jira.json --param issue_key=PROJ-123
|
|
152
|
+
alita -o json toolkit test github --tool get_issue --config github.json
|
|
161
153
|
"""
|
|
162
154
|
formatter = ctx.obj['formatter']
|
|
163
155
|
client = get_client(ctx)
|
|
@@ -166,9 +158,15 @@ def toolkit_test(ctx, toolkit_type: str, tool: str, config_file, params,
|
|
|
166
158
|
# Load toolkit configuration
|
|
167
159
|
toolkit_config = {}
|
|
168
160
|
if config_file:
|
|
169
|
-
toolkit_config =
|
|
161
|
+
toolkit_config = load_toolkit_config(config_file.name)
|
|
170
162
|
logger.debug(f"Loaded toolkit config from {config_file.name}")
|
|
171
163
|
|
|
164
|
+
# Add the tool to selected_tools in the config
|
|
165
|
+
if 'selected_tools' not in toolkit_config:
|
|
166
|
+
toolkit_config['selected_tools'] = []
|
|
167
|
+
if tool not in toolkit_config['selected_tools']:
|
|
168
|
+
toolkit_config['selected_tools'].append(tool)
|
|
169
|
+
|
|
172
170
|
# Load tool parameters
|
|
173
171
|
tool_params = {}
|
|
174
172
|
if params:
|
|
@@ -204,7 +202,6 @@ def toolkit_test(ctx, toolkit_type: str, tool: str, config_file, params,
|
|
|
204
202
|
llm_config = {
|
|
205
203
|
'temperature': temperature,
|
|
206
204
|
'max_tokens': max_tokens,
|
|
207
|
-
'top_p': 1.0
|
|
208
205
|
}
|
|
209
206
|
|
|
210
207
|
# Execute test
|
|
@@ -254,7 +251,7 @@ def toolkit_tools(ctx, toolkit_type: str, config_file):
|
|
|
254
251
|
# Load toolkit configuration if provided
|
|
255
252
|
toolkit_config = {}
|
|
256
253
|
if config_file:
|
|
257
|
-
toolkit_config =
|
|
254
|
+
toolkit_config = load_toolkit_config(config_file.name)
|
|
258
255
|
|
|
259
256
|
# Import and instantiate toolkit
|
|
260
257
|
from alita_sdk.tools import AVAILABLE_TOOLS
|
alita_sdk/cli/toolkit_loader.py
CHANGED
|
@@ -12,6 +12,20 @@ from typing import Dict, Any, List
|
|
|
12
12
|
from .config import substitute_env_vars
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
# All available tools in the inventory toolkit
|
|
16
|
+
INVENTORY_TOOLS = [
|
|
17
|
+
"search_graph",
|
|
18
|
+
"get_entity",
|
|
19
|
+
"get_entity_content",
|
|
20
|
+
"impact_analysis",
|
|
21
|
+
"get_related_entities",
|
|
22
|
+
"get_stats",
|
|
23
|
+
"get_citations",
|
|
24
|
+
"list_entities_by_type",
|
|
25
|
+
"list_entities_by_layer",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
|
|
15
29
|
def load_toolkit_config(file_path: str) -> Dict[str, Any]:
|
|
16
30
|
"""Load toolkit configuration from JSON or YAML file with env var substitution."""
|
|
17
31
|
path = Path(file_path)
|
|
@@ -33,7 +47,15 @@ def load_toolkit_config(file_path: str) -> Dict[str, Any]:
|
|
|
33
47
|
|
|
34
48
|
|
|
35
49
|
def load_toolkit_configs(agent_def: Dict[str, Any], toolkit_config_paths: tuple) -> List[Dict[str, Any]]:
|
|
36
|
-
"""Load all toolkit configurations from agent definition and CLI options.
|
|
50
|
+
"""Load all toolkit configurations from agent definition and CLI options.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
agent_def: Agent definition dictionary
|
|
54
|
+
toolkit_config_paths: Tuple of file paths or dict configs from CLI options
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
List of toolkit configuration dictionaries
|
|
58
|
+
"""
|
|
37
59
|
toolkit_configs = []
|
|
38
60
|
|
|
39
61
|
# Load from agent definition if present
|
|
@@ -45,11 +67,19 @@ def load_toolkit_configs(agent_def: Dict[str, Any], toolkit_config_paths: tuple)
|
|
|
45
67
|
toolkit_configs.append(config)
|
|
46
68
|
elif 'config' in tk_config:
|
|
47
69
|
toolkit_configs.append(tk_config['config'])
|
|
70
|
+
elif 'type' in tk_config:
|
|
71
|
+
# Direct toolkit config (e.g., {'type': 'inventory', ...})
|
|
72
|
+
toolkit_configs.append(tk_config)
|
|
48
73
|
|
|
49
|
-
# Load from CLI options
|
|
74
|
+
# Load from CLI options - can be file paths (str) or dict configs
|
|
50
75
|
if toolkit_config_paths:
|
|
51
|
-
for
|
|
52
|
-
|
|
53
|
-
|
|
76
|
+
for config_item in toolkit_config_paths:
|
|
77
|
+
if isinstance(config_item, dict):
|
|
78
|
+
# Direct config dict (e.g., from /inventory command)
|
|
79
|
+
toolkit_configs.append(config_item)
|
|
80
|
+
elif isinstance(config_item, str):
|
|
81
|
+
# File path
|
|
82
|
+
config = load_toolkit_config(config_item)
|
|
83
|
+
toolkit_configs.append(config)
|
|
54
84
|
|
|
55
85
|
return toolkit_configs
|
alita_sdk/cli/tools/__init__.py
CHANGED
|
@@ -4,7 +4,7 @@ CLI tools package.
|
|
|
4
4
|
Contains specialized tools for CLI agents.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from .filesystem import get_filesystem_tools
|
|
7
|
+
from .filesystem import get_filesystem_tools, FilesystemApiWrapper
|
|
8
8
|
from .terminal import get_terminal_tools, create_default_blocked_patterns_file
|
|
9
9
|
from .planning import (
|
|
10
10
|
get_planning_tools,
|
|
@@ -14,12 +14,16 @@ from .planning import (
|
|
|
14
14
|
create_session_memory,
|
|
15
15
|
save_session_metadata,
|
|
16
16
|
load_session_metadata,
|
|
17
|
+
update_session_metadata,
|
|
17
18
|
get_session_dir,
|
|
19
|
+
to_portable_path,
|
|
20
|
+
from_portable_path,
|
|
18
21
|
)
|
|
19
22
|
from .approval import create_approval_wrapper, ApprovalToolWrapper, prompt_approval
|
|
20
23
|
|
|
21
24
|
__all__ = [
|
|
22
25
|
'get_filesystem_tools',
|
|
26
|
+
'FilesystemApiWrapper',
|
|
23
27
|
'get_terminal_tools',
|
|
24
28
|
'create_default_blocked_patterns_file',
|
|
25
29
|
'get_planning_tools',
|
|
@@ -29,7 +33,10 @@ __all__ = [
|
|
|
29
33
|
'create_session_memory',
|
|
30
34
|
'save_session_metadata',
|
|
31
35
|
'load_session_metadata',
|
|
36
|
+
'update_session_metadata',
|
|
32
37
|
'get_session_dir',
|
|
38
|
+
'to_portable_path',
|
|
39
|
+
'from_portable_path',
|
|
33
40
|
'create_approval_wrapper',
|
|
34
41
|
'ApprovalToolWrapper',
|
|
35
42
|
'prompt_approval',
|