Adds /api/coord/* endpoints for real-time cross-session coordination: - coord_workflows: named units of work per project - coord_work_items: tasks within workflows with dependency chains - coord_session_locks: exclusive resource locks with auto-expiry (TTL) - coord_component_states: live component state per project (upsert) - coord_messages: cross-session messaging and broadcasts - /api/coord/status: cross-project snapshot endpoint Replaces PROJECT_STATE.md as the coordination layer for Claude sessions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
1.4 KiB
Python
43 lines
1.4 KiB
Python
"""Pydantic schemas for CoordWorkflow."""
|
|
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class CoordWorkflowCreate(BaseModel):
|
|
"""Input schema for creating a workflow."""
|
|
|
|
project_key: str = Field(..., description="Project namespace slug", max_length=200)
|
|
name: str = Field(..., description="Short workflow identifier", max_length=200)
|
|
description: Optional[str] = Field(None, description="Freeform description, markdown ok")
|
|
status: str = Field("planning", description="Status: planning, active, blocked, completed, cancelled")
|
|
created_by: str = Field(..., description="Creating session identifier", max_length=200)
|
|
|
|
|
|
class CoordWorkflowUpdate(BaseModel):
|
|
"""Input schema for updating a workflow. All fields optional."""
|
|
|
|
name: Optional[str] = Field(None, max_length=200)
|
|
description: Optional[str] = None
|
|
status: Optional[str] = Field(None, description="Status: planning, active, blocked, completed, cancelled")
|
|
completed_at: Optional[datetime] = None
|
|
|
|
|
|
class CoordWorkflowResponse(BaseModel):
|
|
"""Output schema for a workflow."""
|
|
|
|
id: UUID
|
|
project_key: str
|
|
name: str
|
|
description: Optional[str]
|
|
status: str
|
|
created_by: str
|
|
completed_at: Optional[datetime]
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|