🤯 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: add gated message monitoring for agent bot channels (#17298)
Rdmclin23449fee032d7
diff --git a/apps/server/src/routers/lambda/agentBotProvider.ts b/apps/server/src/routers/lambda/agentBotProvider.tsindex 5f7536a254f..53f0617237f 100644--- a/apps/server/src/routers/lambda/agentBotProvider.ts+++ b/apps/server/src/routers/lambda/agentBotProvider.ts@@ -15,6 +15,7 @@ import { serverDatabase } from '@/libs/trpc/lambda/middleware';import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt';import {assertBotAccessSettings,+ assertWatchKeywordsWritable,invalidateBotAfterUpdate,mergeBotSettingsForPersist,} from '@/server/services/bot/agentBotProviderSettings';@@ -96,6 +97,13 @@ export const agentBotProviderRouter = router({settings: mergeBotSettingsForPersist(input.platform, input.settings),};assertAccessSettingsForTRPC(payload.settings);+ await assertWatchKeywordsWritable({+ applicationId: input.applicationId,+ platform: input.platform,+ settings: payload.settings,+ userId: ctx.userId,+ workspaceId: ctx.workspaceId ?? undefined,+ });try {return await ctx.agentBotProviderModel.create(payload);} catch (e: any) {@@ -352,6 +360,16 @@ export const agentBotProviderRouter = router({value.settings,);assertAccessSettingsForTRPC(value.settings);+ if (targetPlatform) {+ await assertWatchKeywordsWritable({+ applicationId: targetApplicationId,+ existingSettings: existing?.settings,+ platform: targetPlatform,+ settings: value.settings,+ userId: ctx.userId,+ workspaceId: existing?.workspaceId ?? ctx.workspaceId ?? undefined,+ });+ }}const result = await ctx.agentBotProviderModel.update(id, value);@@ -361,6 +379,7 @@ export const agentBotProviderRouter = router({{applicationId: existing.applicationId,platform: existing.platform,+ settings: existing.settings,userId: ctx.userId,},value,diff --git a/apps/server/src/services/bot/BotMessageRouter.ts b/apps/server/src/services/bot/BotMessageRouter.tsindex e40fc80acf7..e4ec3a7defa 100644--- a/apps/server/src/services/bot/BotMessageRouter.ts+++ b/apps/server/src/services/bot/BotMessageRouter.ts@@ -567,6 +567,37 @@ export class BotMessageRouter {*/const watchKeywordEntries = extractWatchKeywordEntries(info.settings);const watchKeywords: ReadonlyArray<string> = watchKeywordEntries.map((e) => e.keyword);++ /**+ * Watch-keyword wakes ride on passive channel monitoring, which is a+ * gated feature (`messageMonitoring` — see the business featureAccess+ * slot). Checked lazily, only when a keyword (not a mention / DM /+ * command) is the sole wake reason, so access changes take effect on+ * the next message without any cache invalidation. Mentions, DMs,+ * replies, and commands never hit this gate.+ */+ const isMessageMonitoringAllowed = async (+ caller: string,+ threadId: string,+ ): Promise<boolean> => {+ const access = await getBotFeatureAccessState({+ action: 'runtime',+ applicationId,+ feature: 'messageMonitoring',+ platform,+ userId,+ workspaceId: workspaceId ?? undefined,+ });+ if (access.allowed) return true;+ log(+ '%s: watch-keyword wake dropped (messageMonitoring not allowed), agent=%s, platform=%s, thread=%s',+ caller,+ agentId,+ platform,+ threadId,+ );+ return false;+ };/*** The provider's owner platform user ID. Only consulted under the* `pairing` policy, where the gate gives the owner a free pass so they@@ -1166,6 +1197,7 @@ export class BotMessageRouter {}if (matchesWatchKeyword && !isAddressedToBot && !isCommand) {+ if (!(await isMessageMonitoringAllowed('onSubscribedMessage', thread.id))) return;log('onSubscribedMessage: keyword match wakes bot, agent=%s, platform=%s, author=%s, thread=%s, keywords=%o',agentId,@@ -1347,6 +1379,11 @@ export class BotMessageRouter {if (!(isDM && dmCatchAllEnabled) && !matchesWatchKeyword) return;if (matchesWatchKeyword) {+ if (+ !(await isMessageMonitoringAllowed(`onNewMessage (${platform} catch-all)`, thread.id))+ ) {+ return;+ }log('onNewMessage (%s catch-all): keyword match wakes bot in channel, agent=%s, author=%s, thread=%s, keywords=%o',platform,diff --git a/apps/server/src/services/bot/__tests__/BotMessageRouter.test.ts b/apps/server/src/services/bot/__tests__/BotMessageRouter.test.tsindex bd605046d6e..32ed71cc5bb 100644--- a/apps/server/src/services/bot/__tests__/BotMessageRouter.test.ts+++ b/apps/server/src/services/bot/__tests__/BotMessageRouter.test.ts@@ -777,6 +777,50 @@ describe('BotMessageRouter', () => {expect(mockHandleSubscribedMessage).toHaveBeenCalledTimes(1);});+ it('should drop a keyword wake when messageMonitoring access is not allowed', async () => {+ mockGetBotFeatureAccessState.mockImplementation(async (params: any) =>+ params?.feature === 'messageMonitoring'+ ? { allowed: false, requiredPlan: 'paid' }+ : { allowed: true },+ );+ const handler = await loadSubscribedHandler({+ dmPolicy: 'open',+ watchKeywords: [{ 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).not.toHaveBeenCalled();+ expect(mockGetBotFeatureAccessState).toHaveBeenCalledWith(+ expect.objectContaining({ action: 'runtime', feature: 'messageMonitoring' }),+ );+ });++ it('should keep handling mentions when messageMonitoring access is not allowed', async () => {+ // The gate only covers passive keyword wakes — explicit @mentions in+ // the same thread must keep flowing for every plan.+ mockGetBotFeatureAccessState.mockImplementation(async (params: any) =>+ params?.feature === 'messageMonitoring'+ ? { allowed: false, requiredPlan: 'paid' }+ : { allowed: true },+ );+ const handler = await loadSubscribedHandler({+ dmPolicy: 'open',+ watchKeywords: [{ keyword: 'bug' }],+ });+ const thread = makeThread({ isDM: false });+ const message = makeMessage({ isMention: true, text: 'there is a bug, please look' });++ 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',@@ -1490,6 +1534,58 @@ describe('BotMessageRouter', () => {);});+ it('drops a channel keyword wake via catch-all when messageMonitoring is not allowed', async () => {+ mockGetBotFeatureAccessState.mockImplementation(async (params: any) =>+ params?.feature === 'messageMonitoring'+ ? { allowed: false, requiredPlan: 'paid' }+ : { allowed: true },+ );+ 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: 'looks like a bug in checkout',+ };++ await handler(thread, message);++ expect(mockHandleMention).not.toHaveBeenCalled();+ });++ it('keeps DM catch-all handling when messageMonitoring is not allowed', async () => {+ mockGetBotFeatureAccessState.mockImplementation(async (params: any) =>+ params?.feature === 'messageMonitoring'+ ? { allowed: false, requiredPlan: 'paid' }+ : { allowed: true },+ );+ const handler = await loadDmCatchAllHandler({+ dmPolicy: 'open',+ watchKeywords: [{ keyword: 'bug' }],+ });+ if (!handler) throw new Error('expected catch-all to be registered');+ const thread = {+ id: 'discord:dm-1',+ isDM: true,+ post: vi.fn().mockResolvedValue(undefined),+ };+ const message = {+ author: { isBot: false, userId: 'alice-id', userName: 'alice' },+ text: 'hi bot, found a bug',+ };++ await handler(thread, message);++ expect(mockHandleMention).toHaveBeenCalledTimes(1);+ });+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 stilldiff --git a/apps/server/src/services/bot/__tests__/agentBotProviderSettings.test.ts b/apps/server/src/services/bot/__tests__/agentBotProviderSettings.test.tsnew file mode 100644index 00000000000..94ec55dfa27--- /dev/null+++ b/apps/server/src/services/bot/__tests__/agentBotProviderSettings.test.ts@@ -0,0 +1,218 @@+import { beforeEach, describe, expect, it, vi } from 'vitest';++import { assertWatchKeywordsWritable, invalidateBotAfterUpdate } from '../agentBotProviderSettings';++const mockAssertBotFeatureAccess = vi.hoisted(() => vi.fn());+const mockStopClient = vi.hoisted(() => vi.fn());+const mockInvalidateBot = vi.hoisted(() => vi.fn());+const gatewayState = vi.hoisted(() => ({ useMessageGateway: true }));++vi.mock('@/business/server/bot/featureAccess', () => ({+ assertBotFeatureAccess: mockAssertBotFeatureAccess,+}));++vi.mock('@/server/services/gateway', () => ({+ GatewayService: vi.fn(() => ({+ stopClient: mockStopClient,+ get useMessageGateway() {+ return gatewayState.useMessageGateway;+ },+ })),+}));++vi.mock('../BotMessageRouter', () => ({+ getBotMessageRouter: () => ({ invalidateBot: mockInvalidateBot }),+}));++describe('assertWatchKeywordsWritable', () => {+ beforeEach(() => {+ vi.clearAllMocks();+ mockAssertBotFeatureAccess.mockResolvedValue(undefined);+ });++ const base = { platform: 'discord', userId: 'user-1' };++ it('skips when settings are not part of the write', async () => {+ await assertWatchKeywordsWritable({ ...base, settings: undefined });+ expect(mockAssertBotFeatureAccess).not.toHaveBeenCalled();+ });++ it('skips when no keywords are configured (including clearing them)', async () => {+ await assertWatchKeywordsWritable({+ ...base,+ existingSettings: { watchKeywords: [{ keyword: 'bug' }] },+ settings: { watchKeywords: [] },+ });+ expect(mockAssertBotFeatureAccess).not.toHaveBeenCalled();+ });++ it('skips when the keyword set is unchanged (unrelated settings save)', async () => {+ await assertWatchKeywordsWritable({+ ...base,+ existingSettings: { watchKeywords: [{ keyword: 'bug' }] },+ settings: { charLimit: 500, watchKeywords: [{ keyword: 'bug' }] },+ });+ expect(mockAssertBotFeatureAccess).not.toHaveBeenCalled();+ });++ it('asserts feature access when keywords are first added', async () => {+ await assertWatchKeywordsWritable({+ ...base,+ applicationId: 'app-1',+ settings: { watchKeywords: [{ keyword: 'bug' }] },+ workspaceId: 'ws-1',+ });++ expect(mockAssertBotFeatureAccess).toHaveBeenCalledWith({+ action: 'manage',+ applicationId: 'app-1',+ feature: 'messageMonitoring',+ platform: 'discord',+ userId: 'user-1',+ workspaceId: 'ws-1',+ });+ });++ it('asserts feature access when the keyword set changes', async () => {+ await assertWatchKeywordsWritable({+ ...base,+ existingSettings: { watchKeywords: [{ keyword: 'bug' }] },+ settings: { watchKeywords: [{ keyword: 'bug' }, { keyword: 'outage' }] },+ });+ expect(mockAssertBotFeatureAccess).toHaveBeenCalledTimes(1);+ });++ it('skips pure removals that leave other keywords in place', async () => {+ // Downgrade path: a locked plan must be able to prune stale rows one at+ // a time, not only via a single clear-everything edit.+ await assertWatchKeywordsWritable({+ ...base,+ existingSettings: { watchKeywords: [{ keyword: 'bug' }, { keyword: 'outage' }] },+ settings: { watchKeywords: [{ keyword: 'bug' }] },+ });+ expect(mockAssertBotFeatureAccess).not.toHaveBeenCalled();+ });++ it('skips reorders of already-saved keywords', async () => {+ await assertWatchKeywordsWritable({+ ...base,+ existingSettings: { watchKeywords: [{ keyword: 'bug' }, { keyword: 'outage' }] },+ settings: { watchKeywords: [{ keyword: 'outage' }, { keyword: 'bug' }] },+ });+ expect(mockAssertBotFeatureAccess).not.toHaveBeenCalled();+ });++ it('asserts feature access when a keyword is edited in place', async () => {+ await assertWatchKeywordsWritable({+ ...base,+ existingSettings: { watchKeywords: [{ keyword: 'bug' }] },+ settings: { watchKeywords: [{ keyword: 'incident' }] },+ });+ expect(mockAssertBotFeatureAccess).toHaveBeenCalledTimes(1);+ });++ it('propagates the denial from assertBotFeatureAccess', async () => {+ mockAssertBotFeatureAccess.mockRejectedValueOnce(new Error('paid plan required'));++ await expect(+ assertWatchKeywordsWritable({+ ...base,+ settings: { watchKeywords: [{ keyword: 'bug' }] },+ }),+ ).rejects.toThrow('paid plan required');+ });+});++describe('invalidateBotAfterUpdate — monitoring capability flips', () => {+ beforeEach(() => {+ vi.clearAllMocks();+ gatewayState.useMessageGateway = true;+ mockStopClient.mockResolvedValue(undefined);+ mockInvalidateBot.mockResolvedValue(undefined);+ });++ const target = {+ applicationId: 'app-1',+ platform: 'discord',+ userId: 'user-1',+ };++ it('stops the runtime when watch keywords go from none to some', async () => {+ await invalidateBotAfterUpdate(+ { ...target, settings: {} },+ { settings: { watchKeywords: [{ keyword: 'bug' }] } },+ );++ expect(mockStopClient).toHaveBeenCalledWith('discord', 'app-1', 'user-1');+ expect(mockInvalidateBot).toHaveBeenCalledWith('discord', 'app-1');+ });++ it('stops the runtime when watch keywords are cleared', async () => {+ await invalidateBotAfterUpdate(+ { ...target, settings: { watchKeywords: [{ keyword: 'bug' }] } },+ { settings: { watchKeywords: [] } },+ );++ expect(mockStopClient).toHaveBeenCalledTimes(1);+ });++ it('does not stop the runtime on keyword flips without the external gateway', async () => {+ // Local/Vercel runtimes have no reconcile loop to restart a stopped+ // client — and they never consume the edge capability the flip feeds.+ gatewayState.useMessageGateway = false;++ await invalidateBotAfterUpdate(+ { ...target, settings: {} },+ { settings: { watchKeywords: [{ keyword: 'bug' }] } },+ );++ expect(mockStopClient).not.toHaveBeenCalled();+ expect(mockInvalidateBot).toHaveBeenCalledTimes(1);+ });++ it('still stops the runtime for disable/rebind even without the external gateway', async () => {+ gatewayState.useMessageGateway = false;++ await invalidateBotAfterUpdate({ ...target, settings: {} }, { enabled: false });++ expect(mockStopClient).toHaveBeenCalledTimes(1);+ });++ it('does not stop webhook-mode runtimes on keyword flips (no auto-reconnect exists)', async () => {+ // Gateway reconciliation skips webhook-mode providers, so a stop here+ // would take the bot offline until the next manual config save.+ await invalidateBotAfterUpdate(+ { ...target, platform: 'telegram', settings: {} },+ { settings: { watchKeywords: [{ keyword: 'bug' }] } },+ );++ expect(mockStopClient).not.toHaveBeenCalled();+ expect(mockInvalidateBot).toHaveBeenCalledTimes(1);+ });++ it('does not stop the runtime when settings switch the bot into webhook mode', async () => {+ await invalidateBotAfterUpdate(+ { ...target, settings: {} },+ { settings: { connectionMode: 'webhook', watchKeywords: [{ keyword: 'bug' }] } },+ );++ expect(mockStopClient).not.toHaveBeenCalled();+ });++ it('does not stop the runtime when keyword presence is unchanged', async () => {+ await invalidateBotAfterUpdate(+ { ...target, settings: { watchKeywords: [{ keyword: 'bug' }] } },+ { settings: { watchKeywords: [{ keyword: 'outage' }] } },+ );++ expect(mockStopClient).not.toHaveBeenCalled();+ expect(mockInvalidateBot).toHaveBeenCalledTimes(1);+ });++ it('does not stop the runtime for settings-free updates', async () => {+ await invalidateBotAfterUpdate({ ...target, settings: {} }, {});++ expect(mockStopClient).not.toHaveBeenCalled();+ expect(mockInvalidateBot).toHaveBeenCalledTimes(1);+ });+});diff --git a/apps/server/src/services/bot/agentBotProviderSettings.ts b/apps/server/src/services/bot/agentBotProviderSettings.tsindex 8cc545577bd..69e675e37ad 100644--- a/apps/server/src/services/bot/agentBotProviderSettings.ts+++ b/apps/server/src/services/bot/agentBotProviderSettings.ts@@ -1,7 +1,14 @@+import { assertBotFeatureAccess } from '@/business/server/bot/featureAccess';import { GatewayService } from '@/server/services/gateway';import { getBotMessageRouter } from './BotMessageRouter';-import { mergeWithDefaults, platformRegistry, validateAccessSettings } from './platforms';+import {+ extractWatchKeywordEntries,+ mergeWithDefaults,+ platformRegistry,+ resolveConnectionMode,+ validateAccessSettings,+} from './platforms';/*** Merge schema defaults into incoming settings before persisting, so the DB@@ -37,9 +44,49 @@ export function assertBotAccessSettings(settings: Record<string, unknown> | undethrow new Error(message);}+/**+ * Adding or changing watch keywords turns on passive channel monitoring — a+ * gated feature (`messageMonitoring`). Enforced only when the incoming+ * settings actually change the keyword set: unrelated settings saves and+ * keyword removals always pass, so existing configurations are never locked+ * out of their own record (they simply stop matching at runtime while the+ * feature isn't allowed).+ */+export async function assertWatchKeywordsWritable(params: {+ applicationId?: string;+ existingSettings?: Record<string, unknown> | null;+ platform: string;+ settings?: Record<string, unknown>;+ userId: string;+ workspaceId?: string;+}): Promise<void> {+ if (params.settings === undefined) return;+ const next = extractWatchKeywordEntries(params.settings);+ // Clearing (or never having) keywords is always allowed.+ if (next.length === 0) return;+ // Only additions/edits turn on new monitoring capability. Removals and+ // reorders of already-saved entries pass, so a downgraded plan can still+ // prune stale keywords one row at a time.+ const prev = new Set(+ extractWatchKeywordEntries(params.existingSettings ?? undefined).map((e) => JSON.stringify(e)),+ );+ if (next.every((e) => prev.has(JSON.stringify(e)))) return;++ await assertBotFeatureAccess({+ action: 'manage',+ applicationId: params.applicationId,+ feature: 'messageMonitoring',+ platform: params.platform,+ userId: params.userId,+ workspaceId: params.workspaceId,+ });+}+interface BotInvalidationTarget {applicationId: string;platform: string;+ /** Previous settings — enables capability-delta detection (e.g. watch keywords). */+ settings?: Record<string, unknown> | null;/** Owner of the bot — passed to `GatewayService.stopClient` for runtime teardown. */userId: string;}@@ -48,6 +95,7 @@ interface BotInvalidationDelta {applicationId?: string;enabled?: boolean;platform?: string;+ settings?: Record<string, unknown>;}/**@@ -61,13 +109,34 @@ export async function invalidateBotAfterUpdate(existing: BotInvalidationTarget,value: BotInvalidationDelta,): Promise<void> {+ const service = new GatewayService();++ // Watch-keyword presence feeds the external gateway's edge-filtering+ // capability (`messageMonitoring.enabled`), which is only sent at connect+ // time — a flip needs a runtime stop so the reconcile pass reconnects with+ // the fresh capability. Same-presence keyword edits don't need it. Scoped+ // tightly to where that reconnect actually exists:+ // - only when the external message gateway is in use (local/Vercel+ // runtimes have no reconcile loop, a stop there is plain downtime — and+ // they don't consume the capability anyway);+ // - only for non-webhook modes (reconciliation skips webhook providers;+ // their registration refreshes capabilities on config save).+ const monitoringFlipped =+ service.useMessageGateway &&+ value.settings !== undefined &&+ existing.settings !== undefined &&+ extractWatchKeywordEntries(value.settings).length > 0 !==+ extractWatchKeywordEntries(existing.settings ?? undefined).length > 0 &&+ resolveConnectionMode(platformRegistry.getPlatform(existing.platform), value.settings) !==+ 'webhook';+const shouldStopRuntime =value.enabled === false ||(value.applicationId !== undefined && value.applicationId !== existing.applicationId) ||- (value.platform !== undefined && value.platform !== existing.platform);+ (value.platform !== undefined && value.platform !== existing.platform) ||+ monitoringFlipped;if (shouldStopRuntime) {- const service = new GatewayService();await service.stopClient(existing.platform, existing.applicationId, existing.userId);}diff --git a/apps/server/src/services/bot/platforms/const.ts b/apps/server/src/services/bot/platforms/const.tsindex 2acba26231d..1488daf49e0 100644--- a/apps/server/src/services/bot/platforms/const.ts+++ b/apps/server/src/services/bot/platforms/const.ts@@ -399,6 +399,7 @@ export const watchKeywordsField: FieldSchema = {default: [],description: 'channel.watchKeywordsHint',label: 'channel.watchKeywords',+ paidFeature: 'messageMonitoring',type: 'array',items: {key: 'item',diff --git a/apps/server/src/services/bot/platforms/types.ts b/apps/server/src/services/bot/platforms/types.tsindex 63d96367392..771b54a2f48 100644--- a/apps/server/src/services/bot/platforms/types.ts+++ b/apps/server/src/services/bot/platforms/types.ts@@ -29,6 +29,11 @@ export type ConnectionMode = 'polling' | 'webhook' | 'websocket';export interface PlatformAccessMeta {allowed?: boolean;blockedMessage?: string;+ /**+ * Per-feature access flags keyed by feature id (see `FieldSchema.paidFeature`).+ * Platform-level `allowed` stays authoritative for the channel itself.+ */+ features?: Record<string, { allowed: boolean }>;requiredPlan?: 'paid';rolloutMode?: 'enforce' | 'notice';}@@ -62,6 +67,12 @@ export interface FieldSchema {label: string;maximum?: number;minimum?: number;+ /**+ * Marks the field as belonging to a gated feature (by feature id). The+ * frontend renders a paid badge next to the label and disables editing+ * when the platform access meta reports the feature as not allowed.+ */+ paidFeature?: string;placeholder?: string;/** Nested fields (for type: 'object') */properties?: FieldSchema[];diff --git a/apps/server/src/services/gateway/MessageGatewayClient.ts b/apps/server/src/services/gateway/MessageGatewayClient.tsindex 102c42ceaa9..d5662951e91 100644--- a/apps/server/src/services/gateway/MessageGatewayClient.ts+++ b/apps/server/src/services/gateway/MessageGatewayClient.ts@@ -6,9 +6,28 @@ const log = debug('lobe-server:message-gateway-client');// ─── Types ───+/**+ * Feature capabilities the gateway may use to filter inbound traffic at the+ * edge before forwarding to LobeHub. Advisory: the server-side routers stay+ * authoritative, and gateways that don't understand a capability simply+ * forward everything (current behavior).+ */+export interface MessageGatewayCapabilities {+ /**+ * Passive channel monitoring. When disabled, the gateway is free to drop+ * ordinary channel messages (not DMs, not mentions/replies to the bot,+ * not commands/interactions) instead of forwarding them.+ */+ messageMonitoring?: {+ enabled: boolean;+ };+}+export interface MessageGatewayConnectionConfig {/** Platform application ID (e.g., Feishu appId, QQ appId) */applicationId?: string;+ /** Edge-filtering capabilities for this connection. Omitted = forward everything. */+ capabilities?: MessageGatewayCapabilities;connectionId: string;/** Preferred connection mode (e.g., "webhook", "websocket"). Falls back to platform default if omitted. */connectionMode?: string;diff --git a/apps/server/src/services/gateway/__tests__/GatewayService.test.ts b/apps/server/src/services/gateway/__tests__/GatewayService.test.tsindex 86cc2c03694..cae403fb2fa 100644--- a/apps/server/src/services/gateway/__tests__/GatewayService.test.ts+++ b/apps/server/src/services/gateway/__tests__/GatewayService.test.ts@@ -92,6 +92,10 @@ vi.mock('@/business/server/bot/featureAccess', () => ({}));vi.mock('../../bot/platforms', () => ({+ extractWatchKeywordEntries: (settings?: Record<string, unknown>) =>+ Array.isArray(settings?.watchKeywords)+ ? settings.watchKeywords.filter((e: any) => typeof e?.keyword === 'string' && e.keyword)+ : [],platformRegistry: {getPlatform: (platform: string) => ({ id: platform }),listPlatforms: () => [{ id: 'discord' }, { id: 'telegram' }, { id: 'wechat' }],diff --git a/apps/server/src/services/gateway/index.ts b/apps/server/src/services/gateway/index.tsindex 29e1f9953b1..6dec62fd202 100644--- a/apps/server/src/services/gateway/index.ts+++ b/apps/server/src/services/gateway/index.ts@@ -22,11 +22,16 @@ import { messengerPlatformRegistry } from '@/server/services/messenger/platformsimport { type BotRuntimeStatus, type BotRuntimeStatusSnapshot } from '@/types/botRuntimeStatus';import type { ConnectionMode } from '../bot/platforms';-import { platformRegistry, resolveConnectionMode } from '../bot/platforms';+import {+ extractWatchKeywordEntries,+ platformRegistry,+ resolveConnectionMode,+} from '../bot/platforms';import { BOT_CONNECT_QUEUE_EXPIRE_MS, BotConnectQueue } from './botConnectQueue';import { createGatewayManager, getGatewayManager } from './GatewayManager';import {getMessageGatewayClient,+ type MessageGatewayCapabilities,type MessageGatewayConnectionStatus,} from './MessageGatewayClient';import { BOT_RUNTIME_STATUSES, getBotRuntimeStatus, updateBotRuntimeStatus } from './runtimeStatus';@@ -102,6 +107,19 @@ function mapGatewayStatusToRuntimeStatus(const log = debug('lobe-server:service:gateway');+/**+ * Derive edge-filtering capabilities for a bot-channel connection from its+ * settings. Monitoring is enabled purely by "has watch keywords configured":+ * feature-access gating stays server-side (BotMessageRouter), so access+ * changes never require a gateway reconnect and operators with existing+ * rules are never cut off by a stale edge config.+ */+const resolveBotGatewayCapabilities = (+ settings?: Record<string, unknown> | null,+): MessageGatewayCapabilities => ({+ messageMonitoring: { enabled: extractWatchKeywordEntries(settings ?? undefined).length > 0 },+});+const isVercel = !!process.env.VERCEL_ENV;export class GatewayService {@@ -239,6 +257,7 @@ export class GatewayService {const result = await client.connect({applicationId: provider.applicationId,+ capabilities: resolveBotGatewayCapabilities(provider.settings),connectionId: provider.id,connectionMode,credentials: provider.credentials,@@ -834,6 +853,10 @@ export class GatewayService {const client = getMessageGatewayClient();await client.connect({applicationId: creds.applicationId,+ // Messenger-owned connections never consume passive channel+ // monitoring — the shared bot only reacts to DMs and explicit+ // mentions, so the gateway may drop ordinary channel messages.+ capabilities: { messageMonitoring: { enabled: false } },connectionId,// The user DO is purely an outbound surface for typing; no inbound// events come back through this connection. Webhook mode prevents the@@ -911,6 +934,7 @@ export class GatewayService {await client.connect({applicationId: provider.applicationId,+ capabilities: resolveBotGatewayCapabilities(provider.settings),connectionId: provider.id,connectionMode,credentials: provider.credentials,diff --git a/apps/server/src/services/toolExecution/serverRuntimes/message/index.ts b/apps/server/src/services/toolExecution/serverRuntimes/message/index.tsindex 50a69ae28ec..e3248b24ea2 100644--- a/apps/server/src/services/toolExecution/serverRuntimes/message/index.ts+++ b/apps/server/src/services/toolExecution/serverRuntimes/message/index.ts@@ -21,6 +21,7 @@ import { agents } from '@/database/schemas';import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt';import {assertBotAccessSettings,+ assertWatchKeywordsWritable,invalidateBotAfterUpdate,mergeBotSettingsForPersist,} from '@/server/services/bot/agentBotProviderSettings';@@ -265,6 +266,13 @@ export const messageRuntime: ServerRuntimeRegistration = {});const settings = mergeBotSettingsForPersist(params.platform, params.settings);assertBotAccessSettings(settings);+ await assertWatchKeywordsWritable({+ applicationId: params.applicationId,+ platform: params.platform,+ settings,+ userId: context.userId!,+ workspaceId: context.workspaceId ?? undefined,+ });const result = await providerModel.create({ ...params, settings });return { id: result.id, platform: params.platform };},@@ -371,6 +379,14 @@ export const messageRuntime: ServerRuntimeRegistration = {if (params.settings !== undefined) {const merged = mergeBotSettingsForPersist(existing.platform, params.settings);assertBotAccessSettings(merged);+ await assertWatchKeywordsWritable({+ applicationId: existing.applicationId,+ existingSettings: existing.settings,+ platform: existing.platform,+ settings: merged,+ userId: context.userId!,+ workspaceId: existing.workspaceId ?? undefined,+ });value.settings = merged;}@@ -379,9 +395,10 @@ export const messageRuntime: ServerRuntimeRegistration = {{applicationId: existing.applicationId,platform: existing.platform,+ settings: existing.settings,userId: context.userId!,},- {},+ value,);},diff --git a/locales/ar/agent.json b/locales/ar/agent.jsonindex f6a9bf88f98..205c06cd4cf 100644--- a/locales/ar/agent.json+++ b/locales/ar/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} متاح في الخطط الشخصية المدفوعة. قم بالترقية لتكوين هذا القناة والحفاظ على اتصالها.","channel.paidFeature.enforce.desc.workspace": "{{name}} متاح في مساحات العمل المحترفة / التجارية. قم بترقية مساحة العمل هذه لتكوين هذا القناة والحفاظ على اتصالها.","channel.paidFeature.enforce.title": "يتطلب خطة مدفوعة",+ "channel.paidFeature.fieldLocked": "متاح في الخطط المدفوعة. قم بالترقية لتكوين هذه الميزة.","channel.paidFeature.notice.desc": "نظرًا للتكاليف العالية للتواصل عبر قناة {{name}}، نخطط لجعل هذه القناة ميزة مدفوعة قريبًا. تظل الاتصالات الحالية متاحة خلال فترة الإشعار، ولكن إنشاء أو إعادة توصيل هذه القناة يتطلب الآن خطة شخصية مدفوعة أو مساحة عمل محترفة / تجارية.","channel.paidFeature.notice.desc.personal": "نظرًا للتكاليف العالية للتواصل عبر قناة {{name}}، نخطط لجعل هذه القناة ميزة مدفوعة قريبًا. تظل الاتصالات الحالية متاحة خلال فترة الإشعار، ولكن إنشاء أو إعادة توصيل هذه القناة يتطلب خطة شخصية مدفوعة.","channel.paidFeature.notice.desc.workspace": "نظرًا للتكاليف العالية للتواصل عبر قناة {{name}}، نخطط لجعل هذه القناة ميزة مدفوعة قريبًا. تظل الاتصالات الحالية متاحة خلال فترة الإشعار، ولكن إنشاء أو إعادة توصيل هذه القناة يتطلب ترقية مساحة العمل هذه إلى محترف أو تجاري.",diff --git a/locales/ar/subscription.json b/locales/ar/subscription.jsonindex 797b83165b1..0e1172076af 100644--- a/locales/ar/subscription.json+++ b/locales/ar/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "المزيد من النماذج في مقارنة الخطط","plans.message.normalLLM": "نماذج قياسية","plans.message.tooltip": "تقدير بناءً على متوسط {{number}} رمز لكل رسالة",+ "plans.messageChannels.monitoring": "مراقبة الرسائل","plans.messageChannels.title": "قنوات الرسائل","plans.messageChannels.wechat": "قناة WeChat","plans.mostPicked": "الأكثر اختيارًا",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "يتم إعادة تعيين الحصة في {{time}}","usage.credit.addon.used": "أرصدة مشحونة","usage.credit.desc": "استخدام الأرصدة للدردشة، توليد الصور، تحويل النص إلى كلام",- "usage.credit.detail": "إحصائيات الاستخدام لآخر {{day}} يومًا","usage.credit.free.desc": "يتم إعادة تعيين الحصة في {{time}}","usage.credit.free.expired": "انتهت في {{date}}","usage.credit.free.used": "أرصدة مجانية",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "تخزين المتجهات","usage.storage.file.used": "استخدام الملفات","usage.storage.title": "تخزين البيانات",- "usage.title": "استخدام هذا الشهر","usage.used": "تم الاستخدام","zarinpal.infoModal.desc": "بسبب المتطلبات التنظيمية، يرجى إكمال المعلومات الشخصية التالية قبل تقديم الطلب:","zarinpal.infoModal.phone.label": "رقم الهاتف",diff --git a/locales/bg-BG/agent.json b/locales/bg-BG/agent.jsonindex 3e373ca9ce8..59967611a07 100644--- a/locales/bg-BG/agent.json+++ b/locales/bg-BG/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} е наличен в платените лични планове. Надградете, за да конфигурирате и запазите този канал свързан.","channel.paidFeature.enforce.desc.workspace": "{{name}} е наличен в Pro / Business работни пространства. Надградете това работно пространство, за да конфигурирате и запазите този канал свързан.","channel.paidFeature.enforce.title": "Изисква се платен план",+ "channel.paidFeature.fieldLocked": "Налично в платени планове. Надградете, за да конфигурирате тази функция.","channel.paidFeature.notice.desc": "Поради високите разходи за комуникация за канала {{name}}, планираме скоро да направим този канал платена функция. Съществуващите връзки остават налични по време на уведомителния период, но създаването или повторното свързване на този канал сега изисква платен личен план или Pro / Business работно пространство.","channel.paidFeature.notice.desc.personal": "Поради високите разходи за комуникация за канала {{name}}, планираме скоро да направим този канал платена функция. Съществуващите връзки остават налични по време на уведомителния период, но създаването или повторното свързване на този канал изисква платен личен план.","channel.paidFeature.notice.desc.workspace": "Поради високите разходи за комуникация за канала {{name}}, планираме скоро да направим този канал платена функция. Съществуващите връзки остават налични по време на уведомителния период, но създаването или повторното свързване на този канал изисква надграждане на това работно пространство до Pro или Business.",diff --git a/locales/bg-BG/subscription.json b/locales/bg-BG/subscription.jsonindex 276152dc6d6..1231673f1a2 100644--- a/locales/bg-BG/subscription.json+++ b/locales/bg-BG/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Още модели в сравнението на планове","plans.message.normalLLM": "Стандартни модели","plans.message.tooltip": "Оценено на база средно {{number}} токена на съобщение",+ "plans.messageChannels.monitoring": "Мониторинг на съобщения","plans.messageChannels.title": "Канали за съобщения","plans.messageChannels.wechat": "Канал WeChat","plans.mostPicked": "Най-популярен",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "Квотата се нулира след {{time}}","usage.credit.addon.used": "Закупени кредити","usage.credit.desc": "Използване на кредити за AI чат, генериране на изображения, синтез на реч",- "usage.credit.detail": "Статистика за използване през последните {{day}} дни","usage.credit.free.desc": "Квотата се нулира след {{time}}","usage.credit.free.expired": "Изтекъл на {{date}}","usage.credit.free.used": "Безплатни кредити",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Векторно съхранение","usage.storage.file.used": "Използване на файлове","usage.storage.title": "Съхранение на данни",- "usage.title": "Използване този месец","usage.used": "Използвано","zarinpal.infoModal.desc": "Поради изисквания на политиката, моля попълнете следната лична информация преди да направите поръчка:","zarinpal.infoModal.phone.label": "Телефонен номер",diff --git a/locales/de-DE/agent.json b/locales/de-DE/agent.jsonindex 273213a87de..1a2c1d2699f 100644--- a/locales/de-DE/agent.json+++ b/locales/de-DE/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} ist in kostenpflichtigen persönlichen Tarifen verfügbar. Upgrade, um diesen Kanal zu konfigurieren und verbunden zu halten.","channel.paidFeature.enforce.desc.workspace": "{{name}} ist in Pro-/Business-Workspaces verfügbar. Upgrade dieses Workspaces, um diesen Kanal zu konfigurieren und verbunden zu halten.","channel.paidFeature.enforce.title": "Kostenpflichtiger Tarif erforderlich",+ "channel.paidFeature.fieldLocked": "Verfügbar in kostenpflichtigen Tarifen. Upgrade erforderlich, um diese Funktion zu konfigurieren.","channel.paidFeature.notice.desc": "Aufgrund der hohen Kommunikationskosten für den {{name}}-Kanal planen wir, diesen Kanal bald zu einer kostenpflichtigen Funktion zu machen. Bestehende Verbindungen bleiben während der Ankündigungsfrist verfügbar, aber das Erstellen oder erneute Verbinden dieses Kanals erfordert jetzt einen kostenpflichtigen persönlichen Tarif oder ein Pro-/Business-Workspace.","channel.paidFeature.notice.desc.personal": "Aufgrund der hohen Kommunikationskosten für den {{name}}-Kanal planen wir, diesen Kanal bald zu einer kostenpflichtigen Funktion zu machen. Bestehende Verbindungen bleiben während der Ankündigungsfrist verfügbar, aber das Erstellen oder erneute Verbinden dieses Kanals erfordert einen kostenpflichtigen persönlichen Tarif.","channel.paidFeature.notice.desc.workspace": "Aufgrund der hohen Kommunikationskosten für den {{name}}-Kanal planen wir, diesen Kanal bald zu einer kostenpflichtigen Funktion zu machen. Bestehende Verbindungen bleiben während der Ankündigungsfrist verfügbar, aber das Erstellen oder erneute Verbinden dieses Kanals erfordert ein Upgrade dieses Workspaces auf Pro oder Business.",diff --git a/locales/de-DE/subscription.json b/locales/de-DE/subscription.jsonindex 12e506da7e4..951d951f91e 100644--- a/locales/de-DE/subscription.json+++ b/locales/de-DE/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Weitere Modelle im Planvergleich","plans.message.normalLLM": "Standardmodelle","plans.message.tooltip": "Geschätzt auf Basis von durchschnittlich {{number}} Tokens pro Nachricht",+ "plans.messageChannels.monitoring": "Nachrichtenüberwachung","plans.messageChannels.title": "Nachrichtenkanäle","plans.messageChannels.wechat": "WeChat-Kanal","plans.mostPicked": "Am beliebtesten",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "Kontingent wird in {{time}} zurückgesetzt","usage.credit.addon.used": "Aufgeladene Credits","usage.credit.desc": "Credit-Nutzung für KI-Chat, Bildgenerierung, Sprachausgabe",- "usage.credit.detail": "Nutzungsstatistik der letzten {{day}} Tage","usage.credit.free.desc": "Kontingent wird in {{time}} zurückgesetzt","usage.credit.free.expired": "Abgelaufen am {{date}}","usage.credit.free.used": "Kostenlose Credits",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Vektorspeicher","usage.storage.file.used": "Dateinutzung","usage.storage.title": "Datenspeicher",- "usage.title": "Nutzung in diesem Monat","usage.used": "Verbraucht","zarinpal.infoModal.desc": "Aufgrund gesetzlicher Vorgaben geben Sie bitte vor dem Kauf folgende Informationen an:","zarinpal.infoModal.phone.label": "Telefonnummer",diff --git a/locales/en-US/agent.json b/locales/en-US/agent.jsonindex 0e5639d6725..09c27fc1d78 100644--- a/locales/en-US/agent.json+++ b/locales/en-US/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} is available on paid personal plans. Upgrade to configure and keep this channel connected.","channel.paidFeature.enforce.desc.workspace": "{{name}} is available on Pro / Business workspaces. Upgrade this workspace to configure and keep this channel connected.","channel.paidFeature.enforce.title": "Paid plan required",+ "channel.paidFeature.fieldLocked": "Available on paid plans. Upgrade to configure this feature.","channel.paidFeature.notice.desc": "Due to the high communication costs for the {{name}} channel, we plan to make this channel a paid feature soon. Existing connections remain available during the notice period, but creating or reconnecting this channel now requires a paid personal plan or a Pro / Business workspace.","channel.paidFeature.notice.desc.personal": "Due to the high communication costs for the {{name}} channel, we plan to make this channel a paid feature soon. Existing connections remain available during the notice period, but creating or reconnecting this channel requires a paid personal plan.","channel.paidFeature.notice.desc.workspace": "Due to the high communication costs for the {{name}} channel, we plan to make this channel a paid feature soon. Existing connections remain available during the notice period, but creating or reconnecting this channel requires upgrading this workspace to Pro or Business.",diff --git a/locales/en-US/subscription.json b/locales/en-US/subscription.jsonindex 7cdafd948f8..7cec1a423fc 100644--- a/locales/en-US/subscription.json+++ b/locales/en-US/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "More models in plan comparison","plans.message.normalLLM": "Standard Models","plans.message.tooltip": "Estimated based on average {{number}} tokens per message",+ "plans.messageChannels.monitoring": "Message monitoring","plans.messageChannels.title": "Message Channels","plans.messageChannels.wechat": "WeChat channel","plans.mostPicked": "Most Popular",diff --git a/locales/es-ES/agent.json b/locales/es-ES/agent.jsonindex 4ba2f954f67..2fb3a61831b 100644--- a/locales/es-ES/agent.json+++ b/locales/es-ES/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} está disponible en planes personales de pago. Actualiza para configurar y mantener este canal conectado.","channel.paidFeature.enforce.desc.workspace": "{{name}} está disponible en espacios de trabajo Pro / Business. Actualiza este espacio de trabajo para configurar y mantener este canal conectado.","channel.paidFeature.enforce.title": "Se requiere un plan de pago",+ "channel.paidFeature.fieldLocked": "Disponible en planes de pago. Actualiza para configurar esta función.","channel.paidFeature.notice.desc": "Debido a los altos costos de comunicación del canal {{name}}, planeamos convertir este canal en una función de pago pronto. Las conexiones existentes seguirán disponibles durante el período de aviso, pero crear o reconectar este canal ahora requiere un plan personal de pago o un espacio de trabajo Pro / Business.","channel.paidFeature.notice.desc.personal": "Debido a los altos costos de comunicación del canal {{name}}, planeamos convertir este canal en una función de pago pronto. Las conexiones existentes seguirán disponibles durante el período de aviso, pero crear o reconectar este canal requiere un plan personal de pago.","channel.paidFeature.notice.desc.workspace": "Debido a los altos costos de comunicación del canal {{name}}, planeamos convertir este canal en una función de pago pronto. Las conexiones existentes seguirán disponibles durante el período de aviso, pero crear o reconectar este canal requiere actualizar este espacio de trabajo a Pro o Business.",diff --git a/locales/es-ES/subscription.json b/locales/es-ES/subscription.jsonindex 0ea8334abb7..c98bfdf897e 100644--- a/locales/es-ES/subscription.json+++ b/locales/es-ES/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Más modelos en comparación de planes","plans.message.normalLLM": "Modelos Estándar","plans.message.tooltip": "Estimado en base a un promedio de {{number}} tokens por mensaje",+ "plans.messageChannels.monitoring": "Monitoreo de mensajes","plans.messageChannels.title": "Canales de Mensajes","plans.messageChannels.wechat": "Canal de WeChat","plans.mostPicked": "Más Popular",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "La cuota se reinicia en {{time}}","usage.credit.addon.used": "Créditos Recargados","usage.credit.desc": "Uso de créditos para chat con IA, generación de imágenes, síntesis de voz",- "usage.credit.detail": "Estadísticas de uso de los últimos {{day}} días","usage.credit.free.desc": "La cuota se reinicia en {{time}}","usage.credit.free.expired": "Expiró el {{date}}","usage.credit.free.used": "Créditos Gratuitos",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Almacenamiento Vectorial","usage.storage.file.used": "Uso de Archivos","usage.storage.title": "Almacenamiento de Datos",- "usage.title": "Uso de Este Mes","usage.used": "Usado","zarinpal.infoModal.desc": "Por requisitos de política, por favor completa la siguiente información personal antes de realizar el pedido:","zarinpal.infoModal.phone.label": "Número de Teléfono",diff --git a/locales/fa-IR/agent.json b/locales/fa-IR/agent.jsonindex 54772aa5568..e99386575a9 100644--- a/locales/fa-IR/agent.json+++ b/locales/fa-IR/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} در طرحهای شخصی پولی در دسترس است. برای پیکربندی و نگه داشتن این کانال متصل، ارتقا دهید.","channel.paidFeature.enforce.desc.workspace": "{{name}} در فضاهای کاری حرفهای / تجاری در دسترس است. برای پیکربندی و نگه داشتن این کانال متصل، این فضای کاری را ارتقا دهید.","channel.paidFeature.enforce.title": "نیاز به طرح پولی",+ "channel.paidFeature.fieldLocked": "این ویژگی در طرحهای پولی موجود است. برای تنظیم این ویژگی ارتقا دهید.","channel.paidFeature.notice.desc": "به دلیل هزینههای بالای ارتباطی برای کانال {{name}}، قصد داریم این کانال را به یک ویژگی پولی تبدیل کنیم. اتصالات موجود در طول دوره اطلاعرسانی در دسترس باقی میمانند، اما ایجاد یا اتصال مجدد این کانال اکنون نیاز به یک طرح شخصی پولی یا یک فضای کاری حرفهای / تجاری دارد.","channel.paidFeature.notice.desc.personal": "به دلیل هزینههای بالای ارتباطی برای کانال {{name}}، قصد داریم این کانال را به یک ویژگی پولی تبدیل کنیم. اتصالات موجود در طول دوره اطلاعرسانی در دسترس باقی میمانند، اما ایجاد یا اتصال مجدد این کانال نیاز به یک طرح شخصی پولی دارد.","channel.paidFeature.notice.desc.workspace": "به دلیل هزینههای بالای ارتباطی برای کانال {{name}}، قصد داریم این کانال را به یک ویژگی پولی تبدیل کنیم. اتصالات موجود در طول دوره اطلاعرسانی در دسترس باقی میمانند، اما ایجاد یا اتصال مجدد این کانال نیاز به ارتقای این فضای کاری به حرفهای یا تجاری دارد.",diff --git a/locales/fa-IR/subscription.json b/locales/fa-IR/subscription.jsonindex 1de1481b6b6..da892f52df4 100644--- a/locales/fa-IR/subscription.json+++ b/locales/fa-IR/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "مدلهای بیشتر در مقایسه طرحها","plans.message.normalLLM": "مدلهای استاندارد","plans.message.tooltip": "بر اساس میانگین {{number}} توکن در هر پیام تخمین زده شده",+ "plans.messageChannels.monitoring": "نظارت بر پیامها","plans.messageChannels.title": "کانالهای پیام","plans.messageChannels.wechat": "کانال ویچت","plans.mostPicked": "محبوبترین",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "سهمیه در {{time}} بازنشانی میشود","usage.credit.addon.used": "اعتبارات شارژشده","usage.credit.desc": "استفاده از اعتبارات برای چت هوش مصنوعی، تولید تصویر، تبدیل گفتار",- "usage.credit.detail": "آمار استفاده در {{day}} روز گذشته","usage.credit.free.desc": "سهمیه در {{time}} بازنشانی میشود","usage.credit.free.expired": "منقضی شده در {{date}}","usage.credit.free.used": "اعتبارات رایگان",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "ذخیرهسازی برداری","usage.storage.file.used": "استفاده از فایل","usage.storage.title": "ذخیرهسازی داده",- "usage.title": "استفاده این ماه","usage.used": "استفادهشده","zarinpal.infoModal.desc": "به دلیل الزامات سیاستی، لطفاً اطلاعات شخصی زیر را پیش از ثبت سفارش تکمیل کنید:","zarinpal.infoModal.phone.label": "شماره تلفن",diff --git a/locales/fr-FR/agent.json b/locales/fr-FR/agent.jsonindex 707bc34f52d..4fafcc93af2 100644--- a/locales/fr-FR/agent.json+++ b/locales/fr-FR/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} est disponible avec des plans personnels payants. Passez à un plan payant pour configurer et maintenir ce canal connecté.","channel.paidFeature.enforce.desc.workspace": "{{name}} est disponible dans les espaces de travail Pro / Business. Mettez à niveau cet espace de travail pour configurer et maintenir ce canal connecté.","channel.paidFeature.enforce.title": "Plan payant requis",+ "channel.paidFeature.fieldLocked": "Disponible avec les plans payants. Mettez à niveau pour configurer cette fonctionnalité.","channel.paidFeature.notice.desc": "En raison des coûts élevés de communication pour le canal {{name}}, nous prévoyons de rendre ce canal une fonctionnalité payante prochainement. Les connexions existantes restent disponibles pendant la période de préavis, mais la création ou la reconnexion de ce canal nécessite désormais un plan personnel payant ou un espace de travail Pro / Business.","channel.paidFeature.notice.desc.personal": "En raison des coûts élevés de communication pour le canal {{name}}, nous prévoyons de rendre ce canal une fonctionnalité payante prochainement. Les connexions existantes restent disponibles pendant la période de préavis, mais la création ou la reconnexion de ce canal nécessite un plan personnel payant.","channel.paidFeature.notice.desc.workspace": "En raison des coûts élevés de communication pour le canal {{name}}, nous prévoyons de rendre ce canal une fonctionnalité payante prochainement. Les connexions existantes restent disponibles pendant la période de préavis, mais la création ou la reconnexion de ce canal nécessite de mettre à niveau cet espace de travail vers Pro ou Business.",diff --git a/locales/fr-FR/subscription.json b/locales/fr-FR/subscription.jsonindex 1f5a72aa5e8..b810e9309cb 100644--- a/locales/fr-FR/subscription.json+++ b/locales/fr-FR/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Plus de modèles dans la comparaison des plans","plans.message.normalLLM": "Modèles standards","plans.message.tooltip": "Estimation basée sur une moyenne de {{number}} tokens par message",+ "plans.messageChannels.monitoring": "Surveillance des messages","plans.messageChannels.title": "Canaux de messages","plans.messageChannels.wechat": "Canal WeChat","plans.mostPicked": "Le plus populaire",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "Quota réinitialisé dans {{time}}","usage.credit.addon.used": "Crédits supplémentaires","usage.credit.desc": "Utilisation des crédits pour chat IA, génération d’images, synthèse vocale",- "usage.credit.detail": "Statistiques d’utilisation des {{day}} derniers jours","usage.credit.free.desc": "Quota réinitialisé dans {{time}}","usage.credit.free.expired": "Expiré le {{date}}","usage.credit.free.used": "Crédits gratuits",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Stockage vectoriel","usage.storage.file.used": "Utilisation des fichiers","usage.storage.title": "Stockage de données",- "usage.title": "Utilisation ce mois-ci","usage.used": "Utilisé","zarinpal.infoModal.desc": "Conformément aux exigences réglementaires, veuillez remplir les informations suivantes avant de passer commande :","zarinpal.infoModal.phone.label": "Numéro de téléphone",diff --git a/locales/it-IT/agent.json b/locales/it-IT/agent.jsonindex 830c6c1488b..7c02c331583 100644--- a/locales/it-IT/agent.json+++ b/locales/it-IT/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} è disponibile nei piani personali a pagamento. Passa a un piano a pagamento per configurare e mantenere questo canale connesso.","channel.paidFeature.enforce.desc.workspace": "{{name}} è disponibile nei workspace Pro / Business. Aggiorna questo workspace per configurare e mantenere questo canale connesso.","channel.paidFeature.enforce.title": "Piano a pagamento richiesto",+ "channel.paidFeature.fieldLocked": "Disponibile nei piani a pagamento. Effettua l'upgrade per configurare questa funzione.","channel.paidFeature.notice.desc": "A causa degli elevati costi di comunicazione per il canale {{name}}, prevediamo di rendere questo canale una funzionalità a pagamento a breve. Le connessioni esistenti rimangono disponibili durante il periodo di preavviso, ma creare o riconnettere questo canale ora richiede un piano personale a pagamento o un workspace Pro / Business.","channel.paidFeature.notice.desc.personal": "A causa degli elevati costi di comunicazione per il canale {{name}}, prevediamo di rendere questo canale una funzionalità a pagamento a breve. Le connessioni esistenti rimangono disponibili durante il periodo di preavviso, ma creare o riconnettere questo canale richiede un piano personale a pagamento.","channel.paidFeature.notice.desc.workspace": "A causa degli elevati costi di comunicazione per il canale {{name}}, prevediamo di rendere questo canale una funzionalità a pagamento a breve. Le connessioni esistenti rimangono disponibili durante il periodo di preavviso, ma creare o riconnettere questo canale richiede l'aggiornamento di questo workspace a Pro o Business.",diff --git a/locales/it-IT/subscription.json b/locales/it-IT/subscription.jsonindex c886bb099b2..f7e23bc3a91 100644--- a/locales/it-IT/subscription.json+++ b/locales/it-IT/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Altri modelli nel confronto piani","plans.message.normalLLM": "Modelli standard","plans.message.tooltip": "Stima basata su una media di {{number}} token per messaggio",+ "plans.messageChannels.monitoring": "Monitoraggio dei messaggi","plans.messageChannels.title": "Canali di Messaggistica","plans.messageChannels.wechat": "Canale WeChat","plans.mostPicked": "Il più scelto",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "La quota si azzera tra {{time}}","usage.credit.addon.used": "Crediti Ricaricati","usage.credit.desc": "Utilizzo crediti per chat AI, generazione immagini, sintesi vocale",- "usage.credit.detail": "Statistiche di utilizzo degli ultimi {{day}} giorni","usage.credit.free.desc": "La quota si azzera tra {{time}}","usage.credit.free.expired": "Scaduto il {{date}}","usage.credit.free.used": "Crediti Gratuiti",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Archiviazione Vettoriale","usage.storage.file.used": "Utilizzo File","usage.storage.title": "Archiviazione Dati",- "usage.title": "Utilizzo di Questo Mese","usage.used": "Utilizzato","zarinpal.infoModal.desc": "A causa di requisiti normativi, completa le seguenti informazioni personali prima di effettuare un ordine:","zarinpal.infoModal.phone.label": "Numero di Telefono",diff --git a/locales/ja-JP/agent.json b/locales/ja-JP/agent.jsonindex 7dd0e5d46e3..5bb3cbaf614 100644--- a/locales/ja-JP/agent.json+++ b/locales/ja-JP/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}}は有料の個人プランで利用可能です。アップグレードして、このチャンネルを設定し接続を維持してください。","channel.paidFeature.enforce.desc.workspace": "{{name}}はプロ/ビジネスワークスペースで利用可能です。このワークスペースをアップグレードして、このチャンネルを設定し接続を維持してください。","channel.paidFeature.enforce.title": "有料プランが必要です",+ "channel.paidFeature.fieldLocked": "有料プランで利用可能です。この機能を設定するにはアップグレードしてください。","channel.paidFeature.notice.desc": "{{name}}チャンネルの高い通信コストのため、このチャンネルを有料機能にする予定です。通知期間中は既存の接続が利用可能ですが、現在このチャンネルを作成または再接続するには、有料の個人プランまたはプロ/ビジネスワークスペースが必要です。","channel.paidFeature.notice.desc.personal": "{{name}}チャンネルの高い通信コストのため、このチャンネルを有料機能にする予定です。通知期間中は既存の接続が利用可能ですが、このチャンネルを作成または再接続するには、有料の個人プランが必要です。","channel.paidFeature.notice.desc.workspace": "{{name}}チャンネルの高い通信コストのため、このチャンネルを有料機能にする予定です。通知期間中は既存の接続が利用可能ですが、このチャンネルを作成または再接続するには、このワークスペースをプロまたはビジネスにアップグレードする必要があります。",diff --git a/locales/ja-JP/subscription.json b/locales/ja-JP/subscription.jsonindex 7c3519a37ec..4e684d090d5 100644--- a/locales/ja-JP/subscription.json+++ b/locales/ja-JP/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "プラン比較でさらに多くのモデルを確認","plans.message.normalLLM": "標準モデル","plans.message.tooltip": "1メッセージあたり平均{{number}}トークンで推定",+ "plans.messageChannels.monitoring": "メッセージ監視","plans.messageChannels.title": "メッセージチャンネル","plans.messageChannels.wechat": "WeChatチャンネル","plans.mostPicked": "人気プラン",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "クォータは{{time}}にリセットされます","usage.credit.addon.used": "チャージクレジット","usage.credit.desc": "AIチャット、画像生成、音声合成のクレジット使用状況",- "usage.credit.detail": "過去{{day}}日間の使用統計","usage.credit.free.desc": "クォータは{{time}}にリセットされます","usage.credit.free.expired": "{{date}}に失効","usage.credit.free.used": "無料クレジット",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "ベクトルストレージ","usage.storage.file.used": "ファイル使用量","usage.storage.title": "データストレージ",- "usage.title": "今月の使用状況","usage.used": "使用済み","zarinpal.infoModal.desc": "ポリシー要件により、ご注文前に以下の個人情報を入力してください:","zarinpal.infoModal.phone.label": "電話番号",diff --git a/locales/ko-KR/agent.json b/locales/ko-KR/agent.jsonindex c165ca0876c..0aacdd4d3fe 100644--- a/locales/ko-KR/agent.json+++ b/locales/ko-KR/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}}은 유료 개인 플랜에서 사용할 수 있습니다. 업그레이드하여 이 채널을 설정하고 연결 상태를 유지하세요.","channel.paidFeature.enforce.desc.workspace": "{{name}}은 프로/비즈니스 워크스페이스에서 사용할 수 있습니다. 이 워크스페이스를 업그레이드하여 이 채널을 설정하고 연결 상태를 유지하세요.","channel.paidFeature.enforce.title": "유료 플랜 필요",+ "channel.paidFeature.fieldLocked": "유료 플랜에서 사용 가능합니다. 이 기능을 설정하려면 업그레이드하세요.","channel.paidFeature.notice.desc": "{{name}} 채널의 높은 통신 비용으로 인해 이 채널을 곧 유료 기능으로 전환할 계획입니다. 기존 연결은 공지 기간 동안 계속 사용할 수 있지만, 지금 이 채널을 생성하거나 다시 연결하려면 유료 개인 플랜 또는 프로/비즈니스 워크스페이스가 필요합니다.","channel.paidFeature.notice.desc.personal": "{{name}} 채널의 높은 통신 비용으로 인해 이 채널을 곧 유료 기능으로 전환할 계획입니다. 기존 연결은 공지 기간 동안 계속 사용할 수 있지만, 이 채널을 생성하거나 다시 연결하려면 유료 개인 플랜이 필요합니다.","channel.paidFeature.notice.desc.workspace": "{{name}} 채널의 높은 통신 비용으로 인해 이 채널을 곧 유료 기능으로 전환할 계획입니다. 기존 연결은 공지 기간 동안 계속 사용할 수 있지만, 이 채널을 생성하거나 다시 연결하려면 이 워크스페이스를 프로 또는 비즈니스로 업그레이드해야 합니다.",diff --git a/locales/ko-KR/subscription.json b/locales/ko-KR/subscription.jsonindex ec25ba1b4b3..185e15fd6af 100644--- a/locales/ko-KR/subscription.json+++ b/locales/ko-KR/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "플랜 비교에서 더 많은 모델 확인","plans.message.normalLLM": "표준 모델","plans.message.tooltip": "메시지당 평균 {{number}} 토큰 기준 추정",+ "plans.messageChannels.monitoring": "메시지 모니터링","plans.messageChannels.title": "메시지 채널","plans.messageChannels.wechat": "위챗 채널","plans.mostPicked": "가장 인기 있는 플랜",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "할당량은 {{time}} 후 초기화됩니다.","usage.credit.addon.used": "충전 크레딧","usage.credit.desc": "AI 채팅, 이미지 생성, 음성 합성에 사용된 크레딧",- "usage.credit.detail": "최근 {{day}}일간의 사용 통계","usage.credit.free.desc": "할당량은 {{time}} 후 초기화됩니다.","usage.credit.free.expired": "{{date}}에 만료됨","usage.credit.free.used": "무료 크레딧",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "벡터 저장소","usage.storage.file.used": "파일 사용량","usage.storage.title": "데이터 저장소",- "usage.title": "이번 달 사용량","usage.used": "사용됨","zarinpal.infoModal.desc": "정책상 주문 전에 아래 개인정보를 입력해 주세요:","zarinpal.infoModal.phone.label": "전화번호",diff --git a/locales/nl-NL/agent.json b/locales/nl-NL/agent.jsonindex 8d7f725c482..d6927238c06 100644--- a/locales/nl-NL/agent.json+++ b/locales/nl-NL/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} is beschikbaar in betaalde persoonlijke abonnementen. Upgrade om dit kanaal te configureren en verbonden te houden.","channel.paidFeature.enforce.desc.workspace": "{{name}} is beschikbaar in Pro / Business-werkruimtes. Upgrade deze werkruimte om dit kanaal te configureren en verbonden te houden.","channel.paidFeature.enforce.title": "Betaald abonnement vereist",+ "channel.paidFeature.fieldLocked": "Beschikbaar op betaalde abonnementen. Upgrade om deze functie te configureren.","channel.paidFeature.notice.desc": "Vanwege de hoge communicatiekosten voor het {{name}}-kanaal, zijn we van plan om dit kanaal binnenkort een betaalde functie te maken. Bestaande verbindingen blijven beschikbaar tijdens de kennisgevingsperiode, maar het aanmaken of opnieuw verbinden van dit kanaal vereist nu een betaald persoonlijk abonnement of een Pro / Business-werkruimte.","channel.paidFeature.notice.desc.personal": "Vanwege de hoge communicatiekosten voor het {{name}}-kanaal, zijn we van plan om dit kanaal binnenkort een betaalde functie te maken. Bestaande verbindingen blijven beschikbaar tijdens de kennisgevingsperiode, maar het aanmaken of opnieuw verbinden van dit kanaal vereist een betaald persoonlijk abonnement.","channel.paidFeature.notice.desc.workspace": "Vanwege de hoge communicatiekosten voor het {{name}}-kanaal, zijn we van plan om dit kanaal binnenkort een betaalde functie te maken. Bestaande verbindingen blijven beschikbaar tijdens de kennisgevingsperiode, maar het aanmaken of opnieuw verbinden van dit kanaal vereist een upgrade van deze werkruimte naar Pro of Business.",diff --git a/locales/nl-NL/subscription.json b/locales/nl-NL/subscription.jsonindex 71202921e00..097a27e78cf 100644--- a/locales/nl-NL/subscription.json+++ b/locales/nl-NL/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Meer modellen in abonnementsvergelijking","plans.message.normalLLM": "Standaardmodellen","plans.message.tooltip": "Geschat op basis van gemiddeld {{number}} tokens per bericht",+ "plans.messageChannels.monitoring": "Berichtbewaking","plans.messageChannels.title": "Berichtkanalen","plans.messageChannels.wechat": "WeChat-kanaal","plans.mostPicked": "Meest Gekozen",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "Limiet wordt gereset over {{time}}","usage.credit.addon.used": "Opgeladen Credits","usage.credit.desc": "Gebruik van credits voor AI-chat, beeldgeneratie, spraaksynthese",- "usage.credit.detail": "Gebruik van de afgelopen {{day}} dagen","usage.credit.free.desc": "Limiet wordt gereset over {{time}}","usage.credit.free.expired": "Verlopen op {{date}}","usage.credit.free.used": "Gratis Credits",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Vectoropslag","usage.storage.file.used": "Bestandsgebruik","usage.storage.title": "Gegevensopslag",- "usage.title": "Gebruik Deze Maand","usage.used": "Gebruikt","zarinpal.infoModal.desc": "Vanwege beleidsvereisten, vul onderstaande gegevens in voor je bestelt:","zarinpal.infoModal.phone.label": "Telefoonnummer",diff --git a/locales/pl-PL/agent.json b/locales/pl-PL/agent.jsonindex c1eabeae486..64e3dcead93 100644--- a/locales/pl-PL/agent.json+++ b/locales/pl-PL/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} jest dostępny w płatnych planach osobistych. Ulepsz, aby skonfigurować i utrzymać połączenie tego kanału.","channel.paidFeature.enforce.desc.workspace": "{{name}} jest dostępny w przestrzeniach roboczych Pro / Business. Ulepsz tę przestrzeń roboczą, aby skonfigurować i utrzymać połączenie tego kanału.","channel.paidFeature.enforce.title": "Wymagany płatny plan",+ "channel.paidFeature.fieldLocked": "Dostępne w płatnych planach. Uaktualnij, aby skonfigurować tę funkcję.","channel.paidFeature.notice.desc": "Ze względu na wysokie koszty komunikacji dla kanału {{name}}, planujemy wkrótce uczynić ten kanał funkcją płatną. Istniejące połączenia pozostają dostępne w okresie powiadomienia, ale utworzenie lub ponowne połączenie tego kanału wymaga teraz płatnego planu osobistego lub przestrzeni roboczej Pro / Business.","channel.paidFeature.notice.desc.personal": "Ze względu na wysokie koszty komunikacji dla kanału {{name}}, planujemy wkrótce uczynić ten kanał funkcją płatną. Istniejące połączenia pozostają dostępne w okresie powiadomienia, ale utworzenie lub ponowne połączenie tego kanału wymaga płatnego planu osobistego.","channel.paidFeature.notice.desc.workspace": "Ze względu na wysokie koszty komunikacji dla kanału {{name}}, planujemy wkrótce uczynić ten kanał funkcją płatną. Istniejące połączenia pozostają dostępne w okresie powiadomienia, ale utworzenie lub ponowne połączenie tego kanału wymaga ulepszenia tej przestrzeni roboczej do Pro lub Business.",diff --git a/locales/pl-PL/subscription.json b/locales/pl-PL/subscription.jsonindex 3e2d8758da7..4ee47df1b6e 100644--- a/locales/pl-PL/subscription.json+++ b/locales/pl-PL/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Więcej modeli w porównaniu planów","plans.message.normalLLM": "Modele standardowe","plans.message.tooltip": "Szacowane na podstawie średnio {{number}} tokenów na wiadomość",+ "plans.messageChannels.monitoring": "Monitorowanie wiadomości","plans.messageChannels.title": "Kanały wiadomości","plans.messageChannels.wechat": "Kanał WeChat","plans.mostPicked": "Najczęściej wybierany",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "Limit zostanie zresetowany za {{time}}","usage.credit.addon.used": "Doładowane Środki","usage.credit.desc": "Wykorzystanie środków na czat AI, generowanie obrazów, syntezę mowy",- "usage.credit.detail": "Statystyki wykorzystania z ostatnich {{day}} dni","usage.credit.free.desc": "Limit zostanie zresetowany za {{time}}","usage.credit.free.expired": "Wygasło dnia {{date}}","usage.credit.free.used": "Darmowe Środki",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Przechowywanie Wektorów","usage.storage.file.used": "Wykorzystanie Plików","usage.storage.title": "Przechowywanie Danych",- "usage.title": "Użytkowanie w Tym Miesiącu","usage.used": "Wykorzystano","zarinpal.infoModal.desc": "Zgodnie z wymogami polityki, przed złożeniem zamówienia uzupełnij poniższe dane osobowe:","zarinpal.infoModal.phone.label": "Numer Telefonu",diff --git a/locales/pt-BR/agent.json b/locales/pt-BR/agent.jsonindex 8bab2091e54..79064b23809 100644--- a/locales/pt-BR/agent.json+++ b/locales/pt-BR/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} está disponível em planos pessoais pagos. Atualize para configurar e manter este canal conectado.","channel.paidFeature.enforce.desc.workspace": "{{name}} está disponível em workspaces Pro / Business. Atualize este workspace para configurar e manter este canal conectado.","channel.paidFeature.enforce.title": "Plano pago necessário",+ "channel.paidFeature.fieldLocked": "Disponível em planos pagos. Faça o upgrade para configurar este recurso.","channel.paidFeature.notice.desc": "Devido aos altos custos de comunicação do canal {{name}}, planejamos tornar este canal uma funcionalidade paga em breve. Conexões existentes permanecerão disponíveis durante o período de aviso, mas criar ou reconectar este canal agora exige um plano pessoal pago ou um workspace Pro / Business.","channel.paidFeature.notice.desc.personal": "Devido aos altos custos de comunicação do canal {{name}}, planejamos tornar este canal uma funcionalidade paga em breve. Conexões existentes permanecerão disponíveis durante o período de aviso, mas criar ou reconectar este canal exige um plano pessoal pago.","channel.paidFeature.notice.desc.workspace": "Devido aos altos custos de comunicação do canal {{name}}, planejamos tornar este canal uma funcionalidade paga em breve. Conexões existentes permanecerão disponíveis durante o período de aviso, mas criar ou reconectar este canal exige atualizar este workspace para Pro ou Business.",diff --git a/locales/pt-BR/subscription.json b/locales/pt-BR/subscription.jsonindex 5aa1720ddef..d2059412a49 100644--- a/locales/pt-BR/subscription.json+++ b/locales/pt-BR/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Mais modelos na comparação de planos","plans.message.normalLLM": "Modelos Padrão","plans.message.tooltip": "Estimado com base em média de {{number}} tokens por mensagem",+ "plans.messageChannels.monitoring": "Monitoramento de mensagens","plans.messageChannels.title": "Canais de Mensagem","plans.messageChannels.wechat": "Canal WeChat","plans.mostPicked": "Mais Popular",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "Cota será reiniciada em {{time}}","usage.credit.addon.used": "Créditos de Recarga","usage.credit.desc": "Uso de créditos para chat com IA, geração de imagens, síntese de voz",- "usage.credit.detail": "Estatísticas de uso dos últimos {{day}} dias","usage.credit.free.desc": "Cota será reiniciada em {{time}}","usage.credit.free.expired": "Expirado em {{date}}","usage.credit.free.used": "Créditos Gratuitos",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Armazenamento Vetorial","usage.storage.file.used": "Uso de Arquivos","usage.storage.title": "Armazenamento de Dados",- "usage.title": "Uso deste Mês","usage.used": "Usado","zarinpal.infoModal.desc": "Devido a exigências legais, preencha as informações pessoais antes de realizar o pedido:","zarinpal.infoModal.phone.label": "Número de Telefone",diff --git a/locales/ru-RU/agent.json b/locales/ru-RU/agent.jsonindex eda6396d1b5..39ac5d6c9a0 100644--- a/locales/ru-RU/agent.json+++ b/locales/ru-RU/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} доступен на платных личных тарифах. Обновите тариф, чтобы настроить и сохранить подключение этого канала.","channel.paidFeature.enforce.desc.workspace": "{{name}} доступен в рабочих пространствах Pro / Business. Обновите это рабочее пространство, чтобы настроить и сохранить подключение этого канала.","channel.paidFeature.enforce.title": "Требуется платный тариф",+ "channel.paidFeature.fieldLocked": "Доступно в платных планах. Обновите план, чтобы настроить эту функцию.","channel.paidFeature.notice.desc": "Из-за высоких затрат на коммуникацию для канала {{name}} мы планируем сделать этот канал платной функцией в ближайшее время. Существующие подключения остаются доступными в течение уведомительного периода, но создание или повторное подключение этого канала теперь требует платного личного тарифа или рабочего пространства Pro / Business.","channel.paidFeature.notice.desc.personal": "Из-за высоких затрат на коммуникацию для канала {{name}} мы планируем сделать этот канал платной функцией в ближайшее время. Существующие подключения остаются доступными в течение уведомительного периода, но создание или повторное подключение этого канала требует платного личного тарифа.","channel.paidFeature.notice.desc.workspace": "Из-за высоких затрат на коммуникацию для канала {{name}} мы планируем сделать этот канал платной функцией в ближайшее время. Существующие подключения остаются доступными в течение уведомительного периода, но создание или повторное подключение этого канала требует обновления рабочего пространства до Pro или Business.",diff --git a/locales/ru-RU/subscription.json b/locales/ru-RU/subscription.jsonindex 4fd4a853b76..21f18d807ae 100644--- a/locales/ru-RU/subscription.json+++ b/locales/ru-RU/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Больше моделей в сравнении планов","plans.message.normalLLM": "Стандартные модели","plans.message.tooltip": "Оценка на основе среднего значения {{number}} токенов на сообщение",+ "plans.messageChannels.monitoring": "Мониторинг сообщений","plans.messageChannels.title": "Каналы сообщений","plans.messageChannels.wechat": "Канал WeChat","plans.mostPicked": "Самый популярный",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "Квота сбросится через {{time}}","usage.credit.addon.used": "Пополненные кредиты","usage.credit.desc": "Использование кредитов для чатов, изображений, синтеза речи",- "usage.credit.detail": "Статистика за последние {{day}} дней","usage.credit.free.desc": "Квота сбросится через {{time}}","usage.credit.free.expired": "Истекло {{date}}","usage.credit.free.used": "Бесплатные кредиты",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Векторное хранилище","usage.storage.file.used": "Использование файлов","usage.storage.title": "Хранилище данных",- "usage.title": "Использование за месяц","usage.used": "Использовано","zarinpal.infoModal.desc": "В соответствии с требованиями, пожалуйста, заполните личные данные перед оформлением заказа:","zarinpal.infoModal.phone.label": "Номер телефона",diff --git a/locales/tr-TR/agent.json b/locales/tr-TR/agent.jsonindex 79e60c0b0bf..d25cd47feff 100644--- a/locales/tr-TR/agent.json+++ b/locales/tr-TR/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} ücretli kişisel planlarda mevcuttur. Bu kanalı yapılandırmak ve bağlı tutmak için yükseltin.","channel.paidFeature.enforce.desc.workspace": "{{name}} Pro / İşletme çalışma alanlarında mevcuttur. Bu çalışma alanını yükselterek bu kanalı yapılandırabilir ve bağlı tutabilirsiniz.","channel.paidFeature.enforce.title": "Ücretli plan gerekli",+ "channel.paidFeature.fieldLocked": "Ücretli planlarda mevcut. Bu özelliği yapılandırmak için yükseltin.","channel.paidFeature.notice.desc": "{{name}} kanalı için yüksek iletişim maliyetleri nedeniyle, bu kanalı yakında ücretli bir özellik haline getirmeyi planlıyoruz. Mevcut bağlantılar bildirim süresi boyunca kullanılabilir durumda kalacak, ancak bu kanalı oluşturmak veya yeniden bağlamak artık ücretli bir kişisel plan veya Pro / İşletme çalışma alanı gerektiriyor.","channel.paidFeature.notice.desc.personal": "{{name}} kanalı için yüksek iletişim maliyetleri nedeniyle, bu kanalı yakında ücretli bir özellik haline getirmeyi planlıyoruz. Mevcut bağlantılar bildirim süresi boyunca kullanılabilir durumda kalacak, ancak bu kanalı oluşturmak veya yeniden bağlamak ücretli bir kişisel plan gerektiriyor.","channel.paidFeature.notice.desc.workspace": "{{name}} kanalı için yüksek iletişim maliyetleri nedeniyle, bu kanalı yakında ücretli bir özellik haline getirmeyi planlıyoruz. Mevcut bağlantılar bildirim süresi boyunca kullanılabilir durumda kalacak, ancak bu kanalı oluşturmak veya yeniden bağlamak için bu çalışma alanını Pro veya İşletme seviyesine yükseltmek gerekiyor.",diff --git a/locales/tr-TR/subscription.json b/locales/tr-TR/subscription.jsonindex 65394bdeb06..ed66a2a5a7d 100644--- a/locales/tr-TR/subscription.json+++ b/locales/tr-TR/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Plan karşılaştırmasında daha fazla model","plans.message.normalLLM": "Standart Modeller","plans.message.tooltip": "Mesaj başına ortalama {{number}} token baz alınarak tahmin edilmiştir",+ "plans.messageChannels.monitoring": "Mesaj izleme","plans.messageChannels.title": "Mesaj Kanalları","plans.messageChannels.wechat": "WeChat kanalı","plans.mostPicked": "En Popüler",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "Kota {{time}} içinde sıfırlanacak","usage.credit.addon.used": "Yükleme Kredileri","usage.credit.desc": "Yapay zeka sohbeti, görsel oluşturma, ses sentezi için kredi kullanımı",- "usage.credit.detail": "Son {{day}} günün kullanım istatistikleri","usage.credit.free.desc": "Kota {{time}} içinde sıfırlanacak","usage.credit.free.expired": "{{date}} tarihinde süresi doldu","usage.credit.free.used": "Ücretsiz Krediler",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Vektör Depolama","usage.storage.file.used": "Dosya Kullanımı","usage.storage.title": "Veri Depolama",- "usage.title": "Bu Ayki Kullanım","usage.used": "Kullanıldı","zarinpal.infoModal.desc": "Politika gereği, sipariş vermeden önce lütfen aşağıdaki kişisel bilgileri doldurun:","zarinpal.infoModal.phone.label": "Telefon Numarası",diff --git a/locales/vi-VN/agent.json b/locales/vi-VN/agent.jsonindex 7fbc87c7936..0e6c15564d6 100644--- a/locales/vi-VN/agent.json+++ b/locales/vi-VN/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} có sẵn trên các gói cá nhân trả phí. Nâng cấp để cấu hình và giữ kênh này được kết nối.","channel.paidFeature.enforce.desc.workspace": "{{name}} có sẵn trên các workspace Pro / Doanh nghiệp. Nâng cấp workspace này để cấu hình và giữ kênh này được kết nối.","channel.paidFeature.enforce.title": "Yêu cầu gói trả phí",+ "channel.paidFeature.fieldLocked": "Có sẵn trên các gói trả phí. Nâng cấp để cấu hình tính năng này.","channel.paidFeature.notice.desc": "Do chi phí liên lạc cao cho kênh {{name}}, chúng tôi dự định biến kênh này thành một tính năng trả phí sớm. Các kết nối hiện có vẫn khả dụng trong thời gian thông báo, nhưng việc tạo hoặc kết nối lại kênh này bây giờ yêu cầu gói cá nhân trả phí hoặc workspace Pro / Doanh nghiệp.","channel.paidFeature.notice.desc.personal": "Do chi phí liên lạc cao cho kênh {{name}}, chúng tôi dự định biến kênh này thành một tính năng trả phí sớm. Các kết nối hiện có vẫn khả dụng trong thời gian thông báo, nhưng việc tạo hoặc kết nối lại kênh này yêu cầu gói cá nhân trả phí.","channel.paidFeature.notice.desc.workspace": "Do chi phí liên lạc cao cho kênh {{name}}, chúng tôi dự định biến kênh này thành một tính năng trả phí sớm. Các kết nối hiện có vẫn khả dụng trong thời gian thông báo, nhưng việc tạo hoặc kết nối lại kênh này yêu cầu nâng cấp workspace này lên Pro hoặc Doanh nghiệp.",diff --git a/locales/vi-VN/subscription.json b/locales/vi-VN/subscription.jsonindex 6f3154aa781..1db7b5b0254 100644--- a/locales/vi-VN/subscription.json+++ b/locales/vi-VN/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "Nhiều mô hình hơn trong so sánh gói","plans.message.normalLLM": "Mô hình tiêu chuẩn","plans.message.tooltip": "Ước tính dựa trên trung bình {{number}} token mỗi tin nhắn",+ "plans.messageChannels.monitoring": "Giám sát tin nhắn","plans.messageChannels.title": "Kênh Tin Nhắn","plans.messageChannels.wechat": "Kênh WeChat","plans.mostPicked": "Phổ biến nhất",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "Hạn mức sẽ được đặt lại sau {{time}}","usage.credit.addon.used": "Tín dụng nạp thêm","usage.credit.desc": "Sử dụng tín dụng cho chat AI, tạo hình ảnh, tổng hợp giọng nói",- "usage.credit.detail": "Thống kê sử dụng trong {{day}} ngày qua","usage.credit.free.desc": "Hạn mức sẽ được đặt lại sau {{time}}","usage.credit.free.expired": "Hết hạn vào {{date}}","usage.credit.free.used": "Tín dụng miễn phí",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "Lưu trữ vector","usage.storage.file.used": "Sử dụng tệp","usage.storage.title": "Lưu trữ dữ liệu",- "usage.title": "Sử dụng tháng này","usage.used": "Đã sử dụng","zarinpal.infoModal.desc": "Theo yêu cầu chính sách, vui lòng hoàn tất thông tin cá nhân sau trước khi đặt hàng:","zarinpal.infoModal.phone.label": "Số điện thoại",diff --git a/locales/zh-CN/agent.json b/locales/zh-CN/agent.jsonindex c48231cf8b4..dc1cde90f89 100644--- a/locales/zh-CN/agent.json+++ b/locales/zh-CN/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} 仅面向个人付费 Plan 开放。升级后即可配置并保持该渠道连接。","channel.paidFeature.enforce.desc.workspace": "{{name}} 仅面向 Pro / Business Workspace 开放。升级当前 Workspace 后即可配置并保持该渠道连接。","channel.paidFeature.enforce.title": "需要付费 Plan",+ "channel.paidFeature.fieldLocked": "仅面向付费 Plan 开放,升级后即可配置该功能。","channel.paidFeature.notice.desc": "由于 {{name}} 渠道通信成本过高,我们计划近期将该渠道调整为付费功能。预告期内已有连接可继续使用,但新建或重新连接该渠道需要升级到个人付费 Plan,或使用 Pro / Business Workspace。","channel.paidFeature.notice.desc.personal": "由于 {{name}} 渠道通信成本过高,我们计划近期将该渠道调整为付费功能。预告期内已有连接可继续使用,但新建或重新连接该渠道需要升级到个人付费 Plan。","channel.paidFeature.notice.desc.workspace": "由于 {{name}} 渠道通信成本过高,我们计划近期将该渠道调整为付费功能。预告期内已有连接可继续使用,但新建或重新连接该渠道需要升级当前 Workspace 到 Pro 或 Business。",diff --git a/locales/zh-CN/subscription.json b/locales/zh-CN/subscription.jsonindex 1ccf8be48dc..ce56769867a 100644--- a/locales/zh-CN/subscription.json+++ b/locales/zh-CN/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "更多模型请查看计划对比","plans.message.normalLLM": "标准模型","plans.message.tooltip": "按每条消息平均 {{number}} tokens 估算",+ "plans.messageChannels.monitoring": "消息监控","plans.messageChannels.title": "消息频道","plans.messageChannels.wechat": "微信渠道","plans.mostPicked": "最受欢迎",diff --git a/locales/zh-TW/agent.json b/locales/zh-TW/agent.jsonindex 09de722de63..6cdba179d29 100644--- a/locales/zh-TW/agent.json+++ b/locales/zh-TW/agent.json@@ -180,6 +180,7 @@"channel.paidFeature.enforce.desc.personal": "{{name}} 僅適用於付費個人方案。升級以設定並保持此頻道連接。","channel.paidFeature.enforce.desc.workspace": "{{name}} 僅適用於專業版/商業版工作區。升級此工作區以設定並保持此頻道連接。","channel.paidFeature.enforce.title": "需要付費方案",+ "channel.paidFeature.fieldLocked": "僅限付費方案使用。升級以啟用此功能。","channel.paidFeature.notice.desc": "由於 {{name}} 頻道的高通信成本,我們計劃將此頻道設為付費功能。現有連接在通知期間仍可用,但現在建立或重新連接此頻道需要付費個人方案或專業版/商業版工作區。","channel.paidFeature.notice.desc.personal": "由於 {{name}} 頻道的高通信成本,我們計劃將此頻道設為付費功能。現有連接在通知期間仍可用,但建立或重新連接此頻道需要付費個人方案。","channel.paidFeature.notice.desc.workspace": "由於 {{name}} 頻道的高通信成本,我們計劃將此頻道設為付費功能。現有連接在通知期間仍可用,但建立或重新連接此頻道需要將此工作區升級至專業版或商業版。",diff --git a/locales/zh-TW/subscription.json b/locales/zh-TW/subscription.jsonindex e12aee81e1c..6df51edf6bd 100644--- a/locales/zh-TW/subscription.json+++ b/locales/zh-TW/subscription.json@@ -376,6 +376,7 @@"plans.message.more": "更多模型請參見方案比較","plans.message.normalLLM": "標準模型","plans.message.tooltip": "依每則訊息平均 {{number}} tokens 預估",+ "plans.messageChannels.monitoring": "訊息監控","plans.messageChannels.title": "訊息頻道","plans.messageChannels.wechat": "微信頻道","plans.mostPicked": "最受歡迎",@@ -564,7 +565,6 @@"usage.credit.addon.desc": "配額將於 {{time}} 重置","usage.credit.addon.used": "儲值點數","usage.credit.desc": "AI 對話、圖片生成、語音合成等功能的點數使用情況",- "usage.credit.detail": "過去 {{day}} 天的使用統計","usage.credit.free.desc": "配額將於 {{time}} 重置","usage.credit.free.expired": "已於 {{date}} 到期","usage.credit.free.used": "免費點數",@@ -585,7 +585,6 @@"usage.storage.embeddings.used": "向量儲存","usage.storage.file.used": "檔案使用量","usage.storage.title": "資料儲存",- "usage.title": "本月使用情況","usage.used": "已使用","zarinpal.infoModal.desc": "依政策要求,請在下單前填寫以下個人資訊:","zarinpal.infoModal.phone.label": "手機號碼",diff --git a/packages/locales/src/default/agent.ts b/packages/locales/src/default/agent.tsindex d3e12f955fb..6a7b0757613 100644--- a/packages/locales/src/default/agent.ts+++ b/packages/locales/src/default/agent.ts@@ -17,6 +17,7 @@ export default {'channel.paidFeature.badge': 'Pro','channel.paidFeature.cta.personal': 'Upgrade','channel.paidFeature.cta.workspace': 'Upgrade',+ 'channel.paidFeature.fieldLocked': 'Available on paid plans. Upgrade to configure this feature.','channel.paidFeature.enforce.desc':'{{name}} is available on paid plans. Upgrade to a paid personal plan or a Pro / Business workspace to configure and keep this channel connected.','channel.paidFeature.enforce.desc.personal':diff --git a/packages/locales/src/default/subscription.ts b/packages/locales/src/default/subscription.tsindex 5bdf8034432..0632db500b5 100644--- a/packages/locales/src/default/subscription.ts+++ b/packages/locales/src/default/subscription.ts@@ -439,6 +439,7 @@ export default {'plans.message.more': 'More models in plan comparison','plans.message.normalLLM': 'Standard Models','plans.message.tooltip': 'Estimated based on average {{number}} tokens per message',+ 'plans.messageChannels.monitoring': 'Message monitoring','plans.messageChannels.title': 'Message Channels','plans.messageChannels.wechat': 'WeChat channel','plans.mostPicked': 'Most Popular',diff --git a/src/business/server/bot/featureAccess.ts b/src/business/server/bot/featureAccess.tsindex 14948879b7a..407549251d9 100644--- a/src/business/server/bot/featureAccess.ts+++ b/src/business/server/bot/featureAccess.ts@@ -1,8 +1,17 @@import type { SerializedPlatformDefinition } from '@/server/services/bot/platforms/types';+/**+ * Feature-scoped capabilities that can be gated independently of the+ * platform itself. `messageMonitoring` covers passive channel listening+ * (e.g. watch-keyword wakes on ordinary, non-addressed channel messages).+ */+export type BotGatedFeature = 'messageMonitoring';+export interface BotFeatureAccessParams {action?: 'manage' | 'runtime';applicationId?: string;+ /** When set, checks access to a specific feature instead of the platform as a whole. */+ feature?: BotGatedFeature;platform: string;userId: string;workspaceId?: string;@@ -11,6 +20,8 @@ export interface BotFeatureAccessParams {export interface BotPlatformAccessMeta {allowed?: boolean;blockedMessage?: string;+ /** Per-feature access flags (platform-level `allowed` stays authoritative for the channel itself). */+ features?: Partial<Record<BotGatedFeature, { allowed: boolean }>>;requiredPlan?: 'paid';rolloutMode?: 'enforce' | 'notice';}diff --git a/src/routes/(main)/agent/channel/detail/Body.tsx b/src/routes/(main)/agent/channel/detail/Body.tsxindex 7b858e069f6..47ed05f0fbc 100644--- a/src/routes/(main)/agent/channel/detail/Body.tsx+++ b/src/routes/(main)/agent/channel/detail/Body.tsx@@ -149,6 +149,8 @@ function buildRules(field: FieldSchema, t: (key: string) => string) {interface SchemaFieldProps {disabled?: boolean;divider?: boolean;+ /** The field belongs to a gated feature the current plan doesn't include. */+ featureLocked?: boolean;field: FieldSchema;parentKey: string;}@@ -156,12 +158,17 @@ interface SchemaFieldProps {const renderFieldLabel = (field: FieldSchema, t: (key: string) => string) => {const hint = field.tooltip;- if (!hint && !field.devOnly) return t(field.label);+ if (!hint && !field.devOnly && !field.paidFeature) return t(field.label);return (<Flexbox horizontal align="center" gap={8}>{t(field.label)}{hint && <InfoTooltip size={'small'} title={t(hint)} />}+ {field.paidFeature && (+ <Tag color="gold" size={'small'}>+ {t('channel.paidFeature.badge')}+ </Tag>+ )}{field.devOnly && <Tag color="gold">Dev Only</Tag>}</Flexbox>);@@ -185,99 +192,115 @@ const renderFieldIcon = (field: FieldSchema) => (<Icon className={styles.fieldIcon} icon={getFieldIcon(field)} size={20} />);-const SchemaField = memo<SchemaFieldProps>(({ field, parentKey, divider, disabled }) => {- const { t: _t } = useTranslation('agent');- const t = _t as (key: string) => string;-- // Conditional visibility: watch the sibling field specified by visibleWhen- const watchedValue = AntdForm.useWatch(- field.visibleWhen ? [parentKey, field.visibleWhen.field] : [],- );- if (field.visibleWhen && watchedValue !== field.visibleWhen.value) return null;+const SchemaField = memo<SchemaFieldProps>(+ ({ field, parentKey, divider, disabled: formDisabled, featureLocked }) => {+ const { t: _t } = useTranslation('agent');+ const t = _t as (key: string) => string;- // Only explicitly authored, actionable guidance earns a help affordance.- // Generic schema descriptions stay out of the compact row layout.- const label = renderFieldLabel(field, t);+ // Scalar controls fully lock with the feature; list fields handle the+ // locked state themselves so operators can still remove stale rows.+ const disabled = formDisabled || featureLocked;- // Array of objects (e.g. user / channel allowlist) — needs Form.List, can't- // be expressed as a single control inside a name-bound FormItem.- if (field.type === 'array' && field.items?.type === 'object') {- return (- <ObjectListField- disabled={disabled}- divider={divider}- field={field}- icon={renderFieldIcon(field)}- label={label}- parentKey={parentKey}- />+ // Conditional visibility: watch the sibling field specified by visibleWhen+ const watchedValue = AntdForm.useWatch(+ field.visibleWhen ? [parentKey, field.visibleWhen.field] : [],);- }-- let children: React.ReactNode;- switch (field.type) {- case 'password': {- children = (- <FormPassword- autoComplete="new-password"- disabled={disabled}- placeholder={field.placeholder ? t(field.placeholder) : undefined}- />- );- break;- }- case 'boolean': {- children = <Switch disabled={disabled} />;- break;- }- case 'number':- case 'integer': {- children = (- <InputNumber- disabled={disabled}- max={field.maximum}- min={field.minimum}- placeholder={field.placeholder ? t(field.placeholder) : undefined}- style={{ width: '100%' }}+ if (field.visibleWhen && watchedValue !== field.visibleWhen.value) return null;++ // Only explicitly authored, actionable guidance earns a help affordance.+ // Generic schema descriptions stay out of the compact row layout.+ const label = renderFieldLabel(field, t);++ // Array of objects (e.g. user / channel allowlist) — needs Form.List, can't+ // be expressed as a single control inside a name-bound FormItem.+ if (field.type === 'array' && field.items?.type === 'object') {+ return (+ <ObjectListField+ disabled={formDisabled}+ divider={divider}+ featureLocked={featureLocked}+ field={field}+ icon={renderFieldIcon(field)}+ label={label}+ parentKey={parentKey}/>);- break;}- case 'string': {- if (field.enum) {- const hasDescriptions = field.enumDescriptions?.some(Boolean);- const options = field.enum.map((value, i) => ({- description: field.enumDescriptions?.[i] ? t(field.enumDescriptions[i]) : undefined,- label: field.enumLabels?.[i] ? t(field.enumLabels[i]) : value,- value,- })) satisfies Array<SelectOption<string> & { description?: string }>;+ let children: React.ReactNode;+ switch (field.type) {+ case 'password': {children = (- <Select+ <FormPassword+ autoComplete="new-password"disabled={disabled}- options={options}placeholder={field.placeholder ? t(field.placeholder) : undefined}- optionRender={- hasDescriptions- ? (item) => {- const option = item as SelectOption<string> & { description?: string };-- return (- <Flexbox horizontal align="center" gap={12} justify="space-between">- <span>{option.label}</span>- {option.description && (- <Text fontSize={12} type="secondary">- {option.description}- </Text>- )}- </Flexbox>- );- }- : undefined- }/>);- } else {+ break;+ }+ case 'boolean': {+ children = <Switch disabled={disabled} />;+ break;+ }+ case 'number':+ case 'integer': {+ children = (+ <InputNumber+ disabled={disabled}+ max={field.maximum}+ min={field.minimum}+ placeholder={field.placeholder ? t(field.placeholder) : undefined}+ style={{ width: '100%' }}+ />+ );+ break;+ }+ case 'string': {+ if (field.enum) {+ const hasDescriptions = field.enumDescriptions?.some(Boolean);+ const options = field.enum.map((value, i) => ({+ description: field.enumDescriptions?.[i] ? t(field.enumDescriptions[i]) : undefined,+ label: field.enumLabels?.[i] ? t(field.enumLabels[i]) : value,+ value,+ })) satisfies Array<SelectOption<string> & { description?: string }>;++ children = (+ <Select+ disabled={disabled}+ options={options}+ placeholder={field.placeholder ? t(field.placeholder) : undefined}+ optionRender={+ hasDescriptions+ ? (item) => {+ const option = item as SelectOption<string> & { description?: string };++ return (+ <Flexbox horizontal align="center" gap={12} justify="space-between">+ <span>{option.label}</span>+ {option.description && (+ <Text fontSize={12} type="secondary">+ {option.description}+ </Text>+ )}+ </Flexbox>+ );+ }+ : undefined+ }+ />+ );+ } else {+ children = (+ <FormInput+ disabled={disabled}+ placeholder={field.placeholder ? t(field.placeholder) : t(field.label)}+ />+ );+ }+ break;+ }+ default: {children = (<FormInputdisabled={disabled}@@ -285,40 +308,33 @@ const SchemaField = memo<SchemaFieldProps>(({ field, parentKey, divider, disable/>);}- break;}- default: {- children = (- <FormInput- disabled={disabled}- placeholder={field.placeholder ? t(field.placeholder) : t(field.label)}- />- );- }- }- return (- <FormItem- avatar={renderFieldIcon(field)}- divider={divider}- initialValue={field.default}- label={label}- minWidth={'max(50%, 400px)'}- name={[parentKey, field.key]}- rules={buildRules(field, t)}- valuePropName={field.type === 'boolean' ? 'checked' : undefined}- variant="outlined"- >- {children}- </FormItem>- );-});+ return (+ <FormItem+ avatar={renderFieldIcon(field)}+ divider={divider}+ initialValue={field.default}+ label={label}+ minWidth={'max(50%, 400px)'}+ name={[parentKey, field.key]}+ rules={buildRules(field, t)}+ valuePropName={field.type === 'boolean' ? 'checked' : undefined}+ variant="outlined"+ >+ {children}+ </FormItem>+ );+ },+);// --------------- Object-list field (e.g. allowFrom: [{id, name?}]) ---------------interface ObjectListFieldProps {disabled?: boolean;divider?: boolean;+ /** The field belongs to a gated feature the current plan doesn't include. */+ featureLocked?: boolean;field: FieldSchema;icon: React.ReactNode;label: React.ReactNode;@@ -326,10 +342,16 @@ interface ObjectListFieldProps {}const ObjectListField = memo<ObjectListFieldProps>(- ({ field, parentKey, divider, icon, label, disabled }) => {+ ({ field, parentKey, divider, icon, label, disabled, featureLocked }) => {const { t: _t } = useTranslation('agent');const t = _t as (key: string) => string;+ // A locked feature blocks new rows and edits, but existing rows must stay+ // removable — the server-side write gate always allows clearing keywords,+ // and stale rows would otherwise keep the feature semi-active with no way+ // out short of resetting all advanced settings.+ const editDisabled = disabled || featureLocked;+// The runtime ignores anything beyond `id`, but the editor renders every// declared property so future additions (e.g. a per-row note tag) flow// through without code changes here.@@ -378,7 +400,7 @@ const ObjectListField = memo<ObjectListFieldProps>(}><FormInput- disabled={disabled}+ disabled={editDisabled}placeholder={sub.placeholder? t(sub.placeholder as 'channel.allowFromIdPlaceholder')@@ -397,9 +419,14 @@ const ObjectListField = memo<ObjectListFieldProps>(/></Flexbox>))}+ {featureLocked && (+ <Flexbox style={{ fontSize: 12, opacity: 0.6, paddingBlock: 4 }}>+ {t('channel.paidFeature.fieldLocked')}+ </Flexbox>+ )}<Buttonblock- disabled={disabled}+ disabled={editDisabled}icon={<Plus size={14} />}type="dashed"onClick={() => add({ id: '', name: '' })}@@ -632,15 +659,23 @@ const Body = memo<BodyProps>(}onCollapse={setSettingsActive}>- {settingsFields.map((field) => (- <SchemaField- divider- disabled={disabled}- field={field}- key={field.key}- parentKey="settings"- />- ))}+ {settingsFields.map((field) => {+ // Feature-gated fields (e.g. watch keywords) lock when the+ // resolved access meta reports the feature as not allowed.+ const featureLocked =+ !!field.paidFeature &&+ platformDef.access?.features?.[field.paidFeature]?.allowed === false;+ return (+ <SchemaField+ divider+ disabled={disabled}+ featureLocked={featureLocked}+ field={field}+ key={field.key}+ parentKey="settings"+ />+ );+ })}</FormGroup></div>)}