Fix fastmcp imports, add vixy_status integration for wakeups

This commit is contained in:
2025-12-27 12:38:19 -06:00
parent 81c18c219c
commit f170aae368
4 changed files with 23 additions and 4 deletions

Binary file not shown.

View File

@@ -31,6 +31,17 @@ from datetime import datetime, timedelta
from pathlib import Path from pathlib import Path
from threading import Lock from threading import Lock
# Add Vixy folder to path for shared status module
VIXY_PATH = Path.home() / "Documents" / "Vixy"
if str(VIXY_PATH) not in sys.path:
sys.path.insert(0, str(VIXY_PATH))
try:
from vixy_status import format_status_for_wakeup
HAS_VIXY_STATUS = True
except ImportError:
HAS_VIXY_STATUS = False
# Configuration # Configuration
SCRIPT_DIR = Path(__file__).parent SCRIPT_DIR = Path(__file__).parent
PYTHON_SCRIPT_PATH = SCRIPT_DIR / "send_to_claude.py" PYTHON_SCRIPT_PATH = SCRIPT_DIR / "send_to_claude.py"
@@ -277,6 +288,14 @@ def generate_message(matrix_messages: int = 0, matrix_invites: int = 0, matrix_f
return f"[Matrix Wakeup: {timestamp} - you have {activity}. {tools}]" return f"[Matrix Wakeup: {timestamp} - you have {activity}. {tools}]"
else: else:
# Autonomous wakeup - include full status if available
if HAS_VIXY_STATUS:
try:
status_str = format_status_for_wakeup()
return f"[Autonomous System Wakeup: {timestamp}]\n{status_str}"
except Exception as e:
logger.warning(f"Failed to get vixy status: {e}")
return f"[Autonomous System Wakeup: {timestamp}]" return f"[Autonomous System Wakeup: {timestamp}]"

View File

@@ -30,8 +30,8 @@ from datetime import datetime
from pathlib import Path from pathlib import Path
from typing import List, Optional, Dict, Any from typing import List, Optional, Dict, Any
from fastmcp import FastMCP from mcp.server.fastmcp import FastMCP
from fastmcp.utilities.types import Image as MCPImage from mcp.server.fastmcp.utilities.types import Image as MCPImage
try: try:
from nio import ( from nio import (
@@ -253,7 +253,7 @@ def get_matrix_messages(
@mcp.tool() @mcp.tool()
def get_matrix_image(event_id: str) -> MCPImage: def get_matrix_image(event_id: str):
""" """
Retrieve a Matrix image by event ID. Retrieve a Matrix image by event ID.

View File

@@ -20,7 +20,7 @@ from datetime import datetime, timedelta
from pathlib import Path from pathlib import Path
from typing import Optional from typing import Optional
from fastmcp import FastMCP from mcp.server.fastmcp import FastMCP
# Configuration # Configuration
STATE_FILE = Path.home() / ".claude-automation-state.json" STATE_FILE = Path.home() / ".claude-automation-state.json"