feat: add scratchpad field to session model and schemas

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Michael Chihlas
2026-02-04 02:47:22 -05:00
parent d488d2acc8
commit 7d0000827b
3 changed files with 64 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
from datetime import datetime
from typing import Optional, Any
from uuid import UUID
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, validator
class DecisionRecord(BaseModel):
@@ -27,6 +27,7 @@ class SessionUpdate(BaseModel):
custom_steps: Optional[list[dict[str, Any]]] = None
ticket_number: Optional[str] = Field(None, max_length=100)
client_name: Optional[str] = Field(None, max_length=255)
scratchpad: Optional[str] = None
class SessionResponse(BaseModel):
@@ -42,6 +43,11 @@ class SessionResponse(BaseModel):
ticket_number: Optional[str] = None
client_name: Optional[str] = None
exported: bool
scratchpad: str = ""
@validator('scratchpad', pre=True, always=True)
def normalize_scratchpad(cls, v):
return v or ""
class Config:
from_attributes = True
@@ -51,3 +57,7 @@ class SessionExport(BaseModel):
format: str = Field(default="markdown", pattern="^(text|markdown|html)$")
include_timestamps: bool = True
include_tree_info: bool = True
class ScratchpadUpdate(BaseModel):
scratchpad: str