🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat: support bot watch (#14796)
Rdmclin2566b261a12ec
diff --git a/apps/cli/src/commands/bot.ts b/apps/cli/src/commands/bot.tsindex adbf49e19b5..481528b13c3 100644--- a/apps/cli/src/commands/bot.ts+++ b/apps/cli/src/commands/bot.ts@@ -269,6 +269,204 @@ function registerAllowlistCommand(bot: Command, opts: AllowlistGroupOptions) {});}+// ── Watch keywords subcommand factory ──────────────────++interface WatchKeywordEntry {+ instruction?: string;+ keyword: string;+}++/**+ * Normalise `settings.watchKeywords` into the canonical+ * `{keyword, instruction?}[]` shape. Mirrors `extractWatchKeywordEntries`+ * in `src/server/services/bot/platforms/const.ts` so the CLI accepts the+ * same legacy on-disk shapes (`string`, `string[]`, `{keyword, …}[]`)+ * the runtime is forgiving about — including the rare comma/whitespace+ * separated string from a hand-pasted upgrade.+ */+function normalizeWatchKeywords(raw: unknown): WatchKeywordEntry[] {+ const push = (out: Map<string, WatchKeywordEntry>, keyword: unknown, instruction?: unknown) => {+ if (typeof keyword !== 'string') return;+ const normalised = keyword.trim().toLowerCase();+ if (!normalised) return;+ const trimmedInstruction =+ typeof instruction === 'string' && instruction.trim() ? instruction.trim() : undefined;+ const existing = out.get(normalised);+ if (!existing) {+ out.set(normalised, { instruction: trimmedInstruction, keyword: normalised });+ return;+ }+ if (!existing.instruction && trimmedInstruction) existing.instruction = trimmedInstruction;+ };+ const collected = new Map<string, WatchKeywordEntry>();+ if (typeof raw === 'string') {+ for (const piece of raw.split(/[\s,]+/)) push(collected, piece);+ } else if (Array.isArray(raw)) {+ for (const entry of raw) {+ if (typeof entry === 'string') {+ push(collected, entry);+ continue;+ }+ if (entry && typeof entry === 'object' && 'keyword' in entry) {+ const obj = entry as { instruction?: unknown; keyword?: unknown };+ push(collected, obj.keyword, obj.instruction);+ }+ }+ }+ return [...collected.values()];+}++/**+ * Build a `list / add / remove / clear` subcommand group around+ * `settings.watchKeywords`. Shape differs from the user/channel allowlists+ * (`{keyword, instruction?}` vs `{id, name?}`), so we duplicate the+ * scaffolding instead of squeezing both shapes through one factory — the+ * help text, column headers, and `--instruction` flag are all keyword-+ * specific and would just bloat the unified version.+ */+function registerWatchKeywordsCommand(bot: Command) {+ const group = bot+ .command('watch-keywords')+ .description(+ 'Manage watch keywords (non-mention channel triggers; the optional instruction is prepended to the user message before being sent to the AI)',+ );++ const readEntries = (bot: any): WatchKeywordEntry[] =>+ normalizeWatchKeywords((bot.settings as Record<string, unknown> | null)?.watchKeywords);++ const buildPayload = (bot: any, nextEntries: WatchKeywordEntry[]) => ({+ id: bot.id,+ settings: {+ ...(bot.settings as Record<string, unknown>),+ watchKeywords: nextEntries,+ },+ });++ group+ .command('list <botId>')+ .description('List watch-keyword entries')+ .option('--json', 'Output JSON')+ .action(async (botId: string, options: { json?: boolean }) => {+ const client = await getTrpcClient();+ const b = await findBot(client, botId);+ const entries = readEntries(b);++ if (options.json) {+ outputJson(entries);+ return;+ }++ if (entries.length === 0) {+ console.log(`${pc.dim('No watch-keyword entries.')}`);+ return;+ }++ printTable(+ entries.map((e) => [e.keyword, e.instruction ?? pc.dim('-')]),+ ['KEYWORD', 'INSTRUCTION'],+ );+ });++ group+ .command('add <botId> <keyword>')+ .description('Add a watch keyword (with optional instruction prefix)')+ .option(+ '--instruction <text>',+ 'Prompt prepended to the user message when this keyword fires (omit for "just wake the bot")',+ )+ .action(async (botId: string, keyword: string, options: { instruction?: string }) => {+ const trimmedKeyword = keyword.trim().toLowerCase();+ if (!trimmedKeyword) {+ log.error('Keyword cannot be empty.');+ process.exit(1);+ return;+ }++ const trimmedInstruction = options.instruction?.trim();++ const client = await getTrpcClient();+ const b = await findBot(client, botId);+ const entries = readEntries(b);++ const existing = entries.find((e) => e.keyword === trimmedKeyword);+ if (existing) {+ // Upsert instruction on duplicate keyword — operators commonly+ // re-run `add` to tweak the prompt without remembering to remove first.+ if (trimmedInstruction && existing.instruction !== trimmedInstruction) {+ existing.instruction = trimmedInstruction;+ await client.agentBotProvider.update.mutate(buildPayload(b, entries) as any);+ console.log(+ `${pc.green('✓')} Updated instruction for ${pc.bold(trimmedKeyword)} (${entries.length} entr${entries.length === 1 ? 'y' : 'ies'})`,+ );+ return;+ }+ log.info(`${trimmedKeyword} is already on watchKeywords — nothing to do.`);+ return;+ }++ const next = [+ ...entries,+ trimmedInstruction+ ? { instruction: trimmedInstruction, keyword: trimmedKeyword }+ : { keyword: trimmedKeyword },+ ];++ await client.agentBotProvider.update.mutate(buildPayload(b, next) as any);+ console.log(+ `${pc.green('✓')} Added ${pc.bold(trimmedKeyword)}${trimmedInstruction ? ' (with instruction)' : ''} to watchKeywords (now ${next.length} entr${next.length === 1 ? 'y' : 'ies'})`,+ );+ });++ group+ .command('remove <botId> <keyword>')+ .description('Remove a watch keyword')+ .action(async (botId: string, keyword: string) => {+ const trimmedKeyword = keyword.trim().toLowerCase();+ const client = await getTrpcClient();+ const b = await findBot(client, botId);+ const entries = readEntries(b);+ const next = entries.filter((e) => e.keyword !== trimmedKeyword);++ if (next.length === entries.length) {+ log.info(`${trimmedKeyword} is not on watchKeywords — nothing to do.`);+ return;+ }++ await client.agentBotProvider.update.mutate(buildPayload(b, next) as any);+ console.log(+ `${pc.green('✓')} Removed ${pc.bold(trimmedKeyword)} from watchKeywords (${next.length} entr${next.length === 1 ? 'y' : 'ies'} left)`,+ );+ });++ group+ .command('clear <botId>')+ .description('Clear all watch keywords')+ .option('--yes', 'Skip confirmation prompt')+ .action(async (botId: string, options: { yes?: boolean }) => {+ const client = await getTrpcClient();+ const b = await findBot(client, botId);+ const entries = readEntries(b);++ if (entries.length === 0) {+ log.info('watchKeywords is already empty — nothing to do.');+ return;+ }++ if (!options.yes) {+ const confirmed = await confirm(+ `Clear all ${entries.length} watch-keyword entr${entries.length === 1 ? 'y' : 'ies'} from this bot?`,+ );+ if (!confirmed) {+ console.log('Cancelled.');+ return;+ }+ }++ await client.agentBotProvider.update.mutate(buildPayload(b, []) as any);+ console.log(`${pc.green('✓')} Cleared watchKeywords on bot ${pc.bold(botId)}`);+ });+}+// ── Command Registration ─────────────────────────────────export function registerBotCommand(program: Command) {@@ -608,6 +806,10 @@ export function registerBotCommand(program: Command) {name: 'group-allowlist',});+ // ── watch-keywords (LOBE-8891) ────────────────────────++ registerWatchKeywordsCommand(bot);+// ── remove ────────────────────────────────────────────botdiff --git a/docs/usage/messenger/discord.mdx b/docs/usage/messenger/discord.mdxnew file mode 100644index 00000000000..1164ab11199--- /dev/null+++ b/docs/usage/messenger/discord.mdx@@ -0,0 +1,105 @@+---+title: Use LobeHub on Discord+description: >-+ Add the official LobeHub bot to a Discord server, then link your Discord+ account to LobeHub. Pick a default agent and chat with your AI assistants in+ Discord DMs — no bot setup required.+tags:+ - Messenger+ - Discord+ - LobeHub Bot+ - Account Linking+ - Server Install+---++# Use LobeHub on Discord++Discord works in two phases: a **server admin adds** the official LobeHub bot to a Discord server once, and then **each member links** their personal Discord account to LobeHub. Both phases happen from **Settings → Messenger → Discord**.++> The Discord install audit is per-server, but your **personal link is global** to your Discord account — you only link once, and the same link works in every server that has the bot.++## Prerequisites++- A LobeHub account+- A Discord account+- For the install step: **Manage Server** permission on the target Discord server++## Phase A — Add the LobeHub bot to a server (server admin)++<Steps>+ ### Open Settings → Messenger → Discord++ In LobeHub, open **Settings → Messenger** and click the **Discord** card. Click **Connect** in the top-right.++ {/* TODO: screenshot — Discord detail page with empty Connections list and the Connect button */}++ ### Authorise in Discord++ You'll be redirected to Discord's bot-add screen. Pick the server you want to add the bot to and click **Authorise**.++ {/* TODO: screenshot — Discord OAuth consent screen with the server picker */}++ ### Server appears under Connections++ After approval you're redirected back to LobeHub. The server appears as a **server** row in **Connections**.++ {/* TODO: screenshot — Discord detail page showing one connected server row */}++ > **Server already connected by someone else?** LobeHub shows a "Server already connected" notice. You don't need to add the bot again — just DM the LobeHub bot in Discord to link your personal account.+</Steps>++## Phase B — Link your personal account (each member)++<Steps>+ ### Open the LobeHub bot in Discord++ Open the LobeHub bot in Discord — the **Open in Discord** button on the Discord detail page (or the pending-link row) takes you straight there.++ {/* TODO: screenshot — Discord detail page with the pending user row + Open in Discord button */}++ ### Send any message++ In the bot DM, send any message to trigger the linking flow. The bot replies with a one-time confirmation link.++ {/* TODO: screenshot — Discord DM with the bot's reply containing the link button */}++ ### Confirm the link in your browser++ Tap the link, sign in to LobeHub if asked, and choose a **default agent**. Every message you DM the LobeHub bot in Discord (across all servers) will route to this agent.++ {/* TODO: screenshot — confirm-link page in LobeHub with the agent picker */}++ Your link appears as a **user** row in **Connections**.++ {/* TODO: screenshot — Discord detail page showing server row + connected user row */}+</Steps>++## Switching the Active Agent++Two equivalent ways:++- **In Discord** — DM the bot `/agents` and pick a different agent.+- **In LobeHub** — open **Settings → Messenger → Discord** and use the agent picker on your link row.++The change takes effect on the next message you send.++## Disconnecting++Discord has two distinct disconnect actions, with one important difference from Slack:++| Action | Effect |+| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| **Disconnect** on a *user* row | Unlinks **your** LobeHub account from your Discord account. The bot stops accepting your DMs until you message it and link again. |+| **Disconnect** on a *server* row | Removes the install **audit entry only**. **The bot stays in the Discord server** until a server admin manually kicks it. Other people's personal links are unaffected. |++You can re-add the bot to a server (or re-link personally) at any time by repeating the relevant phase.++## Troubleshooting++- **"Server already connected"** — Another LobeHub user already added the bot to this server. DM the LobeHub bot in Discord to link your personal account; you do not need to add the bot again.+- **Discord install failed (`<reason>`)** — Common reasons: authorisation cancelled, install session expired (re-open the modal and try again), Discord returned incomplete data (retry; if persistent, contact support).+- **Bot is in the server but doesn't reply** — Check that you have a personal link under **Settings → Messenger → Discord**. The bot only answers users with a confirmed personal link.+- **Removed the audit row but the bot is still in my server** — That's expected. Disconnecting in LobeHub only removes the audit entry; a Discord server admin must kick the bot from Discord itself.+- **"This link is already used"** — One-time confirmation links expire after one use. DM the bot again to get a new link.+- **"This account is already linked"** — Your Discord account is bound to a different LobeHub account. Sign in to that LobeHub account to manage the link, or unlink there before retrying.+- **"Another Discord account is already linked"** — Your LobeHub account already has a Discord link. Disconnect it in **Settings → Messenger → Discord** before linking a new Discord account.diff --git a/docs/usage/messenger/discord.zh-CN.mdx b/docs/usage/messenger/discord.zh-CN.mdxnew file mode 100644index 00000000000..2f2380e8d44--- /dev/null+++ b/docs/usage/messenger/discord.zh-CN.mdx@@ -0,0 +1,104 @@+---+title: 在 Discord 使用 LobeHub+description: >-+ 把官方 LobeHub 机器人加入 Discord 服务器,再把自己的 Discord 账号关联到+ LobeHub;选择默认 Agent,就能在 Discord DM 里直接和 AI 助手对话,无需自建机器人。+tags:+ - Messenger+ - Discord+ - LobeHub 机器人+ - 账号关联+ - 服务器安装+---++# 在 Discord 使用 LobeHub++Discord 接入分两步:**服务器管理员把 LobeHub 机器人加入 Discord 服务器**(每个服务器一次),然后 **每位成员把自己的 Discord 账号关联到 LobeHub**。两步都在 **设置 → Messenger → Discord** 里完成。++> Discord 安装审计是按服务器记录的,但你的 **个人关联是全局的**,挂在你的 Discord 账号下 —— 只需关联一次,所有装了机器人的服务器里它都生效。++## 前置条件++- 一个 LobeHub 账号+- 一个 Discord 账号+- 安装环节:目标 Discord 服务器的 **Manage Server(管理服务器)** 权限++## 阶段 A —— 把 LobeHub 机器人加入服务器(服务器管理员)++<Steps>+ ### 打开「设置 → Messenger → Discord」++ 在 LobeHub 中打开 **设置 → Messenger**,点击 **Discord** 卡片,再点右上角的 **连接**。++ {/* TODO: 截图 —— Discord 详情页(Connections 列表为空 + Connect 按钮) */}++ ### 在 Discord 中授权++ 页面跳转到 Discord 添加机器人页面。选择目标服务器,点击 **Authorise(授权)**。++ {/* TODO: 截图 —— Discord OAuth 授权页(含服务器选择器) */}++ ### 服务器出现在 Connections 列表++ 授权成功后跳回 LobeHub。该服务器会以 **server** 行的形式出现在 **Connections** 中。++ {/* TODO: 截图 —— Discord 详情页:已连接的 server 行 */}++ > **服务器已被他人连接?** LobeHub 会提示「Server already connected」。你**不需要**再次添加机器人,只要在 Discord 里私聊 LobeHub 机器人完成个人账号关联即可。+</Steps>++## 阶段 B —— 关联个人账号(每位成员)++<Steps>+ ### 在 Discord 中打开 LobeHub 机器人++ 在 Discord 中打开 LobeHub 机器人 —— Discord 详情页(或 pending 状态的 user 行)上的 **在 Discord 中打开** 按钮可以直接跳过去。++ {/* TODO: 截图 —— Discord 详情页:pending 的 user 行 + Open in Discord 按钮 */}++ ### 发送任意一条消息++ 在机器人 DM 里发送任意一条消息触发关联流程。机器人会回复一个一次性确认链接。++ {/* TODO: 截图 —— Discord DM 中机器人发送的关联按钮消息 */}++ ### 在浏览器里确认关联++ 点击链接,必要时登录 LobeHub,然后选择一个 **默认 Agent**。之后你在 Discord 任意服务器里私聊 LobeHub 机器人的每条消息都会路由到这个 Agent。++ {/* TODO: 截图 —— LobeHub 确认关联页面,含 Agent 选择器 */}++ 关联完成后会在 **Connections** 里以 **user** 行的形式出现。++ {/* TODO: 截图 —— Discord 详情页:server 行 + 已连接的 user 行 */}+</Steps>++## 切换接收消息的 Agent++两种等价方式:++- **在 Discord 里** —— 私聊机器人发送 `/agents`,挑一个新的 Agent。+- **在 LobeHub 里** —— 打开 **设置 → Messenger → Discord**,在你的关联行里使用 Agent 选择器。++切换会对你发送的下一条消息立即生效。++## 断开连接++Discord 也有两种含义不同的断开操作,有一处和 Slack 不同需要特别注意:++| 操作 | 效果 |+| -------------------- | ----------------------------------------------------------------------------- |+| 在 *user* 行点 **断开** | 解除 **你自己** 的 LobeHub 账号与 Discord 账号的关联。机器人不再接收你的 DM,直到你再次发消息并完成关联。 |+| 在 *server* 行点 **断开** | **只移除安装审计记录**。**机器人会继续留在 Discord 服务器里**,直到 Discord 服务器管理员手动把它踢出。其他人的个人关联不受影响。 |++任何时候都可以重新走对应阶段把机器人加回服务器、或重新建立个人关联。++## 故障排查++- **"Server already connected"(服务器已连接)** —— 服务器已被另一位 LobeHub 用户加过机器人。直接在 Discord 私聊 LobeHub 机器人完成个人关联即可,无需重新添加。+- **Discord 安装失败(`<原因>`)** —— 常见原因:用户取消授权、安装会话过期(重新打开弹窗再试)、Discord 返回的数据不完整(重试;持续失败请联系支持)。+- **机器人在服务器但不回我消息** —— 检查 **设置 → Messenger → Discord** 下你是否有个人关联。机器人只回复完成了个人关联的用户。+- **断开了审计行,但机器人还在服务器里** —— 这是预期行为。在 LobeHub 里断开只移除审计记录,需要 Discord 服务器管理员手动从 Discord 那边把机器人踢出。+- **"This link is already used"** —— 一次性确认链接只能用一次,给机器人再发一条消息获取新链接。+- **"This account is already linked"** —— 这个 Discord 账号已绑定到另一个 LobeHub 账号。请用那个 LobeHub 账号登录管理,或先在那边解绑。+- **"Another Discord account is already linked"** —— 你的 LobeHub 账号在 Discord 上已有关联。先在 **设置 → Messenger → Discord** 断开旧关联,再绑定新的 Discord 账号。diff --git a/docs/usage/messenger/overview.mdx b/docs/usage/messenger/overview.mdxnew file mode 100644index 00000000000..3721467cdb5--- /dev/null+++ b/docs/usage/messenger/overview.mdx@@ -0,0 +1,84 @@+---+title: Messenger Overview+description: >-+ Connect your LobeHub account to the official LobeHub bot on Telegram, Slack,+ and Discord. Link once, pick an active agent, and chat with your assistants+ from the chat apps you already use — no bot setup required.+tags:+ - Messenger+ - Telegram+ - Slack+ - Discord+ - Integration+---++# Messenger++Messenger lets you talk to your LobeHub agents through the **official LobeHub bot** on Telegram, Slack, and Discord. Link your LobeHub account once, choose which agent should answer, and you're done — every message you send to the bot is routed to your agent and replied to in the same conversation.++You manage everything from **Settings → Messenger** in LobeHub.++> \[!NOTE]+>+> Messenger is for **personal use** of LobeHub agents from your favourite chat app. If you want to expose an agent to a public community with your own bot identity, set up a [Channel](/docs/usage/channels/overview) on the agent instead.++## Messenger vs. Channels++| | **Messenger** | **Channels** |+| ------------- | --------------------------------------------- | --------------------------------------------------------------------- |+| Bot identity | Official **@LobeHub** bot, hosted by LobeHub | Your own bot, you bring the token |+| Setup effort | Tap **Connect**, send `/start`, pick an agent | Create the bot on the platform, paste credentials, configure policies |+| Scope | Personal — only you talk to the bot | Public — anyone in the channel/server can talk to it |+| Active agent | One per platform link, switchable any time | One agent per channel binding |+| Configured at | Settings → Messenger | Agent → Channels |++## Supported Platforms++| Platform | Setup model | Guide |+| ------------ | ---------------------------------------- | --------------------------------------------------------- |+| **Telegram** | Global bot — any account can DM directly | [Use LobeHub on Telegram](/docs/usage/messenger/telegram) |+| **Slack** | Per-workspace install + per-member link | [Use LobeHub on Slack](/docs/usage/messenger/slack) |+| **Discord** | Per-server install + per-member link | [Use LobeHub on Discord](/docs/usage/messenger/discord) |++If a platform card does not appear at **Settings → Messenger**, it has not been enabled on your deployment yet — check back later or ask your administrator.++{/* TODO: screenshot — Settings → Messenger landing screen showing the three platform cards */}++## How It Works++1. You **link** your LobeHub account to a platform account through a short OAuth-style flow.+2. You pick a **default agent** during linking. Every message you send to the bot from that platform routes to this agent.+3. To switch agents, send `/agents` inside the bot or open **Settings → Messenger** in LobeHub.+4. **Disconnect** any time from the same screen — inbound messages stop until you `/start` again.++Each LobeHub account can hold one link per platform (Slack also tracks one link per workspace).++## Switching the Active Agent++You can switch the agent that answers your messages at any time:++- **From the bot** — send `/agents` and pick a different agent.+- **From LobeHub** — open **Settings → Messenger**, select the platform, and use the agent picker on your link row.++Changes take effect immediately for the next message you send.++## Disconnecting++There are two distinct disconnect actions per platform:++| Action | Effect |+| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| **Disconnect** on a *user* row | Unlinks **your** LobeHub account from the platform account. Inbound messages stop until you `/start` again. |+| **Disconnect** on a *workspace / server* row | Removes the install audit entry. On Slack, this also freezes the workspace bot for everyone. On Discord, the bot stays in the server until a server admin kicks it. |++You can re-link at any time by repeating the **Connect** flow.++## Common Errors++These messages can appear during linking regardless of platform:++- **"This link is already used"** — The one-time confirm link can only be used once. Return to the bot and send `/start` again to issue a new link.+- **"This account is already linked"** — The platform account is bound to a different LobeHub account. Sign in to that account to manage it, or unlink it there before retrying.+- **"Another \<platform> account is already linked"** — Your LobeHub account already has a link on this platform. Disconnect the existing link in **Settings → Messenger** before linking a new one.++For platform-specific issues, see the troubleshooting section on each platform's guide.diff --git a/docs/usage/messenger/overview.zh-CN.mdx b/docs/usage/messenger/overview.zh-CN.mdxnew file mode 100644index 00000000000..6327f2d2618--- /dev/null+++ b/docs/usage/messenger/overview.zh-CN.mdx@@ -0,0 +1,83 @@+---+title: Messenger 概览+description: >-+ 将 LobeHub 账号一键关联到 Telegram、Slack、Discord 上的官方 LobeHub+ 机器人。只需绑定一次,选择默认 Agent,就能在常用聊天工具里直接和你的 AI 助手对话,无需自建机器人。+tags:+ - Messenger+ - Telegram+ - Slack+ - Discord+ - 集成+---++# Messenger++Messenger 让你通过 **官方 LobeHub 机器人** 在 Telegram、Slack、Discord 上直接和 LobeHub Agent 对话。只需将 LobeHub 账号绑定一次、选好接收消息的 Agent,之后你在机器人里发的每一条消息都会被路由到该 Agent 并在同一会话里回复给你。++所有配置都集中在 LobeHub 的 **设置 → Messenger** 页面。++> \[!NOTE]+>+> Messenger 面向 **个人使用** —— 让你在常用聊天工具里方便地用自己的 LobeHub Agent。如果你想以自家机器人身份把某个 Agent 公开给社区使用,请改用 Agent 上的 [渠道(Channels)](/docs/usage/channels/overview)。++## Messenger 与渠道(Channels)的区别++| | **Messenger** | **渠道(Channels)** |+| -------- | -------------------------------- | ---------------------- |+| 机器人身份 | 官方 **@LobeHub** 机器人,由 LobeHub 托管 | 你自己的机器人,需要自带 Token |+| 配置成本 | 点 **连接**、发送 `/start`、选一个 Agent | 在平台上创建机器人、粘贴凭据、配置策略 |+| 适用场景 | 个人 —— 只有你自己和机器人对话 | 公开 —— 频道 / 服务器里所有人都能对话 |+| 接收 Agent | 每个平台绑定一个,可随时切换 | 每个频道绑定一个 Agent |+| 配置入口 | 设置 → Messenger | Agent → 渠道 |++## 支持的平台++| 平台 | 接入模式 | 文档 |+| ------------ | ------------------- | ------------------------------------------------------- |+| **Telegram** | 全局机器人 —— 任意账号都可直接私聊 | [在 Telegram 使用 LobeHub](/docs/usage/messenger/telegram) |+| **Slack** | 按工作区安装 + 成员各自关联 | [在 Slack 使用 LobeHub](/docs/usage/messenger/slack) |+| **Discord** | 按服务器安装 + 成员各自关联 | [在 Discord 使用 LobeHub](/docs/usage/messenger/discord) |++如果 **设置 → Messenger** 页面没有出现某个平台的卡片,说明当前部署尚未启用该平台 —— 请稍后再来,或联系管理员开启。++{/* TODO: 截图 —— 设置 → Messenger 入口页,三个平台卡片 */}++## 工作原理++1. 通过一段类 OAuth 的流程,将你的 LobeHub 账号 **关联** 到平台账号。+2. 关联时选择一个 **默认 Agent**,之后该平台收到的消息都会路由到这个 Agent。+3. 切换 Agent:在机器人里发送 `/agents`,或回到 LobeHub 的 **设置 → Messenger**。+4. 随时可以在同一页面 **断开连接** —— 断开后机器人将不再接收消息,直到你重新 `/start`。++每个 LobeHub 账号在每个平台上可保留一条关联(Slack 还会按工作区各保留一条)。++## 切换接收消息的 Agent++你可以随时切换接收你消息的 Agent:++- **在机器人里** —— 发送 `/agents`,挑一个新的 Agent。+- **在 LobeHub 里** —— 打开 **设置 → Messenger**,选择平台,在你的关联行里使用 Agent 选择器。++切换会立即对你发送的下一条消息生效。++## 断开连接++每个平台有两种含义不同的断开操作:++| 操作 | 效果 |+| -------------------------------- | ------------------------------------------------------------------------ |+| 在 *user* 行点 **断开** | 解除 **你自己** 的 LobeHub 账号与该平台账号的关联。机器人不再接收你的消息,直到你重新 `/start`。 |+| 在 *workspace / server* 行点 **断开** | 移除安装审计记录。Slack 会因此让该工作区的整个机器人失效;Discord 上机器人会继续留在服务器,直到 Discord 管理员把它踢出。 |++任何时候都可以重新走一次 **连接** 流程恢复关联。++## 通用报错++下面这几条提示在任何平台关联时都可能出现:++- **"This link is already used"(链接已被使用)** —— 一次性确认链接只能使用一次。请回到机器人重新发送 `/start` 获取新链接。+- **"This account is already linked"(该账号已被关联)** —— 该平台账号已绑定到另一个 LobeHub 账号。请用那个 LobeHub 账号登录管理;或先在那边解绑后再尝试。+- **"Another \<platform> account is already linked"(另一个平台账号已关联)** —— 你的 LobeHub 账号在该平台上已有关联。先在 **设置 → Messenger** 里断开旧关联,再绑定新账号。++平台特有的报错和细节请见各平台文档的「故障排查」一节。diff --git a/docs/usage/messenger/slack.mdx b/docs/usage/messenger/slack.mdxnew file mode 100644index 00000000000..23f6ec27983--- /dev/null+++ b/docs/usage/messenger/slack.mdx@@ -0,0 +1,102 @@+---+title: Use LobeHub on Slack+description: >-+ Install the official LobeHub Slack app to your workspace, then link each+ member's Slack account to LobeHub. Pick a default agent and chat with your AI+ assistants from Slack DMs — no bot setup required.+tags:+ - Messenger+ - Slack+ - LobeHub Bot+ - Account Linking+ - Workspace Install+---++# Use LobeHub on Slack++Slack works in two phases: a **workspace admin installs** the official LobeHub Slack app once, and then **each member links** their personal LobeHub account. Both phases happen from **Settings → Messenger → Slack**.++## Prerequisites++- A LobeHub account+- A Slack workspace+- For the install step: permission to install Slack apps in that workspace (typically Workspace Admin or a permission granted by one)++## Phase A — Install the LobeHub Slack app (admin, once per workspace)++<Steps>+ ### Open Settings → Messenger → Slack++ In LobeHub, open **Settings → Messenger** and click the **Slack** card. Click **Connect** in the top-right.++ {/* TODO: screenshot — Slack detail page with empty Connections list and the Connect button */}++ ### Authorise in Slack++ You'll be redirected to Slack's authorisation screen. Pick the workspace you want to install into and click **Allow**.++ {/* TODO: screenshot — Slack OAuth consent screen */}++ ### Workspace appears under Connections++ After approval you're redirected back to LobeHub. The workspace shows up as a **workspace** row in **Connections**, with a status of **Connected**.++ {/* TODO: screenshot — Slack detail page showing one connected workspace row */}++ > **Workspace already connected by someone else?** LobeHub blocks the install and shows a "Workspace already connected" notice. You don't need to install again — just DM **@LobeHub** in Slack to link your personal account. If you want to take over ownership, ask the original installer to disconnect the workspace first.+</Steps>++## Phase B — Link your personal account (each member)++<Steps>+ ### Open the LobeHub bot in Slack++ In Slack, open the **Apps** sidebar and find **LobeHub**, or search for `@LobeHub`. Open a DM with the bot.++ {/* TODO: screenshot — Slack apps sidebar with LobeHub highlighted */}++ ### Send any message++ Send any message to the bot to trigger the linking flow. The bot replies with a one-time confirmation link.++ {/* TODO: screenshot — Slack DM showing the bot's "Link Account" reply */}++ ### Confirm the link in your browser++ Tap the link, sign in to LobeHub if asked, and choose a **default agent**. Every message you DM the bot in this workspace will route to this agent.++ {/* TODO: screenshot — confirm-link page in LobeHub with the agent picker */}++ Your link appears as a **user** row under the workspace install in **Connections**.++ {/* TODO: screenshot — Slack detail page showing the workspace row + a connected user row */}+</Steps>++## Switching the Active Agent++Two equivalent ways:++- **In Slack** — DM the bot `/agents` and pick a different agent.+- **In LobeHub** — open **Settings → Messenger → Slack** and use the agent picker on your link row.++The change takes effect on the next message you send.++## Disconnecting++Slack has two distinct disconnect actions:++| Action | Effect |+| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| **Disconnect** on a *user* row | Unlinks **your** LobeHub account from your Slack account in this workspace. Your inbound DMs stop until you message the bot and link again. |+| **Disconnect** on a *workspace* row | Removes the workspace install. The bot is **frozen for everyone** in that workspace because dispatch is token-gated — existing user links remain on file but pause until the workspace is re-installed. |++You can re-install (workspace) or re-link (personal) at any time by repeating the relevant phase.++## Troubleshooting++- **"Workspace already connected"** — Another LobeHub user already installed the app to this workspace. DM **@LobeHub** to link your personal account; you do not need to install again. To take over ownership, ask the original installer to disconnect first.+- **Slack install failed (`<reason>`)** — Common reasons: authorisation cancelled, install session expired (re-open the modal and try again), Slack returned incomplete data (retry; if persistent, contact support).+- **Bot does not reply to your DM** — The workspace install may have been disconnected. Check **Settings → Messenger → Slack** for a workspace row; if missing, ask an admin to re-install.+- **"This link is already used"** — One-time confirmation links expire after one use. DM the bot again to get a new link.+- **"This account is already linked"** — Your Slack account is bound to a different LobeHub account. Sign in to that LobeHub account to manage the link, or unlink there before retrying.+- **"Another Slack account is already linked"** — Your LobeHub account already has a Slack link in this workspace. Disconnect it in **Settings → Messenger → Slack** before linking a new Slack account.diff --git a/docs/usage/messenger/slack.zh-CN.mdx b/docs/usage/messenger/slack.zh-CN.mdxnew file mode 100644index 00000000000..2b5633df5a5--- /dev/null+++ b/docs/usage/messenger/slack.zh-CN.mdx@@ -0,0 +1,101 @@+---+title: 在 Slack 使用 LobeHub+description: >-+ 在 Slack 工作区安装官方 LobeHub Slack 应用,再让每位成员各自关联自己的 LobeHub+ 账号;选择默认 Agent,就能在 Slack DM 里直接和 AI 助手对话,无需自建机器人。+tags:+ - Messenger+ - Slack+ - LobeHub 机器人+ - 账号关联+ - 工作区安装+---++# 在 Slack 使用 LobeHub++Slack 接入分两步:**工作区管理员安装一次** 官方 LobeHub Slack 应用,然后 **每位成员各自关联** 自己的 LobeHub 账号。两步都在 **设置 → Messenger → Slack** 里完成。++## 前置条件++- 一个 LobeHub 账号+- 一个 Slack 工作区+- 安装环节:在该工作区里安装 Slack 应用的权限(通常是 Workspace Admin,或由管理员授予的权限)++## 阶段 A —— 安装 LobeHub Slack 应用(管理员,每个工作区一次)++<Steps>+ ### 打开「设置 → Messenger → Slack」++ 在 LobeHub 中打开 **设置 → Messenger**,点击 **Slack** 卡片,再点右上角的 **连接**。++ {/* TODO: 截图 —— Slack 详情页(Connections 列表为空 + Connect 按钮) */}++ ### 在 Slack 中授权++ 页面跳转到 Slack 授权界面。选择要安装的目标工作区,点击 **Allow(允许)**。++ {/* TODO: 截图 —— Slack OAuth 授权页 */}++ ### 工作区出现在 Connections 列表++ 授权成功后跳回 LobeHub。该工作区会以 **workspace** 行的形式出现在 **Connections** 中,状态为 **已连接 (Connected)**。++ {/* TODO: 截图 —— Slack 详情页:已连接的 workspace 行 */}++ > **工作区已被他人连接?** LobeHub 会阻止安装并提示「Workspace already connected」。你**不需要**重新安装,只要在 Slack 里私聊 **@LobeHub** 完成个人账号关联即可。如果想接管所有权,请请求最初的安装者先断开连接。+</Steps>++## 阶段 B —— 关联个人账号(每位成员)++<Steps>+ ### 在 Slack 里打开 LobeHub 机器人++ 在 Slack 左侧 **Apps** 栏里找到 **LobeHub**,或直接搜索 `@LobeHub`,打开它的 DM 会话。++ {/* TODO: 截图 —— Slack Apps 栏里高亮 LobeHub */}++ ### 发送任意一条消息++ 给机器人发送任意一条消息触发关联流程。机器人会回复一个一次性确认链接。++ {/* TODO: 截图 —— Slack DM 中机器人发送 "Link Account" 按钮 */}++ ### 在浏览器里确认关联++ 点击链接,必要时登录 LobeHub,然后选择一个 **默认 Agent**。之后在该工作区私聊机器人的每条消息都会路由到这个 Agent。++ {/* TODO: 截图 —— LobeHub 确认关联页面,含 Agent 选择器 */}++ 关联完成后,会在 **Connections** 里以 **user** 行的形式出现在该工作区下方。++ {/* TODO: 截图 —— Slack 详情页:workspace 行 + 一条已连接的 user 行 */}+</Steps>++## 切换接收消息的 Agent++两种等价方式:++- **在 Slack 里** —— 私聊机器人发送 `/agents`,挑一个新的 Agent。+- **在 LobeHub 里** —— 打开 **设置 → Messenger → Slack**,在你的关联行里使用 Agent 选择器。++切换会对你发送的下一条消息立即生效。++## 断开连接++Slack 有两种含义不同的断开操作:++| 操作 | 效果 |+| ----------------------- | ------------------------------------------------------------------------------- |+| 在 *user* 行点 **断开** | 解除 **你自己** 的 LobeHub 账号与该工作区 Slack 账号的关联。你的 DM 不再被接收,直到你再次给机器人发消息并完成关联。 |+| 在 *workspace* 行点 **断开** | 移除工作区安装。由于消息分发受 token 控制,这会让该工作区里**所有人的机器人都失效**;现有 user 关联记录还在,但暂停工作直到工作区被重新安装。 |++任何时候都可以重走对应阶段重新安装(工作区)或重新关联(个人)。++## 故障排查++- **"Workspace already connected"(工作区已连接)** —— 工作区已被另一位 LobeHub 用户安装过。私聊 **@LobeHub** 完成个人关联即可,无需重装。如需接管,请请求最初的安装者先断开。+- **Slack 安装失败(`<原因>`)** —— 常见原因:用户取消授权、安装会话过期(重新打开弹窗再试)、Slack 返回的数据不完整(重试;持续失败请联系支持)。+- **机器人不回 DM** —— 工作区安装可能已被断开。检查 **设置 → Messenger → Slack** 是否还有 workspace 行;没有就请管理员重新安装。+- **"This link is already used"** —— 一次性确认链接只能用一次,给机器人再发一条消息获取新链接。+- **"This account is already linked"** —— 这个 Slack 账号已绑定到另一个 LobeHub 账号。请用那个 LobeHub 账号登录管理,或先在那边解绑。+- **"Another Slack account is already linked"** —— 你的 LobeHub 账号在该工作区里已有 Slack 关联。先在 **设置 → Messenger → Slack** 断开旧关联,再绑定新的 Slack 账号。diff --git a/docs/usage/messenger/telegram.mdx b/docs/usage/messenger/telegram.mdxnew file mode 100644index 00000000000..d2a69011e72--- /dev/null+++ b/docs/usage/messenger/telegram.mdx@@ -0,0 +1,77 @@+---+title: Use LobeHub on Telegram+description: >-+ Link your LobeHub account to the official LobeHub bot on Telegram. Send /start+ to the bot, pick a default agent, and chat with your AI assistants directly+ from any Telegram conversation — no bot setup required.+tags:+ - Messenger+ - Telegram+ - LobeHub Bot+ - Account Linking+---++# Use LobeHub on Telegram++Telegram is the simplest Messenger platform: there is one global LobeHub bot, and any Telegram account can DM it. You only need to link your LobeHub account once.++## Prerequisites++- A LobeHub account+- A Telegram account on any device++## Step 1: Open Settings → Messenger++In LobeHub, open **Settings → Messenger** and click the **Telegram** card.++{/* TODO: screenshot — Settings → Messenger with Telegram card highlighted */}++## Step 2: Click Connect++On the Telegram detail page, click **Connect** in the top-right corner. A modal opens with two ways to reach the bot.++{/* TODO: screenshot — Telegram detail page with empty Connections list and the Connect button */}++## Step 3: Open the bot in Telegram++Either tap **Open in Telegram** in the modal, or scan the QR code with your phone. Telegram opens the official LobeHub bot.++{/* TODO: screenshot — LinkModal showing the Open in Telegram button + QR code */}++## Step 4: Send `/start`++Inside the bot, send the `/start` command. The bot replies with a one-time confirmation link.++{/* TODO: screenshot — Telegram bot conversation showing /start sent and the bot's reply with the Link Account button */}++## Step 5: Confirm the link in your browser++Tap the link in the bot's reply. You'll be taken back to LobeHub. Sign in if asked, then choose a **default agent** — every message you DM the bot from now on will route to this agent.++{/* TODO: screenshot — confirm-link page in LobeHub with the agent picker visible */}++After confirming, the Telegram detail page shows your link as a "user" row with the active agent.++{/* TODO: screenshot — Telegram detail page with one connected user row */}++## Switching the Active Agent++Two equivalent ways:++- **In Telegram** — send `/agents` to the bot and pick a different agent.+- **In LobeHub** — open **Settings → Messenger → Telegram** and use the agent picker on your link row.++The change takes effect on the next message you send.++## Disconnecting++In **Settings → Messenger → Telegram**, click **Disconnect** on the link row. The bot will stop accepting your messages until you re-link by sending `/start` again.++> Disconnecting from LobeHub does not remove the bot from your Telegram chat list — you can manually delete the chat in Telegram if you no longer want to see it.++## Troubleshooting++- **The bot does not reply to `/start`** — Check that the platform card actually exists in **Settings → Messenger**. If your deployment hasn't enabled Telegram yet, the bot won't respond.+- **"This link is already used"** — One-time links can only be used once. Send `/start` again to get a new link.+- **"This account is already linked"** — Your Telegram account is bound to a different LobeHub account. Sign in to that LobeHub account to manage the link, or unlink there first.+- **"Another Telegram account is already linked"** — Your LobeHub account already has a Telegram link. Disconnect it in **Settings → Messenger → Telegram** before linking a new Telegram account.diff --git a/docs/usage/messenger/telegram.zh-CN.mdx b/docs/usage/messenger/telegram.zh-CN.mdxnew file mode 100644index 00000000000..6859debaa73--- /dev/null+++ b/docs/usage/messenger/telegram.zh-CN.mdx@@ -0,0 +1,76 @@+---+title: 在 Telegram 使用 LobeHub+description: >-+ 将 LobeHub 账号关联到 Telegram 上的官方 LobeHub 机器人。给机器人发送+ /start,选择默认 Agent,就能在任意 Telegram 会话里直接和你的 AI 助手对话,无需自建机器人。+tags:+ - Messenger+ - Telegram+ - LobeHub 机器人+ - 账号关联+---++# 在 Telegram 使用 LobeHub++Telegram 是 Messenger 里最简单的平台:只有一个全局 LobeHub 机器人,任何 Telegram 账号都能直接私聊它。你只需要把自己的 LobeHub 账号绑一次。++## 前置条件++- 一个 LobeHub 账号+- 任意设备上的 Telegram 账号++## 第 1 步:打开「设置 → Messenger」++在 LobeHub 中打开 **设置 → Messenger**,点击 **Telegram** 卡片。++{/* TODO: 截图 —— 设置 → Messenger 入口页,高亮 Telegram 卡片 */}++## 第 2 步:点击「连接」++在 Telegram 详情页右上角点击 **连接**。弹窗里会给出两种方式打开机器人。++{/* TODO: 截图 —— Telegram 详情页(Connections 列表为空 + Connect 按钮) */}++## 第 3 步:在 Telegram 中打开机器人++在弹窗里点 **在 Telegram 中打开**,或用手机扫描二维码,Telegram 会自动打开官方 LobeHub 机器人。++{/* TODO: 截图 —— LinkModal 弹窗(含 Open in Telegram 按钮和二维码) */}++## 第 4 步:发送 `/start`++在机器人会话里发送 `/start`。机器人会回复一个一次性确认链接。++{/* TODO: 截图 —— Telegram 机器人会话:用户发送 /start,机器人回复带 Link Account 按钮的消息 */}++## 第 5 步:在浏览器里确认关联++点击机器人回复里的链接,会跳回 LobeHub 网页。如未登录请先登录,然后选择一个 **默认 Agent** —— 之后你在该机器人里发的每条消息都会路由到这个 Agent。++{/* TODO: 截图 —— LobeHub 确认关联页面,含 Agent 选择器 */}++确认后,Telegram 详情页会以 “user” 行的形式显示你的关联,旁边可以看到当前 Agent。++{/* TODO: 截图 —— Telegram 详情页:已连接的 user 行 */}++## 切换接收消息的 Agent++两种等价方式:++- **在 Telegram 里** —— 给机器人发送 `/agents`,挑一个新的 Agent。+- **在 LobeHub 里** —— 打开 **设置 → Messenger → Telegram**,在你的关联行里使用 Agent 选择器。++切换会对你发送的下一条消息立即生效。++## 断开连接++在 **设置 → Messenger → Telegram** 里点关联行上的 **断开**。断开后机器人不再接收你的消息,直到你重新发送 `/start` 关联。++> 在 LobeHub 里断开不会从 Telegram 聊天列表里删掉机器人 —— 如果不想再看到它,可以在 Telegram 里手动删除该会话。++## 故障排查++- **机器人不回复 `/start`** —— 先确认 **设置 → Messenger** 里有 Telegram 卡片。如果当前部署没启用 Telegram,机器人不会响应。+- **"This link is already used"** —— 一次性链接只能用一次,重新发送 `/start` 获取新链接。+- **"This account is already linked"** —— 这个 Telegram 账号已绑定到另一个 LobeHub 账号。请用那个 LobeHub 账号登录管理,或先在那边解绑。+- **"Another Telegram account is already linked"** —— 你的 LobeHub 账号在 Telegram 上已有关联。先在 **设置 → Messenger → Telegram** 断开旧关联,再绑定新的 Telegram 账号。diff --git a/locales/ar/agent.json b/locales/ar/agent.jsonindex ec5efaa8d35..9cdc29d7f6e 100644--- a/locales/ar/agent.json+++ b/locales/ar/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "الصق رمز البوت هنا","channel.charLimit": "حد الأحرف","channel.charLimitHint": "الحد الأقصى لعدد الأحرف لكل رسالة",+ "channel.comingSoon": "قريبًا",+ "channel.comingSoonDesc": "نعمل على جلب هذا التكامل إلى LobeHub. تابعنا للحصول على التحديثات.",+ "channel.comingSoonTitle": "تكامل {{name}} قادم قريبًا","channel.concurrency": "وضع التزامن","channel.concurrencyDebounce": "إزالة الارتداد","channel.concurrencyDebounceHint": "معالجة آخر رسالة فقط في الدفعة (يتم تجاهل الرسائل السابقة)",@@ -183,6 +186,14 @@"channel.verificationToken": "رمز التحقق","channel.verificationTokenHint": "اختياري. يُستخدم للتحقق من مصدر أحداث الويب هوك.","channel.verificationTokenPlaceholder": "الصق رمز التحقق هنا",+ "channel.watchKeywordInstructionLabel": "تعليمات",+ "channel.watchKeywordInstructionPlaceholder": "على سبيل المثال: قم بمسح المحادثة الأخيرة ورد إذا كان هناك تقرير خطأ قابل للتنفيذ",+ "channel.watchKeywordLabel": "الكلمة المفتاحية",+ "channel.watchKeywordPlaceholder": "على سبيل المثال: خطأ",+ "channel.watchKeywords": "الكلمات المفتاحية المراقبة",+ "channel.watchKeywordsAdd": "إضافة كلمة مفتاحية",+ "channel.watchKeywordsEmpty": "لم تتم إضافة أي كلمات مفتاحية بعد — يستيقظ الروبوت فقط عند الإشارة إليه @mention أو في الرسائل المباشرة في القنوات المشتركة.",+ "channel.watchKeywordsHint": "عندما تتطابق رسالة في قناة مشتركة مع كلمة مفتاحية، يستيقظ الروبوت دون الحاجة إلى الإشارة إليه @mention ويتم إضافة التعليمات إلى رسالة المستخدم قبل إرسالها إلى الذكاء الاصطناعي. تطابق غير حساس لحالة الأحرف وكلمة كاملة.","channel.wechat.description": "قم بتوصيل هذا المساعد بـ WeChat عبر iLink Bot للمحادثات الخاصة والجماعية.","channel.wechatBotId": "معرّف الروبوت","channel.wechatBotIdHint": "معرّف الروبوت المخصص بعد تفويض رمز الاستجابة السريعة.",diff --git a/locales/ar/plugin.json b/locales/ar/plugin.jsonindex 67bd711480e..0d86b1ecaf0 100644--- a/locales/ar/plugin.json+++ b/locales/ar/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "الملحق","builtins.lobe-agent-management.render.installPlugin.success": "تم التثبيت بنجاح","builtins.lobe-agent-management.title": "مدير الوكلاء",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "تحليل الوسائط المرئية",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} وسائط",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "تحليل الوسائط المرئية: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "استدعاء الوكيل الفرعي","builtins.lobe-agent.apiName.callSubAgent.completed": "تم إرسال الوكيل الفرعي: ","builtins.lobe-agent.apiName.callSubAgent.loading": "جارٍ إرسال الوكيل الفرعي: ",diff --git a/locales/bg-BG/agent.json b/locales/bg-BG/agent.jsonindex 6f0388aab04..28157d490b9 100644--- a/locales/bg-BG/agent.json+++ b/locales/bg-BG/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Поставете вашия токен на бота тук","channel.charLimit": "Ограничение на символите","channel.charLimitHint": "Максимален брой символи на съобщение",+ "channel.comingSoon": "Очаквайте скоро",+ "channel.comingSoonDesc": "Работим върху интеграцията на това в LobeHub. Следете за актуализации.",+ "channel.comingSoonTitle": "Интеграцията на {{name}} идва скоро","channel.concurrency": "Режим на едновременност","channel.concurrencyDebounce": "Забавяне","channel.concurrencyDebounceHint": "Обработва само последното съобщение от серия (по-ранните се игнорират)",@@ -183,6 +186,14 @@"channel.verificationToken": "Токен за проверка","channel.verificationTokenHint": "По избор. Използва се за проверка на източника на събития за уебхук.","channel.verificationTokenPlaceholder": "Поставете вашия токен за проверка тук",+ "channel.watchKeywordInstructionLabel": "Инструкция",+ "channel.watchKeywordInstructionPlaceholder": "напр. Сканирай последната тема и отговори, ако има доклад за грешка, който изисква действие",+ "channel.watchKeywordLabel": "Ключова дума",+ "channel.watchKeywordPlaceholder": "напр. грешка",+ "channel.watchKeywords": "Наблюдавани ключови думи",+ "channel.watchKeywordsAdd": "Добави ключова дума",+ "channel.watchKeywordsEmpty": "Все още няма добавени ключови думи — ботът се активира само при @споменаване или директно съобщение в абонираните канали.",+ "channel.watchKeywordsHint": "Когато съобщение в абониран канал съвпадне с ключова дума, ботът се активира без @споменаване и инструкцията се добавя към съобщението на потребителя преди да бъде изпратено към AI. Без значение от главни/малки букви, съвпадение на цяла дума.","channel.wechat.description": "Свържете този асистент с WeChat чрез iLink Bot за лични и групови чатове.","channel.wechatBotId": "ID на бота","channel.wechatBotIdHint": "Идентификатор на бота, присвоен след оторизация чрез QR код.",diff --git a/locales/bg-BG/plugin.json b/locales/bg-BG/plugin.jsonindex 3a47148504a..7e1b1c17a5a 100644--- a/locales/bg-BG/plugin.json+++ b/locales/bg-BG/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Плъгин","builtins.lobe-agent-management.render.installPlugin.success": "Успешно инсталиран","builtins.lobe-agent-management.title": "Мениджър на агенти",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Анализиране на визуални медии",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} медии",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Анализиране на визуални медии: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Извикай под-агент","builtins.lobe-agent.apiName.callSubAgent.completed": "Под-агент изпратен: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Изпращане на под-агент: ",diff --git a/locales/de-DE/agent.json b/locales/de-DE/agent.jsonindex aede64f0bc8..d31699a5b52 100644--- a/locales/de-DE/agent.json+++ b/locales/de-DE/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Fügen Sie hier Ihr Bot-Token ein","channel.charLimit": "Zeichenlimit","channel.charLimitHint": "Maximale Anzahl von Zeichen pro Nachricht",+ "channel.comingSoon": "Demnächst verfügbar",+ "channel.comingSoonDesc": "Wir arbeiten daran, diese Integration in LobeHub zu bringen. Bleiben Sie dran für Updates.",+ "channel.comingSoonTitle": "{{name}}-Integration kommt bald","channel.concurrency": "Konkurrenzmodus","channel.concurrencyDebounce": "Entprellen","channel.concurrencyDebounceHint": "Nur die letzte Nachricht in einer Serie verarbeiten (frühere werden verworfen)",@@ -183,6 +186,14 @@"channel.verificationToken": "Verifizierungstoken","channel.verificationTokenHint": "Optional. Wird verwendet, um die Quelle von Webhook-Ereignissen zu überprüfen.","channel.verificationTokenPlaceholder": "Fügen Sie hier Ihr Verifizierungstoken ein",+ "channel.watchKeywordInstructionLabel": "Anweisung",+ "channel.watchKeywordInstructionPlaceholder": "z. B. Scannen Sie den aktuellen Thread und antworten Sie, wenn ein umsetzbarer Fehlerbericht vorliegt",+ "channel.watchKeywordLabel": "Schlüsselwort",+ "channel.watchKeywordPlaceholder": "z. B. Fehler",+ "channel.watchKeywords": "Schlüsselwörter überwachen",+ "channel.watchKeywordsAdd": "Schlüsselwort hinzufügen",+ "channel.watchKeywordsEmpty": "Noch keine Schlüsselwörter hinzugefügt — der Bot reagiert nur auf @Erwähnungen oder Direktnachrichten in abonnierten Kanälen.",+ "channel.watchKeywordsHint": "Wenn eine Nachricht in einem abonnierten Kanal mit einem Schlüsselwort übereinstimmt, reagiert der Bot ohne @Erwähnung und die Anweisung wird der Benutzernachricht vorangestellt, bevor sie an die KI gesendet wird. Groß-/Kleinschreibung wird ignoriert, Übereinstimmung ganzer Wörter.","channel.wechat.description": "Verbinden Sie diesen Assistenten mit WeChat über iLink Bot für private und Gruppenchats.","channel.wechatBotId": "Bot-ID","channel.wechatBotIdHint": "Bot-Kennung, die nach der QR-Code-Autorisierung zugewiesen wurde.",diff --git a/locales/de-DE/plugin.json b/locales/de-DE/plugin.jsonindex 66f06328acc..e5c23ac4307 100644--- a/locales/de-DE/plugin.json+++ b/locales/de-DE/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Plugin","builtins.lobe-agent-management.render.installPlugin.success": "Erfolgreich installiert","builtins.lobe-agent-management.title": "Agenten-Manager",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Visuelle Medien analysieren",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} Medien",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Visuelle Medien analysieren: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Sub-Agent aufrufen","builtins.lobe-agent.apiName.callSubAgent.completed": "Sub-Agent entsendet: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Sub-Agent wird entsendet: ",diff --git a/locales/en-US/agent.json b/locales/en-US/agent.jsonindex b3b5b4cf967..dd2aa2864c3 100644--- a/locales/en-US/agent.json+++ b/locales/en-US/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Paste your bot token here","channel.charLimit": "Character Limit","channel.charLimitHint": "Maximum number of characters per message",+ "channel.comingSoon": "Coming Soon",+ "channel.comingSoonDesc": "We are working on bringing this integration to LobeHub. Stay tuned for updates.",+ "channel.comingSoonTitle": "{{name}} integration is coming soon","channel.concurrency": "Concurrency Mode","channel.concurrencyDebounce": "Debounce","channel.concurrencyDebounceHint": "Only process the last message in a burst (earlier ones are dropped)",@@ -183,6 +186,14 @@"channel.verificationToken": "Verification Token","channel.verificationTokenHint": "Optional. Used to verify webhook event source.","channel.verificationTokenPlaceholder": "Paste your verification token here",+ "channel.watchKeywordInstructionLabel": "Instruction",+ "channel.watchKeywordInstructionPlaceholder": "e.g. Scan the recent thread and reply if there is an actionable bug report",+ "channel.watchKeywordLabel": "Keyword",+ "channel.watchKeywordPlaceholder": "e.g. bug",+ "channel.watchKeywords": "Watch Keywords",+ "channel.watchKeywordsAdd": "Add keyword",+ "channel.watchKeywordsEmpty": "No keywords added yet — bot only wakes on @mention or DM in subscribed channels.",+ "channel.watchKeywordsHint": "A keyword match wakes the bot without an @mention; its instruction is prepended to the user message. Whole-word, case-insensitive.","channel.wechat.description": "Connect this assistant to WeChat via iLink Bot for private and group chats.","channel.wechatBotId": "Bot ID","channel.wechatBotIdHint": "Bot identifier assigned after QR code authorization.",diff --git a/locales/en-US/plugin.json b/locales/en-US/plugin.jsonindex cdfbba6e102..a7cb443d97d 100644--- a/locales/en-US/plugin.json+++ b/locales/en-US/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Plugin","builtins.lobe-agent-management.render.installPlugin.success": "Installed successfully","builtins.lobe-agent-management.title": "Agent Manager",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Analyze visual media",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} media",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Analyze visual media: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Call sub-agent","builtins.lobe-agent.apiName.callSubAgent.completed": "Sub-agent dispatched: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Dispatching sub-agent: ",diff --git a/locales/es-ES/agent.json b/locales/es-ES/agent.jsonindex 02c3ea86a44..d77fe7c7121 100644--- a/locales/es-ES/agent.json+++ b/locales/es-ES/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Pega tu token del bot aquí","channel.charLimit": "Límite de caracteres","channel.charLimitHint": "Número máximo de caracteres por mensaje",+ "channel.comingSoon": "Próximamente",+ "channel.comingSoonDesc": "Estamos trabajando para traer esta integración a LobeHub. Mantente atento para más actualizaciones.",+ "channel.comingSoonTitle": "La integración de {{name}} estará disponible próximamente","channel.concurrency": "Modo de Concurrencia","channel.concurrencyDebounce": "Antirrebote","channel.concurrencyDebounceHint": "Procesar solo el último mensaje de una ráfaga (los anteriores se descartan)",@@ -183,6 +186,14 @@"channel.verificationToken": "Token de Verificación","channel.verificationTokenHint": "Opcional. Usado para verificar la fuente de eventos del webhook.","channel.verificationTokenPlaceholder": "Pega tu token de verificación aquí",+ "channel.watchKeywordInstructionLabel": "Instrucción",+ "channel.watchKeywordInstructionPlaceholder": "p. ej., Escanea el hilo reciente y responde si hay un informe de error accionable",+ "channel.watchKeywordLabel": "Palabra clave",+ "channel.watchKeywordPlaceholder": "p. ej., error",+ "channel.watchKeywords": "Palabras clave de vigilancia",+ "channel.watchKeywordsAdd": "Agregar palabra clave",+ "channel.watchKeywordsEmpty": "No se han agregado palabras clave aún — el bot solo se activa con una @mención o un mensaje directo en los canales suscritos.",+ "channel.watchKeywordsHint": "Cuando un mensaje en un canal suscrito coincide con una palabra clave, el bot se activa sin una @mención y la instrucción se antepone al mensaje del usuario antes de enviarlo a la IA. Coincidencia insensible a mayúsculas, de palabra completa.","channel.wechat.description": "Conecta este asistente a WeChat a través de iLink Bot para chats privados y grupales.","channel.wechatBotId": "ID del Bot","channel.wechatBotIdHint": "Identificador del bot asignado tras la autorización mediante código QR.",diff --git a/locales/es-ES/plugin.json b/locales/es-ES/plugin.jsonindex 9992b82facc..bb45e28a488 100644--- a/locales/es-ES/plugin.json+++ b/locales/es-ES/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Complemento","builtins.lobe-agent-management.render.installPlugin.success": "Instalado correctamente","builtins.lobe-agent-management.title": "Gestor de agentes",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Analizar medios visuales",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} medios",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Analizar medios visuales: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Llamar a subagente","builtins.lobe-agent.apiName.callSubAgent.completed": "Subagente enviado: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Enviando subagente: ",diff --git a/locales/fa-IR/agent.json b/locales/fa-IR/agent.jsonindex cfea50b8ac0..e9559f75f53 100644--- a/locales/fa-IR/agent.json+++ b/locales/fa-IR/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "توکن ربات خود را اینجا وارد کنید","channel.charLimit": "محدودیت کاراکتر","channel.charLimitHint": "حداکثر تعداد کاراکترها در هر پیام",+ "channel.comingSoon": "به زودی",+ "channel.comingSoonDesc": "ما در حال کار بر روی اضافه کردن این یکپارچهسازی به LobeHub هستیم. منتظر بهروزرسانیها باشید.",+ "channel.comingSoonTitle": "یکپارچهسازی {{name}} به زودی در دسترس خواهد بود","channel.concurrency": "حالت همزمانی","channel.concurrencyDebounce": "دیبانس","channel.concurrencyDebounceHint": "فقط آخرین پیام در یک سری پردازش میشود (پیامهای قبلی نادیده گرفته میشوند)",@@ -183,6 +186,14 @@"channel.verificationToken": "توکن تأیید","channel.verificationTokenHint": "اختیاری. برای تأیید منبع رویداد وبهوک استفاده میشود.","channel.verificationTokenPlaceholder": "توکن تأیید خود را اینجا وارد کنید",+ "channel.watchKeywordInstructionLabel": "دستورالعمل",+ "channel.watchKeywordInstructionPlaceholder": "مثال: بررسی رشته اخیر و پاسخ دادن در صورت وجود گزارش اشکال قابل اقدام",+ "channel.watchKeywordLabel": "کلمه کلیدی",+ "channel.watchKeywordPlaceholder": "مثال: اشکال",+ "channel.watchKeywords": "کلمات کلیدی نظارت",+ "channel.watchKeywordsAdd": "افزودن کلمه کلیدی",+ "channel.watchKeywordsEmpty": "هنوز هیچ کلمه کلیدی اضافه نشده است — ربات فقط در صورت @mention یا پیام مستقیم در کانالهای مشترک فعال میشود.",+ "channel.watchKeywordsHint": "وقتی پیامی در کانال مشترک با کلمه کلیدی مطابقت داشته باشد، ربات بدون نیاز به @mention فعال میشود و دستورالعمل به پیام کاربر اضافه میشود قبل از ارسال به هوش مصنوعی. حساس به حروف کوچک و بزرگ نیست، مطابقت کلمه کامل.","channel.wechat.description": "این دستیار را از طریق iLink Bot به WeChat متصل کنید برای چتهای خصوصی و گروهی.","channel.wechatBotId": "شناسه ربات","channel.wechatBotIdHint": "شناسه ربات که پس از تأیید کد QR اختصاص داده شده است.",diff --git a/locales/fa-IR/plugin.json b/locales/fa-IR/plugin.jsonindex 2db235fd65c..24707873018 100644--- a/locales/fa-IR/plugin.json+++ b/locales/fa-IR/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "افزونه","builtins.lobe-agent-management.render.installPlugin.success": "با موفقیت نصب شد","builtins.lobe-agent-management.title": "مدیریت نمایندگان",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "تحلیل رسانه بصری",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} رسانه",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "تحلیل رسانه بصری: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "تماس با زیرعامل","builtins.lobe-agent.apiName.callSubAgent.completed": "زیرعامل ارسال شد: ","builtins.lobe-agent.apiName.callSubAgent.loading": "در حال ارسال زیرعامل: ",diff --git a/locales/fr-FR/agent.json b/locales/fr-FR/agent.jsonindex f3e01121ad9..973a86f87c2 100644--- a/locales/fr-FR/agent.json+++ b/locales/fr-FR/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Collez votre jeton de bot ici","channel.charLimit": "Limite de caractères","channel.charLimitHint": "Nombre maximum de caractères par message",+ "channel.comingSoon": "Bientôt disponible",+ "channel.comingSoonDesc": "Nous travaillons à intégrer cette fonctionnalité à LobeHub. Restez à l'écoute pour les mises à jour.",+ "channel.comingSoonTitle": "L'intégration de {{name}} arrive bientôt","channel.concurrency": "Mode de Concurrence","channel.concurrencyDebounce": "Anti-rebond","channel.concurrencyDebounceHint": "Ne traiter que le dernier message d’une rafale (les précédents sont ignorés)",@@ -183,6 +186,14 @@"channel.verificationToken": "Jeton de vérification","channel.verificationTokenHint": "Optionnel. Utilisé pour vérifier la source des événements webhook.","channel.verificationTokenPlaceholder": "Collez votre jeton de vérification ici",+ "channel.watchKeywordInstructionLabel": "Instruction",+ "channel.watchKeywordInstructionPlaceholder": "par exemple, analyser le fil récent et répondre s'il y a un rapport de bug exploitable",+ "channel.watchKeywordLabel": "Mot-clé",+ "channel.watchKeywordPlaceholder": "par exemple, bug",+ "channel.watchKeywords": "Mots-clés surveillés",+ "channel.watchKeywordsAdd": "Ajouter un mot-clé",+ "channel.watchKeywordsEmpty": "Aucun mot-clé ajouté pour le moment — le bot ne s'active que sur mention @ ou message direct dans les canaux abonnés.",+ "channel.watchKeywordsHint": "Lorsqu'un message dans un canal abonné correspond à un mot-clé, le bot s'active sans mention @ et l'instruction est ajoutée au message utilisateur avant qu'il ne soit envoyé à l'IA. Correspondance insensible à la casse, mot entier.","channel.wechat.description": "Connectez cet assistant à WeChat via iLink Bot pour des chats privés et de groupe.","channel.wechatBotId": "ID du Bot","channel.wechatBotIdHint": "Identifiant du bot attribué après l'autorisation par code QR.",diff --git a/locales/fr-FR/plugin.json b/locales/fr-FR/plugin.jsonindex 66b0600b1f3..80313237909 100644--- a/locales/fr-FR/plugin.json+++ b/locales/fr-FR/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Plugin","builtins.lobe-agent-management.render.installPlugin.success": "Installé avec succès","builtins.lobe-agent-management.title": "Gestionnaire d'agents",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Analyser les médias visuels",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} média(s)",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Analyser les médias visuels : <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Appeler un sous-agent","builtins.lobe-agent.apiName.callSubAgent.completed": "Sous-agent envoyé : ","builtins.lobe-agent.apiName.callSubAgent.loading": "Envoi du sous-agent : ",diff --git a/locales/it-IT/agent.json b/locales/it-IT/agent.jsonindex 61edd0bb956..a0fac8dd8f9 100644--- a/locales/it-IT/agent.json+++ b/locales/it-IT/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Incolla qui il token del tuo bot","channel.charLimit": "Limite di caratteri","channel.charLimitHint": "Numero massimo di caratteri per messaggio",+ "channel.comingSoon": "Prossimamente",+ "channel.comingSoonDesc": "Stiamo lavorando per portare questa integrazione su LobeHub. Resta sintonizzato per gli aggiornamenti.",+ "channel.comingSoonTitle": "L'integrazione di {{name}} arriverà presto","channel.concurrency": "Modalità Concorrenza","channel.concurrencyDebounce": "Debounce","channel.concurrencyDebounceHint": "Elabora solo l’ultimo messaggio in una raffica (i precedenti vengono ignorati)",@@ -183,6 +186,14 @@"channel.verificationToken": "Token di Verifica","channel.verificationTokenHint": "Opzionale. Utilizzato per verificare la sorgente degli eventi webhook.","channel.verificationTokenPlaceholder": "Incolla qui il tuo token di verifica",+ "channel.watchKeywordInstructionLabel": "Istruzione",+ "channel.watchKeywordInstructionPlaceholder": "es. Scansiona il thread recente e rispondi se c'è un rapporto di bug attuabile",+ "channel.watchKeywordLabel": "Parola chiave",+ "channel.watchKeywordPlaceholder": "es. bug",+ "channel.watchKeywords": "Parole chiave da monitorare",+ "channel.watchKeywordsAdd": "Aggiungi parola chiave",+ "channel.watchKeywordsEmpty": "Nessuna parola chiave aggiunta — il bot si attiva solo con @mention o DM nei canali sottoscritti.",+ "channel.watchKeywordsHint": "Quando un messaggio in un canale sottoscritto corrisponde a una parola chiave, il bot si attiva senza un @mention e l'istruzione viene anteposta al messaggio dell'utente prima di essere inviato all'AI. Corrispondenza insensibile alla maiuscola/minuscola, parola intera.","channel.wechat.description": "Connetti questo assistente a WeChat tramite iLink Bot per chat private e di gruppo.","channel.wechatBotId": "ID Bot","channel.wechatBotIdHint": "Identificativo del bot assegnato dopo l'autorizzazione tramite codice QR.",diff --git a/locales/it-IT/plugin.json b/locales/it-IT/plugin.jsonindex bdaf94ca990..ee26e37f3be 100644--- a/locales/it-IT/plugin.json+++ b/locales/it-IT/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Plugin","builtins.lobe-agent-management.render.installPlugin.success": "Installato con successo","builtins.lobe-agent-management.title": "Gestore Agenti",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Analizza i media visivi",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} media",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Analizza i media visivi: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Chiama sub-agente","builtins.lobe-agent.apiName.callSubAgent.completed": "Sub-agente inviato: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Invio sub-agente: ",diff --git a/locales/ja-JP/agent.json b/locales/ja-JP/agent.jsonindex 3fde0b588ff..81849948e2b 100644--- a/locales/ja-JP/agent.json+++ b/locales/ja-JP/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "ここにボットトークンを貼り付けてください","channel.charLimit": "文字数制限","channel.charLimitHint": "メッセージごとの最大文字数",+ "channel.comingSoon": "近日公開",+ "channel.comingSoonDesc": "この統合をLobeHubに導入するために作業を進めています。更新情報をお待ちください。",+ "channel.comingSoonTitle": "{{name}}の統合が近日公開予定です","channel.concurrency": "同時実行モード","channel.concurrencyDebounce": "デバウンス","channel.concurrencyDebounceHint": "連続したメッセージの最後のものだけを処理します(それ以前は破棄)",@@ -183,6 +186,14 @@"channel.verificationToken": "検証トークン","channel.verificationTokenHint": "任意。Webhookイベントソースを検証するために使用されます。","channel.verificationTokenPlaceholder": "ここに検証トークンを貼り付けてください",+ "channel.watchKeywordInstructionLabel": "指示",+ "channel.watchKeywordInstructionPlaceholder": "例: 最近のスレッドをスキャンし、実行可能なバグ報告があれば返信する",+ "channel.watchKeywordLabel": "キーワード",+ "channel.watchKeywordPlaceholder": "例: バグ",+ "channel.watchKeywords": "監視キーワード",+ "channel.watchKeywordsAdd": "キーワードを追加",+ "channel.watchKeywordsEmpty": "まだキーワードが追加されていません — ボットはサブスクライブされたチャンネルで@メンションまたはDMがある場合のみ起動します。",+ "channel.watchKeywordsHint": "サブスクライブされたチャンネルのメッセージがキーワードに一致すると、ボットは@メンションなしで起動し、指示がユーザーメッセージに追加されてAIに送信されます。大文字小文字を区別せず、完全一致で検索します。","channel.wechat.description": "このアシスタントをiLink Botを介してWeChatに接続し、プライベートおよびグループチャットを行います。","channel.wechatBotId": "ボットID","channel.wechatBotIdHint": "QRコード認証後に割り当てられるボット識別子。",diff --git a/locales/ja-JP/plugin.json b/locales/ja-JP/plugin.jsonindex bbc1ac9f6f3..d826bb4b1d4 100644--- a/locales/ja-JP/plugin.json+++ b/locales/ja-JP/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "プラグイン","builtins.lobe-agent-management.render.installPlugin.success": "インストールが完了しました","builtins.lobe-agent-management.title": "エージェントマネージャー",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "視覚メディアを分析する",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} メディア",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "視覚メディアを分析する: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "サブエージェントを呼び出す","builtins.lobe-agent.apiName.callSubAgent.completed": "サブエージェントが派遣されました: ","builtins.lobe-agent.apiName.callSubAgent.loading": "サブエージェントを派遣中: ",diff --git a/locales/ko-KR/agent.json b/locales/ko-KR/agent.jsonindex acdc887bc1e..56d3d5057a2 100644--- a/locales/ko-KR/agent.json+++ b/locales/ko-KR/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "여기에 봇 토큰을 붙여넣으세요","channel.charLimit": "문자 제한","channel.charLimitHint": "메시지당 최대 문자 수",+ "channel.comingSoon": "곧 출시 예정",+ "channel.comingSoonDesc": "이 통합을 LobeHub에 제공하기 위해 작업 중입니다. 업데이트를 기대해주세요.",+ "channel.comingSoonTitle": "{{name}} 통합이 곧 출시됩니다","channel.concurrency": "동시성 모드","channel.concurrencyDebounce": "디바운스","channel.concurrencyDebounceHint": "빠르게 연속된 메시지 중 마지막 메시지만 처리합니다(이전 메시지는 무시됨).",@@ -183,6 +186,14 @@"channel.verificationToken": "검증 토큰","channel.verificationTokenHint": "선택 사항. 웹훅 이벤트 소스를 검증하는 데 사용됩니다.","channel.verificationTokenPlaceholder": "여기에 검증 토큰을 붙여넣으세요",+ "channel.watchKeywordInstructionLabel": "지침",+ "channel.watchKeywordInstructionPlaceholder": "예: 최근 스레드를 스캔하고 실행 가능한 버그 보고서가 있으면 답변하세요",+ "channel.watchKeywordLabel": "키워드",+ "channel.watchKeywordPlaceholder": "예: 버그",+ "channel.watchKeywords": "키워드 감시",+ "channel.watchKeywordsAdd": "키워드 추가",+ "channel.watchKeywordsEmpty": "아직 키워드가 추가되지 않았습니다 — 봇은 구독된 채널에서 @멘션 또는 DM이 있을 때만 활성화됩니다.",+ "channel.watchKeywordsHint": "구독된 채널 메시지가 키워드와 일치하면 봇은 @멘션 없이 활성화되며, 지침이 사용자 메시지 앞에 추가되어 AI로 전송됩니다. 대소문자 구분 없이 전체 단어 일치.","channel.wechat.description": "iLink Bot을 통해 이 어시스턴트를 WeChat에 연결하여 개인 및 그룹 채팅을 지원합니다.","channel.wechatBotId": "봇 ID","channel.wechatBotIdHint": "QR 코드 인증 후 할당된 봇 식별자입니다.",diff --git a/locales/ko-KR/plugin.json b/locales/ko-KR/plugin.jsonindex 470c2953639..e0c1adb65a8 100644--- a/locales/ko-KR/plugin.json+++ b/locales/ko-KR/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "플러그인","builtins.lobe-agent-management.render.installPlugin.success": "설치 완료","builtins.lobe-agent-management.title": "에이전트 관리자",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "시각적 미디어 분석",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} 미디어",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "시각적 미디어 분석: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "하위 에이전트 호출","builtins.lobe-agent.apiName.callSubAgent.completed": "하위 에이전트 배치 완료: ","builtins.lobe-agent.apiName.callSubAgent.loading": "하위 에이전트 배치 중: ",diff --git a/locales/nl-NL/agent.json b/locales/nl-NL/agent.jsonindex a9e4ffdca5e..35c9c6c7634 100644--- a/locales/nl-NL/agent.json+++ b/locales/nl-NL/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Plak hier uw bot-token","channel.charLimit": "Tekenlimiet","channel.charLimitHint": "Maximaal aantal tekens per bericht",+ "channel.comingSoon": "Binnenkort Beschikbaar",+ "channel.comingSoonDesc": "We werken eraan om deze integratie naar LobeHub te brengen. Blijf op de hoogte voor updates.",+ "channel.comingSoonTitle": "{{name}} integratie komt binnenkort beschikbaar","channel.concurrency": "Concurrentie Modus","channel.concurrencyDebounce": "Debounce","channel.concurrencyDebounceHint": "Alleen het laatste bericht in een reeks verwerken (eerdere worden genegeerd)",@@ -183,6 +186,14 @@"channel.verificationToken": "Verificatietoken","channel.verificationTokenHint": "Optioneel. Gebruikt om de bron van webhookgebeurtenissen te verifiëren.","channel.verificationTokenPlaceholder": "Plak hier uw verificatietoken",+ "channel.watchKeywordInstructionLabel": "Instructie",+ "channel.watchKeywordInstructionPlaceholder": "bijv. Scan de recente thread en reageer als er een uitvoerbaar bugrapport is",+ "channel.watchKeywordLabel": "Trefwoord",+ "channel.watchKeywordPlaceholder": "bijv. bug",+ "channel.watchKeywords": "Trefwoorden volgen",+ "channel.watchKeywordsAdd": "Trefwoord toevoegen",+ "channel.watchKeywordsEmpty": "Nog geen trefwoorden toegevoegd — bot wordt alleen geactiveerd bij @mention of DM in geabonneerde kanalen.",+ "channel.watchKeywordsHint": "Wanneer een bericht in een geabonneerd kanaal overeenkomt met een trefwoord, wordt de bot geactiveerd zonder een @mention en wordt de instructie toegevoegd aan het gebruikersbericht voordat het naar de AI wordt verzonden. Hoofdletterongevoelig, hele-woord match.","channel.wechat.description": "Verbind deze assistent met WeChat via iLink Bot voor privé- en groepschats.","channel.wechatBotId": "Bot-ID","channel.wechatBotIdHint": "Bot-identificatie toegewezen na QR-code autorisatie.",diff --git a/locales/nl-NL/plugin.json b/locales/nl-NL/plugin.jsonindex 49a7cc01e36..4dbd40a23e5 100644--- a/locales/nl-NL/plugin.json+++ b/locales/nl-NL/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Plugin","builtins.lobe-agent-management.render.installPlugin.success": "Succesvol geïnstalleerd","builtins.lobe-agent-management.title": "Agentbeheer",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Analyseer visuele media",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} media",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Analyseer visuele media: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Roep sub-agent aan","builtins.lobe-agent.apiName.callSubAgent.completed": "Sub-agent verzonden: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Sub-agent verzenden: ",diff --git a/locales/pl-PL/agent.json b/locales/pl-PL/agent.jsonindex aba2207f8d7..66f118fc92c 100644--- a/locales/pl-PL/agent.json+++ b/locales/pl-PL/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Wklej tutaj token bota","channel.charLimit": "Limit znaków","channel.charLimitHint": "Maksymalna liczba znaków na wiadomość",+ "channel.comingSoon": "Już wkrótce",+ "channel.comingSoonDesc": "Pracujemy nad wprowadzeniem tej integracji do LobeHub. Śledź nasze aktualizacje.",+ "channel.comingSoonTitle": "Integracja {{name}} już wkrótce","channel.concurrency": "Tryb współbieżności","channel.concurrencyDebounce": "Debounce","channel.concurrencyDebounceHint": "Przetwarzaj tylko ostatnią wiadomość z serii (wcześniejsze są pomijane)",@@ -183,6 +186,14 @@"channel.verificationToken": "Token weryfikacyjny","channel.verificationTokenHint": "Opcjonalne. Używane do weryfikacji źródła zdarzeń webhook.","channel.verificationTokenPlaceholder": "Wklej tutaj token weryfikacyjny",+ "channel.watchKeywordInstructionLabel": "Instrukcja",+ "channel.watchKeywordInstructionPlaceholder": "np. Przeskanuj ostatni wątek i odpowiedz, jeśli jest zgłoszenie błędu wymagające działania",+ "channel.watchKeywordLabel": "Słowo kluczowe",+ "channel.watchKeywordPlaceholder": "np. błąd",+ "channel.watchKeywords": "Obserwowane słowa kluczowe",+ "channel.watchKeywordsAdd": "Dodaj słowo kluczowe",+ "channel.watchKeywordsEmpty": "Nie dodano jeszcze żadnych słów kluczowych — bot budzi się tylko przy @wzmiance lub wiadomości prywatnej w subskrybowanych kanałach.",+ "channel.watchKeywordsHint": "Gdy wiadomość w subskrybowanym kanale pasuje do słowa kluczowego, bot budzi się bez @wzmianki, a instrukcja jest dodawana do wiadomości użytkownika przed jej wysłaniem do AI. Dopasowanie jest niewrażliwe na wielkość liter i dotyczy całych słów.","channel.wechat.description": "Połącz tego asystenta z WeChat za pomocą iLink Bot do prywatnych i grupowych rozmów.","channel.wechatBotId": "ID bota","channel.wechatBotIdHint": "Identyfikator bota przypisany po autoryzacji kodem QR.",diff --git a/locales/pl-PL/plugin.json b/locales/pl-PL/plugin.jsonindex 79757d98c33..9324ac8db28 100644--- a/locales/pl-PL/plugin.json+++ b/locales/pl-PL/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Wtyczka","builtins.lobe-agent-management.render.installPlugin.success": "Pomyślnie zainstalowano","builtins.lobe-agent-management.title": "Menedżer Agentów",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Analizuj media wizualne",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} media",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Analizuj media wizualne: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Wezwij pod-agent","builtins.lobe-agent.apiName.callSubAgent.completed": "Pod-agent wysłany: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Wysyłanie pod-agenta: ",diff --git a/locales/pt-BR/agent.json b/locales/pt-BR/agent.jsonindex 49dce11c59d..aad330d5924 100644--- a/locales/pt-BR/agent.json+++ b/locales/pt-BR/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Cole o token do seu bot aqui","channel.charLimit": "Limite de Caracteres","channel.charLimitHint": "Número máximo de caracteres por mensagem",+ "channel.comingSoon": "Em Breve",+ "channel.comingSoonDesc": "Estamos trabalhando para trazer esta integração para o LobeHub. Fique atento para atualizações.",+ "channel.comingSoonTitle": "A integração {{name}} está chegando em breve","channel.concurrency": "Modo de Concorrência","channel.concurrencyDebounce": "Debounce","channel.concurrencyDebounceHint": "Processar apenas a última mensagem em uma sequência rápida (as anteriores serão descartadas)",@@ -183,6 +186,14 @@"channel.verificationToken": "Token de Verificação","channel.verificationTokenHint": "Opcional. Usado para verificar a origem do evento de webhook.","channel.verificationTokenPlaceholder": "Cole seu token de verificação aqui",+ "channel.watchKeywordInstructionLabel": "Instrução",+ "channel.watchKeywordInstructionPlaceholder": "ex.: Escaneie a conversa recente e responda se houver um relatório de bug acionável",+ "channel.watchKeywordLabel": "Palavra-chave",+ "channel.watchKeywordPlaceholder": "ex.: bug",+ "channel.watchKeywords": "Palavras-chave de Monitoramento",+ "channel.watchKeywordsAdd": "Adicionar palavra-chave",+ "channel.watchKeywordsEmpty": "Nenhuma palavra-chave adicionada ainda — o bot só será ativado por @menção ou mensagem direta em canais inscritos.",+ "channel.watchKeywordsHint": "Quando uma mensagem em um canal inscrito corresponder a uma palavra-chave, o bot será ativado sem @menção e a instrução será adicionada à mensagem do usuário antes de ser enviada à IA. Correspondência insensível a maiúsculas/minúsculas e de palavra inteira.","channel.wechat.description": "Conecte este assistente ao WeChat via iLink Bot para chats privados e em grupo.","channel.wechatBotId": "ID do Bot","channel.wechatBotIdHint": "Identificador do bot atribuído após a autorização via código QR.",diff --git a/locales/pt-BR/plugin.json b/locales/pt-BR/plugin.jsonindex 577f86dfbe6..3d82d3c1cc8 100644--- a/locales/pt-BR/plugin.json+++ b/locales/pt-BR/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Plugin","builtins.lobe-agent-management.render.installPlugin.success": "Instalado com sucesso","builtins.lobe-agent-management.title": "Gerenciador de Agentes",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Analisar mídia visual",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} mídias",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Analisar mídia visual: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Chamar subagente","builtins.lobe-agent.apiName.callSubAgent.completed": "Subagente enviado: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Enviando subagente: ",diff --git a/locales/ru-RU/agent.json b/locales/ru-RU/agent.jsonindex f0c3436d94f..afb5422521b 100644--- a/locales/ru-RU/agent.json+++ b/locales/ru-RU/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Вставьте токен вашего бота здесь","channel.charLimit": "Ограничение символов","channel.charLimitHint": "Максимальное количество символов в сообщении",+ "channel.comingSoon": "Скоро будет",+ "channel.comingSoonDesc": "Мы работаем над добавлением этой интеграции в LobeHub. Следите за обновлениями.",+ "channel.comingSoonTitle": "Интеграция {{name}} скоро будет доступна","channel.concurrency": "Режим параллельности","channel.concurrencyDebounce": "Дебаунс","channel.concurrencyDebounceHint": "Обрабатывать только последнее сообщение в серии (предыдущие будут отброшены)",@@ -183,6 +186,14 @@"channel.verificationToken": "Токен проверки","channel.verificationTokenHint": "Необязательно. Используется для проверки источника событий вебхука.","channel.verificationTokenPlaceholder": "Вставьте ваш токен проверки здесь",+ "channel.watchKeywordInstructionLabel": "Инструкция",+ "channel.watchKeywordInstructionPlaceholder": "например, Просканируйте недавнюю ветку и ответьте, если есть отчет об ошибке, требующий действий",+ "channel.watchKeywordLabel": "Ключевое слово",+ "channel.watchKeywordPlaceholder": "например, ошибка",+ "channel.watchKeywords": "Отслеживаемые ключевые слова",+ "channel.watchKeywordsAdd": "Добавить ключевое слово",+ "channel.watchKeywordsEmpty": "Ключевые слова еще не добавлены — бот активируется только при упоминании @ или в личных сообщениях в подписанных каналах.",+ "channel.watchKeywordsHint": "Когда сообщение в подписанном канале совпадает с ключевым словом, бот активируется без упоминания @, и инструкция добавляется к сообщению пользователя перед отправкой в ИИ. Регистр не учитывается, совпадение по целому слову.","channel.wechat.description": "Подключите этого помощника к WeChat через iLink Bot для частных и групповых чатов.","channel.wechatBotId": "ID бота","channel.wechatBotIdHint": "Идентификатор бота, назначенный после авторизации через QR-код.",diff --git a/locales/ru-RU/plugin.json b/locales/ru-RU/plugin.jsonindex ee64662aa66..fe2a44083a9 100644--- a/locales/ru-RU/plugin.json+++ b/locales/ru-RU/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Плагин","builtins.lobe-agent-management.render.installPlugin.success": "Успешно установлено","builtins.lobe-agent-management.title": "Менеджер агентов",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Анализировать визуальные медиа",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} медиа",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Анализировать визуальные медиа: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Вызвать суб-агента","builtins.lobe-agent.apiName.callSubAgent.completed": "Суб-агент отправлен: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Отправка суб-агента: ",diff --git a/locales/tr-TR/agent.json b/locales/tr-TR/agent.jsonindex c4c5240ad6d..beabce056cf 100644--- a/locales/tr-TR/agent.json+++ b/locales/tr-TR/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Bot tokeninizi buraya yapıştırın","channel.charLimit": "Karakter Sınırı","channel.charLimitHint": "Mesaj başına maksimum karakter sayısı",+ "channel.comingSoon": "Çok Yakında",+ "channel.comingSoonDesc": "Bu entegrasyonu LobeHub'a getirmek için çalışıyoruz. Güncellemeler için bizi takip edin.",+ "channel.comingSoonTitle": "{{name}} entegrasyonu çok yakında geliyor","channel.concurrency": "Eşzamanlılık Modu","channel.concurrencyDebounce": "Debounce","channel.concurrencyDebounceHint": "Bir patlamadaki yalnızca son mesajı işle (öncekiler yok sayılır)",@@ -183,6 +186,14 @@"channel.verificationToken": "Doğrulama Token","channel.verificationTokenHint": "Opsiyonel. Webhook olay kaynağını doğrulamak için kullanılır.","channel.verificationTokenPlaceholder": "Doğrulama tokeninizi buraya yapıştırın",+ "channel.watchKeywordInstructionLabel": "Talimat",+ "channel.watchKeywordInstructionPlaceholder": "ör. Son konuyu tarayın ve eyleme geçirilebilir bir hata raporu varsa yanıtlayın",+ "channel.watchKeywordLabel": "Anahtar Kelime",+ "channel.watchKeywordPlaceholder": "ör. hata",+ "channel.watchKeywords": "Anahtar Kelimeleri İzle",+ "channel.watchKeywordsAdd": "Anahtar kelime ekle",+ "channel.watchKeywordsEmpty": "Henüz anahtar kelime eklenmedi — bot yalnızca abone olunan kanallarda @bahsetme veya DM ile uyanır.",+ "channel.watchKeywordsHint": "Abone olunan bir kanal mesajı bir anahtar kelimeyle eşleştiğinde, bot @bahsetme olmadan uyanır ve talimat, kullanıcı mesajına eklenerek AI'ye gönderilir. Büyük/küçük harf duyarsız, tam kelime eşleşmesi.","channel.wechat.description": "Bu asistanı özel ve grup sohbetleri için iLink Bot aracılığıyla WeChat'e bağlayın.","channel.wechatBotId": "Bot Kimliği","channel.wechatBotIdHint": "QR kodu yetkilendirmesinden sonra atanan bot tanımlayıcısı.",diff --git a/locales/tr-TR/plugin.json b/locales/tr-TR/plugin.jsonindex d8dda73da46..ed8761288fd 100644--- a/locales/tr-TR/plugin.json+++ b/locales/tr-TR/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Eklenti","builtins.lobe-agent-management.render.installPlugin.success": "Başarıyla yüklendi","builtins.lobe-agent-management.title": "Temsilci Yöneticisi",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Görsel medyayı analiz et",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} medya",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Görsel medyayı analiz et: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Alt ajanı çağır","builtins.lobe-agent.apiName.callSubAgent.completed": "Alt ajan gönderildi: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Alt ajan gönderiliyor: ",diff --git a/locales/vi-VN/agent.json b/locales/vi-VN/agent.jsonindex e4a9ab5f6ac..b74e0b0831d 100644--- a/locales/vi-VN/agent.json+++ b/locales/vi-VN/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "Dán mã bot của bạn vào đây","channel.charLimit": "Giới hạn ký tự","channel.charLimitHint": "Số ký tự tối đa cho mỗi tin nhắn",+ "channel.comingSoon": "Sắp ra mắt",+ "channel.comingSoonDesc": "Chúng tôi đang làm việc để mang tích hợp này đến LobeHub. Hãy chờ đợi các cập nhật.",+ "channel.comingSoonTitle": "Tích hợp {{name}} sắp ra mắt","channel.concurrency": "Chế độ Đồng thời","channel.concurrencyDebounce": "Giảm chấn","channel.concurrencyDebounceHint": "Chỉ xử lý tin nhắn cuối cùng trong một chuỗi (các tin nhắn trước bị bỏ qua)",@@ -183,6 +186,14 @@"channel.verificationToken": "Mã xác minh","channel.verificationTokenHint": "Tùy chọn. Dùng để xác minh nguồn sự kiện webhook.","channel.verificationTokenPlaceholder": "Dán mã xác minh của bạn vào đây",+ "channel.watchKeywordInstructionLabel": "Hướng dẫn",+ "channel.watchKeywordInstructionPlaceholder": "ví dụ: Quét các luồng gần đây và trả lời nếu có báo cáo lỗi có thể hành động",+ "channel.watchKeywordLabel": "Từ khóa",+ "channel.watchKeywordPlaceholder": "ví dụ: lỗi",+ "channel.watchKeywords": "Theo dõi Từ khóa",+ "channel.watchKeywordsAdd": "Thêm từ khóa",+ "channel.watchKeywordsEmpty": "Chưa có từ khóa nào được thêm — bot chỉ hoạt động khi được @mention hoặc tin nhắn trực tiếp trong các kênh đã đăng ký.",+ "channel.watchKeywordsHint": "Khi một tin nhắn trong kênh đã đăng ký khớp với từ khóa, bot sẽ hoạt động mà không cần @mention và hướng dẫn sẽ được thêm vào trước tin nhắn của người dùng trước khi gửi đến AI. Không phân biệt chữ hoa chữ thường, khớp từ nguyên.","channel.wechat.description": "Kết nối trợ lý này với WeChat qua iLink Bot để trò chuyện riêng tư và nhóm.","channel.wechatBotId": "ID Bot","channel.wechatBotIdHint": "Định danh bot được cấp sau khi ủy quyền mã QR.",diff --git a/locales/vi-VN/plugin.json b/locales/vi-VN/plugin.jsonindex e02b864b1b7..15ef49cc243 100644--- a/locales/vi-VN/plugin.json+++ b/locales/vi-VN/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "Plugin","builtins.lobe-agent-management.render.installPlugin.success": "Cài đặt thành công","builtins.lobe-agent-management.title": "Quản lý Đại lý",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "Phân tích phương tiện trực quan",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} phương tiện",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "Phân tích phương tiện trực quan: <question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "Gọi tác nhân phụ","builtins.lobe-agent.apiName.callSubAgent.completed": "Tác nhân phụ đã được gửi: ","builtins.lobe-agent.apiName.callSubAgent.loading": "Đang gửi tác nhân phụ: ",diff --git a/locales/zh-CN/agent.json b/locales/zh-CN/agent.jsonindex 553ac0a9750..0d185a0fe2e 100644--- a/locales/zh-CN/agent.json+++ b/locales/zh-CN/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "在此粘贴你的 Bot Token","channel.charLimit": "字符限制","channel.charLimitHint": "单条消息的最大字符数",+ "channel.comingSoon": "即将上线",+ "channel.comingSoonDesc": "我们正在为 LobeHub 接入该平台,敬请期待。",+ "channel.comingSoonTitle": "{{name}} 集成即将上线","channel.concurrency": "并发模式","channel.concurrencyDebounce": "防抖","channel.concurrencyDebounceHint": "仅处理连续消息中的最后一条,前序消息会被丢弃",@@ -183,6 +186,14 @@"channel.verificationToken": "Verification Token","channel.verificationTokenHint": "可选。用于验证事件推送来源。","channel.verificationTokenPlaceholder": "在此粘贴你的 Verification Token",+ "channel.watchKeywordInstructionLabel": "指令",+ "channel.watchKeywordInstructionPlaceholder": "如 浏览近期消息,若发现可处理的 bug 报告则回复",+ "channel.watchKeywordLabel": "关键词",+ "channel.watchKeywordPlaceholder": "如 bug",+ "channel.watchKeywords": "监听关键词",+ "channel.watchKeywordsAdd": "添加关键词",+ "channel.watchKeywordsEmpty": "暂未配置关键词——已订阅频道里仅响应 @ 或私信。",+ "channel.watchKeywordsHint": "命中关键词即唤醒机器人,无需 @;指令会拼到用户消息前再发给 AI。整词匹配,不区分大小写。","channel.wechat.description": "通过 iLink Bot 将助手连接到微信,支持私聊和群聊。","channel.wechatBotId": "机器人 ID","channel.wechatBotIdHint": "通过二维码授权后分配的机器人标识符。",diff --git a/locales/zh-CN/plugin.json b/locales/zh-CN/plugin.jsonindex bb615711ba6..664656aa1ae 100644--- a/locales/zh-CN/plugin.json+++ b/locales/zh-CN/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "插件","builtins.lobe-agent-management.render.installPlugin.success": "安装成功","builtins.lobe-agent-management.title": "代理管理器",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "分析视觉媒体",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} 个媒体",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "分析视觉媒体:<question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "调用子代理","builtins.lobe-agent.apiName.callSubAgent.completed": "已派发子代理:","builtins.lobe-agent.apiName.callSubAgent.loading": "正在派发子代理:",diff --git a/locales/zh-TW/agent.json b/locales/zh-TW/agent.jsonindex d3170363110..12c0a91a8a6 100644--- a/locales/zh-TW/agent.json+++ b/locales/zh-TW/agent.json@@ -21,6 +21,9 @@"channel.botTokenPlaceholderNew": "在此貼上您的機器人令牌","channel.charLimit": "字元限制","channel.charLimitHint": "每則訊息的最大字元數",+ "channel.comingSoon": "即將推出",+ "channel.comingSoonDesc": "我們正在努力將此整合帶到 LobeHub。敬請期待更新。",+ "channel.comingSoonTitle": "{{name}} 整合即將推出","channel.concurrency": "併發模式","channel.concurrencyDebounce": "防抖","channel.concurrencyDebounceHint": "僅處理突發訊息中的最後一則(較早的會被忽略)",@@ -183,6 +186,14 @@"channel.verificationToken": "驗證令牌","channel.verificationTokenHint": "可選。用於驗證 Webhook 事件來源。","channel.verificationTokenPlaceholder": "在此貼上您的驗證令牌",+ "channel.watchKeywordInstructionLabel": "指示",+ "channel.watchKeywordInstructionPlaceholder": "例如:掃描最近的討論串,並在有可操作的錯誤報告時回覆",+ "channel.watchKeywordLabel": "關鍵字",+ "channel.watchKeywordPlaceholder": "例如:錯誤",+ "channel.watchKeywords": "監控關鍵字",+ "channel.watchKeywordsAdd": "新增關鍵字",+ "channel.watchKeywordsEmpty": "尚未新增任何關鍵字 — 機器人僅在訂閱頻道中被@提及或收到私訊時啟動。",+ "channel.watchKeywordsHint": "當訂閱頻道中的訊息符合關鍵字時,機器人會在未被@提及的情況下啟動,並將指示附加到用戶訊息前再發送給AI。不區分大小寫,完整詞匹配。","channel.wechat.description": "透過 iLink Bot 將此助手連接到微信,以進行私人和群組聊天。","channel.wechatBotId": "機器人 ID","channel.wechatBotIdHint": "通過二維碼授權後分配的機器人標識符。",diff --git a/locales/zh-TW/plugin.json b/locales/zh-TW/plugin.jsonindex eefb5f6581c..ddba5948d9a 100644--- a/locales/zh-TW/plugin.json+++ b/locales/zh-TW/plugin.json@@ -69,6 +69,9 @@"builtins.lobe-agent-management.render.installPlugin.plugin": "外掛","builtins.lobe-agent-management.render.installPlugin.success": "安裝成功","builtins.lobe-agent-management.title": "代理管理器",+ "builtins.lobe-agent.apiName.analyzeVisualMedia": "分析視覺媒體",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.mediaCount": "{{count}} 媒體",+ "builtins.lobe-agent.apiName.analyzeVisualMedia.result": "分析視覺媒體:<question>{{question}}</question>","builtins.lobe-agent.apiName.callSubAgent": "呼叫子代理","builtins.lobe-agent.apiName.callSubAgent.completed": "子代理已派遣:","builtins.lobe-agent.apiName.callSubAgent.loading": "正在派遣子代理:",diff --git a/packages/builtin-tool-message/src/manifest.ts b/packages/builtin-tool-message/src/manifest.tsindex 6adf95a7b49..774dfddaded 100644--- a/packages/builtin-tool-message/src/manifest.ts+++ b/packages/builtin-tool-message/src/manifest.ts@@ -75,6 +75,28 @@ const botSettingsSchema = {"The bot owner's platform user ID. Required when dmPolicy='pairing' (used as approver identity and as an implicit member of allowFrom). Also used to push owner-only notifications.",type: 'string',},+ watchKeywords: {+ description:+ 'Channel-side keyword wake list. When a non-mention message in a non-DM channel contains any of these keywords (case-insensitive, whole-word), the bot wakes without an @mention. If the matched entry has an `instruction`, it is prepended to the user message as an extra prompt before being sent to the AI — so a bare trigger like "bug" can carry a directive ("Scan the recent thread and reply if there is a real bug report"). Empty/absent instructions just wake the bot with the raw user text. Same overwrite-replace semantics as allowFrom — read-modify-write via getBotDetail to add/remove entries.',+ items: {+ additionalProperties: false,+ properties: {+ instruction: {+ description:+ 'Optional operator-authored prompt prepended to the user message when this keyword fires. Omit for "just wake the bot" behaviour.',+ type: 'string',+ },+ keyword: {+ description:+ 'Trigger word. Lowercased and whole-word matched against inbound message text (Latin scripts use ASCII word boundaries; CJK keywords match as substrings since they have no whitespace boundary).',+ type: 'string',+ },+ },+ required: ['keyword'],+ type: 'object',+ },+ type: 'array',+ },},type: 'object',};@@ -683,7 +705,7 @@ export const MessageManifest: BuiltinToolManifest = {settings: {...botSettingsSchema,description:- 'Updated settings (partial update at the key level). See nested field descriptions for the allowed keys (dmPolicy, allowFrom, userId, groupPolicy, groupAllowFrom, serverId).',+ 'Updated settings (partial update at the key level). See nested field descriptions for the allowed keys (dmPolicy, allowFrom, userId, groupPolicy, groupAllowFrom, serverId, watchKeywords).',},},required: ['botId'],diff --git a/packages/builtin-tool-message/src/systemRole.ts b/packages/builtin-tool-message/src/systemRole.tsindex 5b8c4dc2294..832b1b85d67 100644--- a/packages/builtin-tool-message/src/systemRole.ts+++ b/packages/builtin-tool-message/src/systemRole.ts@@ -39,13 +39,24 @@ Typical asks → action:**groupPolicy** + **groupAllowFrom** — same shape but for group/channel/thread traffic. \`groupAllowFrom\` items are channel/group/thread IDs (e.g. Discord channel IDs from "Copy Channel ID"), not user IDs.-**Read-modify-write for allowFrom and groupAllowFrom (CRITICAL):**-Both arrays are written as a whole — passing \`{ allowFrom: [{ id: 'X' }] }\` REPLACES the entire list, not appends. To add or remove a single entry:-1. Call \`getBotDetail(botId)\` and read \`settings.allowFrom\` (it may be missing — treat as \`[]\`).-2. Mutate the array locally (\`push\` to add, \`filter\` to remove). Preserve every existing \`{ id, name }\` you didn't intend to touch.-3. Call \`updateBot({ botId, settings: { allowFrom: [...newArray] } })\`.+**watchKeywords** — channel-side keyword triggers, format \`[{ keyword, instruction? }]\`. When a non-mention message in a subscribed channel contains a \`keyword\` (case-insensitive whole-word for ASCII, substring for CJK), the bot wakes without an @mention; the optional \`instruction\` is prepended to that user message as a prompt prefix before the agent is invoked.-Skipping step 1 will silently wipe other entries. Same workflow applies to \`groupAllowFrom\`.+**The \`instruction\` is a future prompt for your future self — NOT a task to execute now.** When the user says "if X appears in channel, do Y", the right action is: read existing \`settings.watchKeywords\`, upsert \`{ keyword: X, instruction: Y }\`, write the array back. **Do NOT pre-resolve any references the directive mentions** — team names, user handles, channel names, project IDs, status labels, etc. The future-self runs when the keyword fires, in the same channel context with the same tools you have today, and will look those up against fresh data at trigger time. Pre-resolving now bakes IDs that may go stale and turns a 1-tool-call save into a long lookup chain.++Transcribe the user's directive into \`instruction\` faithfully (preserve original language and tone — translating Chinese intent into English just to "look tidy" is wrong). Include only context the future-self can't recover on its own; leave the rest of the resolution to the future trigger.++Typical asks → action:+- "when 'bug' appears in the channel, create an issue in our tracker and assign it to me" → \`getBotDetail\` → append \`{ keyword: 'bug', instruction: '<verbatim user directive in original language>' }\` → \`updateBot({ settings: { watchKeywords: [...newArray] } })\` → acknowledge. **Stop there.** Do not list teams, users, statuses, channels, or any other reference now.+- "stop watching 'bug'" → \`getBotDetail\` → \`filter\` out the entry → \`updateBot\` with the trimmed array.+- "show me the watch keywords" → \`getBotDetail\` → render \`settings.watchKeywords\` (or treat missing as "none configured").++**Read-modify-write for allowFrom / groupAllowFrom / watchKeywords (CRITICAL):**+All three arrays are written as a whole — passing \`{ allowFrom: [{ id: 'X' }] }\` REPLACES the entire list, not appends. To add or remove a single entry:+1. Call \`getBotDetail(botId)\` and read the array (may be missing — treat as \`[]\`).+2. Mutate the array locally (\`push\` to add, \`filter\` to remove). Preserve every existing entry you didn't intend to touch.+3. Call \`updateBot({ botId, settings: { <field>: [...newArray] } })\`.++Skipping step 1 will silently wipe other entries.**Validation behaviour:** the server validates settings before persisting and returns \`updateBot error: <field>: <reason>\` when something fails (e.g. \`userId: Pairing policy requires the owner's Platform User ID.\`). Surface that message to the user and ask for the missing value rather than retrying blindly.</access_policies>diff --git a/src/features/Messenger/index.tsx b/src/features/Messenger/index.tsxindex 949a52eaef3..6312c2109fc 100644--- a/src/features/Messenger/index.tsx+++ b/src/features/Messenger/index.tsx@@ -43,7 +43,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({}));const MessengerSettings = memo(() => {- const { t } = useTranslation('messenger');+ const { t, ready } = useTranslation('messenger');const { message } = App.useApp();const navigate = useNavigate();const params = useParams<{ sub?: string }>();@@ -75,6 +75,10 @@ const MessengerSettings = memo(() => {useEffect(() => {if (typeof window === 'undefined') return;if (!selected) return;+ // Wait for the `messenger` namespace to finish loading; otherwise the+ // imperative toast captures the raw key as its text (useTranslation has+ // `useSuspense: false`, so the component doesn't block on namespace load).+ if (!ready) return;const url = new URL(window.location.href);const installed = url.searchParams.get('installed');const error = url.searchParams.get('error');@@ -107,7 +111,7 @@ const MessengerSettings = memo(() => {url.searchParams.delete('error');url.searchParams.delete('workspace');window.history.replaceState({}, '', url.pathname + (url.search ? `?${url.searchParams}` : ''));- }, [message, t, selected]);+ }, [message, t, selected, ready]);const platforms = platformsSWR.data ?? [];const selectedMeta = platforms.find((p) => p.id === selected);diff --git a/src/locales/default/agent.ts b/src/locales/default/agent.tsindex 9ee2b1653bc..60f9e636135 100644--- a/src/locales/default/agent.ts+++ b/src/locales/default/agent.ts@@ -11,6 +11,10 @@ export default {'channel.botTokenPlaceholderNew': 'Paste your bot token here','channel.connectionConfig': 'Connection Configuration','channel.copied': 'Copied to clipboard',+ 'channel.comingSoon': 'Coming Soon',+ 'channel.comingSoonDesc':+ 'We are working on bringing this integration to LobeHub. Stay tuned for updates.',+ 'channel.comingSoonTitle': '{{name}} integration is coming soon','channel.copy': 'Copy','channel.deleteAllChannels': 'Remove All Channels','channel.deleteAllConfirm': 'Are you sure you want to remove all channels?',@@ -191,6 +195,17 @@ export default {'channel.groupAllowFromAdd': 'Add channel','channel.groupAllowFromEmpty': 'No channels added yet — the bot will not respond anywhere.','channel.allowListRemove': 'Remove',+ 'channel.watchKeywords': 'Watch Keywords',+ 'channel.watchKeywordsHint':+ 'A keyword match wakes the bot without an @mention; its instruction is prepended to the user message. Whole-word, case-insensitive.',+ 'channel.watchKeywordLabel': 'Keyword',+ 'channel.watchKeywordPlaceholder': 'e.g. bug',+ 'channel.watchKeywordInstructionLabel': 'Instruction',+ 'channel.watchKeywordInstructionPlaceholder':+ 'e.g. Scan the recent thread and reply if there is an actionable bug report',+ 'channel.watchKeywordsAdd': 'Add keyword',+ 'channel.watchKeywordsEmpty':+ 'No keywords added yet — bot only wakes on @mention or DM in subscribed channels.','channel.settings': 'Advanced Settings','channel.settingsResetConfirm': 'Are you sure you want to reset advanced settings to default?','channel.settingsResetDefault': 'Reset to Default',diff --git a/src/routes/(main)/agent/channel/const.ts b/src/routes/(main)/agent/channel/const.tsindex b588ed123e4..7b9730bfdc6 100644--- a/src/routes/(main)/agent/channel/const.ts+++ b/src/routes/(main)/agent/channel/const.ts@@ -1,10 +1,13 @@import * as Icons from '@lobehub/ui/icons';import type { FC } from 'react';+import type { SerializedPlatformDefinition } from '@/server/services/bot/platforms/types';+/** Known icon names from @lobehub/ui/icons that correspond to chat platforms. */const ICON_NAMES = ['Discord','GoogleChat',+ 'IMessage','Lark','Line','MicrosoftTeams',@@ -33,3 +36,33 @@ export function getPlatformIcon(nameOrId: string): FC<any> | undefined {);return name ? (Icons as Record<string, any>)[name] : undefined;}++/**+ * Channel platform definition extended with a frontend-only `comingSoon` flag.+ * Coming-soon platforms are virtual: they appear in the sidebar list and show+ * a placeholder detail view, but never participate in credentials/runtime flow.+ */+export interface ChannelPlatformDefinition extends SerializedPlatformDefinition {+ comingSoon?: boolean;+}++/**+ * Virtual platforms shown in the sidebar with a "Coming Soon" badge.+ * Not registered on the server — handled entirely on the client.+ */+export const COMING_SOON_PLATFORMS: ChannelPlatformDefinition[] = [+ {+ comingSoon: true,+ connectionMode: 'webhook',+ id: 'whatsapp',+ name: 'WhatsApp',+ schema: [],+ },+ {+ comingSoon: true,+ connectionMode: 'webhook',+ id: 'imessage',+ name: 'iMessage',+ schema: [],+ },+];diff --git a/src/routes/(main)/agent/channel/detail/ComingSoon.tsx b/src/routes/(main)/agent/channel/detail/ComingSoon.tsxnew file mode 100644index 00000000000..37381c909c0--- /dev/null+++ b/src/routes/(main)/agent/channel/detail/ComingSoon.tsx@@ -0,0 +1,86 @@+'use client';++import { Flexbox, Tag } from '@lobehub/ui';+import { createStaticStyles } from 'antd-style';+import { memo } from 'react';+import { useTranslation } from 'react-i18next';++import type { ChannelPlatformDefinition } from '../const';+import { getPlatformIcon } from '../const';++const styles = createStaticStyles(({ css, cssVar }) => ({+ desc: css`+ max-width: 360px;++ font-size: 14px;+ line-height: 1.6;+ color: ${cssVar.colorTextSecondary};+ text-align: center;+ `,+ header: css`+ width: 100%;+ max-width: 1024px;+ padding-block: 16px;+ border-block-end: 1px solid ${cssVar.colorBorder};+ `,+ main: css`+ position: relative;++ overflow-y: auto;+ display: flex;+ flex: 1;+ flex-direction: column;+ align-items: center;++ padding: 24px;++ background: ${cssVar.colorBgContainer};+ `,+ placeholder: css`+ display: flex;+ flex: 1;+ flex-direction: column;+ gap: 16px;+ align-items: center;+ justify-content: center;++ width: 100%;+ max-width: 1024px;+ padding-block: 48px;+ `,+ title: css`+ font-size: 18px;+ font-weight: 500;+ color: ${cssVar.colorText};+ `,+}));++interface ComingSoonDetailProps {+ platformDef: ChannelPlatformDefinition;+}++const ComingSoonDetail = memo<ComingSoonDetailProps>(({ platformDef }) => {+ const { t } = useTranslation('agent');+ const PlatformIcon = getPlatformIcon(platformDef.name);+ const ColorIcon =+ PlatformIcon && 'Color' in PlatformIcon ? (PlatformIcon as any).Color : PlatformIcon;++ return (+ <main className={styles.main}>+ <Flexbox horizontal align="center" className={styles.header} gap={8}>+ {ColorIcon && <ColorIcon size={32} />}+ {platformDef.name}+ <Tag size={'small'}>{t('channel.comingSoon')}</Tag>+ </Flexbox>+ <div className={styles.placeholder}>+ {ColorIcon && <ColorIcon size={64} />}+ <div className={styles.title}>+ {t('channel.comingSoonTitle', { name: platformDef.name })}+ </div>+ <div className={styles.desc}>{t('channel.comingSoonDesc')}</div>+ </div>+ </main>+ );+});++export default ComingSoonDetail;diff --git a/src/routes/(main)/agent/channel/index.tsx b/src/routes/(main)/agent/channel/index.tsxindex f157460f0a3..fcdba5f2b6f 100644--- a/src/routes/(main)/agent/channel/index.tsx+++ b/src/routes/(main)/agent/channel/index.tsx@@ -10,7 +10,9 @@ import NavHeader from '@/features/NavHeader';import { useAgentStore } from '@/store/agent';import { BOT_RUNTIME_STATUSES, type BotRuntimeStatus } from '../../../../types/botRuntimeStatus';+import { type ChannelPlatformDefinition, COMING_SOON_PLATFORMS } from './const';import PlatformDetail from './detail';+import ComingSoonDetail from './detail/ComingSoon';import PlatformList from './list';const styles = createStaticStyles(({ css }) => ({@@ -45,8 +47,14 @@ const ChannelPage = memo(() => {const isLoading = platformsLoading || providersLoading;+ // Merge server-side platforms with frontend-only coming-soon entries.+ const allPlatforms = useMemo<ChannelPlatformDefinition[]>(+ () => [...(platforms ?? []), ...COMING_SOON_PLATFORMS],+ [platforms],+ );+// Default to first platform once loaded- const effectiveActiveId = activeProviderId || platforms?.[0]?.id || '';+ const effectiveActiveId = activeProviderId || allPlatforms[0]?.id || '';const platformRuntimeStatuses = useMemo(() =>@@ -63,8 +71,8 @@ const ChannelPage = memo(() => {);const activePlatformDef = useMemo(- () => platforms?.find((p) => p.id === effectiveActiveId) || platforms?.[0],- [platforms, effectiveActiveId],+ () => allPlatforms.find((p) => p.id === effectiveActiveId) || allPlatforms[0],+ [allPlatforms, effectiveActiveId],);const currentConfig = useMemo(@@ -80,22 +88,26 @@ const ChannelPage = memo(() => {<Flexbox flex={1} style={{ overflowY: 'auto' }}>{isLoading && <Loading debugId="ChannelPage" />}- {!isLoading && platforms && platforms.length > 0 && activePlatformDef && (+ {!isLoading && allPlatforms.length > 0 && activePlatformDef && (<div className={styles.container}><PlatformListactiveId={effectiveActiveId}agentId={aid}- platforms={platforms}+ platforms={allPlatforms}providers={providers}runtimeStatuses={platformRuntimeStatuses}onSelect={setActiveProviderId}/>- <PlatformDetail- agentId={aid}- currentConfig={currentConfig}- platformDef={activePlatformDef}- runtimeStatus={platformRuntimeStatuses.get(activePlatformDef.id)}- />+ {activePlatformDef.comingSoon ? (+ <ComingSoonDetail platformDef={activePlatformDef} />+ ) : (+ <PlatformDetail+ agentId={aid}+ currentConfig={currentConfig}+ platformDef={activePlatformDef}+ runtimeStatus={platformRuntimeStatuses.get(activePlatformDef.id)}+ />+ )}</div>)}</Flexbox>diff --git a/src/routes/(main)/agent/channel/list.tsx b/src/routes/(main)/agent/channel/list.tsxindex 6c6f50302fb..636ceb30744 100644--- a/src/routes/(main)/agent/channel/list.tsx+++ b/src/routes/(main)/agent/channel/list.tsx@@ -1,19 +1,18 @@'use client';import { exportJSONFile } from '@lobechat/utils/client';-import { Icon } from '@lobehub/ui';+import { Icon, Tag } from '@lobehub/ui';import { App, Dropdown, type MenuProps } from 'antd';import { createStaticStyles, cx, useTheme } from 'antd-style';import { Book, Download, MoreHorizontal, Trash2, Upload } from 'lucide-react';import { memo, useCallback, useRef } from 'react';import { useTranslation } from 'react-i18next';-import type { SerializedPlatformDefinition } from '@/server/services/bot/platforms/types';import { useAgentStore } from '@/store/agent';import type { BotProviderItem } from '@/store/agent/slices/bot/action';import { BOT_RUNTIME_STATUSES, type BotRuntimeStatus } from '../../../../types/botRuntimeStatus';-import { getPlatformIcon } from './const';+import { type ChannelPlatformDefinition, getPlatformIcon } from './const';import MessengerPromo from './MessengerPromo';const styles = createStaticStyles(({ css, cssVar }) => ({@@ -80,7 +79,7 @@ interface PlatformListProps {activeId: string;agentId: string;onSelect: (id: string) => void;- platforms: SerializedPlatformDefinition[];+ platforms: ChannelPlatformDefinition[];providers?: BotProviderItem[];runtimeStatuses: Map<string, BotRuntimeStatus>;}@@ -262,7 +261,9 @@ const PlatformList = memo<PlatformListProps>(const PlatformIcon = getPlatformIcon(platform.name);const ColorIcon =PlatformIcon && 'Color' in PlatformIcon ? (PlatformIcon as any).Color : PlatformIcon;- const runtimeStatus = runtimeStatuses.get(platform.id);+ const runtimeStatus = platform.comingSoon+ ? undefined+ : runtimeStatuses.get(platform.id);const statusColor = getStatusColor(runtimeStatus);const statusTitle = getStatusTitle(runtimeStatus);return (@@ -273,6 +274,11 @@ const PlatformList = memo<PlatformListProps>(>{ColorIcon && <ColorIcon size={20} />}<span style={{ flex: 1 }}>{platform.name}</span>+ {platform.comingSoon && (+ <Tag size={'small'} style={{ marginInlineEnd: 0 }}>+ {t('channel.comingSoon')}+ </Tag>+ )}{runtimeStatus && (<divclassName={styles.statusDot}diff --git a/src/server/services/bot/BotMessageRouter.ts b/src/server/services/bot/BotMessageRouter.tsindex 211b5d7fede..7837afb0338 100644--- a/src/server/services/bot/BotMessageRouter.ts+++ b/src/server/services/bot/BotMessageRouter.ts@@ -30,8 +30,11 @@ import {extractDmSettings,extractGroupSettings,extractUserAllowlist,+ extractWatchKeywordEntries,+ findMatchingWatchKeywordEntries,getBotReplyLocale,type GroupSettings,+ messageMatchesWatchKeyword,normalizeAllowFromEntries,normalizeBotReplyLocale,type PlatformClient,@@ -42,6 +45,7 @@ import {shouldHandleDm,shouldHandleGroup,type UserAllowlist,+ type WatchKeywordEntry,} from './platforms';import {renderApproveSuccess,@@ -465,6 +469,42 @@ export class BotMessageRouter {});}+ /**+ * Prepend the operator-authored `instruction` of every matched watch+ * keyword to the merged user message. Used on the keyword-wake paths+ * (subscribed-thread `onSubscribedMessage` and the channel catch-all)+ * so a bare trigger like "bug" can carry a directive into the agent+ * call without an explicit mention.+ *+ * Duplicated instructions are de-duplicated (operators routinely paste+ * the same directive under several keywords like "bug" / "outage").+ * If no matched entry has an instruction, the original `merged` is+ * returned unchanged so the caller doesn't need to branch.+ */+ private static applyWatchKeywordInstructions(+ merged: Message,+ entries: ReadonlyArray<WatchKeywordEntry>,+ ): { instructionCount: number; merged: Message; prefixLength: number } {+ const matched = findMatchingWatchKeywordEntries(merged.text, entries);+ const instructions = Array.from(+ new Set(+ matched+ .map((entry) => entry.instruction?.trim())+ .filter((value): value is string => !!value),+ ),+ );+ if (instructions.length === 0) {+ return { instructionCount: 0, merged, prefixLength: 0 };+ }+ const prefix = instructions.join('\n\n');+ const originalText = merged.text ?? '';+ const augmentedText = originalText ? `${prefix}\n\n${originalText}` : prefix;+ const next = Object.assign(Object.create(Object.getPrototypeOf(merged)), merged, {+ text: augmentedText,+ }) as Message;+ return { instructionCount: instructions.length, merged: next, prefixLength: prefix.length };+ }+private registerHandlers(bot: Chat<any>,serverDB: LobeChatDatabase,@@ -483,6 +523,23 @@ export class BotMessageRouter {const dmSettings: DmSettings = extractDmSettings(info.settings);const groupSettings: GroupSettings = extractGroupSettings(info.settings);const userAllowlist: UserAllowlist = extractUserAllowlist(info.settings);+ /**+ * Operator-configured keywords (LOBE-8891). When non-empty, a non-@mention+ * non-command message in a subscribed group thread still wakes the bot if+ * its text contains any keyword — case-insensitive, word-boundary aware+ * (see `messageMatchesWatchKeyword`). Empty list keeps the legacy+ * mention-only behaviour exactly. DMs and explicit mentions are unaffected;+ * keyword matching only relaxes the gate in subscribed group threads.+ *+ * `watchKeywordEntries` carries the operator-authored `instruction` for+ * each keyword. When a keyword (and not a mention) is what wakes the+ * bot, the matched entries' instructions are prepended to the user+ * message as a prompt prefix before dispatch — so a bare trigger word+ * can drive a specific directive ("scan the recent thread for a bug+ * report", "summarise the last 20 messages", …).+ */+ const watchKeywordEntries = extractWatchKeywordEntries(info.settings);+ const watchKeywords: ReadonlyArray<string> = watchKeywordEntries.map((e) => e.keyword);/*** The provider's owner platform user ID. Only consulted under the* `pairing` policy, where the gate gives the owner a free pass so they@@ -922,8 +979,17 @@ export class BotMessageRouter {message.isMention === true ||context?.skipped?.some((m) => m.isMention === true) === true;const isCommand = looksLikeCommand(message.text);-- if (!isAddressedToBot && !isCommand) {+ // LOBE-8891: operator-configured keyword match also wakes the bot in a+ // subscribed group thread. Skipped (debounced) siblings are inspected+ // too so a keyword queued behind a non-trigger still fires — same+ // pattern as the mention check above.+ const matchesWatchKeyword =+ watchKeywords.length > 0 &&+ (messageMatchesWatchKeyword(message.text, watchKeywords) ||+ context?.skipped?.some((m) => messageMatchesWatchKeyword(m.text, watchKeywords)) ===+ true);++ if (!isAddressedToBot && !isCommand && !matchesWatchKeyword) {log('onSubscribedMessage: skip non-mention in group thread, agent=%s, platform=%s, author=%s, thread=%s',agentId,@@ -934,6 +1000,17 @@ export class BotMessageRouter {return;}+ if (matchesWatchKeyword && !isAddressedToBot && !isCommand) {+ log(+ 'onSubscribedMessage: keyword match wakes bot, agent=%s, platform=%s, author=%s, thread=%s, keywords=%o',+ agentId,+ platform,+ message.author.userName,+ thread.id,+ watchKeywords,+ );+ }+// Gate before tryDispatch so a /command from a non-allowlisted sender// (or in a disabled DM/group scope) cannot side-effect.if (!(await passGatesOrNotify(thread, message.author, replyLocale, 'onSubscribedMessage'))) {@@ -962,7 +1039,27 @@ export class BotMessageRouter {);}- const merged = BotMessageRouter.mergeSkippedMessages(message, context);+ let merged = BotMessageRouter.mergeSkippedMessages(message, context);+ // LOBE-8891: when a keyword (and not a mention / DM / command) is what+ // wakes the bot, prepend the matched entries' operator-authored+ // instructions to the user message so the agent gets a directive+ // rather than only the raw chatter. Mentions, DMs, and commands are+ // skipped on purpose — those flows are user-initiated and should not+ // have an operator prompt silently injected on top.+ if (matchesWatchKeyword && !isAddressedToBot && !isCommand) {+ const applied = BotMessageRouter.applyWatchKeywordInstructions(merged, watchKeywordEntries);+ merged = applied.merged;+ if (applied.instructionCount > 0) {+ log(+ 'onSubscribedMessage: injecting %d watch-keyword instruction(s), agent=%s, platform=%s, thread=%s, prefixLen=%d',+ applied.instructionCount,+ agentId,+ platform,+ thread.id,+ applied.prefixLength,+ );+ }+ }void emitAgentSignalSourceEvent({payload: {@@ -1038,12 +1135,26 @@ export class BotMessageRouter {passGatesOrNotify,);- // DM catch-all: only registered when DM handling is enabled. For mixed- // platforms (e.g. Slack/Discord with both DMs and group channels), the- // handler itself restricts routing to DM threads that satisfy the policy —- // otherwise the `/./` regex would match every group message and hijack- // non-mention traffic. Group @-mentions keep going through `onNewMention`.- if (dmSettings.policy !== 'disabled') {+ // DM / keyword-wake catch-all: registered when either DM is enabled OR at+ // least one watch keyword is configured. The handler routes two distinct+ // paths through the same `onNewMessage(/./)` subscription so a single+ // regex listener can serve both:+ //+ // • DM path: every message in a DM thread (when DM policy allows it).+ // • Channel keyword path (LOBE-8891): non-DM messages whose text — or+ // a debounced sibling's text — contains a configured watch keyword.+ // This is the only way to wake the bot in a parent channel on+ // platforms like Discord, where `shouldSubscribe` returns false for+ // top-level guild channels and `onSubscribedMessage` therefore never+ // fires for the channel itself (only its sub-threads).+ //+ // Non-DM messages that DON'T match a keyword are silently dropped so the+ // regex doesn't hijack every group message in shared channels. Group+ // @-mentions keep going through `onNewMention` (unsubscribed) and+ // `onSubscribedMessage` (subscribed sub-threads).+ const dmCatchAllEnabled = dmSettings.policy !== 'disabled';+ const keywordCatchAllEnabled = watchKeywordEntries.length > 0;+ if (dmCatchAllEnabled || keywordCatchAllEnabled) {bot.onNewMessage(/./, async (thread, message, context?: MessageContext) => {if (message.author.isBot === true) return;@@ -1051,12 +1162,34 @@ export class BotMessageRouter {// (which applies the same gates).if (BotMessageRouter.dispatchTextCommand(message.text, commands)) return;- // The catch-all exists solely to handle DMs on mention-less platforms- // (Telegram, WeChat, …) and on mixed platforms where the DM flow should- // not require an @-mention. Group / channel traffic is already handled- // by onNewMention + onSubscribedMessage; if we let it through here we- // would hijack every non-mention message in shared threads.- if (thread.isDM !== true) return;+ const isDM = thread.isDM === true;++ // Channel-side keyword wake: only relevant for non-DM threads, since+ // DMs already pass the gate below via `isDM`. Inspect the current+ // message AND any debounced siblings, mirroring `onSubscribedMessage`+ // so a keyword queued behind a non-trigger message still fires.+ const matchesWatchKeyword =+ !isDM &&+ keywordCatchAllEnabled &&+ (messageMatchesWatchKeyword(message.text, watchKeywords) ||+ context?.skipped?.some((m) => messageMatchesWatchKeyword(m.text, watchKeywords)) ===+ true);++ // If neither path applies, return so the regex doesn't act as a+ // channel-wide hijack. DMs still need the dmCatchAllEnabled gate+ // because a DM message can arrive while DM policy is disabled.+ if (!(isDM && dmCatchAllEnabled) && !matchesWatchKeyword) return;++ if (matchesWatchKeyword) {+ log(+ 'onNewMessage (%s catch-all): keyword match wakes bot in channel, agent=%s, author=%s, thread=%s, keywords=%o',+ platform,+ agentId,+ message.author.userName,+ thread.id,+ watchKeywords,+ );+ }const replyLocale = detectReplyLocale(message);@@ -1091,7 +1224,59 @@ export class BotMessageRouter {);}- const merged = BotMessageRouter.mergeSkippedMessages(message, context);+ let merged = BotMessageRouter.mergeSkippedMessages(message, context);+ // LOBE-8891: same instruction-injection rule as `onSubscribedMessage`+ // — prepend the matched entries' operator-authored instructions when+ // the keyword (not a mention / DM / command) is what wakes the bot.+ // DMs are explicit user intent and never get the prefix.+ if (matchesWatchKeyword) {+ const applied = BotMessageRouter.applyWatchKeywordInstructions(+ merged,+ watchKeywordEntries,+ );+ merged = applied.merged;+ if (applied.instructionCount > 0) {+ log(+ 'onNewMessage (%s catch-all): injecting %d watch-keyword instruction(s), agent=%s, thread=%s, prefixLen=%d',+ platform,+ applied.instructionCount,+ agentId,+ thread.id,+ applied.prefixLength,+ );+ }++ // Discord (and any platform that prefers thread isolation) opts+ // into spawning a sub-thread for the reply via this hook. The+ // chat-sdk Discord adapter only auto-creates a thread on+ // @-mention, so without this the keyword wake would clutter the+ // parent channel with the bot's output. Best-effort: on hook+ // failure we keep the original thread.id and reply in the+ // channel rather than dropping the message.+ if (typeof client.openThreadForChannelWake === 'function') {+ try {+ const upgraded = await client.openThreadForChannelWake(+ thread.id,+ (message as { raw?: unknown }).raw,+ );+ if (upgraded && upgraded !== thread.id) {+ log(+ 'onNewMessage (%s catch-all): opened reply thread for keyword wake, %s -> %s',+ platform,+ thread.id,+ upgraded,+ );+ (thread as { id: string }).id = upgraded;+ }+ } catch (error) {+ log(+ 'onNewMessage (%s catch-all): openThreadForChannelWake threw, posting in channel: %O',+ platform,+ error,+ );+ }+ }+ }void emitAgentSignalSourceEvent({payload: {diff --git a/src/server/services/bot/__tests__/BotMessageRouter.test.ts b/src/server/services/bot/__tests__/BotMessageRouter.test.tsindex 150d13c4e00..16d4b436a6f 100644--- a/src/server/services/bot/__tests__/BotMessageRouter.test.ts+++ b/src/server/services/bot/__tests__/BotMessageRouter.test.ts@@ -91,6 +91,10 @@ vi.mock('@/server/services/aiAgent', () => ({const mockHandleMention = vi.hoisted(() => vi.fn().mockResolvedValue(undefined));const mockHandleSubscribedMessage = vi.hoisted(() => vi.fn().mockResolvedValue(undefined));+// Default to "platform does not opt into thread isolation" so existing tests+// keep their pre-LOBE-8891 behaviour. Individual tests can replace this via+// `.mockResolvedValueOnce(...)` to simulate Discord's auto-thread upgrade.+const mockOpenThreadForChannelWake = vi.hoisted(() => vi.fn().mockResolvedValue(undefined));vi.mock('../AgentBridgeService', () => ({AgentBridgeService: vi.fn().mockImplementation(() => ({@@ -160,6 +164,7 @@ const mockGetPlatform = vi.hoisted(() =>triggerTyping: vi.fn(),}),id: platform,+ openThreadForChannelWake: mockOpenThreadForChannelWake,parseMessageId: (id: string) => id,start: vi.fn(),stop: vi.fn(),@@ -276,6 +281,74 @@ vi.mock('../platforms', () => ({if (!operatorId || explicit.includes(operatorId)) return { ids: explicit };return { ids: [...explicit, operatorId] };},+ // LOBE-8891: mirror the production helpers just well enough that+ // BotMessageRouter.registerHandlers can read a clean list of entries.+ // Tests can populate `settings.watchKeywords` with the canonical+ // `[{ keyword, instruction? }]` shape to exercise both the keyword-match+ // gate and the instruction-injection branch.+ extractWatchKeywordEntries: (+ settings: Record<string, unknown> | null | undefined,+ ): Array<{ instruction?: string; keyword: string }> => {+ const raw = settings?.watchKeywords;+ const byKeyword = new Map<string, { instruction?: string; keyword: string }>();+ if (Array.isArray(raw)) {+ for (const entry of raw) {+ if (typeof entry === 'string') {+ const k = entry.trim().toLowerCase();+ if (k && !byKeyword.has(k)) byKeyword.set(k, { keyword: k });+ } else if (entry && typeof entry === 'object' && 'keyword' in entry) {+ const obj = entry as { instruction?: unknown; keyword?: unknown };+ if (typeof obj.keyword !== 'string') continue;+ const k = obj.keyword.trim().toLowerCase();+ if (!k) continue;+ const instruction =+ typeof obj.instruction === 'string' && obj.instruction.trim()+ ? obj.instruction.trim()+ : undefined;+ const existing = byKeyword.get(k);+ if (!existing) byKeyword.set(k, { instruction, keyword: k });+ else if (!existing.instruction && instruction) existing.instruction = instruction;+ }+ }+ }+ return Array.from(byKeyword.values());+ },+ findMatchingWatchKeywordEntries: (+ text: string | undefined | null,+ entries: ReadonlyArray<{ instruction?: string; keyword: string }>,+ ) => {+ if (!text || entries.length === 0) return [];+ const lowered = text.toLowerCase();+ const wordChar = /\w/;+ return entries.filter((entry) => {+ const idx = lowered.indexOf(entry.keyword);+ if (idx === -1) return false;+ const before = idx === 0 ? '' : lowered[idx - 1];+ const after =+ idx + entry.keyword.length >= lowered.length ? '' : lowered[idx + entry.keyword.length];+ const leftBoundary = !before || !wordChar.test(before);+ const rightBoundary = !after || !wordChar.test(after);+ return leftBoundary && rightBoundary;+ });+ },+ messageMatchesWatchKeyword: (+ text: string | undefined | null,+ keywords: ReadonlyArray<string>,+ ): boolean => {+ if (!text || keywords.length === 0) return false;+ const lowered = text.toLowerCase();+ const wordChar = /\w/;+ for (const keyword of keywords) {+ const idx = lowered.indexOf(keyword);+ if (idx === -1) continue;+ const before = idx === 0 ? '' : lowered[idx - 1];+ const after = idx + keyword.length >= lowered.length ? '' : lowered[idx + keyword.length];+ const leftBoundary = !before || !wordChar.test(before);+ const rightBoundary = !after || !wordChar.test(after);+ if (leftBoundary && rightBoundary) return true;+ }+ return false;+ },mergeWithDefaults: mockMergeWithDefaults,platformRegistry: {getPlatform: mockGetPlatform,@@ -351,6 +424,7 @@ describe('BotMessageRouter', () => {mockFindEnabledByPlatform.mockResolvedValue([]);mockHandleMention.mockResolvedValue(undefined);mockHandleSubscribedMessage.mockResolvedValue(undefined);+ mockOpenThreadForChannelWake.mockResolvedValue(undefined);// Reset pairing-store + provider-model mocks to safe defaults so a// previous test's stub doesn't leak into the next one.mockPeekPairingRequest.mockResolvedValue(null);@@ -594,6 +668,140 @@ describe('BotMessageRouter', () => {expect(mockHandleSubscribedMessage).toHaveBeenCalledTimes(1);});+ it('should wake on a watch-keyword match in a subscribed group thread (LOBE-8891)', async () => {+ const handler = await loadSubscribedHandler({+ dmPolicy: 'open',+ watchKeywords: [{ keyword: 'bug' }, { keyword: 'outage' }],+ });+ const thread = makeThread({ isDM: false });+ const message = makeMessage({+ isMention: false,+ text: 'hey team, I think we have a bug in checkout',+ });++ await handler(thread, message);++ expect(mockHandleSubscribedMessage).toHaveBeenCalledTimes(1);+ });++ it('should still skip when text contains a keyword as substring only (word boundary)', async () => {+ const handler = await loadSubscribedHandler({+ dmPolicy: 'open',+ watchKeywords: [{ keyword: 'bug' }],+ });+ const thread = makeThread({ isDM: false });+ // `debug` must NOT trigger `bug` — that would flood the bot in+ // engineering channels where "debug" is everyday vocabulary.+ const message = makeMessage({ isMention: false, text: 'enabling debug logs on prod' });++ await handler(thread, message);++ expect(mockHandleSubscribedMessage).not.toHaveBeenCalled();+ });++ it('should wake when a debounced/skipped earlier message contained a watch keyword', async () => {+ const handler = await loadSubscribedHandler({+ dmPolicy: 'open',+ watchKeywords: [{ keyword: 'bug' }],+ });+ const thread = makeThread({ isDM: false });+ const skipped = [makeMessage({ isMention: false, text: 'found a bug earlier' })];+ const message = makeMessage({ isMention: false, text: 'still investigating' });++ await handler(thread, message, { skipped, totalSinceLastHandler: 2 });++ expect(mockHandleSubscribedMessage).toHaveBeenCalledTimes(1);+ });++ it('should not change behaviour when watchKeywords is empty/missing', async () => {+ // Sanity: existing call sites must keep their pre-LOBE-8891 semantics.+ const handler = await loadSubscribedHandler({ dmPolicy: 'open' });+ const thread = makeThread({ isDM: false });+ const message = makeMessage({ isMention: false, text: 'there is a bug somewhere' });++ await handler(thread, message);++ expect(mockHandleSubscribedMessage).not.toHaveBeenCalled();+ });++ it('should prepend the matched entry instruction to the user message before dispatch', async () => {+ // Operator-authored prompt: when the keyword (and not a mention) is+ // what wakes the bot, the agent should see `instruction\n\nuser text`.+ const handler = await loadSubscribedHandler({+ dmPolicy: 'open',+ watchKeywords: [+ { instruction: 'Scan the thread and reply if it is a real bug.', keyword: 'bug' },+ ],+ });+ const thread = makeThread({ isDM: false });+ const message = makeMessage({+ isMention: false,+ text: 'hey team, I think we have a bug in checkout',+ });++ await handler(thread, message);++ expect(mockHandleSubscribedMessage).toHaveBeenCalledTimes(1);+ const [, merged] = mockHandleSubscribedMessage.mock.calls[0];+ expect(merged.text).toBe(+ 'Scan the thread and reply if it is a real bug.\n\nhey team, I think we have a bug in checkout',+ );+ });++ it('should merge instructions for every matched entry (dedup, authoring order)', async () => {+ const handler = await loadSubscribedHandler({+ dmPolicy: 'open',+ watchKeywords: [+ { instruction: 'Scan the thread for a bug report.', keyword: 'bug' },+ { instruction: 'Page oncall if downtime is confirmed.', keyword: 'outage' },+ { keyword: 'noise' }, // no instruction → contributes nothing+ ],+ });+ const thread = makeThread({ isDM: false });+ const message = makeMessage({+ isMention: false,+ text: 'we have a bug AND a major outage right now',+ });++ await handler(thread, message);++ const [, merged] = mockHandleSubscribedMessage.mock.calls[0];+ expect(merged.text).toBe(+ 'Scan the thread for a bug report.\n\nPage oncall if downtime is confirmed.\n\nwe have a bug AND a major outage right now',+ );+ });++ it('should NOT inject the instruction when the bot is @-mentioned (user-initiated wins)', async () => {+ // Mentions/DMs/commands are explicit user intent — silently stacking an+ // operator prompt on top would surprise the user, so the instruction+ // injection is scoped to the keyword-only wake path.+ const handler = await loadSubscribedHandler({+ dmPolicy: 'open',+ watchKeywords: [{ instruction: 'should not appear', keyword: 'bug' }],+ });+ const thread = makeThread({ isDM: false });+ const message = makeMessage({ isMention: true, text: '@bot we have a bug here' });++ await handler(thread, message);++ const [, merged] = mockHandleSubscribedMessage.mock.calls[0];+ expect(merged.text).toBe('@bot we have a bug here');+ });++ it('should leave the message untouched when matched entries have no instruction', async () => {+ const handler = await loadSubscribedHandler({+ dmPolicy: 'open',+ watchKeywords: [{ keyword: 'bug' }],+ });+ const thread = makeThread({ isDM: false });+ const message = makeMessage({ isMention: false, text: 'tracking down a bug' });++ await handler(thread, message);++ const [, merged] = mockHandleSubscribedMessage.mock.calls[0];+ expect(merged.text).toBe('tracking down a bug');+ });+it('should ignore messages from other bots', async () => {const handler = await loadSubscribedHandler();const thread = makeThread({ isDM: false });@@ -1017,6 +1225,243 @@ describe('BotMessageRouter', () => {// No pairing notice was posted — Lin is already approved.expect(thread.post).not.toHaveBeenCalled();});++ // ---- LOBE-8891: channel-side keyword wake via catch-all ----+ //+ // Discord (and any platform that opts out of subscribing top-level+ // channels via `shouldSubscribe`) never fires `onSubscribedMessage` for+ // a parent channel — so the only way to wake the bot on a keyword in+ // #general is to route the keyword path through the same `/./`+ // catch-all the DM flow uses. These tests cover that secondary path.++ it('registers the catch-all when DM is disabled but watch keywords are configured', async () => {+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'disabled',+ watchKeywords: [{ keyword: 'bug' }],+ });+ expect(handler).not.toBeNull();+ });++ it('wakes the bot in a non-DM channel when a watch keyword matches', async () => {+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'open',+ watchKeywords: [+ { instruction: 'Scan the recent thread for a bug report.', keyword: 'bug' },+ ],+ });+ if (!handler) throw new Error('expected catch-all to be registered');+ const thread = {+ id: 'discord:guild-1:channel-1',+ isDM: false,+ post: vi.fn().mockResolvedValue(undefined),+ };+ const message = {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ text: 'looks like a bug in checkout',+ };++ await handler(thread, message);++ expect(mockHandleMention).toHaveBeenCalledTimes(1);+ const [, merged] = mockHandleMention.mock.calls[0];+ expect(merged.text).toBe(+ 'Scan the recent thread for a bug report.\n\nlooks like a bug in checkout',+ );+ });++ it('still ignores non-DM channel traffic that does NOT match any watch keyword', async () => {+ // Regression: the relaxed early-return must not turn `/./` into a+ // channel-wide hijack — non-mention chatter without a keyword still+ // belongs to `onSubscribedMessage` (subscribed threads) or nowhere.+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'open',+ watchKeywords: [{ keyword: 'bug' }],+ });+ if (!handler) throw new Error('expected catch-all to be registered');+ const thread = {+ id: 'discord:guild-1:channel-1',+ isDM: false,+ post: vi.fn().mockResolvedValue(undefined),+ };+ const message = {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ text: 'just chatting about the weather',+ };++ await handler(thread, message);++ expect(mockHandleMention).not.toHaveBeenCalled();+ });++ it('wakes in channel when only a debounced/skipped sibling carried the keyword', async () => {+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'open',+ watchKeywords: [{ instruction: 'Scan for bug.', keyword: 'bug' }],+ });+ if (!handler) throw new Error('expected catch-all to be registered');+ const thread = {+ id: 'discord:guild-1:channel-1',+ isDM: false,+ post: vi.fn().mockResolvedValue(undefined),+ };+ const skipped = [+ {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ text: 'found a bug earlier',+ },+ ];+ const message = {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ text: 'still investigating',+ };++ await handler(thread, message, { skipped, totalSinceLastHandler: 2 });++ expect(mockHandleMention).toHaveBeenCalledTimes(1);+ // The matched keyword sits in `skipped` text; after merging, both+ // skipped + current text are joined and the instruction is prepended.+ const [, merged] = mockHandleMention.mock.calls[0];+ expect(merged.text).toBe('Scan for bug.\n\nfound a bug earlier\nstill investigating');+ });++ it('opens a sub-thread for the reply when the platform implements openThreadForChannelWake', async () => {+ // Discord (and any platform with thread isolation) upgrades the+ // composite threadId so the chat-sdk routes reactions / typing /+ // post to a fresh sub-thread instead of the parent channel.+ mockOpenThreadForChannelWake.mockResolvedValueOnce('discord:guild-1:channel-1:new-thread-1');+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'open',+ watchKeywords: [{ instruction: 'Scan.', keyword: 'bug' }],+ });+ if (!handler) throw new Error('expected catch-all to be registered');+ const thread = {+ id: 'discord:guild-1:channel-1',+ isDM: false,+ post: vi.fn().mockResolvedValue(undefined),+ };+ const message = {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ raw: { id: 'msg-99' },+ text: 'there is a bug',+ };++ await handler(thread, message);++ expect(mockOpenThreadForChannelWake).toHaveBeenCalledTimes(1);+ expect(mockOpenThreadForChannelWake.mock.calls[0][0]).toBe('discord:guild-1:channel-1');+ expect(mockOpenThreadForChannelWake.mock.calls[0][1]).toEqual({ id: 'msg-99' });+ // The mutation is observable to handleMention through the thread+ // object — chat-sdk's `thread.post` / subscribe / reaction calls+ // all read `thread.id` lazily, so swapping it propagates.+ expect(thread.id).toBe('discord:guild-1:channel-1:new-thread-1');+ const [dispatchedThread] = mockHandleMention.mock.calls[0];+ expect(dispatchedThread.id).toBe('discord:guild-1:channel-1:new-thread-1');+ });++ it('falls back to the original threadId when openThreadForChannelWake returns undefined', async () => {+ // Threadless platforms (Telegram / WeChat / QQ) return undefined+ // from the hook; the bot replies inline in the channel/chat.+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'open',+ watchKeywords: [{ instruction: 'Scan.', keyword: 'bug' }],+ });+ if (!handler) throw new Error('expected catch-all to be registered');+ const thread = {+ id: 'telegram:chat-1',+ isDM: false,+ post: vi.fn().mockResolvedValue(undefined),+ };+ const message = {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ raw: { id: 'msg-99' },+ text: 'reporting a bug',+ };++ await handler(thread, message);++ expect(mockOpenThreadForChannelWake).toHaveBeenCalledTimes(1);+ expect(thread.id).toBe('telegram:chat-1');+ const [dispatchedThread] = mockHandleMention.mock.calls[0];+ expect(dispatchedThread.id).toBe('telegram:chat-1');+ });++ it('still dispatches when openThreadForChannelWake throws (best-effort contract)', async () => {+ // A platform API failure must not drop the user's message. The+ // router logs the error and posts in the original channel instead.+ mockOpenThreadForChannelWake.mockRejectedValueOnce(new Error('discord 500'));+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'open',+ watchKeywords: [{ keyword: 'bug' }],+ });+ if (!handler) throw new Error('expected catch-all to be registered');+ const thread = {+ id: 'discord:guild-1:channel-1',+ isDM: false,+ post: vi.fn().mockResolvedValue(undefined),+ };+ const message = {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ raw: { id: 'msg-99' },+ text: 'reporting a bug',+ };++ await handler(thread, message);++ expect(mockHandleMention).toHaveBeenCalledTimes(1);+ const [dispatchedThread] = mockHandleMention.mock.calls[0];+ expect(dispatchedThread.id).toBe('discord:guild-1:channel-1');+ });++ it('does NOT call openThreadForChannelWake on the DM path', async () => {+ // DMs already deliver replies in the right context; spawning a+ // thread there would either fail (no thread concept in DMs) or+ // create noise. Scoped to the channel-keyword path only.+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'open',+ watchKeywords: [{ keyword: 'bug' }],+ });+ if (!handler) throw new Error('expected catch-all to be registered');+ const thread = {+ id: 'telegram:chat-1',+ isDM: true,+ post: vi.fn().mockResolvedValue(undefined),+ };+ const message = {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ raw: { id: 'msg-99' },+ text: 'bug here',+ };++ await handler(thread, message);++ expect(mockOpenThreadForChannelWake).not.toHaveBeenCalled();+ expect(mockHandleMention).toHaveBeenCalledTimes(1);+ });++ it('does NOT inject an instruction when the DM path triggers the catch-all', async () => {+ // DMs are explicit user intent — even if a DM message happens to+ // contain a configured keyword, we should not silently prepend an+ // operator prompt on top of what the user actually wrote.+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'open',+ watchKeywords: [{ instruction: 'should not appear', keyword: 'bug' }],+ });+ if (!handler) throw new Error('expected catch-all to be registered');+ const thread = {+ id: 'telegram:chat-1',+ isDM: true,+ post: vi.fn().mockResolvedValue(undefined),+ };+ const message = {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ text: 'I think there is a bug in the app',+ };++ await handler(thread, message);++ const [, merged] = mockHandleMention.mock.calls[0];+ expect(merged.text).toBe('I think there is a bug in the app');+ });});describe('group policy', () => {diff --git a/src/server/services/bot/platforms/__tests__/const.test.ts b/src/server/services/bot/platforms/__tests__/const.test.tsindex cc6eee9a508..daa442f8948 100644--- a/src/server/services/bot/platforms/__tests__/const.test.ts+++ b/src/server/services/bot/platforms/__tests__/const.test.ts@@ -5,10 +5,14 @@ import {extractDmSettings,extractGroupSettings,extractUserAllowlist,+ extractWatchKeywordEntries,+ extractWatchKeywords,+ findMatchingWatchKeywordEntries,getBotReplyLocale,getStepReactionEmoji,makeDmPolicyField,makeGroupPolicyFields,+ messageMatchesWatchKeyword,normalizeAllowFromEntries,normalizeBotReplyLocale,shouldAllowSender,@@ -663,3 +667,166 @@ describe('validateAccessSettings', () => {expect(validateAccessSettings({ dmPolicy: 'disabled' }).valid).toBe(true);});});++describe('extractWatchKeywords', () => {+ it('returns [] for missing / null / non-string / non-array values', () => {+ expect(extractWatchKeywords(null)).toEqual([]);+ expect(extractWatchKeywords(undefined)).toEqual([]);+ expect(extractWatchKeywords({})).toEqual([]);+ expect(extractWatchKeywords({ watchKeywords: 42 })).toEqual([]);+ expect(extractWatchKeywords({ watchKeywords: {} })).toEqual([]);+ });++ it('parses the canonical [{keyword, instruction?}] form, dropping empties', () => {+ expect(+ extractWatchKeywords({+ watchKeywords: [+ { instruction: 'scan the thread', keyword: 'bug' },+ { keyword: ' Outage ' },+ { keyword: '' },+ { keyword: ' ' },+ { instruction: 'no keyword' },+ ],+ }),+ ).toEqual(['bug', 'outage']);+ });++ it('accepts a flat string[] for forward compat', () => {+ expect(extractWatchKeywords({ watchKeywords: ['Bug', '', 'BUY', 'bug'] })).toEqual([+ 'bug',+ 'buy',+ ]);+ });++ it('accepts a comma / newline / whitespace-separated string', () => {+ expect(extractWatchKeywords({ watchKeywords: 'bug, buy\noutage alert,,, alert' })).toEqual([+ 'bug',+ 'buy',+ 'outage',+ 'alert',+ ]);+ });++ it('lowercases and deduplicates so matching is case-insensitive at run time', () => {+ expect(+ extractWatchKeywords({+ watchKeywords: [{ keyword: 'Bug' }, { keyword: 'BUG' }, { keyword: 'bug' }],+ }),+ ).toEqual(['bug']);+ });+});++describe('messageMatchesWatchKeyword', () => {+ it('returns false when text or keywords are empty', () => {+ expect(messageMatchesWatchKeyword('', ['bug'])).toBe(false);+ expect(messageMatchesWatchKeyword(undefined, ['bug'])).toBe(false);+ expect(messageMatchesWatchKeyword('bug everywhere', [])).toBe(false);+ });++ it('matches case-insensitively', () => {+ expect(messageMatchesWatchKeyword('There is a BUG here', ['bug'])).toBe(true);+ expect(messageMatchesWatchKeyword('Bug?', ['bug'])).toBe(true);+ });++ it('respects word boundaries so debug / bugfix do NOT trigger bug', () => {+ expect(messageMatchesWatchKeyword('debug logs', ['bug'])).toBe(false);+ expect(messageMatchesWatchKeyword('bugfix landed', ['bug'])).toBe(false);+ expect(messageMatchesWatchKeyword('the bug landed', ['bug'])).toBe(true);+ });++ it('keeps scanning past non-boundary occurrences to find a later whole-word match', () => {+ expect(messageMatchesWatchKeyword('debug logs show a real bug', ['bug'])).toBe(true);+ expect(messageMatchesWatchKeyword('bugfix landed but the bug is back', ['bug'])).toBe(true);+ // Still false when every occurrence is embedded.+ expect(messageMatchesWatchKeyword('debug then bugfix', ['bug'])).toBe(false);+ });++ it('still matches when keyword is flanked by punctuation', () => {+ expect(messageMatchesWatchKeyword('(bug)', ['bug'])).toBe(true);+ expect(messageMatchesWatchKeyword('bug, anyone?', ['bug'])).toBe(true);+ expect(messageMatchesWatchKeyword('"bug"!', ['bug'])).toBe(true);+ });++ it('supports CJK keywords (no ASCII \\b assumption)', () => {+ expect(messageMatchesWatchKeyword('线上故障,需要修复', ['故障'])).toBe(true);+ // Surrounded by other CJK chars should still match — \b would have failed+ // here but our predicate uses unicode word-class lookarounds.+ expect(messageMatchesWatchKeyword('系统故障报告', ['故障'])).toBe(true);+ });++ it('matches the first keyword in a multi-keyword list', () => {+ expect(messageMatchesWatchKeyword('user wants to buy', ['bug', 'buy', 'outage'])).toBe(true);+ expect(messageMatchesWatchKeyword('weather update', ['bug', 'buy', 'outage'])).toBe(false);+ });+});++describe('extractWatchKeywordEntries', () => {+ it('returns [] for missing / non-array, non-string values', () => {+ expect(extractWatchKeywordEntries(null)).toEqual([]);+ expect(extractWatchKeywordEntries(undefined)).toEqual([]);+ expect(extractWatchKeywordEntries({})).toEqual([]);+ expect(extractWatchKeywordEntries({ watchKeywords: 42 })).toEqual([]);+ });++ it('keeps the operator-authored instruction alongside the lowercased keyword', () => {+ expect(+ extractWatchKeywordEntries({+ watchKeywords: [+ { instruction: ' Scan the thread for a bug report ', keyword: 'Bug' },+ { keyword: 'outage' },+ ],+ }),+ ).toEqual([+ { instruction: 'Scan the thread for a bug report', keyword: 'bug' },+ { instruction: undefined, keyword: 'outage' },+ ]);+ });++ it('dedupes by keyword and keeps the first non-empty instruction', () => {+ expect(+ extractWatchKeywordEntries({+ watchKeywords: [+ { keyword: 'bug' },+ { instruction: 'first instruction', keyword: 'BUG' },+ { instruction: 'later instruction', keyword: 'bug' },+ ],+ }),+ ).toEqual([{ instruction: 'first instruction', keyword: 'bug' }]);+ });++ it('returns entries with no instruction for the string and string[] fallbacks', () => {+ expect(extractWatchKeywordEntries({ watchKeywords: ['Bug', 'outage'] })).toEqual([+ { instruction: undefined, keyword: 'bug' },+ { instruction: undefined, keyword: 'outage' },+ ]);+ expect(extractWatchKeywordEntries({ watchKeywords: 'bug, outage' })).toEqual([+ { instruction: undefined, keyword: 'bug' },+ { instruction: undefined, keyword: 'outage' },+ ]);+ });+});++describe('findMatchingWatchKeywordEntries', () => {+ it('returns matched entries in authoring order', () => {+ const entries = [+ { instruction: 'scan thread for bug', keyword: 'bug' },+ { instruction: 'page oncall', keyword: 'outage' },+ { keyword: 'buy' },+ ];+ expect(findMatchingWatchKeywordEntries('we have a bug and a major outage', entries)).toEqual([+ { instruction: 'scan thread for bug', keyword: 'bug' },+ { instruction: 'page oncall', keyword: 'outage' },+ ]);+ });++ it('respects the same word-boundary rules as the gate predicate', () => {+ const entries = [{ instruction: 'scan thread', keyword: 'bug' }];+ expect(findMatchingWatchKeywordEntries('debug logs', entries)).toEqual([]);+ expect(findMatchingWatchKeywordEntries('the bug landed', entries)).toEqual(entries);+ });++ it('returns [] on empty text or empty entries', () => {+ expect(findMatchingWatchKeywordEntries('', [{ keyword: 'bug' }])).toEqual([]);+ expect(findMatchingWatchKeywordEntries('bug everywhere', [])).toEqual([]);+ });+});diff --git a/src/server/services/bot/platforms/const.ts b/src/server/services/bot/platforms/const.tsindex 0727555d3f4..a65a7d2fda0 100644--- a/src/server/services/bot/platforms/const.ts+++ b/src/server/services/bot/platforms/const.ts@@ -364,6 +364,196 @@ export function normalizeAllowFromEntries(raw: unknown): Array<{ id: string; namreturn [];}+// ---------- Watch keywords (LOBE-8891) ----------++/**+ * Entry shape persisted under `settings.watchKeywords`. `keyword` is what the+ * runtime matches against the inbound message text; `instruction` is an+ * operator-authored prompt that is prepended to the user's message and sent+ * to the agent when the keyword wakes the bot (so a bare trigger word like+ * "bug" can carry a directive like "Scan the recent thread and reply if you+ * spot an actionable bug report"). When `instruction` is empty/absent the+ * keyword just wakes the bot with the user's raw text — same as a mention.+ */+export interface WatchKeywordEntry {+ instruction?: string;+ keyword: string;+}++/**+ * "Watch Keywords" schema field — when populated, the bot also reacts to+ * non-@mention messages in subscribed channels whose text contains any of+ * these keywords. Empty (default) preserves the today behaviour of only+ * responding to mentions / DMs / subscribed-thread mentions.+ *+ * Stored as `Array<{ keyword, instruction? }>`. The optional `instruction`+ * is appended as a user-side prompt prefix when the keyword wakes the bot —+ * letting operators wire each trigger to an explicit directive ("scan the+ * thread for a bug report", "summarise the last 20 messages", …) rather+ * than only routing the raw message.+ */+export const watchKeywordsField: FieldSchema = {+ key: 'watchKeywords',+ default: [],+ description: 'channel.watchKeywordsHint',+ label: 'channel.watchKeywords',+ type: 'array',+ items: {+ key: 'item',+ label: '',+ type: 'object',+ properties: [+ {+ key: 'keyword',+ label: 'channel.watchKeywordLabel',+ placeholder: 'channel.watchKeywordPlaceholder',+ required: true,+ type: 'string',+ },+ {+ key: 'instruction',+ label: 'channel.watchKeywordInstructionLabel',+ placeholder: 'channel.watchKeywordInstructionPlaceholder',+ type: 'string',+ },+ ],+ },+};++/**+ * Parse `settings.watchKeywords` into the canonical entry list. Accepts+ * three shapes for forward-compat with any future schema migrations:+ *+ * 1. `Array<{ keyword, instruction? }>` — current form-produced shape+ * 2. `string[]` — flat array fallback (no instructions attached)+ * 3. `string` — comma / newline / whitespace-separated text (legacy / paste)+ *+ * Keywords are lowercased and deduplicated (matching is case-insensitive,+ * so we normalise once at parse time rather than per-message). The first+ * non-empty `instruction` wins on duplicates so the operator's authoring+ * order is preserved.+ */+export function extractWatchKeywordEntries(+ settings: Record<string, unknown> | null | undefined,+): WatchKeywordEntry[] {+ const raw = settings?.watchKeywords;+ const byKeyword = new Map<string, WatchKeywordEntry>();+ const push = (keyword: unknown, instruction?: unknown) => {+ if (typeof keyword !== 'string') return;+ const normalised = keyword.trim().toLowerCase();+ if (!normalised) return;+ const trimmedInstruction =+ typeof instruction === 'string' && instruction.trim() ? instruction.trim() : undefined;+ const existing = byKeyword.get(normalised);+ if (!existing) {+ byKeyword.set(normalised, { keyword: normalised, instruction: trimmedInstruction });+ return;+ }+ // Keep the first non-empty instruction so the operator's authoring order+ // is honoured when the form contains duplicate keywords.+ if (!existing.instruction && trimmedInstruction) {+ existing.instruction = trimmedInstruction;+ }+ };+ if (typeof raw === 'string') {+ for (const piece of raw.split(/[\s,]+/)) push(piece);+ } else if (Array.isArray(raw)) {+ for (const entry of raw) {+ if (typeof entry === 'string') {+ push(entry);+ continue;+ }+ if (entry && typeof entry === 'object' && 'keyword' in entry) {+ const obj = entry as { instruction?: unknown; keyword?: unknown };+ push(obj.keyword, obj.instruction);+ }+ }+ }+ return Array.from(byKeyword.values());+}++/**+ * Convenience wrapper that returns only the lowercased keyword strings —+ * sufficient for the mention-gate predicate in BotMessageRouter, which+ * doesn't need the instructions.+ */+export function extractWatchKeywords(+ settings: Record<string, unknown> | null | undefined,+): string[] {+ return extractWatchKeywordEntries(settings).map((entry) => entry.keyword);+}++/**+ * Test whether the inbound message text contains any of the configured+ * watch keywords. Case-insensitive, word-boundary aware so `bug` does NOT+ * match `debug` / `bugfix` (operators expect "say the word `bug` and the+ * bot replies", not "any substring") — but punctuation-flanked occurrences+ * still match ("bug!", "(bug)", "bug,").+ *+ * Word-boundary only kicks in for ASCII word chars (`[A-Za-z0-9_]`) on the+ * adjacent side. This keeps the "don't match `bug` inside `debug`" rule for+ * Latin-script keywords, while letting CJK keywords behave like substring+ * matches — Chinese / Japanese don't have a whitespace word boundary, so+ * `\b`-style logic would silently break the feature for the audience this+ * bot is built for (Feishu / Lark / QQ / WeChat).+ *+ * Empty `keywords` short-circuits to `false` so callers can compose with+ * existing mention gates without re-checking emptiness everywhere.+ */+export function messageMatchesWatchKeyword(+ text: string | undefined | null,+ keywords: ReadonlyArray<string>,+): boolean {+ return findFirstMatchingKeyword(text, keywords) !== null;+}++/**+ * Return every entry whose keyword appears in `text`, in the entries'+ * authoring order. Used by the router to gather operator-authored+ * instructions for matched keywords so they can be injected as a prompt+ * prefix when the keyword (and not a mention) is what wakes the bot.+ */+export function findMatchingWatchKeywordEntries(+ text: string | undefined | null,+ entries: ReadonlyArray<WatchKeywordEntry>,+): WatchKeywordEntry[] {+ if (!text || entries.length === 0) return [];+ const lowered = text.toLowerCase();+ return entries.filter((entry) => keywordOccursIn(lowered, entry.keyword));+}++// Underscore is included in the word class so `_bug_` doesn't fire while+// `bug.` / `(bug)` still do. ASCII-only on purpose — see the CJK note on+// `messageMatchesWatchKeyword` above.+const KEYWORD_WORD_CHAR = /\w/;++const keywordOccursIn = (loweredText: string, keyword: string): boolean => {+ if (!keyword) return false;+ let idx = loweredText.indexOf(keyword);+ while (idx !== -1) {+ const before = idx === 0 ? '' : loweredText[idx - 1];+ const after =+ idx + keyword.length >= loweredText.length ? '' : loweredText[idx + keyword.length];+ const leftBoundary = !before || !KEYWORD_WORD_CHAR.test(before);+ const rightBoundary = !after || !KEYWORD_WORD_CHAR.test(after);+ if (leftBoundary && rightBoundary) return true;+ idx = loweredText.indexOf(keyword, idx + 1);+ }+ return false;+};++const findFirstMatchingKeyword = (+ text: string | undefined | null,+ keywords: ReadonlyArray<string>,+): string | null => {+ if (!text || keywords.length === 0) return null;+ const lowered = text.toLowerCase();+ for (const keyword of keywords) {+ if (keywordOccursIn(lowered, keyword)) return keyword;+ }+ return null;+};+/*** Pull the platform IDs out of an allowlist value, regardless of which* historical shape it has on disk. Three shapes are all valid input:diff --git a/src/server/services/bot/platforms/discord/client.test.ts b/src/server/services/bot/platforms/discord/client.test.tsindex acb0c28fb1f..603dc1c3713 100644--- a/src/server/services/bot/platforms/discord/client.test.ts+++ b/src/server/services/bot/platforms/discord/client.test.ts@@ -1,4 +1,4 @@-import { describe, expect, it } from 'vitest';+import { describe, expect, it, vi } from 'vitest';import { DiscordClientFactory } from './client';@@ -205,6 +205,94 @@ describe('DiscordGatewayClient', () => {});});+ describe('openThreadForChannelWake (LOBE-8891)', () => {+ // The chat-sdk Discord adapter only auto-spawns a reply thread on+ // @-mention. For the watch-keyword wake path the bot would otherwise+ // reply directly in the parent channel; this hook opens a thread off+ // the triggering message so the conversation stays isolated.++ const installFakeApi = (client: any, impl: () => any) => {+ // The client is constructed in the factory and holds its own+ // DiscordApi via a private field. Reach in and replace the one+ // method we care about for these tests.+ client.discord = {+ ...client.discord,+ startThreadFromMessage: vi.fn(impl),+ };+ return client.discord.startThreadFromMessage as ReturnType<typeof vi.fn>;+ };++ it('spawns a thread off the triggering message for a top-level guild channel', async () => {+ const client = createClient() as any;+ const spy = installFakeApi(client, async () => ({ id: 'new-thread-1' }));++ const result = await client.openThreadForChannelWake('discord:guild-1:channel-1', {+ id: 'msg-99',+ });++ expect(spy).toHaveBeenCalledTimes(1);+ expect(spy.mock.calls[0][0]).toBe('channel-1');+ expect(spy.mock.calls[0][1]).toBe('msg-99');+ expect(result).toBe('discord:guild-1:channel-1:new-thread-1');+ });++ it('returns undefined for DMs (guildId === @me)', async () => {+ const client = createClient() as any;+ const spy = installFakeApi(client, async () => ({ id: 'never-called' }));++ const result = await client.openThreadForChannelWake('discord:@me:dm-1', { id: 'msg-1' });++ expect(spy).not.toHaveBeenCalled();+ expect(result).toBeUndefined();+ });++ it('returns undefined when the threadId already has a thread segment', async () => {+ // 4-segment IDs already deliver replies inside a sub-thread; no+ // need to spawn another.+ const client = createClient() as any;+ const spy = installFakeApi(client, async () => ({ id: 'never-called' }));++ const result = await client.openThreadForChannelWake(+ 'discord:guild-1:channel-1:existing-thread',+ { id: 'msg-1' },+ );++ expect(spy).not.toHaveBeenCalled();+ expect(result).toBeUndefined();+ });++ it('returns undefined when the message has no usable id', async () => {+ const client = createClient() as any;+ const spy = installFakeApi(client, async () => ({ id: 'never-called' }));++ expect(+ await client.openThreadForChannelWake('discord:guild-1:channel-1', undefined),+ ).toBeUndefined();+ expect(+ await client.openThreadForChannelWake('discord:guild-1:channel-1', {}),+ ).toBeUndefined();+ expect(spy).not.toHaveBeenCalled();+ });++ it('returns undefined and swallows the error when the Discord API rejects', async () => {+ // Best-effort contract: a thread-creation failure must NOT bubble+ // up to the router, since the router would then drop the user's+ // message. Falling back to a channel-level reply is the safer+ // failure mode.+ const client = createClient() as any;+ const spy = installFakeApi(client, async () => {+ throw new Error('boom');+ });++ const result = await client.openThreadForChannelWake('discord:guild-1:channel-1', {+ id: 'msg-99',+ });++ expect(spy).toHaveBeenCalledTimes(1);+ expect(result).toBeUndefined();+ });+ });+describe('extractAuthorLocale', () => {const makeMessage = (overrides: Record<string, unknown>) =>({diff --git a/src/server/services/bot/platforms/discord/client.ts b/src/server/services/bot/platforms/discord/client.tsindex 01dd559fc31..a93764132cc 100644--- a/src/server/services/bot/platforms/discord/client.ts+++ b/src/server/services/bot/platforms/discord/client.ts@@ -403,6 +403,64 @@ class DiscordGatewayClient implements PlatformClient {return isSubscribableThread(threadId);}+ /**+ * Spawn a Discord thread off the triggering message when the bot wakes+ * in a top-level guild channel via a watch-keyword match. The chat-sdk+ * adapter only auto-creates a thread on @-mention (see chat-adapter+ * discord/handleForwardedMessageEvent), so without this hook the+ * keyword path would reply directly in the parent channel and clutter+ * it with bot output.+ *+ * Returns the upgraded composite threadId (`discord:guildId:channelId:newThreadId`)+ * so the caller can swap `thread.id` and have all downstream chat-sdk+ * calls — `setReaction`, `subscribe`, `post`, `startTyping` — target+ * the new sub-thread. The reaction call still lands on the parent+ * channel because `resolveReactionThreadId` strips the thread segment+ * when the message ID equals the thread starter.+ *+ * Skipped for DMs (`guildId === '@me'`) and for already-spawned threads+ * (4-segment IDs); both deliver replies in the right context as-is.+ * Best-effort: any API failure logs and returns undefined so the+ * router falls back to the parent channel rather than dropping the+ * message.+ */+ async openThreadForChannelWake(+ threadId: string,+ messageRaw: unknown,+ ): Promise<string | undefined> {+ const parts = threadId.split(':');+ if (parts.length !== 3 || parts[0] !== 'discord' || parts[1] === '@me') return undefined;+ const [, guildId, channelId] = parts;+ if (!channelId) return undefined;+ const raw = messageRaw as Record<string, unknown> | undefined;+ const messageId = typeof raw?.id === 'string' ? raw.id : undefined;+ if (!messageId) return undefined;++ // Mirror chat-sdk's @-mention auto-thread name format (see+ // chat-adapter discord/createDiscordThread) so operators see a+ // consistent thread title regardless of which path opened it.+ const threadName = `Thread ${new Date().toLocaleString()}`;+ try {+ const result = await this.discord.startThreadFromMessage(channelId, messageId, threadName);+ const newThreadId = `discord:${guildId}:${channelId}:${result.id}`;+ log(+ 'openThreadForChannelWake: spawned thread for keyword wake, channel=%s, msg=%s, thread=%s',+ channelId,+ messageId,+ result.id,+ );+ return newThreadId;+ } catch (error) {+ log(+ 'openThreadForChannelWake failed; falling back to channel %s for msg %s: %O',+ channelId,+ messageId,+ error,+ );+ return undefined;+ }+ }+async registerBotCommands(commands: Array<{command: string;diff --git a/src/server/services/bot/platforms/discord/schema.ts b/src/server/services/bot/platforms/discord/schema.tsindex 3b47393a7e7..7bfd50ab5d7 100644--- a/src/server/services/bot/platforms/discord/schema.ts+++ b/src/server/services/bot/platforms/discord/schema.ts@@ -12,6 +12,7 @@ import {makeGroupPolicyFields,makeServerIdField,makeUserIdField,+ watchKeywordsField,} from '../const';import type { FieldSchema } from '../types';import { MAX_DISCORD_HISTORY_LIMIT } from './const';@@ -100,6 +101,7 @@ export const schema: FieldSchema[] = [makeDmPolicyField({ policy: 'open' }),...makeGroupPolicyFields({ policy: 'open' }),allowFromField,+ watchKeywordsField,],type: 'object',},diff --git a/src/server/services/bot/platforms/feishu/definitions/schema.ts b/src/server/services/bot/platforms/feishu/definitions/schema.tsindex c968c0fdd9b..b9ea5f6d9ad 100644--- a/src/server/services/bot/platforms/feishu/definitions/schema.ts+++ b/src/server/services/bot/platforms/feishu/definitions/schema.ts@@ -11,6 +11,7 @@ import {makeDmPolicyField,makeGroupPolicyFields,makeUserIdField,+ watchKeywordsField,} from '../../const';import type { FieldSchema } from '../../types';import { DEFAULT_FEISHU_CONNECTION_MODE, MAX_FEISHU_HISTORY_LIMIT } from '../const';@@ -118,6 +119,7 @@ export const sharedSchema: FieldSchema[] = [makeDmPolicyField({ policy: 'open' }),...makeGroupPolicyFields({ policy: 'open' }),allowFromField,+ watchKeywordsField,],type: 'object',},diff --git a/src/server/services/bot/platforms/index.ts b/src/server/services/bot/platforms/index.tsindex 9c62fa7cf82..9461cd657cb 100644--- a/src/server/services/bot/platforms/index.ts+++ b/src/server/services/bot/platforms/index.ts@@ -20,6 +20,9 @@ export {extractDmSettings,extractGroupSettings,extractUserAllowlist,+ extractWatchKeywordEntries,+ extractWatchKeywords,+ findMatchingWatchKeywordEntries,getBotReplyLocale,getStepReactionEmoji,type GroupPolicy,@@ -28,6 +31,7 @@ export {makeGroupPolicyFields,makeServerIdField,makeUserIdField,+ messageMatchesWatchKeyword,normalizeAllowFromEntries,normalizeBotReplyLocale,RECEIVED_REACTION_EMOJI,@@ -37,6 +41,8 @@ export {THINKING_REACTION_EMOJI,type UserAllowlist,validateAccessSettings,+ type WatchKeywordEntry,+ watchKeywordsField,WORKING_REACTION_EMOJI,} from './const';export { PlatformRegistry } from './registry';diff --git a/src/server/services/bot/platforms/line/schema.ts b/src/server/services/bot/platforms/line/schema.tsindex d7c80657702..f29ee59bf70 100644--- a/src/server/services/bot/platforms/line/schema.ts+++ b/src/server/services/bot/platforms/line/schema.ts@@ -1,6 +1,6 @@import { DEFAULT_BOT_DEBOUNCE_MS, MAX_BOT_DEBOUNCE_MS } from '@lobechat/const';-import { displayToolCallsField, makeUserIdField } from '../const';+import { displayToolCallsField, makeUserIdField, watchKeywordsField } from '../const';import type { FieldSchema } from '../types';export const schema: FieldSchema[] = [@@ -76,6 +76,7 @@ export const schema: FieldSchema[] = [type: 'boolean',},displayToolCallsField,+ watchKeywordsField,],type: 'object',},diff --git a/src/server/services/bot/platforms/qq/schema.ts b/src/server/services/bot/platforms/qq/schema.tsindex 62cb6ac6839..9d7690ff865 100644--- a/src/server/services/bot/platforms/qq/schema.ts+++ b/src/server/services/bot/platforms/qq/schema.ts@@ -6,6 +6,7 @@ import {makeDmPolicyField,makeGroupPolicyFields,makeUserIdField,+ watchKeywordsField,} from '../const';import type { FieldSchema } from '../types';import { DEFAULT_QQ_CONNECTION_MODE } from './const';@@ -90,6 +91,7 @@ export const schema: FieldSchema[] = [makeDmPolicyField({ policy: 'open' }),...makeGroupPolicyFields({ policy: 'open' }),allowFromField,+ watchKeywordsField,],type: 'object',},diff --git a/src/server/services/bot/platforms/slack/schema.ts b/src/server/services/bot/platforms/slack/schema.tsindex 0c9395c2fbe..eff4ec06ad6 100644--- a/src/server/services/bot/platforms/slack/schema.ts+++ b/src/server/services/bot/platforms/slack/schema.ts@@ -12,6 +12,7 @@ import {makeGroupPolicyFields,makeServerIdField,makeUserIdField,+ watchKeywordsField,} from '../const';import type { FieldSchema } from '../types';import { DEFAULT_SLACK_CONNECTION_MODE, MAX_SLACK_HISTORY_LIMIT } from './const';@@ -120,6 +121,7 @@ export const schema: FieldSchema[] = [makeDmPolicyField({ policy: 'open' }),...makeGroupPolicyFields({ policy: 'open' }),allowFromField,+ watchKeywordsField,],type: 'object',},diff --git a/src/server/services/bot/platforms/telegram/schema.ts b/src/server/services/bot/platforms/telegram/schema.tsindex 898e8af8c9e..4f255959be4 100644--- a/src/server/services/bot/platforms/telegram/schema.ts+++ b/src/server/services/bot/platforms/telegram/schema.ts@@ -6,6 +6,7 @@ import {makeDmPolicyField,makeGroupPolicyFields,makeUserIdField,+ watchKeywordsField,} from '../const';import type { FieldSchema } from '../types';@@ -84,6 +85,7 @@ export const schema: FieldSchema[] = [makeDmPolicyField({ policy: 'open' }),...makeGroupPolicyFields({ policy: 'open' }),allowFromField,+ watchKeywordsField,],type: 'object',},diff --git a/src/server/services/bot/platforms/types.ts b/src/server/services/bot/platforms/types.tsindex b5f3052e36b..5e249698222 100644--- a/src/server/services/bot/platforms/types.ts+++ b/src/server/services/bot/platforms/types.ts@@ -221,6 +221,26 @@ export interface PlatformClient {readonly id: string;+ /**+ * Optional hook called from the router when a non-DM message wakes the+ * bot via a watch-keyword match (LOBE-8891). Platforms that prefer to+ * isolate the reply in a sub-thread (Discord, where the chat-sdk+ * auto-creates a thread only on @-mention) should spawn one off the+ * triggering message and return the upgraded composite threadId so the+ * downstream `bridge.handleMention` posts inside the new thread.+ *+ * Return `undefined` (or omit the method) to leave the threadId+ * unchanged — the bot then replies in the original channel, which is+ * the right behaviour for threadless platforms (Telegram / WeChat / QQ)+ * and for Slack / Lark / Feishu where channel-level replies are the+ * conventional response shape.+ *+ * Implementations must be best-effort: any platform error should be+ * caught and `undefined` returned so the router falls back to the+ * original threadId rather than swallowing the user message.+ */+ openThreadForChannelWake?: (threadId: string, messageRaw: unknown) => Promise<string | undefined>;+/** Parse a composite message ID into the platform-native format. */parseMessageId: (compositeId: string) => string | number;diff --git a/src/server/services/bot/platforms/wechat/schema.ts b/src/server/services/bot/platforms/wechat/schema.tsindex a464ee7f86a..3b51821a472 100644--- a/src/server/services/bot/platforms/wechat/schema.ts+++ b/src/server/services/bot/platforms/wechat/schema.ts@@ -1,6 +1,6 @@import { MAX_BOT_DEBOUNCE_MS } from '@lobechat/const';-import { displayToolCallsField } from '../const';+import { displayToolCallsField, watchKeywordsField } from '../const';import type { FieldSchema } from '../types';export const schema: FieldSchema[] = [@@ -46,6 +46,7 @@ export const schema: FieldSchema[] = [type: 'boolean',},displayToolCallsField,+ watchKeywordsField,],type: 'object',},