feat: wire feishu into app and cli

Signed-off-by: Asklv <boironic@gmail.com>
This commit is contained in:
Asklv
2026-03-03 10:16:00 +08:00
parent 56c6db438a
commit 0072906d9f
2 changed files with 45 additions and 2 deletions

View File

@@ -12,7 +12,8 @@
#include "mimi_config.h"
#include "bus/message_bus.h"
#include "wifi/wifi_manager.h"
#include "telegram/telegram_bot.h"
#include "channels/telegram/telegram_bot.h"
#include "channels/feishu/feishu_bot.h"
#include "llm/llm_proxy.h"
#include "agent/agent_loop.h"
#include "memory/memory_store.h"
@@ -78,6 +79,13 @@ static void outbound_dispatch_task(void *arg)
} else {
ESP_LOGI(TAG, "Telegram send success for %s (%d bytes)", msg.chat_id, (int)strlen(msg.content));
}
} else if (strcmp(msg.channel, MIMI_CHAN_FEISHU) == 0) {
esp_err_t send_err = feishu_send_message(msg.chat_id, msg.content);
if (send_err != ESP_OK) {
ESP_LOGE(TAG, "Feishu send failed for %s: %s", msg.chat_id, esp_err_to_name(send_err));
} else {
ESP_LOGI(TAG, "Feishu send success for %s (%d bytes)", msg.chat_id, (int)strlen(msg.content));
}
} else if (strcmp(msg.channel, MIMI_CHAN_WEBSOCKET) == 0) {
esp_err_t ws_err = ws_server_send(msg.chat_id, msg.content);
if (ws_err != ESP_OK) {
@@ -121,6 +129,7 @@ void app_main(void)
ESP_ERROR_CHECK(wifi_manager_init());
ESP_ERROR_CHECK(http_proxy_init());
ESP_ERROR_CHECK(telegram_bot_init());
ESP_ERROR_CHECK(feishu_bot_init());
ESP_ERROR_CHECK(llm_proxy_init());
ESP_ERROR_CHECK(tool_registry_init());
ESP_ERROR_CHECK(cron_service_init());
@@ -149,6 +158,7 @@ void app_main(void)
/* Start network-dependent services */
ESP_ERROR_CHECK(agent_loop_start());
ESP_ERROR_CHECK(telegram_bot_start());
ESP_ERROR_CHECK(feishu_bot_start());
cron_service_start();
heartbeat_start();
ESP_ERROR_CHECK(ws_server_start());