@microsoft/opentelemetry 0.1.0-alpha.2 → 0.1.0-alpha.4

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 (347) hide show
  1. package/README.md +69 -4
  2. package/dist/commonjs/a365/configuration/A365Configuration.d.ts +42 -0
  3. package/dist/commonjs/a365/configuration/A365Configuration.d.ts.map +1 -0
  4. package/dist/commonjs/a365/configuration/A365Configuration.js +162 -0
  5. package/dist/commonjs/a365/configuration/A365Configuration.js.map +1 -0
  6. package/dist/commonjs/a365/configuration/A365ConfigurationOptions.d.ts +53 -0
  7. package/dist/commonjs/a365/configuration/A365ConfigurationOptions.d.ts.map +1 -0
  8. package/dist/commonjs/a365/configuration/A365ConfigurationOptions.js +5 -0
  9. package/dist/commonjs/a365/configuration/A365ConfigurationOptions.js.map +1 -0
  10. package/dist/commonjs/a365/configuration/index.d.ts +3 -0
  11. package/dist/commonjs/a365/configuration/index.d.ts.map +1 -0
  12. package/dist/commonjs/a365/configuration/index.js +9 -0
  13. package/dist/commonjs/a365/configuration/index.js.map +1 -0
  14. package/dist/commonjs/a365/constants.d.ts +93 -0
  15. package/dist/commonjs/a365/constants.d.ts.map +1 -0
  16. package/dist/commonjs/a365/constants.js +120 -0
  17. package/dist/commonjs/a365/constants.js.map +1 -0
  18. package/dist/commonjs/a365/context/tokenContext.d.ts +25 -0
  19. package/dist/commonjs/a365/context/tokenContext.d.ts.map +1 -0
  20. package/dist/commonjs/a365/context/tokenContext.js +67 -0
  21. package/dist/commonjs/a365/context/tokenContext.js.map +1 -0
  22. package/dist/commonjs/a365/context.d.ts +31 -0
  23. package/dist/commonjs/a365/context.d.ts.map +1 -0
  24. package/dist/commonjs/a365/context.js +109 -0
  25. package/dist/commonjs/a365/context.js.map +1 -0
  26. package/dist/commonjs/a365/contracts.d.ts +250 -0
  27. package/dist/commonjs/a365/contracts.d.ts.map +1 -0
  28. package/dist/commonjs/a365/contracts.js +52 -0
  29. package/dist/commonjs/a365/contracts.js.map +1 -0
  30. package/dist/commonjs/a365/exporter/Agent365Exporter.d.ts +25 -0
  31. package/dist/commonjs/a365/exporter/Agent365Exporter.d.ts.map +1 -0
  32. package/dist/commonjs/a365/exporter/Agent365Exporter.js +219 -0
  33. package/dist/commonjs/a365/exporter/Agent365Exporter.js.map +1 -0
  34. package/dist/commonjs/a365/exporter/Agent365ExporterOptions.d.ts +43 -0
  35. package/dist/commonjs/a365/exporter/Agent365ExporterOptions.d.ts.map +1 -0
  36. package/dist/commonjs/a365/exporter/Agent365ExporterOptions.js +30 -0
  37. package/dist/commonjs/a365/exporter/Agent365ExporterOptions.js.map +1 -0
  38. package/dist/commonjs/a365/exporter/ExporterEventNames.d.ts +9 -0
  39. package/dist/commonjs/a365/exporter/ExporterEventNames.d.ts.map +1 -0
  40. package/dist/commonjs/a365/exporter/ExporterEventNames.js +15 -0
  41. package/dist/commonjs/a365/exporter/ExporterEventNames.js.map +1 -0
  42. package/dist/commonjs/a365/exporter/index.d.ts +6 -0
  43. package/dist/commonjs/a365/exporter/index.d.ts.map +1 -0
  44. package/dist/commonjs/a365/exporter/index.js +15 -0
  45. package/dist/commonjs/a365/exporter/index.js.map +1 -0
  46. package/dist/commonjs/a365/exporter/utils.d.ts +41 -0
  47. package/dist/commonjs/a365/exporter/utils.d.ts.map +1 -0
  48. package/dist/commonjs/a365/exporter/utils.js +410 -0
  49. package/dist/commonjs/a365/exporter/utils.js.map +1 -0
  50. package/dist/commonjs/a365/hosting/baggageBuilderUtils.d.ts +22 -0
  51. package/dist/commonjs/a365/hosting/baggageBuilderUtils.d.ts.map +1 -0
  52. package/dist/commonjs/a365/hosting/baggageBuilderUtils.js +47 -0
  53. package/dist/commonjs/a365/hosting/baggageBuilderUtils.js.map +1 -0
  54. package/dist/commonjs/a365/hosting/baggageMiddleware.d.ts +9 -0
  55. package/dist/commonjs/a365/hosting/baggageMiddleware.d.ts.map +1 -0
  56. package/dist/commonjs/a365/hosting/baggageMiddleware.js +38 -0
  57. package/dist/commonjs/a365/hosting/baggageMiddleware.js.map +1 -0
  58. package/dist/commonjs/a365/hosting/index.d.ts +9 -0
  59. package/dist/commonjs/a365/hosting/index.d.ts.map +1 -0
  60. package/dist/commonjs/a365/hosting/index.js +25 -0
  61. package/dist/commonjs/a365/hosting/index.js.map +1 -0
  62. package/dist/commonjs/a365/hosting/observabilityHostingManager.d.ts +30 -0
  63. package/dist/commonjs/a365/hosting/observabilityHostingManager.d.ts.map +1 -0
  64. package/dist/commonjs/a365/hosting/observabilityHostingManager.js +49 -0
  65. package/dist/commonjs/a365/hosting/observabilityHostingManager.js.map +1 -0
  66. package/dist/commonjs/a365/hosting/outputLoggingMiddleware.d.ts +24 -0
  67. package/dist/commonjs/a365/hosting/outputLoggingMiddleware.d.ts.map +1 -0
  68. package/dist/commonjs/a365/hosting/outputLoggingMiddleware.js +82 -0
  69. package/dist/commonjs/a365/hosting/outputLoggingMiddleware.js.map +1 -0
  70. package/dist/commonjs/a365/hosting/scopeUtils.d.ts +56 -0
  71. package/dist/commonjs/a365/hosting/scopeUtils.d.ts.map +1 -0
  72. package/dist/commonjs/a365/hosting/scopeUtils.js +161 -0
  73. package/dist/commonjs/a365/hosting/scopeUtils.js.map +1 -0
  74. package/dist/commonjs/a365/hosting/turnContextUtils.d.ts +32 -0
  75. package/dist/commonjs/a365/hosting/turnContextUtils.d.ts.map +1 -0
  76. package/dist/commonjs/a365/hosting/turnContextUtils.js +141 -0
  77. package/dist/commonjs/a365/hosting/turnContextUtils.js.map +1 -0
  78. package/dist/commonjs/a365/hosting/types.d.ts +52 -0
  79. package/dist/commonjs/a365/hosting/types.d.ts.map +1 -0
  80. package/dist/commonjs/a365/hosting/types.js +5 -0
  81. package/dist/commonjs/a365/hosting/types.js.map +1 -0
  82. package/dist/commonjs/a365/index.d.ts +18 -0
  83. package/dist/commonjs/a365/index.d.ts.map +1 -0
  84. package/dist/commonjs/a365/index.js +69 -0
  85. package/dist/commonjs/a365/index.js.map +1 -0
  86. package/dist/commonjs/a365/message-utils.d.ts +42 -0
  87. package/dist/commonjs/a365/message-utils.d.ts.map +1 -0
  88. package/dist/commonjs/a365/message-utils.js +116 -0
  89. package/dist/commonjs/a365/message-utils.js.map +1 -0
  90. package/dist/commonjs/a365/middleware/BaggageBuilder.d.ts +112 -0
  91. package/dist/commonjs/a365/middleware/BaggageBuilder.d.ts.map +1 -0
  92. package/dist/commonjs/a365/middleware/BaggageBuilder.js +248 -0
  93. package/dist/commonjs/a365/middleware/BaggageBuilder.js.map +1 -0
  94. package/dist/commonjs/a365/middleware/index.d.ts +2 -0
  95. package/dist/commonjs/a365/middleware/index.d.ts.map +1 -0
  96. package/dist/commonjs/a365/middleware/index.js +9 -0
  97. package/dist/commonjs/a365/middleware/index.js.map +1 -0
  98. package/dist/commonjs/a365/processors/A365SpanProcessor.d.ts +32 -0
  99. package/dist/commonjs/a365/processors/A365SpanProcessor.d.ts.map +1 -0
  100. package/dist/commonjs/a365/processors/A365SpanProcessor.js +104 -0
  101. package/dist/commonjs/a365/processors/A365SpanProcessor.js.map +1 -0
  102. package/dist/commonjs/a365/processors/PerRequestSpanProcessor.d.ts +44 -0
  103. package/dist/commonjs/a365/processors/PerRequestSpanProcessor.d.ts.map +1 -0
  104. package/dist/commonjs/a365/processors/PerRequestSpanProcessor.js +260 -0
  105. package/dist/commonjs/a365/processors/PerRequestSpanProcessor.js.map +1 -0
  106. package/dist/commonjs/a365/processors/index.d.ts +5 -0
  107. package/dist/commonjs/a365/processors/index.d.ts.map +1 -0
  108. package/dist/commonjs/a365/processors/index.js +13 -0
  109. package/dist/commonjs/a365/processors/index.js.map +1 -0
  110. package/dist/commonjs/a365/processors/util.d.ts +10 -0
  111. package/dist/commonjs/a365/processors/util.d.ts.map +1 -0
  112. package/dist/commonjs/a365/processors/util.js +56 -0
  113. package/dist/commonjs/a365/processors/util.js.map +1 -0
  114. package/dist/commonjs/a365/scopes/ExecuteToolScope.d.ts +24 -0
  115. package/dist/commonjs/a365/scopes/ExecuteToolScope.d.ts.map +1 -0
  116. package/dist/commonjs/a365/scopes/ExecuteToolScope.js +60 -0
  117. package/dist/commonjs/a365/scopes/ExecuteToolScope.js.map +1 -0
  118. package/dist/commonjs/a365/scopes/InferenceScope.d.ts +29 -0
  119. package/dist/commonjs/a365/scopes/InferenceScope.d.ts.map +1 -0
  120. package/dist/commonjs/a365/scopes/InferenceScope.js +75 -0
  121. package/dist/commonjs/a365/scopes/InferenceScope.js.map +1 -0
  122. package/dist/commonjs/a365/scopes/InvokeAgentScope.d.ts +25 -0
  123. package/dist/commonjs/a365/scopes/InvokeAgentScope.d.ts.map +1 -0
  124. package/dist/commonjs/a365/scopes/InvokeAgentScope.js +84 -0
  125. package/dist/commonjs/a365/scopes/InvokeAgentScope.js.map +1 -0
  126. package/dist/commonjs/a365/scopes/OpenTelemetryScope.d.ts +69 -0
  127. package/dist/commonjs/a365/scopes/OpenTelemetryScope.d.ts.map +1 -0
  128. package/dist/commonjs/a365/scopes/OpenTelemetryScope.js +211 -0
  129. package/dist/commonjs/a365/scopes/OpenTelemetryScope.js.map +1 -0
  130. package/dist/commonjs/a365/scopes/OutputScope.d.ts +26 -0
  131. package/dist/commonjs/a365/scopes/OutputScope.d.ts.map +1 -0
  132. package/dist/commonjs/a365/scopes/OutputScope.js +73 -0
  133. package/dist/commonjs/a365/scopes/OutputScope.js.map +1 -0
  134. package/dist/commonjs/a365/scopes/index.d.ts +6 -0
  135. package/dist/commonjs/a365/scopes/index.d.ts.map +1 -0
  136. package/dist/commonjs/a365/scopes/index.js +16 -0
  137. package/dist/commonjs/a365/scopes/index.js.map +1 -0
  138. package/dist/commonjs/a365/utils/utils.d.ts +6 -0
  139. package/dist/commonjs/a365/utils/utils.d.ts.map +1 -0
  140. package/dist/commonjs/a365/utils/utils.js +14 -0
  141. package/dist/commonjs/a365/utils/utils.js.map +1 -0
  142. package/dist/commonjs/azureMonitor/index.d.ts +14 -0
  143. package/dist/commonjs/azureMonitor/index.d.ts.map +1 -1
  144. package/dist/commonjs/azureMonitor/index.js +29 -0
  145. package/dist/commonjs/azureMonitor/index.js.map +1 -1
  146. package/dist/commonjs/azureMonitor/metrics/handler.js +2 -2
  147. package/dist/commonjs/azureMonitor/metrics/handler.js.map +1 -1
  148. package/dist/commonjs/azureMonitor/metrics/quickpulse/types.d.ts +1 -1
  149. package/dist/commonjs/azureMonitor/traces/handler.d.ts +0 -3
  150. package/dist/commonjs/azureMonitor/traces/handler.d.ts.map +1 -1
  151. package/dist/commonjs/azureMonitor/traces/handler.js +8 -19
  152. package/dist/commonjs/azureMonitor/traces/handler.js.map +1 -1
  153. package/dist/commonjs/distro/distro.d.ts +3 -1
  154. package/dist/commonjs/distro/distro.d.ts.map +1 -1
  155. package/dist/commonjs/distro/distro.js +88 -92
  156. package/dist/commonjs/distro/distro.js.map +1 -1
  157. package/dist/commonjs/distro/instrumentations.d.ts +31 -0
  158. package/dist/commonjs/distro/instrumentations.d.ts.map +1 -0
  159. package/dist/commonjs/distro/instrumentations.js +131 -0
  160. package/dist/commonjs/distro/instrumentations.js.map +1 -0
  161. package/dist/commonjs/distro/types.d.ts +2 -1
  162. package/dist/commonjs/distro/types.d.ts.map +1 -1
  163. package/dist/commonjs/index.d.ts +8 -12
  164. package/dist/commonjs/index.d.ts.map +1 -1
  165. package/dist/commonjs/index.js +48 -20
  166. package/dist/commonjs/index.js.map +1 -1
  167. package/dist/commonjs/package.json +1 -0
  168. package/dist/commonjs/shared/jsonConfig.d.ts +2 -1
  169. package/dist/commonjs/shared/jsonConfig.d.ts.map +1 -1
  170. package/dist/commonjs/shared/module.js +15 -11
  171. package/dist/commonjs/shared/module.js.map +1 -1
  172. package/dist/commonjs/types.d.ts +8 -32
  173. package/dist/commonjs/types.d.ts.map +1 -1
  174. package/dist/commonjs/types.js +1 -1
  175. package/dist/commonjs/types.js.map +1 -1
  176. package/dist/esm/a365/configuration/A365Configuration.d.ts +42 -0
  177. package/dist/esm/a365/configuration/A365Configuration.d.ts.map +1 -0
  178. package/dist/esm/a365/configuration/A365Configuration.js +158 -0
  179. package/dist/esm/a365/configuration/A365Configuration.js.map +1 -0
  180. package/dist/esm/a365/configuration/A365ConfigurationOptions.d.ts +53 -0
  181. package/dist/esm/a365/configuration/A365ConfigurationOptions.d.ts.map +1 -0
  182. package/dist/esm/a365/configuration/A365ConfigurationOptions.js +4 -0
  183. package/dist/esm/a365/configuration/A365ConfigurationOptions.js.map +1 -0
  184. package/dist/esm/a365/configuration/index.d.ts +3 -0
  185. package/dist/esm/a365/configuration/index.d.ts.map +1 -0
  186. package/dist/esm/a365/configuration/index.js +4 -0
  187. package/dist/esm/a365/configuration/index.js.map +1 -0
  188. package/dist/esm/a365/constants.d.ts +93 -0
  189. package/dist/esm/a365/constants.d.ts.map +1 -0
  190. package/dist/esm/a365/constants.js +116 -0
  191. package/dist/esm/a365/constants.js.map +1 -0
  192. package/dist/esm/a365/context/tokenContext.d.ts +25 -0
  193. package/dist/esm/a365/context/tokenContext.d.ts.map +1 -0
  194. package/dist/esm/a365/context/tokenContext.js +62 -0
  195. package/dist/esm/a365/context/tokenContext.js.map +1 -0
  196. package/dist/esm/a365/context.d.ts +31 -0
  197. package/dist/esm/a365/context.d.ts.map +1 -0
  198. package/dist/esm/a365/context.js +101 -0
  199. package/dist/esm/a365/context.js.map +1 -0
  200. package/dist/esm/a365/contracts.d.ts +250 -0
  201. package/dist/esm/a365/contracts.d.ts.map +1 -0
  202. package/dist/esm/a365/contracts.js +49 -0
  203. package/dist/esm/a365/contracts.js.map +1 -0
  204. package/dist/esm/a365/exporter/Agent365Exporter.d.ts +25 -0
  205. package/dist/esm/a365/exporter/Agent365Exporter.d.ts.map +1 -0
  206. package/dist/esm/a365/exporter/Agent365Exporter.js +215 -0
  207. package/dist/esm/a365/exporter/Agent365Exporter.js.map +1 -0
  208. package/dist/esm/a365/exporter/Agent365ExporterOptions.d.ts +43 -0
  209. package/dist/esm/a365/exporter/Agent365ExporterOptions.d.ts.map +1 -0
  210. package/dist/esm/a365/exporter/Agent365ExporterOptions.js +26 -0
  211. package/dist/esm/a365/exporter/Agent365ExporterOptions.js.map +1 -0
  212. package/dist/esm/a365/exporter/ExporterEventNames.d.ts +9 -0
  213. package/dist/esm/a365/exporter/ExporterEventNames.d.ts.map +1 -0
  214. package/dist/esm/a365/exporter/ExporterEventNames.js +12 -0
  215. package/dist/esm/a365/exporter/ExporterEventNames.js.map +1 -0
  216. package/dist/esm/a365/exporter/index.d.ts +6 -0
  217. package/dist/esm/a365/exporter/index.d.ts.map +1 -0
  218. package/dist/esm/a365/exporter/index.js +7 -0
  219. package/dist/esm/a365/exporter/index.js.map +1 -0
  220. package/dist/esm/a365/exporter/utils.d.ts +41 -0
  221. package/dist/esm/a365/exporter/utils.d.ts.map +1 -0
  222. package/dist/esm/a365/exporter/utils.js +398 -0
  223. package/dist/esm/a365/exporter/utils.js.map +1 -0
  224. package/dist/esm/a365/hosting/baggageBuilderUtils.d.ts +22 -0
  225. package/dist/esm/a365/hosting/baggageBuilderUtils.d.ts.map +1 -0
  226. package/dist/esm/a365/hosting/baggageBuilderUtils.js +43 -0
  227. package/dist/esm/a365/hosting/baggageBuilderUtils.js.map +1 -0
  228. package/dist/esm/a365/hosting/baggageMiddleware.d.ts +9 -0
  229. package/dist/esm/a365/hosting/baggageMiddleware.d.ts.map +1 -0
  230. package/dist/esm/a365/hosting/baggageMiddleware.js +34 -0
  231. package/dist/esm/a365/hosting/baggageMiddleware.js.map +1 -0
  232. package/dist/esm/a365/hosting/index.d.ts +9 -0
  233. package/dist/esm/a365/hosting/index.d.ts.map +1 -0
  234. package/dist/esm/a365/hosting/index.js +9 -0
  235. package/dist/esm/a365/hosting/index.js.map +1 -0
  236. package/dist/esm/a365/hosting/observabilityHostingManager.d.ts +30 -0
  237. package/dist/esm/a365/hosting/observabilityHostingManager.d.ts.map +1 -0
  238. package/dist/esm/a365/hosting/observabilityHostingManager.js +45 -0
  239. package/dist/esm/a365/hosting/observabilityHostingManager.js.map +1 -0
  240. package/dist/esm/a365/hosting/outputLoggingMiddleware.d.ts +24 -0
  241. package/dist/esm/a365/hosting/outputLoggingMiddleware.d.ts.map +1 -0
  242. package/dist/esm/a365/hosting/outputLoggingMiddleware.js +78 -0
  243. package/dist/esm/a365/hosting/outputLoggingMiddleware.js.map +1 -0
  244. package/dist/esm/a365/hosting/scopeUtils.d.ts +56 -0
  245. package/dist/esm/a365/hosting/scopeUtils.d.ts.map +1 -0
  246. package/dist/esm/a365/hosting/scopeUtils.js +157 -0
  247. package/dist/esm/a365/hosting/scopeUtils.js.map +1 -0
  248. package/dist/esm/a365/hosting/turnContextUtils.d.ts +32 -0
  249. package/dist/esm/a365/hosting/turnContextUtils.d.ts.map +1 -0
  250. package/dist/esm/a365/hosting/turnContextUtils.js +133 -0
  251. package/dist/esm/a365/hosting/turnContextUtils.js.map +1 -0
  252. package/dist/esm/a365/hosting/types.d.ts +52 -0
  253. package/dist/esm/a365/hosting/types.d.ts.map +1 -0
  254. package/dist/esm/a365/hosting/types.js +4 -0
  255. package/dist/esm/a365/hosting/types.js.map +1 -0
  256. package/dist/esm/a365/index.d.ts +18 -0
  257. package/dist/esm/a365/index.d.ts.map +1 -0
  258. package/dist/esm/a365/index.js +22 -0
  259. package/dist/esm/a365/index.js.map +1 -0
  260. package/dist/esm/a365/message-utils.d.ts +42 -0
  261. package/dist/esm/a365/message-utils.d.ts.map +1 -0
  262. package/dist/esm/a365/message-utils.js +107 -0
  263. package/dist/esm/a365/message-utils.js.map +1 -0
  264. package/dist/esm/a365/middleware/BaggageBuilder.d.ts +112 -0
  265. package/dist/esm/a365/middleware/BaggageBuilder.d.ts.map +1 -0
  266. package/dist/esm/a365/middleware/BaggageBuilder.js +243 -0
  267. package/dist/esm/a365/middleware/BaggageBuilder.js.map +1 -0
  268. package/dist/esm/a365/middleware/index.d.ts +2 -0
  269. package/dist/esm/a365/middleware/index.d.ts.map +1 -0
  270. package/dist/esm/a365/middleware/index.js +4 -0
  271. package/dist/esm/a365/middleware/index.js.map +1 -0
  272. package/dist/esm/a365/processors/A365SpanProcessor.d.ts +32 -0
  273. package/dist/esm/a365/processors/A365SpanProcessor.d.ts.map +1 -0
  274. package/dist/esm/a365/processors/A365SpanProcessor.js +100 -0
  275. package/dist/esm/a365/processors/A365SpanProcessor.js.map +1 -0
  276. package/dist/esm/a365/processors/PerRequestSpanProcessor.d.ts +44 -0
  277. package/dist/esm/a365/processors/PerRequestSpanProcessor.d.ts.map +1 -0
  278. package/dist/esm/a365/processors/PerRequestSpanProcessor.js +256 -0
  279. package/dist/esm/a365/processors/PerRequestSpanProcessor.js.map +1 -0
  280. package/dist/esm/a365/processors/index.d.ts +5 -0
  281. package/dist/esm/a365/processors/index.d.ts.map +1 -0
  282. package/dist/esm/a365/processors/index.js +6 -0
  283. package/dist/esm/a365/processors/index.js.map +1 -0
  284. package/dist/esm/a365/processors/util.d.ts +10 -0
  285. package/dist/esm/a365/processors/util.d.ts.map +1 -0
  286. package/dist/esm/a365/processors/util.js +53 -0
  287. package/dist/esm/a365/processors/util.js.map +1 -0
  288. package/dist/esm/a365/scopes/ExecuteToolScope.d.ts +24 -0
  289. package/dist/esm/a365/scopes/ExecuteToolScope.d.ts.map +1 -0
  290. package/dist/esm/a365/scopes/ExecuteToolScope.js +56 -0
  291. package/dist/esm/a365/scopes/ExecuteToolScope.js.map +1 -0
  292. package/dist/esm/a365/scopes/InferenceScope.d.ts +29 -0
  293. package/dist/esm/a365/scopes/InferenceScope.d.ts.map +1 -0
  294. package/dist/esm/a365/scopes/InferenceScope.js +71 -0
  295. package/dist/esm/a365/scopes/InferenceScope.js.map +1 -0
  296. package/dist/esm/a365/scopes/InvokeAgentScope.d.ts +25 -0
  297. package/dist/esm/a365/scopes/InvokeAgentScope.d.ts.map +1 -0
  298. package/dist/esm/a365/scopes/InvokeAgentScope.js +80 -0
  299. package/dist/esm/a365/scopes/InvokeAgentScope.js.map +1 -0
  300. package/dist/esm/a365/scopes/OpenTelemetryScope.d.ts +69 -0
  301. package/dist/esm/a365/scopes/OpenTelemetryScope.d.ts.map +1 -0
  302. package/dist/esm/a365/scopes/OpenTelemetryScope.js +207 -0
  303. package/dist/esm/a365/scopes/OpenTelemetryScope.js.map +1 -0
  304. package/dist/esm/a365/scopes/OutputScope.d.ts +26 -0
  305. package/dist/esm/a365/scopes/OutputScope.d.ts.map +1 -0
  306. package/dist/esm/a365/scopes/OutputScope.js +69 -0
  307. package/dist/esm/a365/scopes/OutputScope.js.map +1 -0
  308. package/dist/esm/a365/scopes/index.d.ts +6 -0
  309. package/dist/esm/a365/scopes/index.d.ts.map +1 -0
  310. package/dist/esm/a365/scopes/index.js +8 -0
  311. package/dist/esm/a365/scopes/index.js.map +1 -0
  312. package/dist/esm/a365/utils/utils.d.ts +6 -0
  313. package/dist/esm/a365/utils/utils.d.ts.map +1 -0
  314. package/dist/esm/a365/utils/utils.js +11 -0
  315. package/dist/esm/a365/utils/utils.js.map +1 -0
  316. package/dist/esm/azureMonitor/index.d.ts +14 -0
  317. package/dist/esm/azureMonitor/index.d.ts.map +1 -1
  318. package/dist/esm/azureMonitor/index.js +27 -0
  319. package/dist/esm/azureMonitor/index.js.map +1 -1
  320. package/dist/esm/azureMonitor/metrics/handler.js +2 -2
  321. package/dist/esm/azureMonitor/metrics/handler.js.map +1 -1
  322. package/dist/esm/azureMonitor/metrics/quickpulse/types.d.ts +1 -1
  323. package/dist/esm/azureMonitor/traces/handler.d.ts +0 -3
  324. package/dist/esm/azureMonitor/traces/handler.d.ts.map +1 -1
  325. package/dist/esm/azureMonitor/traces/handler.js +6 -19
  326. package/dist/esm/azureMonitor/traces/handler.js.map +1 -1
  327. package/dist/esm/distro/distro.d.ts +3 -1
  328. package/dist/esm/distro/distro.d.ts.map +1 -1
  329. package/dist/esm/distro/distro.js +89 -93
  330. package/dist/esm/distro/distro.js.map +1 -1
  331. package/dist/esm/distro/instrumentations.d.ts +31 -0
  332. package/dist/esm/distro/instrumentations.d.ts.map +1 -0
  333. package/dist/esm/distro/instrumentations.js +126 -0
  334. package/dist/esm/distro/instrumentations.js.map +1 -0
  335. package/dist/esm/distro/types.d.ts +2 -1
  336. package/dist/esm/distro/types.d.ts.map +1 -1
  337. package/dist/esm/index.d.ts +8 -12
  338. package/dist/esm/index.d.ts.map +1 -1
  339. package/dist/esm/index.js +6 -17
  340. package/dist/esm/index.js.map +1 -1
  341. package/dist/esm/shared/jsonConfig.d.ts +2 -1
  342. package/dist/esm/shared/jsonConfig.d.ts.map +1 -1
  343. package/dist/esm/types.d.ts +8 -32
  344. package/dist/esm/types.d.ts.map +1 -1
  345. package/dist/esm/types.js +1 -1
  346. package/dist/esm/types.js.map +1 -1
  347. package/package.json +7 -8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InferenceScope.d.ts","sourceRoot":"","sources":["../../../../src/a365/scopes/InferenceScope.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;IACpD;;;;;;;;OAQG;WACW,KAAK,CACjB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,YAAY,EAC1B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,GACxB,cAAc;IAIjB,OAAO;IAkDP,0CAA0C;IACnC,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAInD,2CAA2C;IACpC,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAIrD,kCAAkC;IAC3B,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,IAAI;IAMzD,yDAAyD;IACzC,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAIvE,0DAA0D;IAC1C,oBAAoB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI;CAG1E"}
@@ -0,0 +1,71 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { SpanKind } from "@opentelemetry/api";
4
+ import { OpenTelemetryScope } from "./OpenTelemetryScope.js";
5
+ import { OpenTelemetryConstants } from "../constants.js";
6
+ /**
7
+ * Provides OpenTelemetry tracing scope for generative AI inference operations.
8
+ */
9
+ export class InferenceScope extends OpenTelemetryScope {
10
+ /**
11
+ * Creates and starts a new scope for inference tracing.
12
+ *
13
+ * @param request Request payload (channel, conversationId, content, sessionId).
14
+ * @param details The inference call details (model, provider, tokens, etc.).
15
+ * @param agentDetails The agent performing the inference. `tenantId` is required.
16
+ * @param userDetails Optional human caller identity.
17
+ * @param spanDetails Optional span configuration. `spanKind` is always CLIENT.
18
+ */
19
+ static start(request, details, agentDetails, userDetails, spanDetails) {
20
+ return new InferenceScope(request, details, agentDetails, userDetails, spanDetails);
21
+ }
22
+ constructor(request, details, agentDetails, userDetails, spanDetails) {
23
+ if (!agentDetails.tenantId) {
24
+ throw new Error("InferenceScope: tenantId is required on agentDetails");
25
+ }
26
+ // spanKind for InferenceScope is always CLIENT
27
+ const resolvedSpanDetails = { ...spanDetails, spanKind: SpanKind.CLIENT };
28
+ super(details.operationName.toString(), `${details.operationName} ${details.model}`, agentDetails, resolvedSpanDetails, userDetails);
29
+ // Core inference information
30
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_REQUEST_MODEL_KEY, details.model);
31
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_PROVIDER_NAME_KEY, details.providerName);
32
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_USAGE_INPUT_TOKENS_KEY, details.inputTokens);
33
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_USAGE_OUTPUT_TOKENS_KEY, details.outputTokens);
34
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_RESPONSE_FINISH_REASONS_KEY, details.finishReasons);
35
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_AGENT_THOUGHT_PROCESS_KEY, details.thoughtProcess);
36
+ // Conversation and channel
37
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CONVERSATION_ID_KEY, request.conversationId);
38
+ this.setTagMaybe(OpenTelemetryConstants.CHANNEL_NAME_KEY, request.channel?.name);
39
+ this.setTagMaybe(OpenTelemetryConstants.CHANNEL_LINK_KEY, request.channel?.description);
40
+ // Endpoint
41
+ if (details.endpoint) {
42
+ this.setTagMaybe(OpenTelemetryConstants.SERVER_ADDRESS_KEY, details.endpoint.host);
43
+ if (details.endpoint.port && details.endpoint.port !== 443) {
44
+ this.setTagMaybe(OpenTelemetryConstants.SERVER_PORT_KEY, details.endpoint.port);
45
+ }
46
+ }
47
+ }
48
+ /** Records the number of input tokens. */
49
+ recordInputTokens(inputTokens) {
50
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_USAGE_INPUT_TOKENS_KEY, inputTokens);
51
+ }
52
+ /** Records the number of output tokens. */
53
+ recordOutputTokens(outputTokens) {
54
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_USAGE_OUTPUT_TOKENS_KEY, outputTokens);
55
+ }
56
+ /** Records the finish reasons. */
57
+ recordFinishReasons(finishReasons) {
58
+ if (finishReasons && finishReasons.length > 0) {
59
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_RESPONSE_FINISH_REASONS_KEY, finishReasons);
60
+ }
61
+ }
62
+ /** Records the input messages for telemetry tracking. */
63
+ recordInputMessages(messages) {
64
+ super.recordInputMessages(messages);
65
+ }
66
+ /** Records the output messages for telemetry tracking. */
67
+ recordOutputMessages(messages) {
68
+ super.recordOutputMessages(messages);
69
+ }
70
+ }
71
+ //# sourceMappingURL=InferenceScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InferenceScope.js","sourceRoot":"","sources":["../../../../src/a365/scopes/InferenceScope.ts"],"names":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;IAC3B,mBAAmB,CAAC,aAAuB;QAChD,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,kCAAkC,EAAE,aAAa,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;IAED,yDAAyD;IACzC,mBAAmB,CAAC,QAA4B;QAC9D,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,0DAA0D;IAC1C,oBAAoB,CAAC,QAA6B;QAChE,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;CACF"}
@@ -0,0 +1,25 @@
1
+ import { OpenTelemetryScope } from "./OpenTelemetryScope.js";
2
+ import type { InvokeAgentScopeDetails, CallerDetails, Request, SpanDetails, AgentDetails, InputMessagesParam, OutputMessagesParam } from "../contracts.js";
3
+ /**
4
+ * Provides OpenTelemetry tracing scope for AI agent invocation operations.
5
+ */
6
+ export declare class InvokeAgentScope extends OpenTelemetryScope {
7
+ /**
8
+ * Creates and starts a new scope for agent invocation tracing.
9
+ *
10
+ * @param request Request payload (channel, conversationId, content, sessionId).
11
+ * @param invokeScopeDetails Scope-level details (endpoint).
12
+ * @param agentDetails The agent identity. `tenantId` is required.
13
+ * @param callerDetails Optional caller information (human, agent, or both for A2A).
14
+ * @param spanDetails Optional span configuration.
15
+ */
16
+ static start(request: Request, invokeScopeDetails: InvokeAgentScopeDetails, agentDetails: AgentDetails, callerDetails?: CallerDetails, spanDetails?: SpanDetails): InvokeAgentScope;
17
+ private constructor();
18
+ /** Records response information for telemetry tracking. */
19
+ recordResponse(response: string): void;
20
+ /** Records the input messages for telemetry tracking. */
21
+ recordInputMessages(messages: InputMessagesParam): void;
22
+ /** Records the output messages for telemetry tracking. */
23
+ recordOutputMessages(messages: OutputMessagesParam): void;
24
+ }
25
+ //# sourceMappingURL=InvokeAgentScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvokeAgentScope.d.ts","sourceRoot":"","sources":["../../../../src/a365/scopes/InvokeAgentScope.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EACV,uBAAuB,EACvB,aAAa,EACb,OAAO,EACP,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,kBAAkB;IACtD;;;;;;;;OAQG;WACW,KAAK,CACjB,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,uBAAuB,EAC3C,YAAY,EAAE,YAAY,EAC1B,aAAa,CAAC,EAAE,aAAa,EAC7B,WAAW,CAAC,EAAE,WAAW,GACxB,gBAAgB;IAUnB,OAAO;IAkFP,2DAA2D;IACpD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI7C,yDAAyD;IACzC,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAIvE,0DAA0D;IAC1C,oBAAoB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI;CAG1E"}
@@ -0,0 +1,80 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { SpanKind } from "@opentelemetry/api";
4
+ import { OpenTelemetryScope } from "./OpenTelemetryScope.js";
5
+ import { OpenTelemetryConstants } from "../constants.js";
6
+ /**
7
+ * Provides OpenTelemetry tracing scope for AI agent invocation operations.
8
+ */
9
+ export class InvokeAgentScope extends OpenTelemetryScope {
10
+ /**
11
+ * Creates and starts a new scope for agent invocation tracing.
12
+ *
13
+ * @param request Request payload (channel, conversationId, content, sessionId).
14
+ * @param invokeScopeDetails Scope-level details (endpoint).
15
+ * @param agentDetails The agent identity. `tenantId` is required.
16
+ * @param callerDetails Optional caller information (human, agent, or both for A2A).
17
+ * @param spanDetails Optional span configuration.
18
+ */
19
+ static start(request, invokeScopeDetails, agentDetails, callerDetails, spanDetails) {
20
+ return new InvokeAgentScope(request, invokeScopeDetails, agentDetails, callerDetails, spanDetails);
21
+ }
22
+ constructor(request, invokeScopeDetails, agentDetails, callerDetails, spanDetails) {
23
+ if (!agentDetails.tenantId) {
24
+ throw new Error("InvokeAgentScope: tenantId is required on agentDetails");
25
+ }
26
+ const resolvedSpanDetails = {
27
+ ...spanDetails,
28
+ spanKind: spanDetails?.spanKind ?? SpanKind.CLIENT,
29
+ };
30
+ super(OpenTelemetryConstants.INVOKE_AGENT_OPERATION_NAME, agentDetails.agentName
31
+ ? `${OpenTelemetryConstants.INVOKE_AGENT_OPERATION_NAME} ${agentDetails.agentName}`
32
+ : OpenTelemetryConstants.INVOKE_AGENT_OPERATION_NAME, agentDetails, resolvedSpanDetails, callerDetails?.userDetails);
33
+ // Provider name
34
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_PROVIDER_NAME_KEY, agentDetails.providerName);
35
+ // Session ID
36
+ this.setTagMaybe(OpenTelemetryConstants.SESSION_ID_KEY, request.sessionId);
37
+ // Endpoint
38
+ if (invokeScopeDetails.endpoint) {
39
+ this.setTagMaybe(OpenTelemetryConstants.SERVER_ADDRESS_KEY, invokeScopeDetails.endpoint.host);
40
+ if (invokeScopeDetails.endpoint.port && invokeScopeDetails.endpoint.port !== 443) {
41
+ this.setTagMaybe(OpenTelemetryConstants.SERVER_PORT_KEY, invokeScopeDetails.endpoint.port);
42
+ }
43
+ }
44
+ // Channel
45
+ if (request.channel) {
46
+ this.setTagMaybe(OpenTelemetryConstants.CHANNEL_NAME_KEY, request.channel.name);
47
+ this.setTagMaybe(OpenTelemetryConstants.CHANNEL_LINK_KEY, request.channel.description);
48
+ }
49
+ // Conversation ID
50
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CONVERSATION_ID_KEY, request.conversationId);
51
+ // Request content as input messages
52
+ if (request.content != null) {
53
+ this.recordInputMessages(request.content);
54
+ }
55
+ // Caller agent details for A2A scenarios
56
+ const callerAgent = callerDetails?.callerAgentDetails;
57
+ if (callerAgent) {
58
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CALLER_AGENT_NAME_KEY, callerAgent.agentName);
59
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CALLER_AGENT_ID_KEY, callerAgent.agentId);
60
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CALLER_AGENT_APPLICATION_ID_KEY, callerAgent.agentBlueprintId);
61
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CALLER_AGENT_USER_ID_KEY, callerAgent.agentAUID);
62
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CALLER_AGENT_EMAIL_KEY, callerAgent.agentEmail);
63
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CALLER_AGENT_PLATFORM_ID_KEY, callerAgent.platformId);
64
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CALLER_AGENT_VERSION_KEY, callerAgent.agentVersion);
65
+ }
66
+ }
67
+ /** Records response information for telemetry tracking. */
68
+ recordResponse(response) {
69
+ this.recordOutputMessages(response);
70
+ }
71
+ /** Records the input messages for telemetry tracking. */
72
+ recordInputMessages(messages) {
73
+ super.recordInputMessages(messages);
74
+ }
75
+ /** Records the output messages for telemetry tracking. */
76
+ recordOutputMessages(messages) {
77
+ super.recordOutputMessages(messages);
78
+ }
79
+ }
80
+ //# sourceMappingURL=InvokeAgentScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvokeAgentScope.js","sourceRoot":"","sources":["../../../../src/a365/scopes/InvokeAgentScope.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAWzD;;GAEG;AACH,MAAM,OAAO,gB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IAAI,CAAC,WAAW,CACd,sBAAsB,CAAC,mCAAmC,EAC1D,WAAW,CAAC,UAAU,CACvB,CAAC;YACF,IAAI,CAAC,WAAW,CACd,sBAAsB,CAAC,+BAA+B,EACtD,WAAW,CAAC,YAAY,CACzB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,2DAA2D;IACpD,cAAc,CAAC,QAAgB;QACpC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,yDAAyD;IACzC,mBAAmB,CAAC,QAA4B;QAC9D,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,0DAA0D;IAC1C,oBAAoB,CAAC,QAA6B;QAChE,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;CACF"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Base class for OpenTelemetry tracing scopes.
3
+ *
4
+ * Adapted from microsoft/Agent365-nodejs agents-a365-observability/src/tracing/scopes/OpenTelemetryScope.ts
5
+ */
6
+ import type { Span, SpanContext, AttributeValue, TimeInput } from "@opentelemetry/api";
7
+ import type { AgentDetails, UserDetails, SpanDetails, InputMessagesParam, OutputMessagesParam } from "../contracts.js";
8
+ /**
9
+ * Base class for OpenTelemetry tracing scopes.
10
+ *
11
+ * Subclasses: `InvokeAgentScope`, `ExecuteToolScope`, `InferenceScope`, `OutputScope`.
12
+ */
13
+ export declare abstract class OpenTelemetryScope {
14
+ /**
15
+ * Returns a tracer from the current global TracerProvider.
16
+ *
17
+ * This **must not** be stored in a static field because the distro's
18
+ * `useMicrosoftOpenTelemetry()` resets the global API state
19
+ * (`trace.disable()` + global-object deletion) before starting the
20
+ * NodeSDK. A static field would capture a `ProxyTracer` bound to the
21
+ * old `ProxyTracerProvider` whose delegate is never set, producing
22
+ * `NoopSpan` instances with zeroed trace/span IDs.
23
+ */
24
+ private static getTracer;
25
+ protected readonly span: Span;
26
+ private readonly wallClockStartMs;
27
+ private customStartTime?;
28
+ private customEndTime?;
29
+ private errorType?;
30
+ private hasEnded;
31
+ private readonly logger;
32
+ /**
33
+ * @param operationName The name of the operation being traced.
34
+ * @param spanName The display name of the span.
35
+ * @param agentDetails Optional agent details. Tenant ID is read from `agentDetails.tenantId`.
36
+ * @param spanDetails Optional span configuration including parent context, start/end times, span kind, and span links.
37
+ * @param userDetails Optional human caller identity details.
38
+ */
39
+ protected constructor(operationName: string, spanName: string, agentDetails?: AgentDetails, spanDetails?: SpanDetails, userDetails?: UserDetails);
40
+ /** Makes this span active for the duration of the async callback execution. */
41
+ withActiveSpanAsync<T>(callback: () => Promise<T>): Promise<T>;
42
+ /** Gets the span context for this scope. */
43
+ getSpanContext(): SpanContext;
44
+ /** Records an error that occurred during the operation. */
45
+ recordError(error: Error): void;
46
+ /** Records multiple attribute key/value pairs. */
47
+ recordAttributes(attributes: Iterable<[string, AttributeValue]> | Record<string, AttributeValue> | null | undefined): void;
48
+ /** Records the input messages for telemetry tracking. */
49
+ protected recordInputMessages(messages: InputMessagesParam): void;
50
+ /** Records the output messages for telemetry tracking. */
51
+ protected recordOutputMessages(messages: OutputMessagesParam): void;
52
+ /** Sets a tag on the span if the value is not null or undefined. */
53
+ protected setTagMaybe<T extends string | number | boolean | string[] | number[]>(name: string, value: T | null | undefined): void;
54
+ /**
55
+ * Sets a custom end time for the scope.
56
+ * When set, `dispose()` will pass this value to `span.end()` instead of using wall-clock time.
57
+ */
58
+ setEndTime(endTime: TimeInput): void;
59
+ /** Records a cancellation event on the span. */
60
+ recordCancellation(reason?: string): void;
61
+ /** Converts a TimeInput value to milliseconds since epoch. */
62
+ private static timeInputToMs;
63
+ private end;
64
+ /** Disposes the scope and finalizes telemetry data collection. */
65
+ [Symbol.dispose](): void;
66
+ /** Legacy dispose method for compatibility. */
67
+ dispose(): void;
68
+ }
69
+ //# sourceMappingURL=OpenTelemetryScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenTelemetryScope.d.ts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IAkBP,yDAAyD;IACzD,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAKjE,0DAA0D;IAC1D,SAAS,CAAC,oBAAoB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI;IAKnE,oEAAoE;IACpE,SAAS,CAAC,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,EAC7E,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAC1B,IAAI;IAQP;;;OAGG;IACI,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI;IAI3C,gDAAgD;IACzC,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAMhD,8DAA8D;IAC9D,OAAO,CAAC,MAAM,CAAC,aAAa;IAO5B,OAAO,CAAC,GAAG;IAuBX,kEAAkE;IAC3D,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;IAW/B,+CAA+C;IACxC,OAAO,IAAI,IAAI;CAGvB"}
@@ -0,0 +1,207 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { trace, SpanKind, SpanStatusCode, context } from "@opentelemetry/api";
4
+ import { OpenTelemetryConstants } from "../constants.js";
5
+ import { createContextWithParentSpanRef, isParentSpanRef } from "../context.js";
6
+ import { normalizeInputMessages, normalizeOutputMessages, serializeMessages, } from "../message-utils.js";
7
+ import { Logger } from "../../shared/logging/index.js";
8
+ /**
9
+ * Base class for OpenTelemetry tracing scopes.
10
+ *
11
+ * Subclasses: `InvokeAgentScope`, `ExecuteToolScope`, `InferenceScope`, `OutputScope`.
12
+ */
13
+ export class OpenTelemetryScope {
14
+ /**
15
+ * Returns a tracer from the current global TracerProvider.
16
+ *
17
+ * This **must not** be stored in a static field because the distro's
18
+ * `useMicrosoftOpenTelemetry()` resets the global API state
19
+ * (`trace.disable()` + global-object deletion) before starting the
20
+ * NodeSDK. A static field would capture a `ProxyTracer` bound to the
21
+ * old `ProxyTracerProvider` whose delegate is never set, producing
22
+ * `NoopSpan` instances with zeroed trace/span IDs.
23
+ */
24
+ static getTracer() {
25
+ return trace.getTracer(OpenTelemetryConstants.SOURCE_NAME);
26
+ }
27
+ span;
28
+ wallClockStartMs;
29
+ customStartTime;
30
+ customEndTime;
31
+ errorType;
32
+ hasEnded = false;
33
+ logger = Logger.getInstance();
34
+ /**
35
+ * @param operationName The name of the operation being traced.
36
+ * @param spanName The display name of the span.
37
+ * @param agentDetails Optional agent details. Tenant ID is read from `agentDetails.tenantId`.
38
+ * @param spanDetails Optional span configuration including parent context, start/end times, span kind, and span links.
39
+ * @param userDetails Optional human caller identity details.
40
+ */
41
+ constructor(operationName, spanName, agentDetails, spanDetails, userDetails) {
42
+ const parentContext = spanDetails?.parentContext;
43
+ const startTime = spanDetails?.startTime;
44
+ const endTime = spanDetails?.endTime;
45
+ const spanLinks = spanDetails?.spanLinks;
46
+ const kind = spanDetails?.spanKind ?? SpanKind.CLIENT;
47
+ let currentContext = context.active();
48
+ if (parentContext) {
49
+ if (isParentSpanRef(parentContext)) {
50
+ currentContext = createContextWithParentSpanRef(currentContext, parentContext);
51
+ }
52
+ else {
53
+ currentContext = parentContext;
54
+ }
55
+ }
56
+ this.span = OpenTelemetryScope.getTracer().startSpan(spanName, {
57
+ kind,
58
+ startTime,
59
+ links: spanLinks,
60
+ attributes: {
61
+ [OpenTelemetryConstants.GEN_AI_OPERATION_NAME_KEY]: operationName,
62
+ },
63
+ }, currentContext);
64
+ this.wallClockStartMs = Date.now();
65
+ if (startTime !== undefined) {
66
+ this.customStartTime = startTime;
67
+ }
68
+ this.customEndTime = endTime;
69
+ // Set agent details
70
+ if (agentDetails) {
71
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_AGENT_ID_KEY, agentDetails.agentId);
72
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_AGENT_NAME_KEY, agentDetails.agentName);
73
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_AGENT_DESCRIPTION_KEY, agentDetails.agentDescription);
74
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_AGENT_PLATFORM_ID_KEY, agentDetails.platformId);
75
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_ICON_URI_KEY, agentDetails.iconUri);
76
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_AGENT_AUID_KEY, agentDetails.agentAUID);
77
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_AGENT_EMAIL_KEY, agentDetails.agentEmail);
78
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_AGENT_BLUEPRINT_ID_KEY, agentDetails.agentBlueprintId);
79
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_AGENT_VERSION_KEY, agentDetails.agentVersion);
80
+ }
81
+ // Set tenant ID
82
+ this.setTagMaybe(OpenTelemetryConstants.TENANT_ID_KEY, agentDetails?.tenantId);
83
+ // Set caller details
84
+ if (userDetails) {
85
+ this.setTagMaybe(OpenTelemetryConstants.USER_ID_KEY, userDetails.userId);
86
+ this.setTagMaybe(OpenTelemetryConstants.USER_EMAIL_KEY, userDetails.userEmail);
87
+ this.setTagMaybe(OpenTelemetryConstants.USER_NAME_KEY, userDetails.userName);
88
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CALLER_CLIENT_IP_KEY, userDetails.callerClientIp);
89
+ }
90
+ }
91
+ /** Makes this span active for the duration of the async callback execution. */
92
+ withActiveSpanAsync(callback) {
93
+ const newContext = trace.setSpan(context.active(), this.span);
94
+ return context.with(newContext, callback);
95
+ }
96
+ /** Gets the span context for this scope. */
97
+ getSpanContext() {
98
+ return this.span.spanContext();
99
+ }
100
+ /** Records an error that occurred during the operation. */
101
+ recordError(error) {
102
+ if ("status" in error && typeof error.status === "number") {
103
+ this.errorType = String(error.status);
104
+ }
105
+ else {
106
+ this.errorType = error.constructor.name;
107
+ }
108
+ this.span.setStatus({
109
+ code: SpanStatusCode.ERROR,
110
+ message: error.message,
111
+ });
112
+ this.span.recordException(error);
113
+ }
114
+ /** Records multiple attribute key/value pairs. */
115
+ recordAttributes(attributes) {
116
+ if (!attributes)
117
+ return;
118
+ if (Symbol.iterator in Object(attributes) && typeof attributes !== "string") {
119
+ for (const [key, value] of attributes) {
120
+ if (key && typeof key === "string" && key.trim()) {
121
+ this.span.setAttribute(key, value);
122
+ }
123
+ }
124
+ }
125
+ else if (typeof attributes === "object") {
126
+ for (const key of Object.keys(attributes)) {
127
+ if (key && key.trim()) {
128
+ this.span.setAttribute(key, attributes[key]);
129
+ }
130
+ }
131
+ }
132
+ }
133
+ /** Records the input messages for telemetry tracking. */
134
+ recordInputMessages(messages) {
135
+ const wrapper = normalizeInputMessages(messages);
136
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_INPUT_MESSAGES_KEY, serializeMessages(wrapper));
137
+ }
138
+ /** Records the output messages for telemetry tracking. */
139
+ recordOutputMessages(messages) {
140
+ const wrapper = normalizeOutputMessages(messages);
141
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_OUTPUT_MESSAGES_KEY, serializeMessages(wrapper));
142
+ }
143
+ /** Sets a tag on the span if the value is not null or undefined. */
144
+ setTagMaybe(name, value) {
145
+ if (value != null) {
146
+ this.span.setAttributes({
147
+ [name]: value,
148
+ });
149
+ }
150
+ }
151
+ /**
152
+ * Sets a custom end time for the scope.
153
+ * When set, `dispose()` will pass this value to `span.end()` instead of using wall-clock time.
154
+ */
155
+ setEndTime(endTime) {
156
+ this.customEndTime = endTime;
157
+ }
158
+ /** Records a cancellation event on the span. */
159
+ recordCancellation(reason) {
160
+ const message = reason ?? "Task was cancelled";
161
+ this.span.setStatus({ code: SpanStatusCode.ERROR, message });
162
+ this.errorType = OpenTelemetryConstants.ERROR_TYPE_CANCELLED;
163
+ }
164
+ /** Converts a TimeInput value to milliseconds since epoch. */
165
+ static timeInputToMs(t) {
166
+ if (typeof t === "number")
167
+ return t;
168
+ if (t instanceof Date)
169
+ return t.getTime();
170
+ if (Array.isArray(t) && t.length === 2)
171
+ return t[0] * 1000 + t[1] / 1_000_000;
172
+ return Date.now();
173
+ }
174
+ end() {
175
+ if (this.hasEnded)
176
+ return;
177
+ const startMs = this.customStartTime !== undefined
178
+ ? OpenTelemetryScope.timeInputToMs(this.customStartTime)
179
+ : this.wallClockStartMs;
180
+ const endMs = this.customEndTime !== undefined
181
+ ? OpenTelemetryScope.timeInputToMs(this.customEndTime)
182
+ : Date.now();
183
+ const durationMs = Math.max(0, endMs - startMs);
184
+ if (this.errorType) {
185
+ this.span.setAttributes({ [OpenTelemetryConstants.ERROR_TYPE_KEY]: this.errorType });
186
+ }
187
+ this.hasEnded = true;
188
+ this.logger.info(`[A365] Ending span[${this.span.spanContext().spanId}], duration: ${(durationMs / 1000).toFixed(3)}s`);
189
+ }
190
+ /** Disposes the scope and finalizes telemetry data collection. */
191
+ [Symbol.dispose]() {
192
+ if (!this.hasEnded) {
193
+ this.end();
194
+ if (this.customEndTime !== undefined) {
195
+ this.span.end(this.customEndTime);
196
+ }
197
+ else {
198
+ this.span.end();
199
+ }
200
+ }
201
+ }
202
+ /** Legacy dispose method for compatibility. */
203
+ dispose() {
204
+ this[Symbol.dispose]();
205
+ }
206
+ }
207
+ //# sourceMappingURL=OpenTelemetryScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenTelemetryScope.js","sourceRoot":"","sources":["../../../../src/a365/scopes/OpenTelemetryScope.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAQzD,OAAO,EAAE,8BAA8B,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EACL,sBAAsB,EACtB,uBA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, SpanDetails, ResponseMessagesParam } from "../contracts.js";
3
+ /**
4
+ * Provides OpenTelemetry tracing scope for output message tracing.
5
+ */
6
+ export declare class OutputScope extends OpenTelemetryScope {
7
+ /**
8
+ * Creates and starts a new scope for output message tracing.
9
+ *
10
+ * @param request Request payload (channel, conversationId, content, sessionId).
11
+ * @param response The response containing initial output messages.
12
+ * @param agentDetails The agent producing the output. `tenantId` is required.
13
+ * @param userDetails Optional human caller identity details.
14
+ * @param spanDetails Optional span configuration.
15
+ */
16
+ static start(request: Request, response: OutputResponse, agentDetails: AgentDetails, userDetails?: UserDetails, spanDetails?: SpanDetails): OutputScope;
17
+ private constructor();
18
+ /**
19
+ * Records the output messages for telemetry tracking.
20
+ * Overwrites any previously recorded output messages.
21
+ */
22
+ recordOutputMessages(messages: ResponseMessagesParam): void;
23
+ private _setOutput;
24
+ private _isRawDict;
25
+ }
26
+ //# sourceMappingURL=OutputScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OutputScope.d.ts","sourceRoot":"","sources":["../../../../src/a365/scopes/OutputScope.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,OAAO,EACP,WAAW,EACX,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAGzB;;GAEG;AACH,qBAAa,WAAY,SAAQ,kBAAkB;IACjD;;;;;;;;OAQG;WACW,KAAK,CACjB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,EACxB,YAAY,EAAE,YAAY,EAC1B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,GACxB,WAAW;IAId,OAAO;IAiCP;;;OAGG;IACI,oBAAoB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAIlE,OAAO,CAAC,UAAU;IAqBlB,OAAO,CAAC,UAAU;CAQnB"}
@@ -0,0 +1,69 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { SpanKind } from "@opentelemetry/api";
4
+ import { OpenTelemetryScope } from "./OpenTelemetryScope.js";
5
+ import { OpenTelemetryConstants } from "../constants.js";
6
+ import { normalizeOutputMessages, serializeMessages } from "../message-utils.js";
7
+ import { A365_MESSAGE_SCHEMA_VERSION } from "../contracts.js";
8
+ /**
9
+ * Provides OpenTelemetry tracing scope for output message tracing.
10
+ */
11
+ export class OutputScope extends OpenTelemetryScope {
12
+ /**
13
+ * Creates and starts a new scope for output message tracing.
14
+ *
15
+ * @param request Request payload (channel, conversationId, content, sessionId).
16
+ * @param response The response containing initial output messages.
17
+ * @param agentDetails The agent producing the output. `tenantId` is required.
18
+ * @param userDetails Optional human caller identity details.
19
+ * @param spanDetails Optional span configuration.
20
+ */
21
+ static start(request, response, agentDetails, userDetails, spanDetails) {
22
+ return new OutputScope(request, response, agentDetails, userDetails, spanDetails);
23
+ }
24
+ constructor(request, response, agentDetails, userDetails, spanDetails) {
25
+ if (!agentDetails.tenantId) {
26
+ throw new Error("OutputScope: tenantId is required on agentDetails");
27
+ }
28
+ // spanKind for OutputScope is always CLIENT
29
+ const resolvedSpanDetails = { ...spanDetails, spanKind: SpanKind.CLIENT };
30
+ super(OpenTelemetryConstants.OUTPUT_MESSAGES_OPERATION_NAME, agentDetails.agentName
31
+ ? `${OpenTelemetryConstants.OUTPUT_MESSAGES_OPERATION_NAME} ${agentDetails.agentName}`
32
+ : `${OpenTelemetryConstants.OUTPUT_MESSAGES_OPERATION_NAME} ${agentDetails.agentId}`, agentDetails, resolvedSpanDetails, userDetails);
33
+ // Set initial output messages
34
+ this._setOutput(response.messages);
35
+ // Conversation and channel
36
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_CONVERSATION_ID_KEY, request.conversationId);
37
+ this.setTagMaybe(OpenTelemetryConstants.CHANNEL_NAME_KEY, request.channel?.name);
38
+ this.setTagMaybe(OpenTelemetryConstants.CHANNEL_LINK_KEY, request.channel?.description);
39
+ }
40
+ /**
41
+ * Records the output messages for telemetry tracking.
42
+ * Overwrites any previously recorded output messages.
43
+ */
44
+ recordOutputMessages(messages) {
45
+ this._setOutput(messages);
46
+ }
47
+ _setOutput(messages) {
48
+ // Dict (Record<string, unknown>) — treat as tool call result, serialize directly
49
+ if (this._isRawDict(messages)) {
50
+ try {
51
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_OUTPUT_MESSAGES_KEY, JSON.stringify(messages));
52
+ }
53
+ catch {
54
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_OUTPUT_MESSAGES_KEY, JSON.stringify({ error: "serialization failed" }));
55
+ }
56
+ return;
57
+ }
58
+ const normalized = normalizeOutputMessages(messages);
59
+ const wrapper = { version: A365_MESSAGE_SCHEMA_VERSION, messages: normalized.messages };
60
+ this.setTagMaybe(OpenTelemetryConstants.GEN_AI_OUTPUT_MESSAGES_KEY, serializeMessages(wrapper));
61
+ }
62
+ _isRawDict(messages) {
63
+ return (typeof messages === "object" &&
64
+ messages !== null &&
65
+ !Array.isArray(messages) &&
66
+ !("version" in messages && "messages" in messages));
67
+ }
68
+ }
69
+ //# sourceMappingURL=OutputScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OutputScope.js","sourceRoot":"","sources":["../../../../src/a365/scopes/OutputScope.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AASjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,kBAAkB;IACjD;;;;;;;;O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AU,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAEO,UAAU,CAAC,QAA+B;QAChD,iFAAiF;QACjF,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC;gBACH,IAAI,CAAC,WAAW,CACd,sBAAsB,CAAC,0BAA0B,EACjD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CACzB,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,IAAI,CAAC,WAAW,CACd,sBAAsB,CAAC,0BAA0B,EACjD,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC,CAClD,CAAC;YACJ,CAAC;YACD,OAAO;QACT,CAAC;QACD,MAAM,UAAU,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,EAAE,OAAO,EAAE,2BAA2B,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxF,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,0BAA0B,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;IAEO,UAAU,CAAC,QAA+B;QAChD,OAAO,CACL,OAAO,QAAQ,KAAK,QAAQ;YAC5B,QAAQ,KAAK,IAAI;YACjB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YACxB,CAAC,CAAC,SAAS,IAAI,QAAQ,IAAI,UAAU,IAAI,QAAQ,CAAC,CACnD,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ export { OpenTelemetryScope } from "./OpenTelemetryScope.js";
2
+ export { InvokeAgentScope } from "./InvokeAgentScope.js";
3
+ export { ExecuteToolScope } from "./ExecuteToolScope.js";
4
+ export { InferenceScope } from "./InferenceScope.js";
5
+ export { OutputScope } from "./OutputScope.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/a365/scopes/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,8 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export { OpenTelemetryScope } from "./OpenTelemetryScope.js";
4
+ export { InvokeAgentScope } from "./InvokeAgentScope.js";
5
+ export { ExecuteToolScope } from "./ExecuteToolScope.js";
6
+ export { InferenceScope } from "./InferenceScope.js";
7
+ export { OutputScope } from "./OutputScope.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/a365/scopes/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Read an environment variable, trimmed and lowercased.
3
+ * Returns undefined if not set or empty.
4
+ */
5
+ export declare function getEnv(name: string): string | undefined;
6
+ //# sourceMappingURL=utils.d.ts.map