From 3d7c95362717bf870c9f08e5f25c3db734a0997a Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 27 Mar 2026 23:02:30 -0400 Subject: [PATCH] feat: add recurrence_rule to LLM tools; list_tasks status accepts list + cancelled --- src/fabledassistant/services/tools.py | 37 +++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/fabledassistant/services/tools.py b/src/fabledassistant/services/tools.py index f68a866..8bebb60 100644 --- a/src/fabledassistant/services/tools.py +++ b/src/fabledassistant/services/tools.py @@ -105,6 +105,19 @@ _CORE_TOOLS = [ "type": "boolean", "description": "Set to true only when the user has explicitly confirmed creation after being warned about a similar existing task.", }, + "recurrence_rule": { + "type": "object", + "description": ( + "Optional recurrence schedule so the task repeats automatically. Two forms:\n" + " Interval — repeat every N units from the due date:\n" + ' {"type": "interval", "every": 3, "unit": "month"}\n' + " unit options: day | week | month | year\n" + " Calendar/monthly — specific day each month:\n" + ' {"type": "calendar", "unit": "month", "day_of_month": 1}\n' + " Calendar/annual — specific day each year:\n" + ' {"type": "calendar", "unit": "year", "day_of_month": 15, "month": 6}' + ), + }, }, "required": ["title"], }, @@ -179,8 +192,8 @@ _CORE_TOOLS = [ }, "status": { "type": "string", - "enum": ["todo", "in_progress", "done"], - "description": "New task status. Use to mark a task done, start it, etc.", + "enum": ["todo", "in_progress", "done", "cancelled"], + "description": "New task status. Use to mark a task done, start it, cancel it, etc.", }, "priority": { "type": "string", @@ -205,6 +218,13 @@ _CORE_TOOLS = [ "type": "string", "description": "Optional project name to assign this note/task to (set to empty string to remove project)", }, + "recurrence_rule": { + "type": "object", + "description": ( + "Set or update the recurrence schedule. Pass null to remove recurrence. " + "Same format as create_task recurrence_rule." + ), + }, }, "required": ["query"], }, @@ -353,9 +373,16 @@ _CORE_TOOLS = [ "type": "object", "properties": { "status": { - "type": "string", - "enum": ["todo", "in_progress", "done"], - "description": "Filter by task status", + "type": "array", + "items": { + "type": "string", + "enum": ["todo", "in_progress", "done", "cancelled"], + }, + "description": ( + "Filter by one or more task statuses. " + 'Example: ["todo", "in_progress"] to list all active tasks. ' + "Omit to return tasks of any status." + ), }, "priority": { "type": "string",