Add update_task fields, list_tasks, and update_todo tools
- update_note: extend with status/priority/due_date fields so task attributes can be changed via chat (mark done, set priority, move due date). body is now optional — task field updates work without touching content. - list_tasks: new core tool with status/priority/due_before/due_after/limit filters backed by list_notes(is_task=True). Enables queries like "overdue tasks", "high priority tasks", "what's in progress". - update_todo: new CalDAV tool to modify VTODO summary, due date, description, and priority — follows update_event pattern (modify component, rebuild ical, save). Completes the CalDAV todo CRUD suite. - tools.py: add update_todo import + execute case (type: todo_updated) - llm.py: add list_tasks and update_todo to available actions + guidance - intent.py: routing rules for mark-done/priority/due-date → update_note, overdue/in-progress/high-priority queries → list_tasks, CalDAV todo updates → update_todo - ToolCallCard.vue: tasks list block (linked titles + due + priority badges), todo_updated label, tool-task-priority CSS classes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -250,21 +250,22 @@ async def build_context(
|
||||
tool_lines = [
|
||||
"You have access to tool functions. You MUST use them when the user asks you to create, add, find, schedule, or search for anything.",
|
||||
"CRITICAL: Call the tool functions directly. NEVER write out function calls as text or code. NEVER describe what you would do — just do it.",
|
||||
"Available actions: create_task, create_note, update_note, search_notes.",
|
||||
"Available actions: create_task, create_note, update_note, list_tasks, search_notes.",
|
||||
]
|
||||
if has_caldav:
|
||||
tool_lines[-1] = (
|
||||
"Available actions: create_task, create_note, update_note, search_notes, "
|
||||
"Available actions: create_task, create_note, update_note, list_tasks, search_notes, "
|
||||
"create_event, list_events, search_events, update_event, delete_event, "
|
||||
"list_calendars, create_todo, list_todos, complete_todo, delete_todo."
|
||||
"list_calendars, create_todo, list_todos, update_todo, complete_todo, delete_todo."
|
||||
)
|
||||
tool_lines.append("For calendar events, use ISO 8601 datetime format (e.g. 2026-09-30T00:00:00).")
|
||||
tool_lines.append("CalDAV todos are separate from app tasks. Use create_task for app tasks, create_todo for CalDAV todos.")
|
||||
tool_lines.append("When the user says 'remind me' with a time before an event, use the reminder_minutes parameter.")
|
||||
tool_lines.append("For relative dates like 'Friday' or 'next week', resolve them to YYYY-MM-DD format.")
|
||||
tool_lines.append(
|
||||
"Use update_note to edit/expand an existing note. "
|
||||
"Use update_note to edit/expand an existing note OR to update a task's status/priority/due_date. "
|
||||
"Use create_note ONLY for genuinely new notes with a different title. "
|
||||
"Use list_tasks to find tasks by status, priority, or due date (e.g. overdue, high priority, in progress). "
|
||||
"If a note was created earlier in the conversation and the user provides more content for it, use update_note."
|
||||
)
|
||||
tool_guidance = "\n".join(tool_lines)
|
||||
|
||||
Reference in New Issue
Block a user