@od-oneapp/observability 2026.2.1701 → 2026.2.2001-canary.1

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 (66) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/README.md +6 -6
  3. package/client-next.d.mts +6 -6
  4. package/client-next.mjs +4 -4
  5. package/client.d.mts +3 -3
  6. package/client.mjs +1 -1
  7. package/client.mjs.map +1 -1
  8. package/core-BgKCqXjb.mjs +95 -0
  9. package/core-BgKCqXjb.mjs.map +1 -0
  10. package/env.mjs +1 -1
  11. package/env.mjs.map +1 -1
  12. package/{factory-DkY353r8.mjs → factory-d1469fpz.mjs} +2 -2
  13. package/factory-d1469fpz.mjs.map +1 -0
  14. package/hooks-useObservability.d.mts +1 -1
  15. package/hooks-useObservability.mjs +1 -1
  16. package/hooks-useObservability.mjs.map +1 -1
  17. package/{index-CpcdzWrF.d.mts → index-CktVJJqJ.d.mts} +3 -3
  18. package/{index-CpcdzWrF.d.mts.map → index-CktVJJqJ.d.mts.map} +1 -1
  19. package/index.mjs +1 -1
  20. package/index.mjs.map +1 -1
  21. package/logs-DkncIKEw.mjs +112 -0
  22. package/logs-DkncIKEw.mjs.map +1 -0
  23. package/{manager-BxQqOPEg.d.mts → manager-CONEYB97.d.mts} +2 -2
  24. package/{manager-BxQqOPEg.d.mts.map → manager-CONEYB97.d.mts.map} +1 -1
  25. package/package.json +33 -40
  26. package/{plugin-Bt-ygG1m.d.mts → plugin-81171XQL.d.mts} +4 -4
  27. package/{plugin-Bt-ygG1m.d.mts.map → plugin-81171XQL.d.mts.map} +1 -1
  28. package/{plugin-CaQxviDs.d.mts → plugin-CEOGIJFN.d.mts} +2 -2
  29. package/{plugin-CaQxviDs.d.mts.map → plugin-CEOGIJFN.d.mts.map} +1 -1
  30. package/plugin-CuRZ8qQf.mjs +593 -0
  31. package/plugin-CuRZ8qQf.mjs.map +1 -0
  32. package/{plugin-CP895lBx.mjs → plugin-DApSl5bY.mjs} +2 -2
  33. package/plugin-DApSl5bY.mjs.map +1 -0
  34. package/{plugin-lPdJirTY.mjs → plugin-LhaOv4eq.mjs} +2 -2
  35. package/plugin-LhaOv4eq.mjs.map +1 -0
  36. package/{plugin-Bfq-o3nr.d.mts → plugin-pvH_kv0a.d.mts} +1 -1
  37. package/{plugin-Bfq-o3nr.d.mts.map → plugin-pvH_kv0a.d.mts.map} +1 -1
  38. package/plugins-betterstack-env.mjs +1 -1
  39. package/plugins-betterstack-env.mjs.map +1 -1
  40. package/plugins-betterstack.d.mts +2 -2
  41. package/plugins-betterstack.mjs +1 -1
  42. package/plugins-console.d.mts +1 -1
  43. package/plugins-sentry-env.d.mts +4 -4
  44. package/plugins-sentry-env.mjs +1 -1
  45. package/plugins-sentry-env.mjs.map +1 -1
  46. package/plugins-sentry-microfrontend-env.mjs +1 -1
  47. package/plugins-sentry-microfrontend-env.mjs.map +1 -1
  48. package/plugins-sentry-microfrontend.d.mts +1 -1
  49. package/plugins-sentry-microfrontend.mjs +1 -1
  50. package/plugins-sentry.d.mts +2 -2
  51. package/plugins-sentry.mjs +1 -1
  52. package/server-edge.d.mts +4 -4
  53. package/server-edge.mjs +2 -2
  54. package/server-next.d.mts +6 -6
  55. package/server-next.mjs +4 -4
  56. package/server.d.mts +3 -3
  57. package/server.mjs +1 -1
  58. package/server.mjs.map +1 -1
  59. package/{utils-DjjqCeoW.d.mts → utils-6Gg4fkvH.d.mts} +4 -3
  60. package/utils-6Gg4fkvH.d.mts.map +1 -0
  61. package/factory-DkY353r8.mjs.map +0 -1
  62. package/plugin-CP895lBx.mjs.map +0 -1
  63. package/plugin-CxeJHHeJ.mjs +0 -1195
  64. package/plugin-CxeJHHeJ.mjs.map +0 -1
  65. package/plugin-lPdJirTY.mjs.map +0 -1
  66. package/utils-DjjqCeoW.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-CuRZ8qQf.mjs","names":[],"sources":["../src/plugins/sentry-microfrontend/multiplexed-transport.ts","../src/plugins/sentry-microfrontend/sentry-types.ts","../src/plugins/sentry-microfrontend/utils.ts","../src/plugins/sentry-microfrontend/plugin.ts"],"sourcesContent":["/**\n * @fileoverview Multiplexed transport utilities for Sentry Micro Frontend Plugin\n * Multiplexed transport utilities for Sentry Micro Frontend Plugin\n */\n\nimport { logWarn } from '@od-oneapp/shared/logs';\n\nimport type { BackstageAppConfig } from './types';\n\n/**\n * Create a multiplexed transport that routes events to different Sentry projects.\n *\n * Creates a Sentry transport that routes events to different DSNs based on the\n * backstageApp information in the event. Supports edge runtime environments.\n *\n * @param backstage - Array of backstage app configurations with DSNs\n * @param fallbackDsn - Optional fallback DSN if no backstageApp match is found\n * @param sentryClient - Optional Sentry client instance (defaults to global Sentry)\n * @returns Multiplexed transport instance, or undefined if Sentry is not available\n */\n\nexport function createMultiplexedTransport(\n backstage: BackstageAppConfig[],\n fallbackDsn?: string,\n\n sentryClient?: any,\n): any {\n // Import Sentry dynamically or use provided client (edge runtime compatible)\n const Sentry =\n sentryClient !== undefined\n ? sentryClient\n : typeof globalThis !== 'undefined'\n ? (globalThis as any).Sentry\n : null;\n\n if (!Sentry?.makeMultiplexedTransport || !Sentry.makeFetchTransport) {\n logWarn('Sentry multiplexed transport not available');\n return undefined;\n }\n\n return Sentry.makeMultiplexedTransport(Sentry.makeFetchTransport, (args: any) => {\n const event = args.getEvent();\n\n if (!event) {\n return [];\n }\n\n // Extract backstageApp information from various sources\n const backstageApp =\n event.tags?.backstageApp ??\n event.extra?.backstageApp ??\n event.contexts?.microFrontend?.backstageApp;\n\n if (backstageApp) {\n // Find backstageApp configuration\n const backstageAppConfig = backstage.find(z => z.name === backstageApp);\n\n if (backstageAppConfig?.dsn) {\n // Route to backstageApp-specific DSN\n\n const envelope: any[] = [\n {\n dsn: backstageAppConfig.dsn,\n release: backstageAppConfig.release ?? event.release,\n },\n ];\n\n // Add backstageApp-specific tags if configured\n if (backstageAppConfig.tags && event.tags) {\n Object.assign(event.tags, backstageAppConfig.tags);\n }\n\n return envelope;\n }\n }\n\n // Use fallback DSN if provided\n if (fallbackDsn) {\n return [{ dsn: fallbackDsn }];\n }\n\n // Let the default DSN handle it\n return [];\n });\n}\n\n/**\n * Create a transport matcher function for more complex routing logic.\n *\n * Creates a matcher function that can be used with Sentry's multiplexed transport\n * to route events based on custom logic, including stack frame analysis.\n *\n * @param backstage - Array of backstage app configurations\n * @param customMatcher - Optional custom matcher function to extract backstageApp from event\n * @returns Matcher function that returns an array of transport configurations\n */\nexport function createTransportMatcher(\n backstage: BackstageAppConfig[],\n\n customMatcher?: (event: any) => string | undefined,\n): (args: any) => any[] {\n return (args: any) => {\n const event = args.getEvent();\n\n if (!event) {\n return [];\n }\n\n // Use custom matcher if provided\n let backstageApp: string | undefined;\n if (customMatcher) {\n backstageApp = customMatcher(event);\n }\n\n // Fall back to default backstageApp detection\n backstageApp ??=\n event.tags?.backstageApp ??\n event.extra?.backstageApp ??\n event.contexts?.microFrontend?.backstageApp;\n\n // Try to detect backstageApp from stack frames\n if (!backstageApp && event.exception?.values?.[0]?.stacktrace?.frames) {\n const { frames } = event.exception.values[0].stacktrace;\n for (const frame of frames) {\n if (frame.filename) {\n // Check if filename contains backstageApp hints\n if (frame.filename.includes('/cms/')) {\n backstageApp = 'cms';\n break;\n } else if (frame.filename.includes('/workflows/')) {\n backstageApp = 'workflows';\n break;\n } else if (frame.filename.includes('/authmgmt/')) {\n backstageApp = 'authmgmt';\n break;\n }\n }\n }\n }\n\n if (backstageApp) {\n const backstageAppConfig = backstage.find(z => z.name === backstageApp);\n if (backstageAppConfig?.dsn) {\n return [\n {\n dsn: backstageAppConfig.dsn,\n release: backstageAppConfig.release,\n },\n ];\n }\n }\n\n return [];\n };\n}\n\n/**\n * Enhance an event with Backstage app information before sending.\n *\n * Adds backstageApp tags, context, and extra data to a Sentry event.\n * This ensures events are properly tagged for micro frontend routing.\n *\n * @param event - Sentry event to enhance\n * @param backstageApp - Name of the backstage app\n * @param additionalContext - Optional additional context to add\n * @returns Enhanced event with backstageApp information\n */\n\nexport function enhanceEventWithBackstageApp(\n event: any,\n backstageApp: string,\n\n additionalContext?: Record<string, any>,\n): any {\n // Add backstageApp tag\n event.tags ??= {};\n event.tags.backstageApp = backstageApp;\n event.tags.microFrontend = true;\n\n // Add backstageApp context\n event.contexts ??= {};\n event.contexts.microFrontend = {\n backstageApp,\n timestamp: new Date().toISOString(),\n ...additionalContext,\n };\n\n // Add backstageApp to extra for backward compatibility\n event.extra ??= {};\n event.extra.backstageApp = backstageApp;\n\n return event;\n}\n\n/**\n * Create a beforeSend hook that adds backstageApp information.\n *\n * Creates a Sentry beforeSend hook that enhances events with backstageApp information\n * before they are sent. Can wrap an existing beforeSend hook.\n *\n * @param backstageApp - Name of the backstage app\n * @param originalBeforeSend - Optional original beforeSend hook to wrap\n * @returns beforeSend hook function\n */\nexport function createBackstageBeforeSend(\n backstageApp: string,\n\n originalBeforeSend?: (event: any, hint: any) => any,\n): (event: any, hint: any) => any {\n return (event: any, hint: any) => {\n // Enhance with backstageApp information\n enhanceEventWithBackstageApp(event, backstageApp);\n\n // Call original beforeSend if provided\n if (originalBeforeSend) {\n return originalBeforeSend(event, hint);\n }\n\n return event;\n };\n}\n","/**\n * @fileoverview Type definitions for Sentry SDK\n * Type definitions for Sentry SDK\n * These are minimal types to avoid using 'any' throughout the plugin\n */\n\nimport type { LogLevel } from '../../core/types';\n\n/**\n * Sentry Scope interface\n */\nexport interface SentryScope {\n setTag(key: string, value: string | number | boolean | null): void;\n setContext(key: string, context: Record<string, any> | null): void;\n setUser(user: Record<string, any> | null): void;\n setLevel(level: SentrySeverityLevel): void;\n setFingerprint(fingerprint: string[]): void;\n clear(): void;\n}\n\n/**\n * Sentry Hub interface\n */\nexport interface SentryHub {\n getScope(): SentryScope;\n pushScope(): SentryScope;\n popScope(): boolean;\n withScope(callback: (scope: SentryScope) => void): void;\n}\n\n/**\n * Sentry Client interface\n */\nexport interface SentryClient {\n captureException(exception: any, hint?: any): string;\n captureMessage(message: string, level?: SentrySeverityLevel): string;\n captureEvent(event: any): string;\n flush(timeout?: number): Promise<boolean>;\n close(timeout?: number): Promise<boolean>;\n getOptions(): SentryOptions;\n getCurrentHub?(): SentryHub;\n}\n\n/**\n * Sentry SDK interface\n */\nexport interface SentrySDK {\n init(options: SentryOptions): void;\n captureException(exception: any, captureContext?: any): string;\n captureMessage(message: string, captureContext?: any): string;\n captureEvent(event: any, hint?: any): string;\n withScope(callback: (scope: SentryScope) => void): void;\n addBreadcrumb(breadcrumb: any): void;\n setUser(user: any): void;\n setTag(key: string, value: string): void;\n setContext(key: string, context: any): void;\n setExtra(key: string, extra: any): void;\n getCurrentHub(): SentryHub;\n getClient<T extends SentryClient>(): T | undefined;\n flush(timeout?: number): Promise<boolean>;\n close(timeout?: number): Promise<boolean>;\n lastEventId(): string | undefined;\n\n // Integration methods\n addEventProcessor(processor: (event: any) => any | null): void;\n\n // Browser specific\n Scope?: new () => SentryScope;\n\n // Transport creation\n makeMultiplexedTransport?(\n createTransport: (options: any) => any,\n matcher: (options: any) => any[],\n ): any;\n makeFetchTransport?(options: any): any;\n\n // Integrations\n browserTracingIntegration?(): any;\n browserProfilingIntegration?(): any;\n replayIntegration?(options?: any): any;\n captureConsoleIntegration?(options?: any): any;\n feedbackIntegration?(options?: any): any;\n vercelAIIntegration?(): any;\n}\n\n/**\n * Sentry Options interface\n */\nexport interface SentryOptions {\n dsn?: string;\n release?: string;\n environment?: string;\n debug?: boolean;\n sampleRate?: number;\n tracesSampleRate?: number;\n profilesSampleRate?: number;\n replaysSessionSampleRate?: number;\n replaysOnErrorSampleRate?: number;\n transport?: any;\n integrations?: any[];\n beforeSend?: (event: any, hint: any) => any | null;\n beforeSendTransaction?: (event: any, hint: any) => any | null;\n beforeBreadcrumb?: (breadcrumb: any, hint?: any) => any | null;\n tracePropagationTargets?: (string | RegExp)[];\n initialScope?: any;\n maxBreadcrumbs?: number;\n attachStacktrace?: boolean;\n autoSessionTracking?: boolean;\n sendDefaultPii?: boolean;\n\n _experiments?: Record<string, any>;\n}\n\n/**\n * Sentry Severity Level\n */\nexport type SentrySeverityLevel = 'fatal' | 'error' | 'warning' | 'log' | 'info' | 'debug';\n\n/**\n * Map LogLevel to Sentry Severity.\n *\n * Converts the observability package's LogLevel to Sentry's SeverityLevel format.\n *\n * @param level - Log level from observability package\n * @returns Corresponding Sentry severity level\n */\nexport function mapLogLevelToSentrySeverity(level: LogLevel): SentrySeverityLevel {\n switch (level) {\n case 'error':\n return 'error';\n case 'warning':\n return 'warning';\n case 'info':\n return 'info';\n case 'debug':\n return 'debug';\n default:\n return 'info';\n }\n}\n","/**\n * @fileoverview Utility functions for Sentry Micro Frontend Plugin\n * Utility functions for Sentry Micro Frontend Plugin\n */\n\nimport { logError } from '@od-oneapp/shared/logs';\n\nimport type { BackstageAppConfig } from './types';\n\n/**\n * Detect the current micro frontend backstageApp based on URL path.\n *\n * Analyzes the current URL pathname to determine which micro frontend application\n * is active. Supports custom path patterns and falls back to default patterns.\n *\n * @param customPatterns - Optional array of custom backstage app configurations with path patterns\n * @returns Detected backstage app name, or undefined if not detected\n *\n * @example\n * ```typescript\n * const app = detectCurrentBackstageApp([\n * { name: 'admin', pathPatterns: ['/admin', '/manage'] },\n * { name: 'dashboard', pathPatterns: [/^\\/dashboard/] }\n * ]);\n * // Returns: 'admin' if pathname starts with '/admin' or '/manage'\n * ```\n */\nexport function detectCurrentBackstageApp(\n customPatterns?: BackstageAppConfig[],\n): string | undefined {\n // Edge runtime compatible check\n if (\n typeof globalThis === 'undefined' ||\n !(globalThis as { location?: { pathname?: string; href?: string } }).location\n ) {\n // Server-side or edge: check Next.js basePath or environment variables\n // Note: process.env is not available in edge runtime\n if (typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_BASE_PATH) {\n return process.env.NEXT_PUBLIC_BASE_PATH.replace('/', '');\n }\n return undefined;\n }\n\n const path = (globalThis as { location?: { pathname?: string } }).location?.pathname;\n if (!path) {\n return undefined;\n }\n\n // Check custom patterns first\n if (customPatterns) {\n for (const config of customPatterns) {\n if (config.pathPatterns) {\n for (const pattern of config.pathPatterns) {\n if (typeof pattern === 'string' && path.startsWith(pattern)) {\n return config.name;\n } else if (pattern instanceof RegExp && pattern.test(path)) {\n return config.name;\n }\n }\n }\n }\n }\n\n // Default patterns for common microfrontend zones\n if (path.startsWith('/admin')) return 'admin';\n if (path.startsWith('/dashboard')) return 'dashboard';\n if (path.startsWith('/settings')) return 'settings';\n\n // Check for backstageApp in global object (set by host)\n\n if ((globalThis as any).__SENTRY_MICRO_FRONTEND_APP__) {\n return (globalThis as any).__SENTRY_MICRO_FRONTEND_APP__;\n }\n\n if ((globalThis as any).__SENTRY_MICRO_FRONTEND_ZONE__) {\n // Backwards compatibility with legacy zone naming\n\n return (globalThis as any).__SENTRY_MICRO_FRONTEND_ZONE__;\n }\n\n return 'main';\n}\n\n/**\n * Check if running in a host environment.\n *\n * Determines whether the current application is acting as a host for micro frontends\n * or as a child micro frontend. Checks for explicit host markers and Sentry initialization state.\n *\n * @returns True if running as host, false if child or standalone\n */\nexport function isHostEnvironment(): boolean {\n if (typeof globalThis === 'undefined') {\n return false;\n }\n\n // Check if explicitly marked as host\n\n if ((globalThis as any).__SENTRY_MICRO_FRONTEND_HOST__) {\n return true;\n }\n\n // Check if Sentry is already initialized (likely means we're a child)\n if (\n (globalThis as any).Sentry &&\n typeof (globalThis as any).Sentry.getCurrentHub === 'function'\n ) {\n return false;\n }\n\n // Default to false (safer to assume child mode)\n return false;\n}\n\n/**\n * Create a Sentry scope with backstageApp-specific context.\n *\n * Creates a new Sentry scope configured with micro frontend tags and context.\n * Includes backstageApp tag, microFrontend context, and any additional tags provided.\n *\n * @param backstageApp - Name of the backstage app\n * @param additionalTags - Optional additional tags to set on the scope\n * @returns Sentry scope instance, or null if Sentry is not available\n */\n\nexport function createBackstageScope(\n backstageApp: string,\n additionalTags?: Record<string, string>,\n): unknown {\n if (typeof globalThis === 'undefined' || !(globalThis as any).Sentry) {\n return null;\n }\n\n const { Sentry } = globalThis as any;\n\n // Check if Scope constructor is available\n if (!Sentry.Scope || typeof Sentry.Scope !== 'function') {\n return null;\n }\n\n try {\n const scope = new Sentry.Scope();\n\n // Set backstageApp tag\n scope.setTag('backstageApp', backstageApp);\n scope.setTag('microFrontend', true);\n\n // Set backstageApp context\n scope.setContext('microFrontend', {\n backstageApp,\n\n isHost: (globalThis as any).__SENTRY_MICRO_FRONTEND_HOST__ ?? false,\n url: (globalThis as { location?: { href?: string } }).location?.href ?? undefined,\n });\n\n // Add additional tags if provided\n if (additionalTags) {\n Object.entries(additionalTags).forEach(([key, value]) => {\n scope.setTag(key, value);\n });\n }\n\n return scope;\n } catch (error) {\n logError('[SentryMicroFrontendPlugin] Failed to create Backstage scope', { error });\n return null;\n }\n}\n\n/**\n * Check if Sentry is already initialized by a parent application.\n *\n * Verifies whether a parent Sentry instance exists in the global scope.\n * Used to determine if the current micro frontend should use the parent's Sentry\n * or initialize its own instance.\n *\n * @returns True if parent Sentry is available, false otherwise\n */\nexport function hasParentSentry(): boolean {\n if (typeof globalThis === 'undefined') {\n return false;\n }\n\n // Check for Sentry global\n\n const { Sentry } = globalThis as any;\n if (!Sentry) {\n return false;\n }\n\n // Verify it's a real Sentry instance with expected methods\n const requiredMethods = ['captureException', 'captureMessage', 'withScope'];\n return requiredMethods.every(method => typeof Sentry[method] === 'function');\n}\n\n/**\n * Get the parent Sentry instance if available.\n *\n * Returns the global Sentry instance if it exists and has been initialized\n * by a parent application. Returns null if no parent Sentry is available.\n *\n * @returns Parent Sentry SDK instance, or null if not available\n */\n\nexport function getParentSentry(): any {\n if (hasParentSentry()) {\n return (globalThis as any).Sentry;\n }\n return null;\n}\n\n/**\n * Mark the current environment as a host.\n *\n * Sets global flags indicating that this application is acting as a host\n * for micro frontends. This affects how Sentry events are routed and tagged.\n *\n * @param backstageApp - Optional backstage app name to set\n */\nexport function markAsHost(backstageApp?: string): void {\n if (typeof globalThis !== 'undefined') {\n (globalThis as any).__SENTRY_MICRO_FRONTEND_HOST__ = true;\n if (backstageApp) {\n (globalThis as any).__SENTRY_MICRO_FRONTEND_APP__ = backstageApp;\n\n (globalThis as any).__SENTRY_MICRO_FRONTEND_ZONE__ = backstageApp;\n }\n }\n}\n\n/**\n * Get backstageApp-specific configuration.\n *\n * Finds the configuration for a specific backstage app from the provided array.\n *\n * @param backstageApp - Name of the backstage app to find\n * @param backstage - Array of backstage app configurations\n * @returns Configuration for the specified app, or undefined if not found\n */\nexport function getBackstageAppConfig(\n backstageApp: string,\n backstage: BackstageAppConfig[],\n): BackstageAppConfig | undefined {\n return backstage.find(app => app.name === backstageApp);\n}\n\n/**\n * Ensure only one Sentry initialization happens (thread-safe).\n *\n * Prevents multiple Sentry initializations using global state tracking.\n * Uses timestamps and unique IDs to detect concurrent initialization attempts.\n * Throws an error if Sentry is already initialized or if concurrent initialization is detected.\n *\n * @throws Error if Sentry is already initialized or concurrent initialization detected\n */\nexport function ensureSingleInit(): void {\n // Use a more robust initialization check with timestamps\n const initKey = '__SENTRY_INIT_STATE__';\n const now = Date.now();\n\n if (typeof globalThis !== 'undefined') {\n const globalState = (globalThis as any)[initKey];\n\n // Check if already initialized or currently initializing\n if (globalState) {\n const { status, timestamp, id } = globalState;\n\n // If initialized, throw error\n if (status === 'initialized') {\n throw new Error(\n 'Sentry has already been initialized! Use hasParentSentry() to check before initializing.',\n );\n }\n\n // If initializing and it's been less than 5 seconds, assume another process is initializing\n if (status === 'initializing' && now - timestamp < 5000) {\n throw new Error(\n `Sentry initialization already in progress (started ${now - timestamp}ms ago by ${id})`,\n );\n }\n }\n\n // Mark as initializing with timestamp and unique ID\n const initId = `${now}-${Math.random().toString(36).substr(2, 9)}`;\n\n (globalThis as any)[initKey] = {\n status: 'initializing',\n timestamp: now,\n id: initId,\n };\n\n // Small delay to allow for race condition detection\n // In a real thread-safe implementation, this would use proper locking\n\n const checkState = (globalThis as any)[initKey];\n if (checkState.id !== initId) {\n throw new Error('Concurrent Sentry initialization detected');\n }\n\n // Mark as initialized\n\n (globalThis as any)[initKey] = {\n status: 'initialized',\n timestamp: now,\n id: initId,\n };\n\n // Also set legacy flag for backward compatibility\n\n (globalThis as any).__SENTRY_INITIALIZED__ = true;\n }\n}\n\n/**\n * Reset initialization flag (mainly for testing).\n *\n * Clears the global Sentry initialization state. Useful for testing scenarios\n * where you need to test initialization multiple times.\n */\nexport function resetInitFlag(): void {\n if (typeof globalThis !== 'undefined') {\n delete (globalThis as any).__SENTRY_INITIALIZED__;\n\n delete (globalThis as any).__SENTRY_INIT_STATE__;\n }\n}\n","/**\n * @fileoverview Sentry Micro Frontend Plugin\n * Sentry Micro Frontend Plugin\n *\n * Extends the base Sentry plugin with micro frontend-specific functionality\n */\n\nimport { SentryPlugin } from '@od-oneapp/integration-sentry/observability-plugin/plugin';\nimport { logDebug, logError, logWarn } from '@od-oneapp/shared/logs';\n\nimport {\n createBackstageBeforeSend,\n createMultiplexedTransport,\n enhanceEventWithBackstageApp,\n} from './multiplexed-transport';\nimport { mapLogLevelToSentrySeverity } from './sentry-types';\nimport {\n createBackstageScope,\n detectCurrentBackstageApp,\n ensureSingleInit,\n getParentSentry,\n hasParentSentry,\n markAsHost,\n} from './utils';\n\nimport type { SentryScope, SentrySDK } from './sentry-types';\nimport type { MicroFrontendMode, SentryMicroFrontendConfig } from './types';\nimport type { LogLevel, ObservabilityContext } from '../../core/types';\n\n/**\n * Sentry plugin optimized for micro frontend architectures\n */\n/**\n * Sentry plugin optimized for micro frontend architectures.\n *\n * Extends SentryPlugin with micro frontend-specific features:\n * - Host/child/standalone mode detection\n * - Multiplexed transport for routing events to different Sentry projects\n * - Backstage app context management\n * - Parent Sentry instance detection and reuse\n */\nexport class SentryMicroFrontendPlugin extends SentryPlugin {\n private mode: MicroFrontendMode;\n private backstageApp: string | undefined;\n private parentSentry: SentrySDK | undefined;\n private backstageScope: SentryScope | undefined;\n private microFrontendConfig: SentryMicroFrontendConfig;\n private eventProcessorCleanup?: (() => void) | undefined;\n\n /**\n * Create a new SentryMicroFrontendPlugin instance.\n *\n * @param config - Sentry micro frontend plugin configuration\n */\n constructor(config: SentryMicroFrontendConfig = {}) {\n // Determine operation mode\n const mode = SentryMicroFrontendPlugin.determineMode(config);\n\n // Prepare base config based on mode\n const baseConfig = SentryMicroFrontendPlugin.prepareConfig(config, mode);\n\n // Initialize parent class\n super(baseConfig);\n\n this.mode = mode;\n this.microFrontendConfig = config;\n this.backstageApp = config.backstageApp ?? detectCurrentBackstageApp(config.backstageApps);\n\n // Handle parent Sentry if in child mode\n if (this.mode === 'child') {\n const parent = getParentSentry();\n if (parent) {\n this.parentSentry = parent as SentrySDK;\n this.enabled = true; // Re-enable since we'll use parent\n\n // Create backstageApp-specific scope\n if (this.backstageApp && this.parentSentry.Scope) {\n this.backstageScope = createBackstageScope(\n this.backstageApp,\n config.globalTags,\n ) as SentryScope;\n }\n }\n }\n\n // Mark as host if applicable\n if (this.mode === 'host') {\n markAsHost(this.backstageApp);\n }\n }\n\n /**\n * Determine the operation mode based on configuration and environment.\n *\n * @param config - Plugin configuration\n * @returns Operation mode ('host', 'child', or 'standalone')\n */\n private static determineMode(config: SentryMicroFrontendConfig): MicroFrontendMode {\n // Explicit host mode\n if (config.isHost) {\n return 'host';\n }\n\n // Check for parent Sentry\n if (config.detectParent !== false && hasParentSentry()) {\n return 'child';\n }\n\n // Default to standalone\n return 'standalone';\n }\n\n /**\n * Prepare configuration based on operation mode.\n *\n * Adjusts configuration settings based on whether running as host, child, or standalone.\n *\n * @param config - Original plugin configuration\n * @param mode - Determined operation mode\n * @returns Prepared configuration object\n */\n private static prepareConfig(\n config: SentryMicroFrontendConfig,\n mode: MicroFrontendMode,\n ): SentryMicroFrontendConfig {\n const preparedConfig = { ...config };\n\n if (mode === 'child') {\n // Disable initialization in child mode\n preparedConfig.enabled = false;\n } else if (\n mode === 'host' &&\n config.backstageApps &&\n config.useMultiplexedTransport !== false\n ) {\n // Host mode with multiplexed transport is handled in initialize()\n // Don't set transport here as it needs Sentry to be loaded first\n }\n\n return preparedConfig;\n }\n\n /**\n * Initialize the plugin\n */\n async initialize(config?: SentryMicroFrontendConfig): Promise<void> {\n const mergedConfig = { ...this.microFrontendConfig, ...config };\n\n if (this.mode === 'child') {\n // In child mode, we don't initialize Sentry but set up our client reference\n if (this.parentSentry) {\n this.client = this.parentSentry;\n this.initialized = true;\n\n // Configure parent Sentry to include backstageApp information\n if (this.backstageApp && mergedConfig.addBackstageContext !== false) {\n this.configureParentSentry();\n }\n }\n return;\n }\n\n // For host and standalone modes\n if (mergedConfig.preventDuplicateInit !== false) {\n try {\n ensureSingleInit();\n } catch (error) {\n logError('Sentry initialization prevented', { error });\n this.enabled = false;\n return;\n }\n }\n\n // Initialize parent class\n await super.initialize(mergedConfig);\n\n // Additional setup for host mode\n if (this.mode === 'host' && this.client && mergedConfig.backstageApps) {\n this.setupHostMode(mergedConfig);\n }\n }\n\n /**\n * Configure parent Sentry instance for child mode\n */\n private configureParentSentry(): void {\n if (!this.parentSentry || !this.backstageApp) {\n logWarn(\n '[SentryMicroFrontendPlugin] Cannot configure parent Sentry: missing parentSentry or backstageApp',\n );\n return;\n }\n\n try {\n // Create event processor\n\n const processor = (event: any) => {\n try {\n if (this.shouldProcessEvent(event)) {\n enhanceEventWithBackstageApp(event, this.backstageApp ?? '', {\n mode: this.mode,\n plugin: 'SentryMicroFrontendPlugin',\n });\n }\n } catch (error) {\n logError('[SentryMicroFrontendPlugin] Error processing event', { error, event });\n }\n return event;\n };\n\n // Add global event processor to include backstageApp information\n if (typeof this.parentSentry.addEventProcessor === 'function') {\n this.parentSentry.addEventProcessor(processor);\n\n // Store cleanup function\n this.eventProcessorCleanup = () => {\n // Note: Sentry SDK doesn't provide a way to remove event processors\n // We'll mark events as processed to avoid double processing\n };\n } else {\n logWarn('[SentryMicroFrontendPlugin] Parent Sentry does not support addEventProcessor');\n }\n } catch (error) {\n logError('[SentryMicroFrontendPlugin] Failed to configure parent Sentry', { error });\n }\n }\n\n /**\n * Set up host mode with multiplexed transport\n */\n private setupHostMode(config: SentryMicroFrontendConfig): void {\n if (!config.backstageApps || !this.client) {\n logWarn(\n '[SentryMicroFrontendPlugin] Cannot setup host mode: missing backstageApps or client',\n );\n return;\n }\n\n try {\n // Create multiplexed transport\n const transport = createMultiplexedTransport(\n config.backstageApps,\n config.fallbackDsn ?? config.dsn,\n this.client,\n );\n\n if (transport && typeof (this.client as any).init === 'function') {\n // Re-initialize with multiplexed transport\n const currentOptions =\n typeof (this.client as any).getOptions === 'function'\n ? (this.client as any).getOptions()\n : {};\n\n (this.client as any).init({\n ...currentOptions,\n transport,\n beforeSend: createBackstageBeforeSend(this.backstageApp ?? 'main', config.beforeSend),\n });\n } else {\n logWarn(\n '[SentryMicroFrontendPlugin] Client does not support init method or transport creation failed',\n );\n }\n } catch (error) {\n logError('[SentryMicroFrontendPlugin] Failed to setup host mode', { error });\n }\n }\n\n /**\n * Check if we should process this event\n */\n\n private shouldProcessEvent(event: any): boolean {\n // Don't double-process events\n if (event.tags?.microFrontendProcessed) {\n return false;\n }\n\n // Check if event is from our backstageApp\n if (\n this.backstageApp &&\n event.tags?.backstageApp &&\n event.tags.backstageApp !== this.backstageApp\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Capture an exception with backstageApp context\n */\n captureException(error: Error | unknown, context?: ObservabilityContext): void {\n if (!this.enabled) return;\n\n try {\n if (this.mode === 'child' && this.parentSentry && this.backstageScope) {\n // Use parent Sentry with backstageApp scope\n if (typeof this.parentSentry.withScope === 'function') {\n this.parentSentry.withScope((scope: any) => {\n try {\n // Copy backstageApp scope properties\n if (this.backstageScope && typeof scope.setTag === 'function') {\n scope.setTag('backstageApp', this.backstageApp ?? 'unknown');\n scope.setTag('microFrontend', true);\n scope.setContext('microFrontend', {\n backstageApp: this.backstageApp,\n mode: this.mode,\n });\n }\n\n // Add additional context\n if (context && typeof scope.setContext === 'function') {\n scope.setContext('additional', context);\n }\n\n if (this.parentSentry && typeof this.parentSentry.captureException === 'function') {\n this.parentSentry.captureException(error);\n }\n } catch (scopeError) {\n logError('[SentryMicroFrontendPlugin] Error in scope callback', {\n error: scopeError,\n });\n }\n });\n } else {\n logWarn('[SentryMicroFrontendPlugin] Parent Sentry does not support withScope');\n }\n } else {\n // Use standard capture with backstageApp enhancement\n const enhancedContext = {\n ...context,\n microFrontend: {\n backstageApp: this.backstageApp,\n mode: this.mode,\n },\n };\n super.captureException(error, enhancedContext);\n }\n } catch (captureError) {\n logError('[SentryMicroFrontendPlugin] Failed to capture exception', { error: captureError });\n }\n }\n\n /**\n * Capture a message with backstageApp context\n */\n captureMessage(message: string, level: LogLevel = 'info', context?: ObservabilityContext): void {\n if (!this.enabled) return;\n\n try {\n const sentryLevel = mapLogLevelToSentrySeverity(level);\n\n if (this.mode === 'child' && this.parentSentry && this.backstageScope) {\n // Use parent Sentry with backstageApp scope\n if (typeof this.parentSentry.withScope === 'function') {\n this.parentSentry.withScope((scope: SentryScope) => {\n try {\n // Copy backstageApp scope properties\n if (this.backstageScope && typeof scope.setTag === 'function') {\n scope.setTag('backstageApp', this.backstageApp ?? 'unknown');\n scope.setTag('microFrontend', true);\n if (typeof scope.setContext === 'function') {\n scope.setContext('microFrontend', {\n backstageApp: this.backstageApp,\n mode: this.mode,\n });\n }\n }\n\n // Add additional context\n if (context && typeof scope.setContext === 'function') {\n scope.setContext('additional', context);\n }\n\n if (this.parentSentry && typeof this.parentSentry.captureMessage === 'function') {\n this.parentSentry.captureMessage(message, sentryLevel);\n }\n } catch (scopeError) {\n logError('[SentryMicroFrontendPlugin] Error in scope callback', {\n error: scopeError,\n });\n }\n });\n } else {\n logWarn('[SentryMicroFrontendPlugin] Parent Sentry does not support withScope');\n }\n } else {\n // Use standard capture\n super.captureMessage(message, level, context);\n }\n } catch (captureError) {\n logError('[SentryMicroFrontendPlugin] Failed to capture message', { error: captureError });\n }\n }\n\n /**\n * Get the current operation mode\n */\n getMode(): MicroFrontendMode {\n return this.mode;\n }\n\n /**\n * Get the current Backstage app identifier\n */\n getBackstageApp(): string | undefined {\n return this.backstageApp;\n }\n\n /**\n * @deprecated Use getBackstageApp instead.\n */\n getZone(): string | undefined {\n return this.getBackstageApp();\n }\n\n /**\n * Get debug information about the plugin state\n */\n\n getDebugInfo(): Record<string, any> {\n return {\n mode: this.mode,\n backstageApp: this.backstageApp,\n enabled: this.enabled,\n initialized: this.initialized,\n hasParentSentry: this.mode === 'child' && Boolean(this.parentSentry),\n clientType: this.client ? this.client.constructor.name : 'none',\n };\n }\n\n /**\n * Clean up the plugin and release resources\n */\n async cleanup(): Promise<void> {\n try {\n // Clean up event processor if it exists\n if (this.eventProcessorCleanup) {\n this.eventProcessorCleanup();\n this.eventProcessorCleanup = undefined;\n }\n\n // Clear backstageApp scope\n\n if (this.backstageScope && typeof (this.backstageScope as any).clear === 'function') {\n (this.backstageScope as any).clear();\n }\n this.backstageScope = undefined;\n\n // Clear parent Sentry reference\n this.parentSentry = undefined;\n\n // Call parent cleanup\n await super.cleanup();\n\n // Mark as not initialized\n this.initialized = false;\n this.enabled = false;\n\n logDebug('[SentryMicroFrontendPlugin] Cleanup completed');\n } catch (error) {\n logError('[SentryMicroFrontendPlugin] Error during cleanup', { error });\n }\n }\n\n /**\n * Destroy the plugin (alias for cleanup)\n */\n async destroy(): Promise<void> {\n await this.cleanup();\n }\n}\n\n/**\n * Factory function to create a Sentry Micro Frontend plugin.\n *\n * Creates a configured SentryMicroFrontendPlugin instance with micro frontend-specific\n * features like multiplexed transport and backstage app routing.\n *\n * @param config - Optional Sentry micro frontend plugin configuration\n * @returns SentryMicroFrontendPlugin instance\n *\n * @example\n * ```typescript\n * const sentry = createSentryMicroFrontendPlugin({\n * dsn: 'https://...',\n * backstage: [\n * { name: 'admin', dsn: 'https://admin-dsn...' },\n * { name: 'dashboard', dsn: 'https://dashboard-dsn...' },\n * ],\n * });\n * ```\n */\nexport const createSentryMicroFrontendPlugin = (\n config?: SentryMicroFrontendConfig,\n): SentryMicroFrontendPlugin => {\n return new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YAAY,OAAO;GAC1D;;;;;CAMH,MAAM,UAAyB;AAC7B,MAAI;AAEF,OAAI,KAAK,uBAAuB;AAC9B,SAAK,uBAAuB;AAC5B,SAAK,wBAAwB;;AAK/B,OAAI,KAAK,kBAAkB,OAAQ,KAAK,eAAuB,UAAU,WACvE,CAAC,KAAK,eAAuB,OAAO;AAEtC,QAAK,iBAAiB;AAGtB,QAAK,eAAe;AAGpB,SAAM,MAAM,SAAS;AAGrB,QAAK,cAAc;AACnB,QAAK,UAAU;AAEf,YAAS,gDAAgD;WAClD,OAAO;AACd,YAAS,oDAAoD,EAAE,OAAO,CAAC;;;;;;CAO3E,MAAM,UAAyB;AAC7B,QAAM,KAAK,SAAS;;;;;;;;;;;;;;;;;;;;;;;AAwBxB,MAAa,mCACX,WAC8B;AAC9B,QAAO,IAAI,0BAA0B,OAAO"}
@@ -1,6 +1,6 @@
1
+ import { n as logError, r as logWarn, t as logDebug } from "./core-BgKCqXjb.mjs";
1
2
  import { isBrowser } from "./index.mjs";
2
3
  import { safeEnv } from "./plugins-sentry-env.mjs";
3
- import { logDebug, logError, logWarn } from "@od-oneapp/shared/logger";
4
4
 
5
5
  //#region src/plugins/sentry/plugin.ts
6
6
  /**
@@ -531,4 +531,4 @@ const createSentryPlugin = (config) => {
531
531
 
532
532
  //#endregion
533
533
  export { createSentryPlugin as n, defaultBeforeSendLog as r, SentryPlugin as t };
534
- //# sourceMappingURL=plugin-CP895lBx.mjs.map
534
+ //# sourceMappingURL=plugin-DApSl5bY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-DApSl5bY.mjs","names":[],"sources":["../src/plugins/sentry/plugin.ts"],"sourcesContent":["/**\n * @fileoverview Sentry plugin implementation\n * Sentry plugin implementation\n */\n\nimport { logDebug, logError, logWarn } from '@od-oneapp/shared/logger';\n\nimport { isBrowser } from '../../shared';\n\nimport { safeEnv } from './env';\n\nimport type { Hub, Scope, Span, SpanContext, Transaction, TransactionContext } from './types';\nimport type { ObservabilityServerPlugin } from '../../core/plugin';\nimport type {\n Breadcrumb,\n LogLevel,\n ObservabilityContext,\n ObservabilityUser,\n} from '../../core/types';\n\n/**\n * Default log filter function that filters out noisy development logs.\n * Filters out:\n * - Next.js Fast Refresh messages\n * - HMR (Hot Module Replacement) messages\n * - Prisma query logs (server-only)\n * - Prisma engine/info logs\n * - SQL queries matching Prisma's format\n *\n * Handles ANSI color codes, console formatting (%c, %s), and CSS styling.\n *\n * @param log - The log entry from Sentry\n * @param isServer - Whether this is running on the server (defaults to true)\n * @returns The log entry if it should be sent, or null to filter it out\n */\nexport function defaultBeforeSendLog(log: any, isServer = true): any | null {\n // Check both message and any formatted message fields\n const messageToCheck = log.message || log.formatted || '';\n if (!messageToCheck) {\n return log; // No message to filter, send as-is\n }\n\n const message = String(messageToCheck);\n\n // Remove ANSI color codes for comparison (e.g., \\u001b[34mprisma:query\\u001b[39m)\n // Also handle %c format codes used by console styling and %s placeholders\n const messageWithoutAnsi = message\n .replace(/\\u001b\\[[0-9;]*m/g, '') // Remove ANSI escape codes\n .replace(/%[csdfiO]/g, '') // Remove console format placeholders (%c, %s, %d, %f, %i, %o)\n .replace(/background:[^;]+;?/g, '') // Remove CSS background styles\n .replace(/color:[^;]+;?/g, '') // Remove CSS color styles\n .replace(/border-radius:[^;]+;?/g, '') // Remove CSS border-radius\n .replace(/light-dark\\([^)]+\\)/g, '') // Remove light-dark() CSS functions\n .replace(/rgba?\\([^)]+\\)/g, '') // Remove rgba/rgb color functions\n .replace(/#[0-9a-fA-F]{3,8}/g, '') // Remove hex colors\n .toLowerCase(); // Case-insensitive matching\n\n // Filter out Next.js Fast Refresh and HMR messages (both client and server)\n if (messageWithoutAnsi.includes('[fast refresh]') || messageWithoutAnsi.includes('[hmr]')) {\n return null; // Drop the log\n }\n\n // Filter out Prisma logs (server-only)\n if (isServer) {\n if (\n messageWithoutAnsi.includes('prisma:query') ||\n messageWithoutAnsi.includes('prisma:engine') ||\n messageWithoutAnsi.includes('prisma:info') ||\n // Also filter SQL queries that look like Prisma queries (SELECT ... FROM \"public\".)\n (messageWithoutAnsi.includes('select') &&\n messageWithoutAnsi.includes('from') &&\n (messageWithoutAnsi.includes('\"public\".') || messageWithoutAnsi.includes('public.')))\n ) {\n return null; // Drop the log\n }\n }\n\n return log; // Send the log\n}\n\n/**\n * Minimal Sentry interface for common methods across all Sentry packages\n */\ninterface SentryClient {\n init(options: any): void;\n captureException(error: any, captureContext?: any): string;\n captureMessage(message: string, captureContext?: any): string;\n setUser(user: any): void;\n addBreadcrumb(breadcrumb: any): void;\n withScope(callback: (scope: any) => void): void;\n getCurrentScope?(): any;\n getActiveTransaction?(): any;\n startTransaction?(context: TransactionContext, customSamplingContext?: any): any;\n startSpan?(context: SpanContext): any;\n configureScope?(callback: (scope: any) => void): void;\n getCurrentHub?(): any;\n flush?(timeout?: number): Promise<boolean>;\n close?(timeout?: number): Promise<boolean>;\n browserTracingIntegration?(): any;\n replayIntegration?(): any;\n profilesIntegration?(): any;\n consoleLoggingIntegration?(options?: { levels?: string[] }): any;\n logger?: {\n trace(message: string, attributes?: Record<string, unknown>): void;\n debug(message: string, attributes?: Record<string, unknown>): void;\n info(message: string, attributes?: Record<string, unknown>): void;\n warn(message: string, attributes?: Record<string, unknown>): void;\n error(message: string, attributes?: Record<string, unknown>): void;\n fatal(message: string, attributes?: Record<string, unknown>): void;\n fmt(strings: TemplateStringsArray, ...values: unknown[]): string;\n };\n}\n\n/**\n * Sentry plugin configuration\n */\nexport interface SentryPluginConfig {\n /**\n * The Sentry package to use (e.g., '@sentry/node', '@sentry/browser', '@sentry/nextjs')\n * If not provided, the plugin will try to detect based on environment\n */\n sentryPackage?: string;\n\n // Core Sentry options\n dsn?: string;\n environment?: string;\n release?: string;\n enabled?: boolean;\n debug?: boolean;\n\n // Sampling rates\n tracesSampleRate?: number;\n profilesSampleRate?: number;\n replaysSessionSampleRate?: number;\n replaysOnErrorSampleRate?: number;\n\n // Integrations and hooks\n integrations?: any[];\n beforeSend?: (event: any, hint: any) => any;\n beforeSendTransaction?: (event: any, hint: any) => any;\n beforeBreadcrumb?: (breadcrumb: any, hint?: any) => any;\n beforeSendLog?: (log: any) => any;\n\n // Logging options\n enableLogs?: boolean;\n consoleLoggingIntegration?: {\n levels?: ('log' | 'warn' | 'error' | 'debug' | 'info' | 'assert' | 'trace')[];\n };\n\n // Trace propagation\n tracePropagationTargets?: (string | RegExp)[];\n\n // Other options\n initialScope?: any;\n maxBreadcrumbs?: number;\n attachStacktrace?: boolean;\n autoSessionTracking?: boolean;\n sendDefaultPii?: boolean;\n}\n\n/**\n * Sentry plugin implementation\n */\n/**\n * Sentry plugin implementation.\n *\n * Integrates Sentry error tracking and performance monitoring into the observability system.\n * Auto-detects the appropriate Sentry package (@sentry/node, @sentry/browser, @sentry/nextjs)\n * based on the runtime environment.\n */\nexport class SentryPlugin<\n T extends SentryClient = SentryClient,\n> implements ObservabilityServerPlugin<T> {\n name = 'sentry';\n enabled: boolean;\n protected client: T | undefined;\n protected initialized = false;\n protected sentryPackage: string;\n protected config: SentryPluginConfig;\n\n /**\n * Create a new SentryPlugin instance.\n *\n * @param config - Sentry plugin configuration\n */\n constructor(config: SentryPluginConfig = {}) {\n this.config = config;\n const env = safeEnv();\n // Auto-enable if DSN is provided\n const hasDSN = config.dsn ?? env.SENTRY_DSN ?? env.NEXT_PUBLIC_SENTRY_DSN;\n this.enabled = config.enabled ?? Boolean(hasDSN);\n\n // Determine Sentry package to use\n this.sentryPackage = config.sentryPackage ?? this.detectSentryPackage();\n }\n\n /**\n * Detect which Sentry package to use based on the runtime environment.\n *\n * @returns Package name ('@sentry/node', '@sentry/browser', or '@sentry/nextjs')\n */\n private detectSentryPackage(): string {\n if (isBrowser()) {\n return '@sentry/browser';\n } else if (process.env.NEXT_RUNTIME === 'edge') {\n return '@sentry/nextjs'; // Next.js edge uses same package\n } else if (process.env.NEXT_RUNTIME) {\n return '@sentry/nextjs';\n } else {\n return '@sentry/node';\n }\n }\n\n getClient(): T | undefined {\n return this.client;\n }\n\n /**\n * Get safe environment access (for testing/mocking).\n *\n * @returns Environment configuration object\n */\n protected getSafeEnv() {\n return safeEnv();\n }\n\n async initialize(config?: SentryPluginConfig): Promise<void> {\n if (this.initialized || !this.enabled) return;\n\n const env = safeEnv();\n const mergedConfig = { ...this.config, ...config };\n\n // Check for DSN\n const dsn = mergedConfig.dsn ?? env.SENTRY_DSN ?? env.NEXT_PUBLIC_SENTRY_DSN;\n if (!dsn) {\n logWarn('Sentry plugin: No DSN provided, skipping initialization');\n this.enabled = false;\n return;\n }\n\n try {\n // Dynamic import of the specified Sentry package\n this.client = (await import(/* webpackIgnore: true */ this.sentryPackage)) as T;\n\n if (this.client && this.enabled) {\n // Build integrations array if not provided\n let { integrations } = mergedConfig;\n if (!integrations && this.client.browserTracingIntegration) {\n integrations = [];\n\n // Add browser tracing for performance monitoring\n if (\n mergedConfig.tracesSampleRate !== undefined ||\n env.SENTRY_TRACES_SAMPLE_RATE !== undefined\n ) {\n integrations.push(this.client.browserTracingIntegration());\n }\n\n // Add replay integration if configured\n if (\n this.client.replayIntegration &&\n (mergedConfig.replaysSessionSampleRate !== undefined ||\n env.SENTRY_REPLAYS_SESSION_SAMPLE_RATE !== undefined)\n ) {\n integrations.push(this.client.replayIntegration());\n }\n\n // Add profiling if configured\n if (\n this.client.profilesIntegration &&\n (mergedConfig.profilesSampleRate !== undefined ||\n env.SENTRY_PROFILES_SAMPLE_RATE !== undefined)\n ) {\n integrations.push(this.client.profilesIntegration());\n }\n }\n\n // Add console logging integration if logs are enabled\n const enableLogs = mergedConfig.enableLogs ?? true;\n if (enableLogs && this.client.consoleLoggingIntegration) {\n const consoleLoggingConfig = mergedConfig.consoleLoggingIntegration || {\n levels: ['log', 'warn', 'error'],\n };\n if (!integrations) {\n integrations = [];\n }\n integrations.push(this.client.consoleLoggingIntegration(consoleLoggingConfig));\n }\n\n this.client.init({\n dsn,\n environment: mergedConfig.environment ?? env.SENTRY_ENVIRONMENT ?? process.env.NODE_ENV,\n release: mergedConfig.release ?? env.SENTRY_RELEASE,\n debug: mergedConfig.debug ?? env.SENTRY_DEBUG,\n\n // Enable logs to be sent to Sentry\n enableLogs,\n\n // Sampling rates\n tracesSampleRate: mergedConfig.tracesSampleRate ?? env.SENTRY_TRACES_SAMPLE_RATE,\n profilesSampleRate: mergedConfig.profilesSampleRate ?? env.SENTRY_PROFILES_SAMPLE_RATE,\n replaysSessionSampleRate:\n mergedConfig.replaysSessionSampleRate ?? env.SENTRY_REPLAYS_SESSION_SAMPLE_RATE,\n replaysOnErrorSampleRate:\n mergedConfig.replaysOnErrorSampleRate ?? env.SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE,\n\n // Integrations and hooks\n integrations,\n beforeSend: mergedConfig.beforeSend,\n beforeSendTransaction: mergedConfig.beforeSendTransaction,\n // Use provided beforeSendLog, or default filter if logs are enabled and no custom filter provided\n beforeSendLog:\n mergedConfig.beforeSendLog ||\n (enableLogs ? (log: any) => defaultBeforeSendLog(log, !isBrowser()) : undefined),\n\n // Other options\n tracePropagationTargets: mergedConfig.tracePropagationTargets,\n initialScope: mergedConfig.initialScope,\n maxBreadcrumbs: mergedConfig.maxBreadcrumbs,\n attachStacktrace: mergedConfig.attachStacktrace,\n autoSessionTracking: mergedConfig.autoSessionTracking,\n });\n\n this.initialized = true;\n }\n } catch (error) {\n logError(`Failed to import Sentry package '${this.sentryPackage}'`, { error });\n this.enabled = false;\n }\n }\n\n async shutdown(): Promise<void> {\n if (this.client && this.initialized) {\n // Use close if available, otherwise flush\n if (this.client.close) {\n await this.client.close();\n } else if (this.client.flush) {\n await this.client.flush();\n }\n this.initialized = false;\n }\n }\n\n /**\n * Clean up the plugin (alias for shutdown)\n */\n async cleanup(): Promise<void> {\n await this.shutdown();\n }\n\n captureException(error: Error | unknown, context?: ObservabilityContext): void {\n if (!this.enabled || !this.client) return;\n\n // Additional build-time guard to prevent errors during static generation\n if (typeof this.client.captureException !== 'function') {\n // During build/static generation, Sentry client may not be properly initialized\n // Fall back to logging in development\n if (process.env.NODE_ENV === 'development') {\n logError('[Sentry Fallback] Exception', { error });\n }\n return;\n }\n\n try {\n this.client.captureException(error, context);\n } catch (captureError) {\n // Graceful fallback if Sentry fails during build\n if (process.env.NODE_ENV === 'development') {\n logWarn('[Sentry Plugin] Failed to capture exception', { error: captureError });\n logError('[Sentry Fallback] Exception', { error });\n }\n }\n }\n\n captureMessage(message: string, level: LogLevel = 'info', context?: ObservabilityContext): void {\n if (!this.enabled || !this.client) return;\n\n // Prefer Sentry.logger if available (structured logs)\n if (this.client.logger) {\n try {\n const attributes: Record<string, unknown> | undefined = context\n ? ((context.extra as Record<string, unknown> | undefined) ??\n (context as Record<string, unknown>))\n : undefined;\n switch (level) {\n case 'debug':\n this.client.logger.debug(message, attributes);\n return;\n case 'info':\n this.client.logger.info(message, attributes);\n return;\n case 'warning':\n this.client.logger.warn(message, attributes);\n return;\n case 'error':\n this.client.logger.error(message, attributes);\n return;\n }\n } catch (error) {\n // Fall through to captureMessage if logger fails\n if (process.env.NODE_ENV === 'development') {\n logWarn('[Sentry Plugin] Failed to log via logger', { error });\n }\n }\n }\n\n // Fallback to captureMessage for compatibility\n // Additional build-time guard to prevent errors during static generation\n if (typeof this.client.captureMessage !== 'function') {\n // During build/static generation, Sentry client may not be properly initialized\n // Fall back to logging in development\n if (process.env.NODE_ENV === 'development') {\n if (level === 'error') {\n logError(`[Sentry Fallback] ${message}`);\n } else if (level === 'warning') {\n logWarn(`[Sentry Fallback] ${message}`);\n } else {\n logDebug(`[Sentry Fallback] ${message}`);\n }\n }\n return;\n }\n\n // Map our log levels to Sentry severity levels\n const sentryLevel =\n level === 'warning'\n ? 'warning'\n : level === 'error'\n ? 'error'\n : level === 'debug'\n ? 'debug'\n : 'info';\n\n try {\n // Build capture context from ObservabilityContext\n const captureContext = context\n ? {\n level: sentryLevel,\n extra: context.extra ?? context,\n tags: context.tags,\n }\n : sentryLevel;\n\n this.client.captureMessage(message, captureContext);\n } catch (error) {\n // Graceful fallback if Sentry fails during build\n if (process.env.NODE_ENV === 'development') {\n logWarn('[Sentry Plugin] Failed to capture message', { error });\n if (level === 'error') {\n logError(`[Sentry Fallback] ${message}`);\n } else if (level === 'warning') {\n logWarn(`[Sentry Fallback] ${message}`);\n } else {\n logDebug(`[Sentry Fallback] ${message}`);\n }\n }\n }\n }\n\n setUser(user: ObservabilityUser | null): void {\n if (!this.enabled || !this.client) return;\n this.client.setUser(user);\n }\n\n addBreadcrumb(breadcrumb: Breadcrumb): void {\n if (!this.enabled || !this.client) return;\n this.client.addBreadcrumb({\n ...breadcrumb,\n timestamp: breadcrumb.timestamp ?? Date.now() / 1000,\n });\n }\n\n withScope(callback: (scope: any) => void): void {\n if (!this.enabled || !this.client) return;\n this.client.withScope(callback);\n }\n\n /**\n * Start a new transaction\n */\n startTransaction(\n context: TransactionContext,\n customSamplingContext?: any,\n ): Transaction | undefined {\n if (!this.enabled || !this.client) return undefined;\n\n if (this.client.startTransaction) {\n return this.client.startTransaction(context, customSamplingContext);\n }\n\n // Fallback for older versions\n logWarn('startTransaction not available in this Sentry version');\n return undefined;\n }\n\n /**\n * Start a new span\n */\n startSpan(context: SpanContext): Span | undefined {\n if (!this.enabled || !this.client) return undefined;\n\n if (this.client.startSpan) {\n return this.client.startSpan(context);\n }\n\n // Try to create span from active transaction\n const transaction = this.getActiveTransaction();\n if (transaction?.startChild) {\n return transaction.startChild(context);\n }\n\n return undefined;\n }\n\n /**\n * Get the currently active transaction\n */\n getActiveTransaction(): Transaction | undefined {\n if (!this.enabled || !this.client) return undefined;\n\n if (this.client.getActiveTransaction) {\n return this.client.getActiveTransaction();\n }\n\n // Try to get from current scope\n if (this.client.getCurrentScope) {\n const scope = this.client.getCurrentScope();\n if (scope?.getTransaction) {\n return scope.getTransaction();\n }\n }\n\n return undefined;\n }\n\n /**\n * Configure the current scope\n */\n configureScope(callback: (scope: Scope) => void): void {\n if (!this.enabled || !this.client) return;\n\n if (this.client.configureScope) {\n this.client.configureScope(callback);\n } else if (this.client.withScope) {\n // Fallback using withScope\n this.client.withScope(callback);\n }\n }\n\n /**\n * Get the current hub instance\n */\n getCurrentHub(): Hub | undefined {\n if (!this.enabled || !this.client) return undefined;\n\n if (this.client.getCurrentHub) {\n return this.client.getCurrentHub();\n }\n\n return undefined;\n }\n\n /**\n * Set a measurement on the active transaction\n */\n setMeasurement(name: string, value: number, unit?: string): void {\n if (!this.enabled || !this.client) return;\n\n const transaction = this.getActiveTransaction();\n if (transaction?.setMeasurement) {\n transaction.setMeasurement(name, value, unit);\n }\n }\n\n /**\n * Add performance entries as breadcrumbs and measurements\n */\n addPerformanceEntries(\n entries: Array<{\n entryType: string;\n name: string;\n startTime: number;\n duration: number;\n [key: string]: unknown;\n }>,\n ): void {\n if (!this.enabled || !this.client) return;\n\n const transaction = this.getActiveTransaction();\n\n entries.forEach(entry => {\n // Add as breadcrumb for context\n this.addBreadcrumb({\n category: 'performance',\n message: `${entry.entryType}: ${entry.name}`,\n data: {\n name: entry.name,\n duration: entry.duration,\n startTime: entry.startTime,\n ...(entry.entryType === 'navigation' && {\n transferSize: (entry as { transferSize?: number }).transferSize,\n encodedBodySize: (entry as { encodedBodySize?: number }).encodedBodySize,\n decodedBodySize: (entry as { decodedBodySize?: number }).decodedBodySize,\n }),\n ...(entry.entryType === 'resource' && {\n initiatorType: (entry as { initiatorType?: string }).initiatorType,\n transferSize: (entry as { transferSize?: number }).transferSize,\n }),\n },\n });\n\n // Add measurements for key metrics\n if (transaction && entry.entryType === 'navigation') {\n const navEntry = entry as unknown as {\n responseStart?: number;\n fetchStart?: number;\n domInteractive?: number;\n domComplete?: number;\n loadEventEnd?: number;\n transferSize?: number;\n encodedBodySize?: number;\n decodedBodySize?: number;\n [key: string]: unknown;\n };\n\n // Core Web Vitals and other metrics\n const fetchStart = navEntry.fetchStart ?? 0;\n if (navEntry.responseStart !== undefined) {\n this.setMeasurement('fcp', navEntry.responseStart - fetchStart, 'millisecond');\n }\n if (navEntry.domInteractive !== undefined) {\n this.setMeasurement(\n 'dom_interactive',\n navEntry.domInteractive - fetchStart,\n 'millisecond',\n );\n }\n if (navEntry.domComplete !== undefined) {\n this.setMeasurement('dom_complete', navEntry.domComplete - fetchStart, 'millisecond');\n }\n if (navEntry.loadEventEnd !== undefined) {\n this.setMeasurement('load_event_end', navEntry.loadEventEnd - fetchStart, 'millisecond');\n }\n }\n });\n }\n\n /**\n * Record a Web Vital measurement\n */\n recordWebVital(\n name: 'FCP' | 'LCP' | 'FID' | 'CLS' | 'TTFB' | 'INP' | string,\n value: number,\n options?: {\n unit?: string;\n rating?: 'good' | 'needs-improvement' | 'poor';\n },\n ): void {\n if (!this.enabled || !this.client) return;\n\n const { unit = 'millisecond', rating } = options ?? {};\n const transaction = this.getActiveTransaction();\n\n if (transaction) {\n // Set the measurement\n transaction.setMeasurement(name.toLowerCase(), value, unit);\n\n // Add rating as tag if provided\n if (rating) {\n transaction.setTag(`webvital.${name.toLowerCase()}.rating`, rating);\n }\n\n // Also send as a standalone event for monitoring\n this.client.captureMessage(`Web Vital: ${name}`, {\n level: 'info',\n tags: {\n 'webvital.name': name,\n 'webvital.value': value,\n 'webvital.unit': unit,\n ...(rating && { 'webvital.rating': rating }),\n },\n contexts: {\n trace: {\n trace_id: transaction.traceId,\n span_id: transaction.spanId,\n },\n },\n });\n }\n }\n\n /**\n * Create a custom performance mark\n */\n mark(name: string, options?: { detail?: any }): void {\n if (!this.enabled) return;\n\n // Use Performance API if available\n if (typeof performance !== 'undefined' && performance.mark) {\n performance.mark(name, options);\n }\n\n // Also add as breadcrumb\n this.addBreadcrumb({\n category: 'performance.mark',\n message: name,\n data: options?.detail,\n timestamp: Date.now() / 1000,\n });\n }\n\n /**\n * Create a custom performance measure\n */\n measure(\n name: string,\n startMarkOrOptions?:\n | string\n | { start?: string; end?: string; duration?: number; detail?: unknown },\n endMark?: string,\n ): void {\n if (!this.enabled) return;\n\n // Use Performance API if available\n if (typeof performance !== 'undefined' && performance.measure) {\n if (typeof startMarkOrOptions === 'string') {\n performance.measure(name, startMarkOrOptions, endMark);\n } else if (startMarkOrOptions) {\n performance.measure(name, startMarkOrOptions);\n } else {\n // No options provided, create a simple measure\n performance.measure(name);\n }\n\n // Get the measure to record its duration\n const measures = performance.getEntriesByName(name, 'measure');\n const measure = measures[measures.length - 1];\n\n if (measure) {\n this.setMeasurement(name, measure.duration, 'millisecond');\n\n this.addBreadcrumb({\n category: 'performance.measure',\n message: name,\n data: {\n duration: measure.duration,\n startTime: measure.startTime,\n },\n timestamp: measure.startTime / 1000,\n });\n }\n }\n }\n\n /**\n * Log a trace message using Sentry.logger (if available).\n * Falls back to captureMessage if logger is not available.\n *\n * @param message - Trace message to log\n * @param attributes - Optional attributes to include with the log\n */\n logTrace(message: string, attributes?: Record<string, unknown>): void {\n if (!this.enabled || !this.client) return;\n\n if (this.client.logger?.trace) {\n try {\n this.client.logger.trace(message, attributes);\n return;\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n logWarn('[Sentry Plugin] Failed to log trace', { error });\n }\n }\n }\n\n // Fallback to captureMessage\n this.captureMessage(message, 'debug', attributes);\n }\n\n /**\n * Log a debug message using Sentry.logger (if available).\n * Falls back to captureMessage if logger is not available.\n *\n * @param message - Debug message to log\n * @param attributes - Optional attributes to include with the log\n */\n logDebug(message: string, attributes?: Record<string, unknown>): void {\n if (!this.enabled || !this.client) return;\n\n if (this.client.logger?.debug) {\n try {\n this.client.logger.debug(message, attributes);\n return;\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n logWarn('[Sentry Plugin] Failed to log debug', { error });\n }\n }\n }\n\n // Fallback to captureMessage\n this.captureMessage(message, 'debug', attributes);\n }\n\n /**\n * Log an info message using Sentry.logger (if available).\n * Falls back to captureMessage if logger is not available.\n *\n * @param message - Info message to log\n * @param attributes - Optional attributes to include with the log\n */\n logInfo(message: string, attributes?: Record<string, unknown>): void {\n if (!this.enabled || !this.client) return;\n\n if (this.client.logger?.info) {\n try {\n this.client.logger.info(message, attributes);\n return;\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n logWarn('[Sentry Plugin] Failed to log info', { error });\n }\n }\n }\n\n // Fallback to captureMessage\n this.captureMessage(message, 'info', attributes);\n }\n\n /**\n * Log a warning message using Sentry.logger (if available).\n * Falls back to captureMessage if logger is not available.\n *\n * @param message - Warning message to log\n * @param attributes - Optional attributes to include with the log\n */\n logWarn(message: string, attributes?: Record<string, unknown>): void {\n if (!this.enabled || !this.client) return;\n\n if (this.client.logger?.warn) {\n try {\n this.client.logger.warn(message, attributes);\n return;\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n logWarn('[Sentry Plugin] Failed to log warn', { error });\n }\n }\n }\n\n // Fallback to captureMessage\n this.captureMessage(message, 'warning', attributes);\n }\n\n /**\n * Log an error message using Sentry.logger (if available).\n * Falls back to captureMessage if logger is not available.\n *\n * @param message - Error message to log\n * @param attributes - Optional attributes to include with the log\n */\n logError(message: string, attributes?: Record<string, unknown>): void {\n if (!this.enabled || !this.client) return;\n\n if (this.client.logger?.error) {\n try {\n this.client.logger.error(message, attributes);\n return;\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n logWarn('[Sentry Plugin] Failed to log error', { error });\n }\n }\n }\n\n // Fallback to captureMessage\n this.captureMessage(message, 'error', attributes);\n }\n\n /**\n * Log a fatal message using Sentry.logger (if available).\n * Falls back to captureMessage if logger is not available.\n *\n * @param message - Fatal message to log\n * @param attributes - Optional attributes to include with the log\n */\n logFatal(message: string, attributes?: Record<string, unknown>): void {\n if (!this.enabled || !this.client) return;\n\n if (this.client.logger?.fatal) {\n try {\n this.client.logger.fatal(message, attributes);\n return;\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n logWarn('[Sentry Plugin] Failed to log fatal', { error });\n }\n }\n }\n\n // Fallback to captureMessage with error level\n this.captureMessage(message, 'error', attributes);\n }\n\n /**\n * Get the Sentry.logger instance if available.\n * This allows direct access to Sentry.logger APIs including fmt.\n *\n * @returns Sentry.logger instance or undefined if not available\n *\n * @example\n * ```typescript\n * const logger = sentryPlugin.getLogger();\n * if (logger) {\n * logger.info(logger.fmt`User ${user.id} logged in`);\n * }\n * ```\n */\n getLogger(): SentryClient['logger'] | undefined {\n if (!this.enabled || !this.client) return undefined;\n return this.client.logger;\n }\n\n async flush(timeout?: number): Promise<boolean> {\n if (!this.enabled || !this.client || !this.client.flush) return true;\n try {\n return await this.client.flush(timeout);\n } catch (_error) {\n return false;\n }\n }\n}\n\n/**\n * Factory function to create a Sentry plugin.\n *\n * Creates a configured SentryPlugin instance with optional configuration.\n * Auto-detects the appropriate Sentry package based on the environment.\n *\n * @param config - Optional Sentry plugin configuration\n * @returns SentryPlugin instance\n *\n * @example\n * ```typescript\n * const sentry = createSentryPlugin({\n * dsn: 'https://...',\n * environment: 'production',\n * tracesSampleRate: 0.1,\n * });\n * ```\n */\nexport const createSentryPlugin = <T extends SentryClient = SentryClient>(\n config?: SentryPluginConfig,\n): SentryPlugin<T> => {\n return new SentryPlugin<T>(config);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,qBAAqB,KAAU,WAAW,MAAkB;CAE1E,MAAM,iBAAiB,IAAI,WAAW,IAAI,aAAa;AACvD,KAAI,CAAC,eACH,QAAO;CAOT,MAAM,qBAJU,OAAO,eAAe,CAKnC,QAAQ,qBAAqB,GAAG,CAChC,QAAQ,cAAc,GAAG,CACzB,QAAQ,uBAAuB,GAAG,CAClC,QAAQ,kBAAkB,GAAG,CAC7B,QAAQ,0BAA0B,GAAG,CACrC,QAAQ,wBAAwB,GAAG,CACnC,QAAQ,mBAAmB,GAAG,CAC9B,QAAQ,sBAAsB,GAAG,CACjC,aAAa;AAGhB,KAAI,mBAAmB,SAAS,iBAAiB,IAAI,mBAAmB,SAAS,QAAQ,CACvF,QAAO;AAIT,KAAI,UACF;MACE,mBAAmB,SAAS,eAAe,IAC3C,mBAAmB,SAAS,gBAAgB,IAC5C,mBAAmB,SAAS,cAAc,IA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;;;;;;;CAUrD,SAAS,SAAiB,YAA4C;AACpE,MAAI,CAAC,KAAK,WAAW,CAAC,KAAK,OAAQ;AAEnC,MAAI,KAAK,OAAO,QAAQ,MACtB,KAAI;AACF,QAAK,OAAO,OAAO,MAAM,SAAS,WAAW;AAC7C;WACO,OAAO;AAEZ,WAAQ,uCAAuC,EAAE,OAAO,CAAC;;AAM/D,OAAK,eAAe,SAAS,SAAS,WAAW;;;;;;;;;CAUnD,SAAS,SAAiB,YAA4C;AACpE,MAAI,CAAC,KAAK,WAAW,CAAC,KAAK,OAAQ;AAEnC,MAAI,KAAK,OAAO,QAAQ,MACtB,KAAI;AACF,QAAK,OAAO,OAAO,MAAM,SAAS,WAAW;AAC7C;WACO,OAAO;AAEZ,WAAQ,uCAAuC,EAAE,OAAO,CAAC;;AAM/D,OAAK,eAAe,SAAS,SAAS,WAAW;;;;;;;;;;;;;;;;CAiBnD,YAAgD;AAC9C,MAAI,CAAC,KAAK,WAAW,CAAC,KAAK,OAAQ,QAAO;AAC1C,SAAO,KAAK,OAAO;;CAGrB,MAAM,MAAM,SAAoC;AAC9C,MAAI,CAAC,KAAK,WAAW,CAAC,KAAK,UAAU,CAAC,KAAK,OAAO,MAAO,QAAO;AAChE,MAAI;AACF,UAAO,MAAM,KAAK,OAAO,MAAM,QAAQ;WAChC,QAAQ;AACf,UAAO;;;;;;;;;;;;;;;;;;;;;;AAuBb,MAAa,sBACX,WACoB;AACpB,QAAO,IAAI,aAAgB,OAAO"}
@@ -1,5 +1,5 @@
1
+ import { n as logError, r as logWarn } from "./core-BgKCqXjb.mjs";
1
2
  import { safeEnv } from "./plugins-betterstack-env.mjs";
2
- import { logError, logWarn } from "@od-oneapp/shared/logger";
3
3
 
4
4
  //#region src/plugins/betterstack/plugin.ts
5
5
  /**
@@ -231,4 +231,4 @@ const createBetterStackPlugin = (config) => {
231
231
 
232
232
  //#endregion
233
233
  export { createBetterStackPlugin as n, BetterStackPlugin as t };
234
- //# sourceMappingURL=plugin-lPdJirTY.mjs.map
234
+ //# sourceMappingURL=plugin-LhaOv4eq.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-LhaOv4eq.mjs","names":[],"sources":["../src/plugins/betterstack/plugin.ts"],"sourcesContent":["/**\n * @fileoverview Better Stack (Logtail) plugin implementation\n * Better Stack (Logtail) plugin implementation\n * Updated to use official @logtail packages\n */\n\nimport { logError, logWarn } from '@od-oneapp/shared/logger';\n\nimport { safeEnv } from './env';\n\nimport type { ObservabilityServerPlugin } from '../../core/plugin';\nimport type {\n Breadcrumb,\n LogLevel,\n ObservabilityContext,\n ObservabilityUser,\n} from '../../core/types';\n\n/**\n * Maximum number of breadcrumbs to include in error/message context\n * Limits context size to prevent excessive data transmission\n */\nconst MAX_BREADCRUMBS_IN_CONTEXT = 10;\n\n/**\n * Maximum number of breadcrumbs to store in memory\n * Prevents unbounded memory growth while maintaining useful history\n */\nconst MAX_BREADCRUMBS_STORED = 100;\n\n/**\n * Minimal Logtail interface for common methods across all @logtail packages\n */\ninterface LogtailClient {\n info(message: string, data?: any): void;\n warn(message: string, data?: any): void;\n error(message: string, data?: any): void;\n debug(message: string, data?: any): void;\n flush(): Promise<void>;\n}\n\n/**\n * Better Stack plugin configuration\n */\nexport interface BetterStackPluginConfig {\n /**\n * The @logtail package to use (e.g., '@logtail/js', '@logtail/next')\n * If not provided, the plugin will auto-detect based on environment\n */\n logtailPackage?: string;\n\n // Core configuration options\n sourceToken?: string;\n endpoint?: string;\n logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'off';\n enabled?: boolean;\n\n // Advanced options\n batchInterval?: number;\n batchSize?: number;\n retryCount?: number;\n retryBackoff?: boolean;\n middleware?: any[];\n}\n\n/**\n * Better Stack plugin implementation using official @logtail packages\n */\n/**\n * Better Stack (Logtail) plugin implementation.\n *\n * Integrates Better Stack logging service into the observability system.\n * Uses official @logtail packages (@logtail/js or @logtail/next) for unified\n * logging across environments.\n */\nexport class BetterStackPlugin<\n T extends LogtailClient = LogtailClient,\n> implements ObservabilityServerPlugin<T> {\n name = 'betterstack';\n enabled: boolean;\n protected client: T | undefined;\n protected initialized = false;\n protected logtailPackage: string;\n protected currentUser: ObservabilityUser | null = null;\n protected breadcrumbs: Breadcrumb[] = [];\n protected breadcrumbIndex = 0;\n protected config: BetterStackPluginConfig;\n\n /**\n * Create a new BetterStackPlugin instance.\n *\n * @param config - Better Stack plugin configuration\n */\n constructor(config: BetterStackPluginConfig = {}) {\n this.config = config;\n const env = safeEnv();\n // Auto-enable if token is provided\n const hasToken =\n config.sourceToken ??\n env.BETTER_STACK_SOURCE_TOKEN ??\n env.BETTERSTACK_SOURCE_TOKEN ??\n env.LOGTAIL_SOURCE_TOKEN ??\n env.NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN ??\n env.NEXT_PUBLIC_BETTERSTACK_TOKEN ??\n env.NEXT_PUBLIC_LOGTAIL_TOKEN;\n this.enabled = config.enabled ?? Boolean(hasToken);\n\n // Determine Logtail package to use\n this.logtailPackage = config.logtailPackage ?? this.detectLogtailPackage();\n }\n\n /**\n * Detect which Logtail package to use based on the runtime environment.\n *\n * @returns Package name ('@logtail/next' for Next.js, '@logtail/js' otherwise)\n */\n private detectLogtailPackage(): string {\n // Next.js environments use Next.js package\n if (process.env.NEXT_RUNTIME) {\n return '@logtail/next';\n }\n // All other environments use the unified js package (bundles both node and browser)\n return '@logtail/js';\n }\n\n getClient(): T | undefined {\n return this.client;\n }\n\n /**\n * Get safe environment access (for testing/mocking).\n *\n * @returns Environment configuration object\n */\n protected getSafeEnv() {\n return safeEnv();\n }\n\n async initialize(config?: BetterStackPluginConfig): Promise<void> {\n if (this.initialized || !this.enabled) return;\n\n const env = safeEnv();\n const mergedConfig = { ...this.config, ...config };\n\n // Get source token with priority: config > new env vars > legacy env vars\n const sourceToken =\n mergedConfig.sourceToken ??\n env.BETTER_STACK_SOURCE_TOKEN ??\n env.NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN ??\n env.LOGTAIL_SOURCE_TOKEN ??\n env.BETTERSTACK_SOURCE_TOKEN ??\n env.NEXT_PUBLIC_LOGTAIL_TOKEN ??\n env.NEXT_PUBLIC_BETTERSTACK_TOKEN;\n\n if (!sourceToken) {\n logWarn('Better Stack plugin: No source token provided, skipping initialization');\n this.enabled = false;\n return;\n }\n\n try {\n // Dynamic import of the specified Logtail package\n const LogtailModule = await import(/* webpackIgnore: true */ this.logtailPackage);\n\n // Handle different export patterns\n const LogtailClass = LogtailModule.default ?? LogtailModule.Logtail ?? LogtailModule;\n\n if (!LogtailClass) {\n logError(`Better Stack plugin: Could not find Logtail class in ${this.logtailPackage}`, {\n logtailPackage: this.logtailPackage,\n });\n this.enabled = false;\n return;\n }\n\n // Build configuration object\n const logtailConfig: any = {\n sourceToken,\n };\n\n // Add optional configuration\n if (\n mergedConfig.endpoint ??\n env.BETTER_STACK_INGESTING_URL ??\n env.NEXT_PUBLIC_BETTER_STACK_INGESTING_URL\n ) {\n logtailConfig.endpoint =\n mergedConfig.endpoint ??\n env.BETTER_STACK_INGESTING_URL ??\n env.NEXT_PUBLIC_BETTER_STACK_INGESTING_URL;\n }\n\n // Initialize the client\n this.client = new LogtailClass(logtailConfig) as T;\n\n this.initialized = true;\n } catch (error) {\n logError(`Failed to import Logtail package '${this.logtailPackage}'`, {\n error,\n logtailPackage: this.logtailPackage,\n });\n this.enabled = false;\n }\n }\n\n async shutdown(): Promise<void> {\n if (this.client && this.initialized) {\n await this.client.flush();\n this.initialized = false;\n }\n }\n\n captureException(error: Error | unknown, context?: ObservabilityContext): void {\n if (!this.enabled || !this.client) return;\n\n const errorObj = error instanceof Error ? error : new Error(String(error));\n\n // Build structured data\n const data = {\n error: {\n name: errorObj.name,\n message: errorObj.message,\n stack: errorObj.stack,\n },\n context: context?.extra,\n tags: context?.tags,\n user: context?.user ?? this.currentUser,\n breadcrumbs: this.getRecentBreadcrumbs(MAX_BREADCRUMBS_IN_CONTEXT),\n };\n\n this.client.error(errorObj.message, data);\n }\n\n captureMessage(message: string, level: LogLevel = 'info', context?: ObservabilityContext): void {\n if (!this.enabled || !this.client) return;\n\n // Build structured data\n const data = {\n level,\n context: context?.extra,\n tags: context?.tags,\n user: context?.user ?? this.currentUser,\n breadcrumbs: this.getRecentBreadcrumbs(MAX_BREADCRUMBS_IN_CONTEXT),\n };\n\n // Map log levels to Logtail methods\n switch (level) {\n case 'debug':\n this.client.debug(message, data);\n break;\n case 'warning':\n this.client.warn(message, data);\n break;\n case 'error':\n this.client.error(message, data);\n break;\n case 'info':\n default:\n this.client.info(message, data);\n break;\n }\n }\n\n setUser(user: ObservabilityUser | null): void {\n if (!this.enabled) return;\n this.currentUser = user;\n }\n\n addBreadcrumb(breadcrumb: Breadcrumb): void {\n if (!this.enabled) return;\n\n const enriched = {\n ...breadcrumb,\n timestamp: breadcrumb.timestamp ?? Date.now() / 1000,\n };\n\n // Use circular buffer to avoid array reallocation\n if (this.breadcrumbs.length < MAX_BREADCRUMBS_STORED) {\n this.breadcrumbs.push(enriched);\n } else {\n // Overwrite oldest entry (circular buffer)\n this.breadcrumbs[this.breadcrumbIndex] = enriched;\n this.breadcrumbIndex = (this.breadcrumbIndex + 1) % MAX_BREADCRUMBS_STORED;\n }\n }\n\n /**\n * Get the most recent breadcrumbs in chronological order\n * @param count - Number of breadcrumbs to retrieve\n * @returns Array of recent breadcrumbs\n */\n private getRecentBreadcrumbs(count: number): Breadcrumb[] {\n const { length } = this.breadcrumbs;\n if (length === 0) return [];\n if (length <= count) return this.breadcrumbs.slice();\n\n // If buffer is not full yet, return last N items from end of array\n if (length < MAX_BREADCRUMBS_STORED) {\n return this.breadcrumbs.slice(length - count);\n }\n\n // Circular buffer logic:\n // - When the buffer is full, `this.breadcrumbIndex` points to the oldest entry (the next to be overwritten).\n // - The most recent breadcrumb is at index `(this.breadcrumbIndex - 1 + length) % length`.\n // - To get the last `count` breadcrumbs in chronological order, we start at\n // `(this.breadcrumbIndex - count + length) % length` and read `count` entries, wrapping around as needed.\n // - This ensures we always get the correct slice, even if the buffer has wrapped around.\n const result: Breadcrumb[] = [];\n const start = (this.breadcrumbIndex - count + length) % length;\n\n for (let i = 0; i < count; i++) {\n const index = (start + i) % length;\n const breadcrumb = this.breadcrumbs[index];\n if (breadcrumb) {\n result.push(breadcrumb);\n }\n }\n\n return result;\n }\n\n withScope(callback: (scope: any) => void): void {\n if (!this.enabled) return;\n\n try {\n // Simple scope implementation\n const scope = {\n setContext: (_key: string, _context: unknown) => {\n // Could store this for next log entry\n },\n setUser: (user: ObservabilityUser | null) => {\n this.setUser(user);\n },\n };\n callback(scope);\n } catch {\n // Gracefully handle scope errors\n }\n }\n\n async flush(_timeout?: number): Promise<boolean> {\n if (!this.enabled || !this.client) return true;\n\n try {\n await this.client.flush();\n return true;\n } catch (error) {\n logError('Better Stack flush error', { error });\n return false;\n }\n }\n}\n\n/**\n * Factory function to create a Better Stack plugin.\n *\n * Creates a configured BetterStackPlugin instance with optional configuration.\n * Auto-detects the appropriate @logtail package based on the environment.\n *\n * @param config - Optional Better Stack plugin configuration\n * @returns BetterStackPlugin instance\n *\n * @example\n * ```typescript\n * const betterstack = createBetterStackPlugin({\n * sourceToken: '...',\n * logLevel: 'info',\n * });\n * ```\n */\nexport const createBetterStackPlugin = <T extends LogtailClient = LogtailClient>(\n config?: BetterStackPluginConfig,\n): BetterStackPlugin<T> => {\n return new BetterStackPlugin<T>(config);\n};\n"],"mappings":";;;;;;;;;;;;;AAsBA,MAAM,6BAA6B;;;;;AAMnC,MAAM,yBAAyB;;;;;;;;;;;AA+C/B,IAAa,oBAAb,MAE0C;CACxC,OAAO;CACP;CACA,AAAU;CACV,AAAU,cAAc;CACxB,AAAU;CACV,AAAU,cAAwC;CAClD,AAAU,cAA4B,EAAE;CACxC,AAAU,kBAAkB;CAC5B,AAAU;;;;;;CAOV,YAAY,SAAkC,EAAE,EAAE;AAChD,OAAK,SAAS;EACd,MAAM,MAAM,SAAS;EAErB,MAAM,WACJ,OAAO,eACP,IAAI,6BACJ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MAAM,EAAE,WAAW,KAAK;AACxB,MAAI,WAAW,EAAG,QAAO,EAAE;AAC3B,MAAI,UAAU,MAAO,QAAO,KAAK,YAAY,OAAO;AAGpD,MAAI,SAAS,uBACX,QAAO,KAAK,YAAY,MAAM,SAAS,MAAM;EAS/C,MAAM,SAAuB,EAAE;EAC/B,MAAM,SAAS,KAAK,kBAAkB,QAAQ,UAAU;AAExD,OAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;GAC9B,MAAM,SAAS,QAAQ,KAAK;GAC5B,MAAM,aAAa,KAAK,YAAY;AACpC,OAAI,WACF,QAAO,KAAK,WAAW;;AAI3B,SAAO;;CAGT,UAAU,UAAsC;AAC9C,MAAI,CAAC,KAAK,QAAS;AAEnB,MAAI;AAUF,YARc;IACZ,aAAa,MAAc,aAAsB;IAGjD,UAAU,SAAmC;AAC3C,UAAK,QAAQ,KAAK;;IAErB,CACc;UACT;;CAKV,MAAM,MAAM,UAAqC;AAC/C,MAAI,CAAC,KAAK,WAAW,CAAC,KAAK,OAAQ,QAAO;AAE1C,MAAI;AACF,SAAM,KAAK,OAAO,OAAO;AACzB,UAAO;WACA,OAAO;AACd,YAAS,4BAA4B,EAAE,OAAO,CAAC;AAC/C,UAAO;;;;;;;;;;;;;;;;;;;;;AAsBb,MAAa,2BACX,WACyB;AACzB,QAAO,IAAI,kBAAqB,OAAO"}
@@ -57,4 +57,4 @@ interface PluginLifecycle {
57
57
  }
58
58
  //#endregion
59
59
  export { Breadcrumb as a, ObservabilityConfig as c, ObservabilityServer as d, ObservabilityUser as f, PluginLifecycle as i, ObservabilityContext as l, ObservabilityServerPlugin as n, LogLevel as o, PluginFactory as r, ObservabilityClient as s, ObservabilityPlugin as t, ObservabilityScope as u };
60
- //# sourceMappingURL=plugin-Bfq-o3nr.d.mts.map
60
+ //# sourceMappingURL=plugin-pvH_kv0a.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-Bfq-o3nr.d.mts","names":[],"sources":["../src/core/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,wBACP,mBAAA,CAAoB,OAAA,GAAU,mBAAA;AAAA,KAO5B,aAAA,0BAAuC,mBAAA,KACjD,MAAA,GAAS,OAAA,KACN,OAAA;AAAA,UAKY,eAAA;EACf,OAAA,IAAW,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,mBAAA;EACjC,aAAA,IAAiB,MAAA,EAAQ,mBAAA;EACzB,UAAA,IAAc,MAAA,EAAQ,mBAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { logWarn } from "@od-oneapp/shared/logger";
1
+ import { r as logWarn } from "./core-BgKCqXjb.mjs";
2
2
  import { createEnv } from "@t3-oss/env-core";
3
3
  import { z } from "zod/v4";
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"plugins-betterstack-env.mjs","names":[],"sources":["../src/plugins/betterstack/env.ts"],"sourcesContent":["/**\n * @fileoverview Better Stack (Logtail) environment configuration\n * Better Stack (Logtail) environment configuration\n * Updated to support official @logtail packages\n */\n\nimport { logWarn } from '@repo/shared/logger';\nimport { createEnv } from '@t3-oss/env-core';\nimport { z } from 'zod/v4';\n\n// Create validated env object\nexport const env = createEnv({\n server: {\n // Legacy support\n LOGTAIL_SOURCE_TOKEN: z.string().optional(),\n BETTERSTACK_SOURCE_TOKEN: z.string().optional(),\n\n // Official Better Stack environment variables\n BETTER_STACK_SOURCE_TOKEN: z.string().optional(),\n BETTER_STACK_INGESTING_URL: z.string().url().optional(),\n BETTER_STACK_LOG_LEVEL: z.enum(['debug', 'info', 'warn', 'error', 'off']).optional(),\n },\n client: {\n // Legacy support\n NEXT_PUBLIC_LOGTAIL_TOKEN: z.string().optional(),\n NEXT_PUBLIC_BETTERSTACK_TOKEN: z.string().optional(),\n\n // Official Better Stack client environment variables\n NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN: z.string().optional(),\n NEXT_PUBLIC_BETTER_STACK_INGESTING_URL: z.string().url().optional(),\n NEXT_PUBLIC_BETTER_STACK_LOG_LEVEL: z\n .enum(['debug', 'info', 'warn', 'error', 'off'])\n .optional(),\n },\n clientPrefix: 'NEXT_PUBLIC_',\n runtimeEnv: process.env,\n emptyStringAsUndefined: true,\n onInvalidAccess: (variable: string) => {\n throw new Error(\n `❌ Attempted to access a server-side environment variable on the client: ${variable}`,\n );\n },\n onValidationError: error => {\n logWarn('Better Stack environment validation failed', { error });\n // Don't throw in packages - use fallbacks\n return undefined as never;\n },\n});\n\n/**\n * Safe environment access for non-Next.js contexts.\n *\n * Provides fallback environment variable access for Node.js, workers, and test environments\n * where the validated env object may not be available. Returns fallback values with proper\n * priority handling for legacy and official Better Stack variable names.\n *\n * @returns Environment object with Better Stack configuration values\n */\nexport function safeEnv() {\n if (env) return env;\n\n // Fallback values for resilience with proper priority\n return {\n // Legacy support\n LOGTAIL_SOURCE_TOKEN:\n process.env.LOGTAIL_SOURCE_TOKEN ?? process.env.BETTERSTACK_SOURCE_TOKEN ?? '',\n BETTERSTACK_SOURCE_TOKEN:\n process.env.BETTERSTACK_SOURCE_TOKEN ?? process.env.LOGTAIL_SOURCE_TOKEN ?? '',\n NEXT_PUBLIC_LOGTAIL_TOKEN:\n process.env.NEXT_PUBLIC_LOGTAIL_TOKEN ?? process.env.NEXT_PUBLIC_BETTERSTACK_TOKEN ?? '',\n NEXT_PUBLIC_BETTERSTACK_TOKEN:\n process.env.NEXT_PUBLIC_BETTERSTACK_TOKEN ?? process.env.NEXT_PUBLIC_LOGTAIL_TOKEN ?? '',\n\n // Official Better Stack (preferred)\n BETTER_STACK_SOURCE_TOKEN:\n process.env.BETTER_STACK_SOURCE_TOKEN ??\n process.env.LOGTAIL_SOURCE_TOKEN ??\n process.env.BETTERSTACK_SOURCE_TOKEN ??\n '',\n BETTER_STACK_INGESTING_URL: process.env.BETTER_STACK_INGESTING_URL ?? '',\n BETTER_STACK_LOG_LEVEL:\n (process.env.BETTER_STACK_LOG_LEVEL as 'debug' | 'info' | 'warn' | 'error' | 'off') ?? 'info',\n NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN:\n process.env.NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN ??\n process.env.NEXT_PUBLIC_LOGTAIL_TOKEN ??\n process.env.NEXT_PUBLIC_BETTERSTACK_TOKEN ??\n '',\n NEXT_PUBLIC_BETTER_STACK_INGESTING_URL:\n process.env.NEXT_PUBLIC_BETTER_STACK_INGESTING_URL ?? '',\n NEXT_PUBLIC_BETTER_STACK_LOG_LEVEL:\n (process.env.NEXT_PUBLIC_BETTER_STACK_LOG_LEVEL as\n | 'debug'\n | 'info'\n | 'warn'\n | 'error'\n | 'off') ?? 'info',\n };\n}\n\n// Export type\nexport type Env = typeof env;\n"],"mappings":";;;;;;;;;;AAWA,MAAa,MAAM,UAAU;CAC3B,QAAQ;EAEN,sBAAsB,EAAE,QAAQ,CAAC,UAAU;EAC3C,0BAA0B,EAAE,QAAQ,CAAC,UAAU;EAG/C,2BAA2B,EAAE,QAAQ,CAAC,UAAU;EAChD,4BAA4B,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACvD,wBAAwB,EAAE,KAAK;GAAC;GAAS;GAAQ;GAAQ;GAAS;GAAM,CAAC,CAAC,UAAU;EACrF;CACD,QAAQ;EAEN,2BAA2B,EAAE,QAAQ,CAAC,UAAU;EAChD,+BAA+B,EAAE,QAAQ,CAAC,UAAU;EAGpD,uCAAuC,EAAE,QAAQ,CAAC,UAAU;EAC5D,wCAAwC,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACnE,oCAAoC,EACjC,KAAK;GAAC;GAAS;GAAQ;GAAQ;GAAS;GAAM,CAAC,CAC/C,UAAU;EACd;CACD,cAAc;CACd,YAAY,QAAQ;CACpB,wBAAwB;CACxB,kBAAkB,aAAqB;AACrC,QAAM,IAAI,MACR,2EAA2E,WAC5E;;CAEH,oBAAmB,UAAS;AAC1B,UAAQ,8CAA8C,EAAE,OAAO,CAAC;;CAInE,CAAC;;;;;;;;;;AAWF,SAAgB,UAAU;AACxB,KAAI,IAAK,QAAO;AAGhB,QAAO;EAEL,sBACE,QAAQ,IAAI,wBAAwB,QAAQ,IAAI,4BAA4B;EAC9E,0BACE,QAAQ,IAAI,4BAA4B,QAAQ,IAAI,wBAAwB;EAC9E,2BACE,QAAQ,IAAI,6BAA6B,QAAQ,IAAI,iCAAiC;EACxF,+BACE,QAAQ,IAAI,iCAAiC,QAAQ,IAAI,6BAA6B;EAGxF,2BACE,QAAQ,IAAI,6BACZ,QAAQ,IAAI,wBACZ,QAAQ,IAAI,4BACZ;EACF,4BAA4B,QAAQ,IAAI,8BAA8B;EACtE,wBACG,QAAQ,IAAI,0BAA0E;EACzF,uCACE,QAAQ,IAAI,yCACZ,QAAQ,IAAI,6BACZ,QAAQ,IAAI,iCACZ;EACF,wCACE,QAAQ,IAAI,0CAA0C;EACxD,oCACG,QAAQ,IAAI,sCAKC;EACjB"}
1
+ {"version":3,"file":"plugins-betterstack-env.mjs","names":[],"sources":["../src/plugins/betterstack/env.ts"],"sourcesContent":["/**\n * @fileoverview Better Stack (Logtail) environment configuration\n * Better Stack (Logtail) environment configuration\n * Updated to support official @logtail packages\n */\n\nimport { logWarn } from '@od-oneapp/shared/logger';\nimport { createEnv } from '@t3-oss/env-core';\nimport { z } from 'zod/v4';\n\n// Create validated env object\nexport const env = createEnv({\n server: {\n // Legacy support\n LOGTAIL_SOURCE_TOKEN: z.string().optional(),\n BETTERSTACK_SOURCE_TOKEN: z.string().optional(),\n\n // Official Better Stack environment variables\n BETTER_STACK_SOURCE_TOKEN: z.string().optional(),\n BETTER_STACK_INGESTING_URL: z.string().url().optional(),\n BETTER_STACK_LOG_LEVEL: z.enum(['debug', 'info', 'warn', 'error', 'off']).optional(),\n },\n client: {\n // Legacy support\n NEXT_PUBLIC_LOGTAIL_TOKEN: z.string().optional(),\n NEXT_PUBLIC_BETTERSTACK_TOKEN: z.string().optional(),\n\n // Official Better Stack client environment variables\n NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN: z.string().optional(),\n NEXT_PUBLIC_BETTER_STACK_INGESTING_URL: z.string().url().optional(),\n NEXT_PUBLIC_BETTER_STACK_LOG_LEVEL: z\n .enum(['debug', 'info', 'warn', 'error', 'off'])\n .optional(),\n },\n clientPrefix: 'NEXT_PUBLIC_',\n runtimeEnv: process.env,\n emptyStringAsUndefined: true,\n onInvalidAccess: (variable: string) => {\n throw new Error(\n `❌ Attempted to access a server-side environment variable on the client: ${variable}`,\n );\n },\n onValidationError: error => {\n logWarn('Better Stack environment validation failed', { error });\n // Don't throw in packages - use fallbacks\n return undefined as never;\n },\n});\n\n/**\n * Safe environment access for non-Next.js contexts.\n *\n * Provides fallback environment variable access for Node.js, workers, and test environments\n * where the validated env object may not be available. Returns fallback values with proper\n * priority handling for legacy and official Better Stack variable names.\n *\n * @returns Environment object with Better Stack configuration values\n */\nexport function safeEnv() {\n if (env) return env;\n\n // Fallback values for resilience with proper priority\n return {\n // Legacy support\n LOGTAIL_SOURCE_TOKEN:\n process.env.LOGTAIL_SOURCE_TOKEN ?? process.env.BETTERSTACK_SOURCE_TOKEN ?? '',\n BETTERSTACK_SOURCE_TOKEN:\n process.env.BETTERSTACK_SOURCE_TOKEN ?? process.env.LOGTAIL_SOURCE_TOKEN ?? '',\n NEXT_PUBLIC_LOGTAIL_TOKEN:\n process.env.NEXT_PUBLIC_LOGTAIL_TOKEN ?? process.env.NEXT_PUBLIC_BETTERSTACK_TOKEN ?? '',\n NEXT_PUBLIC_BETTERSTACK_TOKEN:\n process.env.NEXT_PUBLIC_BETTERSTACK_TOKEN ?? process.env.NEXT_PUBLIC_LOGTAIL_TOKEN ?? '',\n\n // Official Better Stack (preferred)\n BETTER_STACK_SOURCE_TOKEN:\n process.env.BETTER_STACK_SOURCE_TOKEN ??\n process.env.LOGTAIL_SOURCE_TOKEN ??\n process.env.BETTERSTACK_SOURCE_TOKEN ??\n '',\n BETTER_STACK_INGESTING_URL: process.env.BETTER_STACK_INGESTING_URL ?? '',\n BETTER_STACK_LOG_LEVEL:\n (process.env.BETTER_STACK_LOG_LEVEL as 'debug' | 'info' | 'warn' | 'error' | 'off') ?? 'info',\n NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN:\n process.env.NEXT_PUBLIC_BETTER_STACK_SOURCE_TOKEN ??\n process.env.NEXT_PUBLIC_LOGTAIL_TOKEN ??\n process.env.NEXT_PUBLIC_BETTERSTACK_TOKEN ??\n '',\n NEXT_PUBLIC_BETTER_STACK_INGESTING_URL:\n process.env.NEXT_PUBLIC_BETTER_STACK_INGESTING_URL ?? '',\n NEXT_PUBLIC_BETTER_STACK_LOG_LEVEL:\n (process.env.NEXT_PUBLIC_BETTER_STACK_LOG_LEVEL as\n | 'debug'\n | 'info'\n | 'warn'\n | 'error'\n | 'off') ?? 'info',\n };\n}\n\n// Export type\nexport type Env = typeof env;\n"],"mappings":";;;;;;;;;;AAWA,MAAa,MAAM,UAAU;CAC3B,QAAQ;EAEN,sBAAsB,EAAE,QAAQ,CAAC,UAAU;EAC3C,0BAA0B,EAAE,QAAQ,CAAC,UAAU;EAG/C,2BAA2B,EAAE,QAAQ,CAAC,UAAU;EAChD,4BAA4B,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACvD,wBAAwB,EAAE,KAAK;GAAC;GAAS;GAAQ;GAAQ;GAAS;GAAM,CAAC,CAAC,UAAU;EACrF;CACD,QAAQ;EAEN,2BAA2B,EAAE,QAAQ,CAAC,UAAU;EAChD,+BAA+B,EAAE,QAAQ,CAAC,UAAU;EAGpD,uCAAuC,EAAE,QAAQ,CAAC,UAAU;EAC5D,wCAAwC,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACnE,oCAAoC,EACjC,KAAK;GAAC;GAAS;GAAQ;GAAQ;GAAS;GAAM,CAAC,CAC/C,UAAU;EACd;CACD,cAAc;CACd,YAAY,QAAQ;CACpB,wBAAwB;CACxB,kBAAkB,aAAqB;AACrC,QAAM,IAAI,MACR,2EAA2E,WAC5E;;CAEH,oBAAmB,UAAS;AAC1B,UAAQ,8CAA8C,EAAE,OAAO,CAAC;;CAInE,CAAC;;;;;;;;;;AAWF,SAAgB,UAAU;AACxB,KAAI,IAAK,QAAO;AAGhB,QAAO;EAEL,sBACE,QAAQ,IAAI,wBAAwB,QAAQ,IAAI,4BAA4B;EAC9E,0BACE,QAAQ,IAAI,4BAA4B,QAAQ,IAAI,wBAAwB;EAC9E,2BACE,QAAQ,IAAI,6BAA6B,QAAQ,IAAI,iCAAiC;EACxF,+BACE,QAAQ,IAAI,iCAAiC,QAAQ,IAAI,6BAA6B;EAGxF,2BACE,QAAQ,IAAI,6BACZ,QAAQ,IAAI,wBACZ,QAAQ,IAAI,4BACZ;EACF,4BAA4B,QAAQ,IAAI,8BAA8B;EACtE,wBACG,QAAQ,IAAI,0BAA0E;EACzF,uCACE,QAAQ,IAAI,yCACZ,QAAQ,IAAI,6BACZ,QAAQ,IAAI,iCACZ;EACF,wCACE,QAAQ,IAAI,0CAA0C;EACxD,oCACG,QAAQ,IAAI,sCAKC;EACjB"}
@@ -1,4 +1,4 @@
1
- import { n as ObservabilityServerPlugin, t as ObservabilityPlugin } from "./plugin-Bfq-o3nr.mjs";
2
- import { n as BetterStackPluginConfig, r as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-CaQxviDs.mjs";
1
+ import { n as ObservabilityServerPlugin, t as ObservabilityPlugin } from "./plugin-pvH_kv0a.mjs";
2
+ import { n as BetterStackPluginConfig, r as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-CEOGIJFN.mjs";
3
3
  import { Env, env, safeEnv } from "./plugins-betterstack-env.mjs";
4
4
  export { BetterStackPlugin, type BetterStackPluginConfig, type Env, type ObservabilityPlugin, type ObservabilityServerPlugin, createBetterStackPlugin, env, safeEnv };
@@ -1,4 +1,4 @@
1
1
  import { env, safeEnv } from "./plugins-betterstack-env.mjs";
2
- import { n as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-lPdJirTY.mjs";
2
+ import { n as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-LhaOv4eq.mjs";
3
3
 
4
4
  export { BetterStackPlugin, createBetterStackPlugin, env, safeEnv };
@@ -1,4 +1,4 @@
1
- import { a as Breadcrumb, f as ObservabilityUser, l as ObservabilityContext, n as ObservabilityServerPlugin, o as LogLevel, r as PluginFactory, t as ObservabilityPlugin } from "./plugin-Bfq-o3nr.mjs";
1
+ import { a as Breadcrumb, f as ObservabilityUser, l as ObservabilityContext, n as ObservabilityServerPlugin, o as LogLevel, r as PluginFactory, t as ObservabilityPlugin } from "./plugin-pvH_kv0a.mjs";
2
2
 
3
3
  //#region src/plugins/console/index.d.ts
4
4
  interface ConsolePluginConfig {
@@ -4,14 +4,14 @@ declare const env: Readonly<{
4
4
  SENTRY_AUTH_TOKEN?: string | undefined;
5
5
  SENTRY_ORG?: string | undefined;
6
6
  SENTRY_PROJECT?: string | undefined;
7
- SENTRY_ENVIRONMENT?: "development" | "preview" | "production" | undefined;
7
+ SENTRY_ENVIRONMENT?: "development" | "production" | "preview" | undefined;
8
8
  SENTRY_RELEASE?: string | undefined;
9
9
  SENTRY_TRACES_SAMPLE_RATE?: number | undefined;
10
10
  SENTRY_PROFILES_SAMPLE_RATE?: number | undefined;
11
11
  SENTRY_REPLAYS_SESSION_SAMPLE_RATE?: number | undefined;
12
12
  SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE?: number | undefined;
13
13
  NEXT_PUBLIC_SENTRY_DSN?: string | undefined;
14
- NEXT_PUBLIC_SENTRY_ENVIRONMENT?: "development" | "preview" | "production" | undefined;
14
+ NEXT_PUBLIC_SENTRY_ENVIRONMENT?: "development" | "production" | "preview" | undefined;
15
15
  NEXT_PUBLIC_SENTRY_RELEASE?: string | undefined;
16
16
  SENTRY_DEBUG: boolean;
17
17
  }>;
@@ -20,14 +20,14 @@ declare function safeEnv(): Readonly<{
20
20
  SENTRY_AUTH_TOKEN?: string | undefined;
21
21
  SENTRY_ORG?: string | undefined;
22
22
  SENTRY_PROJECT?: string | undefined;
23
- SENTRY_ENVIRONMENT?: "development" | "preview" | "production" | undefined;
23
+ SENTRY_ENVIRONMENT?: "development" | "production" | "preview" | undefined;
24
24
  SENTRY_RELEASE?: string | undefined;
25
25
  SENTRY_TRACES_SAMPLE_RATE?: number | undefined;
26
26
  SENTRY_PROFILES_SAMPLE_RATE?: number | undefined;
27
27
  SENTRY_REPLAYS_SESSION_SAMPLE_RATE?: number | undefined;
28
28
  SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE?: number | undefined;
29
29
  NEXT_PUBLIC_SENTRY_DSN?: string | undefined;
30
- NEXT_PUBLIC_SENTRY_ENVIRONMENT?: "development" | "preview" | "production" | undefined;
30
+ NEXT_PUBLIC_SENTRY_ENVIRONMENT?: "development" | "production" | "preview" | undefined;
31
31
  NEXT_PUBLIC_SENTRY_RELEASE?: string | undefined;
32
32
  SENTRY_DEBUG: boolean;
33
33
  }>;
@@ -1,4 +1,4 @@
1
- import { logWarn } from "@od-oneapp/shared/logger";
1
+ import { r as logWarn } from "./core-BgKCqXjb.mjs";
2
2
  import { createEnv } from "@t3-oss/env-core";
3
3
  import { z } from "zod/v4";
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"plugins-sentry-env.mjs","names":[],"sources":["../src/plugins/sentry/env.ts"],"sourcesContent":["/**\n * @fileoverview Sentry-specific environment configuration\n * Sentry-specific environment configuration\n * Apps can extend this configuration to inherit Sentry environment variables\n */\n\nimport { logWarn } from '@repo/shared/logger';\nimport { createEnv } from '@t3-oss/env-core';\nimport { z } from 'zod/v4';\n\n// Create validated env object\nexport const env = createEnv({\n server: {\n SENTRY_DSN: z.string().url().optional(),\n SENTRY_AUTH_TOKEN: z.string().optional(),\n SENTRY_ORG: z.string().optional(),\n SENTRY_PROJECT: z.string().optional(),\n SENTRY_ENVIRONMENT: z.enum(['development', 'preview', 'production']).optional(),\n SENTRY_RELEASE: z.string().optional(),\n SENTRY_TRACES_SAMPLE_RATE: z.coerce.number().min(0).max(1).optional(),\n SENTRY_PROFILES_SAMPLE_RATE: z.coerce.number().min(0).max(1).optional(),\n SENTRY_REPLAYS_SESSION_SAMPLE_RATE: z.coerce.number().min(0).max(1).optional(),\n SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE: z.coerce.number().min(0).max(1).optional(),\n SENTRY_DEBUG: z\n .string()\n .optional()\n .transform(val => val === 'true')\n .default(false),\n },\n clientPrefix: 'NEXT_PUBLIC_',\n client: {\n NEXT_PUBLIC_SENTRY_DSN: z.string().url().optional(),\n NEXT_PUBLIC_SENTRY_ENVIRONMENT: z.enum(['development', 'preview', 'production']).optional(),\n NEXT_PUBLIC_SENTRY_RELEASE: z.string().optional(),\n },\n runtimeEnv: process.env,\n emptyStringAsUndefined: true,\n onInvalidAccess: (variable: string) => {\n throw new Error(\n `❌ Attempted to access a server-side environment variable on the client: ${variable}`,\n );\n },\n onValidationError: error => {\n // Note: Using logWarn during env validation - shared logger is always available\n logWarn('Sentry environment validation failed', { error });\n // Don't throw in packages - use fallbacks\n return undefined as never;\n },\n});\n\n/**\n * Safe environment access for non-Next.js contexts.\n *\n * Provides fallback environment variable access for Node.js, workers, and test environments\n * where the validated env object may not be available. Returns fallback values with proper\n * type coercion and defaults.\n *\n * @returns Environment object with Sentry configuration values\n */\nexport function safeEnv() {\n if (env) return env;\n\n // Fallback values for resilience\n return {\n // Server\n SENTRY_DSN: process.env.SENTRY_DSN ?? '',\n SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN ?? '',\n SENTRY_ORG: process.env.SENTRY_ORG ?? '',\n SENTRY_PROJECT: process.env.SENTRY_PROJECT ?? '',\n SENTRY_ENVIRONMENT:\n (process.env.SENTRY_ENVIRONMENT as 'development' | 'preview' | 'production') ?? 'development',\n SENTRY_RELEASE: process.env.SENTRY_RELEASE ?? '',\n SENTRY_TRACES_SAMPLE_RATE:\n Number(process.env.SENTRY_TRACES_SAMPLE_RATE) ||\n (process.env.NODE_ENV === 'production' ? 0.1 : 1.0),\n SENTRY_PROFILES_SAMPLE_RATE: Number(process.env.SENTRY_PROFILES_SAMPLE_RATE) ?? 0,\n SENTRY_REPLAYS_SESSION_SAMPLE_RATE:\n Number(process.env.SENTRY_REPLAYS_SESSION_SAMPLE_RATE) ||\n (process.env.NODE_ENV === 'production' ? 0.1 : 0),\n SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE:\n Number(process.env.SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE) || 1.0,\n SENTRY_DEBUG: process.env.SENTRY_DEBUG === 'true',\n // Client\n NEXT_PUBLIC_SENTRY_DSN: process.env.NEXT_PUBLIC_SENTRY_DSN ?? '',\n NEXT_PUBLIC_SENTRY_ENVIRONMENT:\n (process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT as 'development' | 'preview' | 'production') ??\n 'development',\n NEXT_PUBLIC_SENTRY_RELEASE: process.env.NEXT_PUBLIC_SENTRY_RELEASE ?? '',\n };\n}\n\n// Export type\nexport type Env = typeof env;\n"],"mappings":";;;;;;;;;;AAWA,MAAa,MAAM,UAAU;CAC3B,QAAQ;EACN,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACvC,mBAAmB,EAAE,QAAQ,CAAC,UAAU;EACxC,YAAY,EAAE,QAAQ,CAAC,UAAU;EACjC,gBAAgB,EAAE,QAAQ,CAAC,UAAU;EACrC,oBAAoB,EAAE,KAAK;GAAC;GAAe;GAAW;GAAa,CAAC,CAAC,UAAU;EAC/E,gBAAgB,EAAE,QAAQ,CAAC,UAAU;EACrC,2BAA2B,EAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,UAAU;EACrE,6BAA6B,EAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,UAAU;EACvE,oCAAoC,EAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,UAAU;EAC9E,qCAAqC,EAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,UAAU;EAC/E,cAAc,EACX,QAAQ,CACR,UAAU,CACV,WAAU,QAAO,QAAQ,OAAO,CAChC,QAAQ,MAAM;EAClB;CACD,cAAc;CACd,QAAQ;EACN,wBAAwB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACnD,gCAAgC,EAAE,KAAK;GAAC;GAAe;GAAW;GAAa,CAAC,CAAC,UAAU;EAC3F,4BAA4B,EAAE,QAAQ,CAAC,UAAU;EAClD;CACD,YAAY,QAAQ;CACpB,wBAAwB;CACxB,kBAAkB,aAAqB;AACrC,QAAM,IAAI,MACR,2EAA2E,WAC5E;;CAEH,oBAAmB,UAAS;AAE1B,UAAQ,wCAAwC,EAAE,OAAO,CAAC;;CAI7D,CAAC;;;;;;;;;;AAWF,SAAgB,UAAU;AACxB,KAAI,IAAK,QAAO;AAGhB,QAAO;EAEL,YAAY,QAAQ,IAAI,cAAc;EACtC,mBAAmB,QAAQ,IAAI,qBAAqB;EACpD,YAAY,QAAQ,IAAI,cAAc;EACtC,gBAAgB,QAAQ,IAAI,kBAAkB;EAC9C,oBACG,QAAQ,IAAI,sBAAmE;EAClF,gBAAgB,QAAQ,IAAI,kBAAkB;EAC9C,2BACE,OAAO,QAAQ,IAAI,0BAA0B,IACE;EACjD,6BAA6B,OAAO,QAAQ,IAAI,4BAA4B,IAAI;EAChF,oCACE,OAAO,QAAQ,IAAI,mCAAmC,IACP;EACjD,qCACE,OAAO,QAAQ,IAAI,oCAAoC,IAAI;EAC7D,cAAc,QAAQ,IAAI,iBAAiB;EAE3C,wBAAwB,QAAQ,IAAI,0BAA0B;EAC9D,gCACG,QAAQ,IAAI,kCACb;EACF,4BAA4B,QAAQ,IAAI,8BAA8B;EACvE"}
1
+ {"version":3,"file":"plugins-sentry-env.mjs","names":[],"sources":["../src/plugins/sentry/env.ts"],"sourcesContent":["/**\n * @fileoverview Sentry-specific environment configuration\n * Sentry-specific environment configuration\n * Apps can extend this configuration to inherit Sentry environment variables\n */\n\nimport { logWarn } from '@od-oneapp/shared/logger';\nimport { createEnv } from '@t3-oss/env-core';\nimport { z } from 'zod/v4';\n\n// Create validated env object\nexport const env = createEnv({\n server: {\n SENTRY_DSN: z.string().url().optional(),\n SENTRY_AUTH_TOKEN: z.string().optional(),\n SENTRY_ORG: z.string().optional(),\n SENTRY_PROJECT: z.string().optional(),\n SENTRY_ENVIRONMENT: z.enum(['development', 'preview', 'production']).optional(),\n SENTRY_RELEASE: z.string().optional(),\n SENTRY_TRACES_SAMPLE_RATE: z.coerce.number().min(0).max(1).optional(),\n SENTRY_PROFILES_SAMPLE_RATE: z.coerce.number().min(0).max(1).optional(),\n SENTRY_REPLAYS_SESSION_SAMPLE_RATE: z.coerce.number().min(0).max(1).optional(),\n SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE: z.coerce.number().min(0).max(1).optional(),\n SENTRY_DEBUG: z\n .string()\n .optional()\n .transform(val => val === 'true')\n .default(false),\n },\n clientPrefix: 'NEXT_PUBLIC_',\n client: {\n NEXT_PUBLIC_SENTRY_DSN: z.string().url().optional(),\n NEXT_PUBLIC_SENTRY_ENVIRONMENT: z.enum(['development', 'preview', 'production']).optional(),\n NEXT_PUBLIC_SENTRY_RELEASE: z.string().optional(),\n },\n runtimeEnv: process.env,\n emptyStringAsUndefined: true,\n onInvalidAccess: (variable: string) => {\n throw new Error(\n `❌ Attempted to access a server-side environment variable on the client: ${variable}`,\n );\n },\n onValidationError: error => {\n // Note: Using logWarn during env validation - shared logger is always available\n logWarn('Sentry environment validation failed', { error });\n // Don't throw in packages - use fallbacks\n return undefined as never;\n },\n});\n\n/**\n * Safe environment access for non-Next.js contexts.\n *\n * Provides fallback environment variable access for Node.js, workers, and test environments\n * where the validated env object may not be available. Returns fallback values with proper\n * type coercion and defaults.\n *\n * @returns Environment object with Sentry configuration values\n */\nexport function safeEnv() {\n if (env) return env;\n\n // Fallback values for resilience\n return {\n // Server\n SENTRY_DSN: process.env.SENTRY_DSN ?? '',\n SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN ?? '',\n SENTRY_ORG: process.env.SENTRY_ORG ?? '',\n SENTRY_PROJECT: process.env.SENTRY_PROJECT ?? '',\n SENTRY_ENVIRONMENT:\n (process.env.SENTRY_ENVIRONMENT as 'development' | 'preview' | 'production') ?? 'development',\n SENTRY_RELEASE: process.env.SENTRY_RELEASE ?? '',\n SENTRY_TRACES_SAMPLE_RATE:\n Number(process.env.SENTRY_TRACES_SAMPLE_RATE) ||\n (process.env.NODE_ENV === 'production' ? 0.1 : 1.0),\n SENTRY_PROFILES_SAMPLE_RATE: Number(process.env.SENTRY_PROFILES_SAMPLE_RATE) ?? 0,\n SENTRY_REPLAYS_SESSION_SAMPLE_RATE:\n Number(process.env.SENTRY_REPLAYS_SESSION_SAMPLE_RATE) ||\n (process.env.NODE_ENV === 'production' ? 0.1 : 0),\n SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE:\n Number(process.env.SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE) || 1.0,\n SENTRY_DEBUG: process.env.SENTRY_DEBUG === 'true',\n // Client\n NEXT_PUBLIC_SENTRY_DSN: process.env.NEXT_PUBLIC_SENTRY_DSN ?? '',\n NEXT_PUBLIC_SENTRY_ENVIRONMENT:\n (process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT as 'development' | 'preview' | 'production') ??\n 'development',\n NEXT_PUBLIC_SENTRY_RELEASE: process.env.NEXT_PUBLIC_SENTRY_RELEASE ?? '',\n };\n}\n\n// Export type\nexport type Env = typeof env;\n"],"mappings":";;;;;;;;;;AAWA,MAAa,MAAM,UAAU;CAC3B,QAAQ;EACN,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACvC,mBAAmB,EAAE,QAAQ,CAAC,UAAU;EACxC,YAAY,EAAE,QAAQ,CAAC,UAAU;EACjC,gBAAgB,EAAE,QAAQ,CAAC,UAAU;EACrC,oBAAoB,EAAE,KAAK;GAAC;GAAe;GAAW;GAAa,CAAC,CAA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C,IACP;EACjD,qCACE,OAAO,QAAQ,IAAI,oCAAoC,IAAI;EAC7D,cAAc,QAAQ,IAAI,iBAAiB;EAE3C,wBAAwB,QAAQ,IAAI,0BAA0B;EAC9D,gCACG,QAAQ,IAAI,kCACb;EACF,4BAA4B,QAAQ,IAAI,8BAA8B;EACvE"}
@@ -1,4 +1,4 @@
1
- import { logWarn } from "@od-oneapp/shared/logger";
1
+ import { r as logWarn } from "./core-BgKCqXjb.mjs";
2
2
  import { createEnv } from "@t3-oss/env-core";
3
3
  import { z } from "zod/v4";
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"plugins-sentry-microfrontend-env.mjs","names":[],"sources":["../src/plugins/sentry-microfrontend/env.ts"],"sourcesContent":["/**\n * @fileoverview Environment configuration for Sentry Micro Frontend Plugin\n * Environment configuration for Sentry Micro Frontend Plugin\n */\n\nimport { logWarn } from '@repo/shared/logger';\nimport { createEnv } from '@t3-oss/env-core';\nimport { z } from 'zod/v4';\n\n/**\n * Environment configuration specific to Sentry micro frontend functionality\n */\nexport const env = createEnv({\n server: {\n // Backstage app-specific DSNs for server-side\n SENTRY_DSN_CMS: z.string().url().optional(),\n SENTRY_DSN_WORKFLOWS: z.string().url().optional(),\n SENTRY_DSN_AUTHMGMT: z.string().url().optional(),\n\n // Micro frontend configuration\n SENTRY_MICROFRONTEND_MODE: z.enum(['host', 'child', 'standalone']).optional(),\n SENTRY_MICROFRONTEND_ZONE: z.string().optional(),\n\n // Feature toggles\n SENTRY_MICROFRONTEND_ENABLED: z.boolean().optional(),\n SENTRY_MICROFRONTEND_MULTIPLEXED_TRANSPORT: z.boolean().optional(),\n },\n client: {\n // Backstage app-specific DSNs for client-side\n NEXT_PUBLIC_SENTRY_DSN_CMS: z.string().url().optional(),\n NEXT_PUBLIC_SENTRY_DSN_WORKFLOWS: z.string().url().optional(),\n NEXT_PUBLIC_SENTRY_DSN_AUTHMGMT: z.string().url().optional(),\n\n // Client-side micro frontend configuration\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_MODE: z.enum(['host', 'child', 'standalone']).optional(),\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_ZONE: z.string().optional(),\n\n // Feature toggles\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_ENABLED: z.boolean().optional(),\n },\n clientPrefix: 'NEXT_PUBLIC_',\n runtimeEnv: process.env,\n skipValidation: process.env.SKIP_ENV_VALIDATION === 'true' || process.env.NODE_ENV === 'test',\n emptyStringAsUndefined: true,\n onInvalidAccess: (variable: string) => {\n throw new Error(\n `❌ Attempted to access a server-side environment variable on the client: ${variable}`,\n );\n },\n onValidationError: error => {\n // Non-critical plugin, warn but don't throw\n logWarn('Sentry Micro Frontend Plugin env validation failed', { error });\n return undefined as never;\n },\n});\n\n/**\n * Safe environment access for non-Next.js contexts.\n *\n * Provides fallback environment variable access for Node.js, workers, and test environments\n * where the validated env object may not be available. Returns fallback values for Sentry\n * micro frontend configuration.\n *\n * @returns Environment object with Sentry micro frontend configuration values\n */\nexport function safeEnv() {\n if (env) {\n return env;\n }\n\n // Fallback for non-Next.js contexts\n return {\n // Server\n SENTRY_DSN_CMS: process.env.SENTRY_DSN_CMS,\n SENTRY_DSN_WORKFLOWS: process.env.SENTRY_DSN_WORKFLOWS,\n SENTRY_DSN_AUTHMGMT: process.env.SENTRY_DSN_AUTHMGMT,\n SENTRY_MICROFRONTEND_MODE: process.env.SENTRY_MICROFRONTEND_MODE as\n | 'host'\n | 'child'\n | 'standalone'\n | undefined,\n SENTRY_MICROFRONTEND_APP:\n process.env.SENTRY_MICROFRONTEND_APP ?? process.env.SENTRY_MICROFRONTEND_ZONE,\n SENTRY_MICROFRONTEND_ENABLED: process.env.SENTRY_MICROFRONTEND_ENABLED === 'true',\n SENTRY_MICROFRONTEND_MULTIPLEXED_TRANSPORT:\n process.env.SENTRY_MICROFRONTEND_MULTIPLEXED_TRANSPORT === 'true',\n\n // Client\n NEXT_PUBLIC_SENTRY_DSN_CMS: process.env.NEXT_PUBLIC_SENTRY_DSN_CMS,\n NEXT_PUBLIC_SENTRY_DSN_WORKFLOWS: process.env.NEXT_PUBLIC_SENTRY_DSN_WORKFLOWS,\n NEXT_PUBLIC_SENTRY_DSN_AUTHMGMT: process.env.NEXT_PUBLIC_SENTRY_DSN_AUTHMGMT,\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_MODE: process.env.NEXT_PUBLIC_SENTRY_MICROFRONTEND_MODE as\n | 'host'\n | 'child'\n | 'standalone'\n | undefined,\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_APP:\n process.env.NEXT_PUBLIC_SENTRY_MICROFRONTEND_APP ??\n process.env.NEXT_PUBLIC_SENTRY_MICROFRONTEND_ZONE,\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_ENABLED:\n process.env.NEXT_PUBLIC_SENTRY_MICROFRONTEND_ENABLED === 'true',\n };\n}\n\nexport type Env = typeof env;\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,MAAM,UAAU;CAC3B,QAAQ;EAEN,gBAAgB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAC3C,sBAAsB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACjD,qBAAqB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAGhD,2BAA2B,EAAE,KAAK;GAAC;GAAQ;GAAS;GAAa,CAAC,CAAC,UAAU;EAC7E,2BAA2B,EAAE,QAAQ,CAAC,UAAU;EAGhD,8BAA8B,EAAE,SAAS,CAAC,UAAU;EACpD,4CAA4C,EAAE,SAAS,CAAC,UAAU;EACnE;CACD,QAAQ;EAEN,4BAA4B,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACvD,kCAAkC,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAC7D,iCAAiC,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAG5D,uCAAuC,EAAE,KAAK;GAAC;GAAQ;GAAS;GAAa,CAAC,CAAC,UAAU;EACzF,uCAAuC,EAAE,QAAQ,CAAC,UAAU;EAG5D,0CAA0C,EAAE,SAAS,CAAC,UAAU;EACjE;CACD,cAAc;CACd,YAAY,QAAQ;CACpB,gBAAgB,QAAQ,IAAI,wBAAwB,UAAU;CAC9D,wBAAwB;CACxB,kBAAkB,aAAqB;AACrC,QAAM,IAAI,MACR,2EAA2E,WAC5E;;CAEH,oBAAmB,UAAS;AAE1B,UAAQ,sDAAsD,EAAE,OAAO,CAAC;;CAG3E,CAAC;;;;;;;;;;AAWF,SAAgB,UAAU;AACxB,KAAI,IACF,QAAO;AAIT,QAAO;EAEL,gBAAgB,QAAQ,IAAI;EAC5B,sBAAsB,QAAQ,IAAI;EAClC,qBAAqB,QAAQ,IAAI;EACjC,2BAA2B,QAAQ,IAAI;EAKvC,0BACE,QAAQ,IAAI,4BAA4B,QAAQ,IAAI;EACtD,8BAA8B,QAAQ,IAAI,iCAAiC;EAC3E,4CACE,QAAQ,IAAI,+CAA+C;EAG7D,4BAA4B,QAAQ,IAAI;EACxC,kCAAkC,QAAQ,IAAI;EAC9C,iCAAiC,QAAQ,IAAI;EAC7C,uCAAuC,QAAQ,IAAI;EAKnD,sCACE,QAAQ,IAAI,wCACZ,QAAQ,IAAI;EACd,0CACE,QAAQ,IAAI,6CAA6C;EAC5D"}
1
+ {"version":3,"file":"plugins-sentry-microfrontend-env.mjs","names":[],"sources":["../src/plugins/sentry-microfrontend/env.ts"],"sourcesContent":["/**\n * @fileoverview Environment configuration for Sentry Micro Frontend Plugin\n * Environment configuration for Sentry Micro Frontend Plugin\n */\n\nimport { logWarn } from '@od-oneapp/shared/logger';\nimport { createEnv } from '@t3-oss/env-core';\nimport { z } from 'zod/v4';\n\n/**\n * Environment configuration specific to Sentry micro frontend functionality\n */\nexport const env = createEnv({\n server: {\n // Backstage app-specific DSNs for server-side\n SENTRY_DSN_CMS: z.string().url().optional(),\n SENTRY_DSN_WORKFLOWS: z.string().url().optional(),\n SENTRY_DSN_AUTHMGMT: z.string().url().optional(),\n\n // Micro frontend configuration\n SENTRY_MICROFRONTEND_MODE: z.enum(['host', 'child', 'standalone']).optional(),\n SENTRY_MICROFRONTEND_ZONE: z.string().optional(),\n\n // Feature toggles\n SENTRY_MICROFRONTEND_ENABLED: z.boolean().optional(),\n SENTRY_MICROFRONTEND_MULTIPLEXED_TRANSPORT: z.boolean().optional(),\n },\n client: {\n // Backstage app-specific DSNs for client-side\n NEXT_PUBLIC_SENTRY_DSN_CMS: z.string().url().optional(),\n NEXT_PUBLIC_SENTRY_DSN_WORKFLOWS: z.string().url().optional(),\n NEXT_PUBLIC_SENTRY_DSN_AUTHMGMT: z.string().url().optional(),\n\n // Client-side micro frontend configuration\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_MODE: z.enum(['host', 'child', 'standalone']).optional(),\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_ZONE: z.string().optional(),\n\n // Feature toggles\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_ENABLED: z.boolean().optional(),\n },\n clientPrefix: 'NEXT_PUBLIC_',\n runtimeEnv: process.env,\n skipValidation: process.env.SKIP_ENV_VALIDATION === 'true' || process.env.NODE_ENV === 'test',\n emptyStringAsUndefined: true,\n onInvalidAccess: (variable: string) => {\n throw new Error(\n `❌ Attempted to access a server-side environment variable on the client: ${variable}`,\n );\n },\n onValidationError: error => {\n // Non-critical plugin, warn but don't throw\n logWarn('Sentry Micro Frontend Plugin env validation failed', { error });\n return undefined as never;\n },\n});\n\n/**\n * Safe environment access for non-Next.js contexts.\n *\n * Provides fallback environment variable access for Node.js, workers, and test environments\n * where the validated env object may not be available. Returns fallback values for Sentry\n * micro frontend configuration.\n *\n * @returns Environment object with Sentry micro frontend configuration values\n */\nexport function safeEnv() {\n if (env) {\n return env;\n }\n\n // Fallback for non-Next.js contexts\n return {\n // Server\n SENTRY_DSN_CMS: process.env.SENTRY_DSN_CMS,\n SENTRY_DSN_WORKFLOWS: process.env.SENTRY_DSN_WORKFLOWS,\n SENTRY_DSN_AUTHMGMT: process.env.SENTRY_DSN_AUTHMGMT,\n SENTRY_MICROFRONTEND_MODE: process.env.SENTRY_MICROFRONTEND_MODE as\n | 'host'\n | 'child'\n | 'standalone'\n | undefined,\n SENTRY_MICROFRONTEND_APP:\n process.env.SENTRY_MICROFRONTEND_APP ?? process.env.SENTRY_MICROFRONTEND_ZONE,\n SENTRY_MICROFRONTEND_ENABLED: process.env.SENTRY_MICROFRONTEND_ENABLED === 'true',\n SENTRY_MICROFRONTEND_MULTIPLEXED_TRANSPORT:\n process.env.SENTRY_MICROFRONTEND_MULTIPLEXED_TRANSPORT === 'true',\n\n // Client\n NEXT_PUBLIC_SENTRY_DSN_CMS: process.env.NEXT_PUBLIC_SENTRY_DSN_CMS,\n NEXT_PUBLIC_SENTRY_DSN_WORKFLOWS: process.env.NEXT_PUBLIC_SENTRY_DSN_WORKFLOWS,\n NEXT_PUBLIC_SENTRY_DSN_AUTHMGMT: process.env.NEXT_PUBLIC_SENTRY_DSN_AUTHMGMT,\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_MODE: process.env.NEXT_PUBLIC_SENTRY_MICROFRONTEND_MODE as\n | 'host'\n | 'child'\n | 'standalone'\n | undefined,\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_APP:\n process.env.NEXT_PUBLIC_SENTRY_MICROFRONTEND_APP ??\n process.env.NEXT_PUBLIC_SENTRY_MICROFRONTEND_ZONE,\n NEXT_PUBLIC_SENTRY_MICROFRONTEND_ENABLED:\n process.env.NEXT_PUBLIC_SENTRY_MICROFRONTEND_ENABLED === 'true',\n };\n}\n\nexport type Env = typeof env;\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,MAAM,UAAU;CAC3B,QAAQ;EAEN,gBAAgB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAC3C,sBAAsB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACjD,qBAAqB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAGhD,2BAA2B,EAAE,KAAK;GAAC;G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import { a as createSentryMicroFrontendPlugin, c as MicroFrontendMode, i as SentryMicroFrontendPlugin, l as SentryMicroFrontendConfig, n as detectCurrentBackstageApp, o as createMultiplexedTransport, r as isHostEnvironment, s as BackstageAppConfig, t as createBackstageScope } from "./utils-DjjqCeoW.mjs";
1
+ import { a as createSentryMicroFrontendPlugin, c as MicroFrontendMode, i as SentryMicroFrontendPlugin, l as SentryMicroFrontendConfig, n as detectCurrentBackstageApp, o as createMultiplexedTransport, r as isHostEnvironment, s as BackstageAppConfig, t as createBackstageScope } from "./utils-6Gg4fkvH.mjs";
2
2
  export { type BackstageAppConfig, type MicroFrontendMode, type SentryMicroFrontendConfig, SentryMicroFrontendPlugin, createBackstageScope, createMultiplexedTransport, createSentryMicroFrontendPlugin, detectCurrentBackstageApp, isHostEnvironment };
@@ -1,3 +1,3 @@
1
- import { a as isHostEnvironment, i as detectCurrentBackstageApp, n as createSentryMicroFrontendPlugin, o as createMultiplexedTransport, r as createBackstageScope, t as SentryMicroFrontendPlugin } from "./plugin-CxeJHHeJ.mjs";
1
+ import { a as isHostEnvironment, i as detectCurrentBackstageApp, n as createSentryMicroFrontendPlugin, o as createMultiplexedTransport, r as createBackstageScope, t as SentryMicroFrontendPlugin } from "./plugin-CuRZ8qQf.mjs";
2
2
 
3
3
  export { SentryMicroFrontendPlugin, createBackstageScope, createMultiplexedTransport, createSentryMicroFrontendPlugin, detectCurrentBackstageApp, isHostEnvironment };
@@ -1,5 +1,5 @@
1
- import { n as ObservabilityServerPlugin, t as ObservabilityPlugin } from "./plugin-Bfq-o3nr.mjs";
2
- import { a as Hub, c as SpanContext, d as TransactionContext, i as defaultBeforeSendLog, l as SpanStatus, n as SentryPluginConfig, o as Scope, r as createSentryPlugin, s as Span, t as SentryPlugin, u as Transaction } from "./plugin-Bt-ygG1m.mjs";
1
+ import { n as ObservabilityServerPlugin, t as ObservabilityPlugin } from "./plugin-pvH_kv0a.mjs";
2
+ import { a as Hub, c as SpanContext, d as TransactionContext, i as defaultBeforeSendLog, l as SpanStatus, n as SentryPluginConfig, o as Scope, r as createSentryPlugin, s as Span, t as SentryPlugin, u as Transaction } from "./plugin-81171XQL.mjs";
3
3
  import { Env, env, safeEnv } from "./plugins-sentry-env.mjs";
4
4
  export * from "@sentry/nextjs";
5
5
  export { type Env, type Hub, type ObservabilityPlugin, type ObservabilityServerPlugin, type Scope, SentryPlugin, type SentryPluginConfig, type Span, type SpanContext, type SpanStatus, type Transaction, type TransactionContext, createSentryPlugin, defaultBeforeSendLog, env, safeEnv };
@@ -1,5 +1,5 @@
1
1
  import { env, safeEnv } from "./plugins-sentry-env.mjs";
2
- import { n as createSentryPlugin, r as defaultBeforeSendLog, t as SentryPlugin } from "./plugin-CP895lBx.mjs";
2
+ import { n as createSentryPlugin, r as defaultBeforeSendLog, t as SentryPlugin } from "./plugin-DApSl5bY.mjs";
3
3
 
4
4
  export * from "@sentry/nextjs"
5
5
 
package/server-edge.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { a as Breadcrumb, c as ObservabilityConfig, d as ObservabilityServer, f as ObservabilityUser, i as PluginLifecycle, l as ObservabilityContext, n as ObservabilityServerPlugin, o as LogLevel, r as PluginFactory, s as ObservabilityClient, t as ObservabilityPlugin, u as ObservabilityScope } from "./plugin-Bfq-o3nr.mjs";
2
- import { t as ObservabilityManager } from "./manager-BxQqOPEg.mjs";
3
- import { n as ObservabilityBuilder, t as createObservability } from "./index-CpcdzWrF.mjs";
4
- import { n as BetterStackPluginConfig, r as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-CaQxviDs.mjs";
1
+ import { a as Breadcrumb, c as ObservabilityConfig, d as ObservabilityServer, f as ObservabilityUser, i as PluginLifecycle, l as ObservabilityContext, n as ObservabilityServerPlugin, o as LogLevel, r as PluginFactory, s as ObservabilityClient, t as ObservabilityPlugin, u as ObservabilityScope } from "./plugin-pvH_kv0a.mjs";
2
+ import { t as ObservabilityManager } from "./manager-CONEYB97.mjs";
3
+ import { n as ObservabilityBuilder, t as createObservability } from "./index-CktVJJqJ.mjs";
4
+ import { n as BetterStackPluginConfig, r as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-CEOGIJFN.mjs";
5
5
  import { env, safeEnv } from "./plugins-betterstack-env.mjs";
6
6
  import { ConsolePlugin, ConsolePluginConfig, ConsoleServerPlugin, createConsolePlugin, createConsoleServerPlugin } from "./plugins-console.mjs";
7
7
 
package/server-edge.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { shouldEnableConsole } from "./index.mjs";
2
2
  import { env as env$1 } from "./env.mjs";
3
- import { n as ObservabilityBuilder, t as createObservability } from "./factory-DkY353r8.mjs";
3
+ import { n as ObservabilityBuilder, t as createObservability } from "./factory-d1469fpz.mjs";
4
4
  import { ConsolePlugin, ConsoleServerPlugin, createConsolePlugin, createConsoleServerPlugin } from "./plugins-console.mjs";
5
5
  import { env, safeEnv } from "./plugins-betterstack-env.mjs";
6
- import { n as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-lPdJirTY.mjs";
6
+ import { n as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-LhaOv4eq.mjs";
7
7
 
8
8
  //#region src/server-edge.ts
9
9
  /**
package/server-next.d.mts CHANGED
@@ -1,11 +1,11 @@
1
- import { a as Breadcrumb, c as ObservabilityConfig, d as ObservabilityServer, f as ObservabilityUser, l as ObservabilityContext, o as LogLevel, s as ObservabilityClient, u as ObservabilityScope } from "./plugin-Bfq-o3nr.mjs";
2
- import { t as ObservabilityManager } from "./manager-BxQqOPEg.mjs";
3
- import { n as ObservabilityBuilder, t as createObservability } from "./index-CpcdzWrF.mjs";
4
- import { t as BetterStackPlugin } from "./plugin-CaQxviDs.mjs";
1
+ import { a as Breadcrumb, c as ObservabilityConfig, d as ObservabilityServer, f as ObservabilityUser, l as ObservabilityContext, o as LogLevel, s as ObservabilityClient, u as ObservabilityScope } from "./plugin-pvH_kv0a.mjs";
2
+ import { t as ObservabilityManager } from "./manager-CONEYB97.mjs";
3
+ import { n as ObservabilityBuilder, t as createObservability } from "./index-CktVJJqJ.mjs";
4
+ import { t as BetterStackPlugin } from "./plugin-CEOGIJFN.mjs";
5
5
  import { ConsolePlugin } from "./plugins-console.mjs";
6
- import { t as SentryPlugin } from "./plugin-Bt-ygG1m.mjs";
6
+ import { t as SentryPlugin } from "./plugin-81171XQL.mjs";
7
7
  import "./plugins-sentry.mjs";
8
- import { i as SentryMicroFrontendPlugin } from "./utils-DjjqCeoW.mjs";
8
+ import { i as SentryMicroFrontendPlugin } from "./utils-6Gg4fkvH.mjs";
9
9
  import "./plugins-sentry-microfrontend.mjs";
10
10
 
11
11
  //#region src/server-next.d.ts
package/server-next.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import { shouldEnableConsole } from "./index.mjs";
2
2
  import { env } from "./env.mjs";
3
- import { n as ObservabilityBuilder, r as ObservabilityManager, t as createObservability } from "./factory-DkY353r8.mjs";
3
+ import { n as ObservabilityBuilder, r as ObservabilityManager, t as createObservability } from "./factory-d1469fpz.mjs";
4
4
  import { ConsolePlugin, createConsoleServerPlugin } from "./plugins-console.mjs";
5
5
  import { env as env$1 } from "./plugins-betterstack-env.mjs";
6
- import { n as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-lPdJirTY.mjs";
6
+ import { n as createBetterStackPlugin, t as BetterStackPlugin } from "./plugin-LhaOv4eq.mjs";
7
7
  import { env as env$2 } from "./plugins-sentry-env.mjs";
8
- import { n as createSentryPlugin, t as SentryPlugin } from "./plugin-CP895lBx.mjs";
9
- import { t as SentryMicroFrontendPlugin } from "./plugin-CxeJHHeJ.mjs";
8
+ import { n as createSentryPlugin, t as SentryPlugin } from "./plugin-DApSl5bY.mjs";
9
+ import { t as SentryMicroFrontendPlugin } from "./plugin-CuRZ8qQf.mjs";
10
10
 
11
11
  //#region src/server-next.ts
12
12
  /**
package/server.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { a as Breadcrumb, c as ObservabilityConfig, d as ObservabilityServer, f as ObservabilityUser, l as ObservabilityContext, o as LogLevel, s as ObservabilityClient, u as ObservabilityScope } from "./plugin-Bfq-o3nr.mjs";
2
- import { t as ObservabilityManager } from "./manager-BxQqOPEg.mjs";
3
- import { n as ObservabilityBuilder, t as createObservability } from "./index-CpcdzWrF.mjs";
1
+ import { a as Breadcrumb, c as ObservabilityConfig, d as ObservabilityServer, f as ObservabilityUser, l as ObservabilityContext, o as LogLevel, s as ObservabilityClient, u as ObservabilityScope } from "./plugin-pvH_kv0a.mjs";
2
+ import { t as ObservabilityManager } from "./manager-CONEYB97.mjs";
3
+ import { n as ObservabilityBuilder, t as createObservability } from "./index-CktVJJqJ.mjs";
4
4
 
5
5
  //#region src/server.d.ts
6
6
  declare const observability: ObservabilityManager;
package/server.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { shouldEnableConsole } from "./index.mjs";
2
2
  import { safeEnv } from "./env.mjs";
3
- import { n as ObservabilityBuilder, t as createObservability } from "./factory-DkY353r8.mjs";
3
+ import { n as ObservabilityBuilder, t as createObservability } from "./factory-d1469fpz.mjs";
4
4
  import { createConsoleServerPlugin } from "./plugins-console.mjs";
5
5
 
6
6
  //#region src/server.ts