Fix fastmcp imports, add vixy_status integration for wakeups
This commit is contained in:
BIN
__pycache__/matrix_mcp.cpython-311.pyc
Normal file
BIN
__pycache__/matrix_mcp.cpython-311.pyc
Normal file
Binary file not shown.
@@ -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}]"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user