Refactor AI Agent configuration and workflow handling

- Removed runtime mode handling from AIAgentConfigWorkbench and related components.
- Updated tests to reflect changes in AI Agent policy copy and configuration.
- Changed terminology from "workflow" to "revision" in various components and API responses.
- Simplified agent binding logic in channel editing.
- Cleaned up unused variables and types related to runtime modes.
- Updated localization files for consistency with new terminology.
This commit is contained in:
mlogclub
2026-07-27 23:29:02 +08:00
parent 241f274927
commit 847f688398
97 changed files with 1666 additions and 5941 deletions
+11 -18
View File
@@ -62,10 +62,6 @@ function getNextStatus(item: AIAgent) {
return item.status === Status.Ok ? Status.Disabled : Status.Ok;
}
function isWorkflowPublished(item: AIAgent) {
return Boolean(item.workflowPublished ?? item.workflowVersionId > 0);
}
export default function DashboardAIAgentsPage() {
const t = useI18n();
const statusOptions = useMemo(() => getStatusOptions(t), [t]);
@@ -126,31 +122,28 @@ export default function DashboardAIAgentsPage() {
render: (item) => getServiceModeLabel(item.serviceMode, t),
},
{
key: "workflow",
label: "工作流状态",
key: "publication",
label: "发布状态",
render: (item) => {
const published = isWorkflowPublished(item);
const published = item.publishedRevisionId > 0;
const workflowCount = item.workflowBindings?.length ?? 0;
return (
<div className="space-y-1">
<div className="flex flex-wrap items-center gap-1.5">
<Badge variant={published ? "default" : "outline"}>
{item.workflowStateText || (published ? "已发布" : "未发布")}
{published ? "已发布" : "未发布"}
</Badge>
{published ? (
<span className="font-mono text-xs text-muted-foreground">
#{item.workflowVersionId}
Revision #{item.publishedRevisionId}
</span>
) : null}
</div>
{!published ? (
<div className="text-xs text-muted-foreground">
AI
</div>
) : (
<div className="text-xs text-muted-foreground">
#{item.workflowVersionId}
</div>
)}
<div className="text-xs text-muted-foreground">
{workflowCount > 0
? `已配置 ${workflowCount} 个 Workflow`
: "由 Agent 自主判断并直接回复"}
</div>
</div>
);
},