diff --git a/src/blackboard/operations.py b/src/blackboard/operations.py index 9de7bf5..0e2611a 100644 --- a/src/blackboard/operations.py +++ b/src/blackboard/operations.py @@ -198,6 +198,20 @@ class Blackboard: finally: conn.close() + def update_must_haves(self, task_id: str, must_haves: str) -> bool: + """更新 Task 的 must_haves 字段(用于 Mail 元数据等)""" + conn = self._conn() + try: + conn.execute("BEGIN IMMEDIATE") + conn.execute( + "UPDATE tasks SET must_haves=?, updated_at=datetime('now') WHERE id=?", + (must_haves, task_id), + ) + conn.commit() + return True + finally: + conn.close() + # =================================================================== # Comment # ===================================================================