Skip to content

The agent that grows with you

feat(messaging): edit allowed users one ID per box on Desktop and dashboard

teknium1344a23bce57f
diff --git a/apps/desktop/src/app/messaging/allowlist-field.tsx b/apps/desktop/src/app/messaging/allowlist-field.tsx
new file mode 100644
index 00000000000..9eb8af3a7bd
--- /dev/null
+++ b/apps/desktop/src/app/messaging/allowlist-field.tsx
@@ -0,0 +1,139 @@
+import type * as React from 'react'
+import { useState } from 'react'
+
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Tip } from '@/components/ui/tooltip'
+import type { MessagingEnvVarInfo } from '@/hermes'
+import { useI18n } from '@/i18n'
+import { Plus, X } from '@/lib/icons'
+
+import { CREDENTIAL_CONTROL_CLASS } from '../settings/credential-key-ui'
+
+interface AllowlistRow {
+ id: number
+ value: string
+}
+
+function toRows(raw: null | string | undefined): AllowlistRow[] {
+ const entries = splitAllowlist(raw)
+
+ return (entries.length ? entries : ['']).map(value => ({ id: rowSeq++, value }))
+}
+
+/** Allowlists are stored as one comma-separated env value; a pasted list may also use newlines. */
+export function splitAllowlist(raw: null | string | undefined): string[] {
+ return (raw || '')
+ .split(/[,\n]/)
+ .map(entry => entry.trim())
+ .filter(Boolean)
+}
+
+// Row identity for React keys and focus; module-wide so render-time re-seeding needs no ref.
+let rowSeq = 0
+
+export function joinAllowlist(entries: string[]): string {
+ return [...new Set(entries.map(entry => entry.trim()).filter(Boolean))].join(',')
+}
+
+export interface AllowlistFieldProps {
+ field: MessagingEnvVarInfo
+ fieldId: string
+ /** Visible field label; each entry is announced as "<label> <n>". */
+ label: string
+ /** The field's unsaved value, or undefined when untouched. */
+ pending: string | undefined
+ onEdit: (key: string, value: string) => void
+ /** Docs link, shared with the single-input fields. */
+ tools: React.ReactNode
+}
+
+/** One input per allowed user/ID, with + to add and × to remove; saved as one comma-separated value. */
+export function AllowlistField({ field, fieldId, label, pending, onEdit, tools }: AllowlistFieldProps) {
+ const { t } = useI18n()
+ const m = t.messaging
+
+ const [rows, setRows] = useState<AllowlistRow[]>(() => toRows(pending ?? field.value))
+ const [syncedValue, setSyncedValue] = useState(field.value)
+ const [focusId, setFocusId] = useState<null | number>(null)
+
+ // A save or clear changes the server value: re-seed from it (render-time sync, no effect).
+ if (field.value !== syncedValue) {
+ setSyncedValue(field.value)
+ setRows(toRows(field.value))
+ }
+
+ function commit(next: AllowlistRow[]) {
+ setRows(next)
+ onEdit(field.key, joinAllowlist(next.map(row => row.value)))
+ }
+
+ function change(id: number, value: string) {
+ // A pasted "123, 456" becomes one box per entry.
+ const parts = /[,\n]/.test(value) ? splitAllowlist(value) : [value]
+ const index = rows.findIndex(row => row.id === id)
+ const replacement = parts.map((part, i) => (i === 0 ? { id, value: part } : { id: rowSeq++, value: part }))
+ commit([
+ ...rows.slice(0, index),
+ ...(replacement.length ? replacement : [{ id, value: '' }]),
+ ...rows.slice(index + 1)
+ ])
+ }
+
+ function add() {
+ const id = rowSeq++
+ setFocusId(id)
+ setRows([...rows, { id, value: '' }])
+ }
+
+ function remove(id: number) {
+ const next = rows.filter(row => row.id !== id)
+ commit(next.length ? next : [{ id: rowSeq++, value: '' }])
+ }
+
+ const lone = rows.length === 1 && !rows[0].value
+
+ return (
+ <div className="grid w-full gap-1.5 @2xl:w-88" data-slot="allowlist-field">
+ {rows.map((row, index) => (
+ <div className="flex items-center gap-2" key={row.id}>
+ <Input
+ aria-label={`${label} ${index + 1}`}
+ autoFocus={row.id === focusId}
+ className={CREDENTIAL_CONTROL_CLASS}
+ id={index === 0 ? fieldId : undefined}
+ onChange={event => change(row.id, event.target.value)}
+ onKeyDown={event => {
+ if (event.key === 'Enter' && row.value.trim()) {
+ event.preventDefault()
+ add()
+ }
+ }}
+ placeholder={m.listEntryPlaceholder}
+ type="text"
+ value={row.value}
+ />
+ <Tip label={m.removeListEntry}>
+ <Button
+ aria-label={m.removeListEntry}
+ className="size-8 shrink-0"
+ disabled={lone}
+ onClick={() => remove(row.id)}
+ variant="ghost"
+ >
+ <X className="size-3.5" />
+ </Button>
+ </Tip>
+ </div>
+ ))}
+ <div className="flex items-center gap-2">
+ <Button className="h-7 gap-1 px-2 text-xs" onClick={add} size="sm" variant="ghost">
+ <Plus className="size-3.5" />
+ {m.addListEntry}
+ </Button>
+ <span className="flex-1" />
+ {tools}
+ </div>
+ </div>
+ )
+}
diff --git a/apps/desktop/src/app/messaging/index.test.tsx b/apps/desktop/src/app/messaging/index.test.tsx
index f4e98de252e..f46b712cf57 100644
--- a/apps/desktop/src/app/messaging/index.test.tsx
+++ b/apps/desktop/src/app/messaging/index.test.tsx
@@ -456,6 +456,72 @@ describe('MessagingView restart banner', () => {
})
})
+describe('MessagingView allowlist editor', () => {
+ const allowlist = (patch: Record<string, unknown> = {}) => ({
+ advanced: false,
+ description: 'Allowed users',
+ is_list: true,
+ is_password: false,
+ is_set: true,
+ key: 'TEAMS_ALLOWED_USERS',
+ prompt: 'Allowed users',
+ redacted_value: '«redacted:111...222»',
+ required: false,
+ url: null,
+ value: '111,222',
+ ...patch
+ })
+
+ const entries = () =>
+ screen.getAllByRole('textbox').filter(el => /^Allowed users \d+$/.test(el.getAttribute('aria-label') || ''))
+
+ async function save() {
+ await act(async () => {
+ fireEvent.click(screen.getByRole('button', { name: /Save changes/ }))
+ })
+ }
+
+ it('shows each saved ID in its own visible box and saves add/remove edits as one list', async () => {
+ getMessagingPlatforms.mockResolvedValue({ platforms: [platform({ env_vars: [allowlist()] })] })
+ await renderMessaging()
+
+ await screen.findByLabelText('Allowed users 1')
+ expect(entries().map(el => [(el as HTMLInputElement).type, (el as HTMLInputElement).value])).toEqual([
+ ['text', '111'],
+ ['text', '222']
+ ])
+
+ fireEvent.click(screen.getAllByRole('button', { name: 'Remove' })[0])
+ fireEvent.click(screen.getByRole('button', { name: /Add another/ }))
+ // A pasted comma list splits into one box per entry.
+ fireEvent.change(entries()[1], { target: { value: '333, 444' } })
+ expect(entries().map(el => (el as HTMLInputElement).value)).toEqual(['222', '333', '444'])
+
+ await save()
+ expect(updateMessagingPlatform).toHaveBeenCalledWith(
+ 'teams',
+ { env: { TEAMS_ALLOWED_USERS: '222,333,444' } },
+ 'default'
+ )
+ })
+
+ it('clears a saved allowlist when every entry is removed', async () => {
+ getMessagingPlatforms.mockResolvedValue({
+ platforms: [platform({ env_vars: [allowlist({ redacted_value: '«redacted:111»', value: '111' })] })]
+ })
+ await renderMessaging()
+
+ await screen.findByLabelText('Allowed users 1')
+ fireEvent.click(screen.getByRole('button', { name: 'Remove' }))
+ await save()
+ expect(updateMessagingPlatform).toHaveBeenCalledWith(
+ 'teams',
+ { clear_env: ['TEAMS_ALLOWED_USERS'], env: {} },
+ 'default'
+ )
+ })
+})
+
describe('MessagingView Telegram quick setup', () => {
it('runs the QR pairing to apply on the page scope and watches the backend restart', async () => {
// Every call of one pairing must hit the SAME backend (the pairing lives in
diff --git a/apps/desktop/src/app/messaging/index.tsx b/apps/desktop/src/app/messaging/index.tsx
index c33e0f048cd..056d14852ad 100644
--- a/apps/desktop/src/app/messaging/index.tsx
+++ b/apps/desktop/src/app/messaging/index.tsx
@@ -19,6 +19,7 @@ import {
getPairing,
type MessagingEnvVarInfo,
type MessagingPlatformInfo,
+ type MessagingPlatformUpdate,
type PairingUser,
revokePairing,
type TelegramOnboardingApplyResponse,
@@ -45,6 +46,7 @@ import { ListRow } from '../settings/primitives'
import { SettingsProfileScope } from '../settings/profile-scope'
import type { SetStatusbarItemGroup } from '../shell/statusbar-controls'
+import { AllowlistField } from './allowlist-field'
import { PlatformAvatar } from './platform-icon'
import { TelegramQrSetup } from './telegram-qr-setup'
@@ -86,6 +88,20 @@ const trimEdits = (edits: Record<string, string>): Record<string, string> =>
.filter(([, v]) => v)
)
+/** A saved allowlist emptied in its editor is a clear: trimEdits alone reads "" as untouched. */
+function platformChanges(platform: MessagingPlatformInfo, draft: Record<string, string>): MessagingPlatformUpdate {
+ const env = trimEdits(draft)
+
+ const clearEnv = platform.env_vars
+ .filter(field => field.is_list && field.is_set && draft[field.key]?.trim() === '')
+ .map(field => field.key)
+
+ return clearEnv.length ? { env, clear_env: clearEnv } : { env }
+}
+
+const hasChanges = (update: MessagingPlatformUpdate) =>
+ Object.keys(update.env || {}).length + (update.clear_env?.length ?? 0) > 0
+
/** Stable row identity: a user id is only unique within its platform. */
const pairingKey = (user: PairingUser) => `${user.platform}:${user.user_id}`
@@ -387,18 +403,19 @@ export function MessagingView({ setStatusbarItemGroup: _setStatusbarItemGroup, .
}
async function handleSave(platform: MessagingPlatformInfo) {
- const env = trimEdits(edits[platform.id] || {})
+ const update = platformChanges(platform, edits[platform.id] || {})
- if (Object.keys(env).length === 0) {
+ if (!hasChanges(update)) {
return
}
setSaving(`env:${platform.id}`)
try {
- const result = await updateMessagingPlatform(platform.id, { env }, scopeProfile)
- setEdits(current => ({ ...current, [platform.id]: {} }))
+ const result = await updateMessagingPlatform(platform.id, update, scopeProfile)
+ // Refresh before dropping the drafts so list editors re-seed from the saved value, not the old one.
await refreshPlatforms()
+ setEdits(current => ({ ...current, [platform.id]: {} }))
settleAfterUpdate(result.hot_served)
notify({
kind: 'success',
@@ -580,7 +597,7 @@ export function MessagingView({ setStatusbarItemGroup: _setStatusbarItemGroup, .
actionBar={
selected && (
<PlatformActionBar
- hasEdits={Object.keys(trimEdits(edits[selected.id] || {})).length > 0}
+ hasEdits={hasChanges(platformChanges(selected, edits[selected.id] || {}))}
onSave={() => void handleSave(selected)}
onToggle={enabled => void handleToggle(selected, enabled)}
platform={selected}
@@ -1028,40 +1045,58 @@ function MessagingField({
const copy = fieldCopy(field, m)
const fieldId = `messaging-field-${field.key}`
+ const tools = (
+ <>
+ {field.url && (
+ <Tip label={m.openDocs}>
+ <Button asChild className="size-8 shrink-0" variant="ghost">
+ <a href={field.url} rel="noreferrer" target="_blank">
+ <ExternalLink className="size-3.5" />
+ </a>
+ </Button>
+ </Tip>
+ )}
+ {/* A list clears by removing its last entry and saving; a second trash icon would read as "remove row". */}
+ {field.is_set && !field.is_list && (
+ <Tip label={m.clearField(field.key)}>
+ <Button
+ className="size-8 shrink-0"
+ disabled={saving === `clear:${field.key}`}
+ onClick={() => onClear(field.key)}
+ variant="ghost"
+ >
+ <Trash2 className="size-3.5" />
+ </Button>
+ </Tip>
+ )}
+ </>
+ )
+
return (
<ListRow
action={
- <div className="flex w-full items-center gap-2 @2xl:w-88">
- <Input
- className={CREDENTIAL_CONTROL_CLASS}
- id={fieldId}
- onChange={event => onEdit(field.key, event.target.value)}
- placeholder={field.is_set ? credentialPreview(field.redacted_value) || m.replaceValue : copy.placeholder}
- type={field.is_password ? 'password' : 'text'}
- value={edits[field.key] || ''}
+ field.is_list ? (
+ <AllowlistField
+ field={field}
+ fieldId={fieldId}
+ label={copy.label}
+ onEdit={onEdit}
+ pending={edits[field.key]}
+ tools={tools}
/>
- {field.url && (
- <Tip label={m.openDocs}>
- <Button asChild className="size-8 shrink-0" variant="ghost">
- <a href={field.url} rel="noreferrer" target="_blank">
- <ExternalLink className="size-3.5" />
- </a>
- </Button>
- </Tip>
- )}
- {field.is_set && (
- <Tip label={m.clearField(field.key)}>
- <Button
- className="size-8 shrink-0"
- disabled={saving === `clear:${field.key}`}
- onClick={() => onClear(field.key)}
- variant="ghost"
- >
- <Trash2 className="size-3.5" />
- </Button>
- </Tip>
- )}
- </div>
+ ) : (
+ <div className="flex w-full items-center gap-2 @2xl:w-88">
+ <Input
+ className={CREDENTIAL_CONTROL_CLASS}
+ id={fieldId}
+ onChange={event => onEdit(field.key, event.target.value)}
+ placeholder={field.is_set ? credentialPreview(field.redacted_value) || m.replaceValue : copy.placeholder}
+ type={field.is_password ? 'password' : 'text'}
+ value={edits[field.key] || ''}
+ />
+ {tools}
+ </div>
+ )
}
description={copy.help}
title={
diff --git a/apps/desktop/src/i18n/ar_command_center.ts b/apps/desktop/src/i18n/ar_command_center.ts
index fd4f1bf6406..265458c4579 100644
--- a/apps/desktop/src/i18n/ar_command_center.ts
+++ b/apps/desktop/src/i18n/ar_command_center.ts
@@ -241,6 +241,9 @@ export const arCommandCenter = {
replaceValue: 'استبدال القيمة',
openDocs: 'فتح الوثائق',
clearField: key => `مسح ${key}`,
+ addListEntry: 'إضافة آخر',
+ removeListEntry: 'إزالة',
+ listEntryPlaceholder: 'أدخل معرّفًا',
enableAria: name => `تفعيل ${name}`,
disableAria: name => `تعطيل ${name}`,
platformEnabled: name => `تم تفعيل ${name}`,
@@ -263,7 +266,7 @@ export const arCommandCenter = {
},
TELEGRAM_ALLOWED_USERS: {
label: 'معرّفات مستخدمي Telegram المسموح بهم',
- help: 'موصى به. معرّفات رقمية مفصولة بفواصل من @userinfobot. بدون ذلك، يمكن لأي شخص مراسلة بوتك مباشرة.'
+ help: 'موصى به. معرّفات رقمية (واحد في كل حقل) من @userinfobot. بدون ذلك، يمكن لأي شخص مراسلة بوتك مباشرة.'
},
TELEGRAM_PROXY: {
label: 'رابط الـ Proxy',
@@ -275,7 +278,7 @@ export const arCommandCenter = {
},
DISCORD_ALLOWED_USERS: {
label: 'معرّفات مستخدمي Discord المسموح بهم',
- help: 'موصى به. معرّفات مستخدمي Discord مفصولة بفواصل.'
+ help: 'موصى به. معرّفات مستخدمي Discord (واحد في كل حقل).'
},
DISCORD_REPLY_TO_MODE: {
label: 'نمط الرد',
@@ -325,7 +328,7 @@ export const arCommandCenter = {
},
SLACK_ALLOWED_USERS: {
label: 'معرّفات مستخدمي Slack المسموح بهم',
- help: 'موصى به. معرّفات مستخدمي Slack مفصولة بفواصل.'
+ help: 'موصى به. معرّفات مستخدمي Slack (واحد في كل حقل).'
},
MATTERMOST_URL: {
label: 'رابط الخادم',
@@ -336,7 +339,7 @@ export const arCommandCenter = {
},
MATTERMOST_ALLOWED_USERS: {
label: 'معرّفات المستخدمين المسموح بهم',
- help: 'موصى به. معرّفات مستخدمي Mattermost مفصولة بفواصل.'
+ help: 'موصى به. معرّفات مستخدمي Mattermost (واحد في كل حقل).'
},
MATRIX_HOMESERVER: {
label: 'رابط Homeserver',
@@ -351,7 +354,7 @@ export const arCommandCenter = {
},
MATRIX_ALLOWED_USERS: {
label: 'معرّفات مستخدمي Matrix المسموح بهم',
- help: 'موصى به. معرّفات مستخدمين مفصولة بفواصل بصيغة @user:server.'
+ help: 'موصى به. معرّفات مستخدمين (واحد في كل حقل) بصيغة @user:server.'
},
SIGNAL_HTTP_URL: {
label: 'رابط جسر Signal',
@@ -364,7 +367,7 @@ export const arCommandCenter = {
},
SIGNAL_ALLOWED_USERS: {
label: 'مستخدمو Signal المسموح بهم',
- help: 'موصى به. معرّفات Signal مفصولة بفواصل.'
+ help: 'موصى به. معرّفات Signal (واحد في كل حقل).'
},
WHATSAPP_ENABLED: {
label: 'تفعيل جسر WhatsApp',
@@ -375,7 +378,7 @@ export const arCommandCenter = {
},
WHATSAPP_ALLOWED_USERS: {
label: 'مستخدمو WhatsApp المسموح بهم',
- help: 'موصى به. أرقام هواتف أو معرّفات WhatsApp مفصولة بفواصل.'
+ help: 'موصى به. أرقام هواتف أو معرّفات WhatsApp (واحد في كل حقل).'
}
},
platformIntro: {}
diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.ts
index bcefdf6b595..7c2da615130 100644
--- a/apps/desktop/src/i18n/de.ts
+++ b/apps/desktop/src/i18n/de.ts
@@ -3311,6 +3311,9 @@ export const deOverrides = {
replaceValue: 'Aktuellen Wert ersetzen',
openDocs: 'Dokumentation öffnen',
clearField: key => `${key} löschen`,
+ addListEntry: 'Weitere hinzufügen',
+ removeListEntry: 'Entfernen',
+ listEntryPlaceholder: 'ID eingeben',
enableAria: name => `${name} aktivieren`,
disableAria: name => `${name} deaktivieren`,
platformEnabled: name => `${name} aktiviert`,
@@ -3392,7 +3395,7 @@ export const deOverrides = {
},
TELEGRAM_ALLOWED_USERS: {
label: 'Erlaubte Telegram-Benutzer-IDs',
- help: 'Empfohlen. Numerische IDs von @userinfobot, durch Kommas getrennt. Ohne diese können Ihnen beliebige Benutzer Direktnachrichten senden.'
+ help: 'Empfohlen. Numerische IDs von @userinfobot, eine pro Feld. Ohne diese können Ihnen beliebige Benutzer Direktnachrichten senden.'
},
TELEGRAM_PROXY: {
label: 'Proxy-URL',
@@ -3404,7 +3407,7 @@ export const deOverrides = {
},
DISCORD_ALLOWED_USERS: {
label: 'Erlaubte Discord-Benutzer-IDs',
- help: 'Empfohlen. Discord-Benutzer-IDs, durch Kommas getrennt.'
+ help: 'Empfohlen. Discord-Benutzer-IDs, eine pro Feld.'
},
DISCORD_REPLY_TO_MODE: {
label: 'Antwortstil',
@@ -3454,7 +3457,7 @@ export const deOverrides = {
},
SLACK_ALLOWED_USERS: {
label: 'Erlaubte Slack-Benutzer-IDs',
- help: 'Empfohlen. Slack-Benutzer-IDs, durch Kommas getrennt.'
+ help: 'Empfohlen. Slack-Benutzer-IDs, eine pro Feld.'
},
MATTERMOST_URL: {
label: 'Server-URL',
@@ -3465,7 +3468,7 @@ export const deOverrides = {
},
MATTERMOST_ALLOWED_USERS: {
label: 'Erlaubte Benutzer-IDs',
- help: 'Empfohlen. Mattermost-Benutzer-IDs, durch Kommas getrennt.'
+ help: 'Empfohlen. Mattermost-Benutzer-IDs, eine pro Feld.'
},
MATRIX_HOMESERVER: {
label: 'Homeserver-URL',
@@ -3480,7 +3483,7 @@ export const deOverrides = {
},
MATRIX_ALLOWED_USERS: {
label: 'Erlaubte Matrix-Benutzer-IDs',
- help: 'Empfohlen. Benutzer-IDs im Format @benutzer:server, durch Kommas getrennt.'
+ help: 'Empfohlen. Benutzer-IDs im Format @benutzer:server, eine pro Feld.'
},
SIGNAL_HTTP_URL: {
label: 'Signal-Bridge-URL',
@@ -3493,7 +3496,7 @@ export const deOverrides = {
},
SIGNAL_ALLOWED_USERS: {
label: 'Erlaubte Signal-Benutzer',
- help: 'Empfohlen. Signal-Kennungen, durch Kommas getrennt.'
+ help: 'Empfohlen. Signal-Kennungen, eine pro Feld.'
},
WHATSAPP_ENABLED: {
label: 'WhatsApp-Bridge aktivieren',
@@ -3504,7 +3507,7 @@ export const deOverrides = {
},
WHATSAPP_ALLOWED_USERS: {
label: 'Erlaubte WhatsApp-Benutzer',
- help: 'Empfohlen. Telefonnummern oder WhatsApp-IDs, durch Kommas getrennt.'
+ help: 'Empfohlen. Telefonnummern oder WhatsApp-IDs, eine pro Feld.'
}
},
platformIntro: {}
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 516681bb948..4b712fb5d78 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -2933,6 +2933,9 @@ export const en: Translations = {
replaceValue: 'Replace current value',
openDocs: 'Open docs',
clearField: key => `Clear ${key}`,
+ addListEntry: 'Add another',
+ removeListEntry: 'Remove',
+ listEntryPlaceholder: 'Enter an ID',
enableAria: name => `Enable ${name}`,
disableAria: name => `Disable ${name}`,
platformEnabled: name => `${name} enabled`,
@@ -3009,7 +3012,7 @@ export const en: Translations = {
},
TELEGRAM_ALLOWED_USERS: {
label: 'Allowed Telegram user IDs',
- help: 'Recommended. Comma-separated numeric IDs from @userinfobot. Without this, anyone can DM your bot.'
+ help: 'Recommended. Numeric IDs from @userinfobot, one per box. Without this, anyone can DM your bot.'
},
TELEGRAM_PROXY: { label: 'Proxy URL', help: 'Only needed on networks where Telegram is blocked.' },
DISCORD_BOT_TOKEN: {
@@ -3018,7 +3021,7 @@ export const en: Translations = {
},
DISCORD_ALLOWED_USERS: {
label: 'Allowed Discord user IDs',
- help: 'Recommended. Comma-separated Discord user IDs.'
+ help: 'Recommended. Discord user IDs, one per box.'
},
DISCORD_REPLY_TO_MODE: { label: 'Reply style', help: 'first, all, or off.' },
DISCORD_ALLOW_ALL_USERS: {
@@ -3052,19 +3055,19 @@ export const en: Translations = {
help: 'Use the app-level token required for Socket Mode.',
placeholder: 'Paste Slack app token'
},
- SLACK_ALLOWED_USERS: { label: 'Allowed Slack user IDs', help: 'Recommended. Comma-separated Slack user IDs.' },
+ SLACK_ALLOWED_USERS: { label: 'Allowed Slack user IDs', help: 'Recommended. Slack user IDs, one per box.' },
MATTERMOST_URL: { label: 'Server URL', placeholder: 'https://mattermost.example.com' },
MATTERMOST_TOKEN: { label: 'Bot token' },
MATTERMOST_ALLOWED_USERS: {
label: 'Allowed user IDs',
- help: 'Recommended. Comma-separated Mattermost user IDs.'
+ help: 'Recommended. Mattermost user IDs, one per box.'
},
MATRIX_HOMESERVER: { label: 'Homeserver URL', placeholder: 'https://matrix.org' },
MATRIX_ACCESS_TOKEN: { label: 'Access token' },
MATRIX_USER_ID: { label: 'Bot user ID', placeholder: '@hermes:example.org' },
MATRIX_ALLOWED_USERS: {
label: 'Allowed Matrix user IDs',
- help: 'Recommended. Comma-separated user IDs in @user:server format.'
+ help: 'Recommended. User IDs in @user:server format, one per box.'
},
SIGNAL_HTTP_URL: {
label: 'Signal bridge URL',
@@ -3072,7 +3075,7 @@ export const en: Translations = {
help: 'URL of a running signal-cli REST bridge.'
},
SIGNAL_ACCOUNT: { label: 'Phone number', help: 'The number registered with your signal-cli bridge.' },
- SIGNAL_ALLOWED_USERS: { label: 'Allowed Signal users', help: 'Recommended. Comma-separated Signal identifiers.' },
+ SIGNAL_ALLOWED_USERS: { label: 'Allowed Signal users', help: 'Recommended. Signal identifiers, one per box.' },
WHATSAPP_ENABLED: {
label: 'Enable WhatsApp bridge',
help: 'Set automatically by the toggle below. Leave alone unless you know you need it.'
@@ -3080,7 +3083,7 @@ export const en: Translations = {
WHATSAPP_MODE: { label: 'Bridge mode' },
WHATSAPP_ALLOWED_USERS: {
label: 'Allowed WhatsApp users',
- help: 'Recommended. Comma-separated phone numbers or WhatsApp IDs.'
+ help: 'Recommended. Phone numbers or WhatsApp IDs, one per box.'
}
},
platformIntro: {}
diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.ts
index 0100b98172c..0af7a1cdfc0 100644
--- a/apps/desktop/src/i18n/es.ts
+++ b/apps/desktop/src/i18n/es.ts
@@ -3306,6 +3306,9 @@ export const esOverrides = {
replaceValue: 'Reemplazar valor actual',
openDocs: 'Abrir docs',
clearField: key => `Limpiar ${key}`,
+ addListEntry: 'Añadir otro',
+ removeListEntry: 'Quitar',
+ listEntryPlaceholder: 'Introduce un ID',
enableAria: name => `Activar ${name}`,
disableAria: name => `Desactivar ${name}`,
platformEnabled: name => `${name} activado`,
@@ -3386,7 +3389,7 @@ export const esOverrides = {
},
TELEGRAM_ALLOWED_USERS: {
label: 'IDs de usuarios de Telegram permitidos',
- help: 'Recomendado. IDs numéricos separados por comas desde @userinfobot. Sin esto, cualquiera puede enviar DM a tu bot.'
+ help: 'Recomendado. IDs numéricos (uno por casilla) desde @userinfobot. Sin esto, cualquiera puede enviar DM a tu bot.'
},
TELEGRAM_PROXY: {
label: 'URL de proxy',
@@ -3398,7 +3401,7 @@ export const esOverrides = {
},
DISCORD_ALLOWED_USERS: {
label: 'IDs de usuarios de Discord permitidos',
- help: 'Recomendado. IDs de usuarios de Discord separados por comas.'
+ help: 'Recomendado. IDs de usuarios de Discord (uno por casilla).'
},
DISCORD_REPLY_TO_MODE: {
label: 'Estilo de respuesta',
@@ -3448,7 +3451,7 @@ export const esOverrides = {
},
SLACK_ALLOWED_USERS: {
label: 'IDs de usuarios de Slack permitidos',
- help: 'Recomendado. IDs de Slack separados por comas.'
+ help: 'Recomendado. IDs de Slack (uno por casilla).'
},
MATTERMOST_URL: {
label: 'URL del servidor',
@@ -3459,7 +3462,7 @@ export const esOverrides = {
},
MATTERMOST_ALLOWED_USERS: {
label: 'IDs de usuarios permitidos',
- help: 'Recomendado. IDs de Mattermost separados por comas.'
+ help: 'Recomendado. IDs de Mattermost (uno por casilla).'
},
MATRIX_HOMESERVER: {
label: 'URL del homeserver',
@@ -3474,7 +3477,7 @@ export const esOverrides = {
},
MATRIX_ALLOWED_USERS: {
label: 'IDs de usuarios de Matrix permitidos',
- help: 'Recomendado. IDs separados por comas en formato @usuario:servidor.'
+ help: 'Recomendado. IDs (uno por casilla) en formato @usuario:servidor.'
},
SIGNAL_HTTP_URL: {
label: 'URL del puente Signal',
@@ -3487,7 +3490,7 @@ export const esOverrides = {
},
SIGNAL_ALLOWED_USERS: {
label: 'Usuarios de Signal permitidos',
- help: 'Recomendado. Identificadores de Signal separados por comas.'
+ help: 'Recomendado. Identificadores de Signal (uno por casilla).'
},
WHATSAPP_ENABLED: {
label: 'Activar puente de WhatsApp',
@@ -3498,7 +3501,7 @@ export const esOverrides = {
},
WHATSAPP_ALLOWED_USERS: {
label: 'Usuarios de WhatsApp permitidos',
- help: 'Recomendado. Números de teléfono o IDs de WhatsApp separados por comas.'
+ help: 'Recomendado. Números de teléfono o IDs de WhatsApp (uno por casilla).'
}
},
platformIntro: {}
diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.ts
index 50e852083fb..f07ad451190 100644
--- a/apps/desktop/src/i18n/fr.ts
+++ b/apps/desktop/src/i18n/fr.ts
@@ -3324,6 +3324,9 @@ export const frOverrides = {
replaceValue: 'Remplacer la valeur actuelle',
openDocs: 'Ouvrir la documentation',
clearField: key => `Effacer ${key}`,
+ addListEntry: 'Ajouter',
+ removeListEntry: 'Retirer',
+ listEntryPlaceholder: 'Saisir un identifiant',
enableAria: name => `Activer ${name}`,
disableAria: name => `Désactiver ${name}`,
platformEnabled: name => `${name} activé`,
@@ -3404,7 +3407,7 @@ export const frOverrides = {
},
TELEGRAM_ALLOWED_USERS: {
label: "IDs d'utilisateurs Telegram autorisés",
- help: "Recommandé. IDs numériques séparés par des virgules depuis @userinfobot. Sans cela, n'importe qui peut envoyer un message privé à votre bot."
+ help: "Recommandé. IDs numériques (un par case) depuis @userinfobot. Sans cela, n'importe qui peut envoyer un message privé à votre bot."
},
TELEGRAM_PROXY: {
label: 'URL du proxy',
@@ -3416,7 +3419,7 @@ export const frOverrides = {
},
DISCORD_ALLOWED_USERS: {
label: "IDs d'utilisateurs Discord autorisés",
- help: "Recommandé. IDs d'utilisateurs Discord séparés par des virgules."
+ help: "Recommandé. IDs d'utilisateurs Discord (un par case)."
},
DISCORD_REPLY_TO_MODE: {
label: 'Style de réponse',
@@ -3466,7 +3469,7 @@ export const frOverrides = {
},
SLACK_ALLOWED_USERS: {
label: "IDs d'utilisateurs Slack autorisés",
- help: "Recommandé. IDs d'utilisateurs Slack séparés par des virgules."
+ help: "Recommandé. IDs d'utilisateurs Slack (un par case)."
},
MATTERMOST_URL: {
label: 'URL du serveur',
@@ -3477,7 +3480,7 @@ export const frOverrides = {
},
MATTERMOST_ALLOWED_USERS: {
label: "IDs d'utilisateurs autorisés",
- help: "Recommandé. IDs d'utilisateurs Mattermost séparés par des virgules."
+ help: "Recommandé. IDs d'utilisateurs Mattermost (un par case)."
},
MATRIX_HOMESERVER: {
label: 'URL du homeserver',
@@ -3492,7 +3495,7 @@ export const frOverrides = {
},
MATRIX_ALLOWED_USERS: {
label: "IDs d'utilisateurs Matrix autorisés",
- help: "Recommandé. IDs d'utilisateurs séparés par des virgules au format @utilisateur:serveur."
+ help: "Recommandé. IDs d'utilisateurs (un par case) au format @utilisateur:serveur."
},
SIGNAL_HTTP_URL: {
label: 'URL du pont Signal',
@@ -3505,7 +3508,7 @@ export const frOverrides = {
},
SIGNAL_ALLOWED_USERS: {
label: 'Utilisateurs Signal autorisés',
- help: 'Recommandé. Identifiants Signal séparés par des virgules.'
+ help: 'Recommandé. Identifiants Signal (un par case).'
},
WHATSAPP_ENABLED: {
label: 'Activer le pont WhatsApp',
@@ -3516,7 +3519,7 @@ export const frOverrides = {
},
WHATSAPP_ALLOWED_USERS: {
label: 'Utilisateurs WhatsApp autorisés',
- help: 'Recommandé. Numéros de téléphone ou IDs WhatsApp séparés par des virgules.'
+ help: 'Recommandé. Numéros de téléphone ou IDs WhatsApp (un par case).'
}
},
platformIntro: {}
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index d96ee7ee772..a7a180a3734 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -1985,6 +1985,9 @@ export const ja = defineLocale({
replaceValue: '現在の値を置き換え',
openDocs: 'ドキュメントを開く',
clearField: key => `${key} をクリア`,
+ addListEntry: '追加',
+ removeListEntry: '削除',
+ listEntryPlaceholder: 'ID を入力',
enableAria: name => `${name} を有効にする`,
disableAria: name => `${name} を無効にする`,
platformEnabled: name => `${name} を有効にしました`,
@@ -2007,7 +2010,7 @@ export const ja = defineLocale({
},
TELEGRAM_ALLOWED_USERS: {
label: '許可する Telegram ユーザー ID',
- help: '推奨。@userinfobot の数値 ID をカンマ区切りで。設定しないと誰でもボットに DM できます。'
+ help: '推奨。@userinfobot の数値 ID(1 欄に 1 件)。設定しないと誰でもボットに DM できます。'
},
TELEGRAM_PROXY: { label: 'プロキシ URL', help: 'Telegram がブロックされているネットワークでのみ必要です。' },
DISCORD_BOT_TOKEN: {
@@ -2016,7 +2019,7 @@ export const ja = defineLocale({
},
DISCORD_ALLOWED_USERS: {
label: '許可する Discord ユーザー ID',
- help: '推奨。カンマ区切りの Discord ユーザー ID。'
+ help: '推奨。Discord ユーザー ID(1 欄に 1 件)。'
},
DISCORD_REPLY_TO_MODE: { label: '返信スタイル', help: 'first、all、または off。' },
DISCORD_ALLOW_ALL_USERS: {
@@ -2052,20 +2055,20 @@ export const ja = defineLocale({
},
SLACK_ALLOWED_USERS: {
label: '許可する Slack ユーザー ID',
- help: '推奨。カンマ区切りの Slack ユーザー ID。'
+ help: '推奨。Slack ユーザー ID(1 欄に 1 件)。'
},
MATTERMOST_URL: { label: 'サーバー URL', placeholder: 'https://mattermost.example.com' },
MATTERMOST_TOKEN: { label: 'ボットトークン' },
MATTERMOST_ALLOWED_USERS: {
label: '許可するユーザー ID',
- help: '推奨。カンマ区切りの Mattermost ユーザー ID。'
+ help: '推奨。Mattermost ユーザー ID(1 欄に 1 件)。'
},
MATRIX_HOMESERVER: { label: 'ホームサーバー URL', placeholder: 'https://matrix.org' },
MATRIX_ACCESS_TOKEN: { label: 'アクセストークン' },
MATRIX_USER_ID: { label: 'ボットユーザー ID', placeholder: '@hermes:example.org' },
MATRIX_ALLOWED_USERS: {
label: '許可する Matrix ユーザー ID',
- help: '推奨。@user:server 形式のカンマ区切りユーザー ID。'
+ help: '推奨。@user:server 形式のユーザー ID(1 欄に 1 件)。'
},
SIGNAL_HTTP_URL: {
label: 'Signal ブリッジ URL',
@@ -2075,7 +2078,7 @@ export const ja = defineLocale({
SIGNAL_ACCOUNT: { label: '電話番号', help: 'signal-cli ブリッジに登録した番号。' },
SIGNAL_ALLOWED_USERS: {
label: '許可する Signal ユーザー',
- help: '推奨。カンマ区切りの Signal 識別子。'
+ help: '推奨。Signal 識別子(1 欄に 1 件)。'
},
WHATSAPP_ENABLED: {
label: 'WhatsApp ブリッジを有効にする',
@@ -2084,7 +2087,7 @@ export const ja = defineLocale({
WHATSAPP_MODE: { label: 'ブリッジモード' },
WHATSAPP_ALLOWED_USERS: {
label: '許可する WhatsApp ユーザー',
- help: '推奨。カンマ区切りの電話番号または WhatsApp ID。'
+ help: '推奨。電話番号または WhatsApp ID(1 欄に 1 件)。'
}
},
platformIntro: {}
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index 98df35dcb7a..f225dcb6221 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -2098,6 +2098,9 @@ export const ru = defineLocale({
replaceValue: 'Заменить текущее значение',
openDocs: 'Открыть документацию',
clearField: key => `Очистить ${key}`,
+ addListEntry: 'Добавить ещё',
+ removeListEntry: 'Удалить',
+ listEntryPlaceholder: 'Введите ID',
enableAria: name => `Включить ${name}`,
disableAria: name => `Отключить ${name}`,
platformEnabled: name => `${name} включено`,
@@ -2173,7 +2176,7 @@ export const ru = defineLocale({
},
TELEGRAM_ALLOWED_USERS: {
label: 'Разрешённые ID пользователей Telegram',
- help: 'Рекомендуется. Числовые ID через @userinfobot через запятую. Без этого писать вашему боту может кто угодно.'
+ help: 'Рекомендуется. Числовые ID через @userinfobot (по одному в поле). Без этого писать вашему боту может кто угодно.'
},
TELEGRAM_PROXY: { label: 'URL прокси', help: 'Нужен только в сетях, где Telegram заблокирован.' },
DISCORD_BOT_TOKEN: {
@@ -2182,7 +2185,7 @@ export const ru = defineLocale({
},
DISCORD_ALLOWED_USERS: {
label: 'Разрешённые ID пользователей Discord',
- help: 'Рекомендуется. ID пользователей Discord через запятую.'
+ help: 'Рекомендуется. ID пользователей Discord (по одному в поле).'
},
DISCORD_REPLY_TO_MODE: { label: 'Стиль ответов', help: 'first, all или off.' },
DISCORD_ALLOW_ALL_USERS: {
@@ -2218,20 +2221,20 @@ export const ru = defineLocale({
},
SLACK_ALLOWED_USERS: {
label: 'Разрешённые ID пользователей Slack',
- help: 'Рекомендуется. ID пользователей Slack через запятую.'
+ help: 'Рекомендуется. ID пользователей Slack (по одному в поле).'
},
MATTERMOST_URL: { label: 'URL сервера', placeholder: 'https://mattermost.example.com' },
MATTERMOST_TOKEN: { label: 'Токен бота' },
MATTERMOST_ALLOWED_USERS: {
label: 'Разрешённые ID пользователей',
- help: 'Рекомендуется. ID пользователей Mattermost через запятую.'
+ help: 'Рекомендуется. ID пользователей Mattermost (по одному в поле).'
},
MATRIX_HOMESERVER: { label: 'URL homeserver', placeholder: 'https://matrix.org' },
MATRIX_ACCESS_TOKEN: { label: 'Токен доступа' },
MATRIX_USER_ID: { label: 'ID пользователя бота', placeholder: '@hermes:example.org' },
MATRIX_ALLOWED_USERS: {
label: 'Разрешённые ID пользователей Matrix',
- help: 'Рекомендуется. ID пользователей через запятую в формате @user:server.'
+ help: 'Рекомендуется. ID пользователей (по одному в поле) в формате @user:server.'
},
SIGNAL_HTTP_URL: {
label: 'URL моста Signal',
@@ -2241,7 +2244,7 @@ export const ru = defineLocale({
SIGNAL_ACCOUNT: { label: 'Номер телефона', help: 'Номер, зарегистрированный в вашем мосте signal-cli.' },
SIGNAL_ALLOWED_USERS: {
label: 'Разрешённые пользователи Signal',
- help: 'Рекомендуется. Идентификаторы Signal через запятую.'
+ help: 'Рекомендуется. Идентификаторы Signal (по одному в поле).'
},
WHATSAPP_ENABLED: {
label: 'Включить мост WhatsApp',
@@ -2250,7 +2253,7 @@ export const ru = defineLocale({
WHATSAPP_MODE: { label: 'Режим моста' },
WHATSAPP_ALLOWED_USERS: {
label: 'Разрешённые пользователи WhatsApp',
- help: 'Рекомендуется. Номера телефонов или ID WhatsApp через запятую.'
+ help: 'Рекомендуется. Номера телефонов или ID WhatsApp (по одному в поле).'
}
},
platformIntro: {}
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index ab3db7edc3e..fc91cadffdf 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -2500,6 +2500,9 @@ export interface Translations {
replaceValue: string
openDocs: string
clearField: (key: string) => string
+ addListEntry: string
+ removeListEntry: string
+ listEntryPlaceholder: string
enableAria: (name: string) => string
disableAria: (name: string) => string
platformEnabled: (name: string) => string
diff --git a/apps/desktop/src/i18n/zh-hant_command_center.ts b/apps/desktop/src/i18n/zh-hant_command_center.ts
index f56b7c6e7e8..958035bbe4f 100644
--- a/apps/desktop/src/i18n/zh-hant_command_center.ts
+++ b/apps/desktop/src/i18n/zh-hant_command_center.ts
@@ -213,6 +213,9 @@ export const zhHantCommandCenter = {
replaceValue: '取代目前值',
openDocs: '開啟文件',
clearField: key => `清除 ${key}`,
+ addListEntry: '再新增一個',
+ removeListEntry: '移除',
+ listEntryPlaceholder: '輸入 ID',
enableAria: name => `啟用 ${name}`,
disableAria: name => `停用 ${name}`,
platformEnabled: name => `${name} 已啟用`,
@@ -235,14 +238,14 @@ export const zhHantCommandCenter = {
},
TELEGRAM_ALLOWED_USERS: {
label: '允許的 Telegram 使用者 ID',
- help: '建議設定。來自 @userinfobot 的逗號分隔數字 ID。不設定則任何人都能私訊您的機器人。'
+ help: '建議設定。來自 @userinfobot 的數字 ID(每格一個)。不設定則任何人都能私訊您的機器人。'
},
TELEGRAM_PROXY: { label: '代理 URL', help: '僅在 Telegram 被封鎖的網路中需要。' },
DISCORD_BOT_TOKEN: {
label: 'Bot Token',
help: '在 Discord 開發者入口網站建立應用程式,新增機器人,然後貼上其 Token。'
},
- DISCORD_ALLOWED_USERS: { label: '允許的 Discord 使用者 ID', help: '建議設定。逗號分隔的 Discord 使用者 ID。' },
+ DISCORD_ALLOWED_USERS: { label: '允許的 Discord 使用者 ID', help: '建議設定。Discord 使用者 ID(每格一個)。' },
DISCORD_REPLY_TO_MODE: { label: '回覆方式', help: 'first、all 或 off。' },
DISCORD_ALLOW_ALL_USERS: {
label: '允許所有 Discord 使用者',
@@ -272,16 +275,16 @@ export const zhHantCommandCenter = {
help: 'Socket Mode 需要 app 層級 Token。',
placeholder: '貼上 Slack app Token'
},
- SLACK_ALLOWED_USERS: { label: '允許的 Slack 使用者 ID', help: '建議設定。逗號分隔的 Slack 使用者 ID。' },
+ SLACK_ALLOWED_USERS: { label: '允許的 Slack 使用者 ID', help: '建議設定。Slack 使用者 ID(每格一個)。' },
MATTERMOST_URL: { label: '伺服器 URL', placeholder: 'https://mattermost.example.com' },
MATTERMOST_TOKEN: { label: 'Bot Token' },
- MATTERMOST_ALLOWED_USERS: { label: '允許的使用者 ID', help: '建議設定。逗號分隔的 Mattermost 使用者 ID。' },
+ MATTERMOST_ALLOWED_USERS: { label: '允許的使用者 ID', help: '建議設定。Mattermost 使用者 ID(每格一個)。' },
MATRIX_HOMESERVER: { label: 'Homeserver URL', placeholder: 'https://matrix.org' },
MATRIX_ACCESS_TOKEN: { label: '存取 Token' },
MATRIX_USER_ID: { label: 'Bot 使用者 ID', placeholder: '@hermes:example.org' },
MATRIX_ALLOWED_USERS: {
label: '允許的 Matrix 使用者 ID',
- help: '建議設定。@user:server 格式的逗號分隔使用者 ID。'
+ help: '建議設定。@user:server 格式的使用者 ID(每格一個)。'
},
SIGNAL_HTTP_URL: {
label: 'Signal 橋接 URL',
@@ -289,7 +292,7 @@ export const zhHantCommandCenter = {
help: '執行中的 signal-cli REST 橋接的 URL。'
},
SIGNAL_ACCOUNT: { label: '電話號碼', help: '在 signal-cli 橋接中註冊的號碼。' },
- SIGNAL_ALLOWED_USERS: { label: '允許的 Signal 使用者', help: '建議設定。逗號分隔的 Signal 識別碼。' },
+ SIGNAL_ALLOWED_USERS: { label: '允許的 Signal 使用者', help: '建議設定。Signal 識別碼(每格一個)。' },
WHATSAPP_ENABLED: {
label: '啟用 WhatsApp 橋接',
help: '由下方切換開關自動設定。除非確知需要,否則請勿變更。'
@@ -297,7 +300,7 @@ export const zhHantCommandCenter = {
WHATSAPP_MODE: { label: '橋接模式' },
WHATSAPP_ALLOWED_USERS: {
label: '允許的 WhatsApp 使用者',
- help: '建議設定。逗號分隔的電話號碼或 WhatsApp ID。'
+ help: '建議設定。電話號碼或 WhatsApp ID(每格一個)。'
}
},
platformIntro: {}
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 54dc03de0a9..cd3fe31addb 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -2731,6 +2731,9 @@ export const zh = defineLocale({
replaceValue: '替换当前值',
openDocs: '打开文档',
clearField: key => `清除 ${key}`,
+ addListEntry: '再添加一个',
+ removeListEntry: '移除',
+ listEntryPlaceholder: '输入 ID',
enableAria: name => `启用 ${name}`,
disableAria: name => `禁用 ${name}`,
platformEnabled: name => `${name} 已启用`,
@@ -2802,11 +2805,11 @@ export const zh = defineLocale({
},
TELEGRAM_ALLOWED_USERS: {
label: '允许的 Telegram 用户 ID',
- help: '推荐。来自 @userinfobot 的逗号分隔数字 ID。不设置则任何人都能私信你的机器人。'
+ help: '推荐。来自 @userinfobot 的数字 ID(每格一个)。不设置则任何人都能私信你的机器人。'
},
TELEGRAM_PROXY: { label: '代理 URL', help: '仅在 Telegram 被屏蔽的网络中需要。' },
DISCORD_BOT_TOKEN: { label: 'Bot 令牌', help: '在 Discord 开发者门户创建应用,添加机器人,然后粘贴其令牌。' },
- DISCORD_ALLOWED_USERS: { label: '允许的 Discord 用户 ID', help: '推荐。逗号分隔的 Discord 用户 ID。' },
+ DISCORD_ALLOWED_USERS: { label: '允许的 Discord 用户 ID', help: '推荐。Discord 用户 ID(每格一个)。' },
DISCORD_REPLY_TO_MODE: { label: '回复方式', help: 'first、all 或 off。' },
DISCORD_ALLOW_ALL_USERS: {
label: '允许所有 Discord 用户',
@@ -2830,24 +2833,24 @@ export const zh = defineLocale({
help: 'Socket Mode 需要 app 级令牌。',
placeholder: '粘贴 Slack app 令牌'
},
- SLACK_ALLOWED_USERS: { label: '允许的 Slack 用户 ID', help: '推荐。逗号分隔的 Slack 用户 ID。' },
+ SLACK_ALLOWED_USERS: { label: '允许的 Slack 用户 ID', help: '推荐。Slack 用户 ID(每格一个)。' },
MATTERMOST_URL: { label: '服务器 URL', placeholder: 'https://mattermost.example.com' },
MATTERMOST_TOKEN: { label: 'Bot 令牌' },
- MATTERMOST_ALLOWED_USERS: { label: '允许的用户 ID', help: '推荐。逗号分隔的 Mattermost 用户 ID。' },
+ MATTERMOST_ALLOWED_USERS: { label: '允许的用户 ID', help: '推荐。Mattermost 用户 ID(每格一个)。' },
MATRIX_HOMESERVER: { label: 'Homeserver URL', placeholder: 'https://matrix.org' },
MATRIX_ACCESS_TOKEN: { label: '访问令牌' },
MATRIX_USER_ID: { label: 'Bot 用户 ID', placeholder: '@hermes:example.org' },
- MATRIX_ALLOWED_USERS: { label: '允许的 Matrix 用户 ID', help: '推荐。@user:server 格式的逗号分隔用户 ID。' },
+ MATRIX_ALLOWED_USERS: { label: '允许的 Matrix 用户 ID', help: '推荐。@user:server 格式的用户 ID(每格一个)。' },
SIGNAL_HTTP_URL: {
label: 'Signal 桥接 URL',
placeholder: 'http://127.0.0.1:8080',
help: '运行中的 signal-cli REST 桥接的 URL。'
},
SIGNAL_ACCOUNT: { label: '电话号码', help: '在 signal-cli 桥接中注册的号码。' },
- SIGNAL_ALLOWED_USERS: { label: '允许的 Signal 用户', help: '推荐。逗号分隔的 Signal 标识符。' },
+ SIGNAL_ALLOWED_USERS: { label: '允许的 Signal 用户', help: '推荐。Signal 标识符(每格一个)。' },
WHATSAPP_ENABLED: { label: '启用 WhatsApp 桥接', help: '由下方开关自动设置。除非确知需要,否则请勿改动。' },
WHATSAPP_MODE: { label: '桥接模式' },
- WHATSAPP_ALLOWED_USERS: { label: '允许的 WhatsApp 用户', help: '推荐。逗号分隔的电话号码或 WhatsApp ID。' }
+ WHATSAPP_ALLOWED_USERS: { label: '允许的 WhatsApp 用户', help: '推荐。电话号码或 WhatsApp ID(每格一个)。' }
},
platformIntro: {
telegram:
diff --git a/apps/desktop/src/types/hermes.ts b/apps/desktop/src/types/hermes.ts
index ba1b527c9ea..53149bcb5c2 100644
--- a/apps/desktop/src/types/hermes.ts
+++ b/apps/desktop/src/types/hermes.ts
@@ -323,6 +323,8 @@ export interface CustomEndpointValidationResponse {
export interface MessagingEnvVarInfo {
advanced: boolean
description: string
+ /** Comma-separated allowlist rendered one entry per ID (absent on older backends). */
+ is_list?: boolean
is_password: boolean
is_set: boolean
key: string
@@ -330,6 +332,8 @@ export interface MessagingEnvVarInfo {
redacted_value: null | string
required: boolean
url: null | string
+ /** Plain saved value, sent only for allowlists (they are IDs, not secrets). */
+ value?: null | string
}
export interface MessagingHomeChannel {
diff --git a/hermes_cli/web_routers/messaging.py b/hermes_cli/web_routers/messaging.py
index 09acda2c3f3..71a32e9b8cf 100644
--- a/hermes_cli/web_routers/messaging.py
+++ b/hermes_cli/web_routers/messaging.py
@@ -141,14 +141,22 @@ def _validate_messaging_env_value(platform_id: str, key: str, value: str) -> Non
raise HTTPException(status_code=400, detail=rule[1])
+# Allowlists (``*_ALLOWED_USERS``, ``LINE_ALLOWED_GROUPS``, ``SIMPLEX_GROUP_ALLOWED``) are
+# comma-separated IDs, not secrets: clients render them as one editable entry per ID, which
+# needs the saved value instead of a redacted preview.
+_ALLOWLIST_KEY_RE = re.compile(r"_ALLOWED(?:_[A-Z]+)?$")
+
+
def _messaging_env_info(key: str) -> dict[str, Any]:
info = OPTIONAL_ENV_VARS.get(key) or _MESSAGING_ENV_FALLBACKS.get(key) or {}
+ is_password = bool(info.get("password", False))
return {
"description": info.get("description", ""),
"prompt": info.get("prompt", key),
"help": info.get("help", ""),
"url": info.get("url"),
- "is_password": info.get("password", False),
+ "is_password": is_password,
+ "is_list": not is_password and bool(_ALLOWLIST_KEY_RE.search(key)),
"advanced": info.get("advanced", False),
}
@@ -232,13 +240,14 @@ def _messaging_platform_payload(
# os.environ carries the ROOT install's .env and would report root credentials as the profile's.
return env_on_disk.get(key) or ("" if scoped else os.getenv(key, ""))
- env_vars = [
- {
+ env_vars = []
+ for key in entry["env_vars"]:
+ value, info = env_value(key), _messaging_env_info(key)
+ env_vars.append({
"key": key, "required": key in entry["required_env"], "is_set": bool(value),
- "redacted_value": redacted_credential_preview(value), **_messaging_env_info(key),
- }
- for key, value in ((key, env_value(key)) for key in entry["env_vars"])
- ]
+ "redacted_value": redacted_credential_preview(value),
+ "value": value if info["is_list"] else None, **info,
+ })
enabled, configured, home_channel = _platform_enablement(platform_id, entry, env_on_disk, scoped)
if gateway_running and runtime_platform.get("mirrored_from"):
diff --git a/tests/hermes_cli/test_web_server_messaging_profiles.py b/tests/hermes_cli/test_web_server_messaging_profiles.py
index 18bee5211b9..a5a1b22c30b 100644
--- a/tests/hermes_cli/test_web_server_messaging_profiles.py
+++ b/tests/hermes_cli/test_web_server_messaging_profiles.py
@@ -81,6 +81,23 @@ class TestProfileScopedMessagingReads:
assert token["is_set"] is False
assert telegram["configured"] is False
+ def test_allowlist_value_is_readable_but_secrets_stay_redacted(
+ self, client, isolated_profiles
+ ):
+ """Clients edit an allowlist one ID per entry, so they need its saved value;
+ the bot token next to it must still only ever leave as a redacted preview."""
+ (isolated_profiles["worker_alpha"] / ".env").write_text(
+ f"TELEGRAM_BOT_TOKEN={_VALID_WORKER_BOT_TOKEN}\nTELEGRAM_ALLOWED_USERS=111,222\n",
+ encoding="utf-8",
+ )
+ telegram = _telegram(
+ client.get("/api/messaging/platforms", params={"profile": "worker_alpha"}).json()
+ )
+ allowlist = _env_field(telegram, "TELEGRAM_ALLOWED_USERS")
+ token = _env_field(telegram, "TELEGRAM_BOT_TOKEN")
+ assert (allowlist["is_list"], allowlist["value"]) == (True, "111,222")
+ assert (token["is_list"], token["value"]) == (False, None)
+ assert _VALID_WORKER_BOT_TOKEN not in str(token)
def test_unknown_profile_returns_404(self, client, isolated_profiles):
resp = client.get(
diff --git a/web/src/components/AllowlistInput.tsx b/web/src/components/AllowlistInput.tsx
new file mode 100644
index 00000000000..75fc0c0ff49
--- /dev/null
+++ b/web/src/components/AllowlistInput.tsx
@@ -0,0 +1,109 @@
+import { useState } from 'react'
+import { Plus, X } from 'lucide-react'
+import { Button } from '@nous-research/ui/ui/components/button'
+import { Input } from '@nous-research/ui/ui/components/input'
+
+interface Row {
+ id: number
+ value: string
+}
+
+// Row identity for React keys and focus.
+let rowSeq = 0
+
+/** Allowlists are stored as one comma-separated env value; a pasted list may also use newlines. */
+export function splitAllowlist(raw: string | null | undefined): string[] {
+ return (raw || '')
+ .split(/[,\n]/)
+ .map(entry => entry.trim())
+ .filter(Boolean)
+}
+
+export function joinAllowlist(entries: string[]): string {
+ return [...new Set(entries.map(entry => entry.trim()).filter(Boolean))].join(',')
+}
+
+function toRows(raw: string | null | undefined): Row[] {
+ const entries = splitAllowlist(raw)
+ return (entries.length ? entries : ['']).map(value => ({ id: rowSeq++, value }))
+}
+
+/** One input per allowed user/ID, with + to add and × to remove; reports one comma-separated value. */
+export function AllowlistInput({
+ id,
+ label,
+ value,
+ onChange,
+ invalid
+}: {
+ id: string
+ label: string
+ value: string
+ onChange: (value: string) => void
+ invalid?: boolean
+}) {
+ const [rows, setRows] = useState<Row[]>(() => toRows(value))
+ const [focusId, setFocusId] = useState<number | null>(null)
+
+ const commit = (next: Row[]) => {
+ setRows(next)
+ onChange(joinAllowlist(next.map(row => row.value)))
+ }
+
+ const change = (rowId: number, text: string) => {
+ // A pasted "123, 456" becomes one box per entry.
+ const parts = /[,\n]/.test(text) ? splitAllowlist(text) : [text]
+ const index = rows.findIndex(row => row.id === rowId)
+ const replacement = parts.length
+ ? parts.map((part, i) => ({ id: i === 0 ? rowId : rowSeq++, value: part }))
+ : [{ id: rowId, value: '' }]
+ commit([...rows.slice(0, index), ...replacement, ...rows.slice(index + 1)])
+ }
+
+ const add = () => {
+ const rowId = rowSeq++
+ setFocusId(rowId)
+ setRows([...rows, { id: rowId, value: '' }])
+ }
+
+ const remove = (rowId: number) => {
+ const next = rows.filter(row => row.id !== rowId)
+ commit(next.length ? next : [{ id: rowSeq++, value: '' }])
+ }
+
+ const lone = rows.length === 1 && !rows[0].value
+
+ return (
+ <div className="grid gap-1.5" data-slot="allowlist-input">
+ {rows.map((row, index) => (
+ <div className="flex items-center gap-2" key={row.id}>
+ <Input
+ id={index === 0 ? id : undefined}
+ aria-label={`${label} ${index + 1}`}
+ aria-invalid={invalid}
+ autoFocus={row.id === focusId}
+ type="text"
+ className="text-base leading-6 sm:text-xs sm:leading-4"
+ placeholder="Enter an ID"
+ value={row.value}
+ onChange={e => change(row.id, e.target.value)}
+ onKeyDown={e => {
+ if (e.key === 'Enter' && row.value.trim()) {
+ e.preventDefault()
+ add()
+ }
+ }}
+ />
+ <Button ghost size="icon" aria-label="Remove" title="Remove" disabled={lone} onClick={() => remove(row.id)}>
+ <X className="h-3.5 w-3.5" />
+ </Button>
+ </div>
+ ))}
+ <div>
+ <Button ghost size="sm" onClick={add} prefix={<Plus className="h-3.5 w-3.5" />}>
+ Add another
+ </Button>
+ </div>
+ </div>
+ )
+}
diff --git a/web/src/lib/api.ts b/web/src/lib/api.ts
index 764a75ef8d1..a64a743c5b8 100644
--- a/web/src/lib/api.ts
+++ b/web/src/lib/api.ts
@@ -1679,6 +1679,10 @@ export interface MessagingPlatformEnvVar {
help: string;
url: string | null;
is_password: boolean;
+ /** Comma-separated allowlist rendered one entry per ID (absent on older backends). */
+ is_list?: boolean;
+ /** Plain saved value, sent only for allowlists (they are IDs, not secrets). */
+ value?: string | null;
advanced: boolean;
}
diff --git a/web/src/pages/ChannelsPage.tsx b/web/src/pages/ChannelsPage.tsx
index 66c9676c8b8..ffc4da96f64 100644
--- a/web/src/pages/ChannelsPage.tsx
+++ b/web/src/pages/ChannelsPage.tsx
@@ -34,6 +34,7 @@ import type {
WhatsAppOnboardingStartResponse,
} from "@/lib/api";
import { useModalBehavior } from "@/hooks/useModalBehavior";
+import { AllowlistInput } from "@/components/AllowlistInput";
import { usePageHeader } from "@/contexts/usePageHeader";
import { cn, themedBody } from "@/lib/utils";
import { errorMessage } from "@/lib/api-error";
@@ -177,7 +178,8 @@ export default function ChannelsPage() {
const openConfig = (platform: MessagingPlatform) => {
const initial: Record<string, string> = {};
platform.env_vars.forEach((v) => {
- initial[v.key] = "";
+ // Allowlists open with their saved entries (they are IDs, not secrets).
+ initial[v.key] = v.is_list ? v.value || "" : "";
});
setDraftEnv(initial);
setFieldErrors({});
@@ -189,10 +191,19 @@ export default function ChannelsPage() {
// Only send fields the user actually filled in — leaving a field blank
// preserves the existing value rather than clobbering it.
const env: Record<string, string> = {};
- Object.entries(draftEnv).forEach(([k, v]) => {
- if (v.trim()) env[k] = v.trim();
+ const clearEnv: string[] = [];
+ editing.env_vars.forEach((field) => {
+ const v = (draftEnv[field.key] || "").trim();
+ if (field.is_list) {
+ // Allowlists are prefilled, so an unchanged one is not an edit and an emptied one is a clear.
+ if (v === (field.value || "")) return;
+ if (v) env[field.key] = v;
+ else if (field.is_set) clearEnv.push(field.key);
+ } else if (v) {
+ env[field.key] = v;
+ }
});
- if (Object.keys(env).length === 0) {
+ if (Object.keys(env).length === 0 && clearEnv.length === 0) {
showToast("Nothing to save — fill in at least one field.", "error");
return;
}
@@ -215,7 +226,11 @@ export default function ChannelsPage() {
}
setSaving(true);
try {
- const body: MessagingPlatformUpdate = { env, enabled: true };
+ const body: MessagingPlatformUpdate = {
+ env,
+ enabled: true,
+ ...(clearEnv.length ? { clear_env: clearEnv } : {}),
+ };
const result = await api.updateMessagingPlatform(editing.id, body);
showToast(
result.hot_served
@@ -479,6 +494,23 @@ export default function ChannelsPage() {
{field.description}
</span>
)}
+ {field.is_list ? (
+ <AllowlistInput
+ id={`field-${field.key}`}
+ label={field.prompt || field.key}
+ value={draftEnv[field.key] ?? ""}
+ invalid={Boolean(fieldErrors[field.key])}
+ onChange={(nextValue) => {
+ setDraftEnv((prev) => ({ ...prev, [field.key]: nextValue }));
+ setFieldErrors((prev) => {
+ if (!prev[field.key]) return prev;
+ const next = { ...prev };
+ delete next[field.key];
+ return next;
+ });
+ }}
+ />
+ ) : (
<Input
id={`field-${field.key}`}
type={field.is_password ? "password" : "text"}
@@ -501,6 +533,7 @@ export default function ChannelsPage() {
});
}}
/>
+ )}
{fieldErrors[field.key] && (
<span className="text-xs text-destructive">
{fieldErrors[field.key]}