feat: add interactive approval/confirmation cards

- sendApprovalCard: interactive card with configurable buttons
- resolveCard: patch card to show resolution state (green/red)
- ApprovalManager: register/resolve lifecycle with 5min timeout
- request_approval MCP tool: agent can ask user for confirmation
- Wire onCardAction in trigger handler and server startup
- Add unit tests (5) for card JSON, manager, and routing
This commit is contained in:
2026-07-08 16:47:31 +08:00
parent ad65d93b2e
commit 4736610cf3
6 changed files with 435 additions and 6 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ async function main(): Promise<void> {
const feishuConfig = { appId: feishuAppId, appSecret: feishuAppSecret, botOpenId: feishuBotOpenId };
const larkClient = createLarkClient(feishuConfig);
const trigger = makeTriggerHandler({ prisma, settings: runtimeSettings, logger: app.log });
startFeishuListenerWithClient(feishuConfig, larkClient, app.log, trigger);
startFeishuListenerWithClient(feishuConfig, larkClient, app.log, trigger, trigger.onCardAction);
} else {
app.log.info("feishu listener disabled by HUB_FEISHU_LISTENER_ENABLED");
}