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.
- agents/__init__.py +31 -0
- agents/background_monitor.py +453 -0
- agents/learning.py +460 -0
- agents/planner.py +421 -0
- agents/transcriber.py +341 -0
- civilization/__init__.py +51 -0
- civilization/api/__init__.py +7 -0
- civilization/api/civilization_api.py +361 -0
- civilization/graph/__init__.py +19 -0
- civilization/graph/knowledge_linker.py +348 -0
- civilization/graph/org_graph.py +348 -0
- civilization/graph/process_graph.py +386 -0
- civilization/ingestion/__init__.py +20 -0
- civilization/ingestion/chunker.py +273 -0
- civilization/ingestion/document_ingestor.py +358 -0
- civilization/ingestion/embedder.py +262 -0
- civilization/ingestion/extractor.py +224 -0
- civilization/interview/__init__.py +19 -0
- civilization/interview/gap_detector.py +380 -0
- civilization/interview/interviewer.py +323 -0
- civilization/interview/questioner.py +363 -0
- civilization/retrieval/__init__.py +17 -0
- civilization/retrieval/civilization_rag.py +316 -0
- civilization/retrieval/context_injector.py +342 -0
- civilization/retrieval/relevance_ranker.py +287 -0
- civilization/schema.py +299 -0
- civilization/store.py +177 -0
- civilization/sync/__init__.py +16 -0
- civilization/sync/confluence_sync.py +317 -0
- civilization/sync/gdrive_sync.py +262 -0
- civilization/sync/notion_sync.py +237 -0
- civilization/versioning/__init__.py +19 -0
- civilization/versioning/diff_engine.py +351 -0
- civilization/versioning/staleness_detector.py +303 -0
- civilization/versioning/version_manager.py +293 -0
- cli/__init__.py +1 -0
- cli/doctor.py +334 -0
- cli/hyperclaw.py +1357 -0
- cli/onboarding.py +469 -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 +218 -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 +389 -0
- core/providers/image.py +534 -0
- core/providers/llm.py +1935 -0
- core/providers/search.py +608 -0
- core/providers/voice.py +474 -0
- hyperagents-1.2.3rc5.post3.dist-info/METADATA +469 -0
- hyperagents-1.2.3rc5.post3.dist-info/RECORD +361 -0
- hyperagents-1.2.3rc5.post3.dist-info/WHEEL +5 -0
- hyperagents-1.2.3rc5.post3.dist-info/entry_points.txt +6 -0
- hyperagents-1.2.3rc5.post3.dist-info/licenses/LICENSE +21 -0
- hyperagents-1.2.3rc5.post3.dist-info/top_level.txt +13 -0
- hyperclaw/__init__.py +67 -0
- hyperclaw/__main__.py +220 -0
- hyperclaw/agent.py +775 -0
- hyperclaw/agent_coordinator.py +577 -0
- hyperclaw/anthropic_params.py +225 -0
- hyperclaw/api_utils.py +85 -0
- hyperclaw/approval_telegram.py +209 -0
- hyperclaw/approval_terminal.py +80 -0
- hyperclaw/attachments.py +177 -0
- hyperclaw/branding.py +55 -0
- hyperclaw/brief/__init__.py +11 -0
- hyperclaw/brief/cli.py +204 -0
- hyperclaw/brief/collect.py +146 -0
- hyperclaw/brief/compose.py +333 -0
- hyperclaw/brief/diff.py +110 -0
- hyperclaw/brief/errors.py +99 -0
- hyperclaw/brief/google.py +269 -0
- hyperclaw/brief/google_auth.py +294 -0
- hyperclaw/brief/links.py +124 -0
- hyperclaw/brief/service.py +424 -0
- hyperclaw/brief/store.py +205 -0
- hyperclaw/brief/tasks.py +200 -0
- hyperclaw/chat_scope.py +115 -0
- hyperclaw/cli_tui.py +497 -0
- hyperclaw/client_guard.py +717 -0
- hyperclaw/connection_check.py +113 -0
- hyperclaw/cost_guard.py +1728 -0
- hyperclaw/default_config/agents.yaml +534 -0
- hyperclaw/default_config/hyperclaw.yaml +27 -0
- hyperclaw/default_config/models.yaml +161 -0
- hyperclaw/deployment.py +39 -0
- hyperclaw/digest/__init__.py +9 -0
- hyperclaw/digest/cli.py +117 -0
- hyperclaw/digest/errors.py +100 -0
- hyperclaw/digest/gitlab.py +187 -0
- hyperclaw/digest/http.py +113 -0
- hyperclaw/digest/redact.py +32 -0
- hyperclaw/digest/service.py +271 -0
- hyperclaw/digest/slack.py +223 -0
- hyperclaw/digest/state.py +124 -0
- hyperclaw/digest/summarize.py +198 -0
- hyperclaw/digest/tokens.py +143 -0
- hyperclaw/distribution.py +46 -0
- hyperclaw/documents.py +351 -0
- hyperclaw/feeds.py +339 -0
- hyperclaw/google_workspace/__init__.py +5 -0
- hyperclaw/google_workspace/api.py +151 -0
- hyperclaw/google_workspace/auth.py +397 -0
- hyperclaw/google_workspace/calendar.py +157 -0
- hyperclaw/google_workspace/cli.py +72 -0
- hyperclaw/google_workspace/drive.py +236 -0
- hyperclaw/google_workspace/errors.py +58 -0
- hyperclaw/google_workspace/gmail.py +295 -0
- hyperclaw/google_workspace/meet.py +122 -0
- hyperclaw/google_workspace/tools.py +319 -0
- hyperclaw/hyperspeed.py +57 -0
- hyperclaw/integrations_layer.py +1427 -0
- hyperclaw/live_state.py +188 -0
- hyperclaw/managed_config.py +245 -0
- hyperclaw/media_hub.py +179 -0
- hyperclaw/memory_manager.py +584 -0
- hyperclaw/model_catalog.py +551 -0
- hyperclaw/model_policy.py +211 -0
- hyperclaw/model_router.py +595 -0
- hyperclaw/model_selector.py +72 -0
- hyperclaw/naming.py +284 -0
- hyperclaw/notices.py +65 -0
- hyperclaw/oai_stream.py +106 -0
- hyperclaw/orchestrator.py +591 -0
- hyperclaw/outbox.py +82 -0
- hyperclaw/persona.py +367 -0
- hyperclaw/prometheus.py +219 -0
- hyperclaw/prompt_assembly.py +157 -0
- hyperclaw/provider_setup.py +146 -0
- hyperclaw/providers.py +340 -0
- hyperclaw/qualification.py +341 -0
- hyperclaw/qualification_keys/hyper-d292fd127cef5a3e.pub +1 -0
- hyperclaw/qualification_records/anthropic--claude-sonnet-5-5.json +14 -0
- hyperclaw/reasoning_display.py +35 -0
- hyperclaw/scheduler.py +454 -0
- hyperclaw/server.py +847 -0
- hyperclaw/setup.py +627 -0
- hyperclaw/skills.py +717 -0
- hyperclaw/solomon.py +442 -0
- hyperclaw/swarm.py +533 -0
- hyperclaw/taint.py +832 -0
- hyperclaw/team/__init__.py +28 -0
- hyperclaw/team/dispatcher.py +431 -0
- hyperclaw/team/genesis.py +106 -0
- hyperclaw/team/lead.py +110 -0
- hyperclaw/team/model.py +135 -0
- hyperclaw/team/morning.py +238 -0
- hyperclaw/team/repos.py +66 -0
- hyperclaw/team/roster.py +264 -0
- hyperclaw/team/specialist.py +235 -0
- hyperclaw/team/status.py +163 -0
- hyperclaw/team/watchers.py +112 -0
- hyperclaw/teamsetup/__init__.py +17 -0
- hyperclaw/teamsetup/checks.py +208 -0
- hyperclaw/teamsetup/item.py +391 -0
- hyperclaw/teamsetup/oauth_loopback.py +84 -0
- hyperclaw/teamsetup/onboard.py +550 -0
- hyperclaw/teamsetup/profile.py +82 -0
- hyperclaw/teamsetup/secrets.py +313 -0
- hyperclaw/teamsetup/selfcheck.py +295 -0
- hyperclaw/teamsetup/service.py +495 -0
- hyperclaw/teamsetup/slack_oauth.py +442 -0
- hyperclaw/teamsetup/tty.py +62 -0
- hyperclaw/telegram_bot.py +1106 -0
- hyperclaw/telegram_intake.py +126 -0
- hyperclaw/telegram_pairing.py +360 -0
- hyperclaw/terminal_provider.py +323 -0
- hyperclaw/tools/__init__.py +1 -0
- hyperclaw/tools/approval.py +949 -0
- hyperclaw/tools/args.py +212 -0
- hyperclaw/tools/catalog.py +244 -0
- hyperclaw/tools/classify.py +266 -0
- hyperclaw/tools/effects.py +724 -0
- hyperclaw/tools/egress.py +210 -0
- hyperclaw/tools/envelope.py +188 -0
- hyperclaw/tools/guard.py +367 -0
- hyperclaw/tools/ledger.py +339 -0
- hyperclaw/tools/receipts.py +70 -0
- hyperclaw/tools/registry.py +318 -0
- hyperclaw/tools/service_guard.py +151 -0
- hyperclaw/tools/surfaces.py +54 -0
- hyperclaw/tools/workspace.py +87 -0
- hyperclaw/trading/__init__.py +77 -0
- hyperclaw/truth_guard.py +791 -0
- hyperclaw/tts.py +124 -0
- hyperclaw/tui.py +4255 -0
- hyperclaw/tui_bridge.py +938 -0
- hyperclaw/unattended.py +60 -0
- hyperclaw/updates/__init__.py +54 -0
- hyperclaw/updates/check.py +131 -0
- hyperclaw/updates/index.py +178 -0
- hyperclaw/updates/install.py +110 -0
- hyperclaw/updates/managed.py +161 -0
- hyperclaw/updates/manifest.py +138 -0
- hyperclaw/updates/notices.py +86 -0
- hyperclaw/updates/paths.py +53 -0
- hyperclaw/updates/release.py +146 -0
- hyperclaw/updates/upgrade.py +253 -0
- hyperclaw/updates/versioning.py +104 -0
- hyperclaw/userconfig.py +119 -0
- hyperclaw/xai.py +83 -0
- integrations/__init__.py +31 -0
- integrations/automation/__init__.py +1 -0
- integrations/automation/make.py +87 -0
- integrations/automation/zapier.py +87 -0
- integrations/base.py +476 -0
- integrations/communication/__init__.py +1 -0
- integrations/communication/twilio.py +279 -0
- integrations/communication/zoom.py +290 -0
- integrations/data/__init__.py +1 -0
- integrations/data/google_analytics.py +135 -0
- integrations/data/postgres.py +182 -0
- integrations/data/supabase_connector.py +202 -0
- integrations/data/weather_feeds.py +450 -0
- integrations/developer/__init__.py +9 -0
- integrations/developer/github.py +406 -0
- integrations/developer/gitlab.py +298 -0
- integrations/enterprise/__init__.py +13 -0
- integrations/enterprise/confluence.py +266 -0
- integrations/enterprise/hubspot.py +293 -0
- integrations/enterprise/jira.py +314 -0
- integrations/enterprise/salesforce.py +286 -0
- integrations/finance/__init__.py +1 -0
- integrations/finance/polymarket_client.py +247 -0
- integrations/finance/quickbooks.py +281 -0
- integrations/finance/stripe.py +261 -0
- integrations/gateway.py +238 -0
- integrations/messaging/__init__.py +32 -0
- integrations/messaging/discord.py +159 -0
- integrations/messaging/email.py +401 -0
- integrations/messaging/imessage.py +443 -0
- integrations/messaging/signal.py +175 -0
- integrations/messaging/slack.py +217 -0
- integrations/messaging/sms.py +175 -0
- integrations/messaging/teams.py +208 -0
- integrations/messaging/telegram.py +260 -0
- integrations/messaging/whatsapp.py +203 -0
- integrations/productivity/__init__.py +17 -0
- integrations/productivity/airtable.py +217 -0
- integrations/productivity/asana.py +248 -0
- integrations/productivity/google/__init__.py +19 -0
- integrations/productivity/google/base.py +89 -0
- integrations/productivity/google/calendar.py +272 -0
- integrations/productivity/google/docs.py +202 -0
- integrations/productivity/google/drive.py +268 -0
- integrations/productivity/google/gmail.py +279 -0
- integrations/productivity/google/meet.py +218 -0
- integrations/productivity/google/sheets.py +222 -0
- integrations/productivity/google/tasks.py +199 -0
- integrations/productivity/linear.py +279 -0
- integrations/productivity/microsoft/__init__.py +13 -0
- integrations/productivity/microsoft/base.py +93 -0
- integrations/productivity/microsoft/calendar.py +207 -0
- integrations/productivity/microsoft/onedrive.py +222 -0
- integrations/productivity/microsoft/outlook.py +241 -0
- integrations/productivity/microsoft/sharepoint.py +211 -0
- integrations/productivity/notion.py +243 -0
- integrations/productivity/todoist.py +250 -0
- integrations/productivity/trello.py +244 -0
- integrations/storage/__init__.py +1 -0
- integrations/storage/box.py +279 -0
- integrations/storage/dropbox.py +215 -0
- integrations/telegram_inbound.py +179 -0
- integrations/telegram_poller.py +151 -0
- memory/__init__.py +1 -0
- memory/causal_graph.py +125 -0
- memory/impact_tracker.py +88 -0
- memory/vector_memory.py +436 -0
- models/__init__.py +12 -0
- models/chatjimmy_client.py +210 -0
- models/claude_client.py +235 -0
- models/claude_code_subagent.py +192 -0
- models/openai_client.py +120 -0
- models/router.py +162 -0
- recursive/discovery_loop.py +118 -0
- recursive/optimization_loop.py +135 -0
- recursive/validation_loop.py +38 -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 +230 -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 +30 -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 +32 -0
- swarm/agents/comms/__init__.py +1 -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/intelligence/__init__.py +1 -0
- swarm/agents/intelligence/arbiter.py +30 -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/__init__.py +1 -0
- swarm/agents/trading/global_prediction_engine.py +611 -0
- swarm/agents/trading/polymarket_trader.py +165 -0
- swarm/agents/trading/prediction_strategist.py +218 -0
- swarm/autogen_bridge.py +68 -0
- swarm/bid_protocol.py +196 -0
- swarm/dispatcher.py +527 -0
- swarm/nexus.py +181 -0
- swarm/registry.py +112 -0
- telegram_listener.py +403 -0
- ui/tui/app.py +214 -0
hyperclaw/__main__.py
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"""
|
|
2
|
+
HyperClaw CLI Entry Point
|
|
3
|
+
Usage: python -m hyperclaw <command>
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import asyncio
|
|
8
|
+
import sys
|
|
9
|
+
import os
|
|
10
|
+
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def main():
|
|
15
|
+
parser = argparse.ArgumentParser(
|
|
16
|
+
prog="hyperclaw",
|
|
17
|
+
description="HyperClaw AI Assistant Platform"
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
subparsers = parser.add_subparsers(dest="command", help="Available commands")
|
|
21
|
+
|
|
22
|
+
# Setup command
|
|
23
|
+
setup_parser = subparsers.add_parser("setup", help="Initialize HyperClaw")
|
|
24
|
+
setup_parser.add_argument("--init-db", action="store_true", help="Initialize database schema")
|
|
25
|
+
setup_parser.add_argument("--overwrite", action="store_true", help="Overwrite existing files")
|
|
26
|
+
setup_parser.add_argument("-v", "--verbose", action="store_true", help="Verbose output")
|
|
27
|
+
|
|
28
|
+
# Server command
|
|
29
|
+
server_parser = subparsers.add_parser("server", help="Run the API server")
|
|
30
|
+
server_parser.add_argument("--host", default=None,
|
|
31
|
+
help="Host to bind to (default 127.0.0.1; HOST env also works). "
|
|
32
|
+
"A non-loopback address exposes the server to the network.")
|
|
33
|
+
server_parser.add_argument("--port", type=int, default=8001, help="Port to bind to")
|
|
34
|
+
server_parser.add_argument("--reload", action="store_true", help="Enable auto-reload")
|
|
35
|
+
|
|
36
|
+
# Chat command
|
|
37
|
+
chat_parser = subparsers.add_parser("chat", help="Interactive chat mode")
|
|
38
|
+
chat_parser.add_argument("--session", default="cli", help="Session ID")
|
|
39
|
+
|
|
40
|
+
# TUI command (full terminal UI)
|
|
41
|
+
tui_parser = subparsers.add_parser("tui", help="Full terminal UI with tools")
|
|
42
|
+
tui_parser.add_argument("--session", default="tui", help="Session ID")
|
|
43
|
+
|
|
44
|
+
# Status command
|
|
45
|
+
subparsers.add_parser("status", help="Show system status")
|
|
46
|
+
|
|
47
|
+
# Memory commands
|
|
48
|
+
memory_parser = subparsers.add_parser("memory", help="Memory operations")
|
|
49
|
+
memory_sub = memory_parser.add_subparsers(dest="memory_cmd")
|
|
50
|
+
memory_sub.add_parser("list", help="List recent memories")
|
|
51
|
+
recall_parser = memory_sub.add_parser("recall", help="Recall memories")
|
|
52
|
+
recall_parser.add_argument("query", help="Search query")
|
|
53
|
+
remember_parser = memory_sub.add_parser("remember", help="Store a memory")
|
|
54
|
+
remember_parser.add_argument("content", help="Content to remember")
|
|
55
|
+
|
|
56
|
+
# Version
|
|
57
|
+
subparsers.add_parser("version", help="Show version")
|
|
58
|
+
|
|
59
|
+
args = parser.parse_args()
|
|
60
|
+
|
|
61
|
+
if args.command == "setup":
|
|
62
|
+
from hyperclaw.setup import setup_sync
|
|
63
|
+
result = setup_sync(
|
|
64
|
+
init_db=args.init_db,
|
|
65
|
+
overwrite=args.overwrite,
|
|
66
|
+
verbose=args.verbose
|
|
67
|
+
)
|
|
68
|
+
sys.exit(0 if result.success else 1)
|
|
69
|
+
|
|
70
|
+
elif args.command == "server":
|
|
71
|
+
if args.host:
|
|
72
|
+
os.environ["HOST"] = args.host
|
|
73
|
+
os.environ["PORT"] = str(args.port)
|
|
74
|
+
if args.reload:
|
|
75
|
+
os.environ["RELOAD"] = "true"
|
|
76
|
+
|
|
77
|
+
from hyperclaw.server import main as run_server
|
|
78
|
+
run_server()
|
|
79
|
+
|
|
80
|
+
elif args.command == "chat":
|
|
81
|
+
from hyperclaw.tui import main as tui_main
|
|
82
|
+
tui_main()
|
|
83
|
+
|
|
84
|
+
elif args.command == "tui":
|
|
85
|
+
from hyperclaw.cli_tui import main as tui_main
|
|
86
|
+
tui_main()
|
|
87
|
+
|
|
88
|
+
elif args.command == "status":
|
|
89
|
+
asyncio.run(show_status())
|
|
90
|
+
|
|
91
|
+
elif args.command == "memory":
|
|
92
|
+
asyncio.run(handle_memory(args))
|
|
93
|
+
|
|
94
|
+
elif args.command == "version":
|
|
95
|
+
print("HyperClaw v1.0.0")
|
|
96
|
+
|
|
97
|
+
else:
|
|
98
|
+
parser.print_help()
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
async def interactive_chat(session_id: str):
|
|
102
|
+
"""Interactive chat mode with TUI."""
|
|
103
|
+
try:
|
|
104
|
+
# Try the enhanced TUI first
|
|
105
|
+
from hyperclaw.cli_tui import main as tui_main
|
|
106
|
+
tui_main()
|
|
107
|
+
return
|
|
108
|
+
except ImportError:
|
|
109
|
+
pass
|
|
110
|
+
|
|
111
|
+
# Fallback to basic chat
|
|
112
|
+
from hyperclaw.orchestrator import get_orchestrator
|
|
113
|
+
|
|
114
|
+
print("\n" + "=" * 60)
|
|
115
|
+
print(" HyperClaw Interactive Chat")
|
|
116
|
+
print(" Type 'quit' to exit, 'clear' to reset session")
|
|
117
|
+
print("=" * 60 + "\n")
|
|
118
|
+
|
|
119
|
+
orchestrator = await get_orchestrator()
|
|
120
|
+
|
|
121
|
+
while True:
|
|
122
|
+
try:
|
|
123
|
+
user_input = input("\nYou: ").strip()
|
|
124
|
+
|
|
125
|
+
if not user_input:
|
|
126
|
+
continue
|
|
127
|
+
|
|
128
|
+
if user_input.lower() == "quit":
|
|
129
|
+
print("\nGoodbye!")
|
|
130
|
+
break
|
|
131
|
+
|
|
132
|
+
if user_input.lower() == "clear":
|
|
133
|
+
if orchestrator._memory:
|
|
134
|
+
orchestrator._memory._conversation_history.pop(session_id, None)
|
|
135
|
+
print("Session cleared.")
|
|
136
|
+
continue
|
|
137
|
+
|
|
138
|
+
# Get response
|
|
139
|
+
print("\nAssistant: ", end="", flush=True)
|
|
140
|
+
|
|
141
|
+
response = await orchestrator.chat(
|
|
142
|
+
message=user_input,
|
|
143
|
+
session_id=session_id,
|
|
144
|
+
channel="cli"
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
print(response)
|
|
148
|
+
|
|
149
|
+
except KeyboardInterrupt:
|
|
150
|
+
print("\n\nGoodbye!")
|
|
151
|
+
break
|
|
152
|
+
except Exception as e:
|
|
153
|
+
print(f"\nError: {e}")
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
async def show_status():
|
|
157
|
+
"""Show system status."""
|
|
158
|
+
from hyperclaw.orchestrator import get_orchestrator
|
|
159
|
+
|
|
160
|
+
try:
|
|
161
|
+
orchestrator = await get_orchestrator()
|
|
162
|
+
status = orchestrator.get_status()
|
|
163
|
+
|
|
164
|
+
print("\n" + "=" * 60)
|
|
165
|
+
print(" HyperClaw Status")
|
|
166
|
+
print("=" * 60)
|
|
167
|
+
|
|
168
|
+
print(f"\n Initialized: {status['initialized']}")
|
|
169
|
+
print(f" Model: {status['model']}")
|
|
170
|
+
print(f" Database: {status['database']}")
|
|
171
|
+
|
|
172
|
+
print("\n Integrations:")
|
|
173
|
+
for name, state in status['integrations'].items():
|
|
174
|
+
print(f" - {name}: {state}")
|
|
175
|
+
|
|
176
|
+
print("\n Memory:")
|
|
177
|
+
for key, val in status['memory'].items():
|
|
178
|
+
print(f" - {key}: {val}")
|
|
179
|
+
|
|
180
|
+
print(f"\n Timestamp: {status['timestamp']}")
|
|
181
|
+
print("=" * 60 + "\n")
|
|
182
|
+
|
|
183
|
+
except Exception as e:
|
|
184
|
+
print(f"Error getting status: {e}")
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
async def handle_memory(args):
|
|
188
|
+
"""Handle memory commands."""
|
|
189
|
+
from hyperclaw.orchestrator import get_orchestrator
|
|
190
|
+
|
|
191
|
+
orchestrator = await get_orchestrator()
|
|
192
|
+
|
|
193
|
+
if args.memory_cmd == "recall":
|
|
194
|
+
memories = await orchestrator.recall(args.query)
|
|
195
|
+
print(f"\nFound {len(memories)} memories:\n")
|
|
196
|
+
for mem in memories:
|
|
197
|
+
print(f" [{mem.memory_type}] {mem.content[:100]}...")
|
|
198
|
+
print()
|
|
199
|
+
|
|
200
|
+
elif args.memory_cmd == "remember":
|
|
201
|
+
from hyperclaw.taint import TaintedInput
|
|
202
|
+
try:
|
|
203
|
+
memory_id = await orchestrator.remember(args.content)
|
|
204
|
+
print(f"Stored memory: {memory_id}")
|
|
205
|
+
except TaintedInput as e:
|
|
206
|
+
print(e.user_message)
|
|
207
|
+
|
|
208
|
+
elif args.memory_cmd == "list":
|
|
209
|
+
if orchestrator._memory:
|
|
210
|
+
for mtype, memories in orchestrator._memory._file_cache.items():
|
|
211
|
+
print(f"\n{mtype.upper()} ({len(memories)}):")
|
|
212
|
+
for mem in memories[:5]:
|
|
213
|
+
print(f" - {mem.content[:80]}...")
|
|
214
|
+
|
|
215
|
+
else:
|
|
216
|
+
print("Usage: hyperclaw memory [list|recall|remember]")
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
if __name__ == "__main__":
|
|
220
|
+
main()
|