feat: add deterministic message interaction stages
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user