hanzo-mcp 0.8.8__py3-none-any.whl → 0.9.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.
Potentially problematic release.
This version of hanzo-mcp might be problematic. Click here for more details.
- hanzo_mcp/__init__.py +1 -3
- hanzo_mcp/analytics/posthog_analytics.py +4 -17
- hanzo_mcp/bridge.py +9 -25
- hanzo_mcp/cli.py +8 -17
- hanzo_mcp/cli_enhanced.py +5 -14
- hanzo_mcp/cli_plugin.py +3 -9
- hanzo_mcp/config/settings.py +6 -20
- hanzo_mcp/config/tool_config.py +2 -4
- hanzo_mcp/core/base_agent.py +88 -88
- hanzo_mcp/core/model_registry.py +238 -210
- hanzo_mcp/dev_server.py +5 -15
- hanzo_mcp/prompts/__init__.py +2 -6
- hanzo_mcp/prompts/project_todo_reminder.py +3 -9
- hanzo_mcp/prompts/tool_explorer.py +1 -3
- hanzo_mcp/prompts/utils.py +7 -21
- hanzo_mcp/server.py +6 -7
- hanzo_mcp/tools/__init__.py +29 -32
- hanzo_mcp/tools/agent/__init__.py +2 -1
- hanzo_mcp/tools/agent/agent.py +10 -30
- hanzo_mcp/tools/agent/agent_tool.py +23 -17
- hanzo_mcp/tools/agent/claude_desktop_auth.py +3 -9
- hanzo_mcp/tools/agent/cli_agent_base.py +7 -24
- hanzo_mcp/tools/agent/cli_tools.py +76 -75
- hanzo_mcp/tools/agent/code_auth.py +1 -3
- hanzo_mcp/tools/agent/code_auth_tool.py +2 -6
- hanzo_mcp/tools/agent/critic_tool.py +8 -24
- hanzo_mcp/tools/agent/iching_tool.py +12 -36
- hanzo_mcp/tools/agent/network_tool.py +7 -18
- hanzo_mcp/tools/agent/prompt.py +1 -5
- hanzo_mcp/tools/agent/review_tool.py +10 -25
- hanzo_mcp/tools/agent/swarm_alias.py +1 -3
- hanzo_mcp/tools/agent/unified_cli_tools.py +38 -38
- hanzo_mcp/tools/common/batch_tool.py +15 -45
- hanzo_mcp/tools/common/config_tool.py +9 -28
- hanzo_mcp/tools/common/context.py +1 -3
- hanzo_mcp/tools/common/critic_tool.py +1 -3
- hanzo_mcp/tools/common/decorators.py +2 -6
- hanzo_mcp/tools/common/enhanced_base.py +2 -6
- hanzo_mcp/tools/common/fastmcp_pagination.py +4 -12
- hanzo_mcp/tools/common/forgiving_edit.py +9 -28
- hanzo_mcp/tools/common/mode.py +1 -5
- hanzo_mcp/tools/common/paginated_base.py +3 -11
- hanzo_mcp/tools/common/paginated_response.py +10 -30
- hanzo_mcp/tools/common/pagination.py +3 -9
- hanzo_mcp/tools/common/path_utils.py +34 -0
- hanzo_mcp/tools/common/permissions.py +14 -13
- hanzo_mcp/tools/common/personality.py +983 -701
- hanzo_mcp/tools/common/plugin_loader.py +3 -15
- hanzo_mcp/tools/common/stats.py +7 -19
- hanzo_mcp/tools/common/thinking_tool.py +1 -3
- hanzo_mcp/tools/common/tool_disable.py +2 -6
- hanzo_mcp/tools/common/tool_list.py +2 -6
- hanzo_mcp/tools/common/validation.py +1 -3
- hanzo_mcp/tools/compiler/__init__.py +8 -0
- hanzo_mcp/tools/compiler/sandboxed_compiler.py +681 -0
- hanzo_mcp/tools/config/config_tool.py +7 -13
- hanzo_mcp/tools/config/index_config.py +1 -3
- hanzo_mcp/tools/config/mode_tool.py +5 -15
- hanzo_mcp/tools/database/database_manager.py +3 -9
- hanzo_mcp/tools/database/graph.py +1 -3
- hanzo_mcp/tools/database/graph_add.py +3 -9
- hanzo_mcp/tools/database/graph_query.py +11 -34
- hanzo_mcp/tools/database/graph_remove.py +3 -9
- hanzo_mcp/tools/database/graph_search.py +6 -20
- hanzo_mcp/tools/database/graph_stats.py +11 -33
- hanzo_mcp/tools/database/sql.py +4 -12
- hanzo_mcp/tools/database/sql_query.py +6 -10
- hanzo_mcp/tools/database/sql_search.py +2 -6
- hanzo_mcp/tools/database/sql_stats.py +5 -15
- hanzo_mcp/tools/editor/neovim_command.py +1 -3
- hanzo_mcp/tools/editor/neovim_session.py +7 -13
- hanzo_mcp/tools/environment/__init__.py +8 -0
- hanzo_mcp/tools/environment/environment_detector.py +594 -0
- hanzo_mcp/tools/filesystem/__init__.py +28 -26
- hanzo_mcp/tools/filesystem/ast_multi_edit.py +14 -43
- hanzo_mcp/tools/filesystem/ast_tool.py +3 -0
- hanzo_mcp/tools/filesystem/base.py +20 -12
- hanzo_mcp/tools/filesystem/content_replace.py +7 -12
- hanzo_mcp/tools/filesystem/diff.py +2 -10
- hanzo_mcp/tools/filesystem/directory_tree.py +285 -51
- hanzo_mcp/tools/filesystem/edit.py +10 -18
- hanzo_mcp/tools/filesystem/find.py +312 -179
- hanzo_mcp/tools/filesystem/git_search.py +12 -24
- hanzo_mcp/tools/filesystem/multi_edit.py +10 -18
- hanzo_mcp/tools/filesystem/read.py +14 -30
- hanzo_mcp/tools/filesystem/rules_tool.py +9 -17
- hanzo_mcp/tools/filesystem/search.py +1160 -0
- hanzo_mcp/tools/filesystem/watch.py +2 -4
- hanzo_mcp/tools/filesystem/write.py +7 -10
- hanzo_mcp/tools/framework/__init__.py +8 -0
- hanzo_mcp/tools/framework/framework_modes.py +714 -0
- hanzo_mcp/tools/jupyter/base.py +6 -20
- hanzo_mcp/tools/jupyter/jupyter.py +4 -12
- hanzo_mcp/tools/llm/consensus_tool.py +8 -24
- hanzo_mcp/tools/llm/llm_manage.py +2 -6
- hanzo_mcp/tools/llm/llm_tool.py +17 -58
- hanzo_mcp/tools/llm/llm_unified.py +18 -59
- hanzo_mcp/tools/llm/provider_tools.py +1 -3
- hanzo_mcp/tools/lsp/lsp_tool.py +621 -481
- hanzo_mcp/tools/mcp/mcp_add.py +3 -5
- hanzo_mcp/tools/mcp/mcp_remove.py +1 -1
- hanzo_mcp/tools/mcp/mcp_stats.py +1 -3
- hanzo_mcp/tools/mcp/mcp_tool.py +9 -23
- hanzo_mcp/tools/memory/__init__.py +33 -40
- hanzo_mcp/tools/memory/conversation_memory.py +636 -0
- hanzo_mcp/tools/memory/knowledge_tools.py +7 -25
- hanzo_mcp/tools/memory/memory_tools.py +7 -19
- hanzo_mcp/tools/search/find_tool.py +12 -34
- hanzo_mcp/tools/search/unified_search.py +27 -81
- hanzo_mcp/tools/shell/__init__.py +16 -4
- hanzo_mcp/tools/shell/auto_background.py +2 -6
- hanzo_mcp/tools/shell/base.py +1 -5
- hanzo_mcp/tools/shell/base_process.py +5 -7
- hanzo_mcp/tools/shell/bash_session.py +7 -24
- hanzo_mcp/tools/shell/bash_session_executor.py +5 -15
- hanzo_mcp/tools/shell/bash_tool.py +3 -7
- hanzo_mcp/tools/shell/command_executor.py +26 -79
- hanzo_mcp/tools/shell/logs.py +4 -16
- hanzo_mcp/tools/shell/npx.py +2 -8
- hanzo_mcp/tools/shell/npx_tool.py +1 -3
- hanzo_mcp/tools/shell/pkill.py +4 -12
- hanzo_mcp/tools/shell/process_tool.py +2 -8
- hanzo_mcp/tools/shell/processes.py +5 -17
- hanzo_mcp/tools/shell/run_background.py +1 -3
- hanzo_mcp/tools/shell/run_command.py +1 -3
- hanzo_mcp/tools/shell/run_command_windows.py +1 -3
- hanzo_mcp/tools/shell/run_tool.py +56 -0
- hanzo_mcp/tools/shell/session_manager.py +2 -6
- hanzo_mcp/tools/shell/session_storage.py +2 -6
- hanzo_mcp/tools/shell/streaming_command.py +7 -23
- hanzo_mcp/tools/shell/uvx.py +4 -14
- hanzo_mcp/tools/shell/uvx_background.py +2 -6
- hanzo_mcp/tools/shell/uvx_tool.py +1 -3
- hanzo_mcp/tools/shell/zsh_tool.py +12 -20
- hanzo_mcp/tools/todo/todo.py +1 -3
- hanzo_mcp/tools/vector/__init__.py +97 -50
- hanzo_mcp/tools/vector/ast_analyzer.py +6 -20
- hanzo_mcp/tools/vector/git_ingester.py +10 -30
- hanzo_mcp/tools/vector/index_tool.py +3 -9
- hanzo_mcp/tools/vector/infinity_store.py +11 -30
- hanzo_mcp/tools/vector/mock_infinity.py +159 -0
- hanzo_mcp/tools/vector/node_tool.py +538 -0
- hanzo_mcp/tools/vector/project_manager.py +4 -12
- hanzo_mcp/tools/vector/unified_vector.py +384 -0
- hanzo_mcp/tools/vector/vector.py +2 -6
- hanzo_mcp/tools/vector/vector_index.py +8 -8
- hanzo_mcp/tools/vector/vector_search.py +7 -21
- {hanzo_mcp-0.8.8.dist-info → hanzo_mcp-0.9.0.dist-info}/METADATA +2 -2
- hanzo_mcp-0.9.0.dist-info/RECORD +191 -0
- hanzo_mcp/tools/agent/agent_tool_v1_deprecated.py +0 -645
- hanzo_mcp/tools/agent/swarm_tool.py +0 -723
- hanzo_mcp/tools/agent/swarm_tool_v1_deprecated.py +0 -577
- hanzo_mcp/tools/filesystem/batch_search.py +0 -900
- hanzo_mcp/tools/filesystem/directory_tree_paginated.py +0 -350
- hanzo_mcp/tools/filesystem/find_files.py +0 -369
- hanzo_mcp/tools/filesystem/grep.py +0 -467
- hanzo_mcp/tools/filesystem/search_tool.py +0 -767
- hanzo_mcp/tools/filesystem/symbols_tool.py +0 -515
- hanzo_mcp/tools/filesystem/tree.py +0 -270
- hanzo_mcp/tools/jupyter/notebook_edit.py +0 -317
- hanzo_mcp/tools/jupyter/notebook_read.py +0 -147
- hanzo_mcp/tools/todo/todo_read.py +0 -143
- hanzo_mcp/tools/todo/todo_write.py +0 -374
- hanzo_mcp-0.8.8.dist-info/RECORD +0 -192
- {hanzo_mcp-0.8.8.dist-info → hanzo_mcp-0.9.0.dist-info}/WHEEL +0 -0
- {hanzo_mcp-0.8.8.dist-info → hanzo_mcp-0.9.0.dist-info}/entry_points.txt +0 -0
- {hanzo_mcp-0.8.8.dist-info → hanzo_mcp-0.9.0.dist-info}/top_level.txt +0 -0
|
@@ -88,12 +88,7 @@ class PluginLoader:
|
|
|
88
88
|
|
|
89
89
|
# Find tool classes
|
|
90
90
|
for _name, obj in inspect.getmembers(module):
|
|
91
|
-
if (
|
|
92
|
-
inspect.isclass(obj)
|
|
93
|
-
and issubclass(obj, BaseTool)
|
|
94
|
-
and obj != BaseTool
|
|
95
|
-
and hasattr(obj, "name")
|
|
96
|
-
):
|
|
91
|
+
if inspect.isclass(obj) and issubclass(obj, BaseTool) and obj != BaseTool and hasattr(obj, "name"):
|
|
97
92
|
# Load metadata if available
|
|
98
93
|
metadata = None
|
|
99
94
|
metadata_file = file_path.with_suffix(".json")
|
|
@@ -134,15 +129,8 @@ class PluginLoader:
|
|
|
134
129
|
else:
|
|
135
130
|
# Search for tool classes
|
|
136
131
|
for _name, obj in inspect.getmembers(module):
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
and issubclass(obj, BaseTool)
|
|
140
|
-
and obj != BaseTool
|
|
141
|
-
and hasattr(obj, "name")
|
|
142
|
-
):
|
|
143
|
-
plugin = ToolPlugin(
|
|
144
|
-
name=obj.name, tool_class=obj, source_path=package_dir
|
|
145
|
-
)
|
|
132
|
+
if inspect.isclass(obj) and issubclass(obj, BaseTool) and obj != BaseTool and hasattr(obj, "name"):
|
|
133
|
+
plugin = ToolPlugin(name=obj.name, tool_class=obj, source_path=package_dir)
|
|
146
134
|
self.plugins[obj.name] = plugin
|
|
147
135
|
finally:
|
|
148
136
|
# Remove from path
|
hanzo_mcp/tools/common/stats.py
CHANGED
|
@@ -97,9 +97,7 @@ Example:
|
|
|
97
97
|
memory_used_gb = memory.used / (1024**3)
|
|
98
98
|
memory_total_gb = memory.total / (1024**3)
|
|
99
99
|
memory_percent = memory.percent
|
|
100
|
-
output.append(
|
|
101
|
-
f"Memory: {memory_used_gb:.1f}/{memory_total_gb:.1f} GB ({memory_percent}%)"
|
|
102
|
-
)
|
|
100
|
+
output.append(f"Memory: {memory_used_gb:.1f}/{memory_total_gb:.1f} GB ({memory_percent}%)")
|
|
103
101
|
if memory_percent > 90:
|
|
104
102
|
warnings.append(f"⚠️ HIGH MEMORY USAGE: {memory_percent}%")
|
|
105
103
|
|
|
@@ -109,14 +107,10 @@ Example:
|
|
|
109
107
|
disk_total_gb = disk.total / (1024**3)
|
|
110
108
|
disk_percent = disk.percent
|
|
111
109
|
disk_free_gb = disk.free / (1024**3)
|
|
112
|
-
output.append(
|
|
113
|
-
f"Disk: {disk_used_gb:.1f}/{disk_total_gb:.1f} GB ({disk_percent}%)"
|
|
114
|
-
)
|
|
110
|
+
output.append(f"Disk: {disk_used_gb:.1f}/{disk_total_gb:.1f} GB ({disk_percent}%)")
|
|
115
111
|
output.append(f"Free Space: {disk_free_gb:.1f} GB")
|
|
116
112
|
if disk_percent > 90:
|
|
117
|
-
warnings.append(
|
|
118
|
-
f"⚠️ LOW DISK SPACE: Only {disk_free_gb:.1f} GB free ({100 - disk_percent:.1f}% remaining)"
|
|
119
|
-
)
|
|
113
|
+
warnings.append(f"⚠️ LOW DISK SPACE: Only {disk_free_gb:.1f} GB free ({100 - disk_percent:.1f}% remaining)")
|
|
120
114
|
|
|
121
115
|
output.append("")
|
|
122
116
|
|
|
@@ -173,9 +167,7 @@ Example:
|
|
|
173
167
|
size = db_file.stat().st_size
|
|
174
168
|
total_db_size += size
|
|
175
169
|
|
|
176
|
-
output.append(
|
|
177
|
-
f"Total Database Size: {total_db_size / (1024**2):.1f} MB"
|
|
178
|
-
)
|
|
170
|
+
output.append(f"Total Database Size: {total_db_size / (1024**2):.1f} MB")
|
|
179
171
|
output.append(f"Active Projects: {len(self.db_manager.projects)}")
|
|
180
172
|
|
|
181
173
|
# List largest databases
|
|
@@ -201,9 +193,7 @@ Example:
|
|
|
201
193
|
output.append("=== MCP Servers ===")
|
|
202
194
|
mcp_servers = McpAddTool.get_servers()
|
|
203
195
|
if mcp_servers:
|
|
204
|
-
running_mcp = sum(
|
|
205
|
-
1 for s in mcp_servers.values() if s.get("status") == "running"
|
|
206
|
-
)
|
|
196
|
+
running_mcp = sum(1 for s in mcp_servers.values() if s.get("status") == "running")
|
|
207
197
|
total_mcp_tools = sum(len(s.get("tools", [])) for s in mcp_servers.values())
|
|
208
198
|
|
|
209
199
|
output.append(f"Total Servers: {len(mcp_servers)}")
|
|
@@ -225,9 +215,7 @@ Example:
|
|
|
225
215
|
output.append(f"Log Files: {log_count} ({log_size / (1024**2):.1f} MB)")
|
|
226
216
|
|
|
227
217
|
if log_size > 100 * 1024**2: # > 100MB
|
|
228
|
-
warnings.append(
|
|
229
|
-
f"⚠️ Large log directory: {log_size / (1024**2):.1f} MB"
|
|
230
|
-
)
|
|
218
|
+
warnings.append(f"⚠️ Large log directory: {log_size / (1024**2):.1f} MB")
|
|
231
219
|
|
|
232
220
|
# Config directory
|
|
233
221
|
config_dir = Path.home() / ".hanzo" / "mcp"
|
|
@@ -236,7 +224,7 @@ Example:
|
|
|
236
224
|
output.append(f"Config Files: {config_count}")
|
|
237
225
|
|
|
238
226
|
# Tool status (if available)
|
|
239
|
-
#
|
|
227
|
+
# TODO: Track tool usage statistics
|
|
240
228
|
output.append("\nTool Categories:")
|
|
241
229
|
output.append(" - File Operations: grep, find_files, read, write, edit")
|
|
242
230
|
output.append(" - Shell: bash, run_background, processes, pkill")
|
|
@@ -115,9 +115,7 @@ Feature Implementation Planning
|
|
|
115
115
|
|
|
116
116
|
# Validate required thought parameter
|
|
117
117
|
if not thought:
|
|
118
|
-
await tool_ctx.error(
|
|
119
|
-
"Parameter 'thought' is required but was None or empty"
|
|
120
|
-
)
|
|
118
|
+
await tool_ctx.error("Parameter 'thought' is required but was None or empty")
|
|
121
119
|
return "Error: Parameter 'thought' is required but was None or empty"
|
|
122
120
|
|
|
123
121
|
if thought.strip() == "":
|
|
@@ -125,9 +125,7 @@ Use 'tool_enable' to re-enable disabled tools.
|
|
|
125
125
|
]
|
|
126
126
|
|
|
127
127
|
if not persist:
|
|
128
|
-
output.append(
|
|
129
|
-
"\nNote: This change is temporary and will be lost on restart."
|
|
130
|
-
)
|
|
128
|
+
output.append("\nNote: This change is temporary and will be lost on restart.")
|
|
131
129
|
|
|
132
130
|
# Warn about commonly used tools
|
|
133
131
|
common_tools = {"grep", "read", "write", "bash", "edit"}
|
|
@@ -137,9 +135,7 @@ Use 'tool_enable' to re-enable disabled tools.
|
|
|
137
135
|
)
|
|
138
136
|
|
|
139
137
|
# Count disabled tools
|
|
140
|
-
disabled_count = sum(
|
|
141
|
-
1 for enabled in ToolEnableTool._tool_states.values() if not enabled
|
|
142
|
-
)
|
|
138
|
+
disabled_count = sum(1 for enabled in ToolEnableTool._tool_states.values() if not enabled)
|
|
143
139
|
output.append(f"\nTotal disabled tools: {disabled_count}")
|
|
144
140
|
|
|
145
141
|
return "\n".join(output)
|
|
@@ -205,9 +205,7 @@ Use 'tool_enable' and 'tool_disable' to change tool status.
|
|
|
205
205
|
|
|
206
206
|
# Iterate through categories
|
|
207
207
|
categories = (
|
|
208
|
-
[category_filter]
|
|
209
|
-
if category_filter and category_filter in self.TOOL_INFO
|
|
210
|
-
else self.TOOL_INFO.keys()
|
|
208
|
+
[category_filter] if category_filter and category_filter in self.TOOL_INFO else self.TOOL_INFO.keys()
|
|
211
209
|
)
|
|
212
210
|
|
|
213
211
|
for category in categories:
|
|
@@ -242,9 +240,7 @@ Use 'tool_enable' and 'tool_disable' to change tool status.
|
|
|
242
240
|
max_name_len = max(len(name) for name, _, _ in category_shown)
|
|
243
241
|
|
|
244
242
|
for tool_name, description, status in category_shown:
|
|
245
|
-
output.append(
|
|
246
|
-
f"{status} {tool_name.ljust(max_name_len)} - {description}"
|
|
247
|
-
)
|
|
243
|
+
output.append(f"{status} {tool_name.ljust(max_name_len)} - {description}")
|
|
248
244
|
|
|
249
245
|
output.append("")
|
|
250
246
|
|
|
@@ -32,9 +32,7 @@ class ValidationResult:
|
|
|
32
32
|
return not self.is_valid
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
def validate_path_parameter(
|
|
36
|
-
path: str | None, parameter_name: str = "path"
|
|
37
|
-
) -> ValidationResult:
|
|
35
|
+
def validate_path_parameter(path: str | None, parameter_name: str = "path") -> ValidationResult:
|
|
38
36
|
"""Validate a path parameter.
|
|
39
37
|
|
|
40
38
|
Args:
|