代码修改
This commit is contained in:
1 parent
30e1c2dd90
commit
5ab3d7f254
5 files changed
+72
-25
No files matched your search
@@ -34,6 +34,39 @@ export default function AgentFlow({
|
|||||||
}: AgentFlowProps) {
|
}: AgentFlowProps) {
|
||||||
const seatById = new Map(seats.map((seat) => [seat.agent_id, seat]));
|
const seatById = new Map(seats.map((seat) => [seat.agent_id, seat]));
|
||||||
|
|
||||||
|
// 只有一个阶段时不画阶段框:席位直接横向排列。
|
||||||
|
if (stages.length === 1) {
|
||||||
|
return (
|
||||||
|
<div className={`mat-flow mat-flow--single mat-flow--${size}`}>
|
||||||
|
{stages[0]!.map((agentId) => {
|
||||||
|
const seat = seatById.get(agentId);
|
||||||
|
const state = seatStates?.[agentId] ?? null;
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`mat-seat mat-seat--c${seatColorIndex(agentId)}${
|
||||||
|
state ? ` is-${state}` : ""
|
||||||
|
}`}
|
||||||
|
key={agentId}
|
||||||
|
title={
|
||||||
|
seat?.description
|
||||||
|
? `${seat.name}:${seat.description}`
|
||||||
|
: (seat?.name ?? agentId)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<span className="mat-seat-avatar">
|
||||||
|
<Bot size={size === "sm" ? 11 : 12} strokeWidth={2.2} />
|
||||||
|
</span>
|
||||||
|
<span className="mat-seat-name">{seat?.name ?? agentId}</span>
|
||||||
|
{state && (
|
||||||
|
<span className={`mat-seat-dot is-${state}`} title={STATE_LABEL[state]} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`mat-flow mat-flow--${size}`}>
|
<div className={`mat-flow mat-flow--${size}`}>
|
||||||
{stages.map((stage, stageIndex) => {
|
{stages.map((stage, stageIndex) => {
|
||||||
|
|||||||
@@ -549,6 +549,11 @@
|
|||||||
.mat-flow--sm .mat-flow-stage { padding: 6px; }
|
.mat-flow--sm .mat-flow-stage { padding: 6px; }
|
||||||
.mat-flow--sm .mat-flow-stage-head { margin-bottom: 6px; }
|
.mat-flow--sm .mat-flow-stage-head { margin-bottom: 6px; }
|
||||||
|
|
||||||
|
/* 单阶段:无阶段框,席位横向并排 */
|
||||||
|
.mat-flow--single {
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 席位胶囊:浅底(-03 系)+ 深字(-10 系)+ 实填头像(-09),色序=§1.1.10 */
|
/* 席位胶囊:浅底(-03 系)+ 深字(-10 系)+ 实填头像(-09),色序=§1.1.10 */
|
||||||
.mat-seat {
|
.mat-seat {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import type {
|
|||||||
TaTask,
|
TaTask,
|
||||||
} from "./types";
|
} from "./types";
|
||||||
|
|
||||||
const STORAGE_KEY = "deerflow.official.task-analysis.v1";
|
const STORAGE_KEY = "deerflow.official.task-analysis.v2";
|
||||||
|
|
||||||
interface TaStore {
|
interface TaStore {
|
||||||
tasks: TaTask[];
|
tasks: TaTask[];
|
||||||
@@ -126,8 +126,8 @@ function seedStore(): TaStore {
|
|||||||
name: "竞品新品发布追踪",
|
name: "竞品新品发布追踪",
|
||||||
description: "追踪 5 家核心竞品的新品发布与市场反应,按块更新详情内容。",
|
description: "追踪 5 家核心竞品的新品发布与市场反应,按块更新详情内容。",
|
||||||
binding: {
|
binding: {
|
||||||
chainId: "seed-chain-std",
|
chainId: "seed-chain-single",
|
||||||
chainTitle: "标准舆情分析链",
|
chainTitle: "单阶段并行分析链",
|
||||||
cron: "30 8 * * 1",
|
cron: "30 8 * * 1",
|
||||||
cronText: "每周一 08:30",
|
cronText: "每周一 08:30",
|
||||||
enabled: false,
|
enabled: false,
|
||||||
@@ -156,6 +156,7 @@ function seedStore(): TaStore {
|
|||||||
["analyst"],
|
["analyst"],
|
||||||
["writer"],
|
["writer"],
|
||||||
];
|
];
|
||||||
|
const singleStages = [["collector", "verifier", "analyst"]];
|
||||||
const stdNames = seats;
|
const stdNames = seats;
|
||||||
|
|
||||||
const runs: TaRunRecord[] = [
|
const runs: TaRunRecord[] = [
|
||||||
@@ -202,9 +203,9 @@ function seedStore(): TaStore {
|
|||||||
trigger: "schedule",
|
trigger: "schedule",
|
||||||
scheduledFor: hoursAgo(24 * 3),
|
scheduledFor: hoursAgo(24 * 3),
|
||||||
startedAt: hoursAgo(24 * 3),
|
startedAt: hoursAgo(24 * 3),
|
||||||
durationMs: PENDING_MS + stdStages.length * STAGE_MS,
|
durationMs: PENDING_MS + singleStages.length * STAGE_MS,
|
||||||
stages: stdStages,
|
stages: singleStages,
|
||||||
stageGoals: ["并行完成全网采集与数据核查", "研判风险与行动方向", "汇总各块结论"],
|
stageGoals: ["三席并行:采集 / 核查 / 研判同时产出"],
|
||||||
seatNames: stdNames,
|
seatNames: stdNames,
|
||||||
failStage: null,
|
failStage: null,
|
||||||
},
|
},
|
||||||
@@ -507,6 +508,9 @@ export function chainStagesOf(
|
|||||||
["writer"],
|
["writer"],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
if (binding.chainId === "seed-chain-single") {
|
||||||
|
return [["collector", "verifier", "analyst"]];
|
||||||
|
}
|
||||||
// 真实业务链的编排由页面侧传入的 chain 数据展开;存储层兜底为单席位串行。
|
// 真实业务链的编排由页面侧传入的 chain 数据展开;存储层兜底为单席位串行。
|
||||||
const seats = seedSeatsOf(store);
|
const seats = seedSeatsOf(store);
|
||||||
return seats.map((agentId) => [agentId]);
|
return seats.map((agentId) => [agentId]);
|
||||||
|
|||||||
@@ -939,15 +939,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ta-chain-card {
|
.ta-chain-card {
|
||||||
align-items: center;
|
|
||||||
background: var(--mat-panel);
|
background: var(--mat-panel);
|
||||||
border: 1px solid var(--mat-line);
|
border: 1px solid var(--mat-line);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: grid;
|
display: flex;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
gap: 4px 16px;
|
flex-direction: column;
|
||||||
grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
|
gap: 8px;
|
||||||
padding: 12px 16px;
|
padding: 12px 16px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
transition: border-color 120ms ease, box-shadow 120ms ease;
|
transition: border-color 120ms ease, box-shadow 120ms ease;
|
||||||
@@ -968,8 +967,6 @@
|
|||||||
color: var(--mat-primary);
|
color: var(--mat-primary);
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
grid-column: 1;
|
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ta-chain-card.is-active header svg {
|
.ta-chain-card.is-active header svg {
|
||||||
@@ -999,18 +996,14 @@
|
|||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
grid-column: 1;
|
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ta-chain-card-flow {
|
.ta-chain-card-flow {
|
||||||
align-self: center;
|
|
||||||
background: var(--fs-004-02);
|
background: var(--fs-004-02);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
grid-column: 2;
|
|
||||||
grid-row: 1 / span 2;
|
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -1341,13 +1334,4 @@
|
|||||||
.ta-chain-grid {
|
.ta-chain-grid {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ta-chain-card {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ta-chain-card-flow {
|
|
||||||
grid-column: 1;
|
|
||||||
grid-row: auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
"""Merge assistant-wiki metadata and report-collaboration heads.
|
||||||
|
|
||||||
|
Revision ID: 20260909_01
|
||||||
|
Revises: 20260903_01, 20260907_01
|
||||||
|
Create Date: 2026-09-09
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
revision = "20260909_01"
|
||||||
|
down_revision = ("20260903_01", "20260907_01")
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
pass
|
||||||
Reference in new issue
Block a user