feat(02-02): add CardTheme enum and CardButton dataclass
- CardTheme enum with SUCCESS (green), ERROR (red), INFO (blue), WARNING (orange) - CardButton dataclass with text, value dict, and button_type Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
Response formatter for Feishu Card messages.
|
||||
|
||||
This module provides classes for formatting responses as Feishu Card JSON 2.0
|
||||
messages with three-zone structure (header/content/actions).
|
||||
"""
|
||||
from dataclasses import dataclass
|
||||
from typing import Dict, Any, List, Optional
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class CardTheme(Enum):
|
||||
"""Theme colors for Feishu Card messages."""
|
||||
SUCCESS = "green"
|
||||
ERROR = "red"
|
||||
INFO = "blue"
|
||||
WARNING = "orange"
|
||||
|
||||
|
||||
@dataclass
|
||||
class CardButton:
|
||||
"""Interactive button for Feishu Card actions."""
|
||||
text: str
|
||||
value: Dict[str, Any]
|
||||
button_type: str = "primary" # primary, default, danger
|
||||
Reference in New Issue
Block a user