From a155d93dd8157a2790688243121197d25ab0a309 Mon Sep 17 00:00:00 2001 From: starmen1265 Date: Wed, 11 Mar 2026 13:01:34 +0800 Subject: [PATCH] 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 --- .../src/gsd_openclaw/response_formatter.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 gsd-openclaw/src/gsd_openclaw/response_formatter.py diff --git a/gsd-openclaw/src/gsd_openclaw/response_formatter.py b/gsd-openclaw/src/gsd_openclaw/response_formatter.py new file mode 100644 index 0000000..a7d7a9b --- /dev/null +++ b/gsd-openclaw/src/gsd_openclaw/response_formatter.py @@ -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