autotel 4.2.0 → 4.2.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 (100) hide show
  1. package/dist/auto.cjs +5 -3
  2. package/dist/auto.cjs.map +1 -1
  3. package/dist/auto.js +3 -3
  4. package/dist/auto.js.map +1 -1
  5. package/dist/chunk-C_NdSu1c.cjs +34 -0
  6. package/dist/correlation-id.cjs +1 -1
  7. package/dist/correlation-id.d.cts.map +1 -1
  8. package/dist/correlation-id.d.ts.map +1 -1
  9. package/dist/correlation-id.js +1 -1
  10. package/dist/decorators.cjs +1 -1
  11. package/dist/decorators.js +1 -1
  12. package/dist/{event-ByBTV9M2.js → event-531asIM6.js} +4 -4
  13. package/dist/{event-ByBTV9M2.js.map → event-531asIM6.js.map} +1 -1
  14. package/dist/{event-BhHREDJk.cjs → event-CcZYwp50.cjs} +4 -4
  15. package/dist/{event-BhHREDJk.cjs.map → event-CcZYwp50.cjs.map} +1 -1
  16. package/dist/event.cjs +1 -1
  17. package/dist/event.js +1 -1
  18. package/dist/{functional-zpzNLhky.cjs → functional-C8B0Qa7o.cjs} +10 -7
  19. package/dist/functional-C8B0Qa7o.cjs.map +1 -0
  20. package/dist/{functional-DtI0u4vx.js → functional-r-AUIRy_.js} +9 -9
  21. package/dist/functional-r-AUIRy_.js.map +1 -0
  22. package/dist/functional.cjs +1 -1
  23. package/dist/functional.js +1 -1
  24. package/dist/http.cjs +1 -1
  25. package/dist/http.js +1 -1
  26. package/dist/index.cjs +15 -13
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts.map +1 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +14 -14
  31. package/dist/index.js.map +1 -1
  32. package/dist/{init-D-jnNMix.js → init-BS2JVkrL.js} +2 -2
  33. package/dist/{init-D-jnNMix.js.map → init-BS2JVkrL.js.map} +1 -1
  34. package/dist/{init-BX7AmFRl.cjs → init-BXiuPK6j.cjs} +3 -3
  35. package/dist/{init-BX7AmFRl.cjs.map → init-BXiuPK6j.cjs.map} +1 -1
  36. package/dist/instrumentation.cjs +2 -2
  37. package/dist/instrumentation.js +2 -2
  38. package/dist/logger.cjs +236 -8
  39. package/dist/logger.cjs.map +1 -0
  40. package/dist/messaging.cjs +1 -1
  41. package/dist/messaging.js +1 -1
  42. package/dist/{node-require-DF5QBX6z.cjs → node-require-CZ_PU448.cjs} +6 -4
  43. package/dist/node-require-CZ_PU448.cjs.map +1 -0
  44. package/dist/{node-require-Db1oDpLj.js → node-require-vROmTeJ8.js} +5 -5
  45. package/dist/node-require-vROmTeJ8.js.map +1 -0
  46. package/dist/{operation-context-C-2hmmtP.js → operation-context-CKBoA4Qy.js} +3 -3
  47. package/dist/operation-context-CKBoA4Qy.js.map +1 -0
  48. package/dist/{operation-context-n4_obUwq.cjs → operation-context-D6LDf4W_.cjs} +3 -1
  49. package/dist/operation-context-D6LDf4W_.cjs.map +1 -0
  50. package/dist/register.cjs +3 -1
  51. package/dist/register.cjs.map +1 -1
  52. package/dist/register.js +2 -2
  53. package/dist/register.js.map +1 -1
  54. package/dist/semantic-helpers.cjs +1 -1
  55. package/dist/semantic-helpers.js +1 -1
  56. package/dist/{stable-hash-Cg5cT34Q.js → stable-hash-ChFBIhNt.js} +3 -3
  57. package/dist/stable-hash-ChFBIhNt.js.map +1 -0
  58. package/dist/{stable-hash-BNTMrmdB.cjs → stable-hash-brKISGf1.cjs} +4 -2
  59. package/dist/stable-hash-brKISGf1.cjs.map +1 -0
  60. package/dist/trace-context-Cijqoi6e.d.cts.map +1 -1
  61. package/dist/trace-context-Cijqoi6e.d.ts.map +1 -1
  62. package/dist/trace-helpers.cjs +1 -1
  63. package/dist/trace-helpers.js +1 -1
  64. package/dist/{track-wc0HafS_.js → track-COUuU48p.js} +5 -5
  65. package/dist/track-COUuU48p.js.map +1 -0
  66. package/dist/{track-D59FfpL0.cjs → track-Cb3Q4QmS.cjs} +4 -2
  67. package/dist/track-Cb3Q4QmS.cjs.map +1 -0
  68. package/dist/validate.cjs +1 -1
  69. package/dist/validate.js +1 -1
  70. package/dist/webhook.cjs +1 -1
  71. package/dist/webhook.js +1 -1
  72. package/dist/workflow-distributed.cjs +1 -1
  73. package/dist/workflow-distributed.js +1 -1
  74. package/dist/workflow.cjs +3 -1
  75. package/dist/workflow.cjs.map +1 -1
  76. package/dist/workflow.d.cts.map +1 -1
  77. package/dist/workflow.d.ts.map +1 -1
  78. package/dist/workflow.js +3 -3
  79. package/dist/workflow.js.map +1 -1
  80. package/dist/yaml-config.cjs +233 -4
  81. package/dist/yaml-config.cjs.map +1 -0
  82. package/dist/yaml-config.d.cts.map +1 -1
  83. package/dist/yaml-config.d.ts.map +1 -1
  84. package/dist/yaml-config.js +8 -7
  85. package/dist/yaml-config.js.map +1 -1
  86. package/package.json +1 -1
  87. package/dist/functional-DtI0u4vx.js.map +0 -1
  88. package/dist/functional-zpzNLhky.cjs.map +0 -1
  89. package/dist/logger-thMPLpOG.cjs +0 -487
  90. package/dist/logger-thMPLpOG.cjs.map +0 -1
  91. package/dist/node-require-DF5QBX6z.cjs.map +0 -1
  92. package/dist/node-require-Db1oDpLj.js.map +0 -1
  93. package/dist/operation-context-C-2hmmtP.js.map +0 -1
  94. package/dist/operation-context-n4_obUwq.cjs.map +0 -1
  95. package/dist/stable-hash-BNTMrmdB.cjs.map +0 -1
  96. package/dist/stable-hash-Cg5cT34Q.js.map +0 -1
  97. package/dist/track-D59FfpL0.cjs.map +0 -1
  98. package/dist/track-wc0HafS_.js.map +0 -1
  99. package/dist/yaml-config-Ck2uB0Dp.cjs +0 -273
  100. package/dist/yaml-config-Ck2uB0Dp.cjs.map +0 -1
package/dist/logger.cjs CHANGED
@@ -1,10 +1,238 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_logger = require('./logger-thMPLpOG.cjs');
3
2
 
4
- exports.LOG_LEVEL = require_logger.LOG_LEVEL;
5
- exports.LoggedOperation = require_logger.LoggedOperation;
6
- exports.autotelLogger = require_logger.autotelLogger;
7
- exports.createBuiltinLogger = require_logger.createBuiltinLogger;
8
- exports.getActiveLogLevel = require_logger.getActiveLogLevel;
9
- exports.getTraceContext = require_logger.getTraceContext;
10
- exports.runWithLogLevel = require_logger.runWithLogLevel;
3
+ //#region src/logger.ts
4
+ /**
5
+ * Logger types and utilities for autotel
6
+ *
7
+ * **Zero-Config Option:** Don't provide a logger to `init()` and autotel uses
8
+ * a built-in structured JSON logger with automatic trace context injection.
9
+ *
10
+ * **BYOL (Bring Your Own Logger):** Pass Pino or Bunyan to `init()` for
11
+ * automatic instrumentation with trace context and OTLP log export.
12
+ *
13
+ * ## Logger Signature
14
+ *
15
+ * Autotel v2.10+ uses **Pino's signature**: `logger.info({ metadata }, 'message')`.
16
+ *
17
+ * ### Backward Compatibility
18
+ *
19
+ * The built-in logger auto-detects legacy Winston-style calls and swaps arguments:
20
+ * ```typescript
21
+ * // Legacy (auto-detected and handled)
22
+ * logger.info('User created', { userId: '123' });
23
+ * // → Internally treated as: logger.info({ userId: '123' }, 'User created')
24
+ * // → Logs warning in development, works silently in production
25
+ * ```
26
+ *
27
+ * ### Recommended Usage
28
+ *
29
+ * ```typescript
30
+ * // ✅ Pino-style (preferred)
31
+ * logger.info({ userId: '123' }, 'User created');
32
+ *
33
+ * // ✅ Simple message (no metadata)
34
+ * logger.info('Server started');
35
+ * ```
36
+ *
37
+ * **Note:** If you BYOL (bring your own logger), it must use Pino signature.
38
+ * Winston and other `(message, meta)` loggers are NOT compatible.
39
+ * For Winston, use `@opentelemetry/instrumentation-winston` instead.
40
+ *
41
+ * @example Zero-config (uses built-in logger)
42
+ * ```typescript
43
+ * import { init } from 'autotel';
44
+ *
45
+ * init({ service: 'my-app' });
46
+ * // Internal logs: {"level":"info","service":"my-app","msg":"...","traceId":"..."}
47
+ * ```
48
+ *
49
+ * @example Using built-in logger directly
50
+ * ```typescript
51
+ * import { createBuiltinLogger, runWithLogLevel } from 'autotel/logger';
52
+ *
53
+ * const log = createBuiltinLogger('my-service');
54
+ *
55
+ * // Simple message (no metadata)
56
+ * log.info('Server started');
57
+ *
58
+ * // With metadata (Pino-style: object first, message second)
59
+ * log.info({ userId: '123' }, 'User created');
60
+ * // Output: {"level":"info","service":"my-service","msg":"User created","userId":"123","traceId":"..."}
61
+ *
62
+ * // Dynamic log level per-request
63
+ * runWithLogLevel('debug', () => {
64
+ * log.debug('Debug info for this request only');
65
+ * });
66
+ * ```
67
+ *
68
+ * @example Using Pino (recommended for production, auto-instrumented)
69
+ * ```typescript
70
+ * import pino from 'pino'; // npm install pino
71
+ * import { init } from 'autotel';
72
+ *
73
+ * const logger = pino({ level: 'info' });
74
+ * init({ service: 'my-app', logger });
75
+ *
76
+ * // Logs automatically include traceId/spanId and export via OTLP!
77
+ * logger.info({ userId: '123' }, 'User created');
78
+ * ```
79
+ *
80
+ * @example Using Bunyan (auto-instrumented, same signature as Pino)
81
+ * ```typescript
82
+ * import bunyan from 'bunyan'; // npm install bunyan @opentelemetry/instrumentation-bunyan
83
+ * import { init } from 'autotel';
84
+ * import { BunyanInstrumentation } from '@opentelemetry/instrumentation-bunyan';
85
+ *
86
+ * const logger = bunyan.createLogger({ name: 'my-app' });
87
+ * init({
88
+ * service: 'my-app',
89
+ * logger,
90
+ * instrumentations: [new BunyanInstrumentation()]
91
+ * });
92
+ * ```
93
+ *
94
+ * @example Custom logger (MUST use Pino-compatible signature)
95
+ * ```typescript
96
+ * // ⚠️ Your custom logger MUST accept (object, message?) signature
97
+ * const logger = {
98
+ * info: (extra, msg) => console.log(msg || '', extra),
99
+ * warn: (extra, msg) => console.warn(msg || '', extra),
100
+ * error: (extra, msg) => console.error(msg || '', extra),
101
+ * debug: (extra, msg) => console.debug(msg || '', extra),
102
+ * };
103
+ * init({ service: 'my-app', logger });
104
+ * ```
105
+ *
106
+ * @example BYOL helper: inject trace context into any logger
107
+ * ```typescript
108
+ * import bunyan from 'bunyan';
109
+ * import { getTraceContext } from 'autotel/logger';
110
+ *
111
+ * const bunyanLogger = bunyan.createLogger({ name: 'myapp' });
112
+ * const ctx = getTraceContext();
113
+ * bunyanLogger.info({ ...ctx, userId: '123' }, 'Creating user');
114
+ * ```
115
+ */
116
+ /**
117
+ * Log level constants
118
+ */
119
+ const LOG_LEVEL = {
120
+ DEBUG: "debug",
121
+ INFO: "info",
122
+ WARN: "warn",
123
+ ERROR: "error"
124
+ };
125
+ /**
126
+ * TS5+ Standard Decorator for logging and tracing operations
127
+ * Uses TC39 Stage 3 decorator syntax
128
+ *
129
+ * This is the traditional per-method decorator approach.
130
+ * For zero-boilerplate solution, see @Instrumented class decorator.
131
+ *
132
+ * @example
133
+ * // Simple usage (Pino-style: object first, message second)
134
+ * class OrderService {
135
+ * constructor(private readonly deps: { log: Logger }) {}
136
+ *
137
+ * @LoggedOperation('order.create')
138
+ * async createOrder(data: CreateOrderData) {
139
+ * // ✅ Correct Pino-style logging
140
+ * this.deps.log.info({ orderId: data.id }, 'Creating order');
141
+ * }
142
+ * }
143
+ *
144
+ * // Advanced usage (future-proof for options)
145
+ * @LoggedOperation({ operationName: 'order.create' })
146
+ * async createOrder(data: CreateOrderData) { }
147
+ */
148
+ function LoggedOperation(operationNameOrOptions) {
149
+ const operationName = typeof operationNameOrOptions === "string" ? operationNameOrOptions : operationNameOrOptions.operationName;
150
+ return function(originalMethod, context) {
151
+ const methodName = String(context.name);
152
+ return async function(...args) {
153
+ const log = this.deps?.log;
154
+ const startTime = performance.now();
155
+ return getConfig().tracer.startActiveSpan(operationName, async (span) => {
156
+ try {
157
+ log?.info({
158
+ operation: operationName,
159
+ method: methodName,
160
+ args
161
+ }, "Operation started");
162
+ const result = await originalMethod.apply(this, args);
163
+ const duration = performance.now() - startTime;
164
+ log?.info({
165
+ operation: operationName,
166
+ method: methodName,
167
+ duration
168
+ }, "Operation completed");
169
+ span.setStatus({ code: SpanStatusCode.OK });
170
+ span.setAttributes({
171
+ "operation.name": operationName,
172
+ "operation.method": methodName,
173
+ "operation.duration": duration,
174
+ "operation.success": true
175
+ });
176
+ return result;
177
+ } catch (error) {
178
+ const duration = performance.now() - startTime;
179
+ log?.error({
180
+ err: error instanceof Error ? error : void 0,
181
+ operation: operationName,
182
+ method: methodName,
183
+ duration
184
+ }, "Operation failed");
185
+ span.setStatus({
186
+ code: SpanStatusCode.ERROR,
187
+ message: error instanceof Error ? error.message : "Unknown error"
188
+ });
189
+ span.setAttributes({
190
+ "operation.name": operationName,
191
+ "operation.method": methodName,
192
+ "operation.duration": duration,
193
+ "operation.success": false,
194
+ "error.type": error instanceof Error ? error.constructor.name : "Unknown"
195
+ });
196
+ throw error;
197
+ } finally {
198
+ span.end();
199
+ }
200
+ });
201
+ };
202
+ };
203
+ }
204
+
205
+ //#endregion
206
+ exports.LOG_LEVEL = LOG_LEVEL;
207
+ exports.LoggedOperation = LoggedOperation;
208
+ Object.defineProperty(exports, 'autotelLogger', {
209
+ enumerable: true,
210
+ get: function () {
211
+ return autotelLogger;
212
+ }
213
+ });
214
+ Object.defineProperty(exports, 'createBuiltinLogger', {
215
+ enumerable: true,
216
+ get: function () {
217
+ return createBuiltinLogger;
218
+ }
219
+ });
220
+ Object.defineProperty(exports, 'getActiveLogLevel', {
221
+ enumerable: true,
222
+ get: function () {
223
+ return getActiveLogLevel;
224
+ }
225
+ });
226
+ Object.defineProperty(exports, 'getTraceContext', {
227
+ enumerable: true,
228
+ get: function () {
229
+ return getTraceContext;
230
+ }
231
+ });
232
+ Object.defineProperty(exports, 'runWithLogLevel', {
233
+ enumerable: true,
234
+ get: function () {
235
+ return runWithLogLevel;
236
+ }
237
+ });
238
+ //# sourceMappingURL=logger.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.cjs","names":[],"sources":["../src/logger.ts"],"sourcesContent":["/**\n * Logger types and utilities for autotel\n *\n * **Zero-Config Option:** Don't provide a logger to `init()` and autotel uses\n * a built-in structured JSON logger with automatic trace context injection.\n *\n * **BYOL (Bring Your Own Logger):** Pass Pino or Bunyan to `init()` for\n * automatic instrumentation with trace context and OTLP log export.\n *\n * ## Logger Signature\n *\n * Autotel v2.10+ uses **Pino's signature**: `logger.info({ metadata }, 'message')`.\n *\n * ### Backward Compatibility\n *\n * The built-in logger auto-detects legacy Winston-style calls and swaps arguments:\n * ```typescript\n * // Legacy (auto-detected and handled)\n * logger.info('User created', { userId: '123' });\n * // → Internally treated as: logger.info({ userId: '123' }, 'User created')\n * // → Logs warning in development, works silently in production\n * ```\n *\n * ### Recommended Usage\n *\n * ```typescript\n * // ✅ Pino-style (preferred)\n * logger.info({ userId: '123' }, 'User created');\n *\n * // ✅ Simple message (no metadata)\n * logger.info('Server started');\n * ```\n *\n * **Note:** If you BYOL (bring your own logger), it must use Pino signature.\n * Winston and other `(message, meta)` loggers are NOT compatible.\n * For Winston, use `@opentelemetry/instrumentation-winston` instead.\n *\n * @example Zero-config (uses built-in logger)\n * ```typescript\n * import { init } from 'autotel';\n *\n * init({ service: 'my-app' });\n * // Internal logs: {\"level\":\"info\",\"service\":\"my-app\",\"msg\":\"...\",\"traceId\":\"...\"}\n * ```\n *\n * @example Using built-in logger directly\n * ```typescript\n * import { createBuiltinLogger, runWithLogLevel } from 'autotel/logger';\n *\n * const log = createBuiltinLogger('my-service');\n *\n * // Simple message (no metadata)\n * log.info('Server started');\n *\n * // With metadata (Pino-style: object first, message second)\n * log.info({ userId: '123' }, 'User created');\n * // Output: {\"level\":\"info\",\"service\":\"my-service\",\"msg\":\"User created\",\"userId\":\"123\",\"traceId\":\"...\"}\n *\n * // Dynamic log level per-request\n * runWithLogLevel('debug', () => {\n * log.debug('Debug info for this request only');\n * });\n * ```\n *\n * @example Using Pino (recommended for production, auto-instrumented)\n * ```typescript\n * import pino from 'pino'; // npm install pino\n * import { init } from 'autotel';\n *\n * const logger = pino({ level: 'info' });\n * init({ service: 'my-app', logger });\n *\n * // Logs automatically include traceId/spanId and export via OTLP!\n * logger.info({ userId: '123' }, 'User created');\n * ```\n *\n * @example Using Bunyan (auto-instrumented, same signature as Pino)\n * ```typescript\n * import bunyan from 'bunyan'; // npm install bunyan @opentelemetry/instrumentation-bunyan\n * import { init } from 'autotel';\n * import { BunyanInstrumentation } from '@opentelemetry/instrumentation-bunyan';\n *\n * const logger = bunyan.createLogger({ name: 'my-app' });\n * init({\n * service: 'my-app',\n * logger,\n * instrumentations: [new BunyanInstrumentation()]\n * });\n * ```\n *\n * @example Custom logger (MUST use Pino-compatible signature)\n * ```typescript\n * // ⚠️ Your custom logger MUST accept (object, message?) signature\n * const logger = {\n * info: (extra, msg) => console.log(msg || '', extra),\n * warn: (extra, msg) => console.warn(msg || '', extra),\n * error: (extra, msg) => console.error(msg || '', extra),\n * debug: (extra, msg) => console.debug(msg || '', extra),\n * };\n * init({ service: 'my-app', logger });\n * ```\n *\n * @example BYOL helper: inject trace context into any logger\n * ```typescript\n * import bunyan from 'bunyan';\n * import { getTraceContext } from 'autotel/logger';\n *\n * const bunyanLogger = bunyan.createLogger({ name: 'myapp' });\n * const ctx = getTraceContext();\n * bunyanLogger.info({ ...ctx, userId: '123' }, 'Creating user');\n * ```\n */\n\nimport { SpanStatusCode } from '@opentelemetry/api';\nimport { getConfig } from './config';\n\n// ============================================================================\n// Logger Types\n// ============================================================================\n\n/**\n * Log level constants\n */\nexport const LOG_LEVEL = {\n DEBUG: 'debug',\n INFO: 'info',\n WARN: 'warn',\n ERROR: 'error',\n} as const;\n\nexport type LogLevel = (typeof LOG_LEVEL)[keyof typeof LOG_LEVEL];\n\n/**\n * Logger configuration (for reference - not needed with BYOL approach)\n */\nexport interface LoggerConfig {\n service: string;\n level?: LogLevel;\n pretty?: boolean;\n redact?: string[] | false;\n}\n\n/**\n * Pino-compatible log function signature\n *\n * Matches Pino's actual LogFn type which supports:\n * - `(msg: string)` - simple string message\n * - `(obj: object, msg?: string)` - object first with optional message\n *\n * @example\n * ```typescript\n * logger.info('User logged in');\n * logger.info({ userId: '123' }, 'User created');\n * logger.error({ err: error }, 'Operation failed');\n * ```\n */\nexport interface LogFn {\n (msg: string): void;\n (obj: Record<string, unknown>, msg?: string): void;\n}\n\n/**\n * Simple logger interface - Pino/Bunyan-compatible\n *\n * Uses Pino's LogFn signature which supports both:\n * - `logger.info('message')` - simple string message\n * - `logger.info({ extra }, 'message')` - object first with optional message\n *\n * This is compatible with Pino, Bunyan, and any logger following this pattern.\n *\n * @example Using Pino (just works!)\n * ```typescript\n * import pino from 'pino';\n * const logger = pino({ level: 'info' });\n * init({ service: 'my-app', logger });\n * ```\n *\n * @example Direct usage\n * ```typescript\n * logger.info('Simple message');\n * logger.info({ userId: '123' }, 'User created');\n * logger.error({ err: error }, 'Operation failed');\n * ```\n */\nexport interface Logger {\n info: LogFn;\n warn: LogFn;\n error: LogFn;\n debug: LogFn;\n}\n\n/**\n * Alias for Logger interface (backwards compatibility)\n * @deprecated Use Logger instead\n */\nexport type ILogger = Logger;\n\n/**\n * Pino logger type - re-exported for convenience\n *\n * Note: This is a type-only export. To use Pino, install it as a peer dependency:\n * `npm install pino`\n */\nexport type { Logger as PinoLogger } from 'pino';\n\n// ============================================================================\n// LoggedOperation Decorator\n// ============================================================================\n\nexport interface LoggedOperationOptions {\n /** Operation name for tracing (e.g., 'user.createUser') */\n operationName: string;\n}\n\n/**\n * TS5+ Standard Decorator for logging and tracing operations\n * Uses TC39 Stage 3 decorator syntax\n *\n * This is the traditional per-method decorator approach.\n * For zero-boilerplate solution, see @Instrumented class decorator.\n *\n * @example\n * // Simple usage (Pino-style: object first, message second)\n * class OrderService {\n * constructor(private readonly deps: { log: Logger }) {}\n *\n * @LoggedOperation('order.create')\n * async createOrder(data: CreateOrderData) {\n * // ✅ Correct Pino-style logging\n * this.deps.log.info({ orderId: data.id }, 'Creating order');\n * }\n * }\n *\n * // Advanced usage (future-proof for options)\n * @LoggedOperation({ operationName: 'order.create' })\n * async createOrder(data: CreateOrderData) { }\n */\nexport function LoggedOperation(\n operationNameOrOptions: string | LoggedOperationOptions,\n) {\n const operationName =\n typeof operationNameOrOptions === 'string'\n ? operationNameOrOptions\n : operationNameOrOptions.operationName;\n\n return function <This, Args extends unknown[], Return>(\n originalMethod: (this: This, ...args: Args) => Promise<Return>,\n context: ClassMethodDecoratorContext<\n This,\n (this: This, ...args: Args) => Promise<Return>\n >,\n ) {\n const methodName = String(context.name);\n\n return async function (this: This, ...args: Args): Promise<Return> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const log = (this as any).deps?.log;\n const startTime = performance.now();\n\n const config = getConfig();\n const tracer = config.tracer;\n\n return tracer.startActiveSpan(operationName, async (span) => {\n try {\n log?.info(\n {\n operation: operationName,\n method: methodName,\n args,\n },\n 'Operation started',\n );\n\n const result = await originalMethod.apply(this, args);\n\n const duration = performance.now() - startTime;\n log?.info(\n {\n operation: operationName,\n method: methodName,\n duration,\n },\n 'Operation completed',\n );\n\n span.setStatus({ code: SpanStatusCode.OK });\n span.setAttributes({\n 'operation.name': operationName,\n 'operation.method': methodName,\n 'operation.duration': duration,\n 'operation.success': true,\n });\n\n return result;\n } catch (error) {\n const duration = performance.now() - startTime;\n log?.error(\n {\n err: error instanceof Error ? error : undefined,\n operation: operationName,\n method: methodName,\n duration,\n },\n 'Operation failed',\n );\n\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error instanceof Error ? error.message : 'Unknown error',\n });\n span.setAttributes({\n 'operation.name': operationName,\n 'operation.method': methodName,\n 'operation.duration': duration,\n 'operation.success': false,\n 'error.type':\n error instanceof Error ? error.constructor.name : 'Unknown',\n });\n\n throw error;\n } finally {\n span.end();\n }\n });\n };\n };\n}\n\n// ============================================================================\n// Built-in Logger (re-exports)\n// ============================================================================\n\nexport {\n autotelLogger,\n createBuiltinLogger,\n runWithLogLevel,\n getTraceContext,\n getActiveLogLevel,\n type BuiltinLogLevel,\n type BuiltinLoggerOptions,\n} from './autotel-logger';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACH;CACF;AACF"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_sampling = require('./sampling.cjs');
3
- const require_functional = require('./functional-zpzNLhky.cjs');
3
+ const require_functional = require('./functional-C8B0Qa7o.cjs');
4
4
  const require_correlated_events = require('./correlated-events-kSwLo3mi.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
6
6
 
package/dist/messaging.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createLinkFromHeaders, extractLinksFromBatch } from "./sampling.js";
2
- import { a as trace$1 } from "./functional-DtI0u4vx.js";
2
+ import { a as trace$1 } from "./functional-r-AUIRy_.js";
3
3
  import { t as emitCorrelatedEvent } from "./correlated-events-Bzh5y-UB.js";
4
4
  import { SpanKind, context, propagation } from "@opentelemetry/api";
5
5
 
@@ -1,4 +1,6 @@
1
+ const require_chunk = require('./chunk-C_NdSu1c.cjs');
1
2
  let node_module = require("node:module");
3
+ node_module = require_chunk.__toESM(node_module, 1);
2
4
 
3
5
  //#region src/node-require.ts
4
6
  /**
@@ -16,7 +18,7 @@ function getNodeRequire() {
16
18
  if (cachedRequire) return cachedRequire;
17
19
  const base = typeof __filename === "string" ? __filename : require("url").pathToFileURL(__filename).href;
18
20
  if (!base) throw Object.assign(/* @__PURE__ */ new Error("node require() is unavailable in this runtime"), { code: "MODULE_NOT_FOUND" });
19
- cachedRequire = (0, node_module.createRequire)(base);
21
+ cachedRequire = node_module.createRequire(base);
20
22
  return cachedRequire;
21
23
  }
22
24
  /**
@@ -75,8 +77,8 @@ function requireModule(id) {
75
77
  * forwarded. The live, mutable members of a real `require` — `.cache`,
76
78
  * `.main`, `.extensions` — are intentionally NOT exposed: a lazy wrapper
77
79
  * can't mirror that shared state without resolving eagerly, which would
78
- * reintroduce the workerd crash. Use `createRequire` directly if you need
79
- * them.
80
+ * reintroduce the workerd crash. Use `nodeModule.createRequire` directly if
81
+ * you need them.
80
82
  */
81
83
  const nodeRequire = ((id) => getNodeRequire()(id));
82
84
  const lazyResolve = ((id, options) => getNodeRequire().resolve(id, options));
@@ -96,4 +98,4 @@ Object.defineProperty(exports, 'safeRequire', {
96
98
  return safeRequire;
97
99
  }
98
100
  });
99
- //# sourceMappingURL=node-require-DF5QBX6z.cjs.map
101
+ //# sourceMappingURL=node-require-CZ_PU448.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-require-CZ_PU448.cjs","names":["nodeModule"],"sources":["../src/node-require.ts"],"sourcesContent":["/**\n * Cross-format require() helper for CJS and ESM compatibility\n *\n * Provides a synchronous `require()` function that works in both:\n * - CJS builds: Uses native `require`\n * - ESM builds: Uses `createRequire(import.meta.url)`\n *\n * This allows optional peer dependencies and dynamic module loading\n * to work synchronously in both module formats.\n */\n\n// Namespace import, not `import { createRequire }`. A static *named* import of a\n// Node builtin breaks browser bundlers: tools like Vite rewrite `node:module`\n// to a stub (`__vite-browser-external`) that exports nothing, and Rollup hard-\n// errors on the unresolved named binding (\"createRequire is not exported by\n// __vite-browser-external\") — failing the consumer's build even though this\n// code never runs in the browser. A namespace import has no named binding to\n// resolve, so it bundles cleanly; `.createRequire` is read lazily below and is\n// only ever touched in a real Node runtime.\nimport * as nodeModule from 'node:module';\n\n// `__filename` is provided by CJS and by esbuild's CJS output wrapper, but\n// is undefined under pure ESM. `import.meta.url` is provided by ESM. Pick\n// whichever is available so the helper works in:\n// - native CJS (autotel's published `.cjs`)\n// - native ESM (autotel's published `.js`)\n// - ESM-bundled-into-CJS by a downstream consumer (e.g. CDK's\n// `aws-lambda-nodejs` → esbuild with `format: cjs`). esbuild rewrites\n// `import.meta` to `{}` in this case, so `createRequire(import.meta.url)`\n// alone collapses to `createRequire(undefined)` and crashes at load.\n// `typeof __filename` does NOT throw when the identifier is undeclared, so\n// the ESM build evaluates the conditional safely.\ndeclare const __filename: string | undefined;\n\n// Build the Node `require` lazily on first use. Calling `createRequire`\n// eagerly at module load crashes in runtimes where neither `__filename` nor\n// `import.meta.url` resolves to a path — e.g. Cloudflare Workers / workerd,\n// where the bundle has no module path and `createRequire(undefined)` throws\n// synchronously at import. Deferring the call keeps merely importing this\n// module (and therefore anything that re-exports it, such as `track`)\n// side-effect-free; Node/CJS/ESM still get a real `require` on first call.\nlet cachedRequire: NodeRequire | undefined;\n\nfunction getNodeRequire(): NodeRequire {\n if (cachedRequire) return cachedRequire;\n const base = typeof __filename === 'string' ? __filename : import.meta.url;\n if (!base) {\n // No module path in this runtime. Surface as a missing-module error so\n // optional lookups via `safeRequire()` degrade gracefully to `undefined`.\n throw Object.assign(\n new Error('node require() is unavailable in this runtime'),\n { code: 'MODULE_NOT_FOUND' },\n );\n }\n cachedRequire = nodeModule.createRequire(base);\n return cachedRequire;\n}\n\n/**\n * Synchronously require a module (works in both CJS and ESM)\n *\n * @param id - Module ID to require\n * @returns The required module\n * @throws Error if module cannot be loaded\n *\n * @example\n * ```typescript\n * import { safeRequire } from './node-require';\n *\n * const traceloop = safeRequire('@traceloop/node-server-sdk');\n * if (traceloop) {\n * traceloop.initialize({ ... });\n * }\n * ```\n */\nexport function safeRequire<T = unknown>(id: string): T | undefined {\n try {\n return getNodeRequire()(id) as T;\n } catch (error) {\n if (error && (error as NodeJS.ErrnoException).code === 'MODULE_NOT_FOUND') {\n // Optional dependency missing – return undefined\n return undefined;\n }\n // Any other error is a real bug: rethrow\n throw error;\n }\n}\n\n/**\n * Synchronously require a module (throws if not found)\n *\n * Use this when the module is required (not optional).\n *\n * @param id - Module ID to require\n * @returns The required module\n * @throws Error if module cannot be loaded\n *\n * @example\n * ```typescript\n * import { requireModule } from './node-require';\n *\n * const fs = requireModule<typeof import('node:fs')>('node:fs');\n * const content = fs.readFileSync('file.txt', 'utf8');\n * ```\n */\nexport function requireModule<T = unknown>(id: string): T {\n return getNodeRequire()(id) as T;\n}\n\n/**\n * Direct access to the nodeRequire function (for advanced use cases).\n *\n * Lazily resolves the underlying Node `require` on first call, so importing\n * this binding never triggers `createRequire` in runtimes that lack a module\n * path (e.g. Cloudflare Workers).\n *\n * Only the call signature and `resolve` (including `resolve.paths`) are\n * forwarded. The live, mutable members of a real `require` — `.cache`,\n * `.main`, `.extensions` — are intentionally NOT exposed: a lazy wrapper\n * can't mirror that shared state without resolving eagerly, which would\n * reintroduce the workerd crash. Use `nodeModule.createRequire` directly if\n * you need them.\n */\nconst nodeRequire = ((id: string) => getNodeRequire()(id)) as NodeRequire;\nconst lazyResolve = ((id: string, options?: { paths?: string[] }) =>\n getNodeRequire().resolve(id, options)) as NodeRequire['resolve'];\nlazyResolve.paths = (request: string) =>\n getNodeRequire().resolve.paths(request);\nnodeRequire.resolve = lazyResolve;\n\nexport { nodeRequire };\n"],"mappings":";;;;;;;;;;;;;;;AAyCA,IAAI;AAEJ,SAAS,iBAA8B;CACrC,IAAI,eAAe,OAAO;CAC1B,MAAM,OAAO,OAAO,eAAe,WAAW;CAC9C,IAAI,CAAC,MAGH,MAAM,OAAO,uBACX,IAAI,MAAM,+CAA+C,GACzD,EAAE,MAAM,mBAAmB,CAC7B;CAEF,gBAAgBA,YAAW,cAAc,IAAI;CAC7C,OAAO;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,YAAyB,IAA2B;CAClE,IAAI;EACF,OAAO,eAAe,CAAC,CAAC,EAAE;CAC5B,SAAS,OAAO;EACd,IAAI,SAAU,MAAgC,SAAS,oBAErD;EAGF,MAAM;CACR;AACF;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,cAA2B,IAAe;CACxD,OAAO,eAAe,CAAC,CAAC,EAAE;AAC5B;;;;;;;;;;;;;;;AAgBA,MAAM,gBAAgB,OAAe,eAAe,CAAC,CAAC,EAAE;AACxD,MAAM,gBAAgB,IAAY,YAChC,eAAe,CAAC,CAAC,QAAQ,IAAI,OAAO;AACtC,YAAY,SAAS,YACnB,eAAe,CAAC,CAAC,QAAQ,MAAM,OAAO;AACxC,YAAY,UAAU"}
@@ -1,4 +1,4 @@
1
- import { createRequire } from "node:module";
1
+ import * as nodeModule from "node:module";
2
2
 
3
3
  //#region src/node-require.ts
4
4
  /**
@@ -16,7 +16,7 @@ function getNodeRequire() {
16
16
  if (cachedRequire) return cachedRequire;
17
17
  const base = typeof __filename === "string" ? __filename : import.meta.url;
18
18
  if (!base) throw Object.assign(/* @__PURE__ */ new Error("node require() is unavailable in this runtime"), { code: "MODULE_NOT_FOUND" });
19
- cachedRequire = createRequire(base);
19
+ cachedRequire = nodeModule.createRequire(base);
20
20
  return cachedRequire;
21
21
  }
22
22
  /**
@@ -75,8 +75,8 @@ function requireModule(id) {
75
75
  * forwarded. The live, mutable members of a real `require` — `.cache`,
76
76
  * `.main`, `.extensions` — are intentionally NOT exposed: a lazy wrapper
77
77
  * can't mirror that shared state without resolving eagerly, which would
78
- * reintroduce the workerd crash. Use `createRequire` directly if you need
79
- * them.
78
+ * reintroduce the workerd crash. Use `nodeModule.createRequire` directly if
79
+ * you need them.
80
80
  */
81
81
  const nodeRequire = ((id) => getNodeRequire()(id));
82
82
  const lazyResolve = ((id, options) => getNodeRequire().resolve(id, options));
@@ -85,4 +85,4 @@ nodeRequire.resolve = lazyResolve;
85
85
 
86
86
  //#endregion
87
87
  export { safeRequire as n, requireModule as t };
88
- //# sourceMappingURL=node-require-Db1oDpLj.js.map
88
+ //# sourceMappingURL=node-require-vROmTeJ8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-require-vROmTeJ8.js","names":[],"sources":["../src/node-require.ts"],"sourcesContent":["/**\n * Cross-format require() helper for CJS and ESM compatibility\n *\n * Provides a synchronous `require()` function that works in both:\n * - CJS builds: Uses native `require`\n * - ESM builds: Uses `createRequire(import.meta.url)`\n *\n * This allows optional peer dependencies and dynamic module loading\n * to work synchronously in both module formats.\n */\n\n// Namespace import, not `import { createRequire }`. A static *named* import of a\n// Node builtin breaks browser bundlers: tools like Vite rewrite `node:module`\n// to a stub (`__vite-browser-external`) that exports nothing, and Rollup hard-\n// errors on the unresolved named binding (\"createRequire is not exported by\n// __vite-browser-external\") — failing the consumer's build even though this\n// code never runs in the browser. A namespace import has no named binding to\n// resolve, so it bundles cleanly; `.createRequire` is read lazily below and is\n// only ever touched in a real Node runtime.\nimport * as nodeModule from 'node:module';\n\n// `__filename` is provided by CJS and by esbuild's CJS output wrapper, but\n// is undefined under pure ESM. `import.meta.url` is provided by ESM. Pick\n// whichever is available so the helper works in:\n// - native CJS (autotel's published `.cjs`)\n// - native ESM (autotel's published `.js`)\n// - ESM-bundled-into-CJS by a downstream consumer (e.g. CDK's\n// `aws-lambda-nodejs` → esbuild with `format: cjs`). esbuild rewrites\n// `import.meta` to `{}` in this case, so `createRequire(import.meta.url)`\n// alone collapses to `createRequire(undefined)` and crashes at load.\n// `typeof __filename` does NOT throw when the identifier is undeclared, so\n// the ESM build evaluates the conditional safely.\ndeclare const __filename: string | undefined;\n\n// Build the Node `require` lazily on first use. Calling `createRequire`\n// eagerly at module load crashes in runtimes where neither `__filename` nor\n// `import.meta.url` resolves to a path — e.g. Cloudflare Workers / workerd,\n// where the bundle has no module path and `createRequire(undefined)` throws\n// synchronously at import. Deferring the call keeps merely importing this\n// module (and therefore anything that re-exports it, such as `track`)\n// side-effect-free; Node/CJS/ESM still get a real `require` on first call.\nlet cachedRequire: NodeRequire | undefined;\n\nfunction getNodeRequire(): NodeRequire {\n if (cachedRequire) return cachedRequire;\n const base = typeof __filename === 'string' ? __filename : import.meta.url;\n if (!base) {\n // No module path in this runtime. Surface as a missing-module error so\n // optional lookups via `safeRequire()` degrade gracefully to `undefined`.\n throw Object.assign(\n new Error('node require() is unavailable in this runtime'),\n { code: 'MODULE_NOT_FOUND' },\n );\n }\n cachedRequire = nodeModule.createRequire(base);\n return cachedRequire;\n}\n\n/**\n * Synchronously require a module (works in both CJS and ESM)\n *\n * @param id - Module ID to require\n * @returns The required module\n * @throws Error if module cannot be loaded\n *\n * @example\n * ```typescript\n * import { safeRequire } from './node-require';\n *\n * const traceloop = safeRequire('@traceloop/node-server-sdk');\n * if (traceloop) {\n * traceloop.initialize({ ... });\n * }\n * ```\n */\nexport function safeRequire<T = unknown>(id: string): T | undefined {\n try {\n return getNodeRequire()(id) as T;\n } catch (error) {\n if (error && (error as NodeJS.ErrnoException).code === 'MODULE_NOT_FOUND') {\n // Optional dependency missing – return undefined\n return undefined;\n }\n // Any other error is a real bug: rethrow\n throw error;\n }\n}\n\n/**\n * Synchronously require a module (throws if not found)\n *\n * Use this when the module is required (not optional).\n *\n * @param id - Module ID to require\n * @returns The required module\n * @throws Error if module cannot be loaded\n *\n * @example\n * ```typescript\n * import { requireModule } from './node-require';\n *\n * const fs = requireModule<typeof import('node:fs')>('node:fs');\n * const content = fs.readFileSync('file.txt', 'utf8');\n * ```\n */\nexport function requireModule<T = unknown>(id: string): T {\n return getNodeRequire()(id) as T;\n}\n\n/**\n * Direct access to the nodeRequire function (for advanced use cases).\n *\n * Lazily resolves the underlying Node `require` on first call, so importing\n * this binding never triggers `createRequire` in runtimes that lack a module\n * path (e.g. Cloudflare Workers).\n *\n * Only the call signature and `resolve` (including `resolve.paths`) are\n * forwarded. The live, mutable members of a real `require` — `.cache`,\n * `.main`, `.extensions` — are intentionally NOT exposed: a lazy wrapper\n * can't mirror that shared state without resolving eagerly, which would\n * reintroduce the workerd crash. Use `nodeModule.createRequire` directly if\n * you need them.\n */\nconst nodeRequire = ((id: string) => getNodeRequire()(id)) as NodeRequire;\nconst lazyResolve = ((id: string, options?: { paths?: string[] }) =>\n getNodeRequire().resolve(id, options)) as NodeRequire['resolve'];\nlazyResolve.paths = (request: string) =>\n getNodeRequire().resolve.paths(request);\nnodeRequire.resolve = lazyResolve;\n\nexport { nodeRequire };\n"],"mappings":";;;;;;;;;;;;;AAyCA,IAAI;AAEJ,SAAS,iBAA8B;CACrC,IAAI,eAAe,OAAO;CAC1B,MAAM,OAAO,OAAO,eAAe,WAAW,aAAa,OAAO,KAAK;CACvE,IAAI,CAAC,MAGH,MAAM,OAAO,uBACX,IAAI,MAAM,+CAA+C,GACzD,EAAE,MAAM,mBAAmB,CAC7B;CAEF,gBAAgB,WAAW,cAAc,IAAI;CAC7C,OAAO;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,YAAyB,IAA2B;CAClE,IAAI;EACF,OAAO,eAAe,CAAC,CAAC,EAAE;CAC5B,SAAS,OAAO;EACd,IAAI,SAAU,MAAgC,SAAS,oBAErD;EAGF,MAAM;CACR;AACF;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,cAA2B,IAAe;CACxD,OAAO,eAAe,CAAC,CAAC,EAAE;AAC5B;;;;;;;;;;;;;;;AAgBA,MAAM,gBAAgB,OAAe,eAAe,CAAC,CAAC,EAAE;AACxD,MAAM,gBAAgB,IAAY,YAChC,eAAe,CAAC,CAAC,QAAQ,IAAI,OAAO;AACtC,YAAY,SAAS,YACnB,eAAe,CAAC,CAAC,QAAQ,MAAM,OAAO;AACxC,YAAY,UAAU"}
@@ -1,4 +1,4 @@
1
- import { AsyncLocalStorage } from "node:async_hooks";
1
+ import * as nodeAsyncHooks from "node:async_hooks";
2
2
 
3
3
  //#region src/operation-context.ts
4
4
  /**
@@ -13,7 +13,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
13
13
  /**
14
14
  * AsyncLocalStorage instance for tracking operation context
15
15
  */
16
- const operationStorage = new AsyncLocalStorage();
16
+ const operationStorage = new nodeAsyncHooks.AsyncLocalStorage();
17
17
  /**
18
18
  * Get the current operation context (if any)
19
19
  *
@@ -56,4 +56,4 @@ function runInOperationContext(name, fn) {
56
56
 
57
57
  //#endregion
58
58
  export { runInOperationContext as n, getOperationContext as t };
59
- //# sourceMappingURL=operation-context-C-2hmmtP.js.map
59
+ //# sourceMappingURL=operation-context-CKBoA4Qy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-context-CKBoA4Qy.js","names":[],"sources":["../src/operation-context.ts"],"sourcesContent":["/**\n * Operation context tracking using AsyncLocalStorage\n *\n * This module provides a way to track operation names across async boundaries\n * so they can be automatically captured in events events.\n *\n * We cannot read span attributes from OpenTelemetry's API (it's write-only),\n * so we maintain our own async context storage.\n */\n\n// namespace import for browser-bundler compat — see node-require.ts\nimport * as nodeAsyncHooks from 'node:async_hooks';\n\n/**\n * Operation context that flows through async operations\n */\nexport interface OperationContext {\n /**\n * The name of the current operation\n * This is set by trace() or span() and can be read by events\n */\n name: string;\n}\n\n/**\n * AsyncLocalStorage instance for tracking operation context\n */\nconst operationStorage =\n new nodeAsyncHooks.AsyncLocalStorage<OperationContext>();\n\n/**\n * Get the current operation context (if any)\n *\n * @returns The current operation context, or undefined if not in an operation\n *\n * @example\n * ```typescript\n * const ctx = getOperationContext();\n * if (ctx) {\n * console.log('Current operation:', ctx.name);\n * }\n * ```\n */\nexport function getOperationContext(): OperationContext | undefined {\n return operationStorage.getStore();\n}\n\n/**\n * Run a function within an operation context\n *\n * This sets the operation name for the duration of the function execution,\n * including all async operations spawned from it.\n *\n * @param name - The operation name to set\n * @param fn - The function to execute within the context\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * const result = await runInOperationContext('user.create', async () => {\n * // Any events.trackEvent() calls here will automatically capture\n * // 'operation.name': 'user.create'\n * await createUser();\n * return 'success';\n * });\n * ```\n */\nexport function runInOperationContext<T>(name: string, fn: () => T): T {\n return operationStorage.run({ name }, fn);\n}\n\n/**\n * Update the operation name in the current context\n *\n * This is useful when you want to change the operation name within\n * an already-established context (e.g., when entering a nested span).\n *\n * @param name - The new operation name\n *\n * @example\n * ```typescript\n * runInOperationContext('parent.operation', () => {\n * // operation.name is 'parent.operation'\n *\n * updateOperationName('nested.operation');\n * // operation.name is now 'nested.operation'\n * });\n * ```\n */\nexport function updateOperationName(name: string): void {\n const store = operationStorage.getStore();\n if (store) {\n store.name = name;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2BA,MAAM,mBACJ,IAAI,eAAe,kBAAoC;;;;;;;;;;;;;;AAezD,SAAgB,sBAAoD;CAClE,OAAO,iBAAiB,SAAS;AACnC;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,sBAAyB,MAAc,IAAgB;CACrE,OAAO,iBAAiB,IAAI,EAAE,KAAK,GAAG,EAAE;AAC1C"}
@@ -1,4 +1,6 @@
1
+ const require_chunk = require('./chunk-C_NdSu1c.cjs');
1
2
  let node_async_hooks = require("node:async_hooks");
3
+ node_async_hooks = require_chunk.__toESM(node_async_hooks, 1);
2
4
 
3
5
  //#region src/operation-context.ts
4
6
  /**
@@ -67,4 +69,4 @@ Object.defineProperty(exports, 'runInOperationContext', {
67
69
  return runInOperationContext;
68
70
  }
69
71
  });
70
- //# sourceMappingURL=operation-context-n4_obUwq.cjs.map
72
+ //# sourceMappingURL=operation-context-D6LDf4W_.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-context-D6LDf4W_.cjs","names":["nodeAsyncHooks"],"sources":["../src/operation-context.ts"],"sourcesContent":["/**\n * Operation context tracking using AsyncLocalStorage\n *\n * This module provides a way to track operation names across async boundaries\n * so they can be automatically captured in events events.\n *\n * We cannot read span attributes from OpenTelemetry's API (it's write-only),\n * so we maintain our own async context storage.\n */\n\n// namespace import for browser-bundler compat — see node-require.ts\nimport * as nodeAsyncHooks from 'node:async_hooks';\n\n/**\n * Operation context that flows through async operations\n */\nexport interface OperationContext {\n /**\n * The name of the current operation\n * This is set by trace() or span() and can be read by events\n */\n name: string;\n}\n\n/**\n * AsyncLocalStorage instance for tracking operation context\n */\nconst operationStorage =\n new nodeAsyncHooks.AsyncLocalStorage<OperationContext>();\n\n/**\n * Get the current operation context (if any)\n *\n * @returns The current operation context, or undefined if not in an operation\n *\n * @example\n * ```typescript\n * const ctx = getOperationContext();\n * if (ctx) {\n * console.log('Current operation:', ctx.name);\n * }\n * ```\n */\nexport function getOperationContext(): OperationContext | undefined {\n return operationStorage.getStore();\n}\n\n/**\n * Run a function within an operation context\n *\n * This sets the operation name for the duration of the function execution,\n * including all async operations spawned from it.\n *\n * @param name - The operation name to set\n * @param fn - The function to execute within the context\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * const result = await runInOperationContext('user.create', async () => {\n * // Any events.trackEvent() calls here will automatically capture\n * // 'operation.name': 'user.create'\n * await createUser();\n * return 'success';\n * });\n * ```\n */\nexport function runInOperationContext<T>(name: string, fn: () => T): T {\n return operationStorage.run({ name }, fn);\n}\n\n/**\n * Update the operation name in the current context\n *\n * This is useful when you want to change the operation name within\n * an already-established context (e.g., when entering a nested span).\n *\n * @param name - The new operation name\n *\n * @example\n * ```typescript\n * runInOperationContext('parent.operation', () => {\n * // operation.name is 'parent.operation'\n *\n * updateOperationName('nested.operation');\n * // operation.name is now 'nested.operation'\n * });\n * ```\n */\nexport function updateOperationName(name: string): void {\n const store = operationStorage.getStore();\n if (store) {\n store.name = name;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,MAAM,mBACJ,IAAIA,iBAAe,kBAAoC;;;;;;;;;;;;;;AAezD,SAAgB,sBAAoD;CAClE,OAAO,iBAAiB,SAAS;AACnC;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,sBAAyB,MAAc,IAAgB;CACrE,OAAO,iBAAiB,IAAI,EAAE,KAAK,GAAG,EAAE;AAC1C"}
package/dist/register.cjs CHANGED
@@ -1,4 +1,6 @@
1
+ const require_chunk = require('./chunk-C_NdSu1c.cjs');
1
2
  let node_module = require("node:module");
3
+ node_module = require_chunk.__toESM(node_module, 1);
2
4
 
3
5
  //#region src/register.ts
4
6
  /**
@@ -32,7 +34,7 @@ let node_module = require("node:module");
32
34
  * @see https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md
33
35
  * @see https://nodejs.org/api/module.html#moduleregisterspecifier-parenturl-options
34
36
  */
35
- (0, node_module.register)("@opentelemetry/instrumentation/hook.mjs", require("url").pathToFileURL(__filename).href);
37
+ node_module.register("@opentelemetry/instrumentation/hook.mjs", require("url").pathToFileURL(__filename).href);
36
38
 
37
39
  //#endregion
38
40
  //# sourceMappingURL=register.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"register.cjs","names":[],"sources":["../src/register.ts"],"sourcesContent":["/**\n * ESM instrumentation registration for Node.js 18.19+\n *\n * This module registers the OpenTelemetry ESM loader hook using the modern\n * node:module register() API. This eliminates the need for NODE_OPTIONS or\n * --experimental-loader flags.\n *\n * Usage in instrumentation.mjs:\n * ```typescript\n * import 'autotel/register'; // MUST be first import!\n * import { init } from 'autotel';\n *\n * init({\n * service: 'my-app',\n * instrumentations: [...], // or autoInstrumentations: ['express', 'http', 'pino']\n * });\n * ```\n *\n * Then run:\n * ```bash\n * node --import ./instrumentation.mjs src/index.js\n * # or with tsx:\n * tsx --import ./instrumentation.mjs src/index.ts\n * ```\n *\n * No NODE_OPTIONS or --experimental-loader needed!\n *\n * @requires Node.js 18.19.0 or later\n * @see https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md\n * @see https://nodejs.org/api/module.html#moduleregisterspecifier-parenturl-options\n */\n\nimport { register } from 'node:module';\n\n// Use the official OpenTelemetry instrumentation hook which wraps import-in-the-middle\n// This ensures proper integration with OTel's instrumentation system\nregister('@opentelemetry/instrumentation/hook.mjs', import.meta.url);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAoCS,wFAA0D"}
1
+ {"version":3,"file":"register.cjs","names":["nodeModule"],"sources":["../src/register.ts"],"sourcesContent":["/**\n * ESM instrumentation registration for Node.js 18.19+\n *\n * This module registers the OpenTelemetry ESM loader hook using the modern\n * node:module register() API. This eliminates the need for NODE_OPTIONS or\n * --experimental-loader flags.\n *\n * Usage in instrumentation.mjs:\n * ```typescript\n * import 'autotel/register'; // MUST be first import!\n * import { init } from 'autotel';\n *\n * init({\n * service: 'my-app',\n * instrumentations: [...], // or autoInstrumentations: ['express', 'http', 'pino']\n * });\n * ```\n *\n * Then run:\n * ```bash\n * node --import ./instrumentation.mjs src/index.js\n * # or with tsx:\n * tsx --import ./instrumentation.mjs src/index.ts\n * ```\n *\n * No NODE_OPTIONS or --experimental-loader needed!\n *\n * @requires Node.js 18.19.0 or later\n * @see https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md\n * @see https://nodejs.org/api/module.html#moduleregisterspecifier-parenturl-options\n */\n\n// namespace import for browser-bundler compat — see node-require.ts\nimport * as nodeModule from 'node:module';\n\n// Use the official OpenTelemetry instrumentation hook which wraps import-in-the-middle\n// This ensures proper integration with OTel's instrumentation system\nnodeModule.register('@opentelemetry/instrumentation/hook.mjs', import.meta.url);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCAA,YAAW,SAAS,wFAA0D"}
package/dist/register.js CHANGED
@@ -1,4 +1,4 @@
1
- import { register } from "node:module";
1
+ import * as nodeModule from "node:module";
2
2
 
3
3
  //#region src/register.ts
4
4
  /**
@@ -32,7 +32,7 @@ import { register } from "node:module";
32
32
  * @see https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md
33
33
  * @see https://nodejs.org/api/module.html#moduleregisterspecifier-parenturl-options
34
34
  */
35
- register("@opentelemetry/instrumentation/hook.mjs", import.meta.url);
35
+ nodeModule.register("@opentelemetry/instrumentation/hook.mjs", import.meta.url);
36
36
 
37
37
  //#endregion
38
38
  export { };
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","names":[],"sources":["../src/register.ts"],"sourcesContent":["/**\n * ESM instrumentation registration for Node.js 18.19+\n *\n * This module registers the OpenTelemetry ESM loader hook using the modern\n * node:module register() API. This eliminates the need for NODE_OPTIONS or\n * --experimental-loader flags.\n *\n * Usage in instrumentation.mjs:\n * ```typescript\n * import 'autotel/register'; // MUST be first import!\n * import { init } from 'autotel';\n *\n * init({\n * service: 'my-app',\n * instrumentations: [...], // or autoInstrumentations: ['express', 'http', 'pino']\n * });\n * ```\n *\n * Then run:\n * ```bash\n * node --import ./instrumentation.mjs src/index.js\n * # or with tsx:\n * tsx --import ./instrumentation.mjs src/index.ts\n * ```\n *\n * No NODE_OPTIONS or --experimental-loader needed!\n *\n * @requires Node.js 18.19.0 or later\n * @see https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md\n * @see https://nodejs.org/api/module.html#moduleregisterspecifier-parenturl-options\n */\n\nimport { register } from 'node:module';\n\n// Use the official OpenTelemetry instrumentation hook which wraps import-in-the-middle\n// This ensures proper integration with OTel's instrumentation system\nregister('@opentelemetry/instrumentation/hook.mjs', import.meta.url);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAS,2CAA2C,OAAO,KAAK,GAAG"}
1
+ {"version":3,"file":"register.js","names":[],"sources":["../src/register.ts"],"sourcesContent":["/**\n * ESM instrumentation registration for Node.js 18.19+\n *\n * This module registers the OpenTelemetry ESM loader hook using the modern\n * node:module register() API. This eliminates the need for NODE_OPTIONS or\n * --experimental-loader flags.\n *\n * Usage in instrumentation.mjs:\n * ```typescript\n * import 'autotel/register'; // MUST be first import!\n * import { init } from 'autotel';\n *\n * init({\n * service: 'my-app',\n * instrumentations: [...], // or autoInstrumentations: ['express', 'http', 'pino']\n * });\n * ```\n *\n * Then run:\n * ```bash\n * node --import ./instrumentation.mjs src/index.js\n * # or with tsx:\n * tsx --import ./instrumentation.mjs src/index.ts\n * ```\n *\n * No NODE_OPTIONS or --experimental-loader needed!\n *\n * @requires Node.js 18.19.0 or later\n * @see https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md\n * @see https://nodejs.org/api/module.html#moduleregisterspecifier-parenturl-options\n */\n\n// namespace import for browser-bundler compat — see node-require.ts\nimport * as nodeModule from 'node:module';\n\n// Use the official OpenTelemetry instrumentation hook which wraps import-in-the-middle\n// This ensures proper integration with OTel's instrumentation system\nnodeModule.register('@opentelemetry/instrumentation/hook.mjs', import.meta.url);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,WAAW,SAAS,2CAA2C,OAAO,KAAK,GAAG"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_functional = require('./functional-zpzNLhky.cjs');
2
+ const require_functional = require('./functional-C8B0Qa7o.cjs');
3
3
 
4
4
  //#region src/semantic-helpers.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { a as trace } from "./functional-DtI0u4vx.js";
1
+ import { a as trace } from "./functional-r-AUIRy_.js";
2
2
 
3
3
  //#region src/semantic-helpers.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { createHash } from "node:crypto";
1
+ import * as nodeCrypto from "node:crypto";
2
2
 
3
3
  //#region src/stable-hash.ts
4
4
  /**
@@ -15,9 +15,9 @@ function stableStringify(value) {
15
15
  }
16
16
  /** Stable sha256 of any JSON-serializable value. */
17
17
  function hashJson(value) {
18
- return createHash("sha256").update(stableStringify(value)).digest("hex");
18
+ return nodeCrypto.createHash("sha256").update(stableStringify(value)).digest("hex");
19
19
  }
20
20
 
21
21
  //#endregion
22
22
  export { hashJson as t };
23
- //# sourceMappingURL=stable-hash-Cg5cT34Q.js.map
23
+ //# sourceMappingURL=stable-hash-ChFBIhNt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stable-hash-ChFBIhNt.js","names":[],"sources":["../src/stable-hash.ts"],"sourcesContent":["// namespace import for browser-bundler compat — see node-require.ts\nimport * as nodeCrypto from 'node:crypto';\n\n/**\n * Deterministic JSON stringify with sorted object keys, so two structurally\n * equal values always produce the same string regardless of key insertion\n * order. Shared by `defineEvent` and the validation layer for stable schema\n * hashes.\n */\nexport function stableStringify(value: unknown): string {\n if (value === null || value === undefined || typeof value !== 'object') {\n return JSON.stringify(value);\n }\n if (Array.isArray(value)) {\n return '[' + value.map((v) => stableStringify(v)).join(',') + ']';\n }\n const obj = value as Record<string, unknown>;\n const body = Object.keys(obj)\n .toSorted()\n .map((k) => JSON.stringify(k) + ':' + stableStringify(obj[k]))\n .join(',');\n return '{' + body + '}';\n}\n\n/** Stable sha256 of any JSON-serializable value. */\nexport function hashJson(value: unknown): string {\n return nodeCrypto\n .createHash('sha256')\n .update(stableStringify(value))\n .digest('hex');\n}\n"],"mappings":";;;;;;;;;AASA,SAAgB,gBAAgB,OAAwB;CACtD,IAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,UAC5D,OAAO,KAAK,UAAU,KAAK;CAE7B,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,MAAM,MAAM,KAAK,MAAM,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI;CAEhE,MAAM,MAAM;CAKZ,OAAO,MAJM,OAAO,KAAK,GAAG,CAAC,CAC1B,SAAS,CAAC,CACV,KAAK,MAAM,KAAK,UAAU,CAAC,IAAI,MAAM,gBAAgB,IAAI,EAAE,CAAC,CAAC,CAC7D,KAAK,GACQ,IAAI;AACtB;;AAGA,SAAgB,SAAS,OAAwB;CAC/C,OAAO,WACJ,WAAW,QAAQ,CAAC,CACpB,OAAO,gBAAgB,KAAK,CAAC,CAAC,CAC9B,OAAO,KAAK;AACjB"}
@@ -1,4 +1,6 @@
1
+ const require_chunk = require('./chunk-C_NdSu1c.cjs');
1
2
  let node_crypto = require("node:crypto");
3
+ node_crypto = require_chunk.__toESM(node_crypto, 1);
2
4
 
3
5
  //#region src/stable-hash.ts
4
6
  /**
@@ -15,7 +17,7 @@ function stableStringify(value) {
15
17
  }
16
18
  /** Stable sha256 of any JSON-serializable value. */
17
19
  function hashJson(value) {
18
- return (0, node_crypto.createHash)("sha256").update(stableStringify(value)).digest("hex");
20
+ return node_crypto.createHash("sha256").update(stableStringify(value)).digest("hex");
19
21
  }
20
22
 
21
23
  //#endregion
@@ -25,4 +27,4 @@ Object.defineProperty(exports, 'hashJson', {
25
27
  return hashJson;
26
28
  }
27
29
  });
28
- //# sourceMappingURL=stable-hash-BNTMrmdB.cjs.map
30
+ //# sourceMappingURL=stable-hash-brKISGf1.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stable-hash-brKISGf1.cjs","names":["nodeCrypto"],"sources":["../src/stable-hash.ts"],"sourcesContent":["// namespace import for browser-bundler compat — see node-require.ts\nimport * as nodeCrypto from 'node:crypto';\n\n/**\n * Deterministic JSON stringify with sorted object keys, so two structurally\n * equal values always produce the same string regardless of key insertion\n * order. Shared by `defineEvent` and the validation layer for stable schema\n * hashes.\n */\nexport function stableStringify(value: unknown): string {\n if (value === null || value === undefined || typeof value !== 'object') {\n return JSON.stringify(value);\n }\n if (Array.isArray(value)) {\n return '[' + value.map((v) => stableStringify(v)).join(',') + ']';\n }\n const obj = value as Record<string, unknown>;\n const body = Object.keys(obj)\n .toSorted()\n .map((k) => JSON.stringify(k) + ':' + stableStringify(obj[k]))\n .join(',');\n return '{' + body + '}';\n}\n\n/** Stable sha256 of any JSON-serializable value. */\nexport function hashJson(value: unknown): string {\n return nodeCrypto\n .createHash('sha256')\n .update(stableStringify(value))\n .digest('hex');\n}\n"],"mappings":";;;;;;;;;;;AASA,SAAgB,gBAAgB,OAAwB;CACtD,IAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,UAC5D,OAAO,KAAK,UAAU,KAAK;CAE7B,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,MAAM,MAAM,KAAK,MAAM,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI;CAEhE,MAAM,MAAM;CAKZ,OAAO,MAJM,OAAO,KAAK,GAAG,CAAC,CAC1B,SAAS,CAAC,CACV,KAAK,MAAM,KAAK,UAAU,CAAC,IAAI,MAAM,gBAAgB,IAAI,EAAE,CAAC,CAAC,CAC7D,KAAK,GACQ,IAAI;AACtB;;AAGA,SAAgB,SAAS,OAAwB;CAC/C,OAAOA,YACJ,WAAW,QAAQ,CAAC,CACpB,OAAO,gBAAgB,KAAK,CAAC,CAAC,CAC9B,OAAO,KAAK;AACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"trace-context-Cijqoi6e.d.cts","names":[],"sources":["../src/trace-context.ts"],"mappings":";;;;;;;UA2GiB,gBAAA;EACf,OAAA;EACA,MAA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sBACA,KAAA,EAAO,OAAA,CAAQ,CAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BX,YAAA,kBACO,MAAA,6CACf,gBAAA,GAAmB,WAAA,GAAc,cAAA,CAAe,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6QhC;;;;;;;;;;;;iBAzCJ,mBAAA,WAA8B,MAAA,mBAC5C,SAAA;;;;;;aAQa,YAAA,CAAa,CAAA,MAAK,OAAA,CAAQ,CAAA;;;;;;;;;aAa1B,YAAA,CAAa,CAAA,GAAE,KAAA,EAAS,OAAA,CAAQ,CAAA;;;;;;;;;;;YAenC,UAAA,EACM,YAAA,CAAa,CAAA,IAAK,OAAA,CAAQ,CAAA,GAAE,SAAA,EAC7B,OAAA,CAAQ,CAAA,WAAY,CAAA,GAAI,OAAA,CAAQ,CAAA,IAAG,OAAA,SAC9B,CAAA,GAAI,OAAA,CAAQ,CAAA,MAC3B,CAAA,GAAI,OAAA,CAAQ,CAAA;AAAA"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_node_require = require('./node-require-DF5QBX6z.cjs');
2
+ const require_node_require = require('./node-require-CZ_PU448.cjs');
3
3
  let _opentelemetry_api = require("@opentelemetry/api");
4
4
 
5
5
  //#region src/trace-helpers.ts
@@ -1,4 +1,4 @@
1
- import { t as requireModule } from "./node-require-Db1oDpLj.js";
1
+ import { t as requireModule } from "./node-require-vROmTeJ8.js";
2
2
  import { SpanStatusCode, context, trace } from "@opentelemetry/api";
3
3
 
4
4
  //#region src/trace-helpers.ts