export type MentionReferenceEventDetail = { threadId: string; filename: string; path?: string; ref_source: "artifact" | "upload"; }; export const MENTION_REFERENCE_EVENT = "deerflow:mention-reference"; export function dispatchMentionReference(detail: MentionReferenceEventDetail) { if (typeof window === "undefined") return; window.dispatchEvent( new CustomEvent(MENTION_REFERENCE_EVENT, { detail, }), ); }