hyperagents 1.2.3rc5.post3__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.
Files changed (361) hide show
  1. agents/__init__.py +31 -0
  2. agents/background_monitor.py +453 -0
  3. agents/learning.py +460 -0
  4. agents/planner.py +421 -0
  5. agents/transcriber.py +341 -0
  6. civilization/__init__.py +51 -0
  7. civilization/api/__init__.py +7 -0
  8. civilization/api/civilization_api.py +361 -0
  9. civilization/graph/__init__.py +19 -0
  10. civilization/graph/knowledge_linker.py +348 -0
  11. civilization/graph/org_graph.py +348 -0
  12. civilization/graph/process_graph.py +386 -0
  13. civilization/ingestion/__init__.py +20 -0
  14. civilization/ingestion/chunker.py +273 -0
  15. civilization/ingestion/document_ingestor.py +358 -0
  16. civilization/ingestion/embedder.py +262 -0
  17. civilization/ingestion/extractor.py +224 -0
  18. civilization/interview/__init__.py +19 -0
  19. civilization/interview/gap_detector.py +380 -0
  20. civilization/interview/interviewer.py +323 -0
  21. civilization/interview/questioner.py +363 -0
  22. civilization/retrieval/__init__.py +17 -0
  23. civilization/retrieval/civilization_rag.py +316 -0
  24. civilization/retrieval/context_injector.py +342 -0
  25. civilization/retrieval/relevance_ranker.py +287 -0
  26. civilization/schema.py +299 -0
  27. civilization/store.py +177 -0
  28. civilization/sync/__init__.py +16 -0
  29. civilization/sync/confluence_sync.py +317 -0
  30. civilization/sync/gdrive_sync.py +262 -0
  31. civilization/sync/notion_sync.py +237 -0
  32. civilization/versioning/__init__.py +19 -0
  33. civilization/versioning/diff_engine.py +351 -0
  34. civilization/versioning/staleness_detector.py +303 -0
  35. civilization/versioning/version_manager.py +293 -0
  36. cli/__init__.py +1 -0
  37. cli/doctor.py +334 -0
  38. cli/hyperclaw.py +1357 -0
  39. cli/onboarding.py +469 -0
  40. core/__init__.py +1 -0
  41. core/connectors/__init__.py +119 -0
  42. core/connectors/infrastructure.py +772 -0
  43. core/connectors/messaging.py +586 -0
  44. core/connectors/productivity.py +764 -0
  45. core/connectors/smarthome.py +528 -0
  46. core/connectors/social.py +730 -0
  47. core/hyperrouter/__init__.py +23 -0
  48. core/hyperrouter/bandit.py +218 -0
  49. core/hyperrouter/fast_loop.py +68 -0
  50. core/hyperrouter/slow_loop.py +143 -0
  51. core/hyperstate/__init__.py +24 -0
  52. core/hyperstate/certifier.py +154 -0
  53. core/hyperstate/schema.py +160 -0
  54. core/hyperstate/state_manager.py +103 -0
  55. core/hyperstate/store.py +163 -0
  56. core/providers/__init__.py +121 -0
  57. core/providers/embeddings.py +389 -0
  58. core/providers/image.py +534 -0
  59. core/providers/llm.py +1935 -0
  60. core/providers/search.py +608 -0
  61. core/providers/voice.py +474 -0
  62. hyperagents-1.2.3rc5.post3.dist-info/METADATA +469 -0
  63. hyperagents-1.2.3rc5.post3.dist-info/RECORD +361 -0
  64. hyperagents-1.2.3rc5.post3.dist-info/WHEEL +5 -0
  65. hyperagents-1.2.3rc5.post3.dist-info/entry_points.txt +6 -0
  66. hyperagents-1.2.3rc5.post3.dist-info/licenses/LICENSE +21 -0
  67. hyperagents-1.2.3rc5.post3.dist-info/top_level.txt +13 -0
  68. hyperclaw/__init__.py +67 -0
  69. hyperclaw/__main__.py +220 -0
  70. hyperclaw/agent.py +775 -0
  71. hyperclaw/agent_coordinator.py +577 -0
  72. hyperclaw/anthropic_params.py +225 -0
  73. hyperclaw/api_utils.py +85 -0
  74. hyperclaw/approval_telegram.py +209 -0
  75. hyperclaw/approval_terminal.py +80 -0
  76. hyperclaw/attachments.py +177 -0
  77. hyperclaw/branding.py +55 -0
  78. hyperclaw/brief/__init__.py +11 -0
  79. hyperclaw/brief/cli.py +204 -0
  80. hyperclaw/brief/collect.py +146 -0
  81. hyperclaw/brief/compose.py +333 -0
  82. hyperclaw/brief/diff.py +110 -0
  83. hyperclaw/brief/errors.py +99 -0
  84. hyperclaw/brief/google.py +269 -0
  85. hyperclaw/brief/google_auth.py +294 -0
  86. hyperclaw/brief/links.py +124 -0
  87. hyperclaw/brief/service.py +424 -0
  88. hyperclaw/brief/store.py +205 -0
  89. hyperclaw/brief/tasks.py +200 -0
  90. hyperclaw/chat_scope.py +115 -0
  91. hyperclaw/cli_tui.py +497 -0
  92. hyperclaw/client_guard.py +717 -0
  93. hyperclaw/connection_check.py +113 -0
  94. hyperclaw/cost_guard.py +1728 -0
  95. hyperclaw/default_config/agents.yaml +534 -0
  96. hyperclaw/default_config/hyperclaw.yaml +27 -0
  97. hyperclaw/default_config/models.yaml +161 -0
  98. hyperclaw/deployment.py +39 -0
  99. hyperclaw/digest/__init__.py +9 -0
  100. hyperclaw/digest/cli.py +117 -0
  101. hyperclaw/digest/errors.py +100 -0
  102. hyperclaw/digest/gitlab.py +187 -0
  103. hyperclaw/digest/http.py +113 -0
  104. hyperclaw/digest/redact.py +32 -0
  105. hyperclaw/digest/service.py +271 -0
  106. hyperclaw/digest/slack.py +223 -0
  107. hyperclaw/digest/state.py +124 -0
  108. hyperclaw/digest/summarize.py +198 -0
  109. hyperclaw/digest/tokens.py +143 -0
  110. hyperclaw/distribution.py +46 -0
  111. hyperclaw/documents.py +351 -0
  112. hyperclaw/feeds.py +339 -0
  113. hyperclaw/google_workspace/__init__.py +5 -0
  114. hyperclaw/google_workspace/api.py +151 -0
  115. hyperclaw/google_workspace/auth.py +397 -0
  116. hyperclaw/google_workspace/calendar.py +157 -0
  117. hyperclaw/google_workspace/cli.py +72 -0
  118. hyperclaw/google_workspace/drive.py +236 -0
  119. hyperclaw/google_workspace/errors.py +58 -0
  120. hyperclaw/google_workspace/gmail.py +295 -0
  121. hyperclaw/google_workspace/meet.py +122 -0
  122. hyperclaw/google_workspace/tools.py +319 -0
  123. hyperclaw/hyperspeed.py +57 -0
  124. hyperclaw/integrations_layer.py +1427 -0
  125. hyperclaw/live_state.py +188 -0
  126. hyperclaw/managed_config.py +245 -0
  127. hyperclaw/media_hub.py +179 -0
  128. hyperclaw/memory_manager.py +584 -0
  129. hyperclaw/model_catalog.py +551 -0
  130. hyperclaw/model_policy.py +211 -0
  131. hyperclaw/model_router.py +595 -0
  132. hyperclaw/model_selector.py +72 -0
  133. hyperclaw/naming.py +284 -0
  134. hyperclaw/notices.py +65 -0
  135. hyperclaw/oai_stream.py +106 -0
  136. hyperclaw/orchestrator.py +591 -0
  137. hyperclaw/outbox.py +82 -0
  138. hyperclaw/persona.py +367 -0
  139. hyperclaw/prometheus.py +219 -0
  140. hyperclaw/prompt_assembly.py +157 -0
  141. hyperclaw/provider_setup.py +146 -0
  142. hyperclaw/providers.py +340 -0
  143. hyperclaw/qualification.py +341 -0
  144. hyperclaw/qualification_keys/hyper-d292fd127cef5a3e.pub +1 -0
  145. hyperclaw/qualification_records/anthropic--claude-sonnet-5-5.json +14 -0
  146. hyperclaw/reasoning_display.py +35 -0
  147. hyperclaw/scheduler.py +454 -0
  148. hyperclaw/server.py +847 -0
  149. hyperclaw/setup.py +627 -0
  150. hyperclaw/skills.py +717 -0
  151. hyperclaw/solomon.py +442 -0
  152. hyperclaw/swarm.py +533 -0
  153. hyperclaw/taint.py +832 -0
  154. hyperclaw/team/__init__.py +28 -0
  155. hyperclaw/team/dispatcher.py +431 -0
  156. hyperclaw/team/genesis.py +106 -0
  157. hyperclaw/team/lead.py +110 -0
  158. hyperclaw/team/model.py +135 -0
  159. hyperclaw/team/morning.py +238 -0
  160. hyperclaw/team/repos.py +66 -0
  161. hyperclaw/team/roster.py +264 -0
  162. hyperclaw/team/specialist.py +235 -0
  163. hyperclaw/team/status.py +163 -0
  164. hyperclaw/team/watchers.py +112 -0
  165. hyperclaw/teamsetup/__init__.py +17 -0
  166. hyperclaw/teamsetup/checks.py +208 -0
  167. hyperclaw/teamsetup/item.py +391 -0
  168. hyperclaw/teamsetup/oauth_loopback.py +84 -0
  169. hyperclaw/teamsetup/onboard.py +550 -0
  170. hyperclaw/teamsetup/profile.py +82 -0
  171. hyperclaw/teamsetup/secrets.py +313 -0
  172. hyperclaw/teamsetup/selfcheck.py +295 -0
  173. hyperclaw/teamsetup/service.py +495 -0
  174. hyperclaw/teamsetup/slack_oauth.py +442 -0
  175. hyperclaw/teamsetup/tty.py +62 -0
  176. hyperclaw/telegram_bot.py +1106 -0
  177. hyperclaw/telegram_intake.py +126 -0
  178. hyperclaw/telegram_pairing.py +360 -0
  179. hyperclaw/terminal_provider.py +323 -0
  180. hyperclaw/tools/__init__.py +1 -0
  181. hyperclaw/tools/approval.py +949 -0
  182. hyperclaw/tools/args.py +212 -0
  183. hyperclaw/tools/catalog.py +244 -0
  184. hyperclaw/tools/classify.py +266 -0
  185. hyperclaw/tools/effects.py +724 -0
  186. hyperclaw/tools/egress.py +210 -0
  187. hyperclaw/tools/envelope.py +188 -0
  188. hyperclaw/tools/guard.py +367 -0
  189. hyperclaw/tools/ledger.py +339 -0
  190. hyperclaw/tools/receipts.py +70 -0
  191. hyperclaw/tools/registry.py +318 -0
  192. hyperclaw/tools/service_guard.py +151 -0
  193. hyperclaw/tools/surfaces.py +54 -0
  194. hyperclaw/tools/workspace.py +87 -0
  195. hyperclaw/trading/__init__.py +77 -0
  196. hyperclaw/truth_guard.py +791 -0
  197. hyperclaw/tts.py +124 -0
  198. hyperclaw/tui.py +4255 -0
  199. hyperclaw/tui_bridge.py +938 -0
  200. hyperclaw/unattended.py +60 -0
  201. hyperclaw/updates/__init__.py +54 -0
  202. hyperclaw/updates/check.py +131 -0
  203. hyperclaw/updates/index.py +178 -0
  204. hyperclaw/updates/install.py +110 -0
  205. hyperclaw/updates/managed.py +161 -0
  206. hyperclaw/updates/manifest.py +138 -0
  207. hyperclaw/updates/notices.py +86 -0
  208. hyperclaw/updates/paths.py +53 -0
  209. hyperclaw/updates/release.py +146 -0
  210. hyperclaw/updates/upgrade.py +253 -0
  211. hyperclaw/updates/versioning.py +104 -0
  212. hyperclaw/userconfig.py +119 -0
  213. hyperclaw/xai.py +83 -0
  214. integrations/__init__.py +31 -0
  215. integrations/automation/__init__.py +1 -0
  216. integrations/automation/make.py +87 -0
  217. integrations/automation/zapier.py +87 -0
  218. integrations/base.py +476 -0
  219. integrations/communication/__init__.py +1 -0
  220. integrations/communication/twilio.py +279 -0
  221. integrations/communication/zoom.py +290 -0
  222. integrations/data/__init__.py +1 -0
  223. integrations/data/google_analytics.py +135 -0
  224. integrations/data/postgres.py +182 -0
  225. integrations/data/supabase_connector.py +202 -0
  226. integrations/data/weather_feeds.py +450 -0
  227. integrations/developer/__init__.py +9 -0
  228. integrations/developer/github.py +406 -0
  229. integrations/developer/gitlab.py +298 -0
  230. integrations/enterprise/__init__.py +13 -0
  231. integrations/enterprise/confluence.py +266 -0
  232. integrations/enterprise/hubspot.py +293 -0
  233. integrations/enterprise/jira.py +314 -0
  234. integrations/enterprise/salesforce.py +286 -0
  235. integrations/finance/__init__.py +1 -0
  236. integrations/finance/polymarket_client.py +247 -0
  237. integrations/finance/quickbooks.py +281 -0
  238. integrations/finance/stripe.py +261 -0
  239. integrations/gateway.py +238 -0
  240. integrations/messaging/__init__.py +32 -0
  241. integrations/messaging/discord.py +159 -0
  242. integrations/messaging/email.py +401 -0
  243. integrations/messaging/imessage.py +443 -0
  244. integrations/messaging/signal.py +175 -0
  245. integrations/messaging/slack.py +217 -0
  246. integrations/messaging/sms.py +175 -0
  247. integrations/messaging/teams.py +208 -0
  248. integrations/messaging/telegram.py +260 -0
  249. integrations/messaging/whatsapp.py +203 -0
  250. integrations/productivity/__init__.py +17 -0
  251. integrations/productivity/airtable.py +217 -0
  252. integrations/productivity/asana.py +248 -0
  253. integrations/productivity/google/__init__.py +19 -0
  254. integrations/productivity/google/base.py +89 -0
  255. integrations/productivity/google/calendar.py +272 -0
  256. integrations/productivity/google/docs.py +202 -0
  257. integrations/productivity/google/drive.py +268 -0
  258. integrations/productivity/google/gmail.py +279 -0
  259. integrations/productivity/google/meet.py +218 -0
  260. integrations/productivity/google/sheets.py +222 -0
  261. integrations/productivity/google/tasks.py +199 -0
  262. integrations/productivity/linear.py +279 -0
  263. integrations/productivity/microsoft/__init__.py +13 -0
  264. integrations/productivity/microsoft/base.py +93 -0
  265. integrations/productivity/microsoft/calendar.py +207 -0
  266. integrations/productivity/microsoft/onedrive.py +222 -0
  267. integrations/productivity/microsoft/outlook.py +241 -0
  268. integrations/productivity/microsoft/sharepoint.py +211 -0
  269. integrations/productivity/notion.py +243 -0
  270. integrations/productivity/todoist.py +250 -0
  271. integrations/productivity/trello.py +244 -0
  272. integrations/storage/__init__.py +1 -0
  273. integrations/storage/box.py +279 -0
  274. integrations/storage/dropbox.py +215 -0
  275. integrations/telegram_inbound.py +179 -0
  276. integrations/telegram_poller.py +151 -0
  277. memory/__init__.py +1 -0
  278. memory/causal_graph.py +125 -0
  279. memory/impact_tracker.py +88 -0
  280. memory/vector_memory.py +436 -0
  281. models/__init__.py +12 -0
  282. models/chatjimmy_client.py +210 -0
  283. models/claude_client.py +235 -0
  284. models/claude_code_subagent.py +192 -0
  285. models/openai_client.py +120 -0
  286. models/router.py +162 -0
  287. recursive/discovery_loop.py +118 -0
  288. recursive/optimization_loop.py +135 -0
  289. recursive/validation_loop.py +38 -0
  290. security/__init__.py +1 -0
  291. security/audit_logger.py +106 -0
  292. security/filesystem_guard.py +100 -0
  293. security/hypershield.py +99 -0
  294. security/network_guard.py +97 -0
  295. security/policy_engine.py +198 -0
  296. swarm/__init__.py +1 -0
  297. swarm/agents/__init__.py +0 -0
  298. swarm/agents/base.py +230 -0
  299. swarm/agents/business/__init__.py +0 -0
  300. swarm/agents/business/counsel.py +31 -0
  301. swarm/agents/business/herald.py +32 -0
  302. swarm/agents/business/ledger.py +26 -0
  303. swarm/agents/business/nexus.py +30 -0
  304. swarm/agents/business/ops.py +30 -0
  305. swarm/agents/business/pipeline.py +28 -0
  306. swarm/agents/business/revenue.py +30 -0
  307. swarm/agents/business/sovereign.py +31 -0
  308. swarm/agents/business/strategos.py +27 -0
  309. swarm/agents/business/talent.py +27 -0
  310. swarm/agents/business/venture.py +32 -0
  311. swarm/agents/comms/__init__.py +1 -0
  312. swarm/agents/comms/cipher.py +32 -0
  313. swarm/agents/comms/echo_comms.py +31 -0
  314. swarm/agents/comms/envoy.py +31 -0
  315. swarm/agents/comms/herald_scheduler.py +33 -0
  316. swarm/agents/comms/pulse.py +29 -0
  317. swarm/agents/creative/__init__.py +0 -0
  318. swarm/agents/creative/author.py +27 -0
  319. swarm/agents/creative/lens.py +25 -0
  320. swarm/agents/executive/__init__.py +1 -0
  321. swarm/agents/intelligence/__init__.py +1 -0
  322. swarm/agents/intelligence/arbiter.py +30 -0
  323. swarm/agents/intelligence/sentinel.py +30 -0
  324. swarm/agents/media/__init__.py +0 -0
  325. swarm/agents/personal/__init__.py +0 -0
  326. swarm/agents/personal/atlas.py +27 -0
  327. swarm/agents/personal/hearth.py +26 -0
  328. swarm/agents/personal/midas.py +27 -0
  329. swarm/agents/personal/navigator.py +27 -0
  330. swarm/agents/personal/nourish.py +31 -0
  331. swarm/agents/personal/vitals.py +33 -0
  332. swarm/agents/recursive/__init__.py +0 -0
  333. swarm/agents/recursive/alchemist.py +73 -0
  334. swarm/agents/recursive/calibrator.py +45 -0
  335. swarm/agents/recursive/scout.py +97 -0
  336. swarm/agents/scientific/__init__.py +0 -0
  337. swarm/agents/scientific/cosmos.py +36 -0
  338. swarm/agents/scientific/gaia.py +26 -0
  339. swarm/agents/scientific/medicus.py +33 -0
  340. swarm/agents/scientific/oracle_agent.py +39 -0
  341. swarm/agents/scientific/scribe.py +39 -0
  342. swarm/agents/talent/__init__.py +0 -0
  343. swarm/agents/talent/deal.py +28 -0
  344. swarm/agents/talent/roster.py +29 -0
  345. swarm/agents/talent/scout.py +29 -0
  346. swarm/agents/talent/stage.py +27 -0
  347. swarm/agents/tech/__init__.py +0 -0
  348. swarm/agents/tech/aegis.py +28 -0
  349. swarm/agents/tech/bridge.py +28 -0
  350. swarm/agents/tech/forge.py +28 -0
  351. swarm/agents/trading/__init__.py +1 -0
  352. swarm/agents/trading/global_prediction_engine.py +611 -0
  353. swarm/agents/trading/polymarket_trader.py +165 -0
  354. swarm/agents/trading/prediction_strategist.py +218 -0
  355. swarm/autogen_bridge.py +68 -0
  356. swarm/bid_protocol.py +196 -0
  357. swarm/dispatcher.py +527 -0
  358. swarm/nexus.py +181 -0
  359. swarm/registry.py +112 -0
  360. telegram_listener.py +403 -0
  361. ui/tui/app.py +214 -0
cli/onboarding.py ADDED
@@ -0,0 +1,469 @@
1
+ """
2
+ HyperClaw Onboarding — Warm, conversational first-run experience.
3
+ """
4
+ from __future__ import annotations
5
+
6
+ import time
7
+ from pathlib import Path
8
+
9
+ from rich.console import Console
10
+ from rich.panel import Panel
11
+ from rich.prompt import Prompt, Confirm
12
+ from rich import print as rprint
13
+
14
+ from hyperclaw import live_state
15
+
16
+ console = Console()
17
+
18
+ def banner() -> str:
19
+ """Product banner (see hyperclaw.branding): "HyperAgents" before naming,
20
+ the agent's name with "HyperAgents · powered by HyperClaw" after."""
21
+ from hyperclaw.branding import banner_rich
22
+ return banner_rich()
23
+
24
+
25
+ def slow_print(text: str, delay: float = 0.02):
26
+ """Print text character by character for a typewriter effect."""
27
+ import sys
28
+ for char in text:
29
+ sys.stdout.write(char)
30
+ sys.stdout.flush()
31
+ time.sleep(delay)
32
+ print()
33
+
34
+
35
+ def _say(text: str, *, bold: bool = False, dim: bool = False, style: str = "") -> None:
36
+ """One plain line (never parsed as markup: live values are printed as-is)."""
37
+ st = " ".join(x for x in (style or ("dim" if dim else "white"), "bold" if bold else "") if x)
38
+ console.print(text, style=st, markup=False, highlight=False)
39
+
40
+
41
+ def _live():
42
+ return live_state.snapshot()
43
+
44
+
45
+ def name_assistant() -> str:
46
+ """Step one of onboarding: name the assistant (spec §14).
47
+
48
+ Naming comes before model setup, so on a fresh install no model is
49
+ reachable yet and a suggestion comes from the starter list; the customer
50
+ can ask for a model-made suggestion later with /name suggest. If a model
51
+ is already configured (e.g. `hyperclaw init --reset`), it is used."""
52
+ from hyperclaw import naming
53
+
54
+ console.print()
55
+
56
+ def ask(label: str) -> str:
57
+ return Prompt.ask(f"[cyan]{label}[/cyan]", default="", show_default=False)
58
+
59
+ def say(text: str) -> None:
60
+ console.print(text, markup=False, highlight=False)
61
+ console.print()
62
+
63
+ name = naming.run_interactive(ask, say, model_call=naming.default_model_call())
64
+ time.sleep(0.2)
65
+ return name
66
+
67
+
68
+ def warm_greeting():
69
+ """First greeting - friendly and inviting."""
70
+ console.print(banner())
71
+ time.sleep(0.5)
72
+
73
+ # Welcome message
74
+ console.print()
75
+ # Generated from what is live on this install (truth rule): no fixed
76
+ # list of capabilities or integrations (hyperclaw.live_state).
77
+ state = _live()
78
+ for line in live_state.welcome_lines(state):
79
+ _say(line, bold=line.startswith("Welcome"))
80
+ console.print()
81
+ time.sleep(0.5)
82
+
83
+ _say("Setup:", dim=True)
84
+ for i, step in enumerate(live_state.steps(state), 1):
85
+ _say(f" {i}. {step}")
86
+ console.print()
87
+ time.sleep(0.5)
88
+
89
+
90
+ def get_name():
91
+ """Ask for user's name."""
92
+ name = Prompt.ask("[cyan]What should I call you?[/cyan]")
93
+ console.print()
94
+ rprint(f"[white]Nice to meet you, [bold]{name}[/bold].[/white]")
95
+ time.sleep(0.3)
96
+ return name
97
+
98
+
99
+ def explain_system(user_name: str, ai_name: str):
100
+ """Explain what the AI does."""
101
+ console.print()
102
+ rprint(f"[white]Here's the deal, {user_name}.[/white]")
103
+ time.sleep(0.3)
104
+ console.print()
105
+
106
+ _say(f"I'm {ai_name}.")
107
+ for line in live_state.explain_lines(_live()):
108
+ _say(line)
109
+ time.sleep(0.2)
110
+ console.print()
111
+
112
+
113
+ def ask_hyper_key() -> str:
114
+ """The only thing HyperSpeed V2 needs from the customer (masked)."""
115
+ from hyperclaw.hyperspeed import looks_like_third_party_key
116
+ rprint("[white]HyperSpeed V2 is preconfigured: the endpoint and model are built in.[/white]")
117
+ rprint("[white]All it needs is your [bold]Hyper access key[/bold] "
118
+ "(from your Hyper account or your Hyper contact).[/white]")
119
+ console.print()
120
+ from hyperclaw.model_policy import check_key
121
+ for _ in range(2):
122
+ key = Prompt.ask("[cyan]Hyper access key (hidden; press Enter to add it later)[/cyan]",
123
+ password=True, default="", show_default=False).strip()
124
+ refused = check_key(key)
125
+ if refused:
126
+ _say(refused, style="yellow")
127
+ continue
128
+ vendor = looks_like_third_party_key(key)
129
+ if vendor:
130
+ _say(f"That looks like an {vendor} key, not a Hyper access key. "
131
+ f"You can add it as your own provider in the next step.", style="yellow")
132
+ continue
133
+ if not key:
134
+ return key
135
+ result = check_connection(key)
136
+ _say(result.line, style="green" if result.ok else "yellow")
137
+ if result.ok or result.kind != "auth":
138
+ return key # unavailable or timed out: the key is kept, try later
139
+ return ""
140
+
141
+
142
+ def check_connection(key: str):
143
+ """Live test call to HyperSpeed V2 with the key just entered
144
+ (hyperclaw.connection_check). Tests replace this with a mock endpoint."""
145
+ from hyperclaw.connection_check import check_hyperspeed
146
+ return check_hyperspeed(key)
147
+
148
+
149
+ def _own_provider_prompt(choice: str) -> dict:
150
+ """Ask for one of the customer's own providers. choice: 2-6."""
151
+ if choice == "5":
152
+ console.print()
153
+ rprint("[white]AWS Bedrock needs credentials and a region.[/white]")
154
+ rprint("[dim]Leave blank to use environment variables / IAM role.[/dim]")
155
+ console.print()
156
+ access_key = Prompt.ask("[cyan]AWS Access Key ID (Enter to use env/IAM)[/cyan]", default="")
157
+ secret_key = Prompt.ask("[cyan]AWS Secret Access Key (Enter to use env/IAM)[/cyan]",
158
+ password=True, default="")
159
+ if _refused(access_key) or _refused(secret_key):
160
+ return {}
161
+ region = Prompt.ask("[cyan]AWS Region[/cyan]", default="us-east-1")
162
+ return {"provider": "bedrock", "access_key": access_key or None,
163
+ "secret_key": secret_key or None, "region": region}
164
+
165
+ if choice == "4":
166
+ console.print()
167
+ base_url = Prompt.ask("[cyan]Base URL[/cyan]", default="https://api.openai.com/v1")
168
+ api_key = Prompt.ask("[cyan]API key[/cyan]", password=True)
169
+ if _refused(api_key):
170
+ return {}
171
+ model = Prompt.ask("[cyan]Model name[/cyan]", default="gpt-4o")
172
+ if not base_url or not api_key:
173
+ rprint("[yellow]Base URL and API key are both required.[/yellow]")
174
+ return {}
175
+ return {"provider": "openai_compat", "api_key": api_key, "base_url": base_url,
176
+ "model": model}
177
+
178
+ if choice == "6":
179
+ console.print()
180
+ base_url = Prompt.ask("[cyan]Base URL (Anthropic Messages API)[/cyan]",
181
+ default="http://localhost:8000")
182
+ api_key = Prompt.ask("[cyan]API key (or any placeholder)[/cyan]", password=True)
183
+ if _refused(api_key):
184
+ return {}
185
+ if not base_url or not api_key:
186
+ rprint("[yellow]Base URL and API key are both required.[/yellow]")
187
+ return {}
188
+ return {"provider": "anthropic_compat", "api_key": api_key, "base_url": base_url}
189
+
190
+ if choice == "3":
191
+ console.print()
192
+ api_key = Prompt.ask("[cyan]Paste your OpenAI API key (hidden)[/cyan]", password=True)
193
+ if not api_key.strip() or _refused(api_key):
194
+ return {}
195
+ return {"provider": "openai", "api_key": api_key.strip()}
196
+
197
+ if choice == "7":
198
+ from hyperclaw import xai
199
+ console.print()
200
+ api_key = Prompt.ask("[cyan]Paste your xAI API key (hidden)[/cyan]", password=True)
201
+ if not api_key.strip() or _refused(api_key):
202
+ return {}
203
+ return {"provider": "xai", "api_key": api_key.strip(), "model": xai.DEFAULT_MODEL}
204
+
205
+ # Anthropic
206
+ console.print()
207
+ api_key = Prompt.ask("[cyan]Paste your Anthropic API key (hidden)[/cyan]", password=True)
208
+ if _refused(api_key):
209
+ return {}
210
+ if not api_key.startswith("sk-ant-"):
211
+ rprint("[yellow]That doesn't look right — Anthropic keys start with 'sk-ant-'.[/yellow]")
212
+ return {}
213
+ return {"provider": "anthropic", "api_key": api_key}
214
+
215
+
216
+ OWN_NOTE = ("[dim]Your own providers are labelled as yours, and stay chat-only until "
217
+ "that model passes HyperAgents' tool qualification.[/dim]")
218
+
219
+
220
+ def _refused(key: str) -> bool:
221
+ """A RunPod-looking key is never accepted for any provider."""
222
+ from hyperclaw.model_policy import check_key
223
+ reason = check_key(key or "")
224
+ if reason:
225
+ _say(reason, style="yellow")
226
+ return bool(reason)
227
+
228
+
229
+ def ask_consent(provider: str, model: str) -> bool:
230
+ """Exactly one plain line, then the owner's yes. Recorded (time, provider,
231
+ model) in the owner-only consent file; no consent, no switch."""
232
+ from hyperclaw.model_policy import consent_line, has_consent, record_consent
233
+ _say(consent_line(provider))
234
+ if has_consent(provider):
235
+ return True
236
+ if not Confirm.ask("[cyan]Continue?[/cyan]", default=False):
237
+ return False
238
+ record_consent(provider, model)
239
+ return True
240
+
241
+
242
+ def _default_model(cfg: dict) -> str:
243
+ kind = cfg.get("provider", "")
244
+ if cfg.get("model"):
245
+ return cfg["model"]
246
+ try:
247
+ from hyperclaw.providers import ProviderRegistry
248
+ prov = ProviderRegistry.load().providers.get(kind)
249
+ if prov is not None:
250
+ return prov.model_for()
251
+ except Exception: # noqa: BLE001
252
+ pass
253
+ return ""
254
+
255
+
256
+ def setup_model() -> dict:
257
+ """Choose the model. HyperSpeed V2 is preselected (option 1). A
258
+ Hyper-deployed install has no provider menu: it shows the models on its
259
+ allowed list (V2 first) and asks for the Hyper access key. Choosing a
260
+ third-party model needs the owner's consent. Returns the provider config."""
261
+ from hyperclaw.deployment import is_hyper
262
+ time.sleep(0.3)
263
+ console.print()
264
+ if is_hyper():
265
+ from hyperclaw import hyperspeed, managed_config
266
+ _say("This install is Hyper-deployed: Hyper sets the models it can use.")
267
+ _say("Models on this install:")
268
+ for name in live_state.snapshot().allowed:
269
+ _say(f" • {name}")
270
+ console.print()
271
+ if not managed_config.provider_allowed(hyperspeed.PROVIDER_NAME):
272
+ return {}
273
+ return {"provider": "hyperspeed", "api_key": ask_hyper_key()}
274
+
275
+ rprint("[white]Next, the [bold]model[/bold] I run on.[/white]")
276
+ console.print()
277
+ rprint("[cyan] 1. HyperSpeed V2 (recommended) — Hyper's own model. Chat-only for now. "
278
+ "Needs your Hyper access key.[/cyan]")
279
+ rprint("[cyan] 2. Your own provider: Anthropic API key[/cyan]")
280
+ rprint("[cyan] 3. Your own provider: OpenAI API key[/cyan]")
281
+ rprint("[cyan] 4. Your own provider: OpenAI-compatible endpoint (Azure, LiteLLM, vLLM...)[/cyan]")
282
+ rprint("[cyan] 5. Your own provider: AWS Bedrock[/cyan]")
283
+ rprint("[cyan] 6. Your own provider: Anthropic-compatible endpoint[/cyan]")
284
+ rprint("[cyan] 7. Your own provider: xAI API key (Grok)[/cyan]")
285
+ rprint(OWN_NOTE)
286
+ console.print()
287
+ choice = Prompt.ask("[cyan]Choose[/cyan]", choices=["1", "2", "3", "4", "5", "6", "7"],
288
+ default="1")
289
+ if choice == "1":
290
+ console.print()
291
+ return {"provider": "hyperspeed", "api_key": ask_hyper_key()}
292
+ cfg = _own_provider_prompt(choice)
293
+ if cfg.get("provider") and not ask_consent(cfg["provider"], _default_model(cfg)):
294
+ _say("Nothing was switched: HyperSpeed V2 stays the model.")
295
+ console.print()
296
+ return {"provider": "hyperspeed", "api_key": ask_hyper_key()}
297
+ return cfg
298
+
299
+
300
+ def offer_own_provider() -> dict:
301
+ """Optional, after V2: add the customer's own Anthropic/OpenAI key too."""
302
+ from hyperclaw.deployment import is_hyper
303
+ if is_hyper():
304
+ return {}
305
+ console.print()
306
+ if not Confirm.ask("[cyan]Add your own provider as well? (optional — e.g. your "
307
+ "Anthropic or OpenAI key)[/cyan]", default=False):
308
+ return {}
309
+ rprint("[cyan] 2. Anthropic API key[/cyan]")
310
+ rprint("[cyan] 3. OpenAI API key[/cyan]")
311
+ rprint("[cyan] 4. OpenAI-compatible endpoint[/cyan]")
312
+ rprint("[cyan] 7. xAI API key (Grok)[/cyan]")
313
+ rprint(OWN_NOTE)
314
+ choice = Prompt.ask("[cyan]Choose[/cyan]", choices=["2", "3", "4", "7"], default="2")
315
+ return _own_provider_prompt(choice)
316
+
317
+
318
+ def setup_database():
319
+ """Guide through database setup."""
320
+ console.print()
321
+ rprint("[white]Next: [bold]memory[/bold].[/white]")
322
+ time.sleep(0.2)
323
+ _say("Your memory is kept in files on this computer. Optionally, you can keep it in a "
324
+ "PostgreSQL database of your own instead.")
325
+ console.print()
326
+
327
+ rprint("[white]One way: a [bold]Supabase[/bold] project[/white]")
328
+ rprint("[cyan] 1. Go to [link=https://supabase.com]supabase.com[/link][/cyan]")
329
+ rprint("[cyan] 2. Create a project[/cyan]")
330
+ rprint("[cyan] 3. Copy the connection string from Settings > Database[/cyan]")
331
+ console.print()
332
+
333
+ setup_db = Confirm.ask("[cyan]Want to set up a database now?[/cyan]", default=False)
334
+
335
+ if not setup_db:
336
+ rprint("\n[white]That's fine. You can add it later.[/white]")
337
+ _say("Memory stays on this computer.", dim=True)
338
+ return None
339
+
340
+ db_url = Prompt.ask("[cyan]Paste your database URL[/cyan]")
341
+ while "[YOUR-PASSWORD]" in db_url or "[YOUR-" in db_url:
342
+ rprint("[yellow]That URL still contains the [YOUR-PASSWORD] placeholder from "
343
+ "Supabase's template. Replace it with your actual database password "
344
+ "(Supabase: Settings > Database).[/yellow]")
345
+ db_url = Prompt.ask("[cyan]Paste your database URL (or press Enter to skip)[/cyan]", default="")
346
+ if not db_url:
347
+ rprint("[dim]Skipping database setup — you can add DATABASE_URL to ~/.hyperclaw/.env later.[/dim]")
348
+ return None
349
+ return db_url
350
+
351
+
352
+ def setup_integrations():
353
+ """What is connected on this install, from live state only (truth rule)."""
354
+ console.print()
355
+ _say("Integrations", bold=True)
356
+ time.sleep(0.2)
357
+ for line in live_state.integrations_lines(_live()):
358
+ _say(line)
359
+
360
+
361
+ def setup_telegram() -> bool:
362
+ """Optional chat-app step. Offered only where the install profile allows
363
+ it (managed config, docs/MODEL-POLICY.md); its text lives in
364
+ hyperclaw.telegram_pairing so this file names no integration itself."""
365
+ from hyperclaw import telegram_pairing
366
+ return telegram_pairing.onboarding_offer(
367
+ say=lambda text: rprint(text), confirm=Confirm.ask, prompt=Prompt.ask,
368
+ line=lambda text: console.print(text, markup=False))
369
+
370
+
371
+ def write_config(user_name: str, ai_name: str, provider_cfg: dict, db_url: str | None,
372
+ extra_provider: dict | None = None):
373
+ """Write the customer's config.json and .env (merged, never clobbered).
374
+
375
+ No persona file is written: there is no seeded persona (spec rule 1).
376
+ The persona grows only from preferences the customer sets or agrees to."""
377
+ from hyperclaw.provider_setup import HyperDeployedRefusal, save_provider
378
+ from hyperclaw.userconfig import env_update, root, update_config
379
+
380
+ hyperclaw_dir = root()
381
+ for _sub in ("", "memory", "memory/daily", "workspace", "workspace/context",
382
+ "secrets", "logs", "config"):
383
+ (hyperclaw_dir / _sub).mkdir(parents=True, exist_ok=True)
384
+
385
+ update_config(user_name=user_name, ai_name=ai_name, version="1.0")
386
+
387
+ prov = provider_cfg.get("provider")
388
+ if prov:
389
+ try:
390
+ save_provider(provider_cfg, make_default=True)
391
+ except HyperDeployedRefusal as e:
392
+ rprint(f"[yellow]{e}[/yellow]")
393
+ if extra_provider and extra_provider.get("provider"):
394
+ try:
395
+ save_provider(extra_provider, make_default=False)
396
+ except HyperDeployedRefusal as e:
397
+ rprint(f"[yellow]{e}[/yellow]")
398
+
399
+ if db_url:
400
+ env_update({"DATABASE_URL": db_url})
401
+
402
+ rprint(f"\n[green]Created [bold]{ai_name}[/bold] at {hyperclaw_dir}[/green]")
403
+
404
+
405
+ def final_message(user_name: str, ai_name: str, provider_cfg: dict):
406
+ """Wrap up the onboarding."""
407
+ console.print()
408
+ console.print(Panel.fit(
409
+ f"[bold white]You're all set, {user_name}.[/bold white]",
410
+ border_style="green"
411
+ ))
412
+ console.print()
413
+
414
+ if not provider_cfg.get("provider"):
415
+ rprint("[white]Once you have your API key:[/white]")
416
+ rprint("[cyan] hyperclaw init[/cyan] — Run setup again")
417
+ console.print()
418
+ return
419
+ if provider_cfg.get("provider") == "hyperspeed" and not provider_cfg.get("api_key"):
420
+ rprint("[white]Add your Hyper access key when you have it:[/white]")
421
+ rprint("[cyan] hyperclaw provider hyper-key[/cyan]")
422
+ console.print()
423
+ return
424
+
425
+ rprint(f"[dim]{ai_name} is ready.[/dim]")
426
+ console.print()
427
+ time.sleep(1)
428
+
429
+ # Launch TUI directly
430
+ try:
431
+ from hyperclaw.tui import main as tui_main
432
+ tui_main()
433
+ except Exception as e:
434
+ rprint(f"[yellow]Couldn't start chat: {e}[/yellow]")
435
+ rprint("[white]Run [bold]hyperclaw start[/bold] to try again.[/white]")
436
+
437
+
438
+ def run_onboarding():
439
+ """Main onboarding flow: name first, then the customer, then the model."""
440
+ from hyperclaw.deployment import is_hyper
441
+ console.clear()
442
+
443
+ warm_greeting()
444
+
445
+ ai_name = name_assistant()
446
+ user_name = get_name()
447
+ explain_system(user_name, ai_name)
448
+
449
+ provider_cfg = setup_model()
450
+ extra = {}
451
+ db_url = None
452
+
453
+ if provider_cfg.get("provider"):
454
+ if is_hyper():
455
+ # Hyper-deployed: no provider menu, no database step; local memory.
456
+ _say("Memory stays on this computer.", dim=True)
457
+ else:
458
+ if provider_cfg["provider"] == "hyperspeed":
459
+ extra = offer_own_provider()
460
+ db_url = setup_database()
461
+ setup_integrations()
462
+ setup_telegram()
463
+
464
+ write_config(user_name, ai_name, provider_cfg, db_url, extra)
465
+ final_message(user_name, ai_name, provider_cfg)
466
+
467
+
468
+ if __name__ == "__main__":
469
+ run_onboarding()
core/__init__.py ADDED
@@ -0,0 +1 @@
1
+ # HyperClaw Core — HyperCore Foundation
@@ -0,0 +1,119 @@
1
+ """
2
+ HyperClaw Connectors.
3
+ Integration connectors for social media, smart home, messaging, productivity, and infrastructure.
4
+ """
5
+
6
+ from .social import (
7
+ SocialConnector,
8
+ TwitterConnector,
9
+ LinkedInConnector,
10
+ InstagramConnector,
11
+ FacebookConnector,
12
+ YouTubeConnector,
13
+ BlueskyConnector,
14
+ MastodonConnector,
15
+ RedditConnector,
16
+ TikTokConnector,
17
+ )
18
+
19
+ from .smarthome import (
20
+ SmartHomeConnector,
21
+ PhilipsHueConnector,
22
+ HomeAssistantConnector,
23
+ SonosConnector,
24
+ SpotifyConnector,
25
+ MQTTConnector,
26
+ SmartThingsConnector,
27
+ )
28
+
29
+ from .messaging import (
30
+ MessagingConnector,
31
+ GoogleChatConnector,
32
+ SignalConnector,
33
+ MatrixConnector,
34
+ iMessageConnector,
35
+ LINEConnector,
36
+ IRCConnector,
37
+ WeChatConnector,
38
+ MattermostConnector,
39
+ )
40
+
41
+ from .productivity import (
42
+ ProductivityConnector,
43
+ ObsidianConnector,
44
+ AppleNotesConnector,
45
+ AppleCalendarConnector,
46
+ GoogleSheetsConnector,
47
+ GoogleDocsConnector,
48
+ EvernoteConnector,
49
+ OneNoteConnector,
50
+ ClickUpConnector,
51
+ MondayConnector,
52
+ )
53
+
54
+ from .infrastructure import (
55
+ InfrastructureConnector,
56
+ DockerConnector,
57
+ AWSConnector,
58
+ GCPConnector,
59
+ AzureConnector,
60
+ TailscaleConnector,
61
+ SnowflakeConnector,
62
+ BigQueryConnector,
63
+ DatadogConnector,
64
+ PagerDutyConnector,
65
+ )
66
+
67
+ __all__ = [
68
+ # Social
69
+ "SocialConnector",
70
+ "TwitterConnector",
71
+ "LinkedInConnector",
72
+ "InstagramConnector",
73
+ "FacebookConnector",
74
+ "YouTubeConnector",
75
+ "BlueskyConnector",
76
+ "MastodonConnector",
77
+ "RedditConnector",
78
+ "TikTokConnector",
79
+ # Smart Home
80
+ "SmartHomeConnector",
81
+ "PhilipsHueConnector",
82
+ "HomeAssistantConnector",
83
+ "SonosConnector",
84
+ "SpotifyConnector",
85
+ "MQTTConnector",
86
+ "SmartThingsConnector",
87
+ # Messaging
88
+ "MessagingConnector",
89
+ "GoogleChatConnector",
90
+ "SignalConnector",
91
+ "MatrixConnector",
92
+ "iMessageConnector",
93
+ "LINEConnector",
94
+ "IRCConnector",
95
+ "WeChatConnector",
96
+ "MattermostConnector",
97
+ # Productivity
98
+ "ProductivityConnector",
99
+ "ObsidianConnector",
100
+ "AppleNotesConnector",
101
+ "AppleCalendarConnector",
102
+ "GoogleSheetsConnector",
103
+ "GoogleDocsConnector",
104
+ "EvernoteConnector",
105
+ "OneNoteConnector",
106
+ "ClickUpConnector",
107
+ "MondayConnector",
108
+ # Infrastructure
109
+ "InfrastructureConnector",
110
+ "DockerConnector",
111
+ "AWSConnector",
112
+ "GCPConnector",
113
+ "AzureConnector",
114
+ "TailscaleConnector",
115
+ "SnowflakeConnector",
116
+ "BigQueryConnector",
117
+ "DatadogConnector",
118
+ "PagerDutyConnector",
119
+ ]