Skip to content

"Vibe-Trading: Your Personal Trading Agent"

feat(frontend): QQ setup guide via a per-channel guide registry

shadowinlife413e2c2a03ac
diff --git a/frontend/src/components/settings/ChannelConfigPanel.tsx b/frontend/src/components/settings/ChannelConfigPanel.tsx
index 03ca8e5f4..cd4cc6bd6 100644
--- a/frontend/src/components/settings/ChannelConfigPanel.tsx
+++ b/frontend/src/components/settings/ChannelConfigPanel.tsx
@@ -11,6 +11,7 @@ import {
X,
XCircle,
} from "lucide-react";
+import type { TFunction } from "i18next";
import { useTranslation } from "react-i18next";
import { toast } from "sonner";
import {
@@ -61,6 +62,56 @@ function initialFormValues(entry: ChannelConfigEntry): Record<string, FormValue>
return next;
}
+interface ChannelGuide {
+ title: string;
+ intro: string;
+ steps: string[];
+ docsUrl: string;
+ docsLabel: string;
+}
+
+/**
+ * Per-channel setup guide registry: adding a channel is one entry here plus its
+ * i18n keys. `build` must use literal t() keys — typed i18n rejects
+ * interpolated ones — and receives `t` so the copy re-resolves on language
+ * change instead of being frozen at module load.
+ */
+const GUIDE_DEFS: Record<
+ string,
+ { docsUrl: string; build: (t: TFunction) => Omit<ChannelGuide, "docsUrl"> } | undefined
+> = {
+ dingtalk: {
+ docsUrl: "https://open-dev.dingtalk.com/",
+ build: (t) => ({
+ title: t("settings.channels.guides.dingtalk.title"),
+ intro: t("settings.channels.guides.dingtalk.intro"),
+ steps: [
+ t("settings.channels.guides.dingtalk.step1"),
+ t("settings.channels.guides.dingtalk.step2"),
+ t("settings.channels.guides.dingtalk.step3"),
+ t("settings.channels.guides.dingtalk.step4"),
+ t("settings.channels.guides.dingtalk.step5"),
+ ],
+ docsLabel: t("settings.channels.guides.dingtalk.docsLabel"),
+ }),
+ },
+ qq: {
+ docsUrl: "https://q.qq.com/",
+ build: (t) => ({
+ title: t("settings.channels.guides.qq.title"),
+ intro: t("settings.channels.guides.qq.intro"),
+ steps: [
+ t("settings.channels.guides.qq.step1"),
+ t("settings.channels.guides.qq.step2"),
+ t("settings.channels.guides.qq.step3"),
+ t("settings.channels.guides.qq.step4"),
+ t("settings.channels.guides.qq.step5"),
+ ],
+ docsLabel: t("settings.channels.guides.qq.docsLabel"),
+ }),
+ },
+};
+
export interface ChannelConfigPanelProps {
name: string;
entry: ChannelConfigEntry;
@@ -126,6 +177,14 @@ export function ChannelConfigPanel({
"settings.channels.fields.dingtalk.remote_media_redirect_allowed_hosts": { label: t("settings.channels.fields.dingtalk.remote_media_redirect_allowed_hosts.label"), help: t("settings.channels.fields.dingtalk.remote_media_redirect_allowed_hosts.help") },
"settings.channels.fields.dingtalk.group_user_isolation": { label: t("settings.channels.fields.dingtalk.group_user_isolation.label"), help: t("settings.channels.fields.dingtalk.group_user_isolation.help") },
"settings.channels.fields.dingtalk.force_ipv4": { label: t("settings.channels.fields.dingtalk.force_ipv4.label"), help: t("settings.channels.fields.dingtalk.force_ipv4.help") },
+ "settings.channels.fields.qq.app_id": { label: t("settings.channels.fields.qq.app_id.label"), help: t("settings.channels.fields.qq.app_id.help") },
+ "settings.channels.fields.qq.secret": { label: t("settings.channels.fields.qq.secret.label"), help: t("settings.channels.fields.qq.secret.help") },
+ "settings.channels.fields.qq.allow_from": { label: t("settings.channels.fields.qq.allow_from.label"), help: t("settings.channels.fields.qq.allow_from.help") },
+ "settings.channels.fields.qq.msg_format": { label: t("settings.channels.fields.qq.msg_format.label"), help: t("settings.channels.fields.qq.msg_format.help") },
+ "settings.channels.fields.qq.ack_message": { label: t("settings.channels.fields.qq.ack_message.label"), help: t("settings.channels.fields.qq.ack_message.help") },
+ "settings.channels.fields.qq.media_dir": { label: t("settings.channels.fields.qq.media_dir.label"), help: t("settings.channels.fields.qq.media_dir.help") },
+ "settings.channels.fields.qq.download_chunk_size": { label: t("settings.channels.fields.qq.download_chunk_size.label"), help: t("settings.channels.fields.qq.download_chunk_size.help") },
+ "settings.channels.fields.qq.download_max_bytes": { label: t("settings.channels.fields.qq.download_max_bytes.label"), help: t("settings.channels.fields.qq.download_max_bytes.help") },
}),
[t],
);
@@ -141,20 +200,9 @@ export function ChannelConfigPanel({
);
const guide = useMemo(() => {
- if (name !== "dingtalk") return null;
- return {
- title: t("settings.channels.guides.dingtalk.title"),
- intro: t("settings.channels.guides.dingtalk.intro"),
- steps: [
- t("settings.channels.guides.dingtalk.step1"),
- t("settings.channels.guides.dingtalk.step2"),
- t("settings.channels.guides.dingtalk.step3"),
- t("settings.channels.guides.dingtalk.step4"),
- t("settings.channels.guides.dingtalk.step5"),
- ],
- docsUrl: "https://open-dev.dingtalk.com/",
- docsLabel: t("settings.channels.guides.dingtalk.docsLabel"),
- };
+ const definition = GUIDE_DEFS[name];
+ if (!definition) return null;
+ return { ...definition.build(t), docsUrl: definition.docsUrl };
}, [name, t]);
const setValue = (key: string, value: FormValue) => {
diff --git a/frontend/src/components/settings/__tests__/ChannelSettings.test.tsx b/frontend/src/components/settings/__tests__/ChannelSettings.test.tsx
index f773733b3..f00276b85 100644
--- a/frontend/src/components/settings/__tests__/ChannelSettings.test.tsx
+++ b/frontend/src/components/settings/__tests__/ChannelSettings.test.tsx
@@ -78,6 +78,40 @@ function dingtalkEntry(overrides: Record<string, unknown> = {}) {
};
}
+function qqEntry(overrides: Record<string, unknown> = {}) {
+ return {
+ display_name: "QQ",
+ available: true,
+ loaded: true,
+ install_hint: "",
+ error: "",
+ supports_test: true,
+ sdk_available: true,
+ fields: [
+ { key: "app_id", type: "text", secret: false, required: true, help_key: "settings.channels.fields.qq.app_id" },
+ { key: "secret", type: "password", secret: true, required: true, help_key: "settings.channels.fields.qq.secret" },
+ { key: "allow_from", type: "list", secret: false, required: false, help_key: "settings.channels.fields.qq.allow_from" },
+ { key: "msg_format", type: "text", secret: false, required: false, help_key: "settings.channels.fields.qq.msg_format" },
+ { key: "ack_message", type: "text", secret: false, required: false, help_key: "settings.channels.fields.qq.ack_message" },
+ { key: "media_dir", type: "text", secret: false, required: false, help_key: "settings.channels.fields.qq.media_dir" },
+ { key: "download_chunk_size", type: "text", secret: false, required: false, help_key: "settings.channels.fields.qq.download_chunk_size" },
+ { key: "download_max_bytes", type: "text", secret: false, required: false, help_key: "settings.channels.fields.qq.download_max_bytes" },
+ ],
+ values: {
+ enabled: false,
+ app_id: "102000001",
+ allow_from: [],
+ msg_format: "markdown",
+ ack_message: "",
+ media_dir: "",
+ download_chunk_size: "262144",
+ download_max_bytes: "209715200",
+ },
+ secrets: { secret: { set: true, masked: "****9f2c" } },
+ ...overrides,
+ };
+}
+
function channelsConfig(overrides: Record<string, unknown> = {}) {
return {
config_path: "~/.vibe-trading/agent.json",
@@ -96,6 +130,22 @@ async function renderExpanded() {
expect(await screen.findByDisplayValue("ding_appkey")).toBeInTheDocument();
}
+/** Render the card with both the DingTalk and QQ config panels available. */
+function bothChannelsConfig() {
+ return channelsConfig({
+ channels: { dingtalk: dingtalkEntry(), qq: qqEntry() },
+ });
+}
+
+/** Render the card with the QQ config panel expanded. */
+async function renderQqExpanded() {
+ apiMock.getChannelsConfig.mockResolvedValue(bothChannelsConfig());
+ render(<ChannelSettings />);
+ await screen.findByText("IM Channels");
+ fireEvent.click(await screen.findByRole("button", { name: "Configure QQ" }));
+ expect(await screen.findByDisplayValue("102000001")).toBeInTheDocument();
+}
+
describe("ChannelSettings config panel", () => {
beforeEach(async () => {
await i18n.changeLanguage("en");
@@ -363,4 +413,61 @@ describe("ChannelSettings config panel", () => {
expect(guideToggle).toHaveAttribute("aria-expanded", "false");
expect(screen.queryByText(/Create an app in the DingTalk developer console/)).not.toBeInTheDocument();
});
+
+ it("renders every QQ field from the backend help_keys with localized labels", async () => {
+ await renderQqExpanded();
+
+ expect(screen.getByText("AppID")).toBeInTheDocument();
+ expect(screen.getByText("AppSecret")).toBeInTheDocument();
+ expect(screen.getByText("Allowed senders")).toBeInTheDocument();
+ expect(screen.getByText("Message format")).toBeInTheDocument();
+ expect(screen.getByText("Ack message")).toBeInTheDocument();
+ expect(screen.getByText("Media directory")).toBeInTheDocument();
+ expect(screen.getByText("Download chunk size")).toBeInTheDocument();
+ expect(screen.getByText("Max download size (bytes)")).toBeInTheDocument();
+ expect(screen.getByText(/The bot's AppID from the QQ Open Platform/)).toBeInTheDocument();
+ // The secret field keeps the generic masked placeholder and password type.
+ const secretInput = screen.getByPlaceholderText("Keep current (****9f2c)");
+ expect(secretInput).toHaveAttribute("type", "password");
+ expect(secretInput).toHaveValue("");
+ });
+
+ it("toggles the QQ setup guide with its steps and external link", async () => {
+ await renderQqExpanded();
+
+ expect(screen.queryByText(/Register on the QQ Open Platform/)).not.toBeInTheDocument();
+
+ const guideToggle = screen.getByRole("button", { name: "QQ setup guide" });
+ expect(guideToggle).toHaveAttribute("aria-expanded", "false");
+ fireEvent.click(guideToggle);
+
+ expect(guideToggle).toHaveAttribute("aria-expanded", "true");
+ expect(screen.getByText(/Register on the QQ Open Platform/)).toBeInTheDocument();
+ expect(screen.getByText(/no public callback URL is needed/)).toBeInTheDocument();
+ expect(screen.getByText(/Copy the AppID and AppSecret/)).toBeInTheDocument();
+ expect(screen.getByText(/Paste them into the AppID and AppSecret fields above/)).toBeInTheDocument();
+ expect(screen.getByText(/Add the bot to a QQ group/)).toBeInTheDocument();
+ expect(screen.getByText(/click Test connection, then enable the channel/)).toBeInTheDocument();
+ expect(screen.getByRole("link", { name: "Open the QQ Open Platform" }))
+ .toHaveAttribute("href", "https://q.qq.com/");
+
+ fireEvent.click(guideToggle);
+ expect(guideToggle).toHaveAttribute("aria-expanded", "false");
+ expect(screen.queryByText(/Register on the QQ Open Platform/)).not.toBeInTheDocument();
+ });
+
+ it("renders no setup guide for a channel without a guide definition", async () => {
+ apiMock.getChannelsConfig.mockResolvedValue(channelsConfig({
+ channels: {
+ dingtalk: dingtalkEntry(),
+ signal: qqEntry({ display_name: "Signal", fields: [], values: { enabled: false }, secrets: {} }),
+ },
+ }));
+ render(<ChannelSettings />);
+ await screen.findByText("IM Channels");
+ fireEvent.click(await screen.findByRole("button", { name: "Configure Signal" }));
+
+ expect(await screen.findByText("This channel has no configurable fields.")).toBeInTheDocument();
+ expect(screen.queryByRole("button", { name: /setup guide/ })).not.toBeInTheDocument();
+ });
});
diff --git a/frontend/src/i18n/locales/ar.json b/frontend/src/i18n/locales/ar.json
index ae5a2b91c..9885018bc 100644
--- a/frontend/src/i18n/locales/ar.json
+++ b/frontend/src/i18n/locales/ar.json
@@ -486,6 +486,40 @@
"label": "فرض IPv4",
"help": "يربط استدعاءات واجهة DingTalk بعنوان IPv4. مفيد عندما تحتوي قائمة عناوين IP المسموحة على عنوان IPv4 ثابت بينما تتغير بادئة IPv6 باستمرار."
}
+ },
+ "qq": {
+ "app_id": {
+ "label": "AppID",
+ "help": "معرّف AppID الخاص بالروبوت من إعدادات التطبيق في منصة QQ المفتوحة (q.qq.com)."
+ },
+ "secret": {
+ "label": "AppSecret",
+ "help": "سرّ الروبوت AppSecret. يُحفظ على الخادم ولا يُعاد إرساله إلى المتصفح."
+ },
+ "allow_from": {
+ "label": "المرسلون المسموحون",
+ "help": "قائمة اختيارية بمعرّفات openid لمرسلي QQ المسموح لهم بالتفاعل مع الوكيل (\"*\" تسمح للجميع). المرسلون غير المقترنين يتلقون رمز اقتران في رسالة خاصة."
+ },
+ "msg_format": {
+ "label": "تنسيق الرسالة",
+ "help": "تنسيق الرد: plain أو markdown."
+ },
+ "ack_message": {
+ "label": "رسالة الإقرار",
+ "help": "إقرار فوري يُرسل عند وصول رسالة. اتركه فارغًا لتعطيله."
+ },
+ "media_dir": {
+ "label": "دليل الوسائط",
+ "help": "مكان حفظ المرفقات الواردة. القيمة الفارغة تستخدم ~/.vibe-trading/media/qq."
+ },
+ "download_chunk_size": {
+ "label": "حجم كتلة التنزيل",
+ "help": "عدد البايتات لكل كتلة عند تنزيل المرفقات (الافتراضي 262144)."
+ },
+ "download_max_bytes": {
+ "label": "الحد الأقصى لحجم التنزيل (بايت)",
+ "help": "حدّ أمان لتنزيل مرفق واحد (الافتراضي 209715200 = 200 ميغابايت)."
+ }
}
},
"guides": {
@@ -498,6 +532,16 @@
"step4": "انشر التطبيق ليتيح استخدامه داخل مؤسستك.",
"step5": "عد إلى هنا، وانقر على «اختبار الاتصال»، ثم فعّل القناة.",
"docsLabel": "فتح وحدة تحكم مطوّري DingTalk"
+ },
+ "qq": {
+ "title": "دليل إعداد QQ",
+ "intro": "تتصل روبوتات QQ عبر WebSocket باستخدام SDK الرسمي botpy، لذا لا حاجة إلى عنوان URL عام للاستدعاء.",
+ "step1": "سجّل في منصة QQ المفتوحة (q.qq.com) وأنشئ روبوتًا.",
+ "step2": "انسخ AppID وAppSecret من صفحة إعدادات تطوير الروبوت.",
+ "step3": "الصقهما في حقلي AppID وAppSecret أعلاه.",
+ "step4": "أضف الروبوت إلى مجموعة QQ أو تحدّث معه بشكل خاص، وفقًا لقواعد الصندوق الرملي/النشر الخاصة بالمنصة.",
+ "step5": "عد إلى هنا، وانقر على «اختبار الاتصال»، ثم فعّل القناة.",
+ "docsLabel": "فتح منصة QQ المفتوحة"
}
}
},
diff --git a/frontend/src/i18n/locales/de.json b/frontend/src/i18n/locales/de.json
index 070660972..2802aac22 100644
--- a/frontend/src/i18n/locales/de.json
+++ b/frontend/src/i18n/locales/de.json
@@ -491,6 +491,40 @@
"label": "IPv4 erzwingen",
"help": "Bindet DingTalk-API-Aufrufe an IPv4. Nützlich, wenn die Ausgangs-IP-Whitelist eine stabile IPv4-Adresse enthält, sich das IPv6-Präfix aber ständig ändert."
}
+ },
+ "qq": {
+ "app_id": {
+ "label": "AppID",
+ "help": "Die AppID des Bots aus den App-Einstellungen der QQ Open Platform (q.qq.com)."
+ },
+ "secret": {
+ "label": "AppSecret",
+ "help": "Das AppSecret des Bots. Wird serverseitig gespeichert und nie an den Browser zurückgegeben."
+ },
+ "allow_from": {
+ "label": "Erlaubte Absender",
+ "help": "Optionale Positivliste von QQ-Absender-openids, die mit dem Agenten sprechen dürfen („*“ erlaubt alle). Nicht gekoppelte Absender erhalten einen Kopplungscode per Direktnachricht."
+ },
+ "msg_format": {
+ "label": "Nachrichtenformat",
+ "help": "Antwortformat: plain oder markdown."
+ },
+ "ack_message": {
+ "label": "Bestätigungsnachricht",
+ "help": "Sofortige Bestätigung beim Eingang einer Nachricht. Leer lassen, um sie zu deaktivieren."
+ },
+ "media_dir": {
+ "label": "Medienverzeichnis",
+ "help": "Ablageort für eingehende Anhänge. Leer verwendet ~/.vibe-trading/media/qq."
+ },
+ "download_chunk_size": {
+ "label": "Download-Blockgröße",
+ "help": "Bytes pro Block beim Herunterladen von Anhängen (Standard 262144)."
+ },
+ "download_max_bytes": {
+ "label": "Maximale Downloadgröße (Bytes)",
+ "help": "Sicherheitsobergrenze für einen einzelnen Anhang-Download (Standard 209715200 = 200 MB)."
+ }
}
},
"guides": {
@@ -503,6 +537,16 @@
"step4": "Veröffentliche die App, damit sie in deiner Organisation verfügbar ist.",
"step5": "Kehre hierher zurück, klicke auf „Verbindung testen“ und aktiviere den Kanal.",
"docsLabel": "DingTalk-Entwicklerkonsole öffnen"
+ },
+ "qq": {
+ "title": "QQ-Einrichtungsanleitung",
+ "intro": "QQ-Bots verbinden sich über das offizielle botpy-SDK per WebSocket, daher ist keine öffentliche Callback-URL nötig.",
+ "step1": "Registriere dich auf der QQ Open Platform (q.qq.com) und erstelle einen Bot.",
+ "step2": "Kopiere AppID und AppSecret von der Entwicklungsseite des Bots.",
+ "step3": "Füge sie oben in die Felder AppID und AppSecret ein.",
+ "step4": "Füge den Bot gemäß den Sandbox-/Veröffentlichungsregeln der Plattform einer QQ-Gruppe hinzu oder chatte privat mit ihm.",
+ "step5": "Kehre hierher zurück, klicke auf „Verbindung testen“ und aktiviere den Kanal.",
+ "docsLabel": "QQ Open Platform öffnen"
}
}
},
diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json
index c73264f49..4f450c80b 100644
--- a/frontend/src/i18n/locales/en.json
+++ b/frontend/src/i18n/locales/en.json
@@ -491,6 +491,40 @@
"label": "Force IPv4",
"help": "Bind DingTalk API calls to IPv4. Useful when the app's egress-IP whitelist holds a stable IPv4 address while the IPv6 prefix keeps rotating."
}
+ },
+ "qq": {
+ "app_id": {
+ "label": "AppID",
+ "help": "The bot's AppID from the QQ Open Platform (q.qq.com) app settings."
+ },
+ "secret": {
+ "label": "AppSecret",
+ "help": "The bot's AppSecret. Stored server-side and never sent back to the browser."
+ },
+ "allow_from": {
+ "label": "Allowed senders",
+ "help": "Optional allowlist of QQ sender openids that may talk to the agent (\"*\" allows everyone). Unpaired senders receive a pairing code in a direct message."
+ },
+ "msg_format": {
+ "label": "Message format",
+ "help": "Reply format: plain or markdown."
+ },
+ "ack_message": {
+ "label": "Ack message",
+ "help": "Immediate acknowledgement sent when a message arrives. Leave empty to disable."
+ },
+ "media_dir": {
+ "label": "Media directory",
+ "help": "Where inbound attachments are saved. Empty uses ~/.vibe-trading/media/qq."
+ },
+ "download_chunk_size": {
+ "label": "Download chunk size",
+ "help": "Bytes per chunk when downloading attachments (default 262144)."
+ },
+ "download_max_bytes": {
+ "label": "Max download size (bytes)",
+ "help": "Safety cap for a single attachment download (default 209715200 = 200 MB)."
+ }
}
},
"guides": {
@@ -503,6 +537,16 @@
"step4": "Publish the app so it is available to your organization.",
"step5": "Return here, click Test connection, then enable the channel.",
"docsLabel": "Open the DingTalk developer console"
+ },
+ "qq": {
+ "title": "QQ setup guide",
+ "intro": "QQ bots connect over WebSocket via the official botpy SDK, so no public callback URL is needed.",
+ "step1": "Register on the QQ Open Platform (q.qq.com) and create a bot.",
+ "step2": "Copy the AppID and AppSecret from the bot's development settings page.",
+ "step3": "Paste them into the AppID and AppSecret fields above.",
+ "step4": "Add the bot to a QQ group or chat with it privately, following the platform's sandbox/publish rules.",
+ "step5": "Return here, click Test connection, then enable the channel.",
+ "docsLabel": "Open the QQ Open Platform"
}
}
},
diff --git a/frontend/src/i18n/locales/es.json b/frontend/src/i18n/locales/es.json
index cb7fd7b90..42415e19d 100644
--- a/frontend/src/i18n/locales/es.json
+++ b/frontend/src/i18n/locales/es.json
@@ -491,6 +491,40 @@
"label": "Forzar IPv4",
"help": "Vincula las llamadas a la API de DingTalk a IPv4. Útil cuando la lista blanca de IP de salida tiene una IPv4 estable pero el prefijo IPv6 cambia constantemente."
}
+ },
+ "qq": {
+ "app_id": {
+ "label": "AppID",
+ "help": "El AppID del bot, en la configuración de la app en la QQ Open Platform (q.qq.com)."
+ },
+ "secret": {
+ "label": "AppSecret",
+ "help": "El AppSecret del bot. Se guarda en el servidor y nunca se devuelve al navegador."
+ },
+ "allow_from": {
+ "label": "Remitentes permitidos",
+ "help": "Lista opcional de openids de remitentes de QQ autorizados a hablar con el agente (\"*\" permite a todos). Los remitentes no emparejados reciben un código de emparejamiento por mensaje directo."
+ },
+ "msg_format": {
+ "label": "Formato de mensaje",
+ "help": "Formato de respuesta: plain o markdown."
+ },
+ "ack_message": {
+ "label": "Mensaje de confirmación",
+ "help": "Confirmación inmediata que se envía al recibir un mensaje. Déjalo vacío para desactivarla."
+ },
+ "media_dir": {
+ "label": "Directorio de medios",
+ "help": "Dónde se guardan los archivos adjuntos entrantes. Si está vacío, se usa ~/.vibe-trading/media/qq."
+ },
+ "download_chunk_size": {
+ "label": "Tamaño de bloque de descarga",
+ "help": "Bytes por bloque al descargar archivos adjuntos (predeterminado 262144)."
+ },
+ "download_max_bytes": {
+ "label": "Tamaño máximo de descarga (bytes)",
+ "help": "Límite de seguridad para la descarga de un solo archivo adjunto (predeterminado 209715200 = 200 MB)."
+ }
}
},
"guides": {
@@ -503,6 +537,16 @@
"step4": "Publica la app para que esté disponible en tu organización.",
"step5": "Vuelve aquí, pulsa «Probar conexión» y activa el canal.",
"docsLabel": "Abrir la consola de desarrolladores de DingTalk"
+ },
+ "qq": {
+ "title": "Guía de configuración de QQ",
+ "intro": "Los bots de QQ se conectan por WebSocket mediante el SDK oficial botpy, así que no hace falta una URL de callback pública.",
+ "step1": "Regístrate en la QQ Open Platform (q.qq.com) y crea un bot.",
+ "step2": "Copia el AppID y el AppSecret desde la página de configuración de desarrollo del bot.",
+ "step3": "Pégalos en los campos AppID y AppSecret de arriba.",
+ "step4": "Añade el bot a un grupo de QQ o chatea con él en privado, siguiendo las reglas de sandbox/publicación de la plataforma.",
+ "step5": "Vuelve aquí, pulsa «Probar conexión» y activa el canal.",
+ "docsLabel": "Abrir la QQ Open Platform"
}
}
},
diff --git a/frontend/src/i18n/locales/ja.json b/frontend/src/i18n/locales/ja.json
index 61a4d1524..21afd71d5 100644
--- a/frontend/src/i18n/locales/ja.json
+++ b/frontend/src/i18n/locales/ja.json
@@ -486,6 +486,40 @@
"label": "IPv4 を強制",
"help": "DingTalk API 呼び出しを IPv4 にバインドします。送信元 IP ホワイトリストがあり、IPv6 プレフィックスは変動するが IPv4 は安定している場合に有効にします。"
}
+ },
+ "qq": {
+ "app_id": {
+ "label": "AppID",
+ "help": "QQ 公式プラットフォーム(q.qq.com)のアプリ設定にあるボットの AppID です。"
+ },
+ "secret": {
+ "label": "AppSecret",
+ "help": "ボットの AppSecret。サーバー側に保存され、ブラウザーには返されません。"
+ },
+ "allow_from": {
+ "label": "許可する送信者",
+ "help": "エージェントと対話できる QQ 送信者 openid の許可リスト(「*」で全員許可)。未ペアの送信者には DM でペアリングコードが送られます。"
+ },
+ "msg_format": {
+ "label": "メッセージ形式",
+ "help": "返信形式:plain または markdown。"
+ },
+ "ack_message": {
+ "label": "確認メッセージ",
+ "help": "メッセージ受信時にすぐ送信する確認応答。空欄にすると送信しません。"
+ },
+ "media_dir": {
+ "label": "メディアディレクトリ",
+ "help": "受信した添付ファイルの保存先。空欄の場合は ~/.vibe-trading/media/qq を使用します。"
+ },
+ "download_chunk_size": {
+ "label": "ダウンロードチャンクサイズ",
+ "help": "添付ファイルをダウンロードする際の 1 チャンクあたりのバイト数(既定 262144)。"
+ },
+ "download_max_bytes": {
+ "label": "最大ダウンロードサイズ(バイト)",
+ "help": "1 つの添付ファイルのダウンロードに対する安全上限(既定 209715200=200 MB)。"
+ }
}
},
"guides": {
@@ -498,6 +532,16 @@
"step4": "アプリを公開して、組織内で利用できるようにします。",
"step5": "ここに戻って「接続テスト」をクリックし、チャンネルを有効化します。",
"docsLabel": "DingTalk 開発者コンソールを開く"
+ },
+ "qq": {
+ "title": "QQ セットアップガイド",
+ "intro": "QQ ボットは公式 botpy SDK を介して WebSocket で接続するため、公開コールバック URL は不要です。",
+ "step1": "QQ 公式プラットフォーム(q.qq.com)に登録し、ボットを作成します。",
+ "step2": "ボットの開発設定ページで AppID と AppSecret をコピーします。",
+ "step3": "それらを上の AppID と AppSecret のフィールドに貼り付けます。",
+ "step4": "プラットフォームのサンドボックス/公開ルールに従って、ボットを QQ グループに追加するか、個別にチャットします。",
+ "step5": "ここに戻って「接続テスト」をクリックし、チャンネルを有効化します。",
+ "docsLabel": "QQ 公式プラットフォームを開く"
}
}
},
diff --git a/frontend/src/i18n/locales/ko.json b/frontend/src/i18n/locales/ko.json
index d41b28508..590f976e6 100644
--- a/frontend/src/i18n/locales/ko.json
+++ b/frontend/src/i18n/locales/ko.json
@@ -486,6 +486,40 @@
"label": "IPv4 강제",
"help": "DingTalk API 호출을 IPv4에 바인딩합니다. 발신 IP 화이트리스트를 사용 중이고 IPv6 접두사는 자주 바뀌지만 IPv4는 안정적일 때 활성화하세요."
}
+ },
+ "qq": {
+ "app_id": {
+ "label": "AppID",
+ "help": "QQ 오픈 플랫폼(q.qq.com) 앱 설정에 있는 봇의 AppID입니다."
+ },
+ "secret": {
+ "label": "AppSecret",
+ "help": "봇의 AppSecret입니다. 서버에 저장되며 브라우저로 다시 전송되지 않습니다."
+ },
+ "allow_from": {
+ "label": "허용된 발신자",
+ "help": "에이전트와 대화할 수 있는 QQ 발신자 openid 허용 목록입니다(\"*\"는 모두 허용). 페어링되지 않은 발신자는 DM으로 페어링 코드를 받습니다."
+ },
+ "msg_format": {
+ "label": "메시지 형식",
+ "help": "응답 형식: plain 또는 markdown."
+ },
+ "ack_message": {
+ "label": "확인 메시지",
+ "help": "메시지가 도착했을 때 즉시 보내는 확인 응답입니다. 비워 두면 전송하지 않습니다."
+ },
+ "media_dir": {
+ "label": "미디어 디렉터리",
+ "help": "수신한 첨부 파일을 저장할 위치입니다. 비워 두면 ~/.vibe-trading/media/qq를 사용합니다."
+ },
+ "download_chunk_size": {
+ "label": "다운로드 청크 크기",
+ "help": "첨부 파일을 내려받을 때 청크당 바이트 수(기본 262144)."
+ },
+ "download_max_bytes": {
+ "label": "최대 다운로드 크기(바이트)",
+ "help": "첨부 파일 하나 다운로드의 안전 상한(기본 209715200 = 200 MB)."
+ }
}
},
"guides": {
@@ -498,6 +532,16 @@
"step4": "앱을 게시하여 조직에서 사용할 수 있게 합니다.",
"step5": "여기로 돌아와 '연결 테스트'를 클릭한 다음 채널을 사용 설정합니다.",
"docsLabel": "DingTalk 개발자 콘솔 열기"
+ },
+ "qq": {
+ "title": "QQ 설정 가이드",
+ "intro": "QQ 봇은 공식 botpy SDK를 통해 WebSocket으로 연결되므로 공개 콜백 URL이 필요하지 않습니다.",
+ "step1": "QQ 오픈 플랫폼(q.qq.com)에 등록하고 봇을 만듭니다.",
+ "step2": "봇의 개발 설정 페이지에서 AppID와 AppSecret을 복사합니다.",
+ "step3": "위의 AppID 및 AppSecret 필드에 붙여 넣습니다.",
+ "step4": "플랫폼의 샌드박스/게시 규칙에 따라 봇을 QQ 그룹에 추가하거나 개인 채팅을 시작합니다.",
+ "step5": "여기로 돌아와 '연결 테스트'를 클릭한 다음 채널을 사용 설정합니다.",
+ "docsLabel": "QQ 오픈 플랫폼 열기"
}
}
},
diff --git a/frontend/src/i18n/locales/pt-BR.json b/frontend/src/i18n/locales/pt-BR.json
index 021b842dc..c98c7d3dc 100644
--- a/frontend/src/i18n/locales/pt-BR.json
+++ b/frontend/src/i18n/locales/pt-BR.json
@@ -491,6 +491,40 @@
"label": "Forçar IPv4",
"help": "Vincula as chamadas da API do DingTalk ao IPv4. Útil quando a lista de IPs de saída tem um IPv4 estável, mas o prefixo IPv6 muda constantemente."
}
+ },
+ "qq": {
+ "app_id": {
+ "label": "AppID",
+ "help": "O AppID do bot nas configurações do app na QQ Open Platform (q.qq.com)."
+ },
+ "secret": {
+ "label": "AppSecret",
+ "help": "O AppSecret do bot. Fica no servidor e nunca é devolvido ao navegador."
+ },
+ "allow_from": {
+ "label": "Remetentes permitidos",
+ "help": "Lista opcional de openids de remetentes do QQ autorizados a falar com o agente (\"*\" libera todos). Remetentes não emparelhados recebem um código de emparelhamento por mensagem direta."
+ },
+ "msg_format": {
+ "label": "Formato da mensagem",
+ "help": "Formato da resposta: plain ou markdown."
+ },
+ "ack_message": {
+ "label": "Mensagem de confirmação",
+ "help": "Confirmação imediata enviada quando uma mensagem chega. Deixe vazio para desativar."
+ },
+ "media_dir": {
+ "label": "Diretório de mídia",
+ "help": "Onde os anexos recebidos são salvos. Vazio usa ~/.vibe-trading/media/qq."
+ },
+ "download_chunk_size": {
+ "label": "Tamanho do bloco de download",
+ "help": "Bytes por bloco ao baixar anexos (padrão 262144)."
+ },
+ "download_max_bytes": {
+ "label": "Tamanho máximo de download (bytes)",
+ "help": "Limite de segurança para o download de um único anexo (padrão 209715200 = 200 MB)."
+ }
}
},
"guides": {
@@ -503,6 +537,16 @@
"step4": "Publique o app para que ele fique disponível na sua organização.",
"step5": "Volte aqui, clique em “Testar conexão” e ative o canal.",
"docsLabel": "Abrir o console de desenvolvedor do DingTalk"
+ },
+ "qq": {
+ "title": "Guia de configuração do QQ",
+ "intro": "Os bots do QQ se conectam via WebSocket pelo SDK oficial botpy, então não é necessária uma URL de callback pública.",
+ "step1": "Registre-se na QQ Open Platform (q.qq.com) e crie um bot.",
+ "step2": "Copie o AppID e o AppSecret da página de configurações de desenvolvimento do bot.",
+ "step3": "Cole-os nos campos AppID e AppSecret acima.",
+ "step4": "Adicione o bot a um grupo do QQ ou converse com ele em privado, seguindo as regras de sandbox/publicação da plataforma.",
+ "step5": "Volte aqui, clique em “Testar conexão” e ative o canal.",
+ "docsLabel": "Abrir a QQ Open Platform"
}
}
},
diff --git a/frontend/src/i18n/locales/zh-CN.json b/frontend/src/i18n/locales/zh-CN.json
index 3dbc9e116..9c195ccfa 100644
--- a/frontend/src/i18n/locales/zh-CN.json
+++ b/frontend/src/i18n/locales/zh-CN.json
@@ -486,6 +486,40 @@
"label": "强制使用 IPv4",
"help": "将钉钉 API 调用绑定到 IPv4 出口。当应用配置了服务器出口 IP 白名单、IPv6 前缀会漂移而 IPv4 地址稳定时启用。"
}
+ },
+ "qq": {
+ "app_id": {
+ "label": "AppID",
+ "help": "QQ 开放平台(q.qq.com)应用设置中机器人的 AppID。"
+ },
+ "secret": {
+ "label": "AppSecret",
+ "help": "机器人的 AppSecret,保存在服务端,绝不会回传到浏览器。"
+ },
+ "allow_from": {
+ "label": "允许的发送者",
+ "help": "允许与智能体对话的 QQ 发送者 openid 白名单(“*”表示全部允许)。未配对的用户会在私聊中收到配对码。"
+ },
+ "msg_format": {
+ "label": "消息格式",
+ "help": "回复格式:plain 或 markdown。"
+ },
+ "ack_message": {
+ "label": "确认消息",
+ "help": "收到消息时立即发送的确认提示;留空则不发送。"
+ },
+ "media_dir": {
+ "label": "媒体目录",
+ "help": "保存接收到的附件的位置;留空时使用 ~/.vibe-trading/media/qq。"
+ },
+ "download_chunk_size": {
+ "label": "下载分块大小",
+ "help": "下载附件时每块的大小(字节,默认 262144)。"
+ },
+ "download_max_bytes": {
+ "label": "最大下载大小(字节)",
+ "help": "单个附件下载的安全上限(默认 209715200,即 200 MB)。"
+ }
}
},
"guides": {
@@ -498,6 +532,16 @@
"step4": "发布应用,使其对组织内成员可用。",
"step5": "回到这里点击“测试连接”,然后启用渠道。",
"docsLabel": "打开钉钉开发者后台"
+ },
+ "qq": {
+ "title": "QQ 配置指南",
+ "intro": "QQ 机器人通过官方 botpy SDK 以 WebSocket 连接,无需公网回调地址。",
+ "step1": "在 QQ 开放平台(q.qq.com)注册并创建机器人。",
+ "step2": "在机器人的开发设置页面复制 AppID 与 AppSecret。",
+ "step3": "将其填入上方的 AppID 与 AppSecret 字段。",
+ "step4": "按平台的沙箱/发布规则,将机器人加入 QQ 群或与其私聊。",
+ "step5": "回到这里点击“测试连接”,然后启用渠道。",
+ "docsLabel": "打开 QQ 开放平台"
}
}
},