fix: harden paired runtime turn coordination
This commit is contained in:
@@ -82,6 +82,8 @@ export type NextTurnAction =
|
||||
| { kind: 'owner-follow-up' }
|
||||
| { kind: 'finalize-owner-turn' };
|
||||
|
||||
export type ScheduledNextTurnActionKind = Exclude<NextTurnAction['kind'], 'none'>;
|
||||
|
||||
export type FollowUpDispatch =
|
||||
| { kind: 'none' }
|
||||
| { kind: 'inline' }
|
||||
@@ -116,6 +118,19 @@ export function resolveNextTurnAction(args: {
|
||||
}
|
||||
}
|
||||
|
||||
export function matchesExpectedPairedFollowUpIntent(args: {
|
||||
taskStatus?: PairedTaskStatus | null;
|
||||
lastTurnOutputRole?: PairedRoomRole | null;
|
||||
intentKind: ScheduledNextTurnActionKind;
|
||||
}): boolean {
|
||||
return (
|
||||
resolveNextTurnAction({
|
||||
taskStatus: args.taskStatus,
|
||||
lastTurnOutputRole: args.lastTurnOutputRole,
|
||||
}).kind === args.intentKind
|
||||
);
|
||||
}
|
||||
|
||||
export function resolveFollowUpDispatch(args: {
|
||||
source:
|
||||
| 'delivery-success'
|
||||
|
||||
Reference in New Issue
Block a user