langchain 1.0.0-alpha.8 → 1.0.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 (458) hide show
  1. package/CHANGELOG.md +260 -0
  2. package/LICENSE +6 -6
  3. package/README.md +29 -77
  4. package/dist/agents/ReactAgent.cjs +498 -104
  5. package/dist/agents/ReactAgent.cjs.map +1 -1
  6. package/dist/agents/ReactAgent.d.cts +140 -17
  7. package/dist/agents/ReactAgent.d.cts.map +1 -1
  8. package/dist/agents/ReactAgent.d.ts +140 -17
  9. package/dist/agents/ReactAgent.d.ts.map +1 -1
  10. package/dist/agents/ReactAgent.js +501 -107
  11. package/dist/agents/ReactAgent.js.map +1 -1
  12. package/dist/agents/annotation.cjs +34 -152
  13. package/dist/agents/annotation.cjs.map +1 -1
  14. package/dist/agents/annotation.js +36 -150
  15. package/dist/agents/annotation.js.map +1 -1
  16. package/dist/agents/constants.cjs.map +1 -1
  17. package/dist/agents/constants.d.cts +9 -0
  18. package/dist/agents/constants.d.cts.map +1 -0
  19. package/dist/agents/constants.d.ts +9 -0
  20. package/dist/agents/constants.d.ts.map +1 -0
  21. package/dist/agents/constants.js.map +1 -1
  22. package/dist/agents/errors.cjs +2 -1
  23. package/dist/agents/errors.cjs.map +1 -1
  24. package/dist/agents/errors.js +2 -1
  25. package/dist/agents/errors.js.map +1 -1
  26. package/dist/agents/index.cjs +5 -29
  27. package/dist/agents/index.cjs.map +1 -1
  28. package/dist/agents/index.d.cts +157 -128
  29. package/dist/agents/index.d.cts.map +1 -1
  30. package/dist/agents/index.d.ts +157 -128
  31. package/dist/agents/index.d.ts.map +1 -1
  32. package/dist/agents/index.js +5 -27
  33. package/dist/agents/index.js.map +1 -1
  34. package/dist/agents/{middlewareAgent/middleware → middleware}/callLimit.cjs +31 -29
  35. package/dist/agents/middleware/callLimit.cjs.map +1 -0
  36. package/dist/agents/{middlewareAgent/middleware → middleware}/callLimit.d.cts +3 -3
  37. package/dist/agents/middleware/callLimit.d.cts.map +1 -0
  38. package/dist/agents/{middlewareAgent/middleware → middleware}/callLimit.d.ts +3 -3
  39. package/dist/agents/middleware/callLimit.d.ts.map +1 -0
  40. package/dist/agents/{middlewareAgent/middleware → middleware}/callLimit.js +30 -28
  41. package/dist/agents/middleware/callLimit.js.map +1 -0
  42. package/dist/agents/{middlewareAgent/middleware → middleware}/contextEditing.cjs +6 -6
  43. package/dist/agents/middleware/contextEditing.cjs.map +1 -0
  44. package/dist/agents/{middlewareAgent/middleware → middleware}/contextEditing.d.cts +2 -2
  45. package/dist/agents/middleware/contextEditing.d.cts.map +1 -0
  46. package/dist/agents/{middlewareAgent/middleware → middleware}/contextEditing.d.ts +2 -2
  47. package/dist/agents/middleware/contextEditing.d.ts.map +1 -0
  48. package/dist/agents/{middlewareAgent/middleware → middleware}/contextEditing.js +5 -5
  49. package/dist/agents/middleware/contextEditing.js.map +1 -0
  50. package/dist/agents/{middlewareAgent/middleware → middleware}/dynamicSystemPrompt.cjs +6 -6
  51. package/dist/agents/middleware/dynamicSystemPrompt.cjs.map +1 -0
  52. package/dist/agents/{middlewareAgent/middleware → middleware}/dynamicSystemPrompt.d.cts +3 -2
  53. package/dist/agents/middleware/dynamicSystemPrompt.d.cts.map +1 -0
  54. package/dist/agents/{middlewareAgent/middleware → middleware}/dynamicSystemPrompt.d.ts +3 -2
  55. package/dist/agents/middleware/dynamicSystemPrompt.d.ts.map +1 -0
  56. package/dist/agents/{middlewareAgent/middleware → middleware}/dynamicSystemPrompt.js +6 -6
  57. package/dist/agents/middleware/dynamicSystemPrompt.js.map +1 -0
  58. package/dist/agents/middleware/hitl.cjs +406 -0
  59. package/dist/agents/middleware/hitl.cjs.map +1 -0
  60. package/dist/agents/middleware/hitl.d.cts +611 -0
  61. package/dist/agents/middleware/hitl.d.cts.map +1 -0
  62. package/dist/agents/middleware/hitl.d.ts +611 -0
  63. package/dist/agents/middleware/hitl.d.ts.map +1 -0
  64. package/dist/agents/middleware/hitl.js +405 -0
  65. package/dist/agents/middleware/hitl.js.map +1 -0
  66. package/dist/agents/middleware/index.cjs +12 -0
  67. package/dist/agents/middleware/index.js +12 -0
  68. package/dist/agents/{middlewareAgent/middleware → middleware}/llmToolSelector.cjs +7 -7
  69. package/dist/agents/middleware/llmToolSelector.cjs.map +1 -0
  70. package/dist/agents/{middlewareAgent/middleware → middleware}/llmToolSelector.d.cts +2 -2
  71. package/dist/agents/middleware/llmToolSelector.d.cts.map +1 -0
  72. package/dist/agents/{middlewareAgent/middleware → middleware}/llmToolSelector.d.ts +2 -2
  73. package/dist/agents/middleware/llmToolSelector.d.ts.map +1 -0
  74. package/dist/agents/{middlewareAgent/middleware → middleware}/llmToolSelector.js +6 -6
  75. package/dist/agents/middleware/llmToolSelector.js.map +1 -0
  76. package/dist/agents/{middlewareAgent/middleware → middleware}/modelFallback.cjs +29 -22
  77. package/dist/agents/middleware/modelFallback.cjs.map +1 -0
  78. package/dist/agents/{middlewareAgent/middleware → middleware}/modelFallback.d.cts +3 -3
  79. package/dist/agents/middleware/modelFallback.d.cts.map +1 -0
  80. package/dist/agents/{middlewareAgent/middleware → middleware}/modelFallback.d.ts +3 -3
  81. package/dist/agents/middleware/modelFallback.d.ts.map +1 -0
  82. package/dist/agents/{middlewareAgent/middleware → middleware}/modelFallback.js +29 -22
  83. package/dist/agents/middleware/modelFallback.js.map +1 -0
  84. package/dist/agents/{middlewareAgent/middleware → middleware}/piiRedaction.cjs +12 -12
  85. package/dist/agents/middleware/piiRedaction.cjs.map +1 -0
  86. package/dist/agents/{middlewareAgent/middleware → middleware}/piiRedaction.d.cts +4 -4
  87. package/dist/agents/middleware/piiRedaction.d.cts.map +1 -0
  88. package/dist/agents/{middlewareAgent/middleware → middleware}/piiRedaction.d.ts +4 -4
  89. package/dist/agents/middleware/piiRedaction.d.ts.map +1 -0
  90. package/dist/agents/{middlewareAgent/middleware → middleware}/piiRedaction.js +10 -10
  91. package/dist/agents/middleware/piiRedaction.js.map +1 -0
  92. package/dist/agents/{middlewareAgent/middleware → middleware}/promptCaching.cjs +27 -24
  93. package/dist/agents/middleware/promptCaching.cjs.map +1 -0
  94. package/dist/agents/{middlewareAgent/middleware → middleware}/promptCaching.d.cts +3 -3
  95. package/dist/agents/middleware/promptCaching.d.cts.map +1 -0
  96. package/dist/agents/{middlewareAgent/middleware → middleware}/promptCaching.d.ts +3 -3
  97. package/dist/agents/middleware/promptCaching.d.ts.map +1 -0
  98. package/dist/agents/{middlewareAgent/middleware → middleware}/promptCaching.js +26 -23
  99. package/dist/agents/middleware/promptCaching.js.map +1 -0
  100. package/dist/agents/{middlewareAgent/middleware → middleware}/summarization.cjs +7 -12
  101. package/dist/agents/middleware/summarization.cjs.map +1 -0
  102. package/dist/agents/{middlewareAgent/middleware → middleware}/summarization.d.cts +3 -3
  103. package/dist/agents/middleware/summarization.d.cts.map +1 -0
  104. package/dist/agents/{middlewareAgent/middleware → middleware}/summarization.d.ts +3 -3
  105. package/dist/agents/middleware/summarization.d.ts.map +1 -0
  106. package/dist/agents/{middlewareAgent/middleware → middleware}/summarization.js +5 -10
  107. package/dist/agents/middleware/summarization.js.map +1 -0
  108. package/dist/agents/middleware/todoListMiddleware.cjs +314 -0
  109. package/dist/agents/middleware/todoListMiddleware.cjs.map +1 -0
  110. package/dist/agents/middleware/todoListMiddleware.d.cts +75 -0
  111. package/dist/agents/middleware/todoListMiddleware.d.cts.map +1 -0
  112. package/dist/agents/middleware/todoListMiddleware.d.ts +75 -0
  113. package/dist/agents/middleware/todoListMiddleware.d.ts.map +1 -0
  114. package/dist/agents/middleware/todoListMiddleware.js +312 -0
  115. package/dist/agents/middleware/todoListMiddleware.js.map +1 -0
  116. package/dist/agents/{middlewareAgent/middleware → middleware}/toolCallLimit.cjs +32 -30
  117. package/dist/agents/middleware/toolCallLimit.cjs.map +1 -0
  118. package/dist/agents/{middlewareAgent/middleware → middleware}/toolCallLimit.d.cts +3 -3
  119. package/dist/agents/middleware/toolCallLimit.d.cts.map +1 -0
  120. package/dist/agents/{middlewareAgent/middleware → middleware}/toolCallLimit.d.ts +3 -3
  121. package/dist/agents/middleware/toolCallLimit.d.ts.map +1 -0
  122. package/dist/agents/{middlewareAgent/middleware → middleware}/toolCallLimit.js +31 -29
  123. package/dist/agents/middleware/toolCallLimit.js.map +1 -0
  124. package/dist/agents/middleware/types.d.cts +354 -0
  125. package/dist/agents/middleware/types.d.cts.map +1 -0
  126. package/dist/agents/middleware/types.d.ts +354 -0
  127. package/dist/agents/middleware/types.d.ts.map +1 -0
  128. package/dist/agents/{middlewareAgent/middleware → middleware}/utils.cjs +11 -1
  129. package/dist/agents/middleware/utils.cjs.map +1 -0
  130. package/dist/agents/{middlewareAgent/middleware → middleware}/utils.d.cts +1 -1
  131. package/dist/agents/middleware/utils.d.cts.map +1 -0
  132. package/dist/agents/{middlewareAgent/middleware → middleware}/utils.d.ts +1 -1
  133. package/dist/agents/middleware/utils.d.ts.map +1 -0
  134. package/dist/agents/{middlewareAgent/middleware → middleware}/utils.js +10 -2
  135. package/dist/agents/middleware/utils.js.map +1 -0
  136. package/dist/agents/{middlewareAgent/middleware.cjs → middleware.cjs} +11 -8
  137. package/dist/agents/middleware.cjs.map +1 -0
  138. package/dist/agents/middleware.d.cts +185 -0
  139. package/dist/agents/middleware.d.cts.map +1 -0
  140. package/dist/agents/middleware.d.ts +185 -0
  141. package/dist/agents/middleware.d.ts.map +1 -0
  142. package/dist/agents/{middlewareAgent/middleware.js → middleware.js} +11 -8
  143. package/dist/agents/middleware.js.map +1 -0
  144. package/dist/agents/nodes/AfterAgentNode.cjs +29 -0
  145. package/dist/agents/nodes/AfterAgentNode.cjs.map +1 -0
  146. package/dist/agents/nodes/AfterAgentNode.js +29 -0
  147. package/dist/agents/nodes/AfterAgentNode.js.map +1 -0
  148. package/dist/agents/{middlewareAgent/nodes/AfterModalNode.cjs → nodes/AfterModelNode.cjs} +6 -6
  149. package/dist/agents/nodes/AfterModelNode.cjs.map +1 -0
  150. package/dist/agents/{middlewareAgent/nodes/AfterModalNode.js → nodes/AfterModelNode.js} +6 -6
  151. package/dist/agents/nodes/AfterModelNode.js.map +1 -0
  152. package/dist/agents/nodes/AgentNode.cjs +203 -71
  153. package/dist/agents/nodes/AgentNode.cjs.map +1 -1
  154. package/dist/agents/nodes/AgentNode.js +205 -73
  155. package/dist/agents/nodes/AgentNode.js.map +1 -1
  156. package/dist/agents/nodes/BeforeAgentNode.cjs +29 -0
  157. package/dist/agents/nodes/BeforeAgentNode.cjs.map +1 -0
  158. package/dist/agents/nodes/BeforeAgentNode.js +29 -0
  159. package/dist/agents/nodes/BeforeAgentNode.js.map +1 -0
  160. package/dist/agents/{middlewareAgent/nodes/BeforeModalNode.cjs → nodes/BeforeModelNode.cjs} +6 -4
  161. package/dist/agents/nodes/BeforeModelNode.cjs.map +1 -0
  162. package/dist/agents/{middlewareAgent/nodes/BeforeModalNode.js → nodes/BeforeModelNode.js} +6 -4
  163. package/dist/agents/nodes/BeforeModelNode.js.map +1 -0
  164. package/dist/agents/nodes/ToolNode.cjs +163 -52
  165. package/dist/agents/nodes/ToolNode.cjs.map +1 -1
  166. package/dist/agents/nodes/ToolNode.js +164 -53
  167. package/dist/agents/nodes/ToolNode.js.map +1 -1
  168. package/dist/agents/{middlewareAgent/nodes → nodes}/middleware.cjs +36 -10
  169. package/dist/agents/nodes/middleware.cjs.map +1 -0
  170. package/dist/agents/{middlewareAgent/nodes → nodes}/middleware.js +35 -9
  171. package/dist/agents/nodes/middleware.js.map +1 -0
  172. package/dist/agents/nodes/types.d.cts +72 -0
  173. package/dist/agents/nodes/types.d.cts.map +1 -0
  174. package/dist/agents/nodes/types.d.ts +72 -0
  175. package/dist/agents/nodes/types.d.ts.map +1 -0
  176. package/dist/agents/nodes/utils.cjs +64 -0
  177. package/dist/agents/nodes/utils.cjs.map +1 -1
  178. package/dist/agents/nodes/utils.js +62 -1
  179. package/dist/agents/nodes/utils.js.map +1 -1
  180. package/dist/agents/responses.cjs +1 -1
  181. package/dist/agents/responses.cjs.map +1 -1
  182. package/dist/agents/responses.d.cts +9 -2
  183. package/dist/agents/responses.d.cts.map +1 -1
  184. package/dist/agents/responses.d.ts +8 -1
  185. package/dist/agents/responses.d.ts.map +1 -1
  186. package/dist/agents/responses.js +1 -1
  187. package/dist/agents/responses.js.map +1 -1
  188. package/dist/agents/runtime.d.cts +123 -0
  189. package/dist/agents/runtime.d.cts.map +1 -0
  190. package/dist/agents/runtime.d.ts +123 -0
  191. package/dist/agents/runtime.d.ts.map +1 -0
  192. package/dist/agents/tests/utils.cjs +13 -5
  193. package/dist/agents/tests/utils.cjs.map +1 -1
  194. package/dist/agents/tests/utils.d.cts +17 -8
  195. package/dist/agents/tests/utils.d.cts.map +1 -1
  196. package/dist/agents/tests/utils.d.ts +14 -5
  197. package/dist/agents/tests/utils.d.ts.map +1 -1
  198. package/dist/agents/tests/utils.js +13 -5
  199. package/dist/agents/tests/utils.js.map +1 -1
  200. package/dist/agents/tools.d.cts +9 -0
  201. package/dist/agents/tools.d.cts.map +1 -0
  202. package/dist/agents/tools.d.ts +9 -0
  203. package/dist/agents/tools.d.ts.map +1 -0
  204. package/dist/agents/types.d.cts +163 -119
  205. package/dist/agents/types.d.cts.map +1 -1
  206. package/dist/agents/types.d.ts +163 -119
  207. package/dist/agents/types.d.ts.map +1 -1
  208. package/dist/agents/utils.cjs +141 -38
  209. package/dist/agents/utils.cjs.map +1 -1
  210. package/dist/agents/utils.js +142 -40
  211. package/dist/agents/utils.js.map +1 -1
  212. package/dist/chat_models/universal.cjs +4 -0
  213. package/dist/chat_models/universal.cjs.map +1 -1
  214. package/dist/chat_models/universal.d.cts +6 -2
  215. package/dist/chat_models/universal.d.cts.map +1 -1
  216. package/dist/chat_models/universal.d.ts +4 -0
  217. package/dist/chat_models/universal.d.ts.map +1 -1
  218. package/dist/chat_models/universal.js +4 -0
  219. package/dist/chat_models/universal.js.map +1 -1
  220. package/dist/hub/base.cjs +4 -3
  221. package/dist/hub/base.cjs.map +1 -1
  222. package/dist/hub/base.d.cts +0 -4
  223. package/dist/hub/base.d.cts.map +1 -1
  224. package/dist/hub/base.d.ts +0 -4
  225. package/dist/hub/base.d.ts.map +1 -1
  226. package/dist/hub/base.js +4 -3
  227. package/dist/hub/base.js.map +1 -1
  228. package/dist/index.cjs +23 -43
  229. package/dist/index.cjs.map +1 -1
  230. package/dist/index.d.cts +21 -21
  231. package/dist/index.d.ts +21 -21
  232. package/dist/index.js +17 -26
  233. package/dist/index.js.map +1 -1
  234. package/dist/load/import_map.cjs +1 -7
  235. package/dist/load/import_map.cjs.map +1 -1
  236. package/dist/load/import_map.js +1 -7
  237. package/dist/load/import_map.js.map +1 -1
  238. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/client.cjs +74 -18
  239. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.cjs.map +1 -0
  240. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/client.js +75 -19
  241. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.js.map +1 -0
  242. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.cjs +1 -1
  243. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.cjs.map +1 -1
  244. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.js +1 -1
  245. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/env.js.map +1 -1
  246. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.cjs +1 -1
  247. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.cjs.map +1 -1
  248. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.js +1 -1
  249. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/constants.js.map +1 -1
  250. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.cjs +1 -1
  251. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.cjs.map +1 -1
  252. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.js +1 -1
  253. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/experimental/otel/translator.js.map +1 -1
  254. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.cjs +2 -2
  255. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.cjs.map +1 -1
  256. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.js +2 -2
  257. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/index.js.map +1 -1
  258. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/run_trees.cjs +7 -5
  259. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.cjs.map +1 -0
  260. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/run_trees.js +7 -5
  261. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js.map +1 -0
  262. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.cjs +1 -1
  263. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.cjs.map +1 -1
  264. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.js +1 -1
  265. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/constants.js.map +1 -1
  266. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.cjs +1 -1
  267. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.cjs.map +1 -1
  268. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.js +1 -1
  269. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/fetch.js.map +1 -1
  270. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.cjs +1 -1
  271. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.cjs.map +1 -1
  272. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.js +1 -1
  273. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/singletons/otel.js.map +1 -1
  274. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.cjs +1 -1
  275. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.cjs.map +1 -1
  276. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.js +1 -1
  277. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/_uuid.js.map +1 -1
  278. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.cjs +1 -1
  279. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.cjs.map +1 -1
  280. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.js +1 -1
  281. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/async_caller.js.map +1 -1
  282. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/env.cjs +19 -23
  283. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.cjs.map +1 -0
  284. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/env.js +19 -23
  285. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.js.map +1 -0
  286. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/error.cjs +16 -3
  287. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.cjs.map +1 -0
  288. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/error.js +16 -3
  289. package/dist/node_modules/.pnpm/langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.js.map +1 -0
  290. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs +1 -1
  291. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs.map +1 -1
  292. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js +1 -1
  293. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js.map +1 -1
  294. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.cjs +1 -1
  295. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.cjs.map +1 -1
  296. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.js +1 -1
  297. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/messages.js.map +1 -1
  298. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.cjs +1 -1
  299. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.cjs.map +1 -1
  300. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.js +1 -1
  301. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/project.js.map +1 -1
  302. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.cjs +1 -1
  303. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.cjs.map +1 -1
  304. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.js +1 -1
  305. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/prompts.js.map +1 -1
  306. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.cjs +1 -1
  307. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.cjs.map +1 -1
  308. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.js +1 -1
  309. package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/dist/utils/warn.js.map +1 -1
  310. package/package.json +30 -63
  311. package/dist/agents/RunnableCallable.d.cts +0 -41
  312. package/dist/agents/RunnableCallable.d.cts.map +0 -1
  313. package/dist/agents/RunnableCallable.d.ts +0 -41
  314. package/dist/agents/RunnableCallable.d.ts.map +0 -1
  315. package/dist/agents/annotation.d.cts +0 -52
  316. package/dist/agents/annotation.d.cts.map +0 -1
  317. package/dist/agents/annotation.d.ts +0 -52
  318. package/dist/agents/annotation.d.ts.map +0 -1
  319. package/dist/agents/createAgent.cjs +0 -10
  320. package/dist/agents/createAgent.cjs.map +0 -1
  321. package/dist/agents/createAgent.js +0 -10
  322. package/dist/agents/createAgent.js.map +0 -1
  323. package/dist/agents/interrupt.cjs +0 -2
  324. package/dist/agents/interrupt.d.cts +0 -81
  325. package/dist/agents/interrupt.d.cts.map +0 -1
  326. package/dist/agents/interrupt.d.ts +0 -81
  327. package/dist/agents/interrupt.d.ts.map +0 -1
  328. package/dist/agents/interrupt.js +0 -3
  329. package/dist/agents/middlewareAgent/ReactAgent.cjs +0 -579
  330. package/dist/agents/middlewareAgent/ReactAgent.cjs.map +0 -1
  331. package/dist/agents/middlewareAgent/ReactAgent.d.cts +0 -234
  332. package/dist/agents/middlewareAgent/ReactAgent.d.cts.map +0 -1
  333. package/dist/agents/middlewareAgent/ReactAgent.d.ts +0 -234
  334. package/dist/agents/middlewareAgent/ReactAgent.d.ts.map +0 -1
  335. package/dist/agents/middlewareAgent/ReactAgent.js +0 -578
  336. package/dist/agents/middlewareAgent/ReactAgent.js.map +0 -1
  337. package/dist/agents/middlewareAgent/annotation.cjs +0 -45
  338. package/dist/agents/middlewareAgent/annotation.cjs.map +0 -1
  339. package/dist/agents/middlewareAgent/annotation.js +0 -44
  340. package/dist/agents/middlewareAgent/annotation.js.map +0 -1
  341. package/dist/agents/middlewareAgent/constants.d.cts +0 -5
  342. package/dist/agents/middlewareAgent/constants.d.cts.map +0 -1
  343. package/dist/agents/middlewareAgent/constants.d.ts +0 -5
  344. package/dist/agents/middlewareAgent/constants.d.ts.map +0 -1
  345. package/dist/agents/middlewareAgent/index.cjs +0 -11
  346. package/dist/agents/middlewareAgent/index.cjs.map +0 -1
  347. package/dist/agents/middlewareAgent/index.js +0 -11
  348. package/dist/agents/middlewareAgent/index.js.map +0 -1
  349. package/dist/agents/middlewareAgent/middleware/callLimit.cjs.map +0 -1
  350. package/dist/agents/middlewareAgent/middleware/callLimit.d.cts.map +0 -1
  351. package/dist/agents/middlewareAgent/middleware/callLimit.d.ts.map +0 -1
  352. package/dist/agents/middlewareAgent/middleware/callLimit.js.map +0 -1
  353. package/dist/agents/middlewareAgent/middleware/contextEditing.cjs.map +0 -1
  354. package/dist/agents/middlewareAgent/middleware/contextEditing.d.cts.map +0 -1
  355. package/dist/agents/middlewareAgent/middleware/contextEditing.d.ts.map +0 -1
  356. package/dist/agents/middlewareAgent/middleware/contextEditing.js.map +0 -1
  357. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.cjs.map +0 -1
  358. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.cts.map +0 -1
  359. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.ts.map +0 -1
  360. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.js.map +0 -1
  361. package/dist/agents/middlewareAgent/middleware/hitl.cjs +0 -341
  362. package/dist/agents/middlewareAgent/middleware/hitl.cjs.map +0 -1
  363. package/dist/agents/middlewareAgent/middleware/hitl.d.cts +0 -524
  364. package/dist/agents/middlewareAgent/middleware/hitl.d.cts.map +0 -1
  365. package/dist/agents/middlewareAgent/middleware/hitl.d.ts +0 -524
  366. package/dist/agents/middlewareAgent/middleware/hitl.d.ts.map +0 -1
  367. package/dist/agents/middlewareAgent/middleware/hitl.js +0 -340
  368. package/dist/agents/middlewareAgent/middleware/hitl.js.map +0 -1
  369. package/dist/agents/middlewareAgent/middleware/index.cjs +0 -52
  370. package/dist/agents/middlewareAgent/middleware/index.cjs.map +0 -1
  371. package/dist/agents/middlewareAgent/middleware/index.d.cts +0 -13
  372. package/dist/agents/middlewareAgent/middleware/index.d.ts +0 -13
  373. package/dist/agents/middlewareAgent/middleware/index.js +0 -34
  374. package/dist/agents/middlewareAgent/middleware/index.js.map +0 -1
  375. package/dist/agents/middlewareAgent/middleware/llmToolSelector.cjs.map +0 -1
  376. package/dist/agents/middlewareAgent/middleware/llmToolSelector.d.cts.map +0 -1
  377. package/dist/agents/middlewareAgent/middleware/llmToolSelector.d.ts.map +0 -1
  378. package/dist/agents/middlewareAgent/middleware/llmToolSelector.js.map +0 -1
  379. package/dist/agents/middlewareAgent/middleware/modelFallback.cjs.map +0 -1
  380. package/dist/agents/middlewareAgent/middleware/modelFallback.d.cts.map +0 -1
  381. package/dist/agents/middlewareAgent/middleware/modelFallback.d.ts.map +0 -1
  382. package/dist/agents/middlewareAgent/middleware/modelFallback.js.map +0 -1
  383. package/dist/agents/middlewareAgent/middleware/piiRedaction.cjs.map +0 -1
  384. package/dist/agents/middlewareAgent/middleware/piiRedaction.d.cts.map +0 -1
  385. package/dist/agents/middlewareAgent/middleware/piiRedaction.d.ts.map +0 -1
  386. package/dist/agents/middlewareAgent/middleware/piiRedaction.js.map +0 -1
  387. package/dist/agents/middlewareAgent/middleware/promptCaching.cjs.map +0 -1
  388. package/dist/agents/middlewareAgent/middleware/promptCaching.d.cts.map +0 -1
  389. package/dist/agents/middlewareAgent/middleware/promptCaching.d.ts.map +0 -1
  390. package/dist/agents/middlewareAgent/middleware/promptCaching.js.map +0 -1
  391. package/dist/agents/middlewareAgent/middleware/summarization.cjs.map +0 -1
  392. package/dist/agents/middlewareAgent/middleware/summarization.d.cts.map +0 -1
  393. package/dist/agents/middlewareAgent/middleware/summarization.d.ts.map +0 -1
  394. package/dist/agents/middlewareAgent/middleware/summarization.js.map +0 -1
  395. package/dist/agents/middlewareAgent/middleware/toolCallLimit.cjs.map +0 -1
  396. package/dist/agents/middlewareAgent/middleware/toolCallLimit.d.cts.map +0 -1
  397. package/dist/agents/middlewareAgent/middleware/toolCallLimit.d.ts.map +0 -1
  398. package/dist/agents/middlewareAgent/middleware/toolCallLimit.js.map +0 -1
  399. package/dist/agents/middlewareAgent/middleware/utils.cjs.map +0 -1
  400. package/dist/agents/middlewareAgent/middleware/utils.d.cts.map +0 -1
  401. package/dist/agents/middlewareAgent/middleware/utils.d.ts.map +0 -1
  402. package/dist/agents/middlewareAgent/middleware/utils.js.map +0 -1
  403. package/dist/agents/middlewareAgent/middleware.cjs.map +0 -1
  404. package/dist/agents/middlewareAgent/middleware.d.cts +0 -117
  405. package/dist/agents/middlewareAgent/middleware.d.cts.map +0 -1
  406. package/dist/agents/middlewareAgent/middleware.d.ts +0 -117
  407. package/dist/agents/middlewareAgent/middleware.d.ts.map +0 -1
  408. package/dist/agents/middlewareAgent/middleware.js.map +0 -1
  409. package/dist/agents/middlewareAgent/nodes/AfterModalNode.cjs.map +0 -1
  410. package/dist/agents/middlewareAgent/nodes/AfterModalNode.js.map +0 -1
  411. package/dist/agents/middlewareAgent/nodes/AgentNode.cjs +0 -468
  412. package/dist/agents/middlewareAgent/nodes/AgentNode.cjs.map +0 -1
  413. package/dist/agents/middlewareAgent/nodes/AgentNode.js +0 -467
  414. package/dist/agents/middlewareAgent/nodes/AgentNode.js.map +0 -1
  415. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.cjs.map +0 -1
  416. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.js.map +0 -1
  417. package/dist/agents/middlewareAgent/nodes/middleware.cjs.map +0 -1
  418. package/dist/agents/middlewareAgent/nodes/middleware.js.map +0 -1
  419. package/dist/agents/middlewareAgent/nodes/utils.cjs +0 -66
  420. package/dist/agents/middlewareAgent/nodes/utils.cjs.map +0 -1
  421. package/dist/agents/middlewareAgent/nodes/utils.js +0 -63
  422. package/dist/agents/middlewareAgent/nodes/utils.js.map +0 -1
  423. package/dist/agents/middlewareAgent/types.d.cts +0 -472
  424. package/dist/agents/middlewareAgent/types.d.cts.map +0 -1
  425. package/dist/agents/middlewareAgent/types.d.ts +0 -472
  426. package/dist/agents/middlewareAgent/types.d.ts.map +0 -1
  427. package/dist/agents/nodes/ToolNode.d.cts +0 -97
  428. package/dist/agents/nodes/ToolNode.d.cts.map +0 -1
  429. package/dist/agents/nodes/ToolNode.d.ts +0 -97
  430. package/dist/agents/nodes/ToolNode.d.ts.map +0 -1
  431. package/dist/agents/types.cjs +0 -7
  432. package/dist/agents/types.cjs.map +0 -1
  433. package/dist/agents/types.js +0 -6
  434. package/dist/agents/types.js.map +0 -1
  435. package/dist/embeddings/cache_backed.cjs +0 -140
  436. package/dist/embeddings/cache_backed.cjs.map +0 -1
  437. package/dist/embeddings/cache_backed.d.cts +0 -107
  438. package/dist/embeddings/cache_backed.d.cts.map +0 -1
  439. package/dist/embeddings/cache_backed.d.ts +0 -107
  440. package/dist/embeddings/cache_backed.d.ts.map +0 -1
  441. package/dist/embeddings/cache_backed.js +0 -134
  442. package/dist/embeddings/cache_backed.js.map +0 -1
  443. package/dist/embeddings/fake.cjs +0 -22
  444. package/dist/embeddings/fake.cjs.map +0 -1
  445. package/dist/embeddings/fake.d.cts +0 -1
  446. package/dist/embeddings/fake.d.ts +0 -1
  447. package/dist/embeddings/fake.js +0 -12
  448. package/dist/embeddings/fake.js.map +0 -1
  449. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.cjs.map +0 -1
  450. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/client.js.map +0 -1
  451. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.cjs.map +0 -1
  452. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js.map +0 -1
  453. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.cjs.map +0 -1
  454. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/env.js.map +0 -1
  455. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.cjs.map +0 -1
  456. package/dist/node_modules/.pnpm/langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/utils/error.js.map +0 -1
  457. /package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/index.cjs +0 -0
  458. /package/dist/node_modules/.pnpm/{langsmith@0.3.64_@opentelemetry_api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_ → langsmith@0.3.74_@opentelemetry_api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_}/node_modules/langsmith/index.js +0 -0
@@ -1,5 +1,5 @@
1
1
 
2
- //#region ../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.js
2
+ //#region ../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.js
3
3
  const GEN_AI_OPERATION_NAME = "gen_ai.operation.name";
4
4
  const GEN_AI_SYSTEM = "gen_ai.system";
5
5
  const GEN_AI_REQUEST_MODEL = "gen_ai.request.model";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.js"],"sourcesContent":["// OpenTelemetry GenAI semantic convention attribute names\nexport const GEN_AI_OPERATION_NAME = \"gen_ai.operation.name\";\nexport const GEN_AI_SYSTEM = \"gen_ai.system\";\nexport const GEN_AI_REQUEST_MODEL = \"gen_ai.request.model\";\nexport const GEN_AI_RESPONSE_MODEL = \"gen_ai.response.model\";\nexport const GEN_AI_USAGE_INPUT_TOKENS = \"gen_ai.usage.input_tokens\";\nexport const GEN_AI_USAGE_OUTPUT_TOKENS = \"gen_ai.usage.output_tokens\";\nexport const GEN_AI_USAGE_TOTAL_TOKENS = \"gen_ai.usage.total_tokens\";\nexport const GEN_AI_REQUEST_MAX_TOKENS = \"gen_ai.request.max_tokens\";\nexport const GEN_AI_REQUEST_TEMPERATURE = \"gen_ai.request.temperature\";\nexport const GEN_AI_REQUEST_TOP_P = \"gen_ai.request.top_p\";\nexport const GEN_AI_REQUEST_FREQUENCY_PENALTY = \"gen_ai.request.frequency_penalty\";\nexport const GEN_AI_REQUEST_PRESENCE_PENALTY = \"gen_ai.request.presence_penalty\";\nexport const GEN_AI_RESPONSE_FINISH_REASONS = \"gen_ai.response.finish_reasons\";\nexport const GENAI_PROMPT = \"gen_ai.prompt\";\nexport const GENAI_COMPLETION = \"gen_ai.completion\";\nexport const GEN_AI_REQUEST_EXTRA_QUERY = \"gen_ai.request.extra_query\";\nexport const GEN_AI_REQUEST_EXTRA_BODY = \"gen_ai.request.extra_body\";\nexport const GEN_AI_SERIALIZED_NAME = \"gen_ai.serialized.name\";\nexport const GEN_AI_SERIALIZED_SIGNATURE = \"gen_ai.serialized.signature\";\nexport const GEN_AI_SERIALIZED_DOC = \"gen_ai.serialized.doc\";\nexport const GEN_AI_RESPONSE_ID = \"gen_ai.response.id\";\nexport const GEN_AI_RESPONSE_SERVICE_TIER = \"gen_ai.response.service_tier\";\nexport const GEN_AI_RESPONSE_SYSTEM_FINGERPRINT = \"gen_ai.response.system_fingerprint\";\nexport const GEN_AI_USAGE_INPUT_TOKEN_DETAILS = \"gen_ai.usage.input_token_details\";\nexport const GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS = \"gen_ai.usage.output_token_details\";\n// LangSmith custom attributes\nexport const LANGSMITH_SESSION_ID = \"langsmith.trace.session_id\";\nexport const LANGSMITH_SESSION_NAME = \"langsmith.trace.session_name\";\nexport const LANGSMITH_RUN_TYPE = \"langsmith.span.kind\";\nexport const LANGSMITH_NAME = \"langsmith.trace.name\";\nexport const LANGSMITH_METADATA = \"langsmith.metadata\";\nexport const LANGSMITH_TAGS = \"langsmith.span.tags\";\nexport const LANGSMITH_RUNTIME = \"langsmith.span.runtime\";\nexport const LANGSMITH_REQUEST_STREAMING = \"langsmith.request.streaming\";\nexport const LANGSMITH_REQUEST_HEADERS = \"langsmith.request.headers\";\nexport const LANGSMITH_RUN_ID = \"langsmith.span.id\";\nexport const LANGSMITH_TRACE_ID = \"langsmith.trace.id\";\nexport const LANGSMITH_DOTTED_ORDER = \"langsmith.span.dotted_order\";\nexport const LANGSMITH_PARENT_RUN_ID = \"langsmith.span.parent_id\";\nexport const LANGSMITH_USAGE_METADATA = \"langsmith.usage_metadata\";\nexport const LANGSMITH_REFERENCE_EXAMPLE_ID = \"langsmith.reference_example_id\";\nexport const LANGSMITH_TRACEABLE = \"langsmith.traceable\";\nexport const LANGSMITH_IS_ROOT = \"langsmith.is_root\";\nexport const LANGSMITH_TRACEABLE_PARENT_OTEL_SPAN_ID = \"langsmith.traceable_parent_otel_span_id\";\n// GenAI event names\nexport const GEN_AI_SYSTEM_MESSAGE = \"gen_ai.system.message\";\nexport const GEN_AI_USER_MESSAGE = \"gen_ai.user.message\";\nexport const GEN_AI_ASSISTANT_MESSAGE = \"gen_ai.assistant.message\";\nexport const GEN_AI_CHOICE = \"gen_ai.choice\";\nexport const AI_SDK_LLM_OPERATIONS = [\n \"ai.generateText.doGenerate\",\n \"ai.streamText.doStream\",\n \"ai.generateObject.doGenerate\",\n \"ai.streamObject.doStream\",\n];\nexport const AI_SDK_TOOL_OPERATIONS = [\"ai.toolCall\"];\n"],"x_google_ignoreList":[0],"mappings":";;AACA,MAAa,wBAAwB;AACrC,MAAa,gBAAgB;AAC7B,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;AACrC,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;AACpC,MAAa,mCAAmC;AAChD,MAAa,kCAAkC;AAC/C,MAAa,iCAAiC;AAC9C,MAAa,eAAe;AAC5B,MAAa,mBAAmB;AAChC,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,yBAAyB;AACtC,MAAa,8BAA8B;AAC3C,MAAa,wBAAwB;AACrC,MAAa,qBAAqB;AAClC,MAAa,+BAA+B;AAC5C,MAAa,qCAAqC;AAClD,MAAa,mCAAmC;AAChD,MAAa,oCAAoC;AAEjD,MAAa,uBAAuB;AACpC,MAAa,yBAAyB;AACtC,MAAa,qBAAqB;AAClC,MAAa,iBAAiB;AAC9B,MAAa,qBAAqB;AAClC,MAAa,iBAAiB;AAE9B,MAAa,8BAA8B;AAC3C,MAAa,4BAA4B"}
1
+ {"version":3,"file":"constants.cjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.js"],"sourcesContent":["// OpenTelemetry GenAI semantic convention attribute names\nexport const GEN_AI_OPERATION_NAME = \"gen_ai.operation.name\";\nexport const GEN_AI_SYSTEM = \"gen_ai.system\";\nexport const GEN_AI_REQUEST_MODEL = \"gen_ai.request.model\";\nexport const GEN_AI_RESPONSE_MODEL = \"gen_ai.response.model\";\nexport const GEN_AI_USAGE_INPUT_TOKENS = \"gen_ai.usage.input_tokens\";\nexport const GEN_AI_USAGE_OUTPUT_TOKENS = \"gen_ai.usage.output_tokens\";\nexport const GEN_AI_USAGE_TOTAL_TOKENS = \"gen_ai.usage.total_tokens\";\nexport const GEN_AI_REQUEST_MAX_TOKENS = \"gen_ai.request.max_tokens\";\nexport const GEN_AI_REQUEST_TEMPERATURE = \"gen_ai.request.temperature\";\nexport const GEN_AI_REQUEST_TOP_P = \"gen_ai.request.top_p\";\nexport const GEN_AI_REQUEST_FREQUENCY_PENALTY = \"gen_ai.request.frequency_penalty\";\nexport const GEN_AI_REQUEST_PRESENCE_PENALTY = \"gen_ai.request.presence_penalty\";\nexport const GEN_AI_RESPONSE_FINISH_REASONS = \"gen_ai.response.finish_reasons\";\nexport const GENAI_PROMPT = \"gen_ai.prompt\";\nexport const GENAI_COMPLETION = \"gen_ai.completion\";\nexport const GEN_AI_REQUEST_EXTRA_QUERY = \"gen_ai.request.extra_query\";\nexport const GEN_AI_REQUEST_EXTRA_BODY = \"gen_ai.request.extra_body\";\nexport const GEN_AI_SERIALIZED_NAME = \"gen_ai.serialized.name\";\nexport const GEN_AI_SERIALIZED_SIGNATURE = \"gen_ai.serialized.signature\";\nexport const GEN_AI_SERIALIZED_DOC = \"gen_ai.serialized.doc\";\nexport const GEN_AI_RESPONSE_ID = \"gen_ai.response.id\";\nexport const GEN_AI_RESPONSE_SERVICE_TIER = \"gen_ai.response.service_tier\";\nexport const GEN_AI_RESPONSE_SYSTEM_FINGERPRINT = \"gen_ai.response.system_fingerprint\";\nexport const GEN_AI_USAGE_INPUT_TOKEN_DETAILS = \"gen_ai.usage.input_token_details\";\nexport const GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS = \"gen_ai.usage.output_token_details\";\n// LangSmith custom attributes\nexport const LANGSMITH_SESSION_ID = \"langsmith.trace.session_id\";\nexport const LANGSMITH_SESSION_NAME = \"langsmith.trace.session_name\";\nexport const LANGSMITH_RUN_TYPE = \"langsmith.span.kind\";\nexport const LANGSMITH_NAME = \"langsmith.trace.name\";\nexport const LANGSMITH_METADATA = \"langsmith.metadata\";\nexport const LANGSMITH_TAGS = \"langsmith.span.tags\";\nexport const LANGSMITH_RUNTIME = \"langsmith.span.runtime\";\nexport const LANGSMITH_REQUEST_STREAMING = \"langsmith.request.streaming\";\nexport const LANGSMITH_REQUEST_HEADERS = \"langsmith.request.headers\";\nexport const LANGSMITH_RUN_ID = \"langsmith.span.id\";\nexport const LANGSMITH_TRACE_ID = \"langsmith.trace.id\";\nexport const LANGSMITH_DOTTED_ORDER = \"langsmith.span.dotted_order\";\nexport const LANGSMITH_PARENT_RUN_ID = \"langsmith.span.parent_id\";\nexport const LANGSMITH_USAGE_METADATA = \"langsmith.usage_metadata\";\nexport const LANGSMITH_REFERENCE_EXAMPLE_ID = \"langsmith.reference_example_id\";\nexport const LANGSMITH_TRACEABLE = \"langsmith.traceable\";\nexport const LANGSMITH_IS_ROOT = \"langsmith.is_root\";\nexport const LANGSMITH_TRACEABLE_PARENT_OTEL_SPAN_ID = \"langsmith.traceable_parent_otel_span_id\";\n// GenAI event names\nexport const GEN_AI_SYSTEM_MESSAGE = \"gen_ai.system.message\";\nexport const GEN_AI_USER_MESSAGE = \"gen_ai.user.message\";\nexport const GEN_AI_ASSISTANT_MESSAGE = \"gen_ai.assistant.message\";\nexport const GEN_AI_CHOICE = \"gen_ai.choice\";\nexport const AI_SDK_LLM_OPERATIONS = [\n \"ai.generateText.doGenerate\",\n \"ai.streamText.doStream\",\n \"ai.generateObject.doGenerate\",\n \"ai.streamObject.doStream\",\n];\nexport const AI_SDK_TOOL_OPERATIONS = [\"ai.toolCall\"];\n"],"x_google_ignoreList":[0],"mappings":";;AACA,MAAa,wBAAwB;AACrC,MAAa,gBAAgB;AAC7B,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;AACrC,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;AACpC,MAAa,mCAAmC;AAChD,MAAa,kCAAkC;AAC/C,MAAa,iCAAiC;AAC9C,MAAa,eAAe;AAC5B,MAAa,mBAAmB;AAChC,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,yBAAyB;AACtC,MAAa,8BAA8B;AAC3C,MAAa,wBAAwB;AACrC,MAAa,qBAAqB;AAClC,MAAa,+BAA+B;AAC5C,MAAa,qCAAqC;AAClD,MAAa,mCAAmC;AAChD,MAAa,oCAAoC;AAEjD,MAAa,uBAAuB;AACpC,MAAa,yBAAyB;AACtC,MAAa,qBAAqB;AAClC,MAAa,iBAAiB;AAC9B,MAAa,qBAAqB;AAClC,MAAa,iBAAiB;AAE9B,MAAa,8BAA8B;AAC3C,MAAa,4BAA4B"}
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.js
1
+ //#region ../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.js
2
2
  const GEN_AI_OPERATION_NAME = "gen_ai.operation.name";
3
3
  const GEN_AI_SYSTEM = "gen_ai.system";
4
4
  const GEN_AI_REQUEST_MODEL = "gen_ai.request.model";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.js"],"sourcesContent":["// OpenTelemetry GenAI semantic convention attribute names\nexport const GEN_AI_OPERATION_NAME = \"gen_ai.operation.name\";\nexport const GEN_AI_SYSTEM = \"gen_ai.system\";\nexport const GEN_AI_REQUEST_MODEL = \"gen_ai.request.model\";\nexport const GEN_AI_RESPONSE_MODEL = \"gen_ai.response.model\";\nexport const GEN_AI_USAGE_INPUT_TOKENS = \"gen_ai.usage.input_tokens\";\nexport const GEN_AI_USAGE_OUTPUT_TOKENS = \"gen_ai.usage.output_tokens\";\nexport const GEN_AI_USAGE_TOTAL_TOKENS = \"gen_ai.usage.total_tokens\";\nexport const GEN_AI_REQUEST_MAX_TOKENS = \"gen_ai.request.max_tokens\";\nexport const GEN_AI_REQUEST_TEMPERATURE = \"gen_ai.request.temperature\";\nexport const GEN_AI_REQUEST_TOP_P = \"gen_ai.request.top_p\";\nexport const GEN_AI_REQUEST_FREQUENCY_PENALTY = \"gen_ai.request.frequency_penalty\";\nexport const GEN_AI_REQUEST_PRESENCE_PENALTY = \"gen_ai.request.presence_penalty\";\nexport const GEN_AI_RESPONSE_FINISH_REASONS = \"gen_ai.response.finish_reasons\";\nexport const GENAI_PROMPT = \"gen_ai.prompt\";\nexport const GENAI_COMPLETION = \"gen_ai.completion\";\nexport const GEN_AI_REQUEST_EXTRA_QUERY = \"gen_ai.request.extra_query\";\nexport const GEN_AI_REQUEST_EXTRA_BODY = \"gen_ai.request.extra_body\";\nexport const GEN_AI_SERIALIZED_NAME = \"gen_ai.serialized.name\";\nexport const GEN_AI_SERIALIZED_SIGNATURE = \"gen_ai.serialized.signature\";\nexport const GEN_AI_SERIALIZED_DOC = \"gen_ai.serialized.doc\";\nexport const GEN_AI_RESPONSE_ID = \"gen_ai.response.id\";\nexport const GEN_AI_RESPONSE_SERVICE_TIER = \"gen_ai.response.service_tier\";\nexport const GEN_AI_RESPONSE_SYSTEM_FINGERPRINT = \"gen_ai.response.system_fingerprint\";\nexport const GEN_AI_USAGE_INPUT_TOKEN_DETAILS = \"gen_ai.usage.input_token_details\";\nexport const GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS = \"gen_ai.usage.output_token_details\";\n// LangSmith custom attributes\nexport const LANGSMITH_SESSION_ID = \"langsmith.trace.session_id\";\nexport const LANGSMITH_SESSION_NAME = \"langsmith.trace.session_name\";\nexport const LANGSMITH_RUN_TYPE = \"langsmith.span.kind\";\nexport const LANGSMITH_NAME = \"langsmith.trace.name\";\nexport const LANGSMITH_METADATA = \"langsmith.metadata\";\nexport const LANGSMITH_TAGS = \"langsmith.span.tags\";\nexport const LANGSMITH_RUNTIME = \"langsmith.span.runtime\";\nexport const LANGSMITH_REQUEST_STREAMING = \"langsmith.request.streaming\";\nexport const LANGSMITH_REQUEST_HEADERS = \"langsmith.request.headers\";\nexport const LANGSMITH_RUN_ID = \"langsmith.span.id\";\nexport const LANGSMITH_TRACE_ID = \"langsmith.trace.id\";\nexport const LANGSMITH_DOTTED_ORDER = \"langsmith.span.dotted_order\";\nexport const LANGSMITH_PARENT_RUN_ID = \"langsmith.span.parent_id\";\nexport const LANGSMITH_USAGE_METADATA = \"langsmith.usage_metadata\";\nexport const LANGSMITH_REFERENCE_EXAMPLE_ID = \"langsmith.reference_example_id\";\nexport const LANGSMITH_TRACEABLE = \"langsmith.traceable\";\nexport const LANGSMITH_IS_ROOT = \"langsmith.is_root\";\nexport const LANGSMITH_TRACEABLE_PARENT_OTEL_SPAN_ID = \"langsmith.traceable_parent_otel_span_id\";\n// GenAI event names\nexport const GEN_AI_SYSTEM_MESSAGE = \"gen_ai.system.message\";\nexport const GEN_AI_USER_MESSAGE = \"gen_ai.user.message\";\nexport const GEN_AI_ASSISTANT_MESSAGE = \"gen_ai.assistant.message\";\nexport const GEN_AI_CHOICE = \"gen_ai.choice\";\nexport const AI_SDK_LLM_OPERATIONS = [\n \"ai.generateText.doGenerate\",\n \"ai.streamText.doStream\",\n \"ai.generateObject.doGenerate\",\n \"ai.streamObject.doStream\",\n];\nexport const AI_SDK_TOOL_OPERATIONS = [\"ai.toolCall\"];\n"],"x_google_ignoreList":[0],"mappings":";AACA,MAAa,wBAAwB;AACrC,MAAa,gBAAgB;AAC7B,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;AACrC,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;AACpC,MAAa,mCAAmC;AAChD,MAAa,kCAAkC;AAC/C,MAAa,iCAAiC;AAC9C,MAAa,eAAe;AAC5B,MAAa,mBAAmB;AAChC,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,yBAAyB;AACtC,MAAa,8BAA8B;AAC3C,MAAa,wBAAwB;AACrC,MAAa,qBAAqB;AAClC,MAAa,+BAA+B;AAC5C,MAAa,qCAAqC;AAClD,MAAa,mCAAmC;AAChD,MAAa,oCAAoC;AAEjD,MAAa,uBAAuB;AACpC,MAAa,yBAAyB;AACtC,MAAa,qBAAqB;AAClC,MAAa,iBAAiB;AAC9B,MAAa,qBAAqB;AAClC,MAAa,iBAAiB;AAE9B,MAAa,8BAA8B;AAC3C,MAAa,4BAA4B"}
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/constants.js"],"sourcesContent":["// OpenTelemetry GenAI semantic convention attribute names\nexport const GEN_AI_OPERATION_NAME = \"gen_ai.operation.name\";\nexport const GEN_AI_SYSTEM = \"gen_ai.system\";\nexport const GEN_AI_REQUEST_MODEL = \"gen_ai.request.model\";\nexport const GEN_AI_RESPONSE_MODEL = \"gen_ai.response.model\";\nexport const GEN_AI_USAGE_INPUT_TOKENS = \"gen_ai.usage.input_tokens\";\nexport const GEN_AI_USAGE_OUTPUT_TOKENS = \"gen_ai.usage.output_tokens\";\nexport const GEN_AI_USAGE_TOTAL_TOKENS = \"gen_ai.usage.total_tokens\";\nexport const GEN_AI_REQUEST_MAX_TOKENS = \"gen_ai.request.max_tokens\";\nexport const GEN_AI_REQUEST_TEMPERATURE = \"gen_ai.request.temperature\";\nexport const GEN_AI_REQUEST_TOP_P = \"gen_ai.request.top_p\";\nexport const GEN_AI_REQUEST_FREQUENCY_PENALTY = \"gen_ai.request.frequency_penalty\";\nexport const GEN_AI_REQUEST_PRESENCE_PENALTY = \"gen_ai.request.presence_penalty\";\nexport const GEN_AI_RESPONSE_FINISH_REASONS = \"gen_ai.response.finish_reasons\";\nexport const GENAI_PROMPT = \"gen_ai.prompt\";\nexport const GENAI_COMPLETION = \"gen_ai.completion\";\nexport const GEN_AI_REQUEST_EXTRA_QUERY = \"gen_ai.request.extra_query\";\nexport const GEN_AI_REQUEST_EXTRA_BODY = \"gen_ai.request.extra_body\";\nexport const GEN_AI_SERIALIZED_NAME = \"gen_ai.serialized.name\";\nexport const GEN_AI_SERIALIZED_SIGNATURE = \"gen_ai.serialized.signature\";\nexport const GEN_AI_SERIALIZED_DOC = \"gen_ai.serialized.doc\";\nexport const GEN_AI_RESPONSE_ID = \"gen_ai.response.id\";\nexport const GEN_AI_RESPONSE_SERVICE_TIER = \"gen_ai.response.service_tier\";\nexport const GEN_AI_RESPONSE_SYSTEM_FINGERPRINT = \"gen_ai.response.system_fingerprint\";\nexport const GEN_AI_USAGE_INPUT_TOKEN_DETAILS = \"gen_ai.usage.input_token_details\";\nexport const GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS = \"gen_ai.usage.output_token_details\";\n// LangSmith custom attributes\nexport const LANGSMITH_SESSION_ID = \"langsmith.trace.session_id\";\nexport const LANGSMITH_SESSION_NAME = \"langsmith.trace.session_name\";\nexport const LANGSMITH_RUN_TYPE = \"langsmith.span.kind\";\nexport const LANGSMITH_NAME = \"langsmith.trace.name\";\nexport const LANGSMITH_METADATA = \"langsmith.metadata\";\nexport const LANGSMITH_TAGS = \"langsmith.span.tags\";\nexport const LANGSMITH_RUNTIME = \"langsmith.span.runtime\";\nexport const LANGSMITH_REQUEST_STREAMING = \"langsmith.request.streaming\";\nexport const LANGSMITH_REQUEST_HEADERS = \"langsmith.request.headers\";\nexport const LANGSMITH_RUN_ID = \"langsmith.span.id\";\nexport const LANGSMITH_TRACE_ID = \"langsmith.trace.id\";\nexport const LANGSMITH_DOTTED_ORDER = \"langsmith.span.dotted_order\";\nexport const LANGSMITH_PARENT_RUN_ID = \"langsmith.span.parent_id\";\nexport const LANGSMITH_USAGE_METADATA = \"langsmith.usage_metadata\";\nexport const LANGSMITH_REFERENCE_EXAMPLE_ID = \"langsmith.reference_example_id\";\nexport const LANGSMITH_TRACEABLE = \"langsmith.traceable\";\nexport const LANGSMITH_IS_ROOT = \"langsmith.is_root\";\nexport const LANGSMITH_TRACEABLE_PARENT_OTEL_SPAN_ID = \"langsmith.traceable_parent_otel_span_id\";\n// GenAI event names\nexport const GEN_AI_SYSTEM_MESSAGE = \"gen_ai.system.message\";\nexport const GEN_AI_USER_MESSAGE = \"gen_ai.user.message\";\nexport const GEN_AI_ASSISTANT_MESSAGE = \"gen_ai.assistant.message\";\nexport const GEN_AI_CHOICE = \"gen_ai.choice\";\nexport const AI_SDK_LLM_OPERATIONS = [\n \"ai.generateText.doGenerate\",\n \"ai.streamText.doStream\",\n \"ai.generateObject.doGenerate\",\n \"ai.streamObject.doStream\",\n];\nexport const AI_SDK_TOOL_OPERATIONS = [\"ai.toolCall\"];\n"],"x_google_ignoreList":[0],"mappings":";AACA,MAAa,wBAAwB;AACrC,MAAa,gBAAgB;AAC7B,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;AACrC,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,4BAA4B;AACzC,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;AACpC,MAAa,mCAAmC;AAChD,MAAa,kCAAkC;AAC/C,MAAa,iCAAiC;AAC9C,MAAa,eAAe;AAC5B,MAAa,mBAAmB;AAChC,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,yBAAyB;AACtC,MAAa,8BAA8B;AAC3C,MAAa,wBAAwB;AACrC,MAAa,qBAAqB;AAClC,MAAa,+BAA+B;AAC5C,MAAa,qCAAqC;AAClD,MAAa,mCAAmC;AAChD,MAAa,oCAAoC;AAEjD,MAAa,uBAAuB;AACpC,MAAa,yBAAyB;AACtC,MAAa,qBAAqB;AAClC,MAAa,iBAAiB;AAC9B,MAAa,qBAAqB;AAClC,MAAa,iBAAiB;AAE9B,MAAa,8BAA8B;AAC3C,MAAa,4BAA4B"}
@@ -1,7 +1,7 @@
1
1
  const require_constants = require('./constants.cjs');
2
2
  const require_otel = require('../../singletons/otel.cjs');
3
3
 
4
- //#region ../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.js
4
+ //#region ../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.js
5
5
  const WELL_KNOWN_OPERATION_NAMES = {
6
6
  llm: "chat",
7
7
  tool: "execute_tool",
@@ -1 +1 @@
1
- {"version":3,"file":"translator.cjs","names":["getOTELTrace"],"sources":["../../../../../../../../../../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.js"],"sourcesContent":["import * as constants from \"./constants.js\";\nimport { getOTELTrace } from \"../../singletons/otel.js\";\nconst WELL_KNOWN_OPERATION_NAMES = {\n llm: \"chat\",\n tool: \"execute_tool\",\n retriever: \"embeddings\",\n embedding: \"embeddings\",\n prompt: \"chat\",\n};\nfunction getOperationName(runType) {\n return WELL_KNOWN_OPERATION_NAMES[runType] || runType;\n}\nexport class LangSmithToOTELTranslator {\n constructor() {\n Object.defineProperty(this, \"spans\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n }\n exportBatch(operations, otelContextMap) {\n for (const op of operations) {\n try {\n if (!op.run) {\n continue;\n }\n if (op.operation === \"post\") {\n const span = this.createSpanForRun(op, op.run, otelContextMap.get(op.id));\n if (span && !op.run.end_time) {\n this.spans.set(op.id, span);\n }\n }\n else {\n this.updateSpanForRun(op, op.run);\n }\n }\n catch (e) {\n console.error(`Error processing operation ${op.id}:`, e);\n }\n }\n }\n createSpanForRun(op, runInfo, otelContext) {\n const activeSpan = otelContext && getOTELTrace().getSpan(otelContext);\n if (!activeSpan) {\n return;\n }\n try {\n return this.finishSpanSetup(activeSpan, runInfo, op);\n }\n catch (e) {\n console.error(`Failed to create span for run ${op.id}:`, e);\n return undefined;\n }\n }\n finishSpanSetup(span, runInfo, op) {\n // Set all attributes\n this.setSpanAttributes(span, runInfo, op);\n // Set status based on error\n if (runInfo.error) {\n span.setStatus({ code: 2 }); // ERROR status\n span.recordException(new Error(runInfo.error));\n }\n else {\n span.setStatus({ code: 1 }); // OK status\n }\n // End the span if end_time is present\n if (runInfo.end_time) {\n span.end(new Date(runInfo.end_time));\n }\n return span;\n }\n updateSpanForRun(op, runInfo) {\n try {\n const span = this.spans.get(op.id);\n if (!span) {\n console.debug(`No span found for run ${op.id} during update`);\n return;\n }\n // Update attributes\n this.setSpanAttributes(span, runInfo, op);\n // Update status based on error\n if (runInfo.error) {\n span.setStatus({ code: 2 }); // ERROR status\n span.recordException(new Error(runInfo.error));\n }\n else {\n span.setStatus({ code: 1 }); // OK status\n }\n // End the span if end_time is present\n const endTime = runInfo.end_time;\n if (endTime) {\n span.end(new Date(endTime));\n this.spans.delete(op.id);\n }\n }\n catch (e) {\n console.error(`Failed to update span for run ${op.id}:`, e);\n }\n }\n extractModelName(runInfo) {\n // Try to get model name from metadata\n if (runInfo.extra?.metadata) {\n const metadata = runInfo.extra.metadata;\n // First check for ls_model_name in metadata\n if (metadata.ls_model_name) {\n return metadata.ls_model_name;\n }\n // Then check invocation_params for model info\n if (metadata.invocation_params) {\n const invocationParams = metadata.invocation_params;\n if (invocationParams.model) {\n return invocationParams.model;\n }\n else if (invocationParams.model_name) {\n return invocationParams.model_name;\n }\n }\n }\n return;\n }\n setSpanAttributes(span, runInfo, op) {\n if (\"run_type\" in runInfo && runInfo.run_type) {\n span.setAttribute(constants.LANGSMITH_RUN_TYPE, runInfo.run_type);\n // Set GenAI attributes according to OTEL semantic conventions\n const operationName = getOperationName(runInfo.run_type || \"chain\");\n span.setAttribute(constants.GEN_AI_OPERATION_NAME, operationName);\n }\n if (\"name\" in runInfo && runInfo.name) {\n span.setAttribute(constants.LANGSMITH_NAME, runInfo.name);\n }\n if (\"session_id\" in runInfo && runInfo.session_id) {\n span.setAttribute(constants.LANGSMITH_SESSION_ID, runInfo.session_id);\n }\n if (\"session_name\" in runInfo && runInfo.session_name) {\n span.setAttribute(constants.LANGSMITH_SESSION_NAME, runInfo.session_name);\n }\n // Set gen_ai.system\n this.setGenAiSystem(span, runInfo);\n // Set model name if available\n const modelName = this.extractModelName(runInfo);\n if (modelName) {\n span.setAttribute(constants.GEN_AI_REQUEST_MODEL, modelName);\n }\n // Set token usage information\n if (\"prompt_tokens\" in runInfo &&\n typeof runInfo.prompt_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKENS, runInfo.prompt_tokens);\n }\n if (\"completion_tokens\" in runInfo &&\n typeof runInfo.completion_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKENS, runInfo.completion_tokens);\n }\n if (\"total_tokens\" in runInfo && typeof runInfo.total_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_TOTAL_TOKENS, runInfo.total_tokens);\n }\n // Set other parameters from invocation_params\n this.setInvocationParameters(span, runInfo);\n // Set metadata and tags if available\n const metadata = runInfo.extra?.metadata || {};\n for (const [key, value] of Object.entries(metadata)) {\n if (value !== null && value !== undefined) {\n span.setAttribute(`${constants.LANGSMITH_METADATA}.${key}`, String(value));\n }\n }\n const tags = runInfo.tags;\n if (tags && Array.isArray(tags)) {\n span.setAttribute(constants.LANGSMITH_TAGS, tags.join(\", \"));\n }\n else if (tags) {\n span.setAttribute(constants.LANGSMITH_TAGS, String(tags));\n }\n // Support additional serialized attributes, if present\n if (\"serialized\" in runInfo && typeof runInfo.serialized === \"object\") {\n const serialized = runInfo.serialized;\n if (serialized.name) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_NAME, String(serialized.name));\n }\n if (serialized.signature) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_SIGNATURE, String(serialized.signature));\n }\n if (serialized.doc) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_DOC, String(serialized.doc));\n }\n }\n // Set inputs/outputs if available\n this.setIOAttributes(span, op);\n }\n setGenAiSystem(span, runInfo) {\n // Default to \"langchain\" if we can't determine the system\n let system = \"langchain\";\n // Extract model name to determine the system\n const modelName = this.extractModelName(runInfo);\n if (modelName) {\n const modelLower = modelName.toLowerCase();\n if (modelLower.includes(\"anthropic\") || modelLower.startsWith(\"claude\")) {\n system = \"anthropic\";\n }\n else if (modelLower.includes(\"bedrock\")) {\n system = \"aws.bedrock\";\n }\n else if (modelLower.includes(\"azure\") &&\n modelLower.includes(\"openai\")) {\n system = \"az.ai.openai\";\n }\n else if (modelLower.includes(\"azure\") &&\n modelLower.includes(\"inference\")) {\n system = \"az.ai.inference\";\n }\n else if (modelLower.includes(\"cohere\")) {\n system = \"cohere\";\n }\n else if (modelLower.includes(\"deepseek\")) {\n system = \"deepseek\";\n }\n else if (modelLower.includes(\"gemini\")) {\n system = \"gemini\";\n }\n else if (modelLower.includes(\"groq\")) {\n system = \"groq\";\n }\n else if (modelLower.includes(\"watson\") || modelLower.includes(\"ibm\")) {\n system = \"ibm.watsonx.ai\";\n }\n else if (modelLower.includes(\"mistral\")) {\n system = \"mistral_ai\";\n }\n else if (modelLower.includes(\"gpt\") || modelLower.includes(\"openai\")) {\n system = \"openai\";\n }\n else if (modelLower.includes(\"perplexity\") ||\n modelLower.includes(\"sonar\")) {\n system = \"perplexity\";\n }\n else if (modelLower.includes(\"vertex\")) {\n system = \"vertex_ai\";\n }\n else if (modelLower.includes(\"xai\") || modelLower.includes(\"grok\")) {\n system = \"xai\";\n }\n }\n span.setAttribute(constants.GEN_AI_SYSTEM, system);\n }\n setInvocationParameters(span, runInfo) {\n if (!runInfo.extra?.metadata?.invocation_params) {\n return;\n }\n const invocationParams = runInfo.extra.metadata.invocation_params;\n // Set relevant invocation parameters\n if (invocationParams.max_tokens !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_MAX_TOKENS, invocationParams.max_tokens);\n }\n if (invocationParams.temperature !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_TEMPERATURE, invocationParams.temperature);\n }\n if (invocationParams.top_p !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_TOP_P, invocationParams.top_p);\n }\n if (invocationParams.frequency_penalty !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_FREQUENCY_PENALTY, invocationParams.frequency_penalty);\n }\n if (invocationParams.presence_penalty !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_PRESENCE_PENALTY, invocationParams.presence_penalty);\n }\n }\n setIOAttributes(span, op) {\n if (op.run.inputs) {\n try {\n const inputs = op.run.inputs;\n if (typeof inputs === \"object\" && inputs !== null) {\n if (inputs.model && Array.isArray(inputs.messages)) {\n span.setAttribute(constants.GEN_AI_REQUEST_MODEL, inputs.model);\n }\n // Set additional request attributes if available\n if (inputs.stream !== undefined) {\n span.setAttribute(constants.LANGSMITH_REQUEST_STREAMING, inputs.stream);\n }\n if (inputs.extra_headers) {\n span.setAttribute(constants.LANGSMITH_REQUEST_HEADERS, JSON.stringify(inputs.extra_headers));\n }\n if (inputs.extra_query) {\n span.setAttribute(constants.GEN_AI_REQUEST_EXTRA_QUERY, JSON.stringify(inputs.extra_query));\n }\n if (inputs.extra_body) {\n span.setAttribute(constants.GEN_AI_REQUEST_EXTRA_BODY, JSON.stringify(inputs.extra_body));\n }\n }\n span.setAttribute(constants.GENAI_PROMPT, JSON.stringify(inputs));\n }\n catch (e) {\n console.debug(`Failed to process inputs for run ${op.id}`, e);\n }\n }\n if (op.run.outputs) {\n try {\n const outputs = op.run.outputs;\n // Extract token usage from outputs (for LLM runs)\n const tokenUsage = this.getUnifiedRunTokens(outputs);\n if (tokenUsage) {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKENS, tokenUsage[0]);\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKENS, tokenUsage[1]);\n span.setAttribute(constants.GEN_AI_USAGE_TOTAL_TOKENS, tokenUsage[0] + tokenUsage[1]);\n }\n if (outputs && typeof outputs === \"object\") {\n if (outputs.model) {\n span.setAttribute(constants.GEN_AI_RESPONSE_MODEL, String(outputs.model));\n }\n // Extract additional response attributes\n if (outputs.id) {\n span.setAttribute(constants.GEN_AI_RESPONSE_ID, outputs.id);\n }\n if (outputs.choices && Array.isArray(outputs.choices)) {\n const finishReasons = outputs.choices\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .map((choice) => choice.finish_reason)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .filter((reason) => reason)\n .map(String);\n if (finishReasons.length > 0) {\n span.setAttribute(constants.GEN_AI_RESPONSE_FINISH_REASONS, finishReasons.join(\", \"));\n }\n }\n if (outputs.service_tier) {\n span.setAttribute(constants.GEN_AI_RESPONSE_SERVICE_TIER, outputs.service_tier);\n }\n if (outputs.system_fingerprint) {\n span.setAttribute(constants.GEN_AI_RESPONSE_SYSTEM_FINGERPRINT, outputs.system_fingerprint);\n }\n if (outputs.usage_metadata &&\n typeof outputs.usage_metadata === \"object\") {\n const usageMetadata = outputs.usage_metadata;\n if (usageMetadata.input_token_details) {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKEN_DETAILS, JSON.stringify(usageMetadata.input_token_details));\n }\n if (usageMetadata.output_token_details) {\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS, JSON.stringify(usageMetadata.output_token_details));\n }\n }\n }\n span.setAttribute(constants.GENAI_COMPLETION, JSON.stringify(outputs));\n }\n catch (e) {\n console.debug(`Failed to process outputs for run ${op.id}`, e);\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getUnifiedRunTokens(outputs) {\n if (!outputs) {\n return null;\n }\n // Search in non-generations lists\n let tokenUsage = this.extractUnifiedRunTokens(outputs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n // Find if direct kwarg in outputs\n const keys = Object.keys(outputs);\n for (const key of keys) {\n const haystack = outputs[key];\n if (!haystack || typeof haystack !== \"object\") {\n continue;\n }\n tokenUsage = this.extractUnifiedRunTokens(haystack.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n if (haystack.lc === 1 &&\n haystack.kwargs &&\n typeof haystack.kwargs === \"object\") {\n tokenUsage = this.extractUnifiedRunTokens(haystack.kwargs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n }\n }\n // Find in generations\n const generations = outputs.generations || [];\n if (!Array.isArray(generations)) {\n return null;\n }\n const flatGenerations = Array.isArray(generations[0])\n ? generations.flat()\n : generations;\n for (const generation of flatGenerations) {\n if (typeof generation === \"object\" &&\n generation.message &&\n typeof generation.message === \"object\" &&\n generation.message.kwargs &&\n typeof generation.message.kwargs === \"object\") {\n tokenUsage = this.extractUnifiedRunTokens(generation.message.kwargs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n }\n }\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractUnifiedRunTokens(outputs) {\n if (!outputs || typeof outputs !== \"object\") {\n return null;\n }\n if (typeof outputs.input_tokens !== \"number\" ||\n typeof outputs.output_tokens !== \"number\") {\n return null;\n }\n return [outputs.input_tokens, outputs.output_tokens];\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAEA,MAAM,6BAA6B;CAC/B,KAAK;CACL,MAAM;CACN,WAAW;CACX,WAAW;CACX,QAAQ;AACX;AACD,SAAS,iBAAiB,SAAS;AAC/B,QAAO,2BAA2B,YAAY;AACjD;AACD,IAAa,4BAAb,MAAuC;CACnC,cAAc;EACV,OAAO,eAAe,MAAM,SAAS;GACjC,YAAY;GACZ,cAAc;GACd,UAAU;GACV,uBAAO,IAAI;EACd,EAAC;CACL;CACD,YAAY,YAAY,gBAAgB;AACpC,OAAK,MAAM,MAAM,WACb,KAAI;AACA,OAAI,CAAC,GAAG,IACJ;AAEJ,OAAI,GAAG,cAAc,QAAQ;IACzB,MAAM,OAAO,KAAK,iBAAiB,IAAI,GAAG,KAAK,eAAe,IAAI,GAAG,GAAG,CAAC;AACzE,QAAI,QAAQ,CAAC,GAAG,IAAI,UAChB,KAAK,MAAM,IAAI,GAAG,IAAI,KAAK;GAElC,OAEG,KAAK,iBAAiB,IAAI,GAAG,IAAI;EAExC,SACM,GAAG;GACN,QAAQ,MAAM,CAAC,2BAA2B,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE;EAC3D;CAER;CACD,iBAAiB,IAAI,SAAS,aAAa;EACvC,MAAM,aAAa,eAAeA,2BAAc,CAAC,QAAQ,YAAY;AACrE,MAAI,CAAC,WACD;AAEJ,MAAI;AACA,UAAO,KAAK,gBAAgB,YAAY,SAAS,GAAG;EACvD,SACM,GAAG;GACN,QAAQ,MAAM,CAAC,8BAA8B,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE;AAC3D,UAAO;EACV;CACJ;CACD,gBAAgB,MA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AED,MAAM,cAAc,QAAQ,eAAe,CAAE;AAC7C,MAAI,CAAC,MAAM,QAAQ,YAAY,CAC3B,QAAO;EAEX,MAAM,kBAAkB,MAAM,QAAQ,YAAY,GAAG,GAC/C,YAAY,MAAM,GAClB;AACN,OAAK,MAAM,cAAc,gBACrB,KAAI,OAAO,eAAe,YACtB,WAAW,WACX,OAAO,WAAW,YAAY,YAC9B,WAAW,QAAQ,UACnB,OAAO,WAAW,QAAQ,WAAW,UAAU;GAC/C,aAAa,KAAK,wBAAwB,WAAW,QAAQ,OAAO,eAAe;AACnF,OAAI,WACA,QAAO;EAEd;AAEL,SAAO;CACV;CAED,wBAAwB,SAAS;AAC7B,MAAI,CAAC,WAAW,OAAO,YAAY,SAC/B,QAAO;AAEX,MAAI,OAAO,QAAQ,iBAAiB,YAChC,OAAO,QAAQ,kBAAkB,SACjC,QAAO;AAEX,SAAO,CAAC,QAAQ,cAAc,QAAQ,aAAc;CACvD;AACJ"}
1
+ {"version":3,"file":"translator.cjs","names":["getOTELTrace"],"sources":["../../../../../../../../../../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.js"],"sourcesContent":["import * as constants from \"./constants.js\";\nimport { getOTELTrace } from \"../../singletons/otel.js\";\nconst WELL_KNOWN_OPERATION_NAMES = {\n llm: \"chat\",\n tool: \"execute_tool\",\n retriever: \"embeddings\",\n embedding: \"embeddings\",\n prompt: \"chat\",\n};\nfunction getOperationName(runType) {\n return WELL_KNOWN_OPERATION_NAMES[runType] || runType;\n}\nexport class LangSmithToOTELTranslator {\n constructor() {\n Object.defineProperty(this, \"spans\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n }\n exportBatch(operations, otelContextMap) {\n for (const op of operations) {\n try {\n if (!op.run) {\n continue;\n }\n if (op.operation === \"post\") {\n const span = this.createSpanForRun(op, op.run, otelContextMap.get(op.id));\n if (span && !op.run.end_time) {\n this.spans.set(op.id, span);\n }\n }\n else {\n this.updateSpanForRun(op, op.run);\n }\n }\n catch (e) {\n console.error(`Error processing operation ${op.id}:`, e);\n }\n }\n }\n createSpanForRun(op, runInfo, otelContext) {\n const activeSpan = otelContext && getOTELTrace().getSpan(otelContext);\n if (!activeSpan) {\n return;\n }\n try {\n return this.finishSpanSetup(activeSpan, runInfo, op);\n }\n catch (e) {\n console.error(`Failed to create span for run ${op.id}:`, e);\n return undefined;\n }\n }\n finishSpanSetup(span, runInfo, op) {\n // Set all attributes\n this.setSpanAttributes(span, runInfo, op);\n // Set status based on error\n if (runInfo.error) {\n span.setStatus({ code: 2 }); // ERROR status\n span.recordException(new Error(runInfo.error));\n }\n else {\n span.setStatus({ code: 1 }); // OK status\n }\n // End the span if end_time is present\n if (runInfo.end_time) {\n span.end(new Date(runInfo.end_time));\n }\n return span;\n }\n updateSpanForRun(op, runInfo) {\n try {\n const span = this.spans.get(op.id);\n if (!span) {\n console.debug(`No span found for run ${op.id} during update`);\n return;\n }\n // Update attributes\n this.setSpanAttributes(span, runInfo, op);\n // Update status based on error\n if (runInfo.error) {\n span.setStatus({ code: 2 }); // ERROR status\n span.recordException(new Error(runInfo.error));\n }\n else {\n span.setStatus({ code: 1 }); // OK status\n }\n // End the span if end_time is present\n const endTime = runInfo.end_time;\n if (endTime) {\n span.end(new Date(endTime));\n this.spans.delete(op.id);\n }\n }\n catch (e) {\n console.error(`Failed to update span for run ${op.id}:`, e);\n }\n }\n extractModelName(runInfo) {\n // Try to get model name from metadata\n if (runInfo.extra?.metadata) {\n const metadata = runInfo.extra.metadata;\n // First check for ls_model_name in metadata\n if (metadata.ls_model_name) {\n return metadata.ls_model_name;\n }\n // Then check invocation_params for model info\n if (metadata.invocation_params) {\n const invocationParams = metadata.invocation_params;\n if (invocationParams.model) {\n return invocationParams.model;\n }\n else if (invocationParams.model_name) {\n return invocationParams.model_name;\n }\n }\n }\n return;\n }\n setSpanAttributes(span, runInfo, op) {\n if (\"run_type\" in runInfo && runInfo.run_type) {\n span.setAttribute(constants.LANGSMITH_RUN_TYPE, runInfo.run_type);\n // Set GenAI attributes according to OTEL semantic conventions\n const operationName = getOperationName(runInfo.run_type || \"chain\");\n span.setAttribute(constants.GEN_AI_OPERATION_NAME, operationName);\n }\n if (\"name\" in runInfo && runInfo.name) {\n span.setAttribute(constants.LANGSMITH_NAME, runInfo.name);\n }\n if (\"session_id\" in runInfo && runInfo.session_id) {\n span.setAttribute(constants.LANGSMITH_SESSION_ID, runInfo.session_id);\n }\n if (\"session_name\" in runInfo && runInfo.session_name) {\n span.setAttribute(constants.LANGSMITH_SESSION_NAME, runInfo.session_name);\n }\n // Set gen_ai.system\n this.setGenAiSystem(span, runInfo);\n // Set model name if available\n const modelName = this.extractModelName(runInfo);\n if (modelName) {\n span.setAttribute(constants.GEN_AI_REQUEST_MODEL, modelName);\n }\n // Set token usage information\n if (\"prompt_tokens\" in runInfo &&\n typeof runInfo.prompt_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKENS, runInfo.prompt_tokens);\n }\n if (\"completion_tokens\" in runInfo &&\n typeof runInfo.completion_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKENS, runInfo.completion_tokens);\n }\n if (\"total_tokens\" in runInfo && typeof runInfo.total_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_TOTAL_TOKENS, runInfo.total_tokens);\n }\n // Set other parameters from invocation_params\n this.setInvocationParameters(span, runInfo);\n // Set metadata and tags if available\n const metadata = runInfo.extra?.metadata || {};\n for (const [key, value] of Object.entries(metadata)) {\n if (value !== null && value !== undefined) {\n span.setAttribute(`${constants.LANGSMITH_METADATA}.${key}`, String(value));\n }\n }\n const tags = runInfo.tags;\n if (tags && Array.isArray(tags)) {\n span.setAttribute(constants.LANGSMITH_TAGS, tags.join(\", \"));\n }\n else if (tags) {\n span.setAttribute(constants.LANGSMITH_TAGS, String(tags));\n }\n // Support additional serialized attributes, if present\n if (\"serialized\" in runInfo && typeof runInfo.serialized === \"object\") {\n const serialized = runInfo.serialized;\n if (serialized.name) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_NAME, String(serialized.name));\n }\n if (serialized.signature) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_SIGNATURE, String(serialized.signature));\n }\n if (serialized.doc) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_DOC, String(serialized.doc));\n }\n }\n // Set inputs/outputs if available\n this.setIOAttributes(span, op);\n }\n setGenAiSystem(span, runInfo) {\n // Default to \"langchain\" if we can't determine the system\n let system = \"langchain\";\n // Extract model name to determine the system\n const modelName = this.extractModelName(runInfo);\n if (modelName) {\n const modelLower = modelName.toLowerCase();\n if (modelLower.includes(\"anthropic\") || modelLower.startsWith(\"claude\")) {\n system = \"anthropic\";\n }\n else if (modelLower.includes(\"bedrock\")) {\n system = \"aws.bedrock\";\n }\n else if (modelLower.includes(\"azure\") &&\n modelLower.includes(\"openai\")) {\n system = \"az.ai.openai\";\n }\n else if (modelLower.includes(\"azure\") &&\n modelLower.includes(\"inference\")) {\n system = \"az.ai.inference\";\n }\n else if (modelLower.includes(\"cohere\")) {\n system = \"cohere\";\n }\n else if (modelLower.includes(\"deepseek\")) {\n system = \"deepseek\";\n }\n else if (modelLower.includes(\"gemini\")) {\n system = \"gemini\";\n }\n else if (modelLower.includes(\"groq\")) {\n system = \"groq\";\n }\n else if (modelLower.includes(\"watson\") || modelLower.includes(\"ibm\")) {\n system = \"ibm.watsonx.ai\";\n }\n else if (modelLower.includes(\"mistral\")) {\n system = \"mistral_ai\";\n }\n else if (modelLower.includes(\"gpt\") || modelLower.includes(\"openai\")) {\n system = \"openai\";\n }\n else if (modelLower.includes(\"perplexity\") ||\n modelLower.includes(\"sonar\")) {\n system = \"perplexity\";\n }\n else if (modelLower.includes(\"vertex\")) {\n system = \"vertex_ai\";\n }\n else if (modelLower.includes(\"xai\") || modelLower.includes(\"grok\")) {\n system = \"xai\";\n }\n }\n span.setAttribute(constants.GEN_AI_SYSTEM, system);\n }\n setInvocationParameters(span, runInfo) {\n if (!runInfo.extra?.metadata?.invocation_params) {\n return;\n }\n const invocationParams = runInfo.extra.metadata.invocation_params;\n // Set relevant invocation parameters\n if (invocationParams.max_tokens !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_MAX_TOKENS, invocationParams.max_tokens);\n }\n if (invocationParams.temperature !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_TEMPERATURE, invocationParams.temperature);\n }\n if (invocationParams.top_p !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_TOP_P, invocationParams.top_p);\n }\n if (invocationParams.frequency_penalty !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_FREQUENCY_PENALTY, invocationParams.frequency_penalty);\n }\n if (invocationParams.presence_penalty !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_PRESENCE_PENALTY, invocationParams.presence_penalty);\n }\n }\n setIOAttributes(span, op) {\n if (op.run.inputs) {\n try {\n const inputs = op.run.inputs;\n if (typeof inputs === \"object\" && inputs !== null) {\n if (inputs.model && Array.isArray(inputs.messages)) {\n span.setAttribute(constants.GEN_AI_REQUEST_MODEL, inputs.model);\n }\n // Set additional request attributes if available\n if (inputs.stream !== undefined) {\n span.setAttribute(constants.LANGSMITH_REQUEST_STREAMING, inputs.stream);\n }\n if (inputs.extra_headers) {\n span.setAttribute(constants.LANGSMITH_REQUEST_HEADERS, JSON.stringify(inputs.extra_headers));\n }\n if (inputs.extra_query) {\n span.setAttribute(constants.GEN_AI_REQUEST_EXTRA_QUERY, JSON.stringify(inputs.extra_query));\n }\n if (inputs.extra_body) {\n span.setAttribute(constants.GEN_AI_REQUEST_EXTRA_BODY, JSON.stringify(inputs.extra_body));\n }\n }\n span.setAttribute(constants.GENAI_PROMPT, JSON.stringify(inputs));\n }\n catch (e) {\n console.debug(`Failed to process inputs for run ${op.id}`, e);\n }\n }\n if (op.run.outputs) {\n try {\n const outputs = op.run.outputs;\n // Extract token usage from outputs (for LLM runs)\n const tokenUsage = this.getUnifiedRunTokens(outputs);\n if (tokenUsage) {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKENS, tokenUsage[0]);\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKENS, tokenUsage[1]);\n span.setAttribute(constants.GEN_AI_USAGE_TOTAL_TOKENS, tokenUsage[0] + tokenUsage[1]);\n }\n if (outputs && typeof outputs === \"object\") {\n if (outputs.model) {\n span.setAttribute(constants.GEN_AI_RESPONSE_MODEL, String(outputs.model));\n }\n // Extract additional response attributes\n if (outputs.id) {\n span.setAttribute(constants.GEN_AI_RESPONSE_ID, outputs.id);\n }\n if (outputs.choices && Array.isArray(outputs.choices)) {\n const finishReasons = outputs.choices\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .map((choice) => choice.finish_reason)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .filter((reason) => reason)\n .map(String);\n if (finishReasons.length > 0) {\n span.setAttribute(constants.GEN_AI_RESPONSE_FINISH_REASONS, finishReasons.join(\", \"));\n }\n }\n if (outputs.service_tier) {\n span.setAttribute(constants.GEN_AI_RESPONSE_SERVICE_TIER, outputs.service_tier);\n }\n if (outputs.system_fingerprint) {\n span.setAttribute(constants.GEN_AI_RESPONSE_SYSTEM_FINGERPRINT, outputs.system_fingerprint);\n }\n if (outputs.usage_metadata &&\n typeof outputs.usage_metadata === \"object\") {\n const usageMetadata = outputs.usage_metadata;\n if (usageMetadata.input_token_details) {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKEN_DETAILS, JSON.stringify(usageMetadata.input_token_details));\n }\n if (usageMetadata.output_token_details) {\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS, JSON.stringify(usageMetadata.output_token_details));\n }\n }\n }\n span.setAttribute(constants.GENAI_COMPLETION, JSON.stringify(outputs));\n }\n catch (e) {\n console.debug(`Failed to process outputs for run ${op.id}`, e);\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getUnifiedRunTokens(outputs) {\n if (!outputs) {\n return null;\n }\n // Search in non-generations lists\n let tokenUsage = this.extractUnifiedRunTokens(outputs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n // Find if direct kwarg in outputs\n const keys = Object.keys(outputs);\n for (const key of keys) {\n const haystack = outputs[key];\n if (!haystack || typeof haystack !== \"object\") {\n continue;\n }\n tokenUsage = this.extractUnifiedRunTokens(haystack.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n if (haystack.lc === 1 &&\n haystack.kwargs &&\n typeof haystack.kwargs === \"object\") {\n tokenUsage = this.extractUnifiedRunTokens(haystack.kwargs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n }\n }\n // Find in generations\n const generations = outputs.generations || [];\n if (!Array.isArray(generations)) {\n return null;\n }\n const flatGenerations = Array.isArray(generations[0])\n ? generations.flat()\n : generations;\n for (const generation of flatGenerations) {\n if (typeof generation === \"object\" &&\n generation.message &&\n typeof generation.message === \"object\" &&\n generation.message.kwargs &&\n typeof generation.message.kwargs === \"object\") {\n tokenUsage = this.extractUnifiedRunTokens(generation.message.kwargs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n }\n }\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractUnifiedRunTokens(outputs) {\n if (!outputs || typeof outputs !== \"object\") {\n return null;\n }\n if (typeof outputs.input_tokens !== \"number\" ||\n typeof outputs.output_tokens !== \"number\") {\n return null;\n }\n return [outputs.input_tokens, outputs.output_tokens];\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAEA,MAAM,6BAA6B;CAC/B,KAAK;CACL,MAAM;CACN,WAAW;CACX,WAAW;CACX,QAAQ;AACX;AACD,SAAS,iBAAiB,SAAS;AAC/B,QAAO,2BAA2B,YAAY;AACjD;AACD,IAAa,4BAAb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;CACV;CAED,wBAAwB,SAAS;AAC7B,MAAI,CAAC,WAAW,OAAO,YAAY,SAC/B,QAAO;AAEX,MAAI,OAAO,QAAQ,iBAAiB,YAChC,OAAO,QAAQ,kBAAkB,SACjC,QAAO;AAEX,SAAO,CAAC,QAAQ,cAAc,QAAQ,aAAc;CACvD;AACJ"}
@@ -1,7 +1,7 @@
1
1
  import { GENAI_COMPLETION, GENAI_PROMPT, GEN_AI_OPERATION_NAME, GEN_AI_REQUEST_EXTRA_BODY, GEN_AI_REQUEST_EXTRA_QUERY, GEN_AI_REQUEST_FREQUENCY_PENALTY, GEN_AI_REQUEST_MAX_TOKENS, GEN_AI_REQUEST_MODEL, GEN_AI_REQUEST_PRESENCE_PENALTY, GEN_AI_REQUEST_TEMPERATURE, GEN_AI_REQUEST_TOP_P, GEN_AI_RESPONSE_FINISH_REASONS, GEN_AI_RESPONSE_ID, GEN_AI_RESPONSE_MODEL, GEN_AI_RESPONSE_SERVICE_TIER, GEN_AI_RESPONSE_SYSTEM_FINGERPRINT, GEN_AI_SERIALIZED_DOC, GEN_AI_SERIALIZED_NAME, GEN_AI_SERIALIZED_SIGNATURE, GEN_AI_SYSTEM, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_INPUT_TOKEN_DETAILS, GEN_AI_USAGE_OUTPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS, GEN_AI_USAGE_TOTAL_TOKENS, LANGSMITH_METADATA, LANGSMITH_NAME, LANGSMITH_REQUEST_HEADERS, LANGSMITH_REQUEST_STREAMING, LANGSMITH_RUN_TYPE, LANGSMITH_SESSION_ID, LANGSMITH_SESSION_NAME, LANGSMITH_TAGS } from "./constants.js";
2
2
  import { getOTELTrace } from "../../singletons/otel.js";
3
3
 
4
- //#region ../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.js
4
+ //#region ../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.js
5
5
  const WELL_KNOWN_OPERATION_NAMES = {
6
6
  llm: "chat",
7
7
  tool: "execute_tool",
@@ -1 +1 @@
1
- {"version":3,"file":"translator.js","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.js"],"sourcesContent":["import * as constants from \"./constants.js\";\nimport { getOTELTrace } from \"../../singletons/otel.js\";\nconst WELL_KNOWN_OPERATION_NAMES = {\n llm: \"chat\",\n tool: \"execute_tool\",\n retriever: \"embeddings\",\n embedding: \"embeddings\",\n prompt: \"chat\",\n};\nfunction getOperationName(runType) {\n return WELL_KNOWN_OPERATION_NAMES[runType] || runType;\n}\nexport class LangSmithToOTELTranslator {\n constructor() {\n Object.defineProperty(this, \"spans\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n }\n exportBatch(operations, otelContextMap) {\n for (const op of operations) {\n try {\n if (!op.run) {\n continue;\n }\n if (op.operation === \"post\") {\n const span = this.createSpanForRun(op, op.run, otelContextMap.get(op.id));\n if (span && !op.run.end_time) {\n this.spans.set(op.id, span);\n }\n }\n else {\n this.updateSpanForRun(op, op.run);\n }\n }\n catch (e) {\n console.error(`Error processing operation ${op.id}:`, e);\n }\n }\n }\n createSpanForRun(op, runInfo, otelContext) {\n const activeSpan = otelContext && getOTELTrace().getSpan(otelContext);\n if (!activeSpan) {\n return;\n }\n try {\n return this.finishSpanSetup(activeSpan, runInfo, op);\n }\n catch (e) {\n console.error(`Failed to create span for run ${op.id}:`, e);\n return undefined;\n }\n }\n finishSpanSetup(span, runInfo, op) {\n // Set all attributes\n this.setSpanAttributes(span, runInfo, op);\n // Set status based on error\n if (runInfo.error) {\n span.setStatus({ code: 2 }); // ERROR status\n span.recordException(new Error(runInfo.error));\n }\n else {\n span.setStatus({ code: 1 }); // OK status\n }\n // End the span if end_time is present\n if (runInfo.end_time) {\n span.end(new Date(runInfo.end_time));\n }\n return span;\n }\n updateSpanForRun(op, runInfo) {\n try {\n const span = this.spans.get(op.id);\n if (!span) {\n console.debug(`No span found for run ${op.id} during update`);\n return;\n }\n // Update attributes\n this.setSpanAttributes(span, runInfo, op);\n // Update status based on error\n if (runInfo.error) {\n span.setStatus({ code: 2 }); // ERROR status\n span.recordException(new Error(runInfo.error));\n }\n else {\n span.setStatus({ code: 1 }); // OK status\n }\n // End the span if end_time is present\n const endTime = runInfo.end_time;\n if (endTime) {\n span.end(new Date(endTime));\n this.spans.delete(op.id);\n }\n }\n catch (e) {\n console.error(`Failed to update span for run ${op.id}:`, e);\n }\n }\n extractModelName(runInfo) {\n // Try to get model name from metadata\n if (runInfo.extra?.metadata) {\n const metadata = runInfo.extra.metadata;\n // First check for ls_model_name in metadata\n if (metadata.ls_model_name) {\n return metadata.ls_model_name;\n }\n // Then check invocation_params for model info\n if (metadata.invocation_params) {\n const invocationParams = metadata.invocation_params;\n if (invocationParams.model) {\n return invocationParams.model;\n }\n else if (invocationParams.model_name) {\n return invocationParams.model_name;\n }\n }\n }\n return;\n }\n setSpanAttributes(span, runInfo, op) {\n if (\"run_type\" in runInfo && runInfo.run_type) {\n span.setAttribute(constants.LANGSMITH_RUN_TYPE, runInfo.run_type);\n // Set GenAI attributes according to OTEL semantic conventions\n const operationName = getOperationName(runInfo.run_type || \"chain\");\n span.setAttribute(constants.GEN_AI_OPERATION_NAME, operationName);\n }\n if (\"name\" in runInfo && runInfo.name) {\n span.setAttribute(constants.LANGSMITH_NAME, runInfo.name);\n }\n if (\"session_id\" in runInfo && runInfo.session_id) {\n span.setAttribute(constants.LANGSMITH_SESSION_ID, runInfo.session_id);\n }\n if (\"session_name\" in runInfo && runInfo.session_name) {\n span.setAttribute(constants.LANGSMITH_SESSION_NAME, runInfo.session_name);\n }\n // Set gen_ai.system\n this.setGenAiSystem(span, runInfo);\n // Set model name if available\n const modelName = this.extractModelName(runInfo);\n if (modelName) {\n span.setAttribute(constants.GEN_AI_REQUEST_MODEL, modelName);\n }\n // Set token usage information\n if (\"prompt_tokens\" in runInfo &&\n typeof runInfo.prompt_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKENS, runInfo.prompt_tokens);\n }\n if (\"completion_tokens\" in runInfo &&\n typeof runInfo.completion_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKENS, runInfo.completion_tokens);\n }\n if (\"total_tokens\" in runInfo && typeof runInfo.total_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_TOTAL_TOKENS, runInfo.total_tokens);\n }\n // Set other parameters from invocation_params\n this.setInvocationParameters(span, runInfo);\n // Set metadata and tags if available\n const metadata = runInfo.extra?.metadata || {};\n for (const [key, value] of Object.entries(metadata)) {\n if (value !== null && value !== undefined) {\n span.setAttribute(`${constants.LANGSMITH_METADATA}.${key}`, String(value));\n }\n }\n const tags = runInfo.tags;\n if (tags && Array.isArray(tags)) {\n span.setAttribute(constants.LANGSMITH_TAGS, tags.join(\", \"));\n }\n else if (tags) {\n span.setAttribute(constants.LANGSMITH_TAGS, String(tags));\n }\n // Support additional serialized attributes, if present\n if (\"serialized\" in runInfo && typeof runInfo.serialized === \"object\") {\n const serialized = runInfo.serialized;\n if (serialized.name) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_NAME, String(serialized.name));\n }\n if (serialized.signature) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_SIGNATURE, String(serialized.signature));\n }\n if (serialized.doc) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_DOC, String(serialized.doc));\n }\n }\n // Set inputs/outputs if available\n this.setIOAttributes(span, op);\n }\n setGenAiSystem(span, runInfo) {\n // Default to \"langchain\" if we can't determine the system\n let system = \"langchain\";\n // Extract model name to determine the system\n const modelName = this.extractModelName(runInfo);\n if (modelName) {\n const modelLower = modelName.toLowerCase();\n if (modelLower.includes(\"anthropic\") || modelLower.startsWith(\"claude\")) {\n system = \"anthropic\";\n }\n else if (modelLower.includes(\"bedrock\")) {\n system = \"aws.bedrock\";\n }\n else if (modelLower.includes(\"azure\") &&\n modelLower.includes(\"openai\")) {\n system = \"az.ai.openai\";\n }\n else if (modelLower.includes(\"azure\") &&\n modelLower.includes(\"inference\")) {\n system = \"az.ai.inference\";\n }\n else if (modelLower.includes(\"cohere\")) {\n system = \"cohere\";\n }\n else if (modelLower.includes(\"deepseek\")) {\n system = \"deepseek\";\n }\n else if (modelLower.includes(\"gemini\")) {\n system = \"gemini\";\n }\n else if (modelLower.includes(\"groq\")) {\n system = \"groq\";\n }\n else if (modelLower.includes(\"watson\") || modelLower.includes(\"ibm\")) {\n system = \"ibm.watsonx.ai\";\n }\n else if (modelLower.includes(\"mistral\")) {\n system = \"mistral_ai\";\n }\n else if (modelLower.includes(\"gpt\") || modelLower.includes(\"openai\")) {\n system = \"openai\";\n }\n else if (modelLower.includes(\"perplexity\") ||\n modelLower.includes(\"sonar\")) {\n system = \"perplexity\";\n }\n else if (modelLower.includes(\"vertex\")) {\n system = \"vertex_ai\";\n }\n else if (modelLower.includes(\"xai\") || modelLower.includes(\"grok\")) {\n system = \"xai\";\n }\n }\n span.setAttribute(constants.GEN_AI_SYSTEM, system);\n }\n setInvocationParameters(span, runInfo) {\n if (!runInfo.extra?.metadata?.invocation_params) {\n return;\n }\n const invocationParams = runInfo.extra.metadata.invocation_params;\n // Set relevant invocation parameters\n if (invocationParams.max_tokens !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_MAX_TOKENS, invocationParams.max_tokens);\n }\n if (invocationParams.temperature !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_TEMPERATURE, invocationParams.temperature);\n }\n if (invocationParams.top_p !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_TOP_P, invocationParams.top_p);\n }\n if (invocationParams.frequency_penalty !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_FREQUENCY_PENALTY, invocationParams.frequency_penalty);\n }\n if (invocationParams.presence_penalty !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_PRESENCE_PENALTY, invocationParams.presence_penalty);\n }\n }\n setIOAttributes(span, op) {\n if (op.run.inputs) {\n try {\n const inputs = op.run.inputs;\n if (typeof inputs === \"object\" && inputs !== null) {\n if (inputs.model && Array.isArray(inputs.messages)) {\n span.setAttribute(constants.GEN_AI_REQUEST_MODEL, inputs.model);\n }\n // Set additional request attributes if available\n if (inputs.stream !== undefined) {\n span.setAttribute(constants.LANGSMITH_REQUEST_STREAMING, inputs.stream);\n }\n if (inputs.extra_headers) {\n span.setAttribute(constants.LANGSMITH_REQUEST_HEADERS, JSON.stringify(inputs.extra_headers));\n }\n if (inputs.extra_query) {\n span.setAttribute(constants.GEN_AI_REQUEST_EXTRA_QUERY, JSON.stringify(inputs.extra_query));\n }\n if (inputs.extra_body) {\n span.setAttribute(constants.GEN_AI_REQUEST_EXTRA_BODY, JSON.stringify(inputs.extra_body));\n }\n }\n span.setAttribute(constants.GENAI_PROMPT, JSON.stringify(inputs));\n }\n catch (e) {\n console.debug(`Failed to process inputs for run ${op.id}`, e);\n }\n }\n if (op.run.outputs) {\n try {\n const outputs = op.run.outputs;\n // Extract token usage from outputs (for LLM runs)\n const tokenUsage = this.getUnifiedRunTokens(outputs);\n if (tokenUsage) {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKENS, tokenUsage[0]);\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKENS, tokenUsage[1]);\n span.setAttribute(constants.GEN_AI_USAGE_TOTAL_TOKENS, tokenUsage[0] + tokenUsage[1]);\n }\n if (outputs && typeof outputs === \"object\") {\n if (outputs.model) {\n span.setAttribute(constants.GEN_AI_RESPONSE_MODEL, String(outputs.model));\n }\n // Extract additional response attributes\n if (outputs.id) {\n span.setAttribute(constants.GEN_AI_RESPONSE_ID, outputs.id);\n }\n if (outputs.choices && Array.isArray(outputs.choices)) {\n const finishReasons = outputs.choices\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .map((choice) => choice.finish_reason)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .filter((reason) => reason)\n .map(String);\n if (finishReasons.length > 0) {\n span.setAttribute(constants.GEN_AI_RESPONSE_FINISH_REASONS, finishReasons.join(\", \"));\n }\n }\n if (outputs.service_tier) {\n span.setAttribute(constants.GEN_AI_RESPONSE_SERVICE_TIER, outputs.service_tier);\n }\n if (outputs.system_fingerprint) {\n span.setAttribute(constants.GEN_AI_RESPONSE_SYSTEM_FINGERPRINT, outputs.system_fingerprint);\n }\n if (outputs.usage_metadata &&\n typeof outputs.usage_metadata === \"object\") {\n const usageMetadata = outputs.usage_metadata;\n if (usageMetadata.input_token_details) {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKEN_DETAILS, JSON.stringify(usageMetadata.input_token_details));\n }\n if (usageMetadata.output_token_details) {\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS, JSON.stringify(usageMetadata.output_token_details));\n }\n }\n }\n span.setAttribute(constants.GENAI_COMPLETION, JSON.stringify(outputs));\n }\n catch (e) {\n console.debug(`Failed to process outputs for run ${op.id}`, e);\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getUnifiedRunTokens(outputs) {\n if (!outputs) {\n return null;\n }\n // Search in non-generations lists\n let tokenUsage = this.extractUnifiedRunTokens(outputs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n // Find if direct kwarg in outputs\n const keys = Object.keys(outputs);\n for (const key of keys) {\n const haystack = outputs[key];\n if (!haystack || typeof haystack !== \"object\") {\n continue;\n }\n tokenUsage = this.extractUnifiedRunTokens(haystack.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n if (haystack.lc === 1 &&\n haystack.kwargs &&\n typeof haystack.kwargs === \"object\") {\n tokenUsage = this.extractUnifiedRunTokens(haystack.kwargs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n }\n }\n // Find in generations\n const generations = outputs.generations || [];\n if (!Array.isArray(generations)) {\n return null;\n }\n const flatGenerations = Array.isArray(generations[0])\n ? generations.flat()\n : generations;\n for (const generation of flatGenerations) {\n if (typeof generation === \"object\" &&\n generation.message &&\n typeof generation.message === \"object\" &&\n generation.message.kwargs &&\n typeof generation.message.kwargs === \"object\") {\n tokenUsage = this.extractUnifiedRunTokens(generation.message.kwargs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n }\n }\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractUnifiedRunTokens(outputs) {\n if (!outputs || typeof outputs !== \"object\") {\n return null;\n }\n if (typeof outputs.input_tokens !== \"number\" ||\n typeof outputs.output_tokens !== \"number\") {\n return null;\n }\n return [outputs.input_tokens, outputs.output_tokens];\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAEA,MAAM,6BAA6B;CAC/B,KAAK;CACL,MAAM;CACN,WAAW;CACX,WAAW;CACX,QAAQ;AACX;AACD,SAAS,iBAAiB,SAAS;AAC/B,QAAO,2BAA2B,YAAY;AACjD;AACD,IAAa,4BAAb,MAAuC;CACnC,cAAc;EACV,OAAO,eAAe,MAAM,SAAS;GACjC,YAAY;GACZ,cAAc;GACd,UAAU;GACV,uBAAO,IAAI;EACd,EAAC;CACL;CACD,YAAY,YAAY,gBAAgB;AACpC,OAAK,MAAM,MAAM,WACb,KAAI;AACA,OAAI,CAAC,GAAG,IACJ;AAEJ,OAAI,GAAG,cAAc,QAAQ;IACzB,MAAM,OAAO,KAAK,iBAAiB,IAAI,GAAG,KAAK,eAAe,IAAI,GAAG,GAAG,CAAC;AACzE,QAAI,QAAQ,CAAC,GAAG,IAAI,UA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E,EAAE;EACjE;CAER;CAED,oBAAoB,SAAS;AACzB,MAAI,CAAC,QACD,QAAO;EAGX,IAAI,aAAa,KAAK,wBAAwB,QAAQ,eAAe;AACrE,MAAI,WACA,QAAO;EAGX,MAAM,OAAO,OAAO,KAAK,QAAQ;AACjC,OAAK,MAAM,OAAO,MAAM;GACpB,MAAM,WAAW,QAAQ;AACzB,OAAI,CAAC,YAAY,OAAO,aAAa,SACjC;GAEJ,aAAa,KAAK,wBAAwB,SAAS,eAAe;AAClE,OAAI,WACA,QAAO;AAEX,OAAI,SAAS,OAAO,KAChB,SAAS,UACT,OAAO,SAAS,WAAW,UAAU;IACrC,aAAa,KAAK,wBAAwB,SAAS,OAAO,eAAe;AACzE,QAAI,WACA,QAAO;GAEd;EACJ;EAED,MAAM,cAAc,QAAQ,eAAe,CAAE;AAC7C,MAAI,CAAC,MAAM,QAAQ,YAAY,CAC3B,QAAO;EAEX,MAAM,kBAAkB,MAAM,QAAQ,YAAY,GAAG,GAC/C,YAAY,MAAM,GAClB;AACN,OAAK,MAAM,cAAc,gBACrB,KAAI,OAAO,eAAe,YACtB,WAAW,WACX,OAAO,WAAW,YAAY,YAC9B,WAAW,QAAQ,UACnB,OAAO,WAAW,QAAQ,WAAW,UAAU;GAC/C,aAAa,KAAK,wBAAwB,WAAW,QAAQ,OAAO,eAAe;AACnF,OAAI,WACA,QAAO;EAEd;AAEL,SAAO;CACV;CAED,wBAAwB,SAAS;AAC7B,MAAI,CAAC,WAAW,OAAO,YAAY,SAC/B,QAAO;AAEX,MAAI,OAAO,QAAQ,iBAAiB,YAChC,OAAO,QAAQ,kBAAkB,SACjC,QAAO;AAEX,SAAO,CAAC,QAAQ,cAAc,QAAQ,aAAc;CACvD;AACJ"}
1
+ {"version":3,"file":"translator.js","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/experimental/otel/translator.js"],"sourcesContent":["import * as constants from \"./constants.js\";\nimport { getOTELTrace } from \"../../singletons/otel.js\";\nconst WELL_KNOWN_OPERATION_NAMES = {\n llm: \"chat\",\n tool: \"execute_tool\",\n retriever: \"embeddings\",\n embedding: \"embeddings\",\n prompt: \"chat\",\n};\nfunction getOperationName(runType) {\n return WELL_KNOWN_OPERATION_NAMES[runType] || runType;\n}\nexport class LangSmithToOTELTranslator {\n constructor() {\n Object.defineProperty(this, \"spans\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n }\n exportBatch(operations, otelContextMap) {\n for (const op of operations) {\n try {\n if (!op.run) {\n continue;\n }\n if (op.operation === \"post\") {\n const span = this.createSpanForRun(op, op.run, otelContextMap.get(op.id));\n if (span && !op.run.end_time) {\n this.spans.set(op.id, span);\n }\n }\n else {\n this.updateSpanForRun(op, op.run);\n }\n }\n catch (e) {\n console.error(`Error processing operation ${op.id}:`, e);\n }\n }\n }\n createSpanForRun(op, runInfo, otelContext) {\n const activeSpan = otelContext && getOTELTrace().getSpan(otelContext);\n if (!activeSpan) {\n return;\n }\n try {\n return this.finishSpanSetup(activeSpan, runInfo, op);\n }\n catch (e) {\n console.error(`Failed to create span for run ${op.id}:`, e);\n return undefined;\n }\n }\n finishSpanSetup(span, runInfo, op) {\n // Set all attributes\n this.setSpanAttributes(span, runInfo, op);\n // Set status based on error\n if (runInfo.error) {\n span.setStatus({ code: 2 }); // ERROR status\n span.recordException(new Error(runInfo.error));\n }\n else {\n span.setStatus({ code: 1 }); // OK status\n }\n // End the span if end_time is present\n if (runInfo.end_time) {\n span.end(new Date(runInfo.end_time));\n }\n return span;\n }\n updateSpanForRun(op, runInfo) {\n try {\n const span = this.spans.get(op.id);\n if (!span) {\n console.debug(`No span found for run ${op.id} during update`);\n return;\n }\n // Update attributes\n this.setSpanAttributes(span, runInfo, op);\n // Update status based on error\n if (runInfo.error) {\n span.setStatus({ code: 2 }); // ERROR status\n span.recordException(new Error(runInfo.error));\n }\n else {\n span.setStatus({ code: 1 }); // OK status\n }\n // End the span if end_time is present\n const endTime = runInfo.end_time;\n if (endTime) {\n span.end(new Date(endTime));\n this.spans.delete(op.id);\n }\n }\n catch (e) {\n console.error(`Failed to update span for run ${op.id}:`, e);\n }\n }\n extractModelName(runInfo) {\n // Try to get model name from metadata\n if (runInfo.extra?.metadata) {\n const metadata = runInfo.extra.metadata;\n // First check for ls_model_name in metadata\n if (metadata.ls_model_name) {\n return metadata.ls_model_name;\n }\n // Then check invocation_params for model info\n if (metadata.invocation_params) {\n const invocationParams = metadata.invocation_params;\n if (invocationParams.model) {\n return invocationParams.model;\n }\n else if (invocationParams.model_name) {\n return invocationParams.model_name;\n }\n }\n }\n return;\n }\n setSpanAttributes(span, runInfo, op) {\n if (\"run_type\" in runInfo && runInfo.run_type) {\n span.setAttribute(constants.LANGSMITH_RUN_TYPE, runInfo.run_type);\n // Set GenAI attributes according to OTEL semantic conventions\n const operationName = getOperationName(runInfo.run_type || \"chain\");\n span.setAttribute(constants.GEN_AI_OPERATION_NAME, operationName);\n }\n if (\"name\" in runInfo && runInfo.name) {\n span.setAttribute(constants.LANGSMITH_NAME, runInfo.name);\n }\n if (\"session_id\" in runInfo && runInfo.session_id) {\n span.setAttribute(constants.LANGSMITH_SESSION_ID, runInfo.session_id);\n }\n if (\"session_name\" in runInfo && runInfo.session_name) {\n span.setAttribute(constants.LANGSMITH_SESSION_NAME, runInfo.session_name);\n }\n // Set gen_ai.system\n this.setGenAiSystem(span, runInfo);\n // Set model name if available\n const modelName = this.extractModelName(runInfo);\n if (modelName) {\n span.setAttribute(constants.GEN_AI_REQUEST_MODEL, modelName);\n }\n // Set token usage information\n if (\"prompt_tokens\" in runInfo &&\n typeof runInfo.prompt_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKENS, runInfo.prompt_tokens);\n }\n if (\"completion_tokens\" in runInfo &&\n typeof runInfo.completion_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKENS, runInfo.completion_tokens);\n }\n if (\"total_tokens\" in runInfo && typeof runInfo.total_tokens === \"number\") {\n span.setAttribute(constants.GEN_AI_USAGE_TOTAL_TOKENS, runInfo.total_tokens);\n }\n // Set other parameters from invocation_params\n this.setInvocationParameters(span, runInfo);\n // Set metadata and tags if available\n const metadata = runInfo.extra?.metadata || {};\n for (const [key, value] of Object.entries(metadata)) {\n if (value !== null && value !== undefined) {\n span.setAttribute(`${constants.LANGSMITH_METADATA}.${key}`, String(value));\n }\n }\n const tags = runInfo.tags;\n if (tags && Array.isArray(tags)) {\n span.setAttribute(constants.LANGSMITH_TAGS, tags.join(\", \"));\n }\n else if (tags) {\n span.setAttribute(constants.LANGSMITH_TAGS, String(tags));\n }\n // Support additional serialized attributes, if present\n if (\"serialized\" in runInfo && typeof runInfo.serialized === \"object\") {\n const serialized = runInfo.serialized;\n if (serialized.name) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_NAME, String(serialized.name));\n }\n if (serialized.signature) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_SIGNATURE, String(serialized.signature));\n }\n if (serialized.doc) {\n span.setAttribute(constants.GEN_AI_SERIALIZED_DOC, String(serialized.doc));\n }\n }\n // Set inputs/outputs if available\n this.setIOAttributes(span, op);\n }\n setGenAiSystem(span, runInfo) {\n // Default to \"langchain\" if we can't determine the system\n let system = \"langchain\";\n // Extract model name to determine the system\n const modelName = this.extractModelName(runInfo);\n if (modelName) {\n const modelLower = modelName.toLowerCase();\n if (modelLower.includes(\"anthropic\") || modelLower.startsWith(\"claude\")) {\n system = \"anthropic\";\n }\n else if (modelLower.includes(\"bedrock\")) {\n system = \"aws.bedrock\";\n }\n else if (modelLower.includes(\"azure\") &&\n modelLower.includes(\"openai\")) {\n system = \"az.ai.openai\";\n }\n else if (modelLower.includes(\"azure\") &&\n modelLower.includes(\"inference\")) {\n system = \"az.ai.inference\";\n }\n else if (modelLower.includes(\"cohere\")) {\n system = \"cohere\";\n }\n else if (modelLower.includes(\"deepseek\")) {\n system = \"deepseek\";\n }\n else if (modelLower.includes(\"gemini\")) {\n system = \"gemini\";\n }\n else if (modelLower.includes(\"groq\")) {\n system = \"groq\";\n }\n else if (modelLower.includes(\"watson\") || modelLower.includes(\"ibm\")) {\n system = \"ibm.watsonx.ai\";\n }\n else if (modelLower.includes(\"mistral\")) {\n system = \"mistral_ai\";\n }\n else if (modelLower.includes(\"gpt\") || modelLower.includes(\"openai\")) {\n system = \"openai\";\n }\n else if (modelLower.includes(\"perplexity\") ||\n modelLower.includes(\"sonar\")) {\n system = \"perplexity\";\n }\n else if (modelLower.includes(\"vertex\")) {\n system = \"vertex_ai\";\n }\n else if (modelLower.includes(\"xai\") || modelLower.includes(\"grok\")) {\n system = \"xai\";\n }\n }\n span.setAttribute(constants.GEN_AI_SYSTEM, system);\n }\n setInvocationParameters(span, runInfo) {\n if (!runInfo.extra?.metadata?.invocation_params) {\n return;\n }\n const invocationParams = runInfo.extra.metadata.invocation_params;\n // Set relevant invocation parameters\n if (invocationParams.max_tokens !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_MAX_TOKENS, invocationParams.max_tokens);\n }\n if (invocationParams.temperature !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_TEMPERATURE, invocationParams.temperature);\n }\n if (invocationParams.top_p !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_TOP_P, invocationParams.top_p);\n }\n if (invocationParams.frequency_penalty !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_FREQUENCY_PENALTY, invocationParams.frequency_penalty);\n }\n if (invocationParams.presence_penalty !== undefined) {\n span.setAttribute(constants.GEN_AI_REQUEST_PRESENCE_PENALTY, invocationParams.presence_penalty);\n }\n }\n setIOAttributes(span, op) {\n if (op.run.inputs) {\n try {\n const inputs = op.run.inputs;\n if (typeof inputs === \"object\" && inputs !== null) {\n if (inputs.model && Array.isArray(inputs.messages)) {\n span.setAttribute(constants.GEN_AI_REQUEST_MODEL, inputs.model);\n }\n // Set additional request attributes if available\n if (inputs.stream !== undefined) {\n span.setAttribute(constants.LANGSMITH_REQUEST_STREAMING, inputs.stream);\n }\n if (inputs.extra_headers) {\n span.setAttribute(constants.LANGSMITH_REQUEST_HEADERS, JSON.stringify(inputs.extra_headers));\n }\n if (inputs.extra_query) {\n span.setAttribute(constants.GEN_AI_REQUEST_EXTRA_QUERY, JSON.stringify(inputs.extra_query));\n }\n if (inputs.extra_body) {\n span.setAttribute(constants.GEN_AI_REQUEST_EXTRA_BODY, JSON.stringify(inputs.extra_body));\n }\n }\n span.setAttribute(constants.GENAI_PROMPT, JSON.stringify(inputs));\n }\n catch (e) {\n console.debug(`Failed to process inputs for run ${op.id}`, e);\n }\n }\n if (op.run.outputs) {\n try {\n const outputs = op.run.outputs;\n // Extract token usage from outputs (for LLM runs)\n const tokenUsage = this.getUnifiedRunTokens(outputs);\n if (tokenUsage) {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKENS, tokenUsage[0]);\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKENS, tokenUsage[1]);\n span.setAttribute(constants.GEN_AI_USAGE_TOTAL_TOKENS, tokenUsage[0] + tokenUsage[1]);\n }\n if (outputs && typeof outputs === \"object\") {\n if (outputs.model) {\n span.setAttribute(constants.GEN_AI_RESPONSE_MODEL, String(outputs.model));\n }\n // Extract additional response attributes\n if (outputs.id) {\n span.setAttribute(constants.GEN_AI_RESPONSE_ID, outputs.id);\n }\n if (outputs.choices && Array.isArray(outputs.choices)) {\n const finishReasons = outputs.choices\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .map((choice) => choice.finish_reason)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .filter((reason) => reason)\n .map(String);\n if (finishReasons.length > 0) {\n span.setAttribute(constants.GEN_AI_RESPONSE_FINISH_REASONS, finishReasons.join(\", \"));\n }\n }\n if (outputs.service_tier) {\n span.setAttribute(constants.GEN_AI_RESPONSE_SERVICE_TIER, outputs.service_tier);\n }\n if (outputs.system_fingerprint) {\n span.setAttribute(constants.GEN_AI_RESPONSE_SYSTEM_FINGERPRINT, outputs.system_fingerprint);\n }\n if (outputs.usage_metadata &&\n typeof outputs.usage_metadata === \"object\") {\n const usageMetadata = outputs.usage_metadata;\n if (usageMetadata.input_token_details) {\n span.setAttribute(constants.GEN_AI_USAGE_INPUT_TOKEN_DETAILS, JSON.stringify(usageMetadata.input_token_details));\n }\n if (usageMetadata.output_token_details) {\n span.setAttribute(constants.GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS, JSON.stringify(usageMetadata.output_token_details));\n }\n }\n }\n span.setAttribute(constants.GENAI_COMPLETION, JSON.stringify(outputs));\n }\n catch (e) {\n console.debug(`Failed to process outputs for run ${op.id}`, e);\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getUnifiedRunTokens(outputs) {\n if (!outputs) {\n return null;\n }\n // Search in non-generations lists\n let tokenUsage = this.extractUnifiedRunTokens(outputs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n // Find if direct kwarg in outputs\n const keys = Object.keys(outputs);\n for (const key of keys) {\n const haystack = outputs[key];\n if (!haystack || typeof haystack !== \"object\") {\n continue;\n }\n tokenUsage = this.extractUnifiedRunTokens(haystack.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n if (haystack.lc === 1 &&\n haystack.kwargs &&\n typeof haystack.kwargs === \"object\") {\n tokenUsage = this.extractUnifiedRunTokens(haystack.kwargs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n }\n }\n // Find in generations\n const generations = outputs.generations || [];\n if (!Array.isArray(generations)) {\n return null;\n }\n const flatGenerations = Array.isArray(generations[0])\n ? generations.flat()\n : generations;\n for (const generation of flatGenerations) {\n if (typeof generation === \"object\" &&\n generation.message &&\n typeof generation.message === \"object\" &&\n generation.message.kwargs &&\n typeof generation.message.kwargs === \"object\") {\n tokenUsage = this.extractUnifiedRunTokens(generation.message.kwargs.usage_metadata);\n if (tokenUsage) {\n return tokenUsage;\n }\n }\n }\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractUnifiedRunTokens(outputs) {\n if (!outputs || typeof outputs !== \"object\") {\n return null;\n }\n if (typeof outputs.input_tokens !== \"number\" ||\n typeof outputs.output_tokens !== \"number\") {\n return null;\n }\n return [outputs.input_tokens, outputs.output_tokens];\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAEA,MAAM,6BAA6B;CAC/B,KAAK;CACL,MAAM;CACN,WAAW;CACX,WAAW;CACX,QAAQ;AACX;AACD,SAAS,iBAAiB,SAAS;AAC/B,QAAO,2BAA2B,YAAY;AACjD;AACD,IAAa,4BAAb,MAAuC;CACnC,cAAc;EACV,OAAO,eAAe,MAAM,SAAS;GACjC,YAAY;GACZ,cAAc;GACd,UAAU;GACV,uBAAO,IAAI;EACd,EAAC;CACL;CACD,YAAY,YAAY,gBAAgB;AACpC,OAAK,MAAM,MAAM,WACb,KAAI;AACA,OAAI,CAAC,GAAG,IACJ;AAEJ,OAAI,GAAG,cAAc,QAAQ;IACzB,MAAM,OAAO,KAAK,iBAAiB,IAAI,GAAG,KAAK,eAAe,IAAI,GAAG,GAAG,CAAC;AACzE,QAAI,QAAQ,CAAC,GAAG,IAAI,UAChB,KAAK,MAAM,IAAI,GAAG,IAAI,KAAK;GAElC,OAEG,KAAK,iBAAiB,IAAI,GAAG,IAAI;EAExC,SACM,GAAG;GACN,QAAQ,MAAM,CAAC,2BAA2B,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE;EAC3D;CAER;CACD,iBAAiB,IAAI,SAAS,aAAa;EACvC,MAAM,aAAa,eAAe,cAAc,CAAC,QAAQ,YAAY;AACrE,MAAI,CAAC,WACD;AAEJ,MAAI;AACA,UAAO,KAAK,gBAAgB,YAAY,SAAS,GAAG;EACvD,SACM,GAAG;GACN,QAAQ,MAAM,CAAC,8BAA8B,EAAE,GA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AAa,KAAK,wBAAwB,SAAS,OAAO,eAAe;AACzE,QAAI,WACA,QAAO;GAEd;EACJ;EAED,MAAM,cAAc,QAAQ,eAAe,CAAE;AAC7C,MAAI,CAAC,MAAM,QAAQ,YAAY,CAC3B,QAAO;EAEX,MAAM,kBAAkB,MAAM,QAAQ,YAAY,GAAG,GAC/C,YAAY,MAAM,GAClB;AACN,OAAK,MAAM,cAAc,gBACrB,KAAI,OAAO,eAAe,YACtB,WAAW,WACX,OAAO,WAAW,YAAY,YAC9B,WAAW,QAAQ,UACnB,OAAO,WAAW,QAAQ,WAAW,UAAU;GAC/C,aAAa,KAAK,wBAAwB,WAAW,QAAQ,OAAO,eAAe;AACnF,OAAI,WACA,QAAO;EAEd;AAEL,SAAO;CACV;CAED,wBAAwB,SAAS;AAC7B,MAAI,CAAC,WAAW,OAAO,YAAY,SAC/B,QAAO;AAEX,MAAI,OAAO,QAAQ,iBAAiB,YAChC,OAAO,QAAQ,kBAAkB,SACjC,QAAO;AAEX,SAAO,CAAC,QAAQ,cAAc,QAAQ,aAAc;CACvD;AACJ"}
@@ -3,8 +3,8 @@ const require_client = require('./client.cjs');
3
3
  const require_project = require('./utils/project.cjs');
4
4
  const require_run_trees = require('./run_trees.cjs');
5
5
 
6
- //#region ../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.js
7
- const __version__ = "0.3.64";
6
+ //#region ../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.js
7
+ const __version__ = "0.3.74";
8
8
 
9
9
  //#endregion
10
10
  exports.__version__ = __version__;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.js"],"sourcesContent":["export { Client, } from \"./client.js\";\nexport { RunTree } from \"./run_trees.js\";\nexport { overrideFetchImplementation } from \"./singletons/fetch.js\";\nexport { getDefaultProjectName } from \"./utils/project.js\";\n// Update using yarn bump-version\nexport const __version__ = \"0.3.64\";\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAKA,MAAa,cAAc"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.js"],"sourcesContent":["export { Client, } from \"./client.js\";\nexport { RunTree } from \"./run_trees.js\";\nexport { overrideFetchImplementation } from \"./singletons/fetch.js\";\nexport { getDefaultProjectName } from \"./utils/project.js\";\n// Update using yarn bump-version\nexport const __version__ = \"0.3.74\";\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAKA,MAAa,cAAc"}
@@ -3,8 +3,8 @@ import { Client } from "./client.js";
3
3
  import { getDefaultProjectName } from "./utils/project.js";
4
4
  import { RunTree } from "./run_trees.js";
5
5
 
6
- //#region ../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.js
7
- const __version__ = "0.3.64";
6
+ //#region ../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.js
7
+ const __version__ = "0.3.74";
8
8
 
9
9
  //#endregion
10
10
  export { __version__ };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.js"],"sourcesContent":["export { Client, } from \"./client.js\";\nexport { RunTree } from \"./run_trees.js\";\nexport { overrideFetchImplementation } from \"./singletons/fetch.js\";\nexport { getDefaultProjectName } from \"./utils/project.js\";\n// Update using yarn bump-version\nexport const __version__ = \"0.3.64\";\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAKA,MAAa,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/index.js"],"sourcesContent":["export { Client, } from \"./client.js\";\nexport { RunTree } from \"./run_trees.js\";\nexport { overrideFetchImplementation } from \"./singletons/fetch.js\";\nexport { getDefaultProjectName } from \"./utils/project.js\";\n// Update using yarn bump-version\nexport const __version__ = \"0.3.74\";\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAKA,MAAa,cAAc"}
@@ -8,7 +8,7 @@ const require_constants = require('./singletons/constants.cjs');
8
8
  const require_project = require('./utils/project.cjs');
9
9
  const uuid = require_rolldown_runtime.__toESM(require("uuid"));
10
10
 
11
- //#region ../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js
11
+ //#region ../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js
12
12
  function stripNonAlphanumeric(input) {
13
13
  return input.replace(/[-:.]/g, "");
14
14
  }
@@ -427,11 +427,12 @@ var RunTree = class RunTree {
427
427
  async postRun(excludeChildRuns = true) {
428
428
  try {
429
429
  const runtimeEnv = require_env.getRuntimeEnvironment();
430
- if (this.replicas && this.replicas.length > 0) for (const { projectName, apiKey, apiUrl } of this.replicas) {
430
+ if (this.replicas && this.replicas.length > 0) for (const { projectName, apiKey, apiUrl, workspaceId } of this.replicas) {
431
431
  const runCreate = this._remapForProject(projectName ?? this.project_name, runtimeEnv, true);
432
432
  await this.client.createRun(runCreate, {
433
433
  apiKey,
434
- apiUrl
434
+ apiUrl,
435
+ workspaceId
435
436
  });
436
437
  }
437
438
  else {
@@ -447,7 +448,7 @@ var RunTree = class RunTree {
447
448
  }
448
449
  }
449
450
  async patchRun(options) {
450
- if (this.replicas && this.replicas.length > 0) for (const { projectName, apiKey, apiUrl, updates } of this.replicas) {
451
+ if (this.replicas && this.replicas.length > 0) for (const { projectName, apiKey, apiUrl, workspaceId, updates } of this.replicas) {
451
452
  const runData = this._remapForProject(projectName ?? this.project_name);
452
453
  const updatePayload = {
453
454
  id: runData.id,
@@ -468,7 +469,8 @@ var RunTree = class RunTree {
468
469
  if (!options?.excludeInputs) updatePayload.inputs = runData.inputs;
469
470
  await this.client.updateRun(runData.id, updatePayload, {
470
471
  apiKey,
471
- apiUrl
472
+ apiUrl,
473
+ workspaceId
472
474
  });
473
475
  }
474
476
  else try {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run_trees.cjs","names":["value","getDefaultProjectName","getEnvironmentVariable","Client","_LC_CONTEXT_VARIABLES_KEY","getRuntimeEnvironment","warnOnce","isTracingEnabled","uuid","isConflictingEndpointsError","getLangSmithEnvironmentVariable","ConflictingEndpointsError"],"sources":["../../../../../../../../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js"],"sourcesContent":["import * as uuid from \"uuid\";\nimport { Client } from \"./client.js\";\nimport { isTracingEnabled } from \"./env.js\";\nimport { isConflictingEndpointsError, ConflictingEndpointsError, } from \"./utils/error.js\";\nimport { _LC_CONTEXT_VARIABLES_KEY } from \"./singletons/constants.js\";\nimport { getEnvironmentVariable, getRuntimeEnvironment, } from \"./utils/env.js\";\nimport { getDefaultProjectName } from \"./utils/project.js\";\nimport { getLangSmithEnvironmentVariable } from \"./utils/env.js\";\nimport { warnOnce } from \"./utils/warn.js\";\nfunction stripNonAlphanumeric(input) {\n return input.replace(/[-:.]/g, \"\");\n}\nexport function convertToDottedOrderFormat(epoch, runId, executionOrder = 1) {\n // Date only has millisecond precision, so we use the microseconds to break\n // possible ties, avoiding incorrect run order\n const paddedOrder = executionOrder.toFixed(0).slice(0, 3).padStart(3, \"0\");\n const microsecondPrecisionDatestring = `${new Date(epoch)\n .toISOString()\n .slice(0, -1)}${paddedOrder}Z`;\n return {\n dottedOrder: stripNonAlphanumeric(microsecondPrecisionDatestring) + runId,\n microsecondPrecisionDatestring,\n };\n}\n/**\n * Baggage header information\n */\nclass Baggage {\n constructor(metadata, tags, project_name, replicas) {\n Object.defineProperty(this, \"metadata\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"tags\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"project_name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"replicas\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.metadata = metadata;\n this.tags = tags;\n this.project_name = project_name;\n this.replicas = replicas;\n }\n static fromHeader(value) {\n const items = value.split(\",\");\n let metadata = {};\n let tags = [];\n let project_name;\n let replicas;\n for (const item of items) {\n const [key, uriValue] = item.split(\"=\");\n const value = decodeURIComponent(uriValue);\n if (key === \"langsmith-metadata\") {\n metadata = JSON.parse(value);\n }\n else if (key === \"langsmith-tags\") {\n tags = value.split(\",\");\n }\n else if (key === \"langsmith-project\") {\n project_name = value;\n }\n else if (key === \"langsmith-replicas\") {\n replicas = JSON.parse(value);\n }\n }\n return new Baggage(metadata, tags, project_name, replicas);\n }\n toHeader() {\n const items = [];\n if (this.metadata && Object.keys(this.metadata).length > 0) {\n items.push(`langsmith-metadata=${encodeURIComponent(JSON.stringify(this.metadata))}`);\n }\n if (this.tags && this.tags.length > 0) {\n items.push(`langsmith-tags=${encodeURIComponent(this.tags.join(\",\"))}`);\n }\n if (this.project_name) {\n items.push(`langsmith-project=${encodeURIComponent(this.project_name)}`);\n }\n return items.join(\",\");\n }\n}\nexport class RunTree {\n constructor(originalConfig) {\n Object.defineProperty(this, \"id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"run_type\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"project_name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"parent_run\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"parent_run_id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"child_runs\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"start_time\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"end_time\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"extra\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"tags\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"error\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"serialized\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"inputs\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"outputs\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"reference_example_id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"client\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"events\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"trace_id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"dotted_order\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"tracingEnabled\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"execution_order\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"child_execution_order\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Attachments associated with the run.\n * Each entry is a tuple of [mime_type, bytes]\n */\n Object.defineProperty(this, \"attachments\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Projects to replicate this run to with optional updates.\n */\n Object.defineProperty(this, \"replicas\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_serialized_start_time\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n // If you pass in a run tree directly, return a shallow clone\n if (isRunTree(originalConfig)) {\n Object.assign(this, { ...originalConfig });\n return;\n }\n const defaultConfig = RunTree.getDefaultConfig();\n const { metadata, ...config } = originalConfig;\n const client = config.client ?? RunTree.getSharedClient();\n const dedupedMetadata = {\n ...metadata,\n ...config?.extra?.metadata,\n };\n config.extra = { ...config.extra, metadata: dedupedMetadata };\n Object.assign(this, { ...defaultConfig, ...config, client });\n if (!this.trace_id) {\n if (this.parent_run) {\n this.trace_id = this.parent_run.trace_id ?? this.id;\n }\n else {\n this.trace_id = this.id;\n }\n }\n this.replicas = _ensureWriteReplicas(this.replicas);\n this.execution_order ??= 1;\n this.child_execution_order ??= 1;\n if (!this.dotted_order) {\n const { dottedOrder, microsecondPrecisionDatestring } = convertToDottedOrderFormat(this.start_time, this.id, this.execution_order);\n if (this.parent_run) {\n this.dotted_order = this.parent_run.dotted_order + \".\" + dottedOrder;\n }\n else {\n this.dotted_order = dottedOrder;\n }\n this._serialized_start_time = microsecondPrecisionDatestring;\n }\n }\n set metadata(metadata) {\n this.extra = {\n ...this.extra,\n metadata: {\n ...this.extra?.metadata,\n ...metadata,\n },\n };\n }\n get metadata() {\n return this.extra?.metadata;\n }\n static getDefaultConfig() {\n return {\n id: uuid.v4(),\n run_type: \"chain\",\n project_name: getDefaultProjectName(),\n child_runs: [],\n api_url: getEnvironmentVariable(\"LANGCHAIN_ENDPOINT\") ?? \"http://localhost:1984\",\n api_key: getEnvironmentVariable(\"LANGCHAIN_API_KEY\"),\n caller_options: {},\n start_time: Date.now(),\n serialized: {},\n inputs: {},\n extra: {},\n };\n }\n static getSharedClient() {\n if (!RunTree.sharedClient) {\n RunTree.sharedClient = new Client();\n }\n return RunTree.sharedClient;\n }\n createChild(config) {\n const child_execution_order = this.child_execution_order + 1;\n const child = new RunTree({\n ...config,\n parent_run: this,\n project_name: this.project_name,\n replicas: this.replicas,\n client: this.client,\n tracingEnabled: this.tracingEnabled,\n execution_order: child_execution_order,\n child_execution_order: child_execution_order,\n });\n // Copy context vars over into the new run tree.\n if (_LC_CONTEXT_VARIABLES_KEY in this) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n child[_LC_CONTEXT_VARIABLES_KEY] =\n this[_LC_CONTEXT_VARIABLES_KEY];\n }\n const LC_CHILD = Symbol.for(\"lc:child_config\");\n const presentConfig = config.extra?.[LC_CHILD] ??\n this.extra[LC_CHILD];\n // tracing for LangChain is defined by the _parentRunId and runMap of the tracer\n if (isRunnableConfigLike(presentConfig)) {\n const newConfig = { ...presentConfig };\n const callbacks = isCallbackManagerLike(newConfig.callbacks)\n ? newConfig.callbacks.copy?.()\n : undefined;\n if (callbacks) {\n // update the parent run id\n Object.assign(callbacks, { _parentRunId: child.id });\n // only populate if we're in a newer LC.JS version\n callbacks.handlers\n ?.find(isLangChainTracerLike)\n ?.updateFromRunTree?.(child);\n newConfig.callbacks = callbacks;\n }\n child.extra[LC_CHILD] = newConfig;\n }\n // propagate child_execution_order upwards\n const visited = new Set();\n let current = this;\n while (current != null && !visited.has(current.id)) {\n visited.add(current.id);\n current.child_execution_order = Math.max(current.child_execution_order, child_execution_order);\n current = current.parent_run;\n }\n this.child_runs.push(child);\n return child;\n }\n async end(outputs, error, endTime = Date.now(), metadata) {\n this.outputs = this.outputs ?? outputs;\n this.error = this.error ?? error;\n this.end_time = this.end_time ?? endTime;\n if (metadata && Object.keys(metadata).length > 0) {\n this.extra = this.extra\n ? { ...this.extra, metadata: { ...this.extra.metadata, ...metadata } }\n : { metadata };\n }\n }\n _convertToCreate(run, runtimeEnv, excludeChildRuns = true) {\n const runExtra = run.extra ?? {};\n // Avoid overwriting the runtime environment if it's already set\n if (runExtra?.runtime?.library === undefined) {\n if (!runExtra.runtime) {\n runExtra.runtime = {};\n }\n if (runtimeEnv) {\n for (const [k, v] of Object.entries(runtimeEnv)) {\n if (!runExtra.runtime[k]) {\n runExtra.runtime[k] = v;\n }\n }\n }\n }\n let child_runs;\n let parent_run_id;\n if (!excludeChildRuns) {\n child_runs = run.child_runs.map((child_run) => this._convertToCreate(child_run, runtimeEnv, excludeChildRuns));\n parent_run_id = undefined;\n }\n else {\n parent_run_id = run.parent_run?.id ?? run.parent_run_id;\n child_runs = [];\n }\n return {\n id: run.id,\n name: run.name,\n start_time: run._serialized_start_time ?? run.start_time,\n end_time: run.end_time,\n run_type: run.run_type,\n reference_example_id: run.reference_example_id,\n extra: runExtra,\n serialized: run.serialized,\n error: run.error,\n inputs: run.inputs,\n outputs: run.outputs,\n session_name: run.project_name,\n child_runs: child_runs,\n parent_run_id: parent_run_id,\n trace_id: run.trace_id,\n dotted_order: run.dotted_order,\n tags: run.tags,\n attachments: run.attachments,\n events: run.events,\n };\n }\n _remapForProject(projectName, runtimeEnv, excludeChildRuns = true) {\n const baseRun = this._convertToCreate(this, runtimeEnv, excludeChildRuns);\n if (projectName === this.project_name) {\n return baseRun;\n }\n // Create a deterministic UUID mapping for this project\n const createRemappedId = (originalId) => {\n return uuid.v5(`${originalId}:${projectName}`, uuid.v5.DNS);\n };\n // Remap the current run's ID\n const newId = createRemappedId(baseRun.id);\n const newTraceId = baseRun.trace_id\n ? createRemappedId(baseRun.trace_id)\n : undefined;\n const newParentRunId = baseRun.parent_run_id\n ? createRemappedId(baseRun.parent_run_id)\n : undefined;\n let newDottedOrder;\n if (baseRun.dotted_order) {\n const segments = _parseDottedOrder(baseRun.dotted_order);\n const rebuilt = [];\n // Process all segments except the last one\n for (let i = 0; i < segments.length - 1; i++) {\n const [timestamp, segmentId] = segments[i];\n const remappedId = createRemappedId(segmentId);\n rebuilt.push(timestamp.toISOString().replace(/[-:]/g, \"\").replace(\".\", \"\") +\n remappedId);\n }\n // Process the last segment with the new run ID\n const [lastTimestamp] = segments[segments.length - 1];\n rebuilt.push(lastTimestamp.toISOString().replace(/[-:]/g, \"\").replace(\".\", \"\") +\n newId);\n newDottedOrder = rebuilt.join(\".\");\n }\n else {\n newDottedOrder = undefined;\n }\n const remappedRun = {\n ...baseRun,\n id: newId,\n trace_id: newTraceId,\n parent_run_id: newParentRunId,\n dotted_order: newDottedOrder,\n session_name: projectName,\n };\n return remappedRun;\n }\n async postRun(excludeChildRuns = true) {\n try {\n const runtimeEnv = getRuntimeEnvironment();\n if (this.replicas && this.replicas.length > 0) {\n for (const { projectName, apiKey, apiUrl, workspaceId } of this\n .replicas) {\n const runCreate = this._remapForProject(projectName ?? this.project_name, runtimeEnv, true);\n await this.client.createRun(runCreate, {\n apiKey,\n apiUrl,\n workspaceId,\n });\n }\n }\n else {\n const runCreate = this._convertToCreate(this, runtimeEnv, excludeChildRuns);\n await this.client.createRun(runCreate);\n }\n if (!excludeChildRuns) {\n warnOnce(\"Posting with excludeChildRuns=false is deprecated and will be removed in a future version.\");\n for (const childRun of this.child_runs) {\n await childRun.postRun(false);\n }\n }\n }\n catch (error) {\n console.error(`Error in postRun for run ${this.id}:`, error);\n }\n }\n async patchRun(options) {\n if (this.replicas && this.replicas.length > 0) {\n for (const { projectName, apiKey, apiUrl, workspaceId, updates } of this\n .replicas) {\n const runData = this._remapForProject(projectName ?? this.project_name);\n const updatePayload = {\n id: runData.id,\n outputs: runData.outputs,\n error: runData.error,\n parent_run_id: runData.parent_run_id,\n session_name: runData.session_name,\n reference_example_id: runData.reference_example_id,\n end_time: runData.end_time,\n dotted_order: runData.dotted_order,\n trace_id: runData.trace_id,\n events: runData.events,\n tags: runData.tags,\n extra: runData.extra,\n attachments: this.attachments,\n ...updates,\n };\n // Important that inputs is not a key in the run update\n // if excluded because it will overwrite the run create if the\n // two operations are merged during batching\n if (!options?.excludeInputs) {\n updatePayload.inputs = runData.inputs;\n }\n await this.client.updateRun(runData.id, updatePayload, {\n apiKey,\n apiUrl,\n workspaceId,\n });\n }\n }\n else {\n try {\n const runUpdate = {\n end_time: this.end_time,\n error: this.error,\n outputs: this.outputs,\n parent_run_id: this.parent_run?.id ?? this.parent_run_id,\n reference_example_id: this.reference_example_id,\n extra: this.extra,\n events: this.events,\n dotted_order: this.dotted_order,\n trace_id: this.trace_id,\n tags: this.tags,\n attachments: this.attachments,\n session_name: this.project_name,\n };\n // Important that inputs is not a key in the run update\n // if excluded because it will overwrite the run create if the\n // two operations are merged during batching\n if (!options?.excludeInputs) {\n runUpdate.inputs = this.inputs;\n }\n await this.client.updateRun(this.id, runUpdate);\n }\n catch (error) {\n console.error(`Error in patchRun for run ${this.id}`, error);\n }\n }\n }\n toJSON() {\n return this._convertToCreate(this, undefined, false);\n }\n /**\n * Add an event to the run tree.\n * @param event - A single event or string to add\n */\n addEvent(event) {\n if (!this.events) {\n this.events = [];\n }\n if (typeof event === \"string\") {\n this.events.push({\n name: \"event\",\n time: new Date().toISOString(),\n message: event,\n });\n }\n else {\n this.events.push({\n ...event,\n time: event.time ?? new Date().toISOString(),\n });\n }\n }\n static fromRunnableConfig(parentConfig, props) {\n // We only handle the callback manager case for now\n const callbackManager = parentConfig?.callbacks;\n let parentRun;\n let projectName;\n let client;\n let tracingEnabled = isTracingEnabled();\n if (callbackManager) {\n const parentRunId = callbackManager?.getParentRunId?.() ?? \"\";\n const langChainTracer = callbackManager?.handlers?.find((handler) => handler?.name == \"langchain_tracer\");\n parentRun = langChainTracer?.getRun?.(parentRunId);\n projectName = langChainTracer?.projectName;\n client = langChainTracer?.client;\n tracingEnabled = tracingEnabled || !!langChainTracer;\n }\n if (!parentRun) {\n return new RunTree({\n ...props,\n client,\n tracingEnabled,\n project_name: projectName,\n });\n }\n const parentRunTree = new RunTree({\n name: parentRun.name,\n id: parentRun.id,\n trace_id: parentRun.trace_id,\n dotted_order: parentRun.dotted_order,\n client,\n tracingEnabled,\n project_name: projectName,\n tags: [\n ...new Set((parentRun?.tags ?? []).concat(parentConfig?.tags ?? [])),\n ],\n extra: {\n metadata: {\n ...parentRun?.extra?.metadata,\n ...parentConfig?.metadata,\n },\n },\n });\n return parentRunTree.createChild(props);\n }\n static fromDottedOrder(dottedOrder) {\n return this.fromHeaders({ \"langsmith-trace\": dottedOrder });\n }\n static fromHeaders(headers, inheritArgs) {\n const rawHeaders = \"get\" in headers && typeof headers.get === \"function\"\n ? {\n \"langsmith-trace\": headers.get(\"langsmith-trace\"),\n baggage: headers.get(\"baggage\"),\n }\n : headers;\n const headerTrace = rawHeaders[\"langsmith-trace\"];\n if (!headerTrace || typeof headerTrace !== \"string\")\n return undefined;\n const parentDottedOrder = headerTrace.trim();\n const parsedDottedOrder = parentDottedOrder.split(\".\").map((part) => {\n const [strTime, uuid] = part.split(\"Z\");\n return { strTime, time: Date.parse(strTime + \"Z\"), uuid };\n });\n const traceId = parsedDottedOrder[0].uuid;\n const config = {\n ...inheritArgs,\n name: inheritArgs?.[\"name\"] ?? \"parent\",\n run_type: inheritArgs?.[\"run_type\"] ?? \"chain\",\n start_time: inheritArgs?.[\"start_time\"] ?? Date.now(),\n id: parsedDottedOrder.at(-1)?.uuid,\n trace_id: traceId,\n dotted_order: parentDottedOrder,\n };\n if (rawHeaders[\"baggage\"] && typeof rawHeaders[\"baggage\"] === \"string\") {\n const baggage = Baggage.fromHeader(rawHeaders[\"baggage\"]);\n config.metadata = baggage.metadata;\n config.tags = baggage.tags;\n config.project_name = baggage.project_name;\n config.replicas = baggage.replicas;\n }\n return new RunTree(config);\n }\n toHeaders(headers) {\n const result = {\n \"langsmith-trace\": this.dotted_order,\n baggage: new Baggage(this.extra?.metadata, this.tags, this.project_name, this.replicas).toHeader(),\n };\n if (headers) {\n for (const [key, value] of Object.entries(result)) {\n headers.set(key, value);\n }\n }\n return result;\n }\n}\nObject.defineProperty(RunTree, \"sharedClient\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: null\n});\nexport function isRunTree(x) {\n return (x != null &&\n typeof x.createChild === \"function\" &&\n typeof x.postRun === \"function\");\n}\nfunction isLangChainTracerLike(x) {\n return (typeof x === \"object\" &&\n x != null &&\n typeof x.name === \"string\" &&\n x.name === \"langchain_tracer\");\n}\nfunction containsLangChainTracerLike(x) {\n return (Array.isArray(x) && x.some((callback) => isLangChainTracerLike(callback)));\n}\nfunction isCallbackManagerLike(x) {\n return (typeof x === \"object\" &&\n x != null &&\n Array.isArray(x.handlers));\n}\nexport function isRunnableConfigLike(x) {\n // Check that it's an object with a callbacks arg\n // that has either a CallbackManagerLike object with a langchain tracer within it\n // or an array with a LangChainTracerLike object within it\n return (x != null &&\n typeof x.callbacks === \"object\" &&\n // Callback manager with a langchain tracer\n (containsLangChainTracerLike(x.callbacks?.handlers) ||\n // Or it's an array with a LangChainTracerLike object within it\n containsLangChainTracerLike(x.callbacks)));\n}\nfunction _parseDottedOrder(dottedOrder) {\n const parts = dottedOrder.split(\".\");\n return parts.map((part) => {\n const timestampStr = part.slice(0, -36);\n const uuidStr = part.slice(-36);\n // Parse timestamp: \"%Y%m%dT%H%M%S%fZ\" format\n // Example: \"20231215T143045123456Z\"\n const year = parseInt(timestampStr.slice(0, 4));\n const month = parseInt(timestampStr.slice(4, 6)) - 1; // JS months are 0-indexed\n const day = parseInt(timestampStr.slice(6, 8));\n const hour = parseInt(timestampStr.slice(9, 11));\n const minute = parseInt(timestampStr.slice(11, 13));\n const second = parseInt(timestampStr.slice(13, 15));\n const microsecond = parseInt(timestampStr.slice(15, 21));\n const timestamp = new Date(year, month, day, hour, minute, second, microsecond / 1000);\n return [timestamp, uuidStr];\n });\n}\nfunction _getWriteReplicasFromEnv() {\n const envVar = getEnvironmentVariable(\"LANGSMITH_RUNS_ENDPOINTS\");\n if (!envVar)\n return [];\n try {\n const parsed = JSON.parse(envVar);\n if (Array.isArray(parsed)) {\n const replicas = [];\n for (const item of parsed) {\n if (typeof item !== \"object\" || item === null) {\n console.warn(`Invalid item type in LANGSMITH_RUNS_ENDPOINTS: ` +\n `expected object, got ${typeof item}`);\n continue;\n }\n if (typeof item.api_url !== \"string\") {\n console.warn(`Invalid api_url type in LANGSMITH_RUNS_ENDPOINTS: ` +\n `expected string, got ${typeof item.api_url}`);\n continue;\n }\n if (typeof item.api_key !== \"string\") {\n console.warn(`Invalid api_key type in LANGSMITH_RUNS_ENDPOINTS: ` +\n `expected string, got ${typeof item.api_key}`);\n continue;\n }\n replicas.push({\n apiUrl: item.api_url.replace(/\\/$/, \"\"),\n apiKey: item.api_key,\n });\n }\n return replicas;\n }\n else if (typeof parsed === \"object\" && parsed !== null) {\n _checkEndpointEnvUnset(parsed);\n const replicas = [];\n for (const [url, key] of Object.entries(parsed)) {\n const cleanUrl = url.replace(/\\/$/, \"\");\n if (typeof key === \"string\") {\n replicas.push({\n apiUrl: cleanUrl,\n apiKey: key,\n });\n }\n else {\n console.warn(`Invalid value type in LANGSMITH_RUNS_ENDPOINTS for URL ${url}: ` +\n `expected string, got ${typeof key}`);\n continue;\n }\n }\n return replicas;\n }\n else {\n console.warn(\"Invalid LANGSMITH_RUNS_ENDPOINTS – must be valid JSON array of \" +\n `objects with api_url and api_key properties, or object mapping url->apiKey, got ${typeof parsed}`);\n return [];\n }\n }\n catch (e) {\n if (isConflictingEndpointsError(e)) {\n throw e;\n }\n console.warn(\"Invalid LANGSMITH_RUNS_ENDPOINTS – must be valid JSON array of \" +\n \"objects with api_url and api_key properties, or object mapping url->apiKey\");\n return [];\n }\n}\nfunction _ensureWriteReplicas(replicas) {\n // If null -> fetch from env\n if (replicas) {\n return replicas.map((replica) => {\n if (Array.isArray(replica)) {\n return {\n projectName: replica[0],\n updates: replica[1],\n };\n }\n return replica;\n });\n }\n return _getWriteReplicasFromEnv();\n}\nfunction _checkEndpointEnvUnset(parsed) {\n if (Object.keys(parsed).length > 0 &&\n getLangSmithEnvironmentVariable(\"ENDPOINT\")) {\n throw new ConflictingEndpointsError();\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AASA,SAAS,qBAAqB,OAAO;AACjC,QAAO,MAAM,QAAQ,UAAU,GAAG;AACrC;AACD,SAAgB,2BAA2B,OAAO,OAAO,iBAAiB,GAAG;CAGzE,MAAM,cAAc,eAAe,QAAQ,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,SAAS,GAAG,IAAI;CAC1E,MAAM,iCAAiC,GAAG,IAAI,KAAK,OAC9C,aAAa,CACb,MAAM,GAAG,GAAG,GAAG,YAAY,CAAC,CAAC;AAClC,QAAO;EACH,aAAa,qBAAqB,+BAA+B,GAAG;EACpE;CACH;AACJ;;;;AAID,IAAM,UAAN,MAAM,QAAQ;CACV,YAAY,UAAU,MAAM,cAAc,UAAU;EAChD,OAAO,eAAe,MAAM,YAAY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,EAAE,IAAI,uBAAE,EACjD,OAAO,KAAK,CAAC;AACzC;IACH;GACJ;AACD,UAAO;EACV,OACI;GACD,QAAQ,KAAK,CACR,+IAAgF,EAAE,OAAO,QAAQ,CAAC;AACvG,UAAO,CAAE;EACZ;CACJ,SACM,GAAG;AACN,MAAIO,0CAA4B,EAAE,CAC9B,OAAM;EAEV,QAAQ,KAAK,4IACoE;AACjF,SAAO,CAAE;CACZ;AACJ;AACD,SAAS,qBAAqB,UAAU;AAEpC,KAAI,SACA,QAAO,SAAS,IAAI,CAAC,YAAY;AAC7B,MAAI,MAAM,QAAQ,QAAQ,CACtB,QAAO;GACH,aAAa,QAAQ;GACrB,SAAS,QAAQ;EACpB;AAEL,SAAO;CACV,EAAC;AAEN,QAAO,0BAA0B;AACpC;AACD,SAAS,uBAAuB,QAAQ;AACpC,KAAI,OAAO,KAAK,OAAO,CAAC,SAAS,KAC7BC,4CAAgC,WAAW,CAC3C,OAAM,IAAIC;AAEjB"}
@@ -7,7 +7,7 @@ import { _LC_CONTEXT_VARIABLES_KEY } from "./singletons/constants.js";
7
7
  import { getDefaultProjectName } from "./utils/project.js";
8
8
  import * as uuid from "uuid";
9
9
 
10
- //#region ../../node_modules/.pnpm/langsmith@0.3.64_@opentelemetry+api@1.9.0_openai@5.11.0_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js
10
+ //#region ../../node_modules/.pnpm/langsmith@0.3.74_@opentelemetry+api@1.9.0_openai@5.12.2_ws@8.18.3_bufferutil@4.0.9_utf-8-validate@6.0.5__zod@3.25.76_/node_modules/langsmith/dist/run_trees.js
11
11
  function stripNonAlphanumeric(input) {
12
12
  return input.replace(/[-:.]/g, "");
13
13
  }
@@ -426,11 +426,12 @@ var RunTree = class RunTree {
426
426
  async postRun(excludeChildRuns = true) {
427
427
  try {
428
428
  const runtimeEnv = getRuntimeEnvironment();
429
- if (this.replicas && this.replicas.length > 0) for (const { projectName, apiKey, apiUrl } of this.replicas) {
429
+ if (this.replicas && this.replicas.length > 0) for (const { projectName, apiKey, apiUrl, workspaceId } of this.replicas) {
430
430
  const runCreate = this._remapForProject(projectName ?? this.project_name, runtimeEnv, true);
431
431
  await this.client.createRun(runCreate, {
432
432
  apiKey,
433
- apiUrl
433
+ apiUrl,
434
+ workspaceId
434
435
  });
435
436
  }
436
437
  else {
@@ -446,7 +447,7 @@ var RunTree = class RunTree {
446
447
  }
447
448
  }
448
449
  async patchRun(options) {
449
- if (this.replicas && this.replicas.length > 0) for (const { projectName, apiKey, apiUrl, updates } of this.replicas) {
450
+ if (this.replicas && this.replicas.length > 0) for (const { projectName, apiKey, apiUrl, workspaceId, updates } of this.replicas) {
450
451
  const runData = this._remapForProject(projectName ?? this.project_name);
451
452
  const updatePayload = {
452
453
  id: runData.id,
@@ -467,7 +468,8 @@ var RunTree = class RunTree {
467
468
  if (!options?.excludeInputs) updatePayload.inputs = runData.inputs;
468
469
  await this.client.updateRun(runData.id, updatePayload, {
469
470
  apiKey,
470
- apiUrl
471
+ apiUrl,
472
+ workspaceId
471
473
  });
472
474
  }
473
475
  else try {