Add Reminders (CalDAV), Notes, Reading List agents + Mac bridge
This commit is contained in:
@@ -44,6 +44,43 @@ def collect_sections(config):
|
||||
print(f" Calendar failed: {e}", file=sys.stderr)
|
||||
sections.append(("Calendar", "## Calendar\n\n*Calendar data unavailable.*\n", f"error: {e}"))
|
||||
|
||||
# --- Reminders (CalDAV VTODO) ---
|
||||
reminder_sources = config.get("reminder_sources", [])
|
||||
reminder_mode = config.get("reminder_mode", "due_today_3days")
|
||||
if reminder_sources:
|
||||
try:
|
||||
from reminders_agent import run as reminders_run
|
||||
md, summary = reminders_run(reminders_config=reminder_sources, mode=reminder_mode)
|
||||
sections.append(("Reminders", md, summary))
|
||||
print(f" Reminders: {summary}")
|
||||
except Exception as e:
|
||||
print(f" Reminders failed: {e}", file=sys.stderr)
|
||||
sections.append(("Reminders", "## Reminders\n\n*Unavailable.*\n", f"error: {e}"))
|
||||
|
||||
# --- Notes (via Mac bridge) ---
|
||||
notes_config = config.get("notes", {})
|
||||
if notes_config.get("enabled", False):
|
||||
try:
|
||||
from notes_agent import run as notes_run
|
||||
md, summary = notes_run(config=notes_config)
|
||||
sections.append(("Notes", md, summary))
|
||||
print(f" Notes: {summary}")
|
||||
except Exception as e:
|
||||
print(f" Notes failed: {e}", file=sys.stderr)
|
||||
sections.append(("Notes", "## Recent Notes\n\n*Unavailable.*\n", f"error: {e}"))
|
||||
|
||||
# --- Reading List (via Mac bridge) ---
|
||||
reading_config = config.get("reading_list", {})
|
||||
if reading_config.get("enabled", False):
|
||||
try:
|
||||
from reading_list_agent import run as reading_list_run
|
||||
md, summary = reading_list_run(config=reading_config)
|
||||
sections.append(("Reading List", md, summary))
|
||||
print(f" Reading List: {summary}")
|
||||
except Exception as e:
|
||||
print(f" Reading List failed: {e}", file=sys.stderr)
|
||||
sections.append(("Reading List", "## Reading List\n\n*Unavailable.*\n", f"error: {e}"))
|
||||
|
||||
return sections
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user