Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

feat: add proxy URL field to Telegram setup wizard

ReWiG1d26e39534e4
diff --git a/ui/package-lock.json b/ui/package-lock.json
index 7cea79b88..2306f2556 100644
--- a/ui/package-lock.json
+++ b/ui/package-lock.json
@@ -92,7 +92,6 @@
"integrity": "sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@babel/code-frame": "^7.28.6",
"@babel/generator": "^7.28.6",
@@ -2396,7 +2395,6 @@
"integrity": "sha512-ne4A0IpG3+2ETuREInjPNhUGis1SFjv1d5asp8MzEAGtOZeTeHVDOYqOgqfhvseqg/iXty2hjBf1zAOb7RNiNw==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"undici-types": "~7.16.0"
}
@@ -2407,7 +2405,6 @@
"integrity": "sha512-3MbSL37jEchWZz2p2mjntRZtPt837ij10ApxKfgmXCTuHWagYg7iA5bqPw6C8BMPfwidlvfPI/fxOc42HLhcyg==",
"devOptional": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"csstype": "^3.2.2"
}
@@ -2418,7 +2415,6 @@
"integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",
"devOptional": true,
"license": "MIT",
- "peer": true,
"peerDependencies": {
"@types/react": "^19.2.0"
}
@@ -2468,7 +2464,6 @@
"integrity": "sha512-npiaib8XzbjtzS2N4HlqPvlpxpmZ14FjSJrteZpPxGUaYPlvhzlzUZ4mZyABo0EFrOWnvyd0Xxroq//hKhtAWg==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.53.0",
"@typescript-eslint/types": "8.53.0",
@@ -2720,7 +2715,6 @@
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"dev": true,
"license": "MIT",
- "peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -2893,7 +2887,6 @@
}
],
"license": "MIT",
- "peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
@@ -3195,7 +3188,6 @@
"integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.1",
@@ -3627,7 +3619,6 @@
}
],
"license": "MIT",
- "peer": true,
"dependencies": {
"@babel/runtime": "^7.28.4"
},
@@ -4294,7 +4285,6 @@
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
"dev": true,
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=12"
},
@@ -4322,7 +4312,6 @@
}
],
"license": "MIT",
- "peer": true,
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
@@ -4373,7 +4362,6 @@
"resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz",
"integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==",
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -4383,7 +4371,6 @@
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz",
"integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==",
"license": "MIT",
- "peer": true,
"dependencies": {
"scheduler": "^0.27.0"
},
@@ -4766,7 +4753,6 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"devOptional": true,
"license": "Apache-2.0",
- "peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -4905,7 +4891,6 @@
"integrity": "sha512-Bby3NOsna2jsjfLVOHKes8sGwgl4TT0E6vvpYgnAYDIF/tie7MRaFthmKuHx1NSXjiTueXH3do80FMQgvEktRg==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"esbuild": "^0.27.0",
"fdir": "^6.5.0",
@@ -5036,7 +5021,6 @@
"integrity": "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==",
"dev": true,
"license": "MIT",
- "peer": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
diff --git a/ui/src/components/steps/TelegramConfig.tsx b/ui/src/components/steps/TelegramConfig.tsx
index e775d9163..c0a6f9c3e 100644
--- a/ui/src/components/steps/TelegramConfig.tsx
+++ b/ui/src/components/steps/TelegramConfig.tsx
@@ -37,6 +37,7 @@ export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, on
const api = useApi();
const { showToast } = useToast();
const [botToken, setBotToken] = useState(data.telegram?.bot_token || '');
+ const [proxyUrl, setProxyUrl] = useState(data.telegram?.proxy_url || '');
const [requireMention, setRequireMention] = useState(data.telegram?.require_mention ?? true);
const [forumAutoTopic, setForumAutoTopic] = useState(data.telegram?.forum_auto_topic ?? true);
const [checking, setChecking] = useState(false);
@@ -72,7 +73,7 @@ export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, on
const runAuthTest = async () => {
setChecking(true);
try {
- const result = await api.telegramAuthTest(botToken);
+ const result = await api.telegramAuthTest(botToken, proxyUrl);
setAuthResult(result);
} catch (err: any) {
setAuthResult({ ok: false, error: err?.message || 'Request failed' });
@@ -171,6 +172,7 @@ export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, on
telegram: {
...(data.telegram || {}),
bot_token: botToken,
+ proxy_url: proxyUrl || undefined,
require_mention: requireMention,
forum_auto_topic: forumAutoTopic,
},
@@ -259,6 +261,21 @@ export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, on
<p className="text-[11px] text-muted">{t('telegramConfig.botTokenHint')}</p>
</div>
+ <div className="space-y-2">
+ <label className="flex items-center gap-2 text-[12px] font-medium text-foreground">
+ <SplitSquareVertical size={14} className="text-cyan" />
+ {t('telegramConfig.proxyUrl')}
+ </label>
+ <input
+ type="text"
+ value={proxyUrl}
+ onChange={(e) => setProxyUrl(e.target.value)}
+ placeholder="socks5://user:pass@host:port (optional)"
+ className="w-full rounded-lg border border-border bg-background px-3 py-2.5 font-mono text-[12px] text-foreground outline-none transition placeholder:text-muted/55 focus:border-cyan focus:ring-1 focus:ring-cyan/40"
+ />
+ <p className="text-[11px] text-muted">{t('telegramConfig.proxyUrlHint')}</p>
+ </div>
+
<div className="flex flex-wrap items-center gap-3">
<button
onClick={runAuthTest}
diff --git a/ui/src/context/ApiContext.tsx b/ui/src/context/ApiContext.tsx
index d88e9735d..78ffcea7e 100644
--- a/ui/src/context/ApiContext.tsx
+++ b/ui/src/context/ApiContext.tsx
@@ -25,7 +25,7 @@ export type ApiContextType = {
discordAuthTest: (botToken: string) => Promise<any>;
discordGuilds: (botToken: string) => Promise<any>;
discordChannels: (botToken: string, guildId: string) => Promise<any>;
- telegramAuthTest: (botToken: string) => Promise<any>;
+ telegramAuthTest: (botToken: string, proxyUrl?: string) => Promise<any>;
telegramChats: (includePrivate?: boolean) => Promise<any>;
larkAuthTest: (appId: string, appSecret: string, domain?: string) => Promise<any>;
larkChats: (appId: string, appSecret: string, domain?: string) => Promise<any>;
@@ -170,7 +170,7 @@ export const ApiProvider: React.FC<{ children: React.ReactNode }> = ({ children
discordAuthTest: (botToken) => postJson('/discord/auth_test', { bot_token: botToken }),
discordGuilds: (botToken) => postJson('/discord/guilds', { bot_token: botToken }),
discordChannels: (botToken, guildId) => postJson('/discord/channels', { bot_token: botToken, guild_id: guildId }),
- telegramAuthTest: (botToken) => postJson('/telegram/auth_test', { bot_token: botToken }),
+ telegramAuthTest: (botToken, proxyUrl) => postJson('/telegram/auth_test', { bot_token: botToken, proxy_url: proxyUrl || undefined }),
telegramChats: (includePrivate) => postJson('/telegram/chats', { include_private: includePrivate || false }),
larkAuthTest: (appId, appSecret, domain) => postJson('/lark/auth_test', { app_id: appId, app_secret: appSecret, domain: domain || 'feishu' }),
larkChats: (appId, appSecret, domain) => postJson('/lark/chats', { app_id: appId, app_secret: appSecret, domain: domain || 'feishu' }),
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index f79c605f7..f909c580d 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -337,6 +337,8 @@
"botToken": "Bot Token",
"botTokenPlaceholder": "Paste your Telegram bot token",
"botTokenHint": "Create a bot with @BotFather, then paste the token here.",
+ "proxyUrl": "Proxy URL (optional)",
+ "proxyUrlHint": "SOCKS5, SOCKS4, HTTP or HTTPS proxy. Leave empty if Telegram is accessible directly.",
"validateToken": "Validate Token",
"tokenValidated": "Token validated",
"authFailed": "Validation failed",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index 0cedea89a..825dd4291 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -337,6 +337,8 @@
"botToken": "机器人令牌",
"botTokenPlaceholder": "粘贴 Telegram 机器人令牌",
"botTokenHint": "先通过 @BotFather 创建机器人,再把令牌粘贴到这里。",
+ "proxyUrl": "代理地址(可选)",
+ "proxyUrlHint": "SOCKS5、SOCKS4、HTTP 或 HTTPS 代理。如 Telegram 可直接访问,请留空。",
"validateToken": "验证令牌",
"tokenValidated": "令牌验证成功",
"authFailed": "验证失败",
diff --git a/vibe/api.py b/vibe/api.py
index 35131a6f7..479fd58e6 100644
--- a/vibe/api.py
+++ b/vibe/api.py
@@ -661,9 +661,9 @@ def discord_auth_test(bot_token: str) -> dict:
return {"ok": False, "error": str(exc)}
-def telegram_auth_test(bot_token: str) -> dict:
+def telegram_auth_test(bot_token: str, proxy_url: str | None = None) -> dict:
try:
- return {"ok": True, "response": asyncio.run(_telegram_get_me(bot_token))}
+ return {"ok": True, "response": asyncio.run(_telegram_get_me(bot_token, proxy_url))}
except Exception as exc:
return {"ok": False, "error": str(exc)}
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index f38937dce..0ef444212 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -1007,7 +1007,10 @@ def telegram_auth_test():
from vibe import api
payload = request.json or {}
- result = api.telegram_auth_test(payload.get("bot_token", ""))
+ result = api.telegram_auth_test(
+ payload.get("bot_token", ""),
+ proxy_url=payload.get("proxy_url")
+ )
return jsonify(result)