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>
31 lines
939 B
Python
31 lines
939 B
Python
"""Pydantic schemas for CoordComponentState."""
|
|
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class CoordComponentStateUpsert(BaseModel):
|
|
"""Input schema for upserting a component state."""
|
|
|
|
state: str = Field(..., description="State: deployed, building, stable, broken, unknown", max_length=50)
|
|
version: Optional[str] = Field(None, description="Version string or git SHA", max_length=100)
|
|
notes: Optional[str] = Field(None, description="Freeform notes")
|
|
updated_by: str = Field(..., description="Session performing this update", max_length=200)
|
|
|
|
|
|
class CoordComponentStateResponse(BaseModel):
|
|
"""Output schema for a component state."""
|
|
|
|
project_key: str
|
|
component: str
|
|
state: str
|
|
version: Optional[str]
|
|
notes: Optional[str]
|
|
updated_by: str
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|