Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

506 B
Raw Blame
/** Canonical identity for new results, with historical message fallbacks. */
export const resolveTaskOpenTarget = (
  state?: { taskId?: string; identifier?: string } | null,
  args?: { identifier?: string } | null,
): string | undefined => state?.taskId ?? state?.identifier ?? args?.identifier;

export const taskResultState = (
  task: { id: string; identifier: string },
  extra: Record<string, unknown> = {},
) => ({
  ...extra,
  identifier: task.identifier,
  success: true,
  taskId: task.id,
});