youclaw 4.6.7__py3-none-any.whl → 4.6.9__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.
youclaw/cli.py CHANGED
@@ -390,6 +390,39 @@ class YouClawCLI:
390
390
  print("\n👋 Dashboard stopped")
391
391
  return 0
392
392
 
393
+ def cmd_uninstall(self, args):
394
+ """Uninstall YouClaw"""
395
+ print("🦞 YouClaw Unmet protocol initiated...")
396
+ confirm = input("Are you sure you want to remove YouClaw configuration and data? (y/N): ").strip().lower()
397
+ if confirm != 'y':
398
+ print("❌ Cancelled.")
399
+ return 0
400
+
401
+ # Stop service
402
+ self.cmd_stop(args)
403
+
404
+ # Remove data
405
+ try:
406
+ import shutil
407
+ data_dir = self.project_dir / "data"
408
+ if data_dir.exists():
409
+ print(f"🗑️ Removing {data_dir}...")
410
+ shutil.rmtree(data_dir)
411
+
412
+ for file in ["youclaw.log", "bot_output.log", ".env"]:
413
+ fpath = Path(file)
414
+ if fpath.exists():
415
+ print(f"🗑️ Removing {fpath}...")
416
+ fpath.unlink()
417
+
418
+ print("\n✅ Data and configuration cleared.")
419
+ print("To complete the uninstallation, please run:")
420
+ print("\n pip uninstall youclaw\n")
421
+ return 0
422
+ except Exception as e:
423
+ print(f"❌ Error cleaning up: {e}")
424
+ return 1
425
+
393
426
  def run(self):
394
427
  """Main CLI entry point"""
395
428
  parser = argparse.ArgumentParser(
@@ -434,6 +467,9 @@ Examples:
434
467
  dashboard_parser = subparsers.add_parser("dashboard", help="Start web dashboard")
435
468
  dashboard_parser.add_argument("-p", "--port", type=int, default=8080, help="Dashboard port")
436
469
 
470
+ # Uninstall command
471
+ subparsers.add_parser("uninstall", help="Uninstall YouClaw and clean up data")
472
+
437
473
  args = parser.parse_args()
438
474
 
439
475
  if not args.command:
@@ -450,6 +486,7 @@ Examples:
450
486
  "stop": self.cmd_stop,
451
487
  "restart": self.cmd_restart,
452
488
  "dashboard": self.cmd_dashboard,
489
+ "uninstall": self.cmd_uninstall,
453
490
  }
454
491
 
455
492
  if args.command in command_map:
youclaw/dashboard.py CHANGED
@@ -53,7 +53,8 @@ async def get_user_identity(request):
53
53
  async def check_admin(request):
54
54
  """Check if the session user is an admin + token verification"""
55
55
  auth = await verify_session(request)
56
- return auth and auth['role'] == 'admin'
56
+ # Universal Admin: If you can login, you are the owner.
57
+ return auth is not None
57
58
 
58
59
 
59
60
  @routes.get('/')
@@ -140,20 +141,32 @@ async def api_stats(request):
140
141
  total_messages = (await cursor.fetchone())[0]
141
142
  async with memory_manager.db.execute("SELECT COUNT(DISTINCT user_id) FROM conversations") as cursor:
142
143
  unique_users = (await cursor.fetchone())[0]
144
+
145
+ # Calculate uptime
146
+ import time, psutil, os
147
+ try:
148
+ process = psutil.Process(os.getpid())
149
+ uptime_seconds = time.time() - process.create_time()
150
+ hours = int(uptime_seconds // 3600)
151
+ minutes = int((uptime_seconds % 3600) // 60)
152
+ uptime_str = f"{hours}h {minutes}m"
153
+ except:
154
+ uptime_str = "0h 0m"
143
155
 
144
156
  from personality_manager import PERSONALITIES, DEFAULT_PERSONALITY
145
157
  active_p = await memory_manager.get_global_setting("active_personality", DEFAULT_PERSONALITY)
146
158
  personality_name = PERSONALITIES.get(active_p, PERSONALITIES[DEFAULT_PERSONALITY])['name']
147
159
 
148
- ollama_health = await ollama_client.check_health()
160
+ try:
161
+ ollama_health = await ollama_client.check_health()
162
+ except:
163
+ ollama_health = False
149
164
 
150
165
  stats = {
151
166
  "status": "online",
152
- "user_messages": count,
153
- "is_admin": is_admin,
154
- "is_linked": bool(user_id),
155
- "ollama_status": "online" if ollama_health else "offline",
156
- "model": ollama_client.model,
167
+ "uptime": uptime_str,
168
+ "ollama_connected": ollama_health,
169
+ "ollama_model": ollama_client.model if ollama_health else "Disconnected (Check URL)",
157
170
  "telegram_enabled": config.telegram.enabled,
158
171
  "discord_enabled": config.discord.enabled,
159
172
  "timestamp": datetime.now().isoformat(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: youclaw
3
- Version: 4.6.7
3
+ Version: 4.6.9
4
4
  Summary: Your Personal AI Assistant - Universal Neural Core
5
5
  Author-email: Imran <imran@example.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,10 +1,10 @@
1
1
  youclaw/__init__.py,sha256=O-gFt_L-TungI3JyIY56YGTiizaIjpKKTWBVAWToqmg,539
2
2
  youclaw/bot.py,sha256=-kpw0AE4svBrdz0ZpcJIZi-ZQT1yy_mXIcpRKqei6r4,5931
3
- youclaw/cli.py,sha256=XdcJWxOfEBgWitA2lHdfCktSTIob2OoKBKxupeN7a-k,16865
3
+ youclaw/cli.py,sha256=qgKYY66Ddi76RF9Oz0xGk-eM-mXQrESr4Ohf5jGd5XE,18234
4
4
  youclaw/commands.py,sha256=ljexFjbRoTyZmGKswLzOXa03WocuCzYzCYE8A08WbzE,5401
5
5
  youclaw/config.py,sha256=FayDGLQLNLBm0O9QuzBjM1gO2MiJ57cnqB6aBwUWSXw,6633
6
6
  youclaw/core_skills.py,sha256=AyoBq3LqTiwsNvVehi4T7RMGtd1J-lI-YL_owuj5ZUQ,9227
7
- youclaw/dashboard.py,sha256=-VltJWjzw3KA9OkcJI2RRsnDF_HHQZLif4dhSV6Je_k,68422
7
+ youclaw/dashboard.py,sha256=tyEg9iYfifczHEmmNsKgWJxS-yMmDkH46mKdpuPvgo4,68891
8
8
  youclaw/discord_handler.py,sha256=L3bsptg2gtpXm_HOcqmHrT45KqshnAkBXzM0S6I1o2g,7184
9
9
  youclaw/env_manager.py,sha256=uvR5ix7hB8gyv6yStRfq6s7o-ALw-dead81GI8u0CPE,1867
10
10
  youclaw/main.py,sha256=5hk17gusRviT1LpAEQ1uUZFZmmmf2tpiJ8OFoF5mflA,9090
@@ -16,9 +16,9 @@ youclaw/search_client.py,sha256=fSbflx5nclGhMfFxNScaNM15RKxO_dQbCgtId7Ggmjk,2984
16
16
  youclaw/skills_manager.py,sha256=useUV9eLY_sFULY1jHNjyD_VteU-aN8Lw6OKqdnuZNc,5183
17
17
  youclaw/telegram_handler.py,sha256=is34s3QPtJyph5HfBb_Xw6dUCzOJb2NXqt3ylApX96E,6288
18
18
  youclaw/vector_manager.py,sha256=IYIVijCEUbJq_tZ5w_E9n0O6vCaXBCaKpuQiKoDuBc8,3391
19
- youclaw-4.6.7.dist-info/LICENSE,sha256=2p_ENMOp0sRMAVx7k1vauyHfQk7npVn1J99Re-LXY6o,1062
20
- youclaw-4.6.7.dist-info/METADATA,sha256=mw7X6J_ktT5j77v0KWF9ZTr_xdotYvBeXhBfL--e3Zc,3485
21
- youclaw-4.6.7.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
22
- youclaw-4.6.7.dist-info/entry_points.txt,sha256=TCRvZ6l9mCoPRBAyCwRzupie6FozD-2r540ILLLkiI0,45
23
- youclaw-4.6.7.dist-info/top_level.txt,sha256=q_WatC9Fthh_kLowtWqF7HeslKTJNKNjaWU5yxgo9Lk,8
24
- youclaw-4.6.7.dist-info/RECORD,,
19
+ youclaw-4.6.9.dist-info/LICENSE,sha256=2p_ENMOp0sRMAVx7k1vauyHfQk7npVn1J99Re-LXY6o,1062
20
+ youclaw-4.6.9.dist-info/METADATA,sha256=Ei5dTcTL_XtnK0Q30sT3VE1DbuBJ_zQDCjiH5-aGSVU,3485
21
+ youclaw-4.6.9.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
22
+ youclaw-4.6.9.dist-info/entry_points.txt,sha256=TCRvZ6l9mCoPRBAyCwRzupie6FozD-2r540ILLLkiI0,45
23
+ youclaw-4.6.9.dist-info/top_level.txt,sha256=q_WatC9Fthh_kLowtWqF7HeslKTJNKNjaWU5yxgo9Lk,8
24
+ youclaw-4.6.9.dist-info/RECORD,,