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:
2026-03-11 13:01:34 +08:00
parent 65f6f90c11
commit a155d93dd8
@@ -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