@agent-dock/cli 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -18528,8 +18528,12 @@ async function registerLarkRoutes(app, options = {}) {
18528
18528
  if (existing) throw new LarkServiceError("SESSION_ALREADY_HANDED_OVER", "\u8BE5\u4F1A\u8BDD\u5DF2\u6258\u7BA1\u5230\u98DE\u4E66\u7FA4\uFF0C\u8BF7\u76F4\u63A5\u6253\u5F00\u5DF2\u6709\u7684\u6258\u7BA1\u7FA4", 409);
18529
18529
  }
18530
18530
  const name = request.body?.name?.trim() || `${cleanChatName(session.title) || session.agentId} \xB7 AgentDock`;
18531
+ const memberOpenIds = (request.body?.memberOpenIds ?? []).map((id2) => id2.trim()).filter(Boolean);
18532
+ if (memberOpenIds.some((id2) => !id2.startsWith("ou_"))) {
18533
+ throw new LarkServiceError("INVALID_HANDOVER_MEMBER", "\u9080\u8BF7\u6210\u5458\u5FC5\u987B\u662F ou_ \u5F00\u5934\u7684 open_id", 400);
18534
+ }
18531
18535
  const bot = await resolveService(void 0, appId);
18532
- const chat = await bot.createChat({ name, memberOpenIds: request.body?.memberOpenIds ?? [] });
18536
+ const chat = await bot.createChat({ name, memberOpenIds });
18533
18537
  await options.cardMappings.save({
18534
18538
  id: `${channel}:${chat.chatId}`,
18535
18539
  channel,