shield360 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (520) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +310 -0
  3. package/dist/__tests__/manual-trace.test.d.ts +1 -0
  4. package/dist/__tests__/manual-trace.test.js +118 -0
  5. package/dist/__tests__/manual-trace.test.js.map +1 -0
  6. package/dist/__tests__/register.test.d.ts +0 -0
  7. package/dist/__tests__/register.test.js +90 -0
  8. package/dist/__tests__/register.test.js.map +1 -0
  9. package/dist/config.d.ts +28 -0
  10. package/dist/config.js +22 -0
  11. package/dist/config.js.map +1 -0
  12. package/dist/constant.d.ts +6 -0
  13. package/dist/constant.js +14 -0
  14. package/dist/constant.js.map +1 -0
  15. package/dist/evals/__tests__/offline.test.d.ts +1 -0
  16. package/dist/evals/__tests__/offline.test.js +427 -0
  17. package/dist/evals/__tests__/offline.test.js.map +1 -0
  18. package/dist/evals/index.d.ts +2 -0
  19. package/dist/evals/index.js +15 -0
  20. package/dist/evals/index.js.map +1 -0
  21. package/dist/evals/offline.d.ts +6 -0
  22. package/dist/evals/offline.js +350 -0
  23. package/dist/evals/offline.js.map +1 -0
  24. package/dist/evals/types.d.ts +74 -0
  25. package/dist/evals/types.js +23 -0
  26. package/dist/evals/types.js.map +1 -0
  27. package/dist/features/__tests__/rule-engine.test.d.ts +1 -0
  28. package/dist/features/__tests__/rule-engine.test.js +146 -0
  29. package/dist/features/__tests__/rule-engine.test.js.map +1 -0
  30. package/dist/features/base.d.ts +8 -0
  31. package/dist/features/base.js +15 -0
  32. package/dist/features/base.js.map +1 -0
  33. package/dist/features/prompt-hub.d.ts +4 -0
  34. package/dist/features/prompt-hub.js +66 -0
  35. package/dist/features/prompt-hub.js.map +1 -0
  36. package/dist/features/rule-engine.d.ts +6 -0
  37. package/dist/features/rule-engine.js +60 -0
  38. package/dist/features/rule-engine.js.map +1 -0
  39. package/dist/features/vault.d.ts +4 -0
  40. package/dist/features/vault.js +63 -0
  41. package/dist/features/vault.js.map +1 -0
  42. package/dist/guard/__tests__/findings.test.d.ts +1 -0
  43. package/dist/guard/__tests__/findings.test.js +79 -0
  44. package/dist/guard/__tests__/findings.test.js.map +1 -0
  45. package/dist/guard/__tests__/integration.test.d.ts +1 -0
  46. package/dist/guard/__tests__/integration.test.js +215 -0
  47. package/dist/guard/__tests__/integration.test.js.map +1 -0
  48. package/dist/guard/__tests__/pii.test.d.ts +1 -0
  49. package/dist/guard/__tests__/pii.test.js +131 -0
  50. package/dist/guard/__tests__/pii.test.js.map +1 -0
  51. package/dist/guard/__tests__/pipeline.test.d.ts +1 -0
  52. package/dist/guard/__tests__/pipeline.test.js +162 -0
  53. package/dist/guard/__tests__/pipeline.test.js.map +1 -0
  54. package/dist/guard/__tests__/prompt-injection.test.d.ts +1 -0
  55. package/dist/guard/__tests__/prompt-injection.test.js +92 -0
  56. package/dist/guard/__tests__/prompt-injection.test.js.map +1 -0
  57. package/dist/guard/__tests__/report.test.d.ts +1 -0
  58. package/dist/guard/__tests__/report.test.js +50 -0
  59. package/dist/guard/__tests__/report.test.js.map +1 -0
  60. package/dist/guard/base.d.ts +79 -0
  61. package/dist/guard/base.js +136 -0
  62. package/dist/guard/base.js.map +1 -0
  63. package/dist/guard/custom.d.ts +19 -0
  64. package/dist/guard/custom.js +46 -0
  65. package/dist/guard/custom.js.map +1 -0
  66. package/dist/guard/findings.d.ts +31 -0
  67. package/dist/guard/findings.js +156 -0
  68. package/dist/guard/findings.js.map +1 -0
  69. package/dist/guard/index.d.ts +24 -0
  70. package/dist/guard/index.js +42 -0
  71. package/dist/guard/index.js.map +1 -0
  72. package/dist/guard/integration.d.ts +44 -0
  73. package/dist/guard/integration.js +363 -0
  74. package/dist/guard/integration.js.map +1 -0
  75. package/dist/guard/moderation.d.ts +18 -0
  76. package/dist/guard/moderation.js +61 -0
  77. package/dist/guard/moderation.js.map +1 -0
  78. package/dist/guard/pii.d.ts +17 -0
  79. package/dist/guard/pii.js +114 -0
  80. package/dist/guard/pii.js.map +1 -0
  81. package/dist/guard/pipeline.d.ts +26 -0
  82. package/dist/guard/pipeline.js +139 -0
  83. package/dist/guard/pipeline.js.map +1 -0
  84. package/dist/guard/prompt-injection.d.ts +21 -0
  85. package/dist/guard/prompt-injection.js +70 -0
  86. package/dist/guard/prompt-injection.js.map +1 -0
  87. package/dist/guard/report.d.ts +34 -0
  88. package/dist/guard/report.js +182 -0
  89. package/dist/guard/report.js.map +1 -0
  90. package/dist/guard/schema.d.ts +20 -0
  91. package/dist/guard/schema.js +99 -0
  92. package/dist/guard/schema.js.map +1 -0
  93. package/dist/guard/sensitive-topic.d.ts +23 -0
  94. package/dist/guard/sensitive-topic.js +89 -0
  95. package/dist/guard/sensitive-topic.js.map +1 -0
  96. package/dist/guard/topic-restriction.d.ts +22 -0
  97. package/dist/guard/topic-restriction.js +54 -0
  98. package/dist/guard/topic-restriction.js.map +1 -0
  99. package/dist/helpers.d.ts +246 -0
  100. package/dist/helpers.js +903 -0
  101. package/dist/helpers.js.map +1 -0
  102. package/dist/index.d.ts +71 -0
  103. package/dist/index.js +234 -0
  104. package/dist/index.js.map +1 -0
  105. package/dist/instrumentation/__tests__/ai21-rag-trace-comparison.test.d.ts +13 -0
  106. package/dist/instrumentation/__tests__/ai21-rag-trace-comparison.test.js +176 -0
  107. package/dist/instrumentation/__tests__/ai21-rag-trace-comparison.test.js.map +1 -0
  108. package/dist/instrumentation/__tests__/ai21-trace-comparison.test.d.ts +10 -0
  109. package/dist/instrumentation/__tests__/ai21-trace-comparison.test.js +203 -0
  110. package/dist/instrumentation/__tests__/ai21-trace-comparison.test.js.map +1 -0
  111. package/dist/instrumentation/__tests__/anthropic-wrapper.test.d.ts +1 -0
  112. package/dist/instrumentation/__tests__/anthropic-wrapper.test.js +284 -0
  113. package/dist/instrumentation/__tests__/anthropic-wrapper.test.js.map +1 -0
  114. package/dist/instrumentation/__tests__/assemblyai-wrapper.test.d.ts +1 -0
  115. package/dist/instrumentation/__tests__/assemblyai-wrapper.test.js +284 -0
  116. package/dist/instrumentation/__tests__/assemblyai-wrapper.test.js.map +1 -0
  117. package/dist/instrumentation/__tests__/astra-trace-comparison.test.d.ts +7 -0
  118. package/dist/instrumentation/__tests__/astra-trace-comparison.test.js +160 -0
  119. package/dist/instrumentation/__tests__/astra-trace-comparison.test.js.map +1 -0
  120. package/dist/instrumentation/__tests__/base-wrapper.test.d.ts +1 -0
  121. package/dist/instrumentation/__tests__/base-wrapper.test.js +171 -0
  122. package/dist/instrumentation/__tests__/base-wrapper.test.js.map +1 -0
  123. package/dist/instrumentation/__tests__/bedrock-trace-comparison.test.d.ts +1 -0
  124. package/dist/instrumentation/__tests__/bedrock-trace-comparison.test.js +422 -0
  125. package/dist/instrumentation/__tests__/bedrock-trace-comparison.test.js.map +1 -0
  126. package/dist/instrumentation/__tests__/browser-use-wrapper.test.d.ts +1 -0
  127. package/dist/instrumentation/__tests__/browser-use-wrapper.test.js +284 -0
  128. package/dist/instrumentation/__tests__/browser-use-wrapper.test.js.map +1 -0
  129. package/dist/instrumentation/__tests__/cache-pricing.test.d.ts +15 -0
  130. package/dist/instrumentation/__tests__/cache-pricing.test.js +155 -0
  131. package/dist/instrumentation/__tests__/cache-pricing.test.js.map +1 -0
  132. package/dist/instrumentation/__tests__/chroma-trace-comparison.test.d.ts +18 -0
  133. package/dist/instrumentation/__tests__/chroma-trace-comparison.test.js +209 -0
  134. package/dist/instrumentation/__tests__/chroma-trace-comparison.test.js.map +1 -0
  135. package/dist/instrumentation/__tests__/cohere-wrapper.test.d.ts +1 -0
  136. package/dist/instrumentation/__tests__/cohere-wrapper.test.js +256 -0
  137. package/dist/instrumentation/__tests__/cohere-wrapper.test.js.map +1 -0
  138. package/dist/instrumentation/__tests__/elevenlabs-wrapper.test.d.ts +1 -0
  139. package/dist/instrumentation/__tests__/elevenlabs-wrapper.test.js +282 -0
  140. package/dist/instrumentation/__tests__/elevenlabs-wrapper.test.js.map +1 -0
  141. package/dist/instrumentation/__tests__/firecrawl-wrapper.test.d.ts +1 -0
  142. package/dist/instrumentation/__tests__/firecrawl-wrapper.test.js +238 -0
  143. package/dist/instrumentation/__tests__/firecrawl-wrapper.test.js.map +1 -0
  144. package/dist/instrumentation/__tests__/google-ai-trace-comparison.test.d.ts +4 -0
  145. package/dist/instrumentation/__tests__/google-ai-trace-comparison.test.js +229 -0
  146. package/dist/instrumentation/__tests__/google-ai-trace-comparison.test.js.map +1 -0
  147. package/dist/instrumentation/__tests__/gpu-collector.test.d.ts +1 -0
  148. package/dist/instrumentation/__tests__/gpu-collector.test.js +247 -0
  149. package/dist/instrumentation/__tests__/gpu-collector.test.js.map +1 -0
  150. package/dist/instrumentation/__tests__/gradient-trace-comparison.test.d.ts +11 -0
  151. package/dist/instrumentation/__tests__/gradient-trace-comparison.test.js +391 -0
  152. package/dist/instrumentation/__tests__/gradient-trace-comparison.test.js.map +1 -0
  153. package/dist/instrumentation/__tests__/groq-trace-comparison.test.d.ts +7 -0
  154. package/dist/instrumentation/__tests__/groq-trace-comparison.test.js +687 -0
  155. package/dist/instrumentation/__tests__/groq-trace-comparison.test.js.map +1 -0
  156. package/dist/instrumentation/__tests__/helpers-genai.test.d.ts +14 -0
  157. package/dist/instrumentation/__tests__/helpers-genai.test.js +347 -0
  158. package/dist/instrumentation/__tests__/helpers-genai.test.js.map +1 -0
  159. package/dist/instrumentation/__tests__/huggingface-trace-comparison.test.d.ts +7 -0
  160. package/dist/instrumentation/__tests__/huggingface-trace-comparison.test.js +529 -0
  161. package/dist/instrumentation/__tests__/huggingface-trace-comparison.test.js.map +1 -0
  162. package/dist/instrumentation/__tests__/langchain-role-map.test.d.ts +1 -0
  163. package/dist/instrumentation/__tests__/langchain-role-map.test.js +19 -0
  164. package/dist/instrumentation/__tests__/langchain-role-map.test.js.map +1 -0
  165. package/dist/instrumentation/__tests__/langchain-wrapper.test.d.ts +1 -0
  166. package/dist/instrumentation/__tests__/langchain-wrapper.test.js +282 -0
  167. package/dist/instrumentation/__tests__/langchain-wrapper.test.js.map +1 -0
  168. package/dist/instrumentation/__tests__/letta-wrapper.test.d.ts +1 -0
  169. package/dist/instrumentation/__tests__/letta-wrapper.test.js +285 -0
  170. package/dist/instrumentation/__tests__/letta-wrapper.test.js.map +1 -0
  171. package/dist/instrumentation/__tests__/mem0-trace-comparison.test.d.ts +13 -0
  172. package/dist/instrumentation/__tests__/mem0-trace-comparison.test.js +208 -0
  173. package/dist/instrumentation/__tests__/mem0-trace-comparison.test.js.map +1 -0
  174. package/dist/instrumentation/__tests__/milvus-trace-comparison.test.d.ts +17 -0
  175. package/dist/instrumentation/__tests__/milvus-trace-comparison.test.js +206 -0
  176. package/dist/instrumentation/__tests__/milvus-trace-comparison.test.js.map +1 -0
  177. package/dist/instrumentation/__tests__/mistral-trace-comparison.test.d.ts +1 -0
  178. package/dist/instrumentation/__tests__/mistral-trace-comparison.test.js +345 -0
  179. package/dist/instrumentation/__tests__/mistral-trace-comparison.test.js.map +1 -0
  180. package/dist/instrumentation/__tests__/openai-wrapper.test.d.ts +1 -0
  181. package/dist/instrumentation/__tests__/openai-wrapper.test.js +179 -0
  182. package/dist/instrumentation/__tests__/openai-wrapper.test.js.map +1 -0
  183. package/dist/instrumentation/__tests__/pg-trace-comparison.test.d.ts +21 -0
  184. package/dist/instrumentation/__tests__/pg-trace-comparison.test.js +455 -0
  185. package/dist/instrumentation/__tests__/pg-trace-comparison.test.js.map +1 -0
  186. package/dist/instrumentation/__tests__/qdrant-trace-comparison.test.d.ts +17 -0
  187. package/dist/instrumentation/__tests__/qdrant-trace-comparison.test.js +182 -0
  188. package/dist/instrumentation/__tests__/qdrant-trace-comparison.test.js.map +1 -0
  189. package/dist/instrumentation/__tests__/replicate-trace-comparison.test.d.ts +8 -0
  190. package/dist/instrumentation/__tests__/replicate-trace-comparison.test.js +346 -0
  191. package/dist/instrumentation/__tests__/replicate-trace-comparison.test.js.map +1 -0
  192. package/dist/instrumentation/__tests__/together-trace-comparison.test.d.ts +4 -0
  193. package/dist/instrumentation/__tests__/together-trace-comparison.test.js +289 -0
  194. package/dist/instrumentation/__tests__/together-trace-comparison.test.js.map +1 -0
  195. package/dist/instrumentation/__tests__/trace-comparison-utils.d.ts +67 -0
  196. package/dist/instrumentation/__tests__/trace-comparison-utils.js +255 -0
  197. package/dist/instrumentation/__tests__/trace-comparison-utils.js.map +1 -0
  198. package/dist/instrumentation/__tests__/transformers-trace-comparison.test.d.ts +11 -0
  199. package/dist/instrumentation/__tests__/transformers-trace-comparison.test.js +214 -0
  200. package/dist/instrumentation/__tests__/transformers-trace-comparison.test.js.map +1 -0
  201. package/dist/instrumentation/__tests__/vercel-ai-trace-comparison.test.d.ts +8 -0
  202. package/dist/instrumentation/__tests__/vercel-ai-trace-comparison.test.js +446 -0
  203. package/dist/instrumentation/__tests__/vercel-ai-trace-comparison.test.js.map +1 -0
  204. package/dist/instrumentation/__tests__/vertexai-trace-comparison.test.d.ts +6 -0
  205. package/dist/instrumentation/__tests__/vertexai-trace-comparison.test.js +409 -0
  206. package/dist/instrumentation/__tests__/vertexai-trace-comparison.test.js.map +1 -0
  207. package/dist/instrumentation/__tests__/vllm-trace-comparison.test.d.ts +1 -0
  208. package/dist/instrumentation/__tests__/vllm-trace-comparison.test.js +519 -0
  209. package/dist/instrumentation/__tests__/vllm-trace-comparison.test.js.map +1 -0
  210. package/dist/instrumentation/ai21/index.d.ts +11 -0
  211. package/dist/instrumentation/ai21/index.js +67 -0
  212. package/dist/instrumentation/ai21/index.js.map +1 -0
  213. package/dist/instrumentation/ai21/wrapper.d.ts +54 -0
  214. package/dist/instrumentation/ai21/wrapper.js +511 -0
  215. package/dist/instrumentation/ai21/wrapper.js.map +1 -0
  216. package/dist/instrumentation/anthropic/index.d.ts +11 -0
  217. package/dist/instrumentation/anthropic/index.js +45 -0
  218. package/dist/instrumentation/anthropic/index.js.map +1 -0
  219. package/dist/instrumentation/anthropic/wrapper.d.ts +34 -0
  220. package/dist/instrumentation/anthropic/wrapper.js +426 -0
  221. package/dist/instrumentation/anthropic/wrapper.js.map +1 -0
  222. package/dist/instrumentation/assemblyai/index.d.ts +12 -0
  223. package/dist/instrumentation/assemblyai/index.js +91 -0
  224. package/dist/instrumentation/assemblyai/index.js.map +1 -0
  225. package/dist/instrumentation/assemblyai/wrapper.d.ts +35 -0
  226. package/dist/instrumentation/assemblyai/wrapper.js +238 -0
  227. package/dist/instrumentation/assemblyai/wrapper.js.map +1 -0
  228. package/dist/instrumentation/astra/index.d.ts +11 -0
  229. package/dist/instrumentation/astra/index.js +87 -0
  230. package/dist/instrumentation/astra/index.js.map +1 -0
  231. package/dist/instrumentation/astra/wrapper.d.ts +39 -0
  232. package/dist/instrumentation/astra/wrapper.js +349 -0
  233. package/dist/instrumentation/astra/wrapper.js.map +1 -0
  234. package/dist/instrumentation/azure-ai-inference/index.d.ts +11 -0
  235. package/dist/instrumentation/azure-ai-inference/index.js +76 -0
  236. package/dist/instrumentation/azure-ai-inference/index.js.map +1 -0
  237. package/dist/instrumentation/azure-ai-inference/wrapper.d.ts +55 -0
  238. package/dist/instrumentation/azure-ai-inference/wrapper.js +580 -0
  239. package/dist/instrumentation/azure-ai-inference/wrapper.js.map +1 -0
  240. package/dist/instrumentation/base-wrapper.d.ts +16 -0
  241. package/dist/instrumentation/base-wrapper.js +139 -0
  242. package/dist/instrumentation/base-wrapper.js.map +1 -0
  243. package/dist/instrumentation/bedrock/index.d.ts +11 -0
  244. package/dist/instrumentation/bedrock/index.js +52 -0
  245. package/dist/instrumentation/bedrock/index.js.map +1 -0
  246. package/dist/instrumentation/bedrock/wrapper.d.ts +41 -0
  247. package/dist/instrumentation/bedrock/wrapper.js +494 -0
  248. package/dist/instrumentation/bedrock/wrapper.js.map +1 -0
  249. package/dist/instrumentation/browser-use/index.d.ts +11 -0
  250. package/dist/instrumentation/browser-use/index.js +98 -0
  251. package/dist/instrumentation/browser-use/index.js.map +1 -0
  252. package/dist/instrumentation/browser-use/wrapper.d.ts +12 -0
  253. package/dist/instrumentation/browser-use/wrapper.js +706 -0
  254. package/dist/instrumentation/browser-use/wrapper.js.map +1 -0
  255. package/dist/instrumentation/chroma/index.d.ts +11 -0
  256. package/dist/instrumentation/chroma/index.js +70 -0
  257. package/dist/instrumentation/chroma/index.js.map +1 -0
  258. package/dist/instrumentation/chroma/wrapper.d.ts +10 -0
  259. package/dist/instrumentation/chroma/wrapper.js +127 -0
  260. package/dist/instrumentation/chroma/wrapper.js.map +1 -0
  261. package/dist/instrumentation/claude-agent-sdk/index.d.ts +23 -0
  262. package/dist/instrumentation/claude-agent-sdk/index.js +83 -0
  263. package/dist/instrumentation/claude-agent-sdk/index.js.map +1 -0
  264. package/dist/instrumentation/claude-agent-sdk/wrapper.d.ts +13 -0
  265. package/dist/instrumentation/claude-agent-sdk/wrapper.js +1123 -0
  266. package/dist/instrumentation/claude-agent-sdk/wrapper.js.map +1 -0
  267. package/dist/instrumentation/cohere/index.d.ts +11 -0
  268. package/dist/instrumentation/cohere/index.js +53 -0
  269. package/dist/instrumentation/cohere/index.js.map +1 -0
  270. package/dist/instrumentation/cohere/wrapper.d.ts +50 -0
  271. package/dist/instrumentation/cohere/wrapper.js +452 -0
  272. package/dist/instrumentation/cohere/wrapper.js.map +1 -0
  273. package/dist/instrumentation/cursor-sdk/index.d.ts +21 -0
  274. package/dist/instrumentation/cursor-sdk/index.js +58 -0
  275. package/dist/instrumentation/cursor-sdk/index.js.map +1 -0
  276. package/dist/instrumentation/cursor-sdk/wrapper.d.ts +17 -0
  277. package/dist/instrumentation/cursor-sdk/wrapper.js +789 -0
  278. package/dist/instrumentation/cursor-sdk/wrapper.js.map +1 -0
  279. package/dist/instrumentation/elevenlabs/index.d.ts +12 -0
  280. package/dist/instrumentation/elevenlabs/index.js +92 -0
  281. package/dist/instrumentation/elevenlabs/index.js.map +1 -0
  282. package/dist/instrumentation/elevenlabs/wrapper.d.ts +34 -0
  283. package/dist/instrumentation/elevenlabs/wrapper.js +280 -0
  284. package/dist/instrumentation/elevenlabs/wrapper.js.map +1 -0
  285. package/dist/instrumentation/firecrawl/index.d.ts +13 -0
  286. package/dist/instrumentation/firecrawl/index.js +115 -0
  287. package/dist/instrumentation/firecrawl/index.js.map +1 -0
  288. package/dist/instrumentation/firecrawl/wrapper.d.ts +22 -0
  289. package/dist/instrumentation/firecrawl/wrapper.js +378 -0
  290. package/dist/instrumentation/firecrawl/wrapper.js.map +1 -0
  291. package/dist/instrumentation/google-adk/index.d.ts +57 -0
  292. package/dist/instrumentation/google-adk/index.js +371 -0
  293. package/dist/instrumentation/google-adk/index.js.map +1 -0
  294. package/dist/instrumentation/google-adk/utils.d.ts +45 -0
  295. package/dist/instrumentation/google-adk/utils.js +663 -0
  296. package/dist/instrumentation/google-adk/utils.js.map +1 -0
  297. package/dist/instrumentation/google-adk/wrapper.d.ts +11 -0
  298. package/dist/instrumentation/google-adk/wrapper.js +391 -0
  299. package/dist/instrumentation/google-adk/wrapper.js.map +1 -0
  300. package/dist/instrumentation/google-ai/index.d.ts +11 -0
  301. package/dist/instrumentation/google-ai/index.js +48 -0
  302. package/dist/instrumentation/google-ai/index.js.map +1 -0
  303. package/dist/instrumentation/google-ai/wrapper.d.ts +52 -0
  304. package/dist/instrumentation/google-ai/wrapper.js +466 -0
  305. package/dist/instrumentation/google-ai/wrapper.js.map +1 -0
  306. package/dist/instrumentation/gpu/index.d.ts +38 -0
  307. package/dist/instrumentation/gpu/index.js +233 -0
  308. package/dist/instrumentation/gpu/index.js.map +1 -0
  309. package/dist/instrumentation/gradient/index.d.ts +12 -0
  310. package/dist/instrumentation/gradient/index.js +74 -0
  311. package/dist/instrumentation/gradient/index.js.map +1 -0
  312. package/dist/instrumentation/gradient/utils.d.ts +14 -0
  313. package/dist/instrumentation/gradient/utils.js +119 -0
  314. package/dist/instrumentation/gradient/utils.js.map +1 -0
  315. package/dist/instrumentation/gradient/wrapper.d.ts +76 -0
  316. package/dist/instrumentation/gradient/wrapper.js +584 -0
  317. package/dist/instrumentation/gradient/wrapper.js.map +1 -0
  318. package/dist/instrumentation/groq/index.d.ts +11 -0
  319. package/dist/instrumentation/groq/index.js +43 -0
  320. package/dist/instrumentation/groq/index.js.map +1 -0
  321. package/dist/instrumentation/groq/wrapper.d.ts +35 -0
  322. package/dist/instrumentation/groq/wrapper.js +442 -0
  323. package/dist/instrumentation/groq/wrapper.js.map +1 -0
  324. package/dist/instrumentation/huggingface/index.d.ts +13 -0
  325. package/dist/instrumentation/huggingface/index.js +110 -0
  326. package/dist/instrumentation/huggingface/index.js.map +1 -0
  327. package/dist/instrumentation/huggingface/wrapper.d.ts +54 -0
  328. package/dist/instrumentation/huggingface/wrapper.js +514 -0
  329. package/dist/instrumentation/huggingface/wrapper.js.map +1 -0
  330. package/dist/instrumentation/index.d.ts +7 -0
  331. package/dist/instrumentation/index.js +176 -0
  332. package/dist/instrumentation/index.js.map +1 -0
  333. package/dist/instrumentation/langchain/index.d.ts +16 -0
  334. package/dist/instrumentation/langchain/index.js +91 -0
  335. package/dist/instrumentation/langchain/index.js.map +1 -0
  336. package/dist/instrumentation/langchain/wrapper.d.ts +41 -0
  337. package/dist/instrumentation/langchain/wrapper.js +1235 -0
  338. package/dist/instrumentation/langchain/wrapper.js.map +1 -0
  339. package/dist/instrumentation/langgraph/index.d.ts +12 -0
  340. package/dist/instrumentation/langgraph/index.js +99 -0
  341. package/dist/instrumentation/langgraph/index.js.map +1 -0
  342. package/dist/instrumentation/langgraph/wrapper.d.ts +20 -0
  343. package/dist/instrumentation/langgraph/wrapper.js +620 -0
  344. package/dist/instrumentation/langgraph/wrapper.js.map +1 -0
  345. package/dist/instrumentation/letta/index.d.ts +10 -0
  346. package/dist/instrumentation/letta/index.js +122 -0
  347. package/dist/instrumentation/letta/index.js.map +1 -0
  348. package/dist/instrumentation/letta/utils.d.ts +24 -0
  349. package/dist/instrumentation/letta/utils.js +343 -0
  350. package/dist/instrumentation/letta/utils.js.map +1 -0
  351. package/dist/instrumentation/letta/wrapper.d.ts +37 -0
  352. package/dist/instrumentation/letta/wrapper.js +180 -0
  353. package/dist/instrumentation/letta/wrapper.js.map +1 -0
  354. package/dist/instrumentation/llamaindex/index.d.ts +36 -0
  355. package/dist/instrumentation/llamaindex/index.js +221 -0
  356. package/dist/instrumentation/llamaindex/index.js.map +1 -0
  357. package/dist/instrumentation/llamaindex/wrapper.d.ts +36 -0
  358. package/dist/instrumentation/llamaindex/wrapper.js +811 -0
  359. package/dist/instrumentation/llamaindex/wrapper.js.map +1 -0
  360. package/dist/instrumentation/mcp/index.d.ts +20 -0
  361. package/dist/instrumentation/mcp/index.js +282 -0
  362. package/dist/instrumentation/mcp/index.js.map +1 -0
  363. package/dist/instrumentation/mcp/wrapper.d.ts +72 -0
  364. package/dist/instrumentation/mcp/wrapper.js +571 -0
  365. package/dist/instrumentation/mcp/wrapper.js.map +1 -0
  366. package/dist/instrumentation/mem0/index.d.ts +17 -0
  367. package/dist/instrumentation/mem0/index.js +113 -0
  368. package/dist/instrumentation/mem0/index.js.map +1 -0
  369. package/dist/instrumentation/mem0/wrapper.d.ts +37 -0
  370. package/dist/instrumentation/mem0/wrapper.js +298 -0
  371. package/dist/instrumentation/mem0/wrapper.js.map +1 -0
  372. package/dist/instrumentation/milvus/index.d.ts +11 -0
  373. package/dist/instrumentation/milvus/index.js +67 -0
  374. package/dist/instrumentation/milvus/index.js.map +1 -0
  375. package/dist/instrumentation/milvus/wrapper.d.ts +15 -0
  376. package/dist/instrumentation/milvus/wrapper.js +219 -0
  377. package/dist/instrumentation/milvus/wrapper.js.map +1 -0
  378. package/dist/instrumentation/mistral/index.d.ts +11 -0
  379. package/dist/instrumentation/mistral/index.js +66 -0
  380. package/dist/instrumentation/mistral/index.js.map +1 -0
  381. package/dist/instrumentation/mistral/wrapper.d.ts +49 -0
  382. package/dist/instrumentation/mistral/wrapper.js +482 -0
  383. package/dist/instrumentation/mistral/wrapper.js.map +1 -0
  384. package/dist/instrumentation/ollama/index.d.ts +11 -0
  385. package/dist/instrumentation/ollama/index.js +72 -0
  386. package/dist/instrumentation/ollama/index.js.map +1 -0
  387. package/dist/instrumentation/ollama/wrapper.d.ts +73 -0
  388. package/dist/instrumentation/ollama/wrapper.js +629 -0
  389. package/dist/instrumentation/ollama/wrapper.js.map +1 -0
  390. package/dist/instrumentation/openai/index.d.ts +11 -0
  391. package/dist/instrumentation/openai/index.js +79 -0
  392. package/dist/instrumentation/openai/index.js.map +1 -0
  393. package/dist/instrumentation/openai/wrapper.d.ts +80 -0
  394. package/dist/instrumentation/openai/wrapper.js +1121 -0
  395. package/dist/instrumentation/openai/wrapper.js.map +1 -0
  396. package/dist/instrumentation/openai-agents/index.d.ts +20 -0
  397. package/dist/instrumentation/openai-agents/index.js +174 -0
  398. package/dist/instrumentation/openai-agents/index.js.map +1 -0
  399. package/dist/instrumentation/openai-agents/processor.d.ts +35 -0
  400. package/dist/instrumentation/openai-agents/processor.js +249 -0
  401. package/dist/instrumentation/openai-agents/processor.js.map +1 -0
  402. package/dist/instrumentation/openai-agents/utils.d.ts +20 -0
  403. package/dist/instrumentation/openai-agents/utils.js +624 -0
  404. package/dist/instrumentation/openai-agents/utils.js.map +1 -0
  405. package/dist/instrumentation/pg/index.d.ts +20 -0
  406. package/dist/instrumentation/pg/index.js +74 -0
  407. package/dist/instrumentation/pg/index.js.map +1 -0
  408. package/dist/instrumentation/pg/wrapper.d.ts +66 -0
  409. package/dist/instrumentation/pg/wrapper.js +441 -0
  410. package/dist/instrumentation/pg/wrapper.js.map +1 -0
  411. package/dist/instrumentation/pinecone/index.d.ts +11 -0
  412. package/dist/instrumentation/pinecone/index.js +79 -0
  413. package/dist/instrumentation/pinecone/index.js.map +1 -0
  414. package/dist/instrumentation/pinecone/wrapper.d.ts +14 -0
  415. package/dist/instrumentation/pinecone/wrapper.js +198 -0
  416. package/dist/instrumentation/pinecone/wrapper.js.map +1 -0
  417. package/dist/instrumentation/qdrant/index.d.ts +11 -0
  418. package/dist/instrumentation/qdrant/index.js +67 -0
  419. package/dist/instrumentation/qdrant/index.js.map +1 -0
  420. package/dist/instrumentation/qdrant/wrapper.d.ts +14 -0
  421. package/dist/instrumentation/qdrant/wrapper.js +213 -0
  422. package/dist/instrumentation/qdrant/wrapper.js.map +1 -0
  423. package/dist/instrumentation/replicate/index.d.ts +11 -0
  424. package/dist/instrumentation/replicate/index.js +57 -0
  425. package/dist/instrumentation/replicate/index.js.map +1 -0
  426. package/dist/instrumentation/replicate/wrapper.d.ts +28 -0
  427. package/dist/instrumentation/replicate/wrapper.js +242 -0
  428. package/dist/instrumentation/replicate/wrapper.js.map +1 -0
  429. package/dist/instrumentation/strands/index.d.ts +21 -0
  430. package/dist/instrumentation/strands/index.js +83 -0
  431. package/dist/instrumentation/strands/index.js.map +1 -0
  432. package/dist/instrumentation/strands/processor.d.ts +51 -0
  433. package/dist/instrumentation/strands/processor.js +625 -0
  434. package/dist/instrumentation/strands/processor.js.map +1 -0
  435. package/dist/instrumentation/strands/utils.d.ts +24 -0
  436. package/dist/instrumentation/strands/utils.js +373 -0
  437. package/dist/instrumentation/strands/utils.js.map +1 -0
  438. package/dist/instrumentation/together/index.d.ts +11 -0
  439. package/dist/instrumentation/together/index.js +43 -0
  440. package/dist/instrumentation/together/index.js.map +1 -0
  441. package/dist/instrumentation/together/wrapper.d.ts +48 -0
  442. package/dist/instrumentation/together/wrapper.js +409 -0
  443. package/dist/instrumentation/together/wrapper.js.map +1 -0
  444. package/dist/instrumentation/transformers/index.d.ts +35 -0
  445. package/dist/instrumentation/transformers/index.js +119 -0
  446. package/dist/instrumentation/transformers/index.js.map +1 -0
  447. package/dist/instrumentation/transformers/wrapper.d.ts +49 -0
  448. package/dist/instrumentation/transformers/wrapper.js +472 -0
  449. package/dist/instrumentation/transformers/wrapper.js.map +1 -0
  450. package/dist/instrumentation/vercel-ai/index.d.ts +10 -0
  451. package/dist/instrumentation/vercel-ai/index.js +59 -0
  452. package/dist/instrumentation/vercel-ai/index.js.map +1 -0
  453. package/dist/instrumentation/vercel-ai/wrapper.d.ts +50 -0
  454. package/dist/instrumentation/vercel-ai/wrapper.js +539 -0
  455. package/dist/instrumentation/vercel-ai/wrapper.js.map +1 -0
  456. package/dist/instrumentation/vertexai/index.d.ts +11 -0
  457. package/dist/instrumentation/vertexai/index.js +70 -0
  458. package/dist/instrumentation/vertexai/index.js.map +1 -0
  459. package/dist/instrumentation/vertexai/wrapper.d.ts +67 -0
  460. package/dist/instrumentation/vertexai/wrapper.js +530 -0
  461. package/dist/instrumentation/vertexai/wrapper.js.map +1 -0
  462. package/dist/instrumentation/vllm/index.d.ts +13 -0
  463. package/dist/instrumentation/vllm/index.js +67 -0
  464. package/dist/instrumentation/vllm/index.js.map +1 -0
  465. package/dist/instrumentation/vllm/wrapper.d.ts +60 -0
  466. package/dist/instrumentation/vllm/wrapper.js +482 -0
  467. package/dist/instrumentation/vllm/wrapper.js.map +1 -0
  468. package/dist/llm/anthropic.d.ts +5 -0
  469. package/dist/llm/anthropic.js +39 -0
  470. package/dist/llm/anthropic.js.map +1 -0
  471. package/dist/llm/index.d.ts +10 -0
  472. package/dist/llm/index.js +93 -0
  473. package/dist/llm/index.js.map +1 -0
  474. package/dist/llm/openai.d.ts +6 -0
  475. package/dist/llm/openai.js +52 -0
  476. package/dist/llm/openai.js.map +1 -0
  477. package/dist/llm/providers.d.ts +7 -0
  478. package/dist/llm/providers.js +10 -0
  479. package/dist/llm/providers.js.map +1 -0
  480. package/dist/manual-trace.d.ts +40 -0
  481. package/dist/manual-trace.js +103 -0
  482. package/dist/manual-trace.js.map +1 -0
  483. package/dist/otel/__tests__/metrics.test.d.ts +1 -0
  484. package/dist/otel/__tests__/metrics.test.js +40 -0
  485. package/dist/otel/__tests__/metrics.test.js.map +1 -0
  486. package/dist/otel/events.d.ts +11 -0
  487. package/dist/otel/events.js +74 -0
  488. package/dist/otel/events.js.map +1 -0
  489. package/dist/otel/metrics.d.ts +35 -0
  490. package/dist/otel/metrics.js +219 -0
  491. package/dist/otel/metrics.js.map +1 -0
  492. package/dist/otel/tracing.d.ts +12 -0
  493. package/dist/otel/tracing.js +93 -0
  494. package/dist/otel/tracing.js.map +1 -0
  495. package/dist/otel/utils.d.ts +11 -0
  496. package/dist/otel/utils.js +34 -0
  497. package/dist/otel/utils.js.map +1 -0
  498. package/dist/pricing.json +951 -0
  499. package/dist/prompt-hub.d.ts +4 -0
  500. package/dist/prompt-hub.js +66 -0
  501. package/dist/prompt-hub.js.map +1 -0
  502. package/dist/register.d.ts +4 -0
  503. package/dist/register.js +52 -0
  504. package/dist/register.js.map +1 -0
  505. package/dist/score/__tests__/score.test.d.ts +1 -0
  506. package/dist/score/__tests__/score.test.js +143 -0
  507. package/dist/score/__tests__/score.test.js.map +1 -0
  508. package/dist/score/index.d.ts +2 -0
  509. package/dist/score/index.js +6 -0
  510. package/dist/score/index.js.map +1 -0
  511. package/dist/score/score.d.ts +15 -0
  512. package/dist/score/score.js +135 -0
  513. package/dist/score/score.js.map +1 -0
  514. package/dist/semantic-convention.d.ts +555 -0
  515. package/dist/semantic-convention.js +630 -0
  516. package/dist/semantic-convention.js.map +1 -0
  517. package/dist/types.d.ts +131 -0
  518. package/dist/types.js +3 -0
  519. package/dist/types.js.map +1 -0
  520. package/package.json +136 -0
@@ -0,0 +1,620 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ const api_1 = require("@opentelemetry/api");
40
+ const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
41
+ const semantic_convention_1 = __importDefault(require("../../semantic-convention"));
42
+ const config_1 = __importDefault(require("../../config"));
43
+ const helpers_1 = __importStar(require("../../helpers"));
44
+ const constant_1 = require("../../constant");
45
+ // ---------------------------------------------------------------------------
46
+ // Helpers
47
+ // ---------------------------------------------------------------------------
48
+ function getGraphName(instance) {
49
+ if (!instance)
50
+ return 'graph';
51
+ const name = instance.name;
52
+ if (name)
53
+ return String(name);
54
+ const graphId = instance.graph_id ?? instance.graphId;
55
+ if (graphId)
56
+ return String(graphId);
57
+ const className = instance.constructor?.name;
58
+ if (className && !['Pregel', 'CompiledStateGraph', 'StateGraph'].includes(className)) {
59
+ return className;
60
+ }
61
+ return 'graph';
62
+ }
63
+ function extractConfigInfo(config) {
64
+ const info = {};
65
+ if (!config || typeof config !== 'object')
66
+ return info;
67
+ try {
68
+ const configurable = config.configurable;
69
+ if (configurable && typeof configurable === 'object') {
70
+ if (configurable.thread_id != null)
71
+ info.threadId = String(configurable.thread_id);
72
+ if (configurable.checkpoint_id != null)
73
+ info.checkpointId = String(configurable.checkpoint_id);
74
+ }
75
+ }
76
+ catch { /* ignore */ }
77
+ return info;
78
+ }
79
+ function isToolNode(nodeName, action) {
80
+ const typeName = action?.constructor?.name || '';
81
+ if (typeName.includes('ToolNode'))
82
+ return true;
83
+ if (action?.func && (action.func.constructor?.name || '').includes('ToolNode'))
84
+ return true;
85
+ const lower = nodeName.toLowerCase();
86
+ if (lower.includes('tool') && !lower.includes('agent'))
87
+ return true;
88
+ return false;
89
+ }
90
+ function setCommonSpanAttributes(span, operationType) {
91
+ span.setAttribute(semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME, constant_1.SDK_NAME);
92
+ span.setAttribute(semantic_convention_1.default.ATTR_DEPLOYMENT_ENVIRONMENT, config_1.default.environment || 'default');
93
+ span.setAttribute(semantic_conventions_1.ATTR_SERVICE_NAME, config_1.default.applicationName || 'default');
94
+ span.setAttribute(semantic_convention_1.default.GEN_AI_SDK_VERSION, constant_1.SDK_VERSION);
95
+ span.setAttribute(semantic_convention_1.default.GEN_AI_OPERATION, operationType);
96
+ span.setAttribute(semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL, semantic_convention_1.default.GEN_AI_SYSTEM_LANGGRAPH);
97
+ }
98
+ function extractGraphStructure(instance) {
99
+ const nodes = [];
100
+ const edges = [];
101
+ try {
102
+ if (instance.nodes) {
103
+ const n = instance.nodes;
104
+ if (typeof n.keys === 'function') {
105
+ for (const k of n.keys())
106
+ nodes.push(String(k));
107
+ }
108
+ else if (typeof n === 'object') {
109
+ for (const k of Object.keys(n))
110
+ nodes.push(k);
111
+ }
112
+ }
113
+ if (instance.edges) {
114
+ const edgeSet = instance.edges;
115
+ if (edgeSet instanceof Set || Array.isArray(edgeSet)) {
116
+ for (const edge of edgeSet) {
117
+ if (Array.isArray(edge) && edge.length >= 2) {
118
+ edges.push(`${edge[0]}->${edge[1]}`);
119
+ }
120
+ }
121
+ }
122
+ else if (typeof edgeSet === 'object') {
123
+ for (const [source, targets] of Object.entries(edgeSet)) {
124
+ if (typeof targets === 'object' && targets !== null) {
125
+ if (Array.isArray(targets)) {
126
+ for (const t of targets)
127
+ edges.push(`${source}->${t}`);
128
+ }
129
+ else if (targets instanceof Set) {
130
+ for (const t of targets)
131
+ edges.push(`${source}->${t}`);
132
+ }
133
+ else {
134
+ for (const t of Object.values(targets))
135
+ edges.push(`${source}->${t}`);
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
142
+ catch { /* ignore */ }
143
+ return { nodes, edges };
144
+ }
145
+ function setGraphAttributes(span, nodes, edges) {
146
+ if (nodes.length > 0) {
147
+ span.setAttribute(semantic_convention_1.default.GEN_AI_GRAPH_NODES, JSON.stringify(nodes));
148
+ span.setAttribute(semantic_convention_1.default.GEN_AI_GRAPH_NODE_COUNT, nodes.length);
149
+ }
150
+ if (edges.length > 0) {
151
+ span.setAttribute(semantic_convention_1.default.GEN_AI_GRAPH_EDGES, JSON.stringify(edges));
152
+ span.setAttribute(semantic_convention_1.default.GEN_AI_GRAPH_EDGE_COUNT, edges.length);
153
+ }
154
+ }
155
+ // ---------------------------------------------------------------------------
156
+ // Re-entry suppression via OTel context (mirrors Python _LANGGRAPH_SUPPRESS_KEY)
157
+ // ---------------------------------------------------------------------------
158
+ const LANGGRAPH_SUPPRESS_SYMBOL = Symbol.for('shield360-langgraph-suppress');
159
+ function isLangGraphSuppressed() {
160
+ return api_1.context.active().getValue(LANGGRAPH_SUPPRESS_SYMBOL) === true;
161
+ }
162
+ function withLangGraphSuppression(fn) {
163
+ const ctx = api_1.context.active().setValue(LANGGRAPH_SUPPRESS_SYMBOL, true);
164
+ return api_1.context.with(ctx, fn);
165
+ }
166
+ // ---------------------------------------------------------------------------
167
+ // Wrapper factory
168
+ // ---------------------------------------------------------------------------
169
+ class LangGraphWrapper {
170
+ /**
171
+ * Wrap Pregel.prototype.invoke — creates an invoke_workflow span.
172
+ */
173
+ static _patchInvoke(tracer) {
174
+ return (originalMethod) => {
175
+ return function (...args) {
176
+ if (isLangGraphSuppressed())
177
+ return originalMethod.apply(this, args);
178
+ const graphName = getGraphName(this);
179
+ const spanName = `invoke_workflow ${graphName}`;
180
+ const links = [];
181
+ const creationCtx = this._shield360_creation_context;
182
+ if (creationCtx)
183
+ links.push({ context: creationCtx, attributes: {} });
184
+ const span = tracer.startSpan(spanName, {
185
+ kind: api_1.SpanKind.INTERNAL,
186
+ links,
187
+ attributes: {
188
+ [semantic_convention_1.default.GEN_AI_OPERATION]: semantic_convention_1.default.GEN_AI_OPERATION_TYPE_FRAMEWORK,
189
+ [semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL]: semantic_convention_1.default.GEN_AI_SYSTEM_LANGGRAPH,
190
+ },
191
+ });
192
+ return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => {
193
+ const startTime = Date.now();
194
+ setCommonSpanAttributes(span, semantic_convention_1.default.GEN_AI_OPERATION_TYPE_FRAMEWORK);
195
+ span.setAttribute(semantic_convention_1.default.GEN_AI_WORKFLOW_NAME, graphName);
196
+ span.setAttribute(semantic_convention_1.default.GEN_AI_EXECUTION_MODE, 'invoke');
197
+ span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_IS_STREAM, false);
198
+ const config = args[1] ?? (typeof args[0] === 'object' && args[0]?.configurable ? args[0] : undefined);
199
+ const configInfo = extractConfigInfo(config);
200
+ if (configInfo.threadId)
201
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CONVERSATION_ID, configInfo.threadId);
202
+ if (configInfo.checkpointId)
203
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CHECKPOINT_ID, configInfo.checkpointId);
204
+ const { nodes, edges } = extractGraphStructure(this);
205
+ setGraphAttributes(span, nodes, edges);
206
+ const execute = () => withLangGraphSuppression(() => (0, helpers_1.runWithLangGraph)(() => {
207
+ const convId = configInfo.threadId;
208
+ if (convId) {
209
+ return (0, helpers_1.runWithLangGraphConversationId)(convId, () => originalMethod.apply(this, args));
210
+ }
211
+ return originalMethod.apply(this, args);
212
+ }));
213
+ try {
214
+ const result = execute();
215
+ if (result && typeof result.then === 'function') {
216
+ return result
217
+ .then((response) => {
218
+ finalizeInvokeSpan(span, response, startTime);
219
+ return response;
220
+ })
221
+ .catch((e) => {
222
+ helpers_1.default.handleException(span, e);
223
+ span.end();
224
+ throw e;
225
+ });
226
+ }
227
+ finalizeInvokeSpan(span, result, startTime);
228
+ return result;
229
+ }
230
+ catch (e) {
231
+ helpers_1.default.handleException(span, e);
232
+ span.end();
233
+ throw e;
234
+ }
235
+ });
236
+ };
237
+ };
238
+ }
239
+ /**
240
+ * Wrap Pregel.prototype.stream — creates an invoke_workflow span with stream mode.
241
+ */
242
+ static _patchStream(tracer) {
243
+ return (originalMethod) => {
244
+ return function (...args) {
245
+ if (isLangGraphSuppressed())
246
+ return originalMethod.apply(this, args);
247
+ const graphName = getGraphName(this);
248
+ const spanName = `invoke_workflow ${graphName}`;
249
+ const links = [];
250
+ const creationCtx = this._shield360_creation_context;
251
+ if (creationCtx)
252
+ links.push({ context: creationCtx, attributes: {} });
253
+ const span = tracer.startSpan(spanName, {
254
+ kind: api_1.SpanKind.INTERNAL,
255
+ links,
256
+ attributes: {
257
+ [semantic_convention_1.default.GEN_AI_OPERATION]: semantic_convention_1.default.GEN_AI_OPERATION_TYPE_FRAMEWORK,
258
+ [semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL]: semantic_convention_1.default.GEN_AI_SYSTEM_LANGGRAPH,
259
+ },
260
+ });
261
+ const parentCtx = api_1.trace.setSpan(api_1.context.active(), span);
262
+ return api_1.context.with(parentCtx, () => {
263
+ const startTime = Date.now();
264
+ setCommonSpanAttributes(span, semantic_convention_1.default.GEN_AI_OPERATION_TYPE_FRAMEWORK);
265
+ span.setAttribute(semantic_convention_1.default.GEN_AI_WORKFLOW_NAME, graphName);
266
+ span.setAttribute(semantic_convention_1.default.GEN_AI_EXECUTION_MODE, 'stream');
267
+ span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_IS_STREAM, true);
268
+ const config = args[1] ?? undefined;
269
+ const configInfo = extractConfigInfo(config);
270
+ if (configInfo.threadId)
271
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CONVERSATION_ID, configInfo.threadId);
272
+ if (configInfo.checkpointId)
273
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CHECKPOINT_ID, configInfo.checkpointId);
274
+ const { nodes, edges } = extractGraphStructure(this);
275
+ setGraphAttributes(span, nodes, edges);
276
+ const executionState = {
277
+ executedNodes: [],
278
+ chunkCount: 0,
279
+ };
280
+ try {
281
+ const result = withLangGraphSuppression(() => (0, helpers_1.runWithLangGraph)(() => {
282
+ const convId = configInfo.threadId;
283
+ if (convId) {
284
+ return (0, helpers_1.runWithLangGraphConversationId)(convId, () => originalMethod.apply(this, args));
285
+ }
286
+ return originalMethod.apply(this, args);
287
+ }));
288
+ if (result && typeof result[Symbol.asyncIterator] === 'function') {
289
+ return wrapAsyncIterableStream(result, span, executionState, startTime);
290
+ }
291
+ if (result && typeof result[Symbol.iterator] === 'function') {
292
+ return wrapSyncIterableStream(result, span, executionState, startTime);
293
+ }
294
+ finalizeStreamSpan(span, executionState, startTime);
295
+ return result;
296
+ }
297
+ catch (e) {
298
+ helpers_1.default.handleException(span, e);
299
+ span.end();
300
+ throw e;
301
+ }
302
+ });
303
+ };
304
+ };
305
+ }
306
+ /**
307
+ * Wrap StateGraph.prototype.compile — creates a create_agent span.
308
+ */
309
+ static _patchCompile(tracer) {
310
+ return (originalMethod) => {
311
+ return function (...args) {
312
+ if ((0, helpers_1.isCreateAgentActive)())
313
+ return originalMethod.apply(this, args);
314
+ const graphName = getGraphName(this);
315
+ const agentName = (graphName === 'graph' || graphName === 'LangGraph') ? 'default' : graphName;
316
+ const spanName = `create_agent ${agentName}`;
317
+ const span = tracer.startSpan(spanName, {
318
+ kind: api_1.SpanKind.CLIENT,
319
+ attributes: {
320
+ [semantic_convention_1.default.GEN_AI_OPERATION]: semantic_convention_1.default.GEN_AI_OPERATION_TYPE_CREATE_AGENT,
321
+ [semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL]: semantic_convention_1.default.GEN_AI_SYSTEM_LANGGRAPH,
322
+ },
323
+ });
324
+ return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => {
325
+ const startTime = Date.now();
326
+ try {
327
+ const result = (0, helpers_1.runWithCreateAgent)(() => originalMethod.apply(this, args));
328
+ setCommonSpanAttributes(span, semantic_convention_1.default.GEN_AI_OPERATION_TYPE_CREATE_AGENT);
329
+ span.setAttribute(semantic_convention_1.default.GEN_AI_AGENT_NAME, agentName);
330
+ const { nodes, edges } = extractGraphStructure(this);
331
+ setGraphAttributes(span, nodes, edges);
332
+ if (nodes.length > 0) {
333
+ span.setAttribute(semantic_convention_1.default.GEN_AI_AGENT_DESCRIPTION, `Agent with nodes: ${nodes.join(', ')}`);
334
+ }
335
+ else {
336
+ span.setAttribute(semantic_convention_1.default.GEN_AI_AGENT_DESCRIPTION, 'LangGraph agent');
337
+ }
338
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CLIENT_OPERATION_DURATION, (Date.now() - startTime) / 1000);
339
+ span.setStatus({ code: api_1.SpanStatusCode.OK });
340
+ (0, helpers_1.applyCustomSpanAttributes)(span);
341
+ if (result && typeof result === 'object') {
342
+ result._shield360_creation_context = span.spanContext();
343
+ }
344
+ span.end();
345
+ return result;
346
+ }
347
+ catch (e) {
348
+ helpers_1.default.handleException(span, e);
349
+ span.end();
350
+ throw e;
351
+ }
352
+ });
353
+ };
354
+ };
355
+ }
356
+ /**
357
+ * Wrap StateGraph.prototype.addNode — wraps node callables
358
+ * to create invoke_agent spans per node execution.
359
+ */
360
+ static _patchAddNode(tracer) {
361
+ return (originalMethod) => {
362
+ return function (...args) {
363
+ const nodeKey = args[0];
364
+ const action = args[1];
365
+ if (!action || typeof action !== 'function') {
366
+ return originalMethod.apply(this, args);
367
+ }
368
+ const nodeName = typeof nodeKey === 'string' ? nodeKey : String(nodeKey);
369
+ if (isToolNode(nodeName, action)) {
370
+ return originalMethod.apply(this, args);
371
+ }
372
+ const wrappedAction = createWrappedNode(tracer, action, nodeName);
373
+ const newArgs = [args[0], wrappedAction, ...args.slice(2)];
374
+ return originalMethod.apply(this, newArgs);
375
+ };
376
+ };
377
+ }
378
+ }
379
+ exports.default = LangGraphWrapper;
380
+ // ---------------------------------------------------------------------------
381
+ // Node wrapper — creates invoke_agent spans for each node execution
382
+ // ---------------------------------------------------------------------------
383
+ function createWrappedNode(tracer, originalFunc, nodeName) {
384
+ if (originalFunc._shield360_wrapped)
385
+ return originalFunc;
386
+ const wrapped = function (state, ...nodeArgs) {
387
+ const spanName = `invoke_agent ${nodeName}`;
388
+ const span = tracer.startSpan(spanName, {
389
+ kind: api_1.SpanKind.INTERNAL,
390
+ attributes: {
391
+ [semantic_convention_1.default.GEN_AI_OPERATION]: semantic_convention_1.default.GEN_AI_OPERATION_TYPE_AGENT,
392
+ [semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL]: semantic_convention_1.default.GEN_AI_SYSTEM_LANGGRAPH,
393
+ },
394
+ });
395
+ return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => {
396
+ const startTime = Date.now();
397
+ setCommonSpanAttributes(span, semantic_convention_1.default.GEN_AI_OPERATION_TYPE_AGENT);
398
+ span.setAttribute(semantic_convention_1.default.GEN_AI_AGENT_NAME, nodeName);
399
+ span.setAttribute(semantic_convention_1.default.GEN_AI_AGENT_ID, nodeName);
400
+ span.setAttribute(semantic_convention_1.default.GEN_AI_OUTPUT_TYPE, semantic_convention_1.default.GEN_AI_OUTPUT_TYPE_TEXT);
401
+ const convId = (0, helpers_1.getLangGraphConversationId)();
402
+ if (convId)
403
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CONVERSATION_ID, convId);
404
+ (0, helpers_1.applyCustomSpanAttributes)(span);
405
+ try {
406
+ const result = originalFunc.call(this, state, ...nodeArgs);
407
+ if (result && typeof result.then === 'function') {
408
+ return result
409
+ .then((res) => {
410
+ extractLlmInfoFromResult(span, state, res);
411
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CLIENT_OPERATION_DURATION, (Date.now() - startTime) / 1000);
412
+ span.setStatus({ code: api_1.SpanStatusCode.OK });
413
+ span.end();
414
+ return res;
415
+ })
416
+ .catch((e) => {
417
+ helpers_1.default.handleException(span, e);
418
+ span.end();
419
+ throw e;
420
+ });
421
+ }
422
+ extractLlmInfoFromResult(span, state, result);
423
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CLIENT_OPERATION_DURATION, (Date.now() - startTime) / 1000);
424
+ span.setStatus({ code: api_1.SpanStatusCode.OK });
425
+ span.end();
426
+ return result;
427
+ }
428
+ catch (e) {
429
+ helpers_1.default.handleException(span, e);
430
+ span.end();
431
+ throw e;
432
+ }
433
+ });
434
+ };
435
+ wrapped._shield360_wrapped = true;
436
+ Object.defineProperty(wrapped, 'name', { value: originalFunc.name || nodeName });
437
+ return wrapped;
438
+ }
439
+ // ---------------------------------------------------------------------------
440
+ // Response processing helpers
441
+ // ---------------------------------------------------------------------------
442
+ function finalizeInvokeSpan(span, response, startTime) {
443
+ try {
444
+ if (response && typeof response === 'object' && response.messages) {
445
+ const messages = response.messages;
446
+ if (Array.isArray(messages)) {
447
+ span.setAttribute(semantic_convention_1.default.GEN_AI_GRAPH_MESSAGE_COUNT, messages.length);
448
+ }
449
+ }
450
+ }
451
+ catch { /* ignore */ }
452
+ span.setAttribute(semantic_convention_1.default.GEN_AI_GRAPH_STATUS, 'success');
453
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CLIENT_OPERATION_DURATION, (Date.now() - startTime) / 1000);
454
+ span.setStatus({ code: api_1.SpanStatusCode.OK });
455
+ (0, helpers_1.applyCustomSpanAttributes)(span);
456
+ span.end();
457
+ }
458
+ function finalizeStreamSpan(span, executionState, startTime) {
459
+ span.setAttribute(semantic_convention_1.default.GEN_AI_GRAPH_EXECUTED_NODES, JSON.stringify(executionState.executedNodes));
460
+ span.setAttribute(semantic_convention_1.default.GEN_AI_GRAPH_TOTAL_CHUNKS, executionState.chunkCount);
461
+ span.setAttribute(semantic_convention_1.default.GEN_AI_GRAPH_STATUS, 'success');
462
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CLIENT_OPERATION_DURATION, (Date.now() - startTime) / 1000);
463
+ span.setStatus({ code: api_1.SpanStatusCode.OK });
464
+ (0, helpers_1.applyCustomSpanAttributes)(span);
465
+ span.end();
466
+ }
467
+ function processStreamChunk(chunk, executionState) {
468
+ executionState.chunkCount++;
469
+ try {
470
+ if (chunk && typeof chunk === 'object' && !Array.isArray(chunk)) {
471
+ for (const key of Object.keys(chunk)) {
472
+ if (!['__start__', '__end__', '__interrupt__'].includes(key)) {
473
+ if (!executionState.executedNodes.includes(key)) {
474
+ executionState.executedNodes.push(key);
475
+ }
476
+ }
477
+ }
478
+ }
479
+ if (Array.isArray(chunk) && chunk.length >= 2 && typeof chunk[0] === 'string') {
480
+ const nodeName = chunk[0];
481
+ if (!['__start__', '__end__', '__interrupt__'].includes(nodeName)) {
482
+ if (!executionState.executedNodes.includes(nodeName)) {
483
+ executionState.executedNodes.push(nodeName);
484
+ }
485
+ }
486
+ }
487
+ }
488
+ catch { /* ignore */ }
489
+ }
490
+ function wrapAsyncIterableStream(stream, span, executionState, startTime) {
491
+ const originalIterator = stream[Symbol.asyncIterator].bind(stream);
492
+ return {
493
+ [Symbol.asyncIterator]() {
494
+ const iter = originalIterator();
495
+ return {
496
+ async next() {
497
+ try {
498
+ const result = await iter.next();
499
+ if (result.done) {
500
+ finalizeStreamSpan(span, executionState, startTime);
501
+ return result;
502
+ }
503
+ processStreamChunk(result.value, executionState);
504
+ return result;
505
+ }
506
+ catch (e) {
507
+ helpers_1.default.handleException(span, e);
508
+ span.end();
509
+ throw e;
510
+ }
511
+ },
512
+ async return(value) {
513
+ finalizeStreamSpan(span, executionState, startTime);
514
+ return iter.return ? iter.return(value) : { done: true, value };
515
+ },
516
+ async throw(e) {
517
+ helpers_1.default.handleException(span, e);
518
+ span.end();
519
+ return iter.throw ? iter.throw(e) : { done: true, value: undefined };
520
+ },
521
+ };
522
+ },
523
+ };
524
+ }
525
+ function wrapSyncIterableStream(stream, span, executionState, startTime) {
526
+ const originalIterator = stream[Symbol.iterator].bind(stream);
527
+ return {
528
+ [Symbol.iterator]() {
529
+ const iter = originalIterator();
530
+ return {
531
+ next() {
532
+ try {
533
+ const result = iter.next();
534
+ if (result.done) {
535
+ finalizeStreamSpan(span, executionState, startTime);
536
+ return result;
537
+ }
538
+ processStreamChunk(result.value, executionState);
539
+ return result;
540
+ }
541
+ catch (e) {
542
+ helpers_1.default.handleException(span, e);
543
+ span.end();
544
+ throw e;
545
+ }
546
+ },
547
+ return(value) {
548
+ finalizeStreamSpan(span, executionState, startTime);
549
+ return iter.return ? iter.return(value) : { done: true, value };
550
+ },
551
+ throw(e) {
552
+ helpers_1.default.handleException(span, e);
553
+ span.end();
554
+ return iter.throw ? iter.throw(e) : { done: true, value: undefined };
555
+ },
556
+ };
557
+ },
558
+ };
559
+ }
560
+ // ---------------------------------------------------------------------------
561
+ // LLM info extraction from node results (matching Python extract_llm_info_from_result)
562
+ // ---------------------------------------------------------------------------
563
+ function extractLlmInfoFromResult(span, _state, result) {
564
+ try {
565
+ if (!result || typeof result !== 'object')
566
+ return;
567
+ const messages = result.messages;
568
+ if (!messages || !Array.isArray(messages) || messages.length === 0)
569
+ return;
570
+ const lastMsg = messages[messages.length - 1];
571
+ if (!lastMsg)
572
+ return;
573
+ if (lastMsg.response_metadata && typeof lastMsg.response_metadata === 'object') {
574
+ const metadata = lastMsg.response_metadata;
575
+ const modelName = metadata.model_name || metadata.model;
576
+ if (modelName) {
577
+ span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_MODEL, modelName);
578
+ span.setAttribute(semantic_convention_1.default.GEN_AI_RESPONSE_MODEL, modelName);
579
+ }
580
+ const tokenUsage = metadata.token_usage;
581
+ if (tokenUsage && typeof tokenUsage === 'object') {
582
+ if (tokenUsage.prompt_tokens != null) {
583
+ span.setAttribute(semantic_convention_1.default.GEN_AI_USAGE_INPUT_TOKENS, tokenUsage.prompt_tokens);
584
+ }
585
+ if (tokenUsage.completion_tokens != null) {
586
+ span.setAttribute(semantic_convention_1.default.GEN_AI_USAGE_OUTPUT_TOKENS, tokenUsage.completion_tokens);
587
+ }
588
+ }
589
+ if (metadata.finish_reason) {
590
+ span.setAttribute(semantic_convention_1.default.GEN_AI_RESPONSE_FINISH_REASON, [metadata.finish_reason]);
591
+ }
592
+ if (metadata.id) {
593
+ span.setAttribute(semantic_convention_1.default.GEN_AI_RESPONSE_ID, metadata.id);
594
+ }
595
+ }
596
+ if (lastMsg.usage_metadata && typeof lastMsg.usage_metadata === 'object') {
597
+ const usage = lastMsg.usage_metadata;
598
+ if (usage.input_tokens != null) {
599
+ span.setAttribute(semantic_convention_1.default.GEN_AI_USAGE_INPUT_TOKENS, usage.input_tokens);
600
+ }
601
+ if (usage.output_tokens != null) {
602
+ span.setAttribute(semantic_convention_1.default.GEN_AI_USAGE_OUTPUT_TOKENS, usage.output_tokens);
603
+ }
604
+ }
605
+ if (lastMsg.content != null) {
606
+ const content = typeof lastMsg.content === 'string'
607
+ ? lastMsg.content
608
+ : JSON.stringify(lastMsg.content);
609
+ if (content && config_1.default.captureMessageContent) {
610
+ const rawRole = lastMsg.role || lastMsg._getType?.() || lastMsg.type || '';
611
+ const role = (0, helpers_1.mapLangChainRole)(rawRole);
612
+ if (role === helpers_1.OTEL_ASSISTANT_ROLE) {
613
+ span.setAttribute(semantic_convention_1.default.GEN_AI_OUTPUT_MESSAGES, JSON.stringify([{ role, parts: [{ type: 'text', content }] }]));
614
+ }
615
+ }
616
+ }
617
+ }
618
+ catch { /* don't fail the span */ }
619
+ }
620
+ //# sourceMappingURL=wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../../src/instrumentation/langgraph/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,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