diff --git a/apps/desktop/src/renderer/src/pages/clients.tsx b/apps/desktop/src/renderer/src/pages/clients.tsx index 88fe4494..7cb50d6e 100644 --- a/apps/desktop/src/renderer/src/pages/clients.tsx +++ b/apps/desktop/src/renderer/src/pages/clients.tsx @@ -7,8 +7,6 @@ import { CardTitle, } from '@multica/ui/components/ui/card' import { Button } from '@multica/ui/components/ui/button' -import { Input } from '@multica/ui/components/ui/input' -import { Badge } from '@multica/ui/components/ui/badge' import { Tabs, TabsContent, @@ -16,169 +14,21 @@ import { TabsTrigger, } from '@multica/ui/components/ui/tabs' import { QrCode, Radio, Smartphone, WifiOff, Loader2 } from 'lucide-react' -import { useChannelsStore } from '../stores/channels' import { useHubStore, selectPrimaryAgent } from '../stores/hub' import { ConnectionQRCode } from '../components/qr-code' import { DeviceList } from '../components/device-list' -/** Status badge color mapping */ -function statusVariant(status: string): 'default' | 'secondary' | 'destructive' | 'outline' { - switch (status) { - case 'running': return 'default' - case 'starting': return 'secondary' - case 'error': return 'destructive' - default: return 'outline' - } -} - -function TelegramCard() { - const { states, config, saveToken, removeToken, startChannel, stopChannel } = useChannelsStore() - const [token, setToken] = useState('') - const [saving, setSaving] = useState(false) - const [localError, setLocalError] = useState(null) - - // Current state and config for telegram:default - const state = states.find((s) => s.channelId === 'telegram' && s.accountId === 'default') - const savedConfig = config['telegram']?.['default'] as { botToken?: string } | undefined - const hasToken = Boolean(savedConfig?.botToken) - const isRunning = state?.status === 'running' - const isStarting = state?.status === 'starting' - - const handleSave = async () => { - if (!token.trim()) return - setSaving(true) - setLocalError(null) - const result = await saveToken('telegram', 'default', token.trim()) - if (!result.ok) { - setLocalError(result.error ?? 'Failed to save') - } else { - setToken('') // Clear input on success - } - setSaving(false) - } - - const handleRemove = async () => { - setSaving(true) - setLocalError(null) - const result = await removeToken('telegram', 'default') - if (!result.ok) { - setLocalError(result.error ?? 'Failed to remove') - } - setSaving(false) - } - - const handleToggle = async () => { - setSaving(true) - setLocalError(null) - if (isRunning || isStarting) { - await stopChannel('telegram', 'default') - } else { - await startChannel('telegram', 'default') - } - setSaving(false) - } - - // Mask the token for display: show first 5 and last 5 chars - const maskedToken = savedConfig?.botToken - ? `${savedConfig.botToken.slice(0, 5)}${'*'.repeat(10)}${savedConfig.botToken.slice(-5)}` - : null - - return ( - - -
-
- Telegram - - Connect a Telegram bot via Bot API long polling. - -
- {state && ( - - {state.status} - - )} -
-
- - {hasToken ? ( - // Token is configured — show masked token and actions -
-
- - {maskedToken} - -
- - {state?.error && ( -

{state.error}

- )} - -
- - -
-
- ) : ( - // No token — show input form -
- setToken(e.target.value)} - onKeyDown={(e) => e.key === 'Enter' && handleSave()} - /> - -
- )} - - {localError && ( -

{localError}

- )} -
-
- ) -} function ChannelsTab() { - const { loading, error } = useChannelsStore() - - if (loading) { - return

Loading...

- } - - if (error) { - return

{error}

- } - return (

Connect messaging platforms to chat with your agent.

- +

+ Message @multica_bot on Telegram to get started. + Discord and Slack coming soon. +

) } diff --git a/apps/desktop/src/renderer/src/pages/onboarding/index.tsx b/apps/desktop/src/renderer/src/pages/onboarding/index.tsx index fb43dc69..3a374423 100644 --- a/apps/desktop/src/renderer/src/pages/onboarding/index.tsx +++ b/apps/desktop/src/renderer/src/pages/onboarding/index.tsx @@ -5,10 +5,9 @@ import { ModeToggle } from "../../components/mode-toggle"; import WelcomeStep from "./components/welcome-step"; import PermissionsStep from "./components/permissions-step"; import SetupStep from "./components/setup-step"; -import ConnectStep from "./components/connect-step"; import TryItStep from "./components/try-it-step"; -const steps = ["Privacy", "Provider", "Channels", "Start"]; +const steps = ["Privacy", "Provider", "Start"]; export default function OnboardingPage() { const navigate = useNavigate(); @@ -78,9 +77,6 @@ export default function OnboardingPage() { {currentStep === 1 && } {currentStep === 2 && } {currentStep === 3 && ( - - )} - {currentStep === 4 && ( )} diff --git a/packages/core/src/channels/index.ts b/packages/core/src/channels/index.ts index 63ecc950..cd1043f1 100644 --- a/packages/core/src/channels/index.ts +++ b/packages/core/src/channels/index.ts @@ -13,13 +13,10 @@ export type { ChannelsConfig, } from "./types.js"; -// Built-in channel plugins -import { registerChannel } from "./registry.js"; -import { telegramChannel } from "./plugins/telegram.js"; - /** Register all built-in channel plugins. Call once at startup. */ export function initChannels(): void { - registerChannel(telegramChannel); + // Telegram: use official bot via Gateway webhook instead of user-created bots. + // The long-polling plugin is kept in plugins/telegram.ts but not registered. // Future: registerChannel(discordChannel); // Future: registerChannel(feishuChannel); }