hanzo 0.3.16__tar.gz → 0.3.17__tar.gz
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 might be problematic. Click here for more details.
- {hanzo-0.3.16 → hanzo-0.3.17}/PKG-INFO +1 -1
- {hanzo-0.3.16 → hanzo-0.3.17}/pyproject.toml +1 -1
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/cli.py +1 -1
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/dev.py +101 -13
- {hanzo-0.3.16 → hanzo-0.3.17}/.gitignore +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/README.md +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/__init__.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/__main__.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/__init__.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/agent.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/auth.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/chat.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/cluster.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/config.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/mcp.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/miner.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/network.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/repl.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/commands/tools.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/interactive/__init__.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/interactive/dashboard.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/interactive/repl.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/mcp_server.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/orchestrator_config.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/repl.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/router/__init__.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/utils/__init__.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/utils/config.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/utils/net_check.py +0 -0
- {hanzo-0.3.16 → hanzo-0.3.17}/src/hanzo/utils/output.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hanzo
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.17
|
|
4
4
|
Summary: Hanzo AI - Complete AI Infrastructure Platform with CLI, Router, MCP, and Agent Runtime
|
|
5
5
|
Project-URL: Homepage, https://hanzo.ai
|
|
6
6
|
Project-URL: Repository, https://github.com/hanzoai/python-sdk
|
|
@@ -664,15 +664,69 @@ class HanzoDevREPL:
|
|
|
664
664
|
|
|
665
665
|
async def run(self):
|
|
666
666
|
"""Run the REPL."""
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
667
|
+
from rich.panel import Panel
|
|
668
|
+
from rich.box import Box
|
|
669
|
+
from rich.text import Text
|
|
670
|
+
from rich.console import Group
|
|
671
|
+
from rich.align import Align
|
|
672
|
+
from prompt_toolkit import prompt
|
|
673
|
+
from prompt_toolkit.styles import Style
|
|
674
|
+
|
|
675
|
+
# Define Claude-like style for prompt_toolkit
|
|
676
|
+
claude_style = Style.from_dict({
|
|
677
|
+
'': '#333333', # Default text color
|
|
678
|
+
'prompt': '#666666', # Gray prompt arrow
|
|
679
|
+
})
|
|
680
|
+
|
|
681
|
+
# Custom light gray box for Rich panels
|
|
682
|
+
LIGHT_GRAY_BOX = Box(
|
|
683
|
+
"╭─╮\n"
|
|
684
|
+
"│ │\n"
|
|
685
|
+
"╰─╯\n"
|
|
686
|
+
)
|
|
687
|
+
|
|
688
|
+
# Header
|
|
689
|
+
console.print()
|
|
690
|
+
console.print(Panel(
|
|
691
|
+
"[bold cyan]Hanzo Dev - AI Chat[/bold cyan]\n"
|
|
692
|
+
"[dim]Chat naturally or use /commands • Type /help for available commands[/dim]",
|
|
693
|
+
box=LIGHT_GRAY_BOX,
|
|
694
|
+
style="dim white",
|
|
695
|
+
padding=(0, 1)
|
|
696
|
+
))
|
|
697
|
+
console.print()
|
|
670
698
|
|
|
671
699
|
while True:
|
|
672
700
|
try:
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
701
|
+
# Draw input box border (top)
|
|
702
|
+
console.print("[dim white]╭" + "─" * 78 + "╮[/dim white]")
|
|
703
|
+
|
|
704
|
+
# Get input with styled prompt inside the box
|
|
705
|
+
console.print("[dim white]│[/dim white] ", end="")
|
|
706
|
+
|
|
707
|
+
try:
|
|
708
|
+
# Use prompt_toolkit for input with Claude-like styling
|
|
709
|
+
user_input = await asyncio.get_event_loop().run_in_executor(
|
|
710
|
+
None,
|
|
711
|
+
lambda: prompt(
|
|
712
|
+
'› ', # Using › instead of > for a more modern look
|
|
713
|
+
style=claude_style,
|
|
714
|
+
message=''
|
|
715
|
+
)
|
|
716
|
+
)
|
|
717
|
+
|
|
718
|
+
# Draw input box border (bottom)
|
|
719
|
+
console.print("[dim white]╰" + "─" * 78 + "╯[/dim white]")
|
|
720
|
+
|
|
721
|
+
except EOFError:
|
|
722
|
+
console.print() # New line before exit
|
|
723
|
+
console.print("[dim white]╰" + "─" * 78 + "╯[/dim white]")
|
|
724
|
+
break
|
|
725
|
+
except KeyboardInterrupt:
|
|
726
|
+
console.print() # Complete the box
|
|
727
|
+
console.print("[dim white]╰" + "─" * 78 + "╯[/dim white]")
|
|
728
|
+
console.print("\n[dim yellow]Use /exit to quit[/dim]")
|
|
729
|
+
continue
|
|
676
730
|
|
|
677
731
|
if not user_input:
|
|
678
732
|
continue
|
|
@@ -881,20 +935,38 @@ Examples:
|
|
|
881
935
|
)
|
|
882
936
|
|
|
883
937
|
if result.get("output"):
|
|
884
|
-
|
|
938
|
+
# Display AI response in a styled panel
|
|
939
|
+
console.print()
|
|
940
|
+
from rich.panel import Panel
|
|
941
|
+
console.print(Panel(
|
|
942
|
+
result['output'],
|
|
943
|
+
title="[bold cyan]AI Response[/bold cyan]",
|
|
944
|
+
title_align="left",
|
|
945
|
+
border_style="dim cyan",
|
|
946
|
+
padding=(1, 2)
|
|
947
|
+
))
|
|
885
948
|
elif result.get("error"):
|
|
886
|
-
console.print(f"[red]Error:[/red] {result['error']}")
|
|
949
|
+
console.print(f"\n[red]Error:[/red] {result['error']}")
|
|
887
950
|
else:
|
|
888
|
-
console.print("[yellow]No response from agent[/yellow]")
|
|
951
|
+
console.print("\n[yellow]No response from agent[/yellow]")
|
|
889
952
|
|
|
890
953
|
elif hasattr(self.orchestrator, 'execute_with_critique'):
|
|
891
954
|
# Use multi-Claude orchestrator - but now it will use real AI!
|
|
892
955
|
result = await self.orchestrator.execute_with_critique(message)
|
|
893
956
|
|
|
894
957
|
if result.get("output"):
|
|
895
|
-
|
|
958
|
+
# Display AI response in a styled panel
|
|
959
|
+
console.print()
|
|
960
|
+
from rich.panel import Panel
|
|
961
|
+
console.print(Panel(
|
|
962
|
+
result['output'],
|
|
963
|
+
title="[bold cyan]AI Response[/bold cyan]",
|
|
964
|
+
title_align="left",
|
|
965
|
+
border_style="dim cyan",
|
|
966
|
+
padding=(1, 2)
|
|
967
|
+
))
|
|
896
968
|
else:
|
|
897
|
-
console.print("[yellow]No response from agent[/yellow]")
|
|
969
|
+
console.print("\n[yellow]No response from agent[/yellow]")
|
|
898
970
|
|
|
899
971
|
else:
|
|
900
972
|
# Fallback to direct API call if available
|
|
@@ -958,7 +1030,15 @@ Examples:
|
|
|
958
1030
|
)
|
|
959
1031
|
|
|
960
1032
|
if response.choices:
|
|
961
|
-
|
|
1033
|
+
from rich.panel import Panel
|
|
1034
|
+
console.print()
|
|
1035
|
+
console.print(Panel(
|
|
1036
|
+
response.choices[0].message.content,
|
|
1037
|
+
title="[bold cyan]GPT-4[/bold cyan]",
|
|
1038
|
+
title_align="left",
|
|
1039
|
+
border_style="dim cyan",
|
|
1040
|
+
padding=(1, 2)
|
|
1041
|
+
))
|
|
962
1042
|
return
|
|
963
1043
|
|
|
964
1044
|
except Exception as e:
|
|
@@ -977,7 +1057,15 @@ Examples:
|
|
|
977
1057
|
)
|
|
978
1058
|
|
|
979
1059
|
if response.content:
|
|
980
|
-
|
|
1060
|
+
from rich.panel import Panel
|
|
1061
|
+
console.print()
|
|
1062
|
+
console.print(Panel(
|
|
1063
|
+
response.content[0].text,
|
|
1064
|
+
title="[bold cyan]Claude[/bold cyan]",
|
|
1065
|
+
title_align="left",
|
|
1066
|
+
border_style="dim cyan",
|
|
1067
|
+
padding=(1, 2)
|
|
1068
|
+
))
|
|
981
1069
|
return
|
|
982
1070
|
|
|
983
1071
|
except Exception as e:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|