{"version":3,"file":"resolve-message-id.mjs","names":[],"sources":["../../../src/graphql/resolvers/resolve-message-id.ts"],"sourcesContent":["import { randomId } from \"@copilotkit/shared\";\n\n/**\n * Resolve the id to use for a streamed TextMessageOutput.\n *\n * Upstream events occasionally arrive with `messageId` missing, null, or an\n * empty string. We fall back to a freshly generated id in those cases so the\n * resulting output never surfaces a null id to the GraphQL client (#2118).\n */\nexport function resolveMessageId(\n  eventMessageId: string | null | undefined,\n): string {\n  return eventMessageId || randomId();\n}\n"],"mappings":";;;;;;;;;;;AASA,SAAgB,iBACd,gBACQ;AACR,QAAO,kBAAkB,UAAU"}