feat(studio): 回退/重roll 与 R5 用户确认下一步
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -26,3 +26,18 @@ export function findLastUserMessageIndex(stepMessages = []) {
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/** Whether undo is available for the active node state. */
|
||||
export function canUndoRun(activeNodeState) {
|
||||
return (activeNodeState?.turnHistory?.length ?? 0) > 0;
|
||||
}
|
||||
|
||||
/** Whether reroll is available (at least one user message in current step). */
|
||||
export function canRerollRun(activeNodeState) {
|
||||
return findLastUserMessageIndex(activeNodeState?.stepMessages) >= 0;
|
||||
}
|
||||
|
||||
/** Whether the user may advance to the next pipeline node (R5). */
|
||||
export function canAdvanceNextStep(activeNodeState) {
|
||||
return Boolean(activeNodeState?.lastDraft);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user