- Move backend/frontend/messenger/ old paths to _archive/ - Reorganize scripts into scripts/deploy, check, push, setup, misc - Move docs (pptx, docx) to docs/ - Add .claude agents and skills for fullstack/folder-cleanup harness - workspace/ projects remain intact Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
42 lines
1.0 KiB
Python
42 lines
1.0 KiB
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional, List
|
|
from datetime import datetime
|
|
from uuid import uuid4
|
|
|
|
|
|
def new_msg_id() -> str:
|
|
return f"MSG-{datetime.now().strftime('%Y%m%d')}-{str(uuid4())[:8].upper()}"
|
|
|
|
|
|
class InteractiveAction(BaseModel):
|
|
type: str # BUTTON | APPROVAL_BUTTONS
|
|
label: Optional[str] = None
|
|
command_code: Optional[str] = None
|
|
approve_url: Optional[str] = None
|
|
reject_url: Optional[str] = None
|
|
|
|
|
|
class Message(BaseModel):
|
|
message_id: str = Field(default_factory=new_msg_id)
|
|
timestamp: str = Field(default_factory=lambda: datetime.now().isoformat())
|
|
room_id: str
|
|
sender: str
|
|
sender_type: str = "HUMAN" # HUMAN | BOT
|
|
msg_type: str = "CHAT"
|
|
content: str
|
|
is_widget: bool = False
|
|
interactive_action: Optional[InteractiveAction] = None
|
|
|
|
|
|
class WebhookPayload(BaseModel):
|
|
user_id: str
|
|
text: str
|
|
room_id: str
|
|
files: List[dict] = []
|
|
bot: bool = False
|
|
|
|
|
|
class IncomingChat(BaseModel):
|
|
content: str
|
|
room_id: str
|