@sentry/core 10.36.0 → 10.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/build/cjs/exports.js +10 -0
  2. package/build/cjs/exports.js.map +1 -1
  3. package/build/cjs/index.js +82 -78
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/integrations/captureconsole.js +2 -2
  6. package/build/cjs/integrations/captureconsole.js.map +1 -1
  7. package/build/cjs/integrations/conversationId.js +37 -0
  8. package/build/cjs/integrations/conversationId.js.map +1 -0
  9. package/build/cjs/integrations/mcp-server/errorCapture.js +2 -2
  10. package/build/cjs/integrations/mcp-server/errorCapture.js.map +1 -1
  11. package/build/cjs/integrations/supabase.js +4 -4
  12. package/build/cjs/integrations/supabase.js.map +1 -1
  13. package/build/cjs/scope.js +20 -0
  14. package/build/cjs/scope.js.map +1 -1
  15. package/build/cjs/semanticAttributes.js +16 -0
  16. package/build/cjs/semanticAttributes.js.map +1 -1
  17. package/build/cjs/tracing/ai/gen-ai-attributes.js +51 -7
  18. package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
  19. package/build/cjs/tracing/ai/messageTruncation.js +26 -45
  20. package/build/cjs/tracing/ai/messageTruncation.js.map +1 -1
  21. package/build/cjs/tracing/ai/utils.js +50 -3
  22. package/build/cjs/tracing/ai/utils.js.map +1 -1
  23. package/build/cjs/tracing/anthropic-ai/index.js +3 -3
  24. package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
  25. package/build/cjs/tracing/anthropic-ai/streaming.js +3 -3
  26. package/build/cjs/tracing/anthropic-ai/streaming.js.map +1 -1
  27. package/build/cjs/tracing/anthropic-ai/utils.js +17 -6
  28. package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
  29. package/build/cjs/tracing/google-genai/index.js +12 -5
  30. package/build/cjs/tracing/google-genai/index.js.map +1 -1
  31. package/build/cjs/tracing/google-genai/streaming.js +2 -2
  32. package/build/cjs/tracing/google-genai/streaming.js.map +1 -1
  33. package/build/cjs/tracing/langchain/index.js +9 -9
  34. package/build/cjs/tracing/langchain/index.js.map +1 -1
  35. package/build/cjs/tracing/langchain/utils.js +40 -25
  36. package/build/cjs/tracing/langchain/utils.js.map +1 -1
  37. package/build/cjs/tracing/langgraph/index.js +14 -6
  38. package/build/cjs/tracing/langgraph/index.js.map +1 -1
  39. package/build/cjs/tracing/openai/index.js +52 -14
  40. package/build/cjs/tracing/openai/index.js.map +1 -1
  41. package/build/cjs/tracing/openai/streaming.js +2 -2
  42. package/build/cjs/tracing/openai/streaming.js.map +1 -1
  43. package/build/cjs/tracing/openai/utils.js +4 -3
  44. package/build/cjs/tracing/openai/utils.js.map +1 -1
  45. package/build/cjs/tracing/vercel-ai/constants.js +22 -0
  46. package/build/cjs/tracing/vercel-ai/constants.js.map +1 -1
  47. package/build/cjs/tracing/vercel-ai/index.js +41 -11
  48. package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
  49. package/build/cjs/tracing/vercel-ai/utils.js +19 -5
  50. package/build/cjs/tracing/vercel-ai/utils.js.map +1 -1
  51. package/build/cjs/trpc.js +3 -3
  52. package/build/cjs/trpc.js.map +1 -1
  53. package/build/cjs/utils/aggregate-errors.js +13 -5
  54. package/build/cjs/utils/aggregate-errors.js.map +1 -1
  55. package/build/cjs/utils/exports.js +7 -7
  56. package/build/cjs/utils/exports.js.map +1 -1
  57. package/build/cjs/utils/flushIfServerless.js +2 -2
  58. package/build/cjs/utils/flushIfServerless.js.map +1 -1
  59. package/build/cjs/utils/traceData.js +2 -2
  60. package/build/cjs/utils/traceData.js.map +1 -1
  61. package/build/cjs/utils/version.js +1 -1
  62. package/build/esm/exports.js +12 -3
  63. package/build/esm/exports.js.map +1 -1
  64. package/build/esm/feedback.js +1 -1
  65. package/build/esm/index.js +3 -2
  66. package/build/esm/index.js.map +1 -1
  67. package/build/esm/integrations/conversationId.js +35 -0
  68. package/build/esm/integrations/conversationId.js.map +1 -0
  69. package/build/esm/integrations/moduleMetadata.js +1 -1
  70. package/build/esm/integrations/third-party-errors-filter.js +1 -1
  71. package/build/esm/logs/internal.js +1 -1
  72. package/build/esm/package.json +1 -1
  73. package/build/esm/scope.js +20 -0
  74. package/build/esm/scope.js.map +1 -1
  75. package/build/esm/semanticAttributes.js +16 -1
  76. package/build/esm/semanticAttributes.js.map +1 -1
  77. package/build/esm/tracing/ai/gen-ai-attributes.js +43 -6
  78. package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
  79. package/build/esm/tracing/ai/messageTruncation.js +26 -45
  80. package/build/esm/tracing/ai/messageTruncation.js.map +1 -1
  81. package/build/esm/tracing/ai/utils.js +50 -4
  82. package/build/esm/tracing/ai/utils.js.map +1 -1
  83. package/build/esm/tracing/anthropic-ai/utils.js +17 -6
  84. package/build/esm/tracing/anthropic-ai/utils.js.map +1 -1
  85. package/build/esm/tracing/google-genai/index.js +11 -4
  86. package/build/esm/tracing/google-genai/index.js.map +1 -1
  87. package/build/esm/tracing/langchain/index.js +6 -6
  88. package/build/esm/tracing/langchain/index.js.map +1 -1
  89. package/build/esm/tracing/langchain/utils.js +41 -26
  90. package/build/esm/tracing/langchain/utils.js.map +1 -1
  91. package/build/esm/tracing/langgraph/index.js +12 -4
  92. package/build/esm/tracing/langgraph/index.js.map +1 -1
  93. package/build/esm/tracing/measurement.js +1 -1
  94. package/build/esm/tracing/openai/index.js +51 -13
  95. package/build/esm/tracing/openai/index.js.map +1 -1
  96. package/build/esm/tracing/openai/utils.js +4 -3
  97. package/build/esm/tracing/openai/utils.js.map +1 -1
  98. package/build/esm/tracing/trace.js +3 -3
  99. package/build/esm/tracing/vercel-ai/constants.js +20 -1
  100. package/build/esm/tracing/vercel-ai/constants.js.map +1 -1
  101. package/build/esm/tracing/vercel-ai/index.js +44 -14
  102. package/build/esm/tracing/vercel-ai/index.js.map +1 -1
  103. package/build/esm/tracing/vercel-ai/utils.js +21 -7
  104. package/build/esm/tracing/vercel-ai/utils.js.map +1 -1
  105. package/build/esm/utils/aggregate-errors.js +13 -5
  106. package/build/esm/utils/aggregate-errors.js.map +1 -1
  107. package/build/esm/utils/exports.js +7 -7
  108. package/build/esm/utils/exports.js.map +1 -1
  109. package/build/esm/utils/version.js +1 -1
  110. package/build/types/exports.d.ts +6 -0
  111. package/build/types/exports.d.ts.map +1 -1
  112. package/build/types/index.d.ts +2 -1
  113. package/build/types/index.d.ts.map +1 -1
  114. package/build/types/integrations/conversationId.d.ts +9 -0
  115. package/build/types/integrations/conversationId.d.ts.map +1 -0
  116. package/build/types/scope.d.ts +9 -0
  117. package/build/types/scope.d.ts.map +1 -1
  118. package/build/types/semanticAttributes.d.ts +13 -0
  119. package/build/types/semanticAttributes.d.ts.map +1 -1
  120. package/build/types/tracing/ai/gen-ai-attributes.d.ts +35 -5
  121. package/build/types/tracing/ai/gen-ai-attributes.d.ts.map +1 -1
  122. package/build/types/tracing/ai/messageTruncation.d.ts.map +1 -1
  123. package/build/types/tracing/ai/utils.d.ts +13 -1
  124. package/build/types/tracing/ai/utils.d.ts.map +1 -1
  125. package/build/types/tracing/anthropic-ai/utils.d.ts +1 -0
  126. package/build/types/tracing/anthropic-ai/utils.d.ts.map +1 -1
  127. package/build/types/tracing/google-genai/index.d.ts.map +1 -1
  128. package/build/types/tracing/langchain/index.d.ts.map +1 -1
  129. package/build/types/tracing/langchain/utils.d.ts +4 -2
  130. package/build/types/tracing/langchain/utils.d.ts.map +1 -1
  131. package/build/types/tracing/langgraph/index.d.ts.map +1 -1
  132. package/build/types/tracing/openai/index.d.ts.map +1 -1
  133. package/build/types/tracing/openai/utils.d.ts +2 -1
  134. package/build/types/tracing/openai/utils.d.ts.map +1 -1
  135. package/build/types/tracing/vercel-ai/constants.d.ts +3 -0
  136. package/build/types/tracing/vercel-ai/constants.d.ts.map +1 -1
  137. package/build/types/tracing/vercel-ai/index.d.ts.map +1 -1
  138. package/build/types/tracing/vercel-ai/utils.d.ts.map +1 -1
  139. package/build/types/types-hoist/clientreport.d.ts +1 -1
  140. package/build/types/types-hoist/clientreport.d.ts.map +1 -1
  141. package/build/types-ts3.8/exports.d.ts +6 -0
  142. package/build/types-ts3.8/index.d.ts +2 -1
  143. package/build/types-ts3.8/integrations/conversationId.d.ts +9 -0
  144. package/build/types-ts3.8/scope.d.ts +9 -0
  145. package/build/types-ts3.8/semanticAttributes.d.ts +13 -0
  146. package/build/types-ts3.8/tracing/ai/gen-ai-attributes.d.ts +35 -5
  147. package/build/types-ts3.8/tracing/ai/utils.d.ts +13 -1
  148. package/build/types-ts3.8/tracing/anthropic-ai/utils.d.ts +1 -0
  149. package/build/types-ts3.8/tracing/langchain/utils.d.ts +4 -2
  150. package/build/types-ts3.8/tracing/openai/utils.d.ts +2 -1
  151. package/build/types-ts3.8/tracing/vercel-ai/constants.d.ts +3 -0
  152. package/build/types-ts3.8/types-hoist/clientreport.d.ts +1 -1
  153. package/package.json +1 -1
@@ -103,6 +103,15 @@ function setUser(user) {
103
103
  currentScopes.getIsolationScope().setUser(user);
104
104
  }
105
105
 
106
+ /**
107
+ * Sets the conversation ID for the current isolation scope.
108
+ *
109
+ * @param conversationId The conversation ID to set. Pass `null` or `undefined` to unset the conversation ID.
110
+ */
111
+ function setConversationId(conversationId) {
112
+ currentScopes.getIsolationScope().setConversationId(conversationId);
113
+ }
114
+
106
115
  /**
107
116
  * The last error event id of the isolation scope.
108
117
  *
@@ -337,6 +346,7 @@ exports.isEnabled = isEnabled;
337
346
  exports.isInitialized = isInitialized;
338
347
  exports.lastEventId = lastEventId;
339
348
  exports.setContext = setContext;
349
+ exports.setConversationId = setConversationId;
340
350
  exports.setExtra = setExtra;
341
351
  exports.setExtras = setExtras;
342
352
  exports.setTag = setTag;
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sources":["../../src/exports.ts"],"sourcesContent":["import { getClient, getCurrentScope, getIsolationScope, withIsolationScope } from './currentScopes';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { CaptureContext } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\nimport { startNewTrace } from './tracing/trace';\nimport type { CheckIn, FinishedCheckIn, MonitorConfig } from './types-hoist/checkin';\nimport type { Event, EventHint } from './types-hoist/event';\nimport type { EventProcessor } from './types-hoist/eventprocessor';\nimport type { Extra, Extras } from './types-hoist/extra';\nimport type { Primitive } from './types-hoist/misc';\nimport type { Session, SessionContext } from './types-hoist/session';\nimport type { SeverityLevel } from './types-hoist/severity';\nimport type { User } from './types-hoist/user';\nimport { debug } from './utils/debug-logger';\nimport { isThenable } from './utils/is';\nimport { uuid4 } from './utils/misc';\nimport type { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent';\nimport { timestampInSeconds } from './utils/time';\nimport { GLOBAL_OBJ } from './utils/worldwide';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nexport function captureException(exception: unknown, hint?: ExclusiveEventHintOrCaptureContext): string {\n return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nexport function captureMessage(message: string, captureContext?: CaptureContext | SeverityLevel): string {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const hint = typeof captureContext !== 'string' ? { captureContext } : undefined;\n return getCurrentScope().captureMessage(message, level, hint);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nexport function captureEvent(event: Event, hint?: EventHint): string {\n return getCurrentScope().captureEvent(event, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\nexport function setContext(name: string, context: { [key: string]: unknown } | null): void {\n getIsolationScope().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: Extras): void {\n getIsolationScope().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nexport function setExtra(key: string, extra: Extra): void {\n getIsolationScope().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: Primitive }): void {\n getIsolationScope().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\nexport function setTag(key: string, value: Primitive): void {\n getIsolationScope().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): void {\n getIsolationScope().setUser(user);\n}\n\n/**\n * The last error event id of the isolation scope.\n *\n * Warning: This function really returns the last recorded error event id on the current\n * isolation scope. If you call this function after handling a certain error and another error\n * is captured in between, the last one is returned instead of the one you might expect.\n * Also, ids of events that were never sent to Sentry (for example because\n * they were dropped in `beforeSend`) could be returned.\n *\n * @returns The last event id of the isolation scope.\n */\nexport function lastEventId(): string | undefined {\n return getIsolationScope().lastEventId();\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && debug.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && debug.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param callback Callback to be monitored\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function withMonitor<T>(\n monitorSlug: CheckIn['monitorSlug'],\n callback: () => T,\n upsertMonitorConfig?: MonitorConfig,\n): T {\n function runCallback(): T {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status: FinishedCheckIn['status']): void {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n // Default behavior without isolateTrace\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n return maybePromiseResult.then(\n r => {\n finishCheckIn('ok');\n return r;\n },\n e => {\n finishCheckIn('error');\n throw e;\n },\n ) as T;\n }\n finishCheckIn('ok');\n\n return maybePromiseResult;\n }\n\n return withIsolationScope(() => (upsertMonitorConfig?.isolateTrace ? startNewTrace(runCallback) : runCallback()));\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise<boolean> {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && debug.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise<boolean> {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && debug.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Returns true if Sentry has been properly initialized.\n */\nexport function isInitialized(): boolean {\n return !!getClient();\n}\n\n/** If the SDK is initialized & enabled. */\nexport function isEnabled(): boolean {\n const client = getClient();\n return client?.getOptions().enabled !== false && !!client?.getTransport();\n}\n\n/**\n * Add an event processor.\n * This will be added to the current isolation scope, ensuring any event that is processed in the current execution\n * context will have the processor applied.\n */\nexport function addEventProcessor(callback: EventProcessor): void {\n getIsolationScope().addEventProcessor(callback);\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nexport function startSession(context?: SessionContext): Session {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n user: currentScope.getUser() || isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession?.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nexport function endSession(): void {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate(): void {\n const isolationScope = getIsolationScope();\n const client = getClient();\n const session = isolationScope.getSession();\n if (session && client) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nexport function captureSession(end: boolean = false): void {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n"],"names":["getCurrentScope","parseEventHintOrCaptureContext","getIsolationScope","getClient","DEBUG_BUILD","debug","uuid4","timestampInSeconds","isThenable","withIsolationScope","startNewTrace","GLOBAL_OBJ","session","makeSession","updateSession","closeSession"],"mappings":";;;;;;;;;;;;;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,SAAS,EAAW,IAAI,EAA+C;AACxG,EAAE,OAAOA,6BAAe,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAEC,2CAA8B,CAAC,IAAI,CAAC,CAAC;AAC5F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAU,cAAc,EAA2C;AACzG;AACA;AACA,EAAE,MAAM,KAAA,GAAQ,OAAO,cAAA,KAAmB,QAAA,GAAW,cAAA,GAAiB,SAAS;AAC/E,EAAE,MAAM,IAAA,GAAO,OAAO,cAAA,KAAmB,QAAA,GAAW,EAAE,cAAA,EAAe,GAAI,SAAS;AAClF,EAAE,OAAOD,6BAAe,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAS,IAAI,EAAsB;AACrE,EAAE,OAAOA,6BAAe,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAU,OAAO,EAA2C;AAC3F,EAAEE,+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,EAAE,MAAM,cAAA,GAAiBV,+BAAiB,EAAE;AAC5C,EAAE,MAAM,MAAA,GAASC,uBAAS,EAAE;AAC5B,EAAE,MAAM,OAAA,GAAU,cAAc,CAAC,UAAU,EAAE;AAC7C,EAAE,IAAI,OAAA,IAAW,MAAM,EAAE;AACzB,IAAI,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC;AAClC,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,GAAG,GAAY,KAAK,EAAQ;AAC3D;AACA,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,UAAU,EAAE;AAChB,IAAI;AACJ,EAAE;;AAEF;AACA,EAAE,kBAAkB,EAAE;AACtB;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"exports.js","sources":["../../src/exports.ts"],"sourcesContent":["import { getClient, getCurrentScope, getIsolationScope, withIsolationScope } from './currentScopes';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { CaptureContext } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\nimport { startNewTrace } from './tracing/trace';\nimport type { CheckIn, FinishedCheckIn, MonitorConfig } from './types-hoist/checkin';\nimport type { Event, EventHint } from './types-hoist/event';\nimport type { EventProcessor } from './types-hoist/eventprocessor';\nimport type { Extra, Extras } from './types-hoist/extra';\nimport type { Primitive } from './types-hoist/misc';\nimport type { Session, SessionContext } from './types-hoist/session';\nimport type { SeverityLevel } from './types-hoist/severity';\nimport type { User } from './types-hoist/user';\nimport { debug } from './utils/debug-logger';\nimport { isThenable } from './utils/is';\nimport { uuid4 } from './utils/misc';\nimport type { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent';\nimport { timestampInSeconds } from './utils/time';\nimport { GLOBAL_OBJ } from './utils/worldwide';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nexport function captureException(exception: unknown, hint?: ExclusiveEventHintOrCaptureContext): string {\n return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nexport function captureMessage(message: string, captureContext?: CaptureContext | SeverityLevel): string {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const hint = typeof captureContext !== 'string' ? { captureContext } : undefined;\n return getCurrentScope().captureMessage(message, level, hint);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nexport function captureEvent(event: Event, hint?: EventHint): string {\n return getCurrentScope().captureEvent(event, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\nexport function setContext(name: string, context: { [key: string]: unknown } | null): void {\n getIsolationScope().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: Extras): void {\n getIsolationScope().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nexport function setExtra(key: string, extra: Extra): void {\n getIsolationScope().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: Primitive }): void {\n getIsolationScope().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\nexport function setTag(key: string, value: Primitive): void {\n getIsolationScope().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): void {\n getIsolationScope().setUser(user);\n}\n\n/**\n * Sets the conversation ID for the current isolation scope.\n *\n * @param conversationId The conversation ID to set. Pass `null` or `undefined` to unset the conversation ID.\n */\nexport function setConversationId(conversationId: string | null | undefined): void {\n getIsolationScope().setConversationId(conversationId);\n}\n\n/**\n * The last error event id of the isolation scope.\n *\n * Warning: This function really returns the last recorded error event id on the current\n * isolation scope. If you call this function after handling a certain error and another error\n * is captured in between, the last one is returned instead of the one you might expect.\n * Also, ids of events that were never sent to Sentry (for example because\n * they were dropped in `beforeSend`) could be returned.\n *\n * @returns The last event id of the isolation scope.\n */\nexport function lastEventId(): string | undefined {\n return getIsolationScope().lastEventId();\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && debug.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && debug.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param callback Callback to be monitored\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function withMonitor<T>(\n monitorSlug: CheckIn['monitorSlug'],\n callback: () => T,\n upsertMonitorConfig?: MonitorConfig,\n): T {\n function runCallback(): T {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status: FinishedCheckIn['status']): void {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n // Default behavior without isolateTrace\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n return maybePromiseResult.then(\n r => {\n finishCheckIn('ok');\n return r;\n },\n e => {\n finishCheckIn('error');\n throw e;\n },\n ) as T;\n }\n finishCheckIn('ok');\n\n return maybePromiseResult;\n }\n\n return withIsolationScope(() => (upsertMonitorConfig?.isolateTrace ? startNewTrace(runCallback) : runCallback()));\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise<boolean> {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && debug.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise<boolean> {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && debug.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Returns true if Sentry has been properly initialized.\n */\nexport function isInitialized(): boolean {\n return !!getClient();\n}\n\n/** If the SDK is initialized & enabled. */\nexport function isEnabled(): boolean {\n const client = getClient();\n return client?.getOptions().enabled !== false && !!client?.getTransport();\n}\n\n/**\n * Add an event processor.\n * This will be added to the current isolation scope, ensuring any event that is processed in the current execution\n * context will have the processor applied.\n */\nexport function addEventProcessor(callback: EventProcessor): void {\n getIsolationScope().addEventProcessor(callback);\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nexport function startSession(context?: SessionContext): Session {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n user: currentScope.getUser() || isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession?.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nexport function endSession(): void {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate(): void {\n const isolationScope = getIsolationScope();\n const client = getClient();\n const session = isolationScope.getSession();\n if (session && client) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nexport function captureSession(end: boolean = false): void {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n"],"names":["getCurrentScope","parseEventHintOrCaptureContext","getIsolationScope","getClient","DEBUG_BUILD","debug","uuid4","timestampInSeconds","isThenable","withIsolationScope","startNewTrace","GLOBAL_OBJ","session","makeSession","updateSession","closeSession"],"mappings":";;;;;;;;;;;;;AAqBA;AACA;AACA;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G,GAAY,KAAK,EAAQ;AAC3D;AACA,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,UAAU,EAAE;AAChB,IAAI;AACJ,EAAE;;AAEF;AACA,EAAE,kBAAkB,EAAE;AACtB;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -12,11 +12,11 @@ const measurement = require('./tracing/measurement.js');
12
12
  const sampling = require('./tracing/sampling.js');
13
13
  const logSpans = require('./tracing/logSpans.js');
14
14
  const semanticAttributes = require('./semanticAttributes.js');
15
- const envelope = require('./envelope.js');
16
- const exports$1 = require('./exports.js');
15
+ const envelope$1 = require('./envelope.js');
16
+ const _exports = require('./exports.js');
17
17
  const currentScopes = require('./currentScopes.js');
18
18
  const defaultScopes = require('./defaultScopes.js');
19
- const index = require('./asyncContext/index.js');
19
+ const index$6 = require('./asyncContext/index.js');
20
20
  const carrier = require('./carrier.js');
21
21
  const session = require('./session.js');
22
22
  const scope = require('./scope.js');
@@ -46,7 +46,7 @@ const traceData = require('./utils/traceData.js');
46
46
  const meta = require('./utils/meta.js');
47
47
  const debounce = require('./utils/debounce.js');
48
48
  const request = require('./utils/request.js');
49
- const constants = require('./constants.js');
49
+ const constants$1 = require('./constants.js');
50
50
  const breadcrumbs = require('./breadcrumbs.js');
51
51
  const functiontostring = require('./integrations/functiontostring.js');
52
52
  const eventFilters = require('./integrations/eventFilters.js');
@@ -60,13 +60,14 @@ const rewriteframes = require('./integrations/rewriteframes.js');
60
60
  const supabase = require('./integrations/supabase.js');
61
61
  const zoderrors = require('./integrations/zoderrors.js');
62
62
  const thirdPartyErrorsFilter = require('./integrations/third-party-errors-filter.js');
63
- const console = require('./integrations/console.js');
63
+ const console$1 = require('./integrations/console.js');
64
64
  const featureFlagsIntegration = require('./integrations/featureFlags/featureFlagsIntegration.js');
65
65
  const growthbook = require('./integrations/featureFlags/growthbook.js');
66
+ const conversationId = require('./integrations/conversationId.js');
66
67
  const profiling = require('./profiling.js');
67
- const fetch = require('./fetch.js');
68
+ const fetch$1 = require('./fetch.js');
68
69
  const trpc = require('./trpc.js');
69
- const index$1 = require('./integrations/mcp-server/index.js');
70
+ const index$7 = require('./integrations/mcp-server/index.js');
70
71
  const feedback = require('./feedback.js');
71
72
  const internal = require('./logs/internal.js');
72
73
  const publicApi = require('./logs/public-api.js');
@@ -74,18 +75,18 @@ const consoleIntegration = require('./logs/console-integration.js');
74
75
  const internal$1 = require('./metrics/internal.js');
75
76
  const publicApi$1 = require('./metrics/public-api.js');
76
77
  const consola = require('./integrations/consola.js');
77
- const index$2 = require('./tracing/vercel-ai/index.js');
78
+ const index = require('./tracing/vercel-ai/index.js');
78
79
  const utils = require('./tracing/vercel-ai/utils.js');
79
- const index$3 = require('./tracing/openai/index.js');
80
- const constants$1 = require('./tracing/openai/constants.js');
81
- const index$4 = require('./tracing/anthropic-ai/index.js');
82
- const constants$2 = require('./tracing/anthropic-ai/constants.js');
83
- const index$5 = require('./tracing/google-genai/index.js');
84
- const constants$3 = require('./tracing/google-genai/constants.js');
85
- const index$6 = require('./tracing/langchain/index.js');
86
- const constants$4 = require('./tracing/langchain/constants.js');
87
- const index$7 = require('./tracing/langgraph/index.js');
88
- const constants$5 = require('./tracing/langgraph/constants.js');
80
+ const index$5 = require('./tracing/openai/index.js');
81
+ const constants$5 = require('./tracing/openai/constants.js');
82
+ const index$2 = require('./tracing/anthropic-ai/index.js');
83
+ const constants = require('./tracing/anthropic-ai/constants.js');
84
+ const index$3 = require('./tracing/google-genai/index.js');
85
+ const constants$2 = require('./tracing/google-genai/constants.js');
86
+ const index$1 = require('./tracing/langchain/index.js');
87
+ const constants$3 = require('./tracing/langchain/constants.js');
88
+ const index$4 = require('./tracing/langgraph/index.js');
89
+ const constants$4 = require('./tracing/langgraph/constants.js');
89
90
  const featureFlags = require('./utils/featureFlags.js');
90
91
  const aggregateErrors = require('./utils/aggregate-errors.js');
91
92
  const breadcrumbLogLevel = require('./utils/breadcrumb-log-level.js');
@@ -93,8 +94,8 @@ const browser = require('./utils/browser.js');
93
94
  const dsn = require('./utils/dsn.js');
94
95
  const error = require('./utils/error.js');
95
96
  const worldwide = require('./utils/worldwide.js');
96
- const console$1 = require('./instrument/console.js');
97
- const fetch$1 = require('./instrument/fetch.js');
97
+ const console = require('./instrument/console.js');
98
+ const fetch = require('./instrument/fetch.js');
98
99
  const globalError = require('./instrument/globalError.js');
99
100
  const globalUnhandledRejection = require('./instrument/globalUnhandledRejection.js');
100
101
  const handlers = require('./instrument/handlers.js');
@@ -108,7 +109,7 @@ const object = require('./utils/object.js');
108
109
  const path = require('./utils/path.js');
109
110
  const promisebuffer = require('./utils/promisebuffer.js');
110
111
  const severity = require('./utils/severity.js');
111
- const exports$2 = require('./utils/exports.js');
112
+ const _exports$1 = require('./utils/exports.js');
112
113
  const stacktrace = require('./utils/stacktrace.js');
113
114
  const nodeStackTrace = require('./utils/node-stack-trace.js');
114
115
  const string = require('./utils/string.js');
@@ -117,7 +118,7 @@ const syncpromise = require('./utils/syncpromise.js');
117
118
  const time = require('./utils/time.js');
118
119
  const tracing = require('./utils/tracing.js');
119
120
  const env = require('./utils/env.js');
120
- const envelope$1 = require('./utils/envelope.js');
121
+ const envelope = require('./utils/envelope.js');
121
122
  const clientreport = require('./utils/clientreport.js');
122
123
  const ratelimit = require('./utils/ratelimit.js');
123
124
  const baggage = require('./utils/baggage.js');
@@ -164,6 +165,7 @@ exports.timedEventsToMeasurements = measurement.timedEventsToMeasurements;
164
165
  exports.sampleSpan = sampling.sampleSpan;
165
166
  exports.logSpanEnd = logSpans.logSpanEnd;
166
167
  exports.logSpanStart = logSpans.logSpanStart;
168
+ exports.GEN_AI_CONVERSATION_ID_ATTRIBUTE = semanticAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE;
167
169
  exports.SEMANTIC_ATTRIBUTE_CACHE_HIT = semanticAttributes.SEMANTIC_ATTRIBUTE_CACHE_HIT;
168
170
  exports.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = semanticAttributes.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE;
169
171
  exports.SEMANTIC_ATTRIBUTE_CACHE_KEY = semanticAttributes.SEMANTIC_ATTRIBUTE_CACHE_KEY;
@@ -181,29 +183,30 @@ exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = semanticAttributes.SEMANTIC_ATTR
181
183
  exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE;
182
184
  exports.SEMANTIC_ATTRIBUTE_URL_FULL = semanticAttributes.SEMANTIC_ATTRIBUTE_URL_FULL;
183
185
  exports.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = semanticAttributes.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE;
184
- exports.createEventEnvelope = envelope.createEventEnvelope;
185
- exports.createSessionEnvelope = envelope.createSessionEnvelope;
186
- exports.createSpanEnvelope = envelope.createSpanEnvelope;
187
- exports.addEventProcessor = exports$1.addEventProcessor;
188
- exports.captureCheckIn = exports$1.captureCheckIn;
189
- exports.captureEvent = exports$1.captureEvent;
190
- exports.captureException = exports$1.captureException;
191
- exports.captureMessage = exports$1.captureMessage;
192
- exports.captureSession = exports$1.captureSession;
193
- exports.close = exports$1.close;
194
- exports.endSession = exports$1.endSession;
195
- exports.flush = exports$1.flush;
196
- exports.isEnabled = exports$1.isEnabled;
197
- exports.isInitialized = exports$1.isInitialized;
198
- exports.lastEventId = exports$1.lastEventId;
199
- exports.setContext = exports$1.setContext;
200
- exports.setExtra = exports$1.setExtra;
201
- exports.setExtras = exports$1.setExtras;
202
- exports.setTag = exports$1.setTag;
203
- exports.setTags = exports$1.setTags;
204
- exports.setUser = exports$1.setUser;
205
- exports.startSession = exports$1.startSession;
206
- exports.withMonitor = exports$1.withMonitor;
186
+ exports.createEventEnvelope = envelope$1.createEventEnvelope;
187
+ exports.createSessionEnvelope = envelope$1.createSessionEnvelope;
188
+ exports.createSpanEnvelope = envelope$1.createSpanEnvelope;
189
+ exports.addEventProcessor = _exports.addEventProcessor;
190
+ exports.captureCheckIn = _exports.captureCheckIn;
191
+ exports.captureEvent = _exports.captureEvent;
192
+ exports.captureException = _exports.captureException;
193
+ exports.captureMessage = _exports.captureMessage;
194
+ exports.captureSession = _exports.captureSession;
195
+ exports.close = _exports.close;
196
+ exports.endSession = _exports.endSession;
197
+ exports.flush = _exports.flush;
198
+ exports.isEnabled = _exports.isEnabled;
199
+ exports.isInitialized = _exports.isInitialized;
200
+ exports.lastEventId = _exports.lastEventId;
201
+ exports.setContext = _exports.setContext;
202
+ exports.setConversationId = _exports.setConversationId;
203
+ exports.setExtra = _exports.setExtra;
204
+ exports.setExtras = _exports.setExtras;
205
+ exports.setTag = _exports.setTag;
206
+ exports.setTags = _exports.setTags;
207
+ exports.setUser = _exports.setUser;
208
+ exports.startSession = _exports.startSession;
209
+ exports.withMonitor = _exports.withMonitor;
207
210
  exports.getClient = currentScopes.getClient;
208
211
  exports.getCurrentScope = currentScopes.getCurrentScope;
209
212
  exports.getGlobalScope = currentScopes.getGlobalScope;
@@ -213,7 +216,7 @@ exports.withIsolationScope = currentScopes.withIsolationScope;
213
216
  exports.withScope = currentScopes.withScope;
214
217
  exports.getDefaultCurrentScope = defaultScopes.getDefaultCurrentScope;
215
218
  exports.getDefaultIsolationScope = defaultScopes.getDefaultIsolationScope;
216
- exports.setAsyncContextStrategy = index.setAsyncContextStrategy;
219
+ exports.setAsyncContextStrategy = index$6.setAsyncContextStrategy;
217
220
  exports.getGlobalSingleton = carrier.getGlobalSingleton;
218
221
  exports.getMainCarrier = carrier.getMainCarrier;
219
222
  exports.closeSession = session.closeSession;
@@ -274,8 +277,8 @@ exports.httpHeadersToSpanAttributes = request.httpHeadersToSpanAttributes;
274
277
  exports.httpRequestToRequestData = request.httpRequestToRequestData;
275
278
  exports.winterCGHeadersToDict = request.winterCGHeadersToDict;
276
279
  exports.winterCGRequestToRequestData = request.winterCGRequestToRequestData;
277
- exports.DEFAULT_ENVIRONMENT = constants.DEFAULT_ENVIRONMENT;
278
- exports.DEV_ENVIRONMENT = constants.DEV_ENVIRONMENT;
280
+ exports.DEFAULT_ENVIRONMENT = constants$1.DEFAULT_ENVIRONMENT;
281
+ exports.DEV_ENVIRONMENT = constants$1.DEV_ENVIRONMENT;
279
282
  exports.addBreadcrumb = breadcrumbs.addBreadcrumb;
280
283
  exports.functionToStringIntegration = functiontostring.functionToStringIntegration;
281
284
  exports.eventFiltersIntegration = eventFilters.eventFiltersIntegration;
@@ -291,13 +294,14 @@ exports.instrumentSupabaseClient = supabase.instrumentSupabaseClient;
291
294
  exports.supabaseIntegration = supabase.supabaseIntegration;
292
295
  exports.zodErrorsIntegration = zoderrors.zodErrorsIntegration;
293
296
  exports.thirdPartyErrorFilterIntegration = thirdPartyErrorsFilter.thirdPartyErrorFilterIntegration;
294
- exports.consoleIntegration = console.consoleIntegration;
297
+ exports.consoleIntegration = console$1.consoleIntegration;
295
298
  exports.featureFlagsIntegration = featureFlagsIntegration.featureFlagsIntegration;
296
299
  exports.growthbookIntegration = growthbook.growthbookIntegration;
300
+ exports.conversationIdIntegration = conversationId.conversationIdIntegration;
297
301
  exports.profiler = profiling.profiler;
298
- exports.instrumentFetchRequest = fetch.instrumentFetchRequest;
302
+ exports.instrumentFetchRequest = fetch$1.instrumentFetchRequest;
299
303
  exports.trpcMiddleware = trpc.trpcMiddleware;
300
- exports.wrapMcpServerWithSentry = index$1.wrapMcpServerWithSentry;
304
+ exports.wrapMcpServerWithSentry = index$7.wrapMcpServerWithSentry;
301
305
  exports.captureFeedback = feedback.captureFeedback;
302
306
  exports._INTERNAL_captureLog = internal._INTERNAL_captureLog;
303
307
  exports._INTERNAL_captureSerializedLog = internal._INTERNAL_captureSerializedLog;
@@ -309,20 +313,20 @@ exports._INTERNAL_captureSerializedMetric = internal$1._INTERNAL_captureSerializ
309
313
  exports._INTERNAL_flushMetricsBuffer = internal$1._INTERNAL_flushMetricsBuffer;
310
314
  exports.metrics = publicApi$1;
311
315
  exports.createConsolaReporter = consola.createConsolaReporter;
312
- exports.addVercelAiProcessors = index$2.addVercelAiProcessors;
316
+ exports.addVercelAiProcessors = index.addVercelAiProcessors;
313
317
  exports._INTERNAL_cleanupToolCallSpan = utils._INTERNAL_cleanupToolCallSpan;
314
318
  exports._INTERNAL_getSpanForToolCallId = utils._INTERNAL_getSpanForToolCallId;
315
- exports.instrumentOpenAiClient = index$3.instrumentOpenAiClient;
316
- exports.OPENAI_INTEGRATION_NAME = constants$1.OPENAI_INTEGRATION_NAME;
317
- exports.instrumentAnthropicAiClient = index$4.instrumentAnthropicAiClient;
318
- exports.ANTHROPIC_AI_INTEGRATION_NAME = constants$2.ANTHROPIC_AI_INTEGRATION_NAME;
319
- exports.instrumentGoogleGenAIClient = index$5.instrumentGoogleGenAIClient;
320
- exports.GOOGLE_GENAI_INTEGRATION_NAME = constants$3.GOOGLE_GENAI_INTEGRATION_NAME;
321
- exports.createLangChainCallbackHandler = index$6.createLangChainCallbackHandler;
322
- exports.LANGCHAIN_INTEGRATION_NAME = constants$4.LANGCHAIN_INTEGRATION_NAME;
323
- exports.instrumentLangGraph = index$7.instrumentLangGraph;
324
- exports.instrumentStateGraphCompile = index$7.instrumentStateGraphCompile;
325
- exports.LANGGRAPH_INTEGRATION_NAME = constants$5.LANGGRAPH_INTEGRATION_NAME;
319
+ exports.instrumentOpenAiClient = index$5.instrumentOpenAiClient;
320
+ exports.OPENAI_INTEGRATION_NAME = constants$5.OPENAI_INTEGRATION_NAME;
321
+ exports.instrumentAnthropicAiClient = index$2.instrumentAnthropicAiClient;
322
+ exports.ANTHROPIC_AI_INTEGRATION_NAME = constants.ANTHROPIC_AI_INTEGRATION_NAME;
323
+ exports.instrumentGoogleGenAIClient = index$3.instrumentGoogleGenAIClient;
324
+ exports.GOOGLE_GENAI_INTEGRATION_NAME = constants$2.GOOGLE_GENAI_INTEGRATION_NAME;
325
+ exports.createLangChainCallbackHandler = index$1.createLangChainCallbackHandler;
326
+ exports.LANGCHAIN_INTEGRATION_NAME = constants$3.LANGCHAIN_INTEGRATION_NAME;
327
+ exports.instrumentLangGraph = index$4.instrumentLangGraph;
328
+ exports.instrumentStateGraphCompile = index$4.instrumentStateGraphCompile;
329
+ exports.LANGGRAPH_INTEGRATION_NAME = constants$4.LANGGRAPH_INTEGRATION_NAME;
326
330
  exports._INTERNAL_FLAG_BUFFER_SIZE = featureFlags._INTERNAL_FLAG_BUFFER_SIZE;
327
331
  exports._INTERNAL_MAX_FLAGS_PER_SPAN = featureFlags._INTERNAL_MAX_FLAGS_PER_SPAN;
328
332
  exports._INTERNAL_addFeatureFlagToActiveSpan = featureFlags._INTERNAL_addFeatureFlagToActiveSpan;
@@ -338,9 +342,9 @@ exports.dsnToString = dsn.dsnToString;
338
342
  exports.makeDsn = dsn.makeDsn;
339
343
  exports.SentryError = error.SentryError;
340
344
  exports.GLOBAL_OBJ = worldwide.GLOBAL_OBJ;
341
- exports.addConsoleInstrumentationHandler = console$1.addConsoleInstrumentationHandler;
342
- exports.addFetchEndInstrumentationHandler = fetch$1.addFetchEndInstrumentationHandler;
343
- exports.addFetchInstrumentationHandler = fetch$1.addFetchInstrumentationHandler;
345
+ exports.addConsoleInstrumentationHandler = console.addConsoleInstrumentationHandler;
346
+ exports.addFetchEndInstrumentationHandler = fetch.addFetchEndInstrumentationHandler;
347
+ exports.addFetchInstrumentationHandler = fetch.addFetchInstrumentationHandler;
344
348
  exports.addGlobalErrorInstrumentationHandler = globalError.addGlobalErrorInstrumentationHandler;
345
349
  exports.addGlobalUnhandledRejectionInstrumentationHandler = globalUnhandledRejection.addGlobalUnhandledRejectionInstrumentationHandler;
346
350
  exports.addHandler = handlers.addHandler;
@@ -397,7 +401,7 @@ exports.resolve = path.resolve;
397
401
  exports.SENTRY_BUFFER_FULL_ERROR = promisebuffer.SENTRY_BUFFER_FULL_ERROR;
398
402
  exports.makePromiseBuffer = promisebuffer.makePromiseBuffer;
399
403
  exports.severityLevelFromString = severity.severityLevelFromString;
400
- exports.replaceExports = exports$2.replaceExports;
404
+ exports.replaceExports = _exports$1.replaceExports;
401
405
  exports.UNKNOWN_FUNCTION = stacktrace.UNKNOWN_FUNCTION;
402
406
  exports.createStackParser = stacktrace.createStackParser;
403
407
  exports.getFramesFromEvent = stacktrace.getFramesFromEvent;
@@ -435,17 +439,17 @@ exports.propagationContextFromHeaders = tracing.propagationContextFromHeaders;
435
439
  exports.shouldContinueTrace = tracing.shouldContinueTrace;
436
440
  exports.getSDKSource = env.getSDKSource;
437
441
  exports.isBrowserBundle = env.isBrowserBundle;
438
- exports.addItemToEnvelope = envelope$1.addItemToEnvelope;
439
- exports.createAttachmentEnvelopeItem = envelope$1.createAttachmentEnvelopeItem;
440
- exports.createEnvelope = envelope$1.createEnvelope;
441
- exports.createEventEnvelopeHeaders = envelope$1.createEventEnvelopeHeaders;
442
- exports.createSpanEnvelopeItem = envelope$1.createSpanEnvelopeItem;
443
- exports.envelopeContainsItemType = envelope$1.envelopeContainsItemType;
444
- exports.envelopeItemTypeToDataCategory = envelope$1.envelopeItemTypeToDataCategory;
445
- exports.forEachEnvelopeItem = envelope$1.forEachEnvelopeItem;
446
- exports.getSdkMetadataForEnvelopeHeader = envelope$1.getSdkMetadataForEnvelopeHeader;
447
- exports.parseEnvelope = envelope$1.parseEnvelope;
448
- exports.serializeEnvelope = envelope$1.serializeEnvelope;
442
+ exports.addItemToEnvelope = envelope.addItemToEnvelope;
443
+ exports.createAttachmentEnvelopeItem = envelope.createAttachmentEnvelopeItem;
444
+ exports.createEnvelope = envelope.createEnvelope;
445
+ exports.createEventEnvelopeHeaders = envelope.createEventEnvelopeHeaders;
446
+ exports.createSpanEnvelopeItem = envelope.createSpanEnvelopeItem;
447
+ exports.envelopeContainsItemType = envelope.envelopeContainsItemType;
448
+ exports.envelopeItemTypeToDataCategory = envelope.envelopeItemTypeToDataCategory;
449
+ exports.forEachEnvelopeItem = envelope.forEachEnvelopeItem;
450
+ exports.getSdkMetadataForEnvelopeHeader = envelope.getSdkMetadataForEnvelopeHeader;
451
+ exports.parseEnvelope = envelope.parseEnvelope;
452
+ exports.serializeEnvelope = envelope.serializeEnvelope;
449
453
  exports.createClientReportEnvelope = clientreport.createClientReportEnvelope;
450
454
  exports.DEFAULT_RETRY_AFTER = ratelimit.DEFAULT_RETRY_AFTER;
451
455
  exports.disabledUntil = ratelimit.disabledUntil;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const currentScopes = require('../currentScopes.js');
4
- const exports$1 = require('../exports.js');
4
+ const _exports = require('../exports.js');
5
5
  const console = require('../instrument/console.js');
6
6
  const integration = require('../integration.js');
7
7
  const debugLogger = require('../utils/debug-logger.js');
@@ -81,7 +81,7 @@ function consoleHandler(args, level, handled) {
81
81
 
82
82
  const error = args.find(arg => arg instanceof Error);
83
83
  if (error) {
84
- exports$1.captureException(error, captureContext);
84
+ _exports.captureException(error, captureContext);
85
85
  return;
86
86
  }
87
87
 
@@ -1 +1 @@
1
- {"version":3,"file":"captureconsole.js","sources":["../../../src/integrations/captureconsole.ts"],"sourcesContent":["import { getClient, withScope } from '../currentScopes';\nimport { captureException } from '../exports';\nimport { addConsoleInstrumentationHandler } from '../instrument/console';\nimport { defineIntegration } from '../integration';\nimport type { CaptureContext } from '../scope';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport { CONSOLE_LEVELS } from '../utils/debug-logger';\nimport { addExceptionMechanism } from '../utils/misc';\nimport { severityLevelFromString } from '../utils/severity';\nimport { safeJoin } from '../utils/string';\nimport { GLOBAL_OBJ } from '../utils/worldwide';\n\ninterface CaptureConsoleOptions {\n levels?: string[];\n\n /**\n * By default, Sentry will mark captured console messages as handled.\n * Set this to `false` if you want to mark them as unhandled instead.\n *\n * @default true\n */\n handled?: boolean;\n}\n\nconst INTEGRATION_NAME = 'CaptureConsole';\n\nconst _captureConsoleIntegration = ((options: CaptureConsoleOptions = {}) => {\n const levels = options.levels || CONSOLE_LEVELS;\n const handled = options.handled ?? true;\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n addConsoleInstrumentationHandler(({ args, level }) => {\n if (getClient() !== client || !levels.includes(level)) {\n return;\n }\n\n consoleHandler(args, level, handled);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Send Console API calls as Sentry Events.\n */\nexport const captureConsoleIntegration = defineIntegration(_captureConsoleIntegration);\n\nfunction consoleHandler(args: unknown[], level: string, handled: boolean): void {\n const severityLevel = severityLevelFromString(level);\n\n /*\n We create this error here already to attach a stack trace to captured messages,\n if users set `attachStackTrace` to `true` in Sentry.init.\n We do this here already because we want to minimize the number of Sentry SDK stack frames\n within the error. Technically, Client.captureMessage will also do it but this happens several\n stack frames deeper.\n */\n const syntheticException = new Error();\n\n const captureContext: CaptureContext = {\n level: severityLevelFromString(level),\n extra: {\n arguments: args,\n },\n };\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n event.logger = 'console';\n\n addExceptionMechanism(event, {\n handled,\n type: 'auto.core.capture_console',\n });\n\n return event;\n });\n\n if (level === 'assert') {\n if (!args[0]) {\n const message = `Assertion failed: ${safeJoin(args.slice(1), ' ') || 'console.assert'}`;\n scope.setExtra('arguments', args.slice(1));\n scope.captureMessage(message, severityLevel, { captureContext, syntheticException });\n }\n return;\n }\n\n const error = args.find(arg => arg instanceof Error);\n if (error) {\n captureException(error, captureContext);\n return;\n }\n\n const message = safeJoin(args, ' ');\n scope.captureMessage(message, severityLevel, { captureContext, syntheticException });\n });\n}\n"],"names":["CONSOLE_LEVELS","GLOBAL_OBJ","addConsoleInstrumentationHandler","getClient","defineIntegration","severityLevelFromString","withScope","addExceptionMechanism","safeJoin","captureException"],"mappings":";;;;;;;;;;;;AAwBA,MAAM,gBAAA,GAAmB,gBAAgB;;AAEzC,MAAM,0BAAA,IAA8B,CAAC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;AACnC,QAAQ,OAAO;AACf,QAAQ,IAAI,EAAE,2BAA2B;AACzC,OAAO,CAAC;;AAER,MAAM,OAAO,KAAK;AAClB,IAAI,CAAC,CAAC;;AAEN,IAAI,IAAI,KAAA,KAAU,QAAQ,EAAE;AAC5B,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACpB,QAAQ,MAAM,UAAU,CAAC,kBAAkB,EAAEC,eAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC,CAAA;AACA,QAAA,KAAA,CAAA,QAAA,CAAA,WAAA,EAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,KAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,CAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;;AAEA,IAAA,MAAA,KAAA,GAAA,IAAA,CAAA,IAAA,CAAA,GAAA,IAAA,GAAA,YAAA,KAAA,CAAA;AACA,IAAA,IAAA,KAAA,EAAA;AACA,MAAAC,0BAAA,CAAA,KAAA,EAAA,cAAA,CAAA;AACA,MAAA;AACA,IAAA;;AAEA,IAAA,MAAA,OAAA,GAAAD,eAAA,CAAA,IAAA,EAAA,GAAA,CAAA;AACA,IAAA,KAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,CAAA;AACA,EAAA,CAAA,CAAA;AACA;;;;"}
1
+ {"version":3,"file":"captureconsole.js","sources":["../../../src/integrations/captureconsole.ts"],"sourcesContent":["import { getClient, withScope } from '../currentScopes';\nimport { captureException } from '../exports';\nimport { addConsoleInstrumentationHandler } from '../instrument/console';\nimport { defineIntegration } from '../integration';\nimport type { CaptureContext } from '../scope';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport { CONSOLE_LEVELS } from '../utils/debug-logger';\nimport { addExceptionMechanism } from '../utils/misc';\nimport { severityLevelFromString } from '../utils/severity';\nimport { safeJoin } from '../utils/string';\nimport { GLOBAL_OBJ } from '../utils/worldwide';\n\ninterface CaptureConsoleOptions {\n levels?: string[];\n\n /**\n * By default, Sentry will mark captured console messages as handled.\n * Set this to `false` if you want to mark them as unhandled instead.\n *\n * @default true\n */\n handled?: boolean;\n}\n\nconst INTEGRATION_NAME = 'CaptureConsole';\n\nconst _captureConsoleIntegration = ((options: CaptureConsoleOptions = {}) => {\n const levels = options.levels || CONSOLE_LEVELS;\n const handled = options.handled ?? true;\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n addConsoleInstrumentationHandler(({ args, level }) => {\n if (getClient() !== client || !levels.includes(level)) {\n return;\n }\n\n consoleHandler(args, level, handled);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Send Console API calls as Sentry Events.\n */\nexport const captureConsoleIntegration = defineIntegration(_captureConsoleIntegration);\n\nfunction consoleHandler(args: unknown[], level: string, handled: boolean): void {\n const severityLevel = severityLevelFromString(level);\n\n /*\n We create this error here already to attach a stack trace to captured messages,\n if users set `attachStackTrace` to `true` in Sentry.init.\n We do this here already because we want to minimize the number of Sentry SDK stack frames\n within the error. Technically, Client.captureMessage will also do it but this happens several\n stack frames deeper.\n */\n const syntheticException = new Error();\n\n const captureContext: CaptureContext = {\n level: severityLevelFromString(level),\n extra: {\n arguments: args,\n },\n };\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n event.logger = 'console';\n\n addExceptionMechanism(event, {\n handled,\n type: 'auto.core.capture_console',\n });\n\n return event;\n });\n\n if (level === 'assert') {\n if (!args[0]) {\n const message = `Assertion failed: ${safeJoin(args.slice(1), ' ') || 'console.assert'}`;\n scope.setExtra('arguments', args.slice(1));\n scope.captureMessage(message, severityLevel, { captureContext, syntheticException });\n }\n return;\n }\n\n const error = args.find(arg => arg instanceof Error);\n if (error) {\n captureException(error, captureContext);\n return;\n }\n\n const message = safeJoin(args, ' ');\n scope.captureMessage(message, severityLevel, { captureContext, syntheticException });\n });\n}\n"],"names":["CONSOLE_LEVELS","GLOBAL_OBJ","addConsoleInstrumentationHandler","getClient","defineIntegration","severityLevelFromString","withScope","addExceptionMechanism","safeJoin","captureException"],"mappings":";;;;;;;;;;;;AAwBA,MAAM,gBAAA,GAAmB,gBAAgB;;AAEzC,MAAM,0BAAA,IAA8B,CAAC,OAAO,GAA0B,EAAE,KAAK;AAC7E,EAAE,MAAM,MAAA,GAAS,OAAO,CAAC,MAAA,IAAUA,0BAAc;AACjD,EAAE,MAAM,OAAA,GAAU,OAAO,CAAC,OAAA,IAAW,IAAI;;AAEzC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,IAAI,EAAE,aAAaC,oBAAU,CAAC,EAAE;AACtC,QAAQ;AACR,MAAM;;AAEN,MAAMC,wCAAgC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAA,EAAO,KAAK;AAC5D,QAAQ,IAAIC,uBAAS,OAAO,MAAA,IAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC/D,UAAU;AACV,QAAQ;;AAER,QAAQ,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC;AAC5C,MAAM,CAAC,CAAC;AACR,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;MACa,yBAAA,GAA4BC,6BAAiB,CAAC,0BAA0B;;AAErF,SAAS,cAAc,CAAC,IAAI,EAAa,KAAK,EAAU,OAAO,EAAiB;AAChF,EAAE,MAAM,aAAA,GAAgBC,gCAAuB,CAAC,KAAK,CAAC;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,kBAAA,GAAqB,IAAI,KAAK,EAAE;;AAExC,EAAE,MAAM,cAAc,GAAmB;AACzC,IAAI,KAAK,EAA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"}
@@ -0,0 +1,37 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const currentScopes = require('../currentScopes.js');
4
+ const integration = require('../integration.js');
5
+ const semanticAttributes = require('../semanticAttributes.js');
6
+
7
+ const INTEGRATION_NAME = 'ConversationId';
8
+
9
+ const _conversationIdIntegration = (() => {
10
+ return {
11
+ name: INTEGRATION_NAME,
12
+ setup(client) {
13
+ client.on('spanStart', (span) => {
14
+ const scopeData = currentScopes.getCurrentScope().getScopeData();
15
+ const isolationScopeData = currentScopes.getIsolationScope().getScopeData();
16
+
17
+ const conversationId = scopeData.conversationId || isolationScopeData.conversationId;
18
+
19
+ if (conversationId) {
20
+ span.setAttribute(semanticAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE, conversationId);
21
+ }
22
+ });
23
+ },
24
+ };
25
+ }) ;
26
+
27
+ /**
28
+ * Automatically applies conversation ID from scope to spans.
29
+ *
30
+ * This integration reads the conversation ID from the current or isolation scope
31
+ * and applies it to spans when they start. This ensures the conversation ID is
32
+ * available for all AI-related operations.
33
+ */
34
+ const conversationIdIntegration = integration.defineIntegration(_conversationIdIntegration);
35
+
36
+ exports.conversationIdIntegration = conversationIdIntegration;
37
+ //# sourceMappingURL=conversationId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversationId.js","sources":["../../../src/integrations/conversationId.ts"],"sourcesContent":["import type { Client } from '../client';\nimport { getCurrentScope, getIsolationScope } from '../currentScopes';\nimport { defineIntegration } from '../integration';\nimport { GEN_AI_CONVERSATION_ID_ATTRIBUTE } from '../semanticAttributes';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport type { Span } from '../types-hoist/span';\n\nconst INTEGRATION_NAME = 'ConversationId';\n\nconst _conversationIdIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setup(client: Client) {\n client.on('spanStart', (span: Span) => {\n const scopeData = getCurrentScope().getScopeData();\n const isolationScopeData = getIsolationScope().getScopeData();\n\n const conversationId = scopeData.conversationId || isolationScopeData.conversationId;\n\n if (conversationId) {\n span.setAttribute(GEN_AI_CONVERSATION_ID_ATTRIBUTE, conversationId);\n }\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Automatically applies conversation ID from scope to spans.\n *\n * This integration reads the conversation ID from the current or isolation scope\n * and applies it to spans when they start. This ensures the conversation ID is\n * available for all AI-related operations.\n */\nexport const conversationIdIntegration = defineIntegration(_conversationIdIntegration);\n"],"names":["getCurrentScope","getIsolationScope","GEN_AI_CONVERSATION_ID_ATTRIBUTE","defineIntegration"],"mappings":";;;;;;AAOA,MAAM,gBAAA,GAAmB,gBAAgB;;AAEzC,MAAM,0BAAA,IAA8B,MAAM;AAC1C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAU;AAC1B,MAAM,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,KAAW;AAC7C,QAAQ,MAAM,YAAYA,6BAAe,EAAE,CAAC,YAAY,EAAE;AAC1D,QAAQ,MAAM,qBAAqBC,+BAAiB,EAAE,CAAC,YAAY,EAAE;;AAErE,QAAQ,MAAM,iBAAiB,SAAS,CAAC,cAAA,IAAkB,kBAAkB,CAAC,cAAc;;AAE5F,QAAQ,IAAI,cAAc,EAAE;AAC5B,UAAU,IAAI,CAAC,YAAY,CAACC,mDAAgC,EAAE,cAAc,CAAC;AAC7E,QAAQ;AACR,MAAM,CAAC,CAAC;AACR,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;MACa,yBAAA,GAA4BC,6BAAiB,CAAC,0BAA0B;;;;"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const currentScopes = require('../../currentScopes.js');
4
- const exports$1 = require('../../exports.js');
4
+ const _exports = require('../../exports.js');
5
5
  const spanUtils = require('../../utils/spanUtils.js');
6
6
  const spanstatus = require('../../tracing/spanstatus.js');
7
7
 
@@ -36,7 +36,7 @@ function captureError(error, errorType, extraData) {
36
36
  });
37
37
  }
38
38
 
39
- exports$1.captureException(error, {
39
+ _exports.captureException(error, {
40
40
  mechanism: {
41
41
  type: 'auto.ai.mcp_server',
42
42
  handled: false,
@@ -1 +1 @@
1
- {"version":3,"file":"errorCapture.js","sources":["../../../../src/integrations/mcp-server/errorCapture.ts"],"sourcesContent":["/**\n * Safe error capture utilities for MCP server instrumentation\n *\n * Ensures error reporting never interferes with MCP server operation.\n * All capture operations are wrapped in try-catch to prevent side effects.\n */\n\nimport { getClient } from '../../currentScopes';\nimport { captureException } from '../../exports';\nimport { SPAN_STATUS_ERROR } from '../../tracing';\nimport { getActiveSpan } from '../../utils/spanUtils';\nimport type { McpErrorType } from './types';\n\n/**\n * Captures an error without affecting MCP server operation.\n *\n * The active span already contains all MCP context (method, tool, arguments, etc.)\n * @param error - Error to capture\n * @param errorType - Classification of error type for filtering\n * @param extraData - Additional context data to include\n */\nexport function captureError(error: Error, errorType?: McpErrorType, extraData?: Record<string, unknown>): void {\n try {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (activeSpan?.isRecording()) {\n activeSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: 'internal_error',\n });\n }\n\n captureException(error, {\n mechanism: {\n type: 'auto.ai.mcp_server',\n handled: false,\n data: {\n error_type: errorType || 'handler_execution',\n ...extraData,\n },\n },\n });\n } catch {\n // noop\n }\n}\n"],"names":["getClient","getActiveSpan","SPAN_STATUS_ERROR","captureException"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAS,SAAS,EAAiB,SAAS,EAAkC;AAChH,EAAE,IAAI;AACN,IAAI,MAAM,MAAA,GAASA,uBAAS,EAAE;AAC9B,IAAI,IAAI,CAAC,MAAM,EAAE;AACjB,MAAM;AACN,IAAI;;AAEJ,IAAI,MAAM,UAAA,GAAaC,uBAAa,EAAE;AACtC,IAAI,IAAI,UAAU,EAAE,WAAW,EAAE,EAAE;AACnC,MAAM,UAAU,CAAC,SAAS,CAAC;AAC3B,QAAQ,IAAI,EAAEC,4BAAiB;AAC/B,QAAQ,OAAO,EAAE,gBAAgB;AACjC,OAAO,CAAC;AACR,IAAI;;AAEJ,IAAIC,0BAAgB,CAAC,KAAK,EAAE;AAC5B,MAAM,SAAS,EAAE;AACjB,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,IAAI,EAAE;AACd,UAAU,UAAU,EAAE,SAAA,IAAa,mBAAmB;AACtD,UAAU,GAAG,SAAS;AACtB,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,EAAE,EAAE,MAAM;AACV;AACA,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"errorCapture.js","sources":["../../../../src/integrations/mcp-server/errorCapture.ts"],"sourcesContent":["/**\n * Safe error capture utilities for MCP server instrumentation\n *\n * Ensures error reporting never interferes with MCP server operation.\n * All capture operations are wrapped in try-catch to prevent side effects.\n */\n\nimport { getClient } from '../../currentScopes';\nimport { captureException } from '../../exports';\nimport { SPAN_STATUS_ERROR } from '../../tracing';\nimport { getActiveSpan } from '../../utils/spanUtils';\nimport type { McpErrorType } from './types';\n\n/**\n * Captures an error without affecting MCP server operation.\n *\n * The active span already contains all MCP context (method, tool, arguments, etc.)\n * @param error - Error to capture\n * @param errorType - Classification of error type for filtering\n * @param extraData - Additional context data to include\n */\nexport function captureError(error: Error, errorType?: McpErrorType, extraData?: Record<string, unknown>): void {\n try {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (activeSpan?.isRecording()) {\n activeSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: 'internal_error',\n });\n }\n\n captureException(error, {\n mechanism: {\n type: 'auto.ai.mcp_server',\n handled: false,\n data: {\n error_type: errorType || 'handler_execution',\n ...extraData,\n },\n },\n });\n } catch {\n // noop\n }\n}\n"],"names":["getClient","getActiveSpan","SPAN_STATUS_ERROR","captureException"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAS,SAAS,EAAiB,SAAS,EAAkC;AAChH,EAAE,IAAI;AACN,IAAI,MAAM,MAAA,GAASA,uBAAS,EAAE;AAC9B,IAAI,IAAI,CAAC,MAAM,EAAE;AACjB,MAAM;AACN,IAAI;;AAEJ,IAAI,MAAM,UAAA,GAAaC,uBAAa,EAAE;AACtC,IAAI,IAAI,UAAU,EAAE,WAAW,EAAE,EAAE;AACnC,MAAM,UAAU,CAAC,SAAS,CAAC;AAC3B,QAAQ,IAAI,EAAEC,4BAAiB;AAC/B,QAAQ,OAAO,EAAE,gBAAgB;AACjC,OAAO,CAAC;AACR,IAAI;;AAEJ,IAAIC,yBAAgB,CAAC,KAAK,EAAE;AAC5B,MAAM,SAAS,EAAE;AACjB,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,IAAI,EAAE;AACd,UAAU,UAAU,EAAE,SAAA,IAAa,mBAAmB;AACtD,UAAU,GAAG,SAAS;AACtB,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,EAAE,EAAE,MAAM;AACV;AACA,EAAE;AACF;;;;"}
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const breadcrumbs = require('../breadcrumbs.js');
4
4
  const debugBuild = require('../debug-build.js');
5
- const exports$1 = require('../exports.js');
5
+ const _exports = require('../exports.js');
6
6
  const integration = require('../integration.js');
7
7
  const semanticAttributes = require('../semanticAttributes.js');
8
8
  const debugLogger = require('../utils/debug-logger.js');
@@ -172,7 +172,7 @@ function instrumentAuthOperation(operation, isAdmin = false) {
172
172
  if (res && typeof res === 'object' && 'error' in res && res.error) {
173
173
  span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR });
174
174
 
175
- exports$1.captureException(res.error, {
175
+ _exports.captureException(res.error, {
176
176
  mechanism: {
177
177
  handled: false,
178
178
  type: 'auto.db.supabase.auth',
@@ -189,7 +189,7 @@ function instrumentAuthOperation(operation, isAdmin = false) {
189
189
  span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR });
190
190
  span.end();
191
191
 
192
- exports$1.captureException(err, {
192
+ _exports.captureException(err, {
193
193
  mechanism: {
194
194
  handled: false,
195
195
  type: 'auto.db.supabase.auth',
@@ -357,7 +357,7 @@ function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder) {
357
357
  supabaseContext.body = body;
358
358
  }
359
359
 
360
- exports$1.captureException(err, scope => {
360
+ _exports.captureException(err, scope => {
361
361
  scope.addEventProcessor(e => {
362
362
  misc.addExceptionMechanism(e, {
363
363
  handled: false,