feat: 持久化运行记录并补充分发验证

这个提交包含在:
yu 于 2026-10-27 11:35:13 +08:00 提交
1 父节点 c03380168d
当前提交 aff2d5cd95
8 个文件已更改
+344 -7

没有与搜索条件相匹配的文件

+2 -2
查看文件
@@ -47,13 +47,13 @@ export function startRun(flow: FlowDefinition, sender: WebContents): { runId: st
log,
componentOf: (node) => components.get(node.componentId)
});
fs.writeFileSync(path.join(root, "run.json"), JSON.stringify(result, null, 2), "utf8");
fs.writeFileSync(path.join(root, "run.json"), JSON.stringify({ ...result, flowId: flow.id }, null, 2), "utf8");
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
emit({ type: "run.finished", status: "failed", durationMs: 0, error: { code: "unknown", reason: message } });
fs.writeFileSync(
path.join(root, "run.json"),
JSON.stringify({ runId, status: "failed", error: message }, null, 2),
JSON.stringify({ runId, flowId: flow.id, status: "failed", error: { reason: message }, finishedAt: new Date().toISOString(), durationMs: 0 }, null, 2),
"utf8"
);
} finally {