feat(roundtable): 第三步「数据入库」由结构化输出智能体自行调用技能
- 入库改为让 roundtable-structure 走完整 agent 运行时(ingest run policy) 自行挑选/读取/调用入库技能并传入 taskId,不再前端代调演示 - 新增 /api/flow-extract/ingest-eligibility(智能体判断当前业务场景是否有 合适入库技能,决定入库按钮是否显示)+ /api/multi-agent/structure/init - 入库前判断是否已生成流程图:无则发起「是否先生成流程图」用户协助 - 「知识库入库」更名为「数据入库」 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a85d2480b4
commit
03c155f8a7
10 files changed
+507
-80
No files matched your search
@@ -98,7 +98,7 @@ import { useStep3Summary } from "@/roundtable-planning/hooks/useStep3Summary";
|
||||
import { useStep3Report } from "@/roundtable-planning/hooks/useStep3Report";
|
||||
import { useStep3Dashboard } from "@/roundtable-planning/hooks/useStep3Dashboard";
|
||||
import { isDashboardHtml } from "@/roundtable-planning/lib/report-template";
|
||||
import { isIngestSkillAvailable } from "@/roundtable-planning/api/ingest";
|
||||
import { checkIngestEligibility } from "@/roundtable-planning/api/ingest";
|
||||
import { stripReasoning } from "@/roundtable-planning/lib/reasoning";
|
||||
import {
|
||||
BUILTIN_AGENT_META,
|
||||
@@ -328,11 +328,45 @@ export default function RoundtablePlanningPage() {
|
||||
// 加载草稿时 hydrateStep3 恢复;新建任务清空。step3SavedTick 递增触发一次草稿自动保存。
|
||||
const [step3Report, setStep3Report] = useState<DraftStep3Snapshot | null>(null);
|
||||
const [step3SavedTick, setStep3SavedTick] = useState<number>(0);
|
||||
// 入库技能是否可用(决定第三步生成流程图后是否询问入库 + 显示手动入库按钮)。挂载查一次。
|
||||
// 入库是否可用 + 选中的入库技能:不再前端硬编码关键字,而是让**结构化输出智能体**读它
|
||||
// 挂载的入库技能 + 当前业务场景**自行判断**是否有适合本场景的入库技能(决定第三步是否询问
|
||||
// 入库 + 显示手动入库按钮)。入库仅深链(taskId)模式才有意义,故仅在该模式下判定。
|
||||
const [ingestAvailable, setIngestAvailable] = useState<boolean>(false);
|
||||
const [ingestSkill, setIngestSkill] = useState<string>("");
|
||||
const ingestTaskIdForCheck = prefillRef.current?.taskId ?? null;
|
||||
const ingestBusinessCode = prefillRef.current?.businessCode ?? null;
|
||||
useEffect(() => {
|
||||
void isIngestSkillAvailable().then(setIngestAvailable).catch(() => setIngestAvailable(false));
|
||||
}, []);
|
||||
if (!ingestTaskIdForCheck) {
|
||||
setIngestAvailable(false);
|
||||
setIngestSkill("");
|
||||
return;
|
||||
}
|
||||
let cancelled = false;
|
||||
void checkIngestEligibility({
|
||||
taskId: ingestTaskIdForCheck,
|
||||
businessCode: ingestBusinessCode,
|
||||
chainName: chainMeta?.title ?? null,
|
||||
coordinatorPrompt: orchestrationPlan?.coordinatorPrompt ?? null,
|
||||
})
|
||||
.then((r) => {
|
||||
if (cancelled) return;
|
||||
setIngestAvailable(r.canIngest);
|
||||
setIngestSkill(r.skill);
|
||||
})
|
||||
.catch(() => {
|
||||
if (cancelled) return;
|
||||
setIngestAvailable(false);
|
||||
setIngestSkill("");
|
||||
});
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [
|
||||
ingestTaskIdForCheck,
|
||||
ingestBusinessCode,
|
||||
chainMeta?.title,
|
||||
orchestrationPlan?.coordinatorPrompt,
|
||||
]);
|
||||
const step2RunsRef = useRef<DraftStep2RunSnapshot[]>([]);
|
||||
const activeStep2RunIdRef = useRef<string | null>(null);
|
||||
// 并行执行时收起左侧栏 —— 全局工作区侧栏(最左)走 useSidebarSafe(与「打开沙箱」同一路径,
|
||||
@@ -1174,6 +1208,10 @@ export default function RoundtablePlanningPage() {
|
||||
ingestAvailable,
|
||||
// 入库仅深链(taskId)模式(会商 rwfx-A 等)才有;taskId 入库时必传给技能。
|
||||
taskId: prefillRef.current?.taskId ?? null,
|
||||
// 入库场景线索:适用性判定选中的技能 + 业务码/链名,入库时引导智能体挑对入库技能。
|
||||
ingestSkill,
|
||||
ingestBusinessCode,
|
||||
ingestChainName: chainMeta?.title ?? null,
|
||||
});
|
||||
// render 期镜像总结报告的实时对话(文字 + 步骤条) + stub + 入库状态,供 getStep3Snapshot 落库。
|
||||
step3SummaryConvoRef.current = {
|
||||
|
||||
Reference in new issue
Block a user