96 lines
3.3 KiB
TypeScript
96 lines
3.3 KiB
TypeScript
/**
|
|
* Step 3 主面板 —— 方案结果展示。
|
|
*
|
|
* 当前是 `HighFidelityReport` 的薄壳;放它在这里只是为了让 Step 1 / Step 2 /
|
|
* Step 3 三步在主页面里以同样的导入风格出现,方便阅读。
|
|
*
|
|
* Step 3 真实逻辑请改 `HighFidelityReport.tsx` —— 包括各席位 artifact
|
|
* 拉取 / 文本类预览 / window.open 下载 / 「重新起草」按钮等。
|
|
*/
|
|
import { HighFidelityReport } from "@/roundtable-planning/components/HighFidelityReport";
|
|
import type { DraftStep3Snapshot } from "@/roundtable-planning/api/drafts";
|
|
import type { ModelOption } from "@/roundtable-planning/components/Step3ReportMode";
|
|
import type { Step2Dialogue } from "@/roundtable-planning/hooks/useStep2Orchestration";
|
|
import type { ReportIntent } from "@/roundtable-planning/hooks/useStep3Report";
|
|
import type { ThreadIdMap } from "@/roundtable-planning/api/multi-agent";
|
|
|
|
export interface Step3PanelProps {
|
|
threadIds: ThreadIdMap | null;
|
|
coordinatorName: string | null;
|
|
consensusText: string;
|
|
hasConsensus: boolean;
|
|
step2RoundtableDialogues: Step2Dialogue[];
|
|
agentNameToRole: Record<
|
|
string,
|
|
{ speakerId: number; avatarType: string; displayName: string }
|
|
>;
|
|
/** Step 1 结构化意图 + 当前模型 —— 透传给「结果绘制」的方案可视化智能体。 */
|
|
intentReady: ReportIntent | null;
|
|
selectedModel: string;
|
|
/** 可选模型列表 + 加载态 + 切换器 —— 透传给「结果绘制」的模型选择。 */
|
|
availableModels: ReadonlyArray<ModelOption>;
|
|
modelsLoading: boolean;
|
|
setSelectedModel: (model: string) => void;
|
|
/** 草稿里已存的上次绘制结果 + 完成回调 —— 透传给「结果绘制」做持久化。 */
|
|
savedReport?: DraftStep3Snapshot | null;
|
|
onReportSaved?: (snapshot: DraftStep3Snapshot) => void;
|
|
onReset: () => void;
|
|
/** Step 2 沙箱预览产出文件(与第二步相同)。 */
|
|
openArtifactPreview: (threadId: string, path: string) => void;
|
|
seatStubMessages: Record<string, unknown[]>;
|
|
}
|
|
|
|
export function Step3Panel(props: Step3PanelProps) {
|
|
const {
|
|
threadIds,
|
|
coordinatorName,
|
|
consensusText,
|
|
hasConsensus,
|
|
step2RoundtableDialogues,
|
|
agentNameToRole,
|
|
intentReady,
|
|
selectedModel,
|
|
availableModels,
|
|
modelsLoading,
|
|
setSelectedModel,
|
|
savedReport,
|
|
onReportSaved,
|
|
onReset,
|
|
openArtifactPreview,
|
|
seatStubMessages,
|
|
} = props;
|
|
|
|
const seatDeliveries = step2RoundtableDialogues
|
|
.filter((d) => d.confidence === "子智能体交付")
|
|
.map((d) => ({
|
|
sender: String(d.sender ?? ""),
|
|
avatarType: String(d.avatarType ?? "blue"),
|
|
content: String(d.content ?? ""),
|
|
}));
|
|
|
|
const seatNameMap = Object.fromEntries(
|
|
Object.entries(agentNameToRole).map(([k, v]) => [k, v.displayName]),
|
|
);
|
|
|
|
return (
|
|
<HighFidelityReport
|
|
threadIds={threadIds}
|
|
coordinatorName={coordinatorName}
|
|
consensusText={consensusText}
|
|
hasConsensus={hasConsensus}
|
|
seatDeliveries={seatDeliveries}
|
|
seatNameMap={seatNameMap}
|
|
intentReady={intentReady}
|
|
selectedModel={selectedModel}
|
|
availableModels={availableModels}
|
|
modelsLoading={modelsLoading}
|
|
setSelectedModel={setSelectedModel}
|
|
savedReport={savedReport}
|
|
onReportSaved={onReportSaved}
|
|
onReset={onReset}
|
|
openArtifactPreview={openArtifactPreview}
|
|
seatStubMessages={seatStubMessages}
|
|
/>
|
|
);
|
|
}
|