hanzo-mcp 0.7.3__py3-none-any.whl → 0.7.7__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.

Files changed (36) hide show
  1. hanzo_mcp/__init__.py +1 -1
  2. hanzo_mcp/cli.py +10 -0
  3. hanzo_mcp/prompts/__init__.py +43 -0
  4. hanzo_mcp/prompts/example_custom_prompt.py +40 -0
  5. hanzo_mcp/prompts/tool_explorer.py +603 -0
  6. hanzo_mcp/tools/__init__.py +52 -51
  7. hanzo_mcp/tools/agent/__init__.py +3 -16
  8. hanzo_mcp/tools/agent/agent_tool.py +365 -525
  9. hanzo_mcp/tools/agent/agent_tool_v1_deprecated.py +641 -0
  10. hanzo_mcp/tools/agent/network_tool.py +3 -5
  11. hanzo_mcp/tools/agent/swarm_tool.py +447 -349
  12. hanzo_mcp/tools/agent/swarm_tool_v1_deprecated.py +535 -0
  13. hanzo_mcp/tools/agent/tool_adapter.py +21 -2
  14. hanzo_mcp/tools/common/forgiving_edit.py +24 -14
  15. hanzo_mcp/tools/common/permissions.py +8 -0
  16. hanzo_mcp/tools/filesystem/__init__.py +5 -5
  17. hanzo_mcp/tools/filesystem/{symbols.py → ast_tool.py} +8 -8
  18. hanzo_mcp/tools/filesystem/batch_search.py +2 -2
  19. hanzo_mcp/tools/filesystem/directory_tree.py +8 -1
  20. hanzo_mcp/tools/filesystem/find.py +1 -0
  21. hanzo_mcp/tools/filesystem/grep.py +11 -2
  22. hanzo_mcp/tools/filesystem/read.py +8 -1
  23. hanzo_mcp/tools/filesystem/search_tool.py +1 -1
  24. hanzo_mcp/tools/jupyter/__init__.py +5 -1
  25. hanzo_mcp/tools/jupyter/base.py +2 -2
  26. hanzo_mcp/tools/jupyter/jupyter.py +89 -18
  27. hanzo_mcp/tools/search/find_tool.py +49 -8
  28. hanzo_mcp/tools/shell/base_process.py +7 -1
  29. hanzo_mcp/tools/shell/streaming_command.py +34 -1
  30. {hanzo_mcp-0.7.3.dist-info → hanzo_mcp-0.7.7.dist-info}/METADATA +7 -1
  31. {hanzo_mcp-0.7.3.dist-info → hanzo_mcp-0.7.7.dist-info}/RECORD +34 -32
  32. hanzo_mcp/tools/agent/agent_tool_v2.py +0 -492
  33. hanzo_mcp/tools/agent/swarm_tool_v2.py +0 -654
  34. {hanzo_mcp-0.7.3.dist-info → hanzo_mcp-0.7.7.dist-info}/WHEEL +0 -0
  35. {hanzo_mcp-0.7.3.dist-info → hanzo_mcp-0.7.7.dist-info}/entry_points.txt +0 -0
  36. {hanzo_mcp-0.7.3.dist-info → hanzo_mcp-0.7.7.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- hanzo_mcp/__init__.py,sha256=u_sq1RxXsMYSHcKa9iuMSjVhooegJyiHbPhVIc9O4oE,361
1
+ hanzo_mcp/__init__.py,sha256=U5Z6_6chxxWXErixZYCuJ2riBtCYMJo7Z2Ife5J1Avw,360
2
2
  hanzo_mcp/__main__.py,sha256=TY-sUBg0MJozJws4-e3_kT8mJVoYGKCk6G3gPGxjIBI,129
3
- hanzo_mcp/cli.py,sha256=NU861dStkBtnerDvV3uTjBL_2RGV2Ujz0C6DnNI8BXI,13295
3
+ hanzo_mcp/cli.py,sha256=jAN0NennVl0zn04RLY9EVSE5StTEZq8_60hNuQJJsSk,13542
4
4
  hanzo_mcp/cli_enhanced.py,sha256=T_AATmhSoKxEdltB-OY8iv5FxD2yI-d-TtDJ3ui-eY0,15966
5
5
  hanzo_mcp/cli_plugin.py,sha256=FjBklPtpIbpgSNq5QfIeeWCO3otjOJPFXcpfKP8bGBw,3181
6
6
  hanzo_mcp/dev_server.py,sha256=Ie1egLSmzu2i_kRLorIIlpfHyS-hZBv9P9yUjjAEVVc,8134
@@ -12,17 +12,19 @@ hanzo_mcp/analytics/posthog_analytics.py,sha256=XOt7hkvswyYEaKE8f6nmWl-Tr4BvKhM0
12
12
  hanzo_mcp/config/__init__.py,sha256=E3GQ0EMerdJI8mbTL2uhlBPiJYykNOnAoPorIpP2QKM,505
13
13
  hanzo_mcp/config/settings.py,sha256=kA7O8MaDv988H1xlywXWfO1pyGTsoZVR77_aRVR7wg0,18508
14
14
  hanzo_mcp/config/tool_config.py,sha256=MhRg-IhgYEY74CNywJskWBxMo0TX6fE6vnBWnqH2y14,6854
15
- hanzo_mcp/prompts/__init__.py,sha256=Fp2Jr6SmUd6QmasOclgkTIb4qCzRSqtu3i-0d98XKEg,3992
15
+ hanzo_mcp/prompts/__init__.py,sha256=4nH23rNCh9H2jXHNhvxE1lO1SzOxecOeQijgnck6GZM,5249
16
16
  hanzo_mcp/prompts/compact_conversation.py,sha256=nvD068KEesiMcevxxMBeIJh6AqT7YHOqyH6RepRFFfA,4206
17
17
  hanzo_mcp/prompts/create_release.py,sha256=1Z8xSTtz5vAm0rWFnERpFu7wIYExT4iXhM6nGmQaM-s,1374
18
+ hanzo_mcp/prompts/example_custom_prompt.py,sha256=NXOGYtCgcY0JCHrmYP-rCcnyBDz72NHv5qe5nLQIcj4,1680
18
19
  hanzo_mcp/prompts/project_system.py,sha256=FgWxRaX7rPQwDZT3n69yBwLkQv4uJ4jcUZjKzikjR9A,8230
19
20
  hanzo_mcp/prompts/project_todo_reminder.py,sha256=otiBdmzxssBSb3MZZSQsjYDGLBqi1bM0HgraELP_Nf4,3645
21
+ hanzo_mcp/prompts/tool_explorer.py,sha256=At2z8o6zuHHOypwT607HpXNHPTByL5KIJPGnbhiuPWA,16410
20
22
  hanzo_mcp/prompts/utils.py,sha256=IwxIhzZfYJ2anToPulbrpcc07u4Dozo9ok6VE3BC_4A,9963
21
- hanzo_mcp/tools/__init__.py,sha256=QXnDVa7MjTsGT2MnEXJcUdWS0e5Grw9_mX0rwhZ-F3k,18811
22
- hanzo_mcp/tools/agent/__init__.py,sha256=Op9hy3rrRCvhzH85mUXWPhFQWYgFbmr486ehl7EaziU,4847
23
+ hanzo_mcp/tools/__init__.py,sha256=O5Rz12cCOMXRYr1_vWEV_icZDl3ClX38kKC_jErIgQg,18435
24
+ hanzo_mcp/tools/agent/__init__.py,sha256=UXspGTEFHAfvDh6KuoSz4OtvaEZoctsmmq69y_yXVeY,4288
23
25
  hanzo_mcp/tools/agent/agent.py,sha256=xWYV6-ACIut_u2yiaobmN5szvoBOs8vre0opNKcKkmY,13541
24
- hanzo_mcp/tools/agent/agent_tool.py,sha256=xh7ts4ZOGhe9AiQ1B6fuqvy3HfL-Gtd6azeQfey0PAk,26744
25
- hanzo_mcp/tools/agent/agent_tool_v2.py,sha256=83yn4GKNJ6N0TSk97kfOK7kyO_RI89c0aPae0rwV9HI,17155
26
+ hanzo_mcp/tools/agent/agent_tool.py,sha256=PO6Vtgk0P4AhdzBTXZhfJSEX5QvEEg3wbYvTHWnK2b0,16659
27
+ hanzo_mcp/tools/agent/agent_tool_v1_deprecated.py,sha256=xh7ts4ZOGhe9AiQ1B6fuqvy3HfL-Gtd6azeQfey0PAk,26744
26
28
  hanzo_mcp/tools/agent/clarification_protocol.py,sha256=haSUDJQVLAQLpp0doFdqxfSDUWeyzDNL38xcI918_H8,8135
27
29
  hanzo_mcp/tools/agent/clarification_tool.py,sha256=yXuo6z8N5wq0Ll5-Tg8RYHtyeexxFREQrC0JlhKrbyk,2469
28
30
  hanzo_mcp/tools/agent/claude_cli_tool.py,sha256=TM2VT6FlbUlyLp9QWZ_UBqmSjfNT-F9cmeUHSIupF_o,3904
@@ -35,12 +37,12 @@ hanzo_mcp/tools/agent/critic_tool.py,sha256=WGE9IcashxSDsLaUkQTiR78u89-3PqAMcJff
35
37
  hanzo_mcp/tools/agent/gemini_cli_tool.py,sha256=HSzZJP1dgs6cZ2D9CNkkTLGkvGex-jmTMiUHDX49Qdo,4027
36
38
  hanzo_mcp/tools/agent/grok_cli_tool.py,sha256=cBBNixC92wjblzlJqI8ar4yg88M9692qOP40gt9YlY8,3861
37
39
  hanzo_mcp/tools/agent/iching_tool.py,sha256=dXEJLFtwMQNnPWquxsbAuNH6_hB2sva82Q9VN_Qn0_A,20878
38
- hanzo_mcp/tools/agent/network_tool.py,sha256=83S-ggTUINGkQjuAcQQjYkx2BUCS6O2POI8vPqS8SlM,10223
40
+ hanzo_mcp/tools/agent/network_tool.py,sha256=0IUoxOGljzM5mZK8m9sTA2M22wcjNPnWPUN658rKNJk,10087
39
41
  hanzo_mcp/tools/agent/prompt.py,sha256=O5aTf6ooF_KLUgeELjNPoJuxIqFh_pQtDhda9TohQVU,6806
40
42
  hanzo_mcp/tools/agent/review_tool.py,sha256=5HeltukjfLfg6EqwExsz7y2h4_lJnqybRQhtbR2DpO8,17257
41
- hanzo_mcp/tools/agent/swarm_tool.py,sha256=W-czkW1mAdgsAb87f3u0y3r1WA_p_fHotT7hJZUd7Io,21038
42
- hanzo_mcp/tools/agent/swarm_tool_v2.py,sha256=VhiUCEYv4s9hPLsJoRs-6avEOM1IKqfWI5i69gcbaa0,23346
43
- hanzo_mcp/tools/agent/tool_adapter.py,sha256=HbuCOuj21hdNlUu0vLQq2QRupi7vCDhMPj2MH-oTwKE,2302
43
+ hanzo_mcp/tools/agent/swarm_tool.py,sha256=9vdU_PoUvhqX2i_bnLvpdW8IuGrziOPpLjsfcboJIGo,22346
44
+ hanzo_mcp/tools/agent/swarm_tool_v1_deprecated.py,sha256=W-czkW1mAdgsAb87f3u0y3r1WA_p_fHotT7hJZUd7Io,21038
45
+ hanzo_mcp/tools/agent/tool_adapter.py,sha256=DEFCocQNm1kocw0NZmpueYpAMnvsJzR1Ca4OndGEG0M,3141
44
46
  hanzo_mcp/tools/common/__init__.py,sha256=QQqwCAtOEvWlQ48O-8s_vayY58peGSfk1AgmWJSuQus,1283
45
47
  hanzo_mcp/tools/common/base.py,sha256=Yu6aQX3ma-uLcHf1frLStw1U3zCiOvuROHdr0HPoyc8,5946
46
48
  hanzo_mcp/tools/common/batch_tool.py,sha256=GYNGG4tTemmgJEvyUodRq5ysQe0_gpIAQ0WjLRcbjwg,16070
@@ -51,13 +53,13 @@ hanzo_mcp/tools/common/critic_tool.py,sha256=0wj9in66AmLQs8bTCiuNxnSSYyUZUursIIX
51
53
  hanzo_mcp/tools/common/decorators.py,sha256=4CIpYTrcTKSM1zGKFGGjDwgxJXKKKthavzz_cLGqw2U,6806
52
54
  hanzo_mcp/tools/common/enhanced_base.py,sha256=8jF7QNFmS1owhqJLzdClpDkbS3INj49DQ_Rn_yvdIoY,3781
53
55
  hanzo_mcp/tools/common/fastmcp_pagination.py,sha256=fbfXsOWb80bSHoDmMhKLthCaHlF_T3MQ42lzjplmOUU,12144
54
- hanzo_mcp/tools/common/forgiving_edit.py,sha256=6SGMrItHQdAkaqx0y73ivK8vKa5nJTpNbuXtmB_Y7t4,9129
56
+ hanzo_mcp/tools/common/forgiving_edit.py,sha256=_l2_Q9zWe2_rP7b376cskKLgMnE8cMAgpn2zkShQ5S0,9642
55
57
  hanzo_mcp/tools/common/mode.py,sha256=3tHBnhR-N6fxmEJPelLMyeHIUqXx-q0lSGU5BWCPw14,3320
56
58
  hanzo_mcp/tools/common/mode_loader.py,sha256=341MxmYmJHwM5WAfQnULbfoypEAnyME-tEu69_8J44Y,3340
57
59
  hanzo_mcp/tools/common/paginated_base.py,sha256=Yrrmcy-WnA885cd7Coi-CCHQXboqsjgl8_K8jrEb-Ts,8902
58
60
  hanzo_mcp/tools/common/paginated_response.py,sha256=Qqjd_mS0SV1vztV_DY_-iShMBRS5eeQnRor8pKvi0vk,10563
59
61
  hanzo_mcp/tools/common/pagination.py,sha256=rTIb-dCm8jMb4ElFa8BWkad8HFAB55RUpnyKgSChGw4,6413
60
- hanzo_mcp/tools/common/permissions.py,sha256=D6oK5eWqkAZt-tUeL717-NnmYLzcX22wsq86zzhOdfc,7561
62
+ hanzo_mcp/tools/common/permissions.py,sha256=pLBu68fgt8mFStVdh_w1_-DsstUT532fXIlL7x_d8iM,7862
61
63
  hanzo_mcp/tools/common/personality.py,sha256=8Ly46Ui95t-KbaMz5k6gVQG87Acz7p32sU4Cz-RwtuM,36884
62
64
  hanzo_mcp/tools/common/plugin_loader.py,sha256=XUEmxkdteOSejoTnRMeEMXdCOrDPRTt0BvvrvrBA4is,9191
63
65
  hanzo_mcp/tools/common/stats.py,sha256=Idv5lkJjx6PUbpgLkifwrrd09bigzLKgpZHGZFJT5qQ,9765
@@ -87,32 +89,32 @@ hanzo_mcp/tools/editor/__init__.py,sha256=UfwWP23OUFmd6dYRwm2fKfaYDlignQ2gfi32yR
87
89
  hanzo_mcp/tools/editor/neovim_command.py,sha256=R4OtUia7WKdzOK8AHDrNpHii5GDJmHWwZigFy9ATycs,8283
88
90
  hanzo_mcp/tools/editor/neovim_edit.py,sha256=Hq10p1LIHBM_jGIyvjQYtJr8NR5pAeLRM6GfnGHFzTg,8816
89
91
  hanzo_mcp/tools/editor/neovim_session.py,sha256=H1AhXBod9HzcYv4fQu4pOlBcyfwgjUo24lzenDZfqRU,11962
90
- hanzo_mcp/tools/filesystem/__init__.py,sha256=navUNfGxyJqHfc-mVhuAPMGeyjauB9WyknhzSitFQME,7849
92
+ hanzo_mcp/tools/filesystem/__init__.py,sha256=TKxGKUkSQtrh3AW4hGLq-hGoJVyiPhMUJza9rdfHm7s,7826
91
93
  hanzo_mcp/tools/filesystem/ast_multi_edit.py,sha256=DdcVYEbdKIgrPOPJVxmirt_xXfkffFhtBdXpOkCaZek,22084
94
+ hanzo_mcp/tools/filesystem/ast_tool.py,sha256=1WjQE-VDsn8DVOZ--uCjjZIR5UUY_LZXk5lyhHu1iRo,7285
92
95
  hanzo_mcp/tools/filesystem/base.py,sha256=0_6PBU1yqGRIQ8ggQNMEA2rB4DXTFg7sMJRAoocN9do,3818
93
- hanzo_mcp/tools/filesystem/batch_search.py,sha256=nnl72e-HzkjrGCcnyn-2E8VkKBNRx7-0NxxiYFznbhc,34278
96
+ hanzo_mcp/tools/filesystem/batch_search.py,sha256=o2xBh5EneCzJ-MthWfaEwvVBGkvvuvzRrNWdlLGi_P8,34271
94
97
  hanzo_mcp/tools/filesystem/content_replace.py,sha256=9GvQhJP1yBJsLQZPHs1UJZ6hxLBh1gCmZaU_CI4kbsA,9958
95
98
  hanzo_mcp/tools/filesystem/diff.py,sha256=0ukeGSvkf4PosKhlvQltMuFKA7and_H5T8c632LEX6U,7618
96
- hanzo_mcp/tools/filesystem/directory_tree.py,sha256=H_fuqNot8Qx3eJQXBsFGIUVyASGFjXgnO_viT_gCLwU,10696
99
+ hanzo_mcp/tools/filesystem/directory_tree.py,sha256=7zs1WBobiNhvHY-G-vNDuGXKgot02Y21Kk0gujBcmZM,11117
97
100
  hanzo_mcp/tools/filesystem/directory_tree_paginated.py,sha256=bP3ns4jW0srTiIqsmj6tvJ76Xj89JvjYrOofXQ9iXmU,11511
98
101
  hanzo_mcp/tools/filesystem/edit.py,sha256=jqn1ae3tL5JrHQYm-uWHbXZSuAtw8o2Nj2yYJ1CGg8k,10632
99
- hanzo_mcp/tools/filesystem/find.py,sha256=897Lnd2507979hBzkskU5gEj1XDJdr7Gr9hTZIAWkUU,15337
102
+ hanzo_mcp/tools/filesystem/find.py,sha256=f3Cib0tWdOp0yAMsCO_Hn3VunRJ89sF28v8XSqoqlrM,15399
100
103
  hanzo_mcp/tools/filesystem/find_files.py,sha256=BjmDzXvfXLV7_5NSZ7whhxXzJbM-vP1O0xq411PReSk,10959
101
104
  hanzo_mcp/tools/filesystem/git_search.py,sha256=qOOIxuATu6UPdlWokJaifaKLphj1Y3uMREqCMD9weOk,16220
102
- hanzo_mcp/tools/filesystem/grep.py,sha256=LDBGEpN2dj5xW1VvfgDxlkx4QqofWeztqwdyf_pSup0,16832
105
+ hanzo_mcp/tools/filesystem/grep.py,sha256=nhgFfwRvclKjScKVSL1Hd5JBIxMHXjlD5uz-8laFf00,17374
103
106
  hanzo_mcp/tools/filesystem/multi_edit.py,sha256=p6_OJNBn9uzCxVcLJrL88gze_P4O8j2Lm0-DZAESwpY,14242
104
- hanzo_mcp/tools/filesystem/read.py,sha256=y8FV9S4GZZLNMplrIZrz5FrqQ0xT3OiIHav-a2uDBzs,9342
107
+ hanzo_mcp/tools/filesystem/read.py,sha256=hJP0AZWHCTCM9xrn2qZCIOVFDS-qfYagSojZ6i6XC2I,9726
105
108
  hanzo_mcp/tools/filesystem/rules_tool.py,sha256=QBm2FnuN3HlIHC5M5vkAE8fvMrtebQskb31KJ_R1mec,8311
106
- hanzo_mcp/tools/filesystem/search_tool.py,sha256=m2i8A-iC9oyL6KR0fsPXbD7QXDORJksb2iB_xqNLz8s,26580
107
- hanzo_mcp/tools/filesystem/symbols.py,sha256=gwLwA2PA6YuT7hojjFVHq2xVPuB2xlyTYyVbBow7AXY,7290
109
+ hanzo_mcp/tools/filesystem/search_tool.py,sha256=Tz2qGwY2fgJSpzRuhv0NbR2MGsRnQfXl0GP7FxqV4Wc,26585
108
110
  hanzo_mcp/tools/filesystem/symbols_tool.py,sha256=oCS734s17Q2KjGGw0vXcKOzJclrLvuHPE0NXCS_BN-U,15993
109
111
  hanzo_mcp/tools/filesystem/tree.py,sha256=MPBb3jHWa09DezDILP3FP7S_XCY2dJYQM-zUVYUloQQ,7497
110
112
  hanzo_mcp/tools/filesystem/unix_aliases.py,sha256=jagrJbDo97Kpt3Zu3LQcuw_z28MQlADrNPbWgk6_cA0,3162
111
113
  hanzo_mcp/tools/filesystem/watch.py,sha256=in8vDAaInagg5gWT5hOcgioN7hs5nuEDeln3yaxrW5c,7100
112
114
  hanzo_mcp/tools/filesystem/write.py,sha256=FwumcJX9RW_Xy8noKh-S3p95KRyOUG59Nl4w5lznV40,4762
113
- hanzo_mcp/tools/jupyter/__init__.py,sha256=QQV3Vq13L5TicBWaSHtgg7HNteGjkmj67PXfWbrvcqY,2416
114
- hanzo_mcp/tools/jupyter/base.py,sha256=cK190wDExYyUFu7qrT-s5sHglPd9k6SrlpA60sLwFFE,10101
115
- hanzo_mcp/tools/jupyter/jupyter.py,sha256=48QgVTgoHmlKRk2D1oxMckIDr92CzZmKuWyzpdagceo,11749
115
+ hanzo_mcp/tools/jupyter/__init__.py,sha256=KVu1VZ2gazhSJbDTIYugVro44zc__63U5Th7qfIo2yk,2658
116
+ hanzo_mcp/tools/jupyter/base.py,sha256=3iaEovX2ENFAWjFCoZOCUbBMN7KF27jh0KMHTPavg9Y,10113
117
+ hanzo_mcp/tools/jupyter/jupyter.py,sha256=mixZHONUl6oxNlaub2ItKaNSm53AczIsl4KeNENntOY,14421
116
118
  hanzo_mcp/tools/jupyter/notebook_edit.py,sha256=MeaeUgvPnc5EmvgzbtJGIqKqFuUFt_8RE-XzBouYU4Q,11806
117
119
  hanzo_mcp/tools/jupyter/notebook_read.py,sha256=Au6Ad3N1Z5cYq2yIbu5y9H4oF6SwOj6SdHQeBwP7Gus,5222
118
120
  hanzo_mcp/tools/llm/__init__.py,sha256=7bb3oAPAGkv_jFmGNXK6RSTFqjbty9Iklp1WqQXsM2s,703
@@ -131,12 +133,12 @@ hanzo_mcp/tools/memory/__init__.py,sha256=1ndJ_bwVVt0xFCpEYDUBHQjby6hM4Uww3Av_ai
131
133
  hanzo_mcp/tools/memory/knowledge_tools.py,sha256=52lWw5Km6rUjvsFXMAgXAIGO91qyDTvpK6WJOZNSfM0,17922
132
134
  hanzo_mcp/tools/memory/memory_tools.py,sha256=jBF4HVsOFURBMOV4KXD1z4e-_O5oRKy63DqeFFppHsc,14267
133
135
  hanzo_mcp/tools/search/__init__.py,sha256=nYhD_YhR4YLtA4lHK8hKW9XErw0g-JvRB8NF_T8vrd4,272
134
- hanzo_mcp/tools/search/find_tool.py,sha256=5h7r8nWox80YpgevgRNnr1Gg-CCMYfWu2xD9Qj4O8Bw,22243
136
+ hanzo_mcp/tools/search/find_tool.py,sha256=qSaNsAP2kIqXbdXLPdWLx7bkie_jFKmCSpKMXXVpTA8,23767
135
137
  hanzo_mcp/tools/search/unified_search.py,sha256=c2Di9eOcFtDh8FJMpt9nFB1PkkVtD-8lzyProkoaatI,37429
136
138
  hanzo_mcp/tools/shell/__init__.py,sha256=Ejgww5ots7XYXnf4uVJ3qvu9CROCHEEps622P4OzUWM,1996
137
139
  hanzo_mcp/tools/shell/auto_background.py,sha256=m_S815bsS2B5bIpjolFI1qA2V7SenLq0emqpGDrHIlE,7590
138
140
  hanzo_mcp/tools/shell/base.py,sha256=Nx9rAE7CO9-Hr5k_qYKUtNFq4twI6Z-lOt0fpkS57i4,5832
139
- hanzo_mcp/tools/shell/base_process.py,sha256=h6jg5O_SK6n4QVFC7-4z6kJRlPgxnVEOYt7hofxny4w,10520
141
+ hanzo_mcp/tools/shell/base_process.py,sha256=yfAmLu8xHxDYH9xbmXE1bUyQidHA_G8KQKfBlEzNtTk,10856
140
142
  hanzo_mcp/tools/shell/bash_session.py,sha256=YPtdtC0pc6Q04RJqKUy0u0RPTbiT2IGtsvFqejK5Hu4,27271
141
143
  hanzo_mcp/tools/shell/bash_session_executor.py,sha256=BcR6aJgluRdj0lepV8MrIkeYo3S9MrbuIqIjtV12WHQ,10891
142
144
  hanzo_mcp/tools/shell/bash_tool.py,sha256=kjJpwaXHx5Xmjannvw4NVVJFY2HmDU5hH_ZGyYyPMZ0,4453
@@ -154,7 +156,7 @@ hanzo_mcp/tools/shell/run_command.py,sha256=AEH3waGpjbaSxBxSfmDW6hF7aL4pzwEwgUoj
154
156
  hanzo_mcp/tools/shell/run_command_windows.py,sha256=FZ8fUjqvsdGvzyyvagNiQ6ot_isHvVtvCt39MZ5FNks,15320
155
157
  hanzo_mcp/tools/shell/session_manager.py,sha256=o8iS4PFCnq28vPqYtdtH9M8lfGyzyhtNL0hmNI13Uuc,6509
156
158
  hanzo_mcp/tools/shell/session_storage.py,sha256=elnyFgn0FwsmVvoWAoJFAqiEeNaK4_yByT8-zXa6r-o,10141
157
- hanzo_mcp/tools/shell/streaming_command.py,sha256=gHh1J5AxOPgI2pcqhGHXv8sVxMrAkSmqBDsF2V6oNMQ,22312
159
+ hanzo_mcp/tools/shell/streaming_command.py,sha256=EBaimyzwN6y4fdTH5X0huLwXQljbmJGXwgPu8YXAb1g,23263
158
160
  hanzo_mcp/tools/shell/uvx.py,sha256=f8Lmn35epWmvEfhzWbKju1KMRotLyqT8VmZ-vXeOL1Y,6749
159
161
  hanzo_mcp/tools/shell/uvx_background.py,sha256=sgUSPbDavgnREePVBl0eSe8UhekPHnSVBc2YDHHUo2c,8820
160
162
  hanzo_mcp/tools/shell/uvx_tool.py,sha256=vCqsn756vOEwC7QP-8JQHM_BtskJjSrviaRVxVPs5YU,3068
@@ -173,8 +175,8 @@ hanzo_mcp/tools/vector/project_manager.py,sha256=PBaO5WMT5SJRM6wENMZXCCG86P2p5Pf
173
175
  hanzo_mcp/tools/vector/vector.py,sha256=EpKEDkRfSHsDfPewqRwNAulX0BndlK48p-sFSMtt3js,10179
174
176
  hanzo_mcp/tools/vector/vector_index.py,sha256=IqXoEfEk6TOOEThXw4obePZqfvBRiYL_LCrx8z35-h8,4403
175
177
  hanzo_mcp/tools/vector/vector_search.py,sha256=jwX1azf4V4seqJ2CIDloX3lJ5_hkUl7X5e2OOgGXQNk,9647
176
- hanzo_mcp-0.7.3.dist-info/METADATA,sha256=GfA_wU2sO36TXf3BbqLD46r27Oft_tQ1o6jEc8Rtx9M,16190
177
- hanzo_mcp-0.7.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
178
- hanzo_mcp-0.7.3.dist-info/entry_points.txt,sha256=ML30pedHV5wjthfztzMMz3uYhNdR_6inzYY5pSqNME4,142
179
- hanzo_mcp-0.7.3.dist-info/top_level.txt,sha256=eGFANatA0MHWiVlpS56fTYRIShtibrSom1uXI6XU0GU,10
180
- hanzo_mcp-0.7.3.dist-info/RECORD,,
178
+ hanzo_mcp-0.7.7.dist-info/METADATA,sha256=6NJK45_DVGKJU_3faDDRPQTdKQwImM77F3aCIPMxRwk,16472
179
+ hanzo_mcp-0.7.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
180
+ hanzo_mcp-0.7.7.dist-info/entry_points.txt,sha256=ML30pedHV5wjthfztzMMz3uYhNdR_6inzYY5pSqNME4,142
181
+ hanzo_mcp-0.7.7.dist-info/top_level.txt,sha256=eGFANatA0MHWiVlpS56fTYRIShtibrSom1uXI6XU0GU,10
182
+ hanzo_mcp-0.7.7.dist-info/RECORD,,
@@ -1,492 +0,0 @@
1
- """Agent tool implementation using hanzo-agents SDK.
2
-
3
- This module implements the AgentTool that leverages the hanzo-agents SDK
4
- for sophisticated agent orchestration and execution.
5
- """
6
-
7
- import asyncio
8
- import json
9
- import os
10
- import re
11
- import time
12
- from typing import Annotated, TypedDict, Unpack, final, override, Optional, Dict, Any, List
13
-
14
- from mcp.server.fastmcp import Context as MCPContext
15
- from mcp.server import FastMCP
16
- from pydantic import Field
17
-
18
- # Import hanzo-agents SDK
19
- try:
20
- from hanzo_agents import (
21
- Agent, State, Network, Tool, History,
22
- ModelRegistry, InferenceResult, ToolCall,
23
- create_memory_kv, create_memory_vector,
24
- sequential_router, state_based_router,
25
- )
26
- from hanzo_agents.core.cli_agent import (
27
- ClaudeCodeAgent, OpenAICodexAgent,
28
- GeminiAgent, GrokAgent
29
- )
30
- HANZO_AGENTS_AVAILABLE = True
31
- except ImportError:
32
- HANZO_AGENTS_AVAILABLE = False
33
- # Define stub classes when hanzo-agents is not available
34
- class State:
35
- """Stub State class when hanzo-agents is not available."""
36
- def __init__(self):
37
- pass
38
- def to_dict(self):
39
- return {}
40
- @classmethod
41
- def from_dict(cls, data):
42
- return cls()
43
-
44
- class Tool:
45
- """Stub Tool class when hanzo-agents is not available."""
46
- pass
47
-
48
- class Agent:
49
- """Stub Agent class when hanzo-agents is not available."""
50
- pass
51
-
52
- class Network:
53
- """Stub Network class when hanzo-agents is not available."""
54
- pass
55
-
56
- class History:
57
- """Stub History class when hanzo-agents is not available."""
58
- pass
59
-
60
- class InferenceResult:
61
- """Stub InferenceResult class when hanzo-agents is not available."""
62
- def __init__(self, agent=None, content=None, metadata=None):
63
- self.agent = agent
64
- self.content = content
65
- self.metadata = metadata or {}
66
-
67
- from hanzo_mcp.tools.common.base import BaseTool
68
- from hanzo_mcp.tools.common.context import ToolContext, create_tool_context
69
- from hanzo_mcp.tools.common.permissions import PermissionManager
70
- from hanzo_mcp.tools.filesystem import get_read_only_filesystem_tools, Edit, MultiEdit
71
- from hanzo_mcp.tools.jupyter import get_read_only_jupyter_tools
72
- from hanzo_mcp.tools.common.batch_tool import BatchTool
73
- from hanzo_mcp.tools.agent.clarification_protocol import AgentClarificationMixin, ClarificationType
74
- from hanzo_mcp.tools.agent.clarification_tool import ClarificationTool
75
- from hanzo_mcp.tools.agent.critic_tool import CriticTool
76
- from hanzo_mcp.tools.agent.review_tool import ReviewTool
77
- from hanzo_mcp.tools.agent.iching_tool import IChingTool
78
-
79
-
80
- class AgentToolParams(TypedDict, total=False):
81
- """Parameters for the AgentTool."""
82
- prompts: str | list[str]
83
- model: Optional[str]
84
- use_memory: Optional[bool]
85
- memory_backend: Optional[str]
86
-
87
-
88
- class MCPAgentState(State):
89
- """State for MCP agents."""
90
-
91
- def __init__(self, prompts: List[str], context: Dict[str, Any]):
92
- """Initialize agent state."""
93
- super().__init__()
94
- self.prompts = prompts
95
- self.context = context
96
- self.current_prompt_index = 0
97
- self.results = []
98
-
99
- def to_dict(self) -> Dict[str, Any]:
100
- """Convert to dictionary."""
101
- base_dict = super().to_dict()
102
- base_dict.update({
103
- "prompts": self.prompts,
104
- "context": self.context,
105
- "current_prompt_index": self.current_prompt_index,
106
- "results": self.results
107
- })
108
- return base_dict
109
-
110
- @classmethod
111
- def from_dict(cls, data: Dict[str, Any]) -> "MCPAgentState":
112
- """Create from dictionary."""
113
- state = cls(
114
- prompts=data.get("prompts", []),
115
- context=data.get("context", {})
116
- )
117
- state.current_prompt_index = data.get("current_prompt_index", 0)
118
- state.results = data.get("results", [])
119
- for k, v in data.items():
120
- if k not in ["prompts", "context", "current_prompt_index", "results"]:
121
- state[k] = v
122
- return state
123
-
124
-
125
- class MCPToolAdapter(Tool):
126
- """Adapter to wrap MCP tools for hanzo-agents."""
127
-
128
- def __init__(self, mcp_tool: BaseTool, ctx: MCPContext):
129
- """Initialize adapter."""
130
- self.mcp_tool = mcp_tool
131
- self.ctx = ctx
132
-
133
- @property
134
- def name(self) -> str:
135
- """Get tool name."""
136
- return self.mcp_tool.name
137
-
138
- @property
139
- def description(self) -> str:
140
- """Get tool description."""
141
- return self.mcp_tool.description
142
-
143
- async def execute(self, **kwargs) -> str:
144
- """Execute the MCP tool."""
145
- return await self.mcp_tool.call(self.ctx, **kwargs)
146
-
147
-
148
- class MCPAgent(Agent):
149
- """Agent that executes MCP tasks."""
150
-
151
- name = "mcp_agent"
152
- description = "Agent for executing MCP tasks"
153
-
154
- def __init__(self,
155
- available_tools: List[BaseTool],
156
- permission_manager: PermissionManager,
157
- ctx: MCPContext,
158
- model: str = "model://anthropic/claude-3-5-sonnet-20241022",
159
- **kwargs):
160
- """Initialize MCP agent."""
161
- super().__init__(model=model, **kwargs)
162
-
163
- self.available_tools = available_tools
164
- self.permission_manager = permission_manager
165
- self.ctx = ctx
166
-
167
- # Register MCP tools as agent tools
168
- for mcp_tool in available_tools:
169
- adapter = MCPToolAdapter(mcp_tool, ctx)
170
- self.register_tool(adapter)
171
-
172
- async def run(self, state: MCPAgentState, history: History, network: Network) -> InferenceResult:
173
- """Execute the agent."""
174
- # Get current prompt
175
- if state.current_prompt_index >= len(state.prompts):
176
- return InferenceResult(
177
- agent=self.name,
178
- content="All prompts completed",
179
- metadata={"completed": True}
180
- )
181
-
182
- prompt = state.prompts[state.current_prompt_index]
183
-
184
- # Execute with tools
185
- messages = [
186
- {"role": "system", "content": self._get_system_prompt()},
187
- {"role": "user", "content": prompt}
188
- ]
189
-
190
- # Add history context
191
- for entry in history[-10:]:
192
- if entry.role == "assistant":
193
- messages.append({
194
- "role": "assistant",
195
- "content": entry.content
196
- })
197
- elif entry.role == "user":
198
- messages.append({
199
- "role": "user",
200
- "content": entry.content
201
- })
202
-
203
- # Call model
204
- from hanzo_agents import ModelRegistry
205
- adapter = ModelRegistry.get_adapter(self.model)
206
- response = await adapter.chat(messages)
207
-
208
- # Update state
209
- state.current_prompt_index += 1
210
- state.results.append(response)
211
-
212
- # Return result
213
- return InferenceResult(
214
- agent=self.name,
215
- content=response,
216
- metadata={
217
- "prompt_index": state.current_prompt_index - 1,
218
- "total_prompts": len(state.prompts)
219
- }
220
- )
221
-
222
- def _get_system_prompt(self) -> str:
223
- """Get system prompt for the agent."""
224
- tool_descriptions = []
225
- for tool in self.tools.values():
226
- tool_descriptions.append(f"- {tool.name}: {tool.description}")
227
-
228
- return f"""You are an AI assistant with access to the following tools:
229
-
230
- {chr(10).join(tool_descriptions)}
231
-
232
- When you need to use a tool, respond with:
233
- TOOL: tool_name(arg1="value1", arg2="value2")
234
-
235
- Important guidelines:
236
- - Always include absolute paths starting with / when working with files
237
- - Be thorough in your searches and analysis
238
- - Provide clear, actionable results
239
- - Edit files when requested to make changes
240
- """
241
-
242
-
243
- @final
244
- class AgentTool(AgentClarificationMixin, BaseTool):
245
- """Tool for delegating tasks to sub-agents using hanzo-agents SDK."""
246
-
247
- @property
248
- @override
249
- def name(self) -> str:
250
- """Get the tool name."""
251
- return "agent"
252
-
253
- @property
254
- @override
255
- def description(self) -> str:
256
- """Get the tool description."""
257
- if not HANZO_AGENTS_AVAILABLE:
258
- return "Agent tool (hanzo-agents SDK not available - using fallback)"
259
-
260
- at = [t.name for t in self.available_tools]
261
- return f"""Launch a new agent that has access to the following tools: {at}.
262
-
263
- When to use the Agent tool:
264
- - If you are searching for a keyword like "config" or "logger"
265
- - When you need to perform edits across multiple files
266
- - When you need to delegate complex file modification tasks
267
-
268
- When NOT to use the Agent tool:
269
- - If you want to read a specific file path
270
- - If you are searching for a specific class definition
271
- - Writing code and running bash commands
272
- - Other tasks that are not related to searching
273
-
274
- Usage notes:
275
- 1. Launch multiple agents concurrently whenever possible
276
- 2. Agent results are not visible to the user - summarize them
277
- 3. Each agent invocation is stateless
278
- 4. The agent's outputs should generally be trusted
279
- 5. Clearly tell the agent whether you expect it to write code or just do research"""
280
-
281
- def __init__(
282
- self,
283
- permission_manager: PermissionManager,
284
- model: str | None = None,
285
- api_key: str | None = None,
286
- base_url: str | None = None,
287
- max_tokens: int | None = None,
288
- max_iterations: int = 10,
289
- max_tool_uses: int = 30,
290
- ) -> None:
291
- """Initialize the agent tool."""
292
- self.permission_manager = permission_manager
293
- self.model_override = model
294
- self.api_key_override = api_key
295
- self.base_url_override = base_url
296
- self.max_tokens_override = max_tokens
297
- self.max_iterations = max_iterations
298
- self.max_tool_uses = max_tool_uses
299
-
300
- # Set up available tools
301
- self.available_tools: list[BaseTool] = []
302
- self.available_tools.extend(
303
- get_read_only_filesystem_tools(self.permission_manager)
304
- )
305
- self.available_tools.extend(
306
- get_read_only_jupyter_tools(self.permission_manager)
307
- )
308
-
309
- # Add edit tools
310
- self.available_tools.append(Edit(self.permission_manager))
311
- self.available_tools.append(MultiEdit(self.permission_manager))
312
-
313
- # Add special tools
314
- self.available_tools.append(ClarificationTool())
315
- self.available_tools.append(CriticTool())
316
- self.available_tools.append(ReviewTool())
317
- self.available_tools.append(IChingTool())
318
-
319
- self.available_tools.append(
320
- BatchTool({t.name: t for t in self.available_tools})
321
- )
322
-
323
- @override
324
- async def call(
325
- self,
326
- ctx: MCPContext,
327
- **params: Unpack[AgentToolParams],
328
- ) -> str:
329
- """Execute the tool with the given parameters."""
330
- start_time = time.time()
331
-
332
- # Create tool context
333
- tool_ctx = create_tool_context(ctx)
334
- await tool_ctx.set_tool_info(self.name)
335
-
336
- # Extract parameters
337
- prompts = params.get("prompts")
338
- if prompts is None:
339
- await tool_ctx.error("No prompts provided")
340
- return "Error: At least one prompt must be provided."
341
-
342
- # Handle both string and list inputs
343
- if isinstance(prompts, str):
344
- prompt_list = [prompts]
345
- elif isinstance(prompts, list):
346
- if not prompts:
347
- await tool_ctx.error("Empty prompts list provided")
348
- return "Error: At least one prompt must be provided."
349
- prompt_list = prompts
350
- else:
351
- await tool_ctx.error("Invalid prompts parameter type")
352
- return "Error: Parameter 'prompts' must be a string or list of strings."
353
-
354
- # Validate absolute paths
355
- absolute_path_pattern = r"/(?:[^/\s]+/)*[^/\s]+"
356
- for prompt in prompt_list:
357
- if not re.search(absolute_path_pattern, prompt):
358
- await tool_ctx.error(f"Prompt missing absolute path: {prompt[:50]}...")
359
- return "Error: All prompts must contain at least one absolute path."
360
-
361
- # Check if hanzo-agents is available
362
- if not HANZO_AGENTS_AVAILABLE:
363
- # Fall back to original implementation
364
- await tool_ctx.warning("hanzo-agents SDK not available, using fallback")
365
- from hanzo_mcp.tools.agent.agent_tool import AgentTool as OriginalAgentTool
366
- original_tool = OriginalAgentTool(
367
- permission_manager=self.permission_manager,
368
- model=self.model_override,
369
- api_key=self.api_key_override,
370
- base_url=self.base_url_override,
371
- max_tokens=self.max_tokens_override,
372
- max_iterations=self.max_iterations,
373
- max_tool_uses=self.max_tool_uses,
374
- )
375
- return await original_tool.call(ctx, prompts=prompts)
376
-
377
- # Use hanzo-agents SDK
378
- await tool_ctx.info(f"Launching {len(prompt_list)} agent(s) using hanzo-agents SDK")
379
-
380
- # Determine model and agent type
381
- model = params.get("model", self.model_override)
382
- use_memory = params.get("use_memory", False)
383
- memory_backend = params.get("memory_backend", "sqlite")
384
-
385
- # Get appropriate agent class
386
- agent_class = self._get_agent_class(model)
387
-
388
- # Create state
389
- state = MCPAgentState(
390
- prompts=prompt_list,
391
- context={
392
- "permission_manager": self.permission_manager,
393
- "api_key": self.api_key_override,
394
- "base_url": self.base_url_override,
395
- "max_tokens": self.max_tokens_override,
396
- }
397
- )
398
-
399
- # Create memory if requested
400
- memory_kv = None
401
- memory_vector = None
402
- if use_memory:
403
- memory_kv = create_memory_kv(memory_backend)
404
- memory_vector = create_memory_vector("simple")
405
-
406
- # Create network
407
- network = Network(
408
- state=state,
409
- agents=[agent_class],
410
- router=sequential_router([agent_class] * len(prompt_list)),
411
- memory_kv=memory_kv,
412
- memory_vector=memory_vector,
413
- max_steps=self.max_iterations * len(prompt_list),
414
- )
415
-
416
- # Execute
417
- try:
418
- final_state = await network.run()
419
- execution_time = time.time() - start_time
420
-
421
- # Format results
422
- results = final_state.results
423
- if len(results) == 1:
424
- formatted_result = f"""Agent execution completed in {execution_time:.2f} seconds.
425
-
426
- AGENT RESPONSE:
427
- {results[0]}"""
428
- else:
429
- formatted_results = []
430
- for i, result in enumerate(results):
431
- formatted_results.append(f"Agent {i+1} Result:\n{result}")
432
-
433
- formatted_result = f"""Multi-agent execution completed in {execution_time:.2f} seconds ({len(results)} agents).
434
-
435
- AGENT RESPONSES:
436
- {chr(10).join(formatted_results)}"""
437
-
438
- await tool_ctx.info(f"Execution completed in {execution_time:.2f}s")
439
- return formatted_result
440
-
441
- except Exception as e:
442
- await tool_ctx.error(f"Agent execution failed: {str(e)}")
443
- return f"Error: {str(e)}"
444
-
445
- def _get_agent_class(self, model: Optional[str]) -> type[Agent]:
446
- """Get appropriate agent class based on model."""
447
- if not model:
448
- model = "model://anthropic/claude-3-5-sonnet-20241022"
449
-
450
- # Check for CLI agents
451
- cli_agents = {
452
- "claude_cli": ClaudeCodeAgent,
453
- "codex_cli": OpenAICodexAgent,
454
- "gemini_cli": GeminiAgent,
455
- "grok_cli": GrokAgent,
456
- }
457
-
458
- if model in cli_agents:
459
- return cli_agents[model]
460
-
461
- # Return generic MCP agent
462
- return type("DynamicMCPAgent", (MCPAgent,), {
463
- "model": model,
464
- "__init__": lambda self: MCPAgent.__init__(
465
- self,
466
- available_tools=self.available_tools,
467
- permission_manager=self.permission_manager,
468
- ctx=self.ctx,
469
- model=model
470
- )
471
- })
472
-
473
- @override
474
- def register(self, mcp_server: FastMCP) -> None:
475
- """Register this agent tool with the MCP server."""
476
- tool_self = self
477
-
478
- @mcp_server.tool(name=self.name, description=self.description)
479
- async def dispatch_agent(
480
- prompts: str | list[str],
481
- ctx: MCPContext,
482
- model: Optional[str] = None,
483
- use_memory: bool = False,
484
- memory_backend: str = "sqlite"
485
- ) -> str:
486
- return await tool_self.call(
487
- ctx,
488
- prompts=prompts,
489
- model=model,
490
- use_memory=use_memory,
491
- memory_backend=memory_backend
492
- )