autotel 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/auto.cjs +2 -2
  2. package/dist/auto.js +1 -1
  3. package/dist/{chunk-ZKKJQS6R.js → chunk-32AXF4MA.js} +29 -7
  4. package/dist/chunk-32AXF4MA.js.map +1 -0
  5. package/dist/{chunk-RRTFFAG3.cjs → chunk-3MZJ7Y24.cjs} +5 -5
  6. package/dist/{chunk-RRTFFAG3.cjs.map → chunk-3MZJ7Y24.cjs.map} +1 -1
  7. package/dist/{chunk-5RZ3NZ2M.cjs → chunk-4RA6HIYF.cjs} +5 -5
  8. package/dist/{chunk-5RZ3NZ2M.cjs.map → chunk-4RA6HIYF.cjs.map} +1 -1
  9. package/dist/{chunk-NIDUQZIN.js → chunk-4TAQQZDU.js} +3 -3
  10. package/dist/{chunk-NIDUQZIN.js.map → chunk-4TAQQZDU.js.map} +1 -1
  11. package/dist/{chunk-UV64CWMA.cjs → chunk-DQSVSGK3.cjs} +13 -13
  12. package/dist/{chunk-UV64CWMA.cjs.map → chunk-DQSVSGK3.cjs.map} +1 -1
  13. package/dist/{chunk-IS2QJ44P.js → chunk-FZROHTZZ.js} +3 -3
  14. package/dist/{chunk-IS2QJ44P.js.map → chunk-FZROHTZZ.js.map} +1 -1
  15. package/dist/{chunk-4UUEGERM.cjs → chunk-MQH5OOZK.cjs} +17 -17
  16. package/dist/{chunk-4UUEGERM.cjs.map → chunk-MQH5OOZK.cjs.map} +1 -1
  17. package/dist/{chunk-QVLMGNQF.js → chunk-OACAWYLR.js} +4 -4
  18. package/dist/{chunk-QVLMGNQF.js.map → chunk-OACAWYLR.js.map} +1 -1
  19. package/dist/{chunk-RZI5XXAD.js → chunk-OPCTN527.js} +3 -3
  20. package/dist/{chunk-RZI5XXAD.js.map → chunk-OPCTN527.js.map} +1 -1
  21. package/dist/{chunk-NN2GODP4.cjs → chunk-QICFEFD6.cjs} +7 -7
  22. package/dist/{chunk-NN2GODP4.cjs.map → chunk-QICFEFD6.cjs.map} +1 -1
  23. package/dist/{chunk-KKIYPZOP.cjs → chunk-QJYWKAC5.cjs} +29 -7
  24. package/dist/chunk-QJYWKAC5.cjs.map +1 -0
  25. package/dist/{chunk-7EVW3Z37.js → chunk-TGV2XF57.js} +3 -3
  26. package/dist/{chunk-7EVW3Z37.js.map → chunk-TGV2XF57.js.map} +1 -1
  27. package/dist/{chunk-FVA2YDEQ.js → chunk-U4D5IBSB.js} +4 -4
  28. package/dist/{chunk-FVA2YDEQ.js.map → chunk-U4D5IBSB.js.map} +1 -1
  29. package/dist/{chunk-EEQHQKPP.cjs → chunk-U72TGONP.cjs} +32 -32
  30. package/dist/{chunk-EEQHQKPP.cjs.map → chunk-U72TGONP.cjs.map} +1 -1
  31. package/dist/correlation-id.cjs +10 -10
  32. package/dist/correlation-id.js +2 -2
  33. package/dist/decorators.cjs +4 -4
  34. package/dist/decorators.js +3 -3
  35. package/dist/event.cjs +6 -6
  36. package/dist/event.js +3 -3
  37. package/dist/functional.cjs +11 -11
  38. package/dist/functional.js +3 -3
  39. package/dist/http.cjs +3 -3
  40. package/dist/http.js +2 -2
  41. package/dist/index.cjs +215 -70
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +185 -2
  44. package/dist/index.d.ts +185 -2
  45. package/dist/index.js +149 -12
  46. package/dist/index.js.map +1 -1
  47. package/dist/{init-BSyIyDs5.d.ts → init-DyE43paw.d.ts} +7 -2
  48. package/dist/{init-D9Bxx39e.d.cts → init-gyesUMwz.d.cts} +7 -2
  49. package/dist/instrumentation.cjs +8 -8
  50. package/dist/instrumentation.js +1 -1
  51. package/dist/messaging.cjs +7 -7
  52. package/dist/messaging.js +4 -4
  53. package/dist/semantic-helpers.cjs +8 -8
  54. package/dist/semantic-helpers.js +4 -4
  55. package/dist/webhook.cjs +5 -5
  56. package/dist/webhook.js +3 -3
  57. package/dist/workflow-distributed.cjs +5 -5
  58. package/dist/workflow-distributed.js +3 -3
  59. package/dist/workflow.cjs +8 -8
  60. package/dist/workflow.js +4 -4
  61. package/dist/yaml-config.d.cts +1 -1
  62. package/dist/yaml-config.d.ts +1 -1
  63. package/package.json +1 -1
  64. package/skills/build-audit-trails/SKILL.md +150 -5
  65. package/skills/build-audit-trails/references/audit-queries.md +73 -0
  66. package/skills/build-audit-trails/references/framework-wiring.md +187 -0
  67. package/skills/review-otel-patterns/SKILL.md +41 -0
  68. package/src/error-catalog.test.ts +128 -0
  69. package/src/error-catalog.ts +259 -0
  70. package/src/gen-ai-cost.test.ts +81 -0
  71. package/src/gen-ai-cost.ts +145 -0
  72. package/src/index.ts +29 -0
  73. package/src/init-auto-redactor.test.ts +53 -0
  74. package/src/init.ts +46 -7
  75. package/dist/chunk-KKIYPZOP.cjs.map +0 -1
  76. package/dist/chunk-ZKKJQS6R.js.map +0 -1
@@ -2,8 +2,8 @@
2
2
 
3
3
  var chunk2GIBANLB_cjs = require('./chunk-2GIBANLB.cjs');
4
4
  var chunkVQTCQKHQ_cjs = require('./chunk-VQTCQKHQ.cjs');
5
- var chunkUV64CWMA_cjs = require('./chunk-UV64CWMA.cjs');
6
- var chunkKKIYPZOP_cjs = require('./chunk-KKIYPZOP.cjs');
5
+ var chunkDQSVSGK3_cjs = require('./chunk-DQSVSGK3.cjs');
6
+ var chunkQJYWKAC5_cjs = require('./chunk-QJYWKAC5.cjs');
7
7
  var chunkVH77IPJN_cjs = require('./chunk-VH77IPJN.cjs');
8
8
  var chunkESLWRGAG_cjs = require('./chunk-ESLWRGAG.cjs');
9
9
  var api = require('@opentelemetry/api');
@@ -355,7 +355,7 @@ function shouldSkip(key, fn, skip) {
355
355
  function getCtxValue() {
356
356
  const activeSpan = api.trace.getActiveSpan();
357
357
  if (!activeSpan) return null;
358
- return chunkUV64CWMA_cjs.createTraceContext(activeSpan);
358
+ return chunkDQSVSGK3_cjs.createTraceContext(activeSpan);
359
359
  }
360
360
  var ctx = new Proxy(
361
361
  {},
@@ -420,17 +420,17 @@ function wrapWithTracing(fnFactory, options, variableName) {
420
420
  }
421
421
  const startTime = performance.now();
422
422
  const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
423
- const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkKKIYPZOP_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
424
- const shouldAutoFlushSpans = chunkKKIYPZOP_cjs.getConfig()?.forceFlushOnShutdown ?? false;
423
+ const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkQJYWKAC5_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
424
+ const shouldAutoFlushSpans = chunkQJYWKAC5_cjs.getConfig()?.forceFlushOnShutdown ?? false;
425
425
  const flushIfNeeded = async () => {
426
426
  if (!shouldAutoFlush || !isRootSpan) return;
427
427
  try {
428
- const queue = chunkUV64CWMA_cjs.getEventQueue();
428
+ const queue = chunkDQSVSGK3_cjs.getEventQueue();
429
429
  if (queue && queue.size() > 0) {
430
430
  await queue.flush();
431
431
  }
432
432
  if (shouldAutoFlushSpans) {
433
- const sdk = chunkKKIYPZOP_cjs.getSdk();
433
+ const sdk = chunkQJYWKAC5_cjs.getSdk();
434
434
  if (sdk) {
435
435
  try {
436
436
  const sdkAny = sdk;
@@ -445,7 +445,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
445
445
  }
446
446
  }
447
447
  } catch (error) {
448
- const initConfig = chunkKKIYPZOP_cjs.getConfig();
448
+ const initConfig = chunkQJYWKAC5_cjs.getConfig();
449
449
  const logger = initConfig?.logger;
450
450
  if (logger?.error) {
451
451
  logger.error(
@@ -464,7 +464,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
464
464
  if (options.spanKind !== void 0) {
465
465
  spanOptions.kind = options.spanKind;
466
466
  }
467
- const parentContext = chunkUV64CWMA_cjs.getActiveContextWithBaggage();
467
+ const parentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
468
468
  return tracer.startActiveSpan(
469
469
  spanName,
470
470
  spanOptions,
@@ -474,11 +474,11 @@ function wrapWithTracing(fnFactory, options, variableName) {
474
474
  let shouldKeepSpan = true;
475
475
  chunk2GIBANLB_cjs.setSpanName(span2, spanName);
476
476
  const initialContext = api.context.active();
477
- const contextStorage = chunkUV64CWMA_cjs.getContextStorage();
477
+ const contextStorage = chunkDQSVSGK3_cjs.getContextStorage();
478
478
  if (!contextStorage.getStore()) {
479
- chunkUV64CWMA_cjs.enterOrRun(contextStorage, initialContext);
479
+ chunkDQSVSGK3_cjs.enterOrRun(contextStorage, initialContext);
480
480
  }
481
- const ctxValue = chunkUV64CWMA_cjs.createTraceContext(span2);
481
+ const ctxValue = chunkDQSVSGK3_cjs.createTraceContext(span2);
482
482
  const fn = fnFactory(ctxValue);
483
483
  const argsAttributes = options.attributesFromArgs ? options.attributesFromArgs(args) : {};
484
484
  const handleTailSampling = (success, duration, error) => {
@@ -563,7 +563,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
563
563
  status: "started"
564
564
  });
565
565
  const executeWithContext = async () => {
566
- const currentContext = chunkUV64CWMA_cjs.getActiveContextWithBaggage();
566
+ const currentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
567
567
  return api.context.with(currentContext, async () => {
568
568
  return fn.call(this, ...args);
569
569
  });
@@ -615,14 +615,14 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
615
615
  }
616
616
  const startTime = performance.now();
617
617
  const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
618
- const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkKKIYPZOP_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
619
- const shouldAutoFlushSpans = chunkKKIYPZOP_cjs.getConfig()?.forceFlushOnShutdown ?? false;
618
+ const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkQJYWKAC5_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
619
+ const shouldAutoFlushSpans = chunkQJYWKAC5_cjs.getConfig()?.forceFlushOnShutdown ?? false;
620
620
  const flushIfNeeded = () => {
621
621
  if (!shouldAutoFlush || !isRootSpan) return;
622
- const queue = chunkUV64CWMA_cjs.getEventQueue();
622
+ const queue = chunkDQSVSGK3_cjs.getEventQueue();
623
623
  if (queue && queue.size() > 0) {
624
624
  void queue.flush().catch((error) => {
625
- const initConfig = chunkKKIYPZOP_cjs.getConfig();
625
+ const initConfig = chunkQJYWKAC5_cjs.getConfig();
626
626
  const logger = initConfig?.logger;
627
627
  if (logger?.error) {
628
628
  logger.error(
@@ -635,7 +635,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
635
635
  });
636
636
  }
637
637
  if (shouldAutoFlushSpans) {
638
- const sdk = chunkKKIYPZOP_cjs.getSdk();
638
+ const sdk = chunkQJYWKAC5_cjs.getSdk();
639
639
  if (sdk) {
640
640
  try {
641
641
  const sdkAny = sdk;
@@ -643,7 +643,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
643
643
  const tracerProvider = sdkAny.getTracerProvider();
644
644
  if (tracerProvider && typeof tracerProvider.forceFlush === "function") {
645
645
  void tracerProvider.forceFlush().catch((error) => {
646
- const initConfig = chunkKKIYPZOP_cjs.getConfig();
646
+ const initConfig = chunkQJYWKAC5_cjs.getConfig();
647
647
  const logger = initConfig?.logger;
648
648
  if (logger?.error) {
649
649
  logger.error(
@@ -668,7 +668,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
668
668
  if (options.spanKind !== void 0) {
669
669
  spanOptions.kind = options.spanKind;
670
670
  }
671
- const parentContext = chunkUV64CWMA_cjs.getActiveContextWithBaggage();
671
+ const parentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
672
672
  return tracer.startActiveSpan(
673
673
  spanName,
674
674
  spanOptions,
@@ -677,7 +677,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
677
677
  return chunkVQTCQKHQ_cjs.runInOperationContext(spanName, () => {
678
678
  let shouldKeepSpan = true;
679
679
  chunk2GIBANLB_cjs.setSpanName(span2, spanName);
680
- const ctxValue = chunkUV64CWMA_cjs.createTraceContext(span2);
680
+ const ctxValue = chunkDQSVSGK3_cjs.createTraceContext(span2);
681
681
  const fn = fnFactory(ctxValue);
682
682
  const argsAttributes = options.attributesFromArgs ? options.attributesFromArgs(args) : {};
683
683
  const handleTailSampling = (success, duration, error) => {
@@ -792,8 +792,8 @@ function executeImmediately(fn, options) {
792
792
  }
793
793
  const startTime = performance.now();
794
794
  const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
795
- const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkKKIYPZOP_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
796
- const shouldAutoFlushSpans = chunkKKIYPZOP_cjs.getConfig()?.forceFlushOnShutdown ?? false;
795
+ const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkQJYWKAC5_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
796
+ const shouldAutoFlushSpans = chunkQJYWKAC5_cjs.getConfig()?.forceFlushOnShutdown ?? false;
797
797
  const callCounter = options.withMetrics ? meter.createCounter(`${spanName}.calls`, {
798
798
  description: `Call count for ${spanName}`,
799
799
  unit: "1"
@@ -805,12 +805,12 @@ function executeImmediately(fn, options) {
805
805
  const flushIfNeeded = async () => {
806
806
  if (!shouldAutoFlush || !isRootSpan) return;
807
807
  try {
808
- const queue = chunkUV64CWMA_cjs.getEventQueue();
808
+ const queue = chunkDQSVSGK3_cjs.getEventQueue();
809
809
  if (queue && queue.size() > 0) {
810
810
  await queue.flush();
811
811
  }
812
812
  if (shouldAutoFlushSpans) {
813
- const sdk = chunkKKIYPZOP_cjs.getSdk();
813
+ const sdk = chunkQJYWKAC5_cjs.getSdk();
814
814
  if (sdk) {
815
815
  try {
816
816
  const sdkAny = sdk;
@@ -825,7 +825,7 @@ function executeImmediately(fn, options) {
825
825
  }
826
826
  }
827
827
  } catch (error) {
828
- const initConfig = chunkKKIYPZOP_cjs.getConfig();
828
+ const initConfig = chunkQJYWKAC5_cjs.getConfig();
829
829
  const logger = initConfig?.logger;
830
830
  if (logger?.error) {
831
831
  logger.error(
@@ -844,7 +844,7 @@ function executeImmediately(fn, options) {
844
844
  if (options.spanKind !== void 0) {
845
845
  spanOptions.kind = options.spanKind;
846
846
  }
847
- const parentContext = chunkUV64CWMA_cjs.getActiveContextWithBaggage();
847
+ const parentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
848
848
  return tracer.startActiveSpan(
849
849
  spanName,
850
850
  spanOptions,
@@ -853,7 +853,7 @@ function executeImmediately(fn, options) {
853
853
  return chunkVQTCQKHQ_cjs.runInOperationContext(spanName, () => {
854
854
  let shouldKeepSpan = true;
855
855
  chunk2GIBANLB_cjs.setSpanName(span2, spanName);
856
- const ctxValue = chunkUV64CWMA_cjs.createTraceContext(span2);
856
+ const ctxValue = chunkDQSVSGK3_cjs.createTraceContext(span2);
857
857
  const handleTailSampling = (success, duration, error) => {
858
858
  if (needsTailSampling && "shouldKeepTrace" in sampler && typeof sampler.shouldKeepTrace === "function") {
859
859
  shouldKeepSpan = sampler.shouldKeepTrace(samplingContext, {
@@ -1135,7 +1135,7 @@ function span(nameOrOptions, fn) {
1135
1135
  }
1136
1136
  });
1137
1137
  };
1138
- const parentContext = chunkUV64CWMA_cjs.getActiveContextWithBaggage();
1138
+ const parentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
1139
1139
  const result = tracer.startActiveSpan(name, {}, parentContext, executeSpan);
1140
1140
  if (result instanceof Promise) {
1141
1141
  return result;
@@ -1170,7 +1170,7 @@ function withBaggage(options) {
1170
1170
  updatedBaggage = updatedBaggage.setEntry(key, { value });
1171
1171
  }
1172
1172
  const newContext = api.propagation.setBaggage(currentContext, updatedBaggage);
1173
- const ctxStorage = chunkUV64CWMA_cjs.getContextStorage();
1173
+ const ctxStorage = chunkDQSVSGK3_cjs.getContextStorage();
1174
1174
  const previousStored = ctxStorage.getStore();
1175
1175
  const baggageEnrichedStored = previousStored ? { value: api.propagation.setBaggage(previousStored.value, updatedBaggage) } : { value: newContext };
1176
1176
  const result = previousStored ? ctxStorage.run(baggageEnrichedStored, () => api.context.with(newContext, fn)) : api.context.with(newContext, fn);
@@ -1203,5 +1203,5 @@ exports.trace = trace;
1203
1203
  exports.withBaggage = withBaggage;
1204
1204
  exports.withNewContext = withNewContext;
1205
1205
  exports.withTracing = withTracing;
1206
- //# sourceMappingURL=chunk-EEQHQKPP.cjs.map
1207
- //# sourceMappingURL=chunk-EEQHQKPP.cjs.map
1206
+ //# sourceMappingURL=chunk-U72TGONP.cjs.map
1207
+ //# sourceMappingURL=chunk-U72TGONP.cjs.map