diff --git a/docs/event-based-agents/adapters/aiocqhttp.md b/docs/event-based-agents/adapters/aiocqhttp.md index aa2edf8ca..c056adfbe 100644 --- a/docs/event-based-agents/adapters/aiocqhttp.md +++ b/docs/event-based-agents/adapters/aiocqhttp.md @@ -13,7 +13,7 @@ src/langbot/pkg/platform/adapters/aiocqhttp/ ├── message_converter.py ├── platform_api.py ├── types.py -└── onebot.svg +└── onebot.png ``` The EBA adapter is registered as `aiocqhttp-omni`. The legacy adapter remains at `src/langbot/pkg/platform/sources/aiocqhttp.py`. diff --git a/src/langbot/pkg/platform/adapters/aiocqhttp/manifest.yaml b/src/langbot/pkg/platform/adapters/aiocqhttp/manifest.yaml index bb0f4c8d5..6911881c9 100644 --- a/src/langbot/pkg/platform/adapters/aiocqhttp/manifest.yaml +++ b/src/langbot/pkg/platform/adapters/aiocqhttp/manifest.yaml @@ -11,7 +11,7 @@ metadata: en_US: OneBot v11 adapter for QQ-compatible protocol endpoints with event-driven orchestration support zh_Hans: OneBot v11 适配器,用于接入 QQ 兼容协议端,支持事件驱动编排 zh_Hant: OneBot v11 適配器,用於接入 QQ 相容協定端,支援事件驅動編排 - icon: onebot.svg + icon: onebot.png spec: categories: diff --git a/src/langbot/pkg/platform/adapters/aiocqhttp/onebot.png b/src/langbot/pkg/platform/adapters/aiocqhttp/onebot.png new file mode 100644 index 000000000..5144648c2 Binary files /dev/null and b/src/langbot/pkg/platform/adapters/aiocqhttp/onebot.png differ diff --git a/src/langbot/pkg/platform/adapters/aiocqhttp/onebot.svg b/src/langbot/pkg/platform/adapters/aiocqhttp/onebot.svg deleted file mode 100644 index c685bb9be..000000000 --- a/src/langbot/pkg/platform/adapters/aiocqhttp/onebot.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/web/src/app/home/bots/BotDetailContent.tsx b/web/src/app/home/bots/BotDetailContent.tsx index a812e35dc..47fdd9a14 100644 --- a/web/src/app/home/bots/BotDetailContent.tsx +++ b/web/src/app/home/bots/BotDetailContent.tsx @@ -4,13 +4,6 @@ import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs'; import { Button } from '@/components/ui/button'; import { Switch } from '@/components/ui/switch'; import { Label } from '@/components/ui/label'; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from '@/components/ui/card'; import { Dialog, DialogContent, @@ -36,6 +29,7 @@ import { Bot } from '@/app/infra/entities/api'; import EntityBasicInfoDialog, { EntityBasicInfoValues, } from '@/app/home/components/entity-basic-info/EntityBasicInfoDialog'; +import AdapterEventDebugDialog from './components/bot-form/AdapterEventDebugDialog'; import EntityTitleEditButton from '@/app/home/components/entity-basic-info/EntityTitleEditButton'; export default function BotDetailContent({ id }: { id: string }) { @@ -61,6 +55,7 @@ export default function BotDetailContent({ id }: { id: string }) { }, [id, isCreateMode, bots, setDetailEntityName, t]); const [activeTab, setActiveTab] = useState('config'); + const [adapterLabel, setAdapterLabel] = useState(''); const [showDeleteConfirm, setShowDeleteConfirm] = useState(false); const [basicInfoOpen, setBasicInfoOpen] = useState(false); const [bot, setBot] = useState(null); @@ -191,7 +186,7 @@ export default function BotDetailContent({ id }: { id: string }) { <>
{/* Sticky Header: title + enable switch + save button */} -
+

@@ -219,14 +214,29 @@ export default function BotDetailContent({ id }: { id: string }) { )}

{canManage && ( - +
+ + + +
)}
@@ -286,9 +296,9 @@ export default function BotDetailContent({ id }: { id: string }) { {/* Tab: Configuration */} -
+
- - {/* Card: Danger Zone */} - {canManage && ( - - - - {t('bots.dangerZone')} - - - {t('bots.dangerZoneDescription')} - - - -
-
-

- {t('bots.deleteBotAction')} -

-

- {t('bots.deleteBotHint')} -

-
- -
-
-
- )}
diff --git a/web/src/app/home/bots/components/bot-form/AdapterEventDebugDialog.tsx b/web/src/app/home/bots/components/bot-form/AdapterEventDebugDialog.tsx index 17c362c16..f144653e2 100644 --- a/web/src/app/home/bots/components/bot-form/AdapterEventDebugDialog.tsx +++ b/web/src/app/home/bots/components/bot-form/AdapterEventDebugDialog.tsx @@ -192,12 +192,11 @@ export default function AdapterEventDebugDialog({ diff --git a/web/src/app/home/bots/components/bot-form/BotForm.tsx b/web/src/app/home/bots/components/bot-form/BotForm.tsx index fd9b66630..9585d1582 100644 --- a/web/src/app/home/bots/components/bot-form/BotForm.tsx +++ b/web/src/app/home/bots/components/bot-form/BotForm.tsx @@ -21,8 +21,8 @@ import { systemInfo } from '@/app/infra/http'; import { Agent, Bot } from '@/app/infra/entities/api'; import { getAdapterDocUrl } from '@/app/infra/entities/adapter-docs'; import { ExternalLink, ChevronDown, ChevronRight } from 'lucide-react'; +import { cn } from '@/lib/utils'; import EventBindingsEditor from './EventBindingsEditor'; -import AdapterEventDebugDialog from './AdapterEventDebugDialog'; import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; @@ -101,10 +101,17 @@ interface BotFormProps { onFormSubmit: (value: z.infer>) => void; onNewBotCreated: (botId: string) => void; onDirtyChange?: (dirty: boolean) => void; + onAdapterLabelChange?: (label: string) => void; } const BotForm = forwardRef(function BotForm( - { initBotId, onFormSubmit, onNewBotCreated, onDirtyChange }, + { + initBotId, + onFormSubmit, + onNewBotCreated, + onDirtyChange, + onAdapterLabelChange, + }, ref, ) { const { t } = useTranslation(); @@ -153,6 +160,12 @@ const BotForm = forwardRef(function BotForm( // Watch adapter and adapter_config for filtering const currentAdapter = form.watch('adapter'); + const adapterLabel = + adapterNameList.find((adapter) => adapter.value === currentAdapter) + ?.label ?? ''; + useEffect(() => { + onAdapterLabelChange?.(adapterLabel); + }, [adapterLabel, onAdapterLabelChange]); const currentAdapterConfig = form.watch('adapter_config'); // Group adapters by category for the Select dropdown. Legacy adapters are @@ -440,10 +453,15 @@ const BotForm = forwardRef(function BotForm( id="bot-form" onSubmit={form.handleSubmit(onDynamicFormSubmit)} aria-busy={isLoading} - className="w-full min-w-0 max-w-full" + className={cn('w-full min-w-0 max-w-full', initBotId && 'lg:h-full')} >
{!initBotId && ( @@ -489,14 +507,24 @@ const BotForm = forwardRef(function BotForm( )} {/* Card 2: Adapter Configuration */} - + {t('bots.adapterConfig')} {t('bots.adapterConfigDescription')} - + (function BotForm( * -
+