Add CalDAV calendar integration, LLM-suggested tags, and settings refinements

- CalDAV integration: per-user calendar config, create/list/search events
  via caldav library, LLM tools for calendar operations from chat
- LLM-suggested tags: new tag_suggestions service prompts LLM with existing
  tags and note content to suggest 3-5 relevant tags; exposed via API
  endpoints (suggest-tags, append-tag); integrated into editor views
  (suggest button + clickable pills) and chat tool calls (pills in
  ToolCallCard with one-click apply)
- Settings/model UI refinements, generation task improvements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 22:40:20 -05:00
parent 8996b45e50
commit d7bc3f3222
22 changed files with 1158 additions and 837 deletions
+32
View File
@@ -27,6 +27,7 @@ from fabledassistant.services.notes import (
update_note,
)
from fabledassistant.services.settings import get_setting
from fabledassistant.services.tag_suggestions import suggest_tags
from fabledassistant.utils.tags import extract_tags
logger = logging.getLogger(__name__)
@@ -95,6 +96,37 @@ async def list_tags_route():
return jsonify({"tags": tags})
@notes_bp.route("/suggest-tags", methods=["POST"])
@login_required
async def suggest_tags_route():
uid = get_current_user_id()
data = await request.get_json()
title = data.get("title", "")
body = data.get("body", "")
tags = await suggest_tags(uid, title, body)
return jsonify({"suggested_tags": tags})
@notes_bp.route("/<int:note_id>/append-tag", methods=["POST"])
@login_required
async def append_tag_route(note_id: int):
uid = get_current_user_id()
data = await request.get_json()
tag = data.get("tag", "").strip()
if not tag:
return jsonify({"error": "tag is required"}), 400
note = await get_note(uid, note_id)
if note is None:
return jsonify({"error": "Note not found"}), 404
# Append #tag to body
new_body = note.body.rstrip() + f"\n#{tag}" if note.body else f"#{tag}"
tags = extract_tags(new_body)
updated = await update_note(uid, note_id, body=new_body, tags=tags)
return jsonify(updated.to_dict())
@notes_bp.route("/by-title", methods=["GET"])
@login_required
async def get_note_by_title_route():