Record calendar events from natural language. Creates all-day events with no reminders.
Use this skill when the user wants to record something on a specific day.
Use the exec tool to run a short Python script that imports nanobot.storage.calendar_repository and creates the event directly in ~/.nanobot/system.db.
import sys
from pathlib import Path
# Ensure nanobot is importable
project_root = Path(__file__).resolve().parent if '__file__' in dir() else Path.cwd()
while project_root.name != 'nanobot-webui' and project_root.parent != project_root:
project_root = project_root.parent
if str(project_root) not in sys.path:
sys.path.insert(0, str(project_root))
from nanobot.storage.calendar_repository import get_calendar_repository
repo = get_calendar_repository()
# Optional deduplication: check for existing events on the same day
title = "<event title>"
start_time = "<YYYY-MM-DD>T00:00:00"
end_time = "<YYYY-MM-DD>T23:59:59"
existing = repo.get_events(start_time=start_time[:10], end_time=end_time[:10])
if any(e.get("title") == title for e in existing):
print(f"Event '{title}' already exists on {start_time[:10]}")