hyperclaw 0.1.0a0__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.
- cli/__init__.py +1 -0
- cli/doctor.py +196 -0
- cli/hyperclaw.py +1028 -0
- cli/onboarding.py +248 -0
- core/__init__.py +1 -0
- core/connectors/__init__.py +119 -0
- core/connectors/infrastructure.py +772 -0
- core/connectors/messaging.py +586 -0
- core/connectors/productivity.py +764 -0
- core/connectors/smarthome.py +528 -0
- core/connectors/social.py +730 -0
- core/hyperrouter/__init__.py +23 -0
- core/hyperrouter/bandit.py +216 -0
- core/hyperrouter/fast_loop.py +68 -0
- core/hyperrouter/slow_loop.py +143 -0
- core/hyperstate/__init__.py +24 -0
- core/hyperstate/certifier.py +154 -0
- core/hyperstate/schema.py +160 -0
- core/hyperstate/state_manager.py +103 -0
- core/hyperstate/store.py +163 -0
- core/providers/__init__.py +121 -0
- core/providers/embeddings.py +353 -0
- core/providers/image.py +525 -0
- core/providers/llm.py +1929 -0
- core/providers/search.py +604 -0
- core/providers/voice.py +474 -0
- hyperclaw/__init__.py +21 -0
- hyperclaw/agent.py +739 -0
- hyperclaw/feeds.py +339 -0
- hyperclaw/integrations_layer.py +495 -0
- hyperclaw/prometheus.py +409 -0
- hyperclaw/scheduler.py +282 -0
- hyperclaw/skills.py +707 -0
- hyperclaw/solomon.py +362 -0
- hyperclaw/swarm.py +479 -0
- hyperclaw/telegram_bot.py +248 -0
- hyperclaw/trading/__init__.py +77 -0
- hyperclaw/tts.py +124 -0
- hyperclaw/tui.py +2770 -0
- hyperclaw-0.1.0a0.dist-info/METADATA +218 -0
- hyperclaw-0.1.0a0.dist-info/RECORD +129 -0
- hyperclaw-0.1.0a0.dist-info/WHEEL +5 -0
- hyperclaw-0.1.0a0.dist-info/entry_points.txt +3 -0
- hyperclaw-0.1.0a0.dist-info/licenses/LICENSE +21 -0
- hyperclaw-0.1.0a0.dist-info/top_level.txt +9 -0
- memory/__init__.py +1 -0
- memory/causal_graph.py +120 -0
- memory/impact_tracker.py +85 -0
- memory/vector_memory.py +323 -0
- models/__init__.py +12 -0
- models/chatjimmy_client.py +207 -0
- models/claude_client.py +106 -0
- models/claude_code_subagent.py +192 -0
- models/router.py +152 -0
- recursive/discovery_loop.py +115 -0
- recursive/optimization_loop.py +132 -0
- recursive/validation_loop.py +36 -0
- security/__init__.py +1 -0
- security/audit_logger.py +106 -0
- security/filesystem_guard.py +100 -0
- security/hypershield.py +99 -0
- security/network_guard.py +97 -0
- security/policy_engine.py +198 -0
- swarm/__init__.py +1 -0
- swarm/agents/__init__.py +0 -0
- swarm/agents/base.py +226 -0
- swarm/agents/business/__init__.py +0 -0
- swarm/agents/business/counsel.py +31 -0
- swarm/agents/business/herald.py +32 -0
- swarm/agents/business/ledger.py +26 -0
- swarm/agents/business/nexus.py +30 -0
- swarm/agents/business/ops.py +30 -0
- swarm/agents/business/pipeline.py +28 -0
- swarm/agents/business/revenue.py +31 -0
- swarm/agents/business/sovereign.py +31 -0
- swarm/agents/business/strategos.py +27 -0
- swarm/agents/business/talent.py +27 -0
- swarm/agents/business/venture.py +35 -0
- swarm/agents/comms/cipher.py +32 -0
- swarm/agents/comms/echo_comms.py +31 -0
- swarm/agents/comms/envoy.py +31 -0
- swarm/agents/comms/herald_scheduler.py +33 -0
- swarm/agents/comms/pulse.py +29 -0
- swarm/agents/creative/__init__.py +0 -0
- swarm/agents/creative/author.py +27 -0
- swarm/agents/creative/lens.py +25 -0
- swarm/agents/executive/__init__.py +1 -0
- swarm/agents/executive/genesis.py +30 -0
- swarm/agents/executive/gil.py +29 -0
- swarm/agents/executive/solomon.py +29 -0
- swarm/agents/intelligence/arbiter.py +30 -0
- swarm/agents/intelligence/prophet.py +31 -0
- swarm/agents/intelligence/sentinel.py +30 -0
- swarm/agents/media/__init__.py +0 -0
- swarm/agents/personal/__init__.py +0 -0
- swarm/agents/personal/atlas.py +27 -0
- swarm/agents/personal/hearth.py +26 -0
- swarm/agents/personal/midas.py +27 -0
- swarm/agents/personal/navigator.py +27 -0
- swarm/agents/personal/nourish.py +31 -0
- swarm/agents/personal/vitals.py +33 -0
- swarm/agents/recursive/__init__.py +0 -0
- swarm/agents/recursive/alchemist.py +73 -0
- swarm/agents/recursive/calibrator.py +45 -0
- swarm/agents/recursive/scout.py +97 -0
- swarm/agents/scientific/__init__.py +0 -0
- swarm/agents/scientific/cosmos.py +36 -0
- swarm/agents/scientific/gaia.py +26 -0
- swarm/agents/scientific/medicus.py +33 -0
- swarm/agents/scientific/oracle_agent.py +39 -0
- swarm/agents/scientific/scribe.py +39 -0
- swarm/agents/talent/__init__.py +0 -0
- swarm/agents/talent/deal.py +28 -0
- swarm/agents/talent/roster.py +29 -0
- swarm/agents/talent/scout.py +29 -0
- swarm/agents/talent/stage.py +27 -0
- swarm/agents/tech/__init__.py +0 -0
- swarm/agents/tech/aegis.py +28 -0
- swarm/agents/tech/bridge.py +28 -0
- swarm/agents/tech/forge.py +28 -0
- swarm/agents/trading/global_prediction_engine.py +611 -0
- swarm/agents/trading/polymarket_trader.py +169 -0
- swarm/agents/trading/prediction_strategist.py +218 -0
- swarm/autogen_bridge.py +68 -0
- swarm/bid_protocol.py +196 -0
- swarm/dispatcher.py +517 -0
- swarm/nexus.py +181 -0
- swarm/registry.py +188 -0
- ui/tui/app.py +213 -0
cli/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# HyperClaw CLI
|
cli/doctor.py
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"""
|
|
2
|
+
hyperclaw doctor — system health check.
|
|
3
|
+
Verifies API keys, DB connection, pgvector, policy files, and dependencies.
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import asyncio
|
|
8
|
+
import importlib
|
|
9
|
+
import os
|
|
10
|
+
import sys
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import Callable
|
|
13
|
+
|
|
14
|
+
from rich.console import Console
|
|
15
|
+
from rich.table import Table
|
|
16
|
+
from rich import print as rprint
|
|
17
|
+
|
|
18
|
+
console = Console()
|
|
19
|
+
|
|
20
|
+
CHECK_MARK = "[bold green]✓[/bold green]"
|
|
21
|
+
CROSS_MARK = "[bold red]✗[/bold red]"
|
|
22
|
+
WARN_MARK = "[bold yellow]⚠[/bold yellow]"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _check(label: str, ok: bool, detail: str = "", warn: bool = False) -> dict:
|
|
26
|
+
status = CHECK_MARK if ok else (WARN_MARK if warn else CROSS_MARK)
|
|
27
|
+
return {"label": label, "ok": ok, "warn": warn, "detail": detail, "status": status}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
async def _check_db(db_url: str) -> dict:
|
|
31
|
+
try:
|
|
32
|
+
import asyncpg
|
|
33
|
+
conn = await asyncpg.connect(db_url, timeout=5)
|
|
34
|
+
await conn.close()
|
|
35
|
+
return _check("PostgreSQL connection", True, db_url.split("@")[-1] if "@" in db_url else db_url)
|
|
36
|
+
except Exception as e:
|
|
37
|
+
return _check("PostgreSQL connection", False, str(e)[:80])
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
async def _check_pgvector(db_url: str) -> dict:
|
|
41
|
+
try:
|
|
42
|
+
import asyncpg
|
|
43
|
+
conn = await asyncpg.connect(db_url, timeout=5)
|
|
44
|
+
row = await conn.fetchval(
|
|
45
|
+
"SELECT COUNT(*) FROM pg_extension WHERE extname = 'vector'"
|
|
46
|
+
)
|
|
47
|
+
await conn.close()
|
|
48
|
+
if row:
|
|
49
|
+
return _check("pgvector extension", True, "installed")
|
|
50
|
+
else:
|
|
51
|
+
return _check("pgvector extension", False,
|
|
52
|
+
"Not installed — run: CREATE EXTENSION vector; in your DB", warn=True)
|
|
53
|
+
except Exception as e:
|
|
54
|
+
return _check("pgvector extension", False, str(e)[:80])
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
async def _check_migrations(db_url: str) -> dict:
|
|
58
|
+
try:
|
|
59
|
+
import asyncpg
|
|
60
|
+
conn = await asyncpg.connect(db_url, timeout=5)
|
|
61
|
+
exists = await conn.fetchval(
|
|
62
|
+
"SELECT EXISTS(SELECT 1 FROM information_schema.tables WHERE table_name='_migrations')"
|
|
63
|
+
)
|
|
64
|
+
if exists:
|
|
65
|
+
applied = await conn.fetch("SELECT filename FROM _migrations ORDER BY filename")
|
|
66
|
+
names = [r["filename"] for r in applied]
|
|
67
|
+
await conn.close()
|
|
68
|
+
return _check("DB migrations", True, f"{len(names)} applied: {', '.join(names)}")
|
|
69
|
+
else:
|
|
70
|
+
await conn.close()
|
|
71
|
+
return _check("DB migrations", False,
|
|
72
|
+
"Not initialized — run: hyperclaw init", warn=True)
|
|
73
|
+
except Exception as e:
|
|
74
|
+
return _check("DB migrations", False, str(e)[:80])
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def run_doctor() -> int:
|
|
78
|
+
"""
|
|
79
|
+
Run all health checks and print results.
|
|
80
|
+
Returns 0 if all critical checks pass, 1 if any fail.
|
|
81
|
+
"""
|
|
82
|
+
console.print("\n[bold cyan]⚡ HyperClaw Doctor[/bold cyan]\n")
|
|
83
|
+
|
|
84
|
+
checks: list[dict] = []
|
|
85
|
+
db_url = os.environ.get("DATABASE_URL", "")
|
|
86
|
+
|
|
87
|
+
# ── Python version ────────────────────────────────────────────────────────
|
|
88
|
+
py = sys.version_info
|
|
89
|
+
checks.append(_check(
|
|
90
|
+
"Python version",
|
|
91
|
+
py >= (3, 11),
|
|
92
|
+
f"{py.major}.{py.minor}.{py.micro}",
|
|
93
|
+
warn=(py >= (3, 11)),
|
|
94
|
+
))
|
|
95
|
+
|
|
96
|
+
# ── Required packages ─────────────────────────────────────────────────────
|
|
97
|
+
required_packages = {
|
|
98
|
+
"pydantic": "pydantic",
|
|
99
|
+
"asyncpg": "asyncpg",
|
|
100
|
+
"anthropic": "anthropic",
|
|
101
|
+
"httpx": "httpx",
|
|
102
|
+
"typer": "typer",
|
|
103
|
+
"rich": "rich",
|
|
104
|
+
"yaml": "yaml (pyyaml)",
|
|
105
|
+
"dotenv": "dotenv (python-dotenv)",
|
|
106
|
+
}
|
|
107
|
+
for mod, label in required_packages.items():
|
|
108
|
+
try:
|
|
109
|
+
importlib.import_module(mod)
|
|
110
|
+
checks.append(_check(f"Package: {label}", True))
|
|
111
|
+
except ImportError:
|
|
112
|
+
checks.append(_check(f"Package: {label}", False, f"pip install {label.split()[0]}"))
|
|
113
|
+
|
|
114
|
+
# ── Environment variables ─────────────────────────────────────────────────
|
|
115
|
+
anthropic_key = os.environ.get("ANTHROPIC_API_KEY", "")
|
|
116
|
+
checks.append(_check(
|
|
117
|
+
"ANTHROPIC_API_KEY",
|
|
118
|
+
bool(anthropic_key),
|
|
119
|
+
f"sk-ant-...{anthropic_key[-6:]}" if anthropic_key else "Not set — export ANTHROPIC_API_KEY=...",
|
|
120
|
+
))
|
|
121
|
+
|
|
122
|
+
db_url_env = os.environ.get("DATABASE_URL", "")
|
|
123
|
+
checks.append(_check(
|
|
124
|
+
"DATABASE_URL",
|
|
125
|
+
bool(db_url_env),
|
|
126
|
+
f"...{db_url_env[-30:]}" if db_url_env else "Not set — using config/hyperclaw.yaml fallback",
|
|
127
|
+
warn=not bool(db_url_env),
|
|
128
|
+
))
|
|
129
|
+
|
|
130
|
+
chatjimmy_key = os.environ.get("CHATJIMMY_API_KEY", "")
|
|
131
|
+
checks.append(_check(
|
|
132
|
+
"CHATJIMMY_API_KEY",
|
|
133
|
+
bool(chatjimmy_key),
|
|
134
|
+
"Set" if chatjimmy_key else "Not set — ChatJimmy will be unavailable (optional)",
|
|
135
|
+
warn=not bool(chatjimmy_key),
|
|
136
|
+
))
|
|
137
|
+
|
|
138
|
+
# ── Config files ──────────────────────────────────────────────────────────
|
|
139
|
+
config_files = [
|
|
140
|
+
"config/hyperclaw.yaml",
|
|
141
|
+
"config/agents.yaml",
|
|
142
|
+
"config/models.yaml",
|
|
143
|
+
"security/policies/default.yaml",
|
|
144
|
+
]
|
|
145
|
+
for cf in config_files:
|
|
146
|
+
checks.append(_check(f"Config: {cf}", Path(cf).exists(),
|
|
147
|
+
"Found" if Path(cf).exists() else f"Missing — run: hyperclaw init"))
|
|
148
|
+
|
|
149
|
+
# ── DB checks (async) ─────────────────────────────────────────────────────
|
|
150
|
+
if db_url_env:
|
|
151
|
+
loop = asyncio.new_event_loop()
|
|
152
|
+
try:
|
|
153
|
+
checks.append(loop.run_until_complete(_check_db(db_url_env)))
|
|
154
|
+
checks.append(loop.run_until_complete(_check_pgvector(db_url_env)))
|
|
155
|
+
checks.append(loop.run_until_complete(_check_migrations(db_url_env)))
|
|
156
|
+
finally:
|
|
157
|
+
loop.close()
|
|
158
|
+
else:
|
|
159
|
+
checks.append(_check("PostgreSQL connection", False,
|
|
160
|
+
"Skipped — DATABASE_URL not set", warn=True))
|
|
161
|
+
checks.append(_check("pgvector extension", False,
|
|
162
|
+
"Skipped — DATABASE_URL not set", warn=True))
|
|
163
|
+
checks.append(_check("DB migrations", False,
|
|
164
|
+
"Skipped — DATABASE_URL not set", warn=True))
|
|
165
|
+
|
|
166
|
+
# ── Print results ─────────────────────────────────────────────────────────
|
|
167
|
+
table = Table(show_header=True, header_style="bold cyan", expand=True)
|
|
168
|
+
table.add_column("Check", style="bold")
|
|
169
|
+
table.add_column("Status", justify="center", width=4)
|
|
170
|
+
table.add_column("Detail", style="dim")
|
|
171
|
+
|
|
172
|
+
for c in checks:
|
|
173
|
+
table.add_row(c["label"], c["status"], c["detail"])
|
|
174
|
+
|
|
175
|
+
console.print(table)
|
|
176
|
+
|
|
177
|
+
failed = [c for c in checks if not c["ok"] and not c.get("warn")]
|
|
178
|
+
warned = [c for c in checks if not c["ok"] and c.get("warn")]
|
|
179
|
+
passed = [c for c in checks if c["ok"]]
|
|
180
|
+
|
|
181
|
+
console.print(
|
|
182
|
+
f"\n[green]{len(passed)} passed[/green] "
|
|
183
|
+
f"[yellow]{len(warned)} warnings[/yellow] "
|
|
184
|
+
f"[red]{len(failed)} failed[/red]"
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
if failed:
|
|
188
|
+
console.print("\n[red]Fix the failed checks above before running hyperclaw start.[/red]")
|
|
189
|
+
return 1
|
|
190
|
+
|
|
191
|
+
if not warned:
|
|
192
|
+
console.print("\n[bold green]✓ HyperClaw is healthy and ready to run.[/bold green]")
|
|
193
|
+
else:
|
|
194
|
+
console.print("\n[bold yellow]⚠ HyperClaw has warnings — review above before running tasks.[/bold yellow]")
|
|
195
|
+
|
|
196
|
+
return 0
|