mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-09 20:50:58 +00:00
refactor: consolidate bot event routing
This commit is contained in:
committed by
huanghuoguoguo
parent
662627142e
commit
7fb393b85b
@@ -84,8 +84,8 @@ export default function AgentCreateContent({
|
||||
{
|
||||
kind: 'agent',
|
||||
icon: Bot,
|
||||
title: t('agents.agentOrchestration'),
|
||||
description: t('agents.agentOrchestrationDescription'),
|
||||
title: t('agents.agentType'),
|
||||
description: t('agents.agentTypeDescription'),
|
||||
badge: t('agents.allEvents'),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -148,7 +148,7 @@ export default function AgentFormComponent({
|
||||
const sections: SectionItem[] = [
|
||||
{ label: t('agents.basicInfo'), name: 'basic', icon: Info },
|
||||
{ label: t('agents.runnerSettings'), name: 'runner', icon: Brain },
|
||||
{ label: t('agents.eventCapability'), name: 'events', icon: FileJson2 },
|
||||
{ label: t('agents.advanced'), name: 'events', icon: FileJson2 },
|
||||
];
|
||||
|
||||
const currentRunner = (form.watch('runner') as Record<string, any>)?.id;
|
||||
@@ -450,9 +450,9 @@ export default function AgentFormComponent({
|
||||
{activeSection === 'events' && (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t('agents.eventCapability')}</CardTitle>
|
||||
<CardTitle>{t('agents.bindableEvents')}</CardTitle>
|
||||
<CardDescription>
|
||||
{t('agents.eventCapabilityDescription')}
|
||||
{t('agents.bindableEventsDescription')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
|
||||
@@ -448,13 +448,13 @@ export default function BotForm({
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Card 2: Event Orchestration (edit mode only) */}
|
||||
{/* Card 2: Event Routing (edit mode only) */}
|
||||
{initBotId && (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t('bots.eventOrchestration')}</CardTitle>
|
||||
<CardTitle>{t('bots.eventRouting')}</CardTitle>
|
||||
<CardDescription>
|
||||
{t('bots.eventOrchestrationDescription')}
|
||||
{t('bots.eventRoutingDescription')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
|
||||
@@ -59,7 +59,7 @@ import {
|
||||
} from '@dnd-kit/sortable';
|
||||
import { CSS } from '@dnd-kit/utilities';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { EventBinding, Agent, AgentKind } from '@/app/infra/entities/api';
|
||||
import { EventBinding, Agent } from '@/app/infra/entities/api';
|
||||
|
||||
export const PIPELINE_DISCARD = '__discard__';
|
||||
|
||||
@@ -496,18 +496,6 @@ function BindingCardContent({
|
||||
const isExpanded = expandedIds.has(id);
|
||||
const filterCount = (binding.filters as FilterRow[] | undefined)?.length ?? 0;
|
||||
const pipelineAllowed = isMessageEventPattern(binding.event_pattern);
|
||||
const targetType = binding.target_type || 'agent';
|
||||
|
||||
function getTargetOptions(kind: AgentKind): Agent[] {
|
||||
return agentOptions.filter((agent) => {
|
||||
if (agent.kind !== kind) return false;
|
||||
if (kind === 'pipeline')
|
||||
return isMessageEventPattern(binding.event_pattern);
|
||||
if (kind === 'agent')
|
||||
return agentSupportsEventPattern(agent, binding.event_pattern);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="rounded-lg border bg-card">
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface SidebarEntityItem {
|
||||
debug?: boolean;
|
||||
// Set when this item appears in the unified extensions list
|
||||
extensionType?: 'plugin' | 'mcp' | 'skill';
|
||||
// Agent-specific: distinguishes Agent orchestration from legacy Pipeline
|
||||
// Agent-specific: distinguishes Agent processors from Pipelines
|
||||
kind?: 'agent' | 'pipeline';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user