feat: 按机器人选择 Agent Preset

在九个渠道的设置页卡片上选择 Host 已有预设;未选则跟随默认,只影响之后新建的会话。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
iamyaojie 2026-08-21 19:19:45 +08:00
parent c3b3a29f27
commit 3161816cc4
51 changed files with 2227 additions and 740 deletions

View file

@ -6,6 +6,8 @@
* must never be returned by any endpoint on this channel.
*/
import { normalizeAgentPresetCatalog, normalizeAgentPresetId } from "../../agent-preset.js";
export const FEISHU_RPC_CHANNEL = "/feishu";
export const FEISHU_ENDPOINTS = Object.freeze({
@ -19,6 +21,7 @@ export const FEISHU_ENDPOINTS = Object.freeze({
disconnectBot: "bot.disconnect",
deleteBot: "bot.delete",
setWorkspace: "bot.workspace.set",
setAgentPreset: "bot.preset.set",
// Kept for rolling upgrades. The multi-bot UI never calls these endpoints.
testConnection: "connection.test",
disconnect: "connection.disconnect",
@ -182,6 +185,7 @@ export function normalizeBotConnection(value, fallbackBotId) {
connected,
configured: value.configured !== false,
workspace: optionalString(value.workspace)?.slice(0, 4_096) ?? "",
agentPreset: normalizeAgentPresetId(value.agentPreset),
bot: normalizeBot(value.bot),
health: normalizeHealth(value.health, connected),
error: normalizeError(value.error),
@ -236,6 +240,7 @@ export function normalizeBotsSnapshot(value) {
? normalizeProvisioning(value.provisioning)
: undefined,
error: normalizeError(value.error),
agentPresetCatalog: normalizeAgentPresetCatalog(value.agentPresetCatalog),
};
}