feat: add deterministic message interaction stages

This commit is contained in:
Xin Wang
2026-08-03 07:10:41 +08:00
parent 479a516546
commit 9daa46ed4d
26 changed files with 1356 additions and 414 deletions

View File

@@ -63,21 +63,30 @@ let nodeSeq = 0;
function defaultNodeData(spec: RuntimeNodeSpec): WorkflowNodeData {
const data: WorkflowNodeData = {
name: spec.displayName,
...(spec.type === "agent"
? {
contextPolicy: "inherit",
inheritGlobalConfig: true,
entryMode: "wait_user",
entrySpeech: "",
}
: spec.type === "action"
? {
arguments: {},
resultAssignmentMode: "inherit",
userInputPolicy: "queue",
}
: {}),
};
if (spec.type === "agent") {
Object.assign(data, {
contextPolicy: "inherit",
inheritGlobalConfig: true,
entryMode: "wait_user",
entrySpeech: "",
});
} else if (spec.type === "action") {
Object.assign(data, {
arguments: {},
resultAssignmentMode: "inherit",
userInputPolicy: "queue",
});
} else if (spec.type === "message") {
Object.assign(data, {
speech: "",
showMessage: false,
title: "重要提示",
message: "",
confirmLabel: "确认",
requireConfirmation: false,
});
}
for (const field of spec.fields) {
if (field.default !== undefined) data[field.key] = field.default;
}