mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-30 21:49:18 +01:00
12 lines
462 B
TypeScript
12 lines
462 B
TypeScript
/** Use the same effective assignee for authorization and persisted chat handoffs. */
|
|
export function resolveChatTaskAssignment(
|
|
assignment: { assigneeAgentId?: string | null; assigneeUserId?: string | null },
|
|
conversationAgentId: string | null | undefined,
|
|
) {
|
|
return {
|
|
assigneeAgentId: assignment.assigneeAgentId
|
|
?? (assignment.assigneeUserId ? null : conversationAgentId ?? null),
|
|
assigneeUserId: assignment.assigneeUserId ?? null,
|
|
};
|
|
}
|