hanzo 0.3.23__py3-none-any.whl → 0.3.25__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 might be problematic. Click here for more details.

hanzo/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Hanzo - Complete AI Infrastructure Platform with CLI, Router, MCP, and Agent Runtime."""
2
2
 
3
- __version__ = "0.3.2"
4
- __all__ = ["main", "cli"]
3
+ __version__ = "0.3.25"
4
+ __all__ = ["main", "cli", "__version__"]
5
5
 
6
6
  from .cli import cli, main
hanzo/base_agent.py CHANGED
@@ -10,13 +10,12 @@ import os
10
10
  import asyncio
11
11
  import logging
12
12
  from abc import ABC, abstractmethod
13
- from typing import Any, Dict, List, Optional, Protocol, TypeVar, Generic
14
- from dataclasses import dataclass, field
15
- from datetime import datetime
13
+ from typing import Any, Dict, List, Generic, TypeVar, Optional, Protocol
16
14
  from pathlib import Path
15
+ from datetime import datetime
16
+ from dataclasses import field, dataclass
17
17
 
18
- from .model_registry import registry, ModelConfig
19
-
18
+ from .model_registry import ModelConfig, registry
20
19
 
21
20
  logger = logging.getLogger(__name__)
22
21
 
@@ -5,28 +5,28 @@ consensus mechanisms, and critic chains using the unified base classes.
5
5
  """
6
6
 
7
7
  import re
8
+ import json
8
9
  import asyncio
9
10
  import logging
10
- from typing import Any, Dict, List, Optional, AsyncIterator, Callable
11
- from dataclasses import dataclass, field
12
- from datetime import datetime
13
- from pathlib import Path
14
- import json
15
11
  import subprocess
12
+ from typing import Any, Dict, List, Callable, Optional, AsyncIterator
13
+ from pathlib import Path
14
+ from datetime import datetime
15
+ from dataclasses import field, dataclass
16
16
 
17
- from rich.console import Console
18
- from rich.progress import Progress, TaskID, TextColumn, SpinnerColumn, BarColumn
19
- from rich.table import Table
20
17
  from rich.panel import Panel
18
+ from rich.table import Table
19
+ from rich.console import Console
20
+ from rich.progress import TaskID, Progress, BarColumn, TextColumn, SpinnerColumn
21
21
 
22
22
  try:
23
23
  # Try to import from hanzo-mcp if available
24
- from hanzo_mcp.core.model_registry import registry
25
24
  from hanzo_mcp.core.base_agent import AgentConfig, AgentResult, AgentOrchestrator
25
+ from hanzo_mcp.core.model_registry import registry
26
26
  except ImportError:
27
27
  # Fall back to local imports if hanzo-mcp is not installed
28
- from .model_registry import registry
29
28
  from .base_agent import AgentConfig, AgentResult, AgentOrchestrator
29
+ from .model_registry import registry
30
30
 
31
31
  logger = logging.getLogger(__name__)
32
32
  console = Console()
@@ -906,7 +906,7 @@ class MetaAIOrchestrator:
906
906
  )
907
907
  try:
908
908
  return json.loads(result)
909
- except:
909
+ except Exception:
910
910
  pass
911
911
 
912
912
  # Fallback intent detection
hanzo/cli.py CHANGED
@@ -14,19 +14,22 @@ from .commands import (
14
14
  mcp,
15
15
  auth,
16
16
  chat,
17
+ node,
17
18
  repl,
18
19
  agent,
19
20
  miner,
20
21
  tools,
21
22
  config,
22
- cluster,
23
+ router,
23
24
  network,
24
25
  )
25
26
  from .utils.output import console
26
27
  from .interactive.repl import HanzoREPL
28
+ from .interactive.enhanced_repl import EnhancedHanzoREPL
29
+ from .ui.startup import show_startup
27
30
 
28
31
  # Version
29
- __version__ = "0.3.22"
32
+ __version__ = "0.3.23"
30
33
 
31
34
 
32
35
  @click.group(invoke_without_command=True)
@@ -54,14 +57,20 @@ def cli(ctx, verbose: bool, json: bool, config: Optional[str]):
54
57
 
55
58
  if os.environ.get("HANZO_COMPUTE_NODE") == "1":
56
59
  # Start as a compute node
57
-
58
60
  asyncio.run(start_compute_node(ctx))
59
61
  else:
62
+ # Show startup UI (unless in quiet mode)
63
+ if not ctx.obj.get("quiet") and not os.environ.get("HANZO_NO_STARTUP"):
64
+ show_startup(minimal=os.environ.get("HANZO_MINIMAL_UI") == "1")
65
+
60
66
  # Enter interactive REPL mode
61
- console.print("[bold cyan]Hanzo AI - Interactive Mode[/bold cyan]")
62
- console.print("Type 'help' for commands, 'exit' to quit\n")
63
67
  try:
64
- repl = HanzoREPL(console=console)
68
+ # Use enhanced REPL if available, otherwise fallback
69
+ use_enhanced = os.environ.get("HANZO_ENHANCED_REPL", "1") == "1"
70
+ if use_enhanced:
71
+ repl = EnhancedHanzoREPL(console=console)
72
+ else:
73
+ repl = HanzoREPL(console=console)
65
74
  asyncio.run(repl.run())
66
75
  except KeyboardInterrupt:
67
76
  console.print("\n[yellow]Interrupted[/yellow]")
@@ -72,7 +81,7 @@ def cli(ctx, verbose: bool, json: bool, config: Optional[str]):
72
81
  # Register command groups
73
82
  cli.add_command(agent.agent_group)
74
83
  cli.add_command(auth.auth_group)
75
- cli.add_command(cluster.cluster_group)
84
+ cli.add_command(node.cluster)
76
85
  cli.add_command(mcp.mcp_group)
77
86
  cli.add_command(miner.miner_group)
78
87
  cli.add_command(chat.chat_command)
@@ -80,6 +89,7 @@ cli.add_command(repl.repl_group)
80
89
  cli.add_command(tools.tools_group)
81
90
  cli.add_command(network.network_group)
82
91
  cli.add_command(config.config_group)
92
+ cli.add_command(router.router_group)
83
93
 
84
94
 
85
95
  # Quick aliases
@@ -95,12 +105,12 @@ def ask(ctx, prompt: tuple, model: str, local: bool):
95
105
 
96
106
 
97
107
  @cli.command()
98
- @click.option("--name", "-n", default="hanzo-local", help="Cluster name")
108
+ @click.option("--name", "-n", default="hanzo-local", help="Node name")
99
109
  @click.option("--port", "-p", default=8000, help="API port")
100
110
  @click.pass_context
101
111
  def serve(ctx, name: str, port: int):
102
- """Start local AI cluster (alias for 'hanzo cluster start')."""
103
- asyncio.run(cluster.start_cluster(ctx, name, port))
112
+ """Start local AI node (alias for 'hanzo node start')."""
113
+ asyncio.run(node.start_node(ctx, name, port))
104
114
 
105
115
 
106
116
  @cli.command()