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,208 @@
1
+ "use strict";
2
+ /**
3
+ * Cross-Language Trace Comparison Tests for the mem0 Integration
4
+ *
5
+ * These verify that the TypeScript mem0 instrumentation emits the same spans /
6
+ * attributes as the Python SDK reference
7
+ * (sdk/python/src/shield360/instrumentation/mem0). mem0 is a memory layer, not an LLM
8
+ * provider: each operation (add / search / get / getAll / update / delete /
9
+ * deleteAll / history) becomes one CLIENT span named `memory <op>` carrying
10
+ * `gen_ai.*` attributes. There are no tokens, model, cost, or metrics. The same
11
+ * wrapper serves both the hosted `MemoryClient` and the OSS `Memory` clients, whose
12
+ * method surfaces are identical.
13
+ */
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const api_1 = require("@opentelemetry/api");
19
+ const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
20
+ const wrapper_1 = __importDefault(require("../mem0/wrapper"));
21
+ const config_1 = __importDefault(require("../../config"));
22
+ const helpers_1 = __importDefault(require("../../helpers"));
23
+ const semantic_convention_1 = __importDefault(require("../../semantic-convention"));
24
+ jest.mock('../../config');
25
+ jest.mock('../../helpers', () => ({
26
+ __esModule: true,
27
+ default: { handleException: jest.fn() },
28
+ applyCustomSpanAttributes: jest.fn(),
29
+ }));
30
+ describe('mem0 Cross-Language Trace Comparison', () => {
31
+ let mockSpan;
32
+ let mockTracer;
33
+ beforeEach(() => {
34
+ mockSpan = {
35
+ setAttribute: jest.fn(),
36
+ setStatus: jest.fn(),
37
+ recordException: jest.fn(),
38
+ end: jest.fn(),
39
+ };
40
+ mockTracer = { startSpan: jest.fn(() => mockSpan) };
41
+ config_1.default.environment = 'shield360-testing';
42
+ config_1.default.applicationName = 'shield360-test';
43
+ config_1.default.captureMessageContent = true;
44
+ });
45
+ afterEach(() => {
46
+ jest.clearAllMocks();
47
+ });
48
+ // Wrap `impl` as the mem0 operation `spanName`, then invoke it with `args`.
49
+ async function runOp(spanName, impl, args = []) {
50
+ const wrapped = wrapper_1.default._patchMemoryOperation(mockTracer, spanName)(impl);
51
+ return wrapped.apply({}, args);
52
+ }
53
+ // Snapshot of all setAttribute(key, value) calls as a plain object.
54
+ function attrs() {
55
+ return Object.fromEntries(mockSpan.setAttribute.mock.calls);
56
+ }
57
+ describe('Core span shape', () => {
58
+ it('opens a CLIENT span named after the Python endpoint string', async () => {
59
+ await runOp('memory add', async () => [{ id: 'm1' }], [[{ role: 'user', content: 'hi' }], {}]);
60
+ expect(mockTracer.startSpan).toHaveBeenCalledWith('memory add', { kind: api_1.SpanKind.CLIENT });
61
+ expect(mockSpan.setStatus).toHaveBeenCalledWith({ code: 1 }); // SpanStatusCode.OK
62
+ expect(mockSpan.end).toHaveBeenCalledTimes(1);
63
+ });
64
+ it('sets the same core attributes as the Python SDK', async () => {
65
+ await runOp('memory add', async () => [{ id: 'm1' }], [[{ role: 'user', content: 'hi' }], {}]);
66
+ const a = attrs();
67
+ expect(a[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]).toBe('shield360');
68
+ // Provider name is stamped on BOTH keys (gen_ai.system + gen_ai.provider.name).
69
+ expect(a[semantic_convention_1.default.GEN_AI_PROVIDER_NAME]).toBe('mem0');
70
+ expect(a[semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL]).toBe('mem0');
71
+ expect(a[semantic_convention_1.default.GEN_AI_ENDPOINT]).toBe('memory add');
72
+ expect(a[semantic_convention_1.default.GEN_AI_OPERATION]).toBe(semantic_convention_1.default.GEN_AI_OPERATION_TYPE_MEMORY);
73
+ expect(a[semantic_convention_1.default.ATTR_DEPLOYMENT_ENVIRONMENT]).toBe('shield360-testing');
74
+ expect(a[semantic_conventions_1.ATTR_SERVICE_NAME]).toBe('shield360-test');
75
+ // gen_ai.sdk.version is the mem0ai package version (a string); its exact value
76
+ // comes from the version OTel passes to the patch hook — asserted in the next test.
77
+ expect(typeof a[semantic_convention_1.default.GEN_AI_SDK_VERSION]).toBe('string');
78
+ expect(typeof a[semantic_convention_1.default.GEN_AI_CLIENT_OPERATION_DURATION]).toBe('number');
79
+ });
80
+ it('stamps the mem0ai version OTel hands to the patch hook', async () => {
81
+ const wrapped = wrapper_1.default._patchMemoryOperation(mockTracer, 'memory add', '3.0.7')(async () => [{ id: 'm1' }]);
82
+ await wrapped.apply({}, [[{ role: 'user', content: 'hi' }], {}]);
83
+ expect(attrs()[semantic_convention_1.default.GEN_AI_SDK_VERSION]).toBe('3.0.7');
84
+ });
85
+ it('applies custom span attributes on every memory span', async () => {
86
+ const { applyCustomSpanAttributes } = jest.requireMock('../../helpers');
87
+ await runOp('memory get', async () => ({ id: 'm1' }), ['mem-123']);
88
+ expect(applyCustomSpanAttributes).toHaveBeenCalledWith(mockSpan);
89
+ });
90
+ });
91
+ describe('Operation: add', () => {
92
+ it('records message count, infer flag, and input content', async () => {
93
+ const messages = [
94
+ { role: 'user', content: 'I love coffee' },
95
+ { role: 'assistant', content: 'Noted' },
96
+ ];
97
+ await runOp('memory add', async () => ({ results: [{ id: 'm1' }] }), [
98
+ messages,
99
+ { userId: 'alice', infer: false },
100
+ ]);
101
+ const a = attrs();
102
+ expect(a[semantic_convention_1.default.GEN_AI_MEMORY_COUNT]).toBe(2);
103
+ expect(a[semantic_convention_1.default.GEN_AI_MEMORY_INFER]).toBe(false);
104
+ expect(a[semantic_convention_1.default.GEN_AI_USER_ID]).toBe('alice');
105
+ expect(a[semantic_convention_1.default.GEN_AI_INPUT_MESSAGES]).toBe(JSON.stringify(messages));
106
+ });
107
+ it('captures user / agent / run scope from the config object', async () => {
108
+ await runOp('memory add', async () => [{ id: 'm1' }], [
109
+ [{ role: 'user', content: 'hi' }],
110
+ { userId: 'u1', agentId: 'a1', runId: 'r1', metadata: { topic: 'food' } },
111
+ ]);
112
+ const a = attrs();
113
+ expect(a[semantic_convention_1.default.GEN_AI_USER_ID]).toBe('u1');
114
+ expect(a[semantic_convention_1.default.GEN_AI_AGENT_ID]).toBe('a1');
115
+ expect(a[semantic_convention_1.default.GEN_AI_RUN_ID]).toBe('r1');
116
+ expect(a[semantic_convention_1.default.GEN_AI_MEMORY_METADATA]).toBe(JSON.stringify({ topic: 'food' }));
117
+ });
118
+ });
119
+ describe('Operation: search', () => {
120
+ it('records query / limit (topK) / threshold and output content', async () => {
121
+ const response = { results: [{ id: 'm1', memory: 'likes coffee' }, { id: 'm2', memory: 'likes tea' }] };
122
+ await runOp('memory search', async () => response, [
123
+ 'what drinks?',
124
+ { userId: 'alice', topK: 5, threshold: 0.7 },
125
+ ]);
126
+ const a = attrs();
127
+ expect(a[semantic_convention_1.default.GEN_AI_MEMORY_SEARCH_QUERY]).toBe('what drinks?');
128
+ expect(a[semantic_convention_1.default.GEN_AI_MEMORY_SEARCH_LIMIT]).toBe(5);
129
+ expect(a[semantic_convention_1.default.GEN_AI_MEMORY_SEARCH_THRESHOLD]).toBe(0.7);
130
+ expect(a[semantic_convention_1.default.GEN_AI_MEMORY_OPERATION_RESULT_COUNT]).toBe(2);
131
+ expect(a[semantic_convention_1.default.GEN_AI_DATA_SOURCES]).toBe(2);
132
+ expect(a[semantic_convention_1.default.GEN_AI_OUTPUT_MESSAGES]).toBe(JSON.stringify(response));
133
+ });
134
+ it('reads scope from a nested filters object (camel or snake case)', async () => {
135
+ await runOp('memory search', async () => ({ results: [] }), [
136
+ 'q',
137
+ { filters: { user_id: 'snake-user' } },
138
+ ]);
139
+ expect(attrs()[semantic_convention_1.default.GEN_AI_USER_ID]).toBe('snake-user');
140
+ });
141
+ it('reports result_count 0 for an empty results array (not 1)', async () => {
142
+ await runOp('memory search', async () => ({ results: [] }), ['q', { filters: { user_id: 'x' } }]);
143
+ const a = attrs();
144
+ expect(a[semantic_convention_1.default.GEN_AI_MEMORY_OPERATION_RESULT_COUNT]).toBe(0);
145
+ expect(a[semantic_convention_1.default.GEN_AI_DATA_SOURCES]).toBe(0);
146
+ });
147
+ });
148
+ describe('Operations carrying a positional memory id', () => {
149
+ it('get -> db.operation.id', async () => {
150
+ await runOp('memory get', async () => ({ id: 'mem-1' }), ['mem-1']);
151
+ expect(attrs()[semantic_convention_1.default.DB_OPERATION_ID]).toBe('mem-1');
152
+ });
153
+ it('update -> db.update.id', async () => {
154
+ await runOp('memory update', async () => ({ message: 'ok' }), ['mem-2', 'new text']);
155
+ expect(attrs()[semantic_convention_1.default.DB_UPDATE_ID]).toBe('mem-2');
156
+ });
157
+ it('delete -> db.delete.id', async () => {
158
+ await runOp('memory delete', async () => ({ message: 'ok' }), ['mem-3']);
159
+ expect(attrs()[semantic_convention_1.default.DB_DELETE_ID]).toBe('mem-3');
160
+ });
161
+ });
162
+ describe('Operation: getAll / deleteAll', () => {
163
+ it('getAll uses the snake_case span name and reads scope from its first-arg config', async () => {
164
+ await runOp('memory get_all', async () => ({ results: [{ id: 'm1' }, { id: 'm2' }, { id: 'm3' }] }), [
165
+ { userId: 'bob' },
166
+ ]);
167
+ const a = attrs();
168
+ expect(mockTracer.startSpan).toHaveBeenCalledWith('memory get_all', { kind: api_1.SpanKind.CLIENT });
169
+ expect(a[semantic_convention_1.default.GEN_AI_USER_ID]).toBe('bob');
170
+ expect(a[semantic_convention_1.default.GEN_AI_MEMORY_OPERATION_RESULT_COUNT]).toBe(3);
171
+ });
172
+ it('deleteAll uses the snake_case span name', async () => {
173
+ await runOp('memory delete_all', async () => ({ message: 'ok' }), [{ userId: 'bob' }]);
174
+ expect(mockTracer.startSpan).toHaveBeenCalledWith('memory delete_all', { kind: api_1.SpanKind.CLIENT });
175
+ });
176
+ it('reset uses the Python endpoint span name', async () => {
177
+ await runOp('memory reset', async () => ({ message: 'ok' }), []);
178
+ expect(mockTracer.startSpan).toHaveBeenCalledWith('memory reset', { kind: api_1.SpanKind.CLIENT });
179
+ expect(attrs()[semantic_convention_1.default.GEN_AI_ENDPOINT]).toBe('memory reset');
180
+ expect(attrs()[semantic_convention_1.default.GEN_AI_OPERATION]).toBe(semantic_convention_1.default.GEN_AI_OPERATION_TYPE_MEMORY);
181
+ });
182
+ });
183
+ describe('Content capture toggle', () => {
184
+ it('omits input/output content when captureMessageContent is false', async () => {
185
+ config_1.default.captureMessageContent = false;
186
+ await runOp('memory add', async () => ({ results: [] }), [
187
+ [{ role: 'user', content: 'secret' }],
188
+ {},
189
+ ]);
190
+ const keys = mockSpan.setAttribute.mock.calls.map(([k]) => k);
191
+ expect(keys).not.toContain(semantic_convention_1.default.GEN_AI_INPUT_MESSAGES);
192
+ });
193
+ });
194
+ describe('Error path', () => {
195
+ it('records the exception, still ends the span, and rethrows', async () => {
196
+ const boom = new Error('mem0 down');
197
+ await expect(runOp('memory search', async () => {
198
+ throw boom;
199
+ }, ['q', { topK: 3 }])).rejects.toThrow('mem0 down');
200
+ expect(helpers_1.default.handleException).toHaveBeenCalledWith(mockSpan, boom);
201
+ expect(mockSpan.end).toHaveBeenCalledTimes(1);
202
+ // Core attributes are still emitted on the error path (best-effort).
203
+ expect(attrs()[semantic_convention_1.default.GEN_AI_PROVIDER_NAME]).toBe('mem0');
204
+ expect(typeof attrs()[semantic_convention_1.default.GEN_AI_CLIENT_OPERATION_DURATION]).toBe('number');
205
+ });
206
+ });
207
+ });
208
+ //# sourceMappingURL=mem0-trace-comparison.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mem0-trace-comparison.test.js","sourceRoot":"","sources":["../../../src/instrumentation/__tests__/mem0-trace-comparison.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;AAEH,4CAA8C;AAC9C,8EAAiG;AACjG,8DAA0C;AAC1C,0DAA2C;AAC3C,4DAA4C;AAC5C,oFAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC1B,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC;IAChC,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE;IACvC,yBAAyB,EAAE,IAAI,CAAC,EAAE,EAAE;CACrC,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACpD,IAAI,QAAa,CAAC;IAClB,IAAI,UAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG;YACT,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE;YACvB,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE;YACpB,eAAe,EAAE,IAAI,CAAC,EAAE,EAAE;YAC1B,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;SACf,CAAC;QACF,UAAU,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;QAEnD,gBAAuB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MAAM,CACV,KAAK,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;gBAChC,MAAM,IAAI,CAAC;YACb,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CACvB,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAE/B,MAAM,CAAE,iBAAuB,CAAC,eAAe,CAAC,CAAC,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACtF,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAC9C,qEAAqE;YACrE,MAAM,CAAC,KAAK,EAAE,CAAC,6BAAkB,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtE,MAAM,CAAC,OAAO,KAAK,EAAE,CAAC,6BAAkB,CAAC,gCAAgC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Cross-Language Trace Comparison Tests for Milvus Integration
3
+ *
4
+ * Verifies TypeScript SDK trace attributes match Python SDK.
5
+ *
6
+ * Python SDK reference: sdk/python/src/shield360/instrumentation/milvus/milvus.py
7
+ *
8
+ * Key alignment:
9
+ * - db.system.name = 'milvus'
10
+ * - db.operation.name: SEARCH, INSERT, UPSERT, DELETE, QUERY
11
+ * - server.address, server.port (default localhost:19530)
12
+ * - db.vector.query.top_k for search
13
+ * - db.filter for expr/filter params
14
+ * - db.vector.count for insert/upsert
15
+ * - db.query.summary
16
+ */
17
+ export {};
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ /**
3
+ * Cross-Language Trace Comparison Tests for Milvus Integration
4
+ *
5
+ * Verifies TypeScript SDK trace attributes match Python SDK.
6
+ *
7
+ * Python SDK reference: sdk/python/src/shield360/instrumentation/milvus/milvus.py
8
+ *
9
+ * Key alignment:
10
+ * - db.system.name = 'milvus'
11
+ * - db.operation.name: SEARCH, INSERT, UPSERT, DELETE, QUERY
12
+ * - server.address, server.port (default localhost:19530)
13
+ * - db.vector.query.top_k for search
14
+ * - db.filter for expr/filter params
15
+ * - db.vector.count for insert/upsert
16
+ * - db.query.summary
17
+ */
18
+ var __importDefault = (this && this.__importDefault) || function (mod) {
19
+ return (mod && mod.__esModule) ? mod : { "default": mod };
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const wrapper_1 = __importDefault(require("../milvus/wrapper"));
23
+ const config_1 = __importDefault(require("../../config"));
24
+ const helpers_1 = __importDefault(require("../../helpers"));
25
+ const semantic_convention_1 = __importDefault(require("../../semantic-convention"));
26
+ jest.mock('../../config');
27
+ jest.mock('../../helpers');
28
+ describe('Milvus Cross-Language Trace Comparison', () => {
29
+ let mockSpan;
30
+ let mockTracer;
31
+ beforeEach(() => {
32
+ mockSpan = {
33
+ setAttribute: jest.fn(),
34
+ addEvent: jest.fn(),
35
+ end: jest.fn(),
36
+ setStatus: jest.fn(),
37
+ };
38
+ mockTracer = {
39
+ startSpan: jest.fn().mockReturnValue(mockSpan),
40
+ };
41
+ config_1.default.environment = 'shield360-testing';
42
+ config_1.default.applicationName = 'shield360-test';
43
+ config_1.default.captureMessageContent = true;
44
+ helpers_1.default.handleException = jest.fn();
45
+ });
46
+ afterEach(() => {
47
+ jest.clearAllMocks();
48
+ });
49
+ // ── Common attributes ────────────────────────────────────────────────────
50
+ it('should set db.system.name = "milvus" matching Python DB_SYSTEM_MILVUS', async () => {
51
+ const patchFn = wrapper_1.default._patchSearch(mockTracer);
52
+ const originalMethod = jest.fn().mockResolvedValue({ results: [] });
53
+ const wrapped = patchFn(originalMethod);
54
+ await wrapped.call({}, { collection_name: 'test', vectors: [[0.1]], topk: 5 });
55
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_SYSTEM_NAME, 'milvus');
56
+ });
57
+ it('should set server.address = localhost and server.port = 19530', async () => {
58
+ const patchFn = wrapper_1.default._patchSearch(mockTracer);
59
+ const originalMethod = jest.fn().mockResolvedValue({ results: [] });
60
+ const wrapped = patchFn(originalMethod);
61
+ await wrapped.call({}, { collection_name: 'test', vectors: [[0.1]], topk: 5 });
62
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.SERVER_ADDRESS, 'localhost');
63
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.SERVER_PORT, 19530);
64
+ });
65
+ // ── search → SEARCH ───────────────────────────────────────────────────────
66
+ describe('search() → SEARCH', () => {
67
+ async function runSearch(params, returnValue = { results: [] }) {
68
+ const patchFn = wrapper_1.default._patchSearch(mockTracer);
69
+ const originalMethod = jest.fn().mockResolvedValue(returnValue);
70
+ const wrapped = patchFn(originalMethod);
71
+ await wrapped.call({}, params);
72
+ }
73
+ it('should set db.operation.name = "SEARCH"', async () => {
74
+ await runSearch({ collection_name: 'embeddings', vectors: [[0.1]], topk: 10 });
75
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'SEARCH');
76
+ });
77
+ it('should set db.collection.name from collection_name param', async () => {
78
+ await runSearch({ collection_name: 'my_embeddings', vectors: [[0.1]], topk: 5 });
79
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_COLLECTION_NAME, 'my_embeddings');
80
+ });
81
+ it('should set db.vector.query.top_k from topk param', async () => {
82
+ await runSearch({ collection_name: 'col', vectors: [[0.1]], topk: 20 });
83
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_VECTOR_QUERY_TOP_K, 20);
84
+ });
85
+ it('should also accept "limit" as top_k param', async () => {
86
+ await runSearch({ collection_name: 'col', vectors: [[0.1]], limit: 15 });
87
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_VECTOR_QUERY_TOP_K, 15);
88
+ });
89
+ it('should set db.filter when expr provided', async () => {
90
+ await runSearch({
91
+ collection_name: 'col',
92
+ vectors: [[0.1]],
93
+ topk: 5,
94
+ expr: 'category == "books"',
95
+ });
96
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_FILTER, 'category == "books"');
97
+ });
98
+ it('should set db.n_results from results length', async () => {
99
+ await runSearch({ collection_name: 'col', vectors: [[0.1]], topk: 5 }, { results: [{ id: 1 }, { id: 2 }] });
100
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_N_RESULTS, 2);
101
+ });
102
+ });
103
+ // ── insert → INSERT ───────────────────────────────────────────────────────
104
+ describe('insert() → INSERT (matches Python DB_OPERATION_INSERT)', () => {
105
+ async function runInsert(params) {
106
+ const patchFn = wrapper_1.default._patchInsert(mockTracer);
107
+ const originalMethod = jest.fn().mockResolvedValue({ insert_cnt: params.data?.length ?? 0 });
108
+ const wrapped = patchFn(originalMethod);
109
+ await wrapped.call({}, params);
110
+ }
111
+ it('should set db.operation.name = "INSERT"', async () => {
112
+ await runInsert({ collection_name: 'col', data: [{ id: 1, vector: [0.1] }] });
113
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'INSERT');
114
+ });
115
+ it('should set db.vector.count from data length', async () => {
116
+ await runInsert({
117
+ collection_name: 'col',
118
+ data: [{ id: 1 }, { id: 2 }, { id: 3 }],
119
+ });
120
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_VECTOR_COUNT, 3);
121
+ });
122
+ it('should also work with collectionName (camelCase) param', async () => {
123
+ const patchFn = wrapper_1.default._patchInsert(mockTracer);
124
+ const originalMethod = jest.fn().mockResolvedValue({});
125
+ const wrapped = patchFn(originalMethod);
126
+ await wrapped.call({}, { collectionName: 'camelCase', data: [{ id: 1 }] });
127
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_COLLECTION_NAME, 'camelCase');
128
+ });
129
+ });
130
+ // ── upsert → UPSERT ───────────────────────────────────────────────────────
131
+ describe('upsert() → UPSERT', () => {
132
+ it('should set db.operation.name = "UPSERT" and db.vector.count', async () => {
133
+ const patchFn = wrapper_1.default._patchUpsert(mockTracer);
134
+ const originalMethod = jest.fn().mockResolvedValue({});
135
+ const wrapped = patchFn(originalMethod);
136
+ await wrapped.call({}, {
137
+ collection_name: 'col',
138
+ data: [{ id: 1, vector: [0.1] }, { id: 2, vector: [0.2] }],
139
+ });
140
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'UPSERT');
141
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_VECTOR_COUNT, 2);
142
+ });
143
+ });
144
+ // ── delete → DELETE ───────────────────────────────────────────────────────
145
+ describe('delete() → DELETE', () => {
146
+ it('should set db.operation.name = "DELETE"', async () => {
147
+ const patchFn = wrapper_1.default._patchDelete(mockTracer);
148
+ const originalMethod = jest.fn().mockResolvedValue({ delete_cnt: 2 });
149
+ const wrapped = patchFn(originalMethod);
150
+ await wrapped.call({}, {
151
+ collection_name: 'col',
152
+ ids: [1, 2],
153
+ });
154
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'DELETE');
155
+ });
156
+ it('should set db.filter when expr provided', async () => {
157
+ const patchFn = wrapper_1.default._patchDelete(mockTracer);
158
+ const originalMethod = jest.fn().mockResolvedValue({});
159
+ const wrapped = patchFn(originalMethod);
160
+ await wrapped.call({}, {
161
+ collection_name: 'col',
162
+ expr: 'id in [1, 2, 3]',
163
+ });
164
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_FILTER, 'id in [1, 2, 3]');
165
+ });
166
+ it('should set db.ids_count when ids provided', async () => {
167
+ const patchFn = wrapper_1.default._patchDelete(mockTracer);
168
+ const originalMethod = jest.fn().mockResolvedValue({});
169
+ const wrapped = patchFn(originalMethod);
170
+ await wrapped.call({}, { collection_name: 'col', ids: [10, 20, 30] });
171
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_ID_COUNT, 3);
172
+ });
173
+ });
174
+ // ── query → QUERY ─────────────────────────────────────────────────────────
175
+ describe('query() → QUERY (scalar filter query)', () => {
176
+ it('should set db.operation.name = "QUERY"', async () => {
177
+ const patchFn = wrapper_1.default._patchQuery(mockTracer);
178
+ const originalMethod = jest.fn().mockResolvedValue({ data: [{ id: 1 }, { id: 2 }] });
179
+ const wrapped = patchFn(originalMethod);
180
+ await wrapped.call({}, {
181
+ collection_name: 'col',
182
+ expr: 'category == "books"',
183
+ limit: 50,
184
+ });
185
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'QUERY');
186
+ });
187
+ it('should set db.n_results from data length', async () => {
188
+ const patchFn = wrapper_1.default._patchQuery(mockTracer);
189
+ const originalMethod = jest.fn().mockResolvedValue({ data: [{ id: 1 }, { id: 2 }, { id: 3 }] });
190
+ const wrapped = patchFn(originalMethod);
191
+ await wrapped.call({}, { collection_name: 'col', expr: 'id > 0' });
192
+ expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_N_RESULTS, 3);
193
+ });
194
+ });
195
+ // ── Error handling ────────────────────────────────────────────────────────
196
+ it('should call handleException and end span on error', async () => {
197
+ const patchFn = wrapper_1.default._patchSearch(mockTracer);
198
+ const error = new Error('Milvus not available');
199
+ const originalMethod = jest.fn().mockRejectedValue(error);
200
+ const wrapped = patchFn(originalMethod);
201
+ await expect(wrapped.call({}, { collection_name: 'col', vectors: [[0.1]], topk: 5 })).rejects.toThrow();
202
+ expect(helpers_1.default.handleException).toHaveBeenCalledWith(mockSpan, error);
203
+ expect(mockSpan.end).toHaveBeenCalled();
204
+ });
205
+ });
206
+ //# sourceMappingURL=milvus-trace-comparison.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"milvus-trace-comparison.test.js","sourceRoot":"","sources":["../../../src/instrumentation/__tests__/milvus-trace-comparison.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;AAEH,gEAA8C;AAC9C,0DAA2C;AAC3C,4DAA4C;AAC5C,oFAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC1B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAE3B,QAAQ,CAAC,wCAAwC,EAAE,GAAG,EAAE;IACtD,IAAI,QAAa,CAAC;IAClB,IAAI,UAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG;YACT,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE;YACvB,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;YACnB,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;YACd,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE;SACrB,CAAC;QAEF,UAAU,GAAG;YACX,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC;SAC/C,CAAC;QAED,gBAAuB,CAAC,WAAW,GAAG,mBAAmB,CAAC;QAC1D,gBAAuB,CAAC,eAAe,GAAG,gBAAgB,CAAC;QAC3D,gBAAuB,CAAC,qBAAqB,GAAG,IAAI,CAAC;QACrD,iBAAuB,CAAC,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,4EAA4E;IAE5E,EAAE,CAAC,uEAAuE,EAAE,KAAK,IAAI,EAAE;QACrF,MAAM,OAAO,GAAG,iBAAa,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,cAAc,GAAG,IAAI,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