meeting_memory/dispatch.py

32 lines
825 B
Python
Raw Normal View History

2026-06-24 07:05:19 +00:00
from __future__ import annotations
from dataclasses import asdict, dataclass
from typing import Any
from uuid import uuid4
@dataclass(slots=True)
class Task:
id: str
title: str
description: str
status: str = "ready"
def to_dict(self) -> dict[str, Any]:
return asdict(self)
class TaskDispatcher:
"""Small task-board placeholder matching the reference project's extension point."""
def __init__(self) -> None:
self._tasks: dict[str, Task] = {}
def create_task(self, *, title: str, description: str) -> Task:
task = Task(id=f"task_{uuid4().hex[:8]}", title=title, description=description)
self._tasks[task.id] = task
return task
def list_tasks(self) -> list[dict[str, Any]]:
return [task.to_dict() for task in self._tasks.values()]