mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-28 21:27:14 +00:00
style(agents): distinguish agent capabilities from events
This commit is contained in:
@@ -22,6 +22,40 @@ function ArrowMarker({ id }: { id: string }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CapabilityIcon({
|
||||||
|
kind,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
}: {
|
||||||
|
kind: 'model' | 'tool' | 'action';
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<g
|
||||||
|
transform={`translate(${x - 9} ${y - 9})`}
|
||||||
|
fill="none"
|
||||||
|
stroke={LANGBOT_CYAN}
|
||||||
|
strokeWidth="1.7"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
>
|
||||||
|
{kind === 'model' && (
|
||||||
|
<>
|
||||||
|
<path d="m7 1 1.4 4.1L12.5 6.5 8.4 8 7 12 5.6 8 1.5 6.5l4.1-1.4L7 1Z" />
|
||||||
|
<path d="m14.5 10 .7 2.3 2.3.7-2.3.8-.7 2.2-.8-2.2-2.2-.8 2.2-.7.8-2.3Z" />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{kind === 'tool' && (
|
||||||
|
<path d="M12.8 2.1a4.1 4.1 0 0 0-5.2 5.2L2 12.9a2.1 2.1 0 1 0 3 3l5.6-5.6a4.1 4.1 0 0 0 5.2-5.2l-2.7 2.7-2.8-2.8 2.5-2.9Z" />
|
||||||
|
)}
|
||||||
|
{kind === 'action' && (
|
||||||
|
<path d="M10.5 1 3 10.5h6L8 17l7.5-9.5h-6L10.5 1Z" />
|
||||||
|
)}
|
||||||
|
</g>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function AgentDiagram() {
|
function AgentDiagram() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const arrowId = `agent-arrow-${useId().replace(/:/g, '')}`;
|
const arrowId = `agent-arrow-${useId().replace(/:/g, '')}`;
|
||||||
@@ -31,9 +65,9 @@ function AgentDiagram() {
|
|||||||
{ label: t('agents.diagramFeedback'), y: 395 },
|
{ label: t('agents.diagramFeedback'), y: 395 },
|
||||||
];
|
];
|
||||||
const outputs = [
|
const outputs = [
|
||||||
{ label: t('agents.diagramModel'), y: 155 },
|
{ kind: 'model' as const, label: t('agents.diagramModel'), y: 155 },
|
||||||
{ label: t('agents.diagramTools'), y: 275 },
|
{ kind: 'tool' as const, label: t('agents.diagramTools'), y: 275 },
|
||||||
{ label: t('agents.diagramActions'), y: 395 },
|
{ kind: 'action' as const, label: t('agents.diagramActions'), y: 395 },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -121,7 +155,7 @@ function AgentDiagram() {
|
|||||||
fontSize="13"
|
fontSize="13"
|
||||||
fontWeight="600"
|
fontWeight="600"
|
||||||
>
|
>
|
||||||
{t('agents.diagramAgentInitiated')}
|
{t('agents.diagramAgentCanUse')}
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
{outputs.map((item) => (
|
{outputs.map((item) => (
|
||||||
@@ -129,10 +163,10 @@ function AgentDiagram() {
|
|||||||
<path
|
<path
|
||||||
d={`M436 310 C468 310 474 ${item.y + 29} 538 ${item.y + 29}`}
|
d={`M436 310 C468 310 474 ${item.y + 29} 538 ${item.y + 29}`}
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke={LANGBOT_BLUE}
|
stroke={LANGBOT_CYAN}
|
||||||
strokeWidth="2"
|
strokeWidth="1.8"
|
||||||
opacity="0.38"
|
strokeDasharray="5 6"
|
||||||
markerEnd={`url(#${arrowId})`}
|
opacity="0.48"
|
||||||
/>
|
/>
|
||||||
<rect
|
<rect
|
||||||
x="538"
|
x="538"
|
||||||
@@ -153,14 +187,7 @@ function AgentDiagram() {
|
|||||||
stroke={LANGBOT_CYAN}
|
stroke={LANGBOT_CYAN}
|
||||||
strokeOpacity="0.5"
|
strokeOpacity="0.5"
|
||||||
/>
|
/>
|
||||||
<path
|
<CapabilityIcon kind={item.kind} x={565} y={item.y + 29} />
|
||||||
d={`M559 ${item.y + 29}h12m-4-4 4 4-4 4`}
|
|
||||||
fill="none"
|
|
||||||
stroke={LANGBOT_CYAN}
|
|
||||||
strokeWidth="1.7"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
/>
|
|
||||||
<text
|
<text
|
||||||
x="584"
|
x="584"
|
||||||
y={item.y + 34}
|
y={item.y + 34}
|
||||||
|
|||||||
@@ -723,7 +723,7 @@ const enUS = {
|
|||||||
'A Pipeline handles message events only and runs each step in the order you configure.',
|
'A Pipeline handles message events only and runs each step in the order you configure.',
|
||||||
pipelineDiagramFlow: 'Messages move through a fixed sequence',
|
pipelineDiagramFlow: 'Messages move through a fixed sequence',
|
||||||
diagramEvents: 'Platform events',
|
diagramEvents: 'Platform events',
|
||||||
diagramAgentInitiated: 'Initiated by Agent',
|
diagramAgentCanUse: 'Available to Agent',
|
||||||
diagramMessages: 'Messages',
|
diagramMessages: 'Messages',
|
||||||
diagramMembers: 'Members',
|
diagramMembers: 'Members',
|
||||||
diagramFeedback: 'Feedback',
|
diagramFeedback: 'Feedback',
|
||||||
|
|||||||
@@ -736,7 +736,7 @@ const jaJP = {
|
|||||||
'Pipeline はメッセージイベントのみを、設定した固定ステップの順番で処理します。',
|
'Pipeline はメッセージイベントのみを、設定した固定ステップの順番で処理します。',
|
||||||
pipelineDiagramFlow: 'メッセージを固定フローで順番に処理',
|
pipelineDiagramFlow: 'メッセージを固定フローで順番に処理',
|
||||||
diagramEvents: 'イベント',
|
diagramEvents: 'イベント',
|
||||||
diagramAgentInitiated: 'Agent が実行',
|
diagramAgentCanUse: 'Agent が利用可能',
|
||||||
diagramMessages: 'メッセージ',
|
diagramMessages: 'メッセージ',
|
||||||
diagramMembers: 'メンバー',
|
diagramMembers: 'メンバー',
|
||||||
diagramFeedback: 'フィードバック',
|
diagramFeedback: 'フィードバック',
|
||||||
|
|||||||
@@ -692,7 +692,7 @@ const zhHans = {
|
|||||||
'Pipeline 只处理消息事件,并严格按照你编排的固定步骤依次执行。',
|
'Pipeline 只处理消息事件,并严格按照你编排的固定步骤依次执行。',
|
||||||
pipelineDiagramFlow: '消息沿固定流程依次处理',
|
pipelineDiagramFlow: '消息沿固定流程依次处理',
|
||||||
diagramEvents: '平台事件',
|
diagramEvents: '平台事件',
|
||||||
diagramAgentInitiated: 'Agent 主动发起',
|
diagramAgentCanUse: 'Agent 可使用',
|
||||||
diagramMessages: '消息',
|
diagramMessages: '消息',
|
||||||
diagramMembers: '群成员',
|
diagramMembers: '群成员',
|
||||||
diagramFeedback: '反馈',
|
diagramFeedback: '反馈',
|
||||||
|
|||||||
Reference in New Issue
Block a user