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,113 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const instrumentation_1 = require("@opentelemetry/instrumentation");
7
+ const api_1 = require("@opentelemetry/api");
8
+ const constant_1 = require("../../constant");
9
+ const wrapper_1 = __importDefault(require("./wrapper"));
10
+ /**
11
+ * mem0 method name -> span name. Span names reuse the Python endpoint strings
12
+ * (snake_case `get_all` / `delete_all`) so TS and Python emit identical span names,
13
+ * even though the JS methods are camelCase (`getAll` / `deleteAll`).
14
+ */
15
+ const MEM0_METHODS = [
16
+ ['add', 'memory add'],
17
+ ['search', 'memory search'],
18
+ ['get', 'memory get'],
19
+ ['getAll', 'memory get_all'],
20
+ ['update', 'memory update'],
21
+ ['delete', 'memory delete'],
22
+ ['deleteAll', 'memory delete_all'],
23
+ ['history', 'memory history'],
24
+ ['reset', 'memory reset'],
25
+ ];
26
+ class Shield360Mem0Instrumentation extends instrumentation_1.InstrumentationBase {
27
+ constructor(config = {}) {
28
+ super(`${constant_1.INSTRUMENTATION_PREFIX}/instrumentation-mem0`, '1.0.0', config);
29
+ }
30
+ init() {
31
+ // mem0ai ships two clients at two specifiers:
32
+ // - `mem0ai` -> hosted MemoryClient (the package entry, patched below)
33
+ // - `mem0ai/oss` -> self-hosted Memory (an internal file)
34
+ // require-in-the-middle reaches internal files via the `files` array, so the OSS
35
+ // entry is registered as InstrumentationNodeModuleFile(s) on the main definition.
36
+ // A few candidate paths are listed to stay robust across build layouts.
37
+ const ossFiles = ['mem0ai/dist/oss/index.js', 'mem0ai/dist/oss/index.cjs', 'mem0ai/oss/index.js'].map((filePath) => new instrumentation_1.InstrumentationNodeModuleFile(filePath, ['>=0.1.32'], (moduleExports, moduleVersion) => {
38
+ this._patchOss(moduleExports, moduleVersion);
39
+ return moduleExports;
40
+ }, (moduleExports) => {
41
+ if (moduleExports !== undefined)
42
+ this._unpatchOss(moduleExports);
43
+ }));
44
+ const module = new instrumentation_1.InstrumentationNodeModuleDefinition('mem0ai', ['>=0.1.32'], (moduleExports, moduleVersion) => {
45
+ this._patch(moduleExports, moduleVersion);
46
+ return moduleExports;
47
+ }, (moduleExports) => {
48
+ if (moduleExports !== undefined)
49
+ this._unpatch(moduleExports);
50
+ }, ossFiles);
51
+ return [module];
52
+ }
53
+ manualPatch(mem0) {
54
+ // Manual entry point (shield360.init({ instrumentations: { mem0 } })). The caller may
55
+ // pass either the hosted module/class or the OSS one, so try both resolvers — the
56
+ // isWrapped guard in _patchClass keeps it idempotent.
57
+ this._patch(mem0);
58
+ this._patchOss(mem0);
59
+ }
60
+ /** Patch the hosted MemoryClient (default export of `mem0ai`). */
61
+ _patch(moduleExports, moduleVersion) {
62
+ const ClientClass = moduleExports?.MemoryClient ?? moduleExports?.default ?? moduleExports;
63
+ this._patchClass(ClientClass, moduleVersion);
64
+ }
65
+ /** Patch the self-hosted Memory class (`mem0ai/oss`). */
66
+ _patchOss(moduleExports, moduleVersion) {
67
+ const MemoryClass = moduleExports?.Memory ?? moduleExports?.default ?? moduleExports;
68
+ this._patchClass(MemoryClass, moduleVersion);
69
+ }
70
+ _patchClass(target, moduleVersion) {
71
+ try {
72
+ const proto = target?.prototype;
73
+ if (!proto)
74
+ return;
75
+ for (const [method, spanName] of MEM0_METHODS) {
76
+ if (typeof proto[method] !== 'function')
77
+ continue;
78
+ if ((0, instrumentation_1.isWrapped)(proto[method])) {
79
+ this._unwrap(proto, method);
80
+ }
81
+ this._wrap(proto, method, wrapper_1.default._patchMemoryOperation(this.tracer, spanName, moduleVersion));
82
+ }
83
+ }
84
+ catch (e) {
85
+ api_1.diag.error('mem0 instrumentation: error in _patch method', e);
86
+ }
87
+ }
88
+ _unpatch(moduleExports) {
89
+ const ClientClass = moduleExports?.MemoryClient ?? moduleExports?.default ?? moduleExports;
90
+ this._unpatchClass(ClientClass);
91
+ }
92
+ _unpatchOss(moduleExports) {
93
+ const MemoryClass = moduleExports?.Memory ?? moduleExports?.default ?? moduleExports;
94
+ this._unpatchClass(MemoryClass);
95
+ }
96
+ _unpatchClass(target) {
97
+ try {
98
+ const proto = target?.prototype;
99
+ if (!proto)
100
+ return;
101
+ for (const [method] of MEM0_METHODS) {
102
+ if (typeof proto[method] === 'function' && (0, instrumentation_1.isWrapped)(proto[method])) {
103
+ this._unwrap(proto, method);
104
+ }
105
+ }
106
+ }
107
+ catch {
108
+ /* ignore */
109
+ }
110
+ }
111
+ }
112
+ exports.default = Shield360Mem0Instrumentation;
113
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/instrumentation/mem0/index.ts"],"names":[],"mappings":";;;;;AAAA,oEAMw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uGC"}
@@ -0,0 +1,37 @@
1
+ import { Tracer } from '@opentelemetry/api';
2
+ /**
3
+ * Wrapper for mem0 memory-layer operations. mem0 exposes the same method surface on
4
+ * the hosted `MemoryClient` (`mem0ai`) and the self-hosted `Memory` (`mem0ai/oss`):
5
+ * add / search / get / getAll / update / delete / deleteAll / history. Every method
6
+ * returns a Promise, so a single async wrapper handles them all. The emitted spans
7
+ * mirror the Python reference (sdk/python/src/shield360/instrumentation/mem0): one
8
+ * CLIENT span per call named `memory <op>`, with `gen_ai.*` attributes. No tokens,
9
+ * model, cost, or metrics are involved (matching Python) so this does not use the
10
+ * chat-oriented BaseWrapper.
11
+ */
12
+ declare class Mem0Wrapper {
13
+ static aiSystem: string;
14
+ /**
15
+ * Returns a wrapper (over an original Promise-returning method) that emits one
16
+ * `memory <op>` CLIENT span. `spanName` is the Python endpoint string, e.g.
17
+ * `memory add` or `memory get_all`.
18
+ */
19
+ static _patchMemoryOperation(tracer: Tracer, spanName: string, version?: string): any;
20
+ /** Sets every non-content attribute (core + scope + memory + operation + response). */
21
+ static _setSpanAttributes(span: any, spanName: string, args: any[], response?: any, sdkVersion?: string): void;
22
+ private static _setOperationAttributes;
23
+ private static _setResponseAttributes;
24
+ /** Captures input (add) / output (search) content when capture is enabled. */
25
+ static _setContentAttributes(span: any, spanName: string, args: any[], response: any): void;
26
+ /**
27
+ * Returns the options/config object for an operation, accounting for the fact that
28
+ * its argument position differs by method: add/search take it as the 2nd arg, while
29
+ * getAll/deleteAll take it as the 1st. get/update/history take a positional id and
30
+ * carry no scope config.
31
+ */
32
+ private static _extractConfig;
33
+ private static _scopeValue;
34
+ private static _hasMessages;
35
+ private static _safeStringify;
36
+ }
37
+ export default Mem0Wrapper;
@@ -0,0 +1,298 @@
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 config_1 = __importDefault(require("../../config"));
42
+ const constant_1 = require("../../constant");
43
+ const helpers_1 = __importStar(require("../../helpers"));
44
+ const semantic_convention_1 = __importDefault(require("../../semantic-convention"));
45
+ // `gen_ai.sdk.version` reports the *instrumented* package version (mem0ai), matching
46
+ // the Python SDK (importlib.metadata.version("mem0ai")) rather than Shield360's version.
47
+ // The reliable source is the version OTel passes to the patch hook, threaded in as the
48
+ // `version` arg of _patchMemoryOperation. This module-level require is only a fallback
49
+ // for manualPatch — and note mem0ai's "exports" map blocks `mem0ai/package.json`, so it
50
+ // resolves to 'unknown' for mem0ai itself; that's fine, the OTel-provided version wins.
51
+ let mem0SdkVersion = 'unknown';
52
+ try {
53
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
54
+ mem0SdkVersion = require('mem0ai/package.json')?.version || 'unknown';
55
+ }
56
+ catch {
57
+ mem0SdkVersion = 'unknown';
58
+ }
59
+ /**
60
+ * Wrapper for mem0 memory-layer operations. mem0 exposes the same method surface on
61
+ * the hosted `MemoryClient` (`mem0ai`) and the self-hosted `Memory` (`mem0ai/oss`):
62
+ * add / search / get / getAll / update / delete / deleteAll / history. Every method
63
+ * returns a Promise, so a single async wrapper handles them all. The emitted spans
64
+ * mirror the Python reference (sdk/python/src/shield360/instrumentation/mem0): one
65
+ * CLIENT span per call named `memory <op>`, with `gen_ai.*` attributes. No tokens,
66
+ * model, cost, or metrics are involved (matching Python) so this does not use the
67
+ * chat-oriented BaseWrapper.
68
+ */
69
+ class Mem0Wrapper {
70
+ /**
71
+ * Returns a wrapper (over an original Promise-returning method) that emits one
72
+ * `memory <op>` CLIENT span. `spanName` is the Python endpoint string, e.g.
73
+ * `memory add` or `memory get_all`.
74
+ */
75
+ static _patchMemoryOperation(tracer, spanName, version) {
76
+ const sdkVersion = version || mem0SdkVersion;
77
+ return (originalMethod) => {
78
+ return async function (...args) {
79
+ const span = tracer.startSpan(spanName, { kind: api_1.SpanKind.CLIENT });
80
+ const startTime = Date.now();
81
+ return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), async () => {
82
+ try {
83
+ const response = await originalMethod.apply(this, args);
84
+ const duration = (Date.now() - startTime) / 1000;
85
+ Mem0Wrapper._setSpanAttributes(span, spanName, args, response, sdkVersion);
86
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CLIENT_OPERATION_DURATION, duration);
87
+ Mem0Wrapper._setContentAttributes(span, spanName, args, response);
88
+ span.setStatus({ code: api_1.SpanStatusCode.OK });
89
+ return response;
90
+ }
91
+ catch (e) {
92
+ const duration = (Date.now() - startTime) / 1000;
93
+ span.setAttribute(semantic_convention_1.default.GEN_AI_CLIENT_OPERATION_DURATION, duration);
94
+ try {
95
+ Mem0Wrapper._setSpanAttributes(span, spanName, args, undefined, sdkVersion);
96
+ }
97
+ catch {
98
+ /* best-effort attributes on the error path */
99
+ }
100
+ helpers_1.default.handleException(span, e);
101
+ throw e;
102
+ }
103
+ finally {
104
+ span.end();
105
+ }
106
+ });
107
+ };
108
+ };
109
+ }
110
+ /** Sets every non-content attribute (core + scope + memory + operation + response). */
111
+ static _setSpanAttributes(span, spanName, args, response, sdkVersion = mem0SdkVersion) {
112
+ const applicationName = config_1.default.applicationName || '';
113
+ const environment = config_1.default.environment || '';
114
+ // Core attributes (set on every memory span).
115
+ span.setAttribute(semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME, constant_1.SDK_NAME);
116
+ // Set both provider-name keys to 'mem0': gen_ai.system (the key Python mem0 uses)
117
+ // and gen_ai.provider.name (the OTel framework convention). Same value either way.
118
+ span.setAttribute(semantic_convention_1.default.GEN_AI_PROVIDER_NAME, Mem0Wrapper.aiSystem);
119
+ span.setAttribute(semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL, Mem0Wrapper.aiSystem);
120
+ span.setAttribute(semantic_convention_1.default.GEN_AI_ENDPOINT, spanName);
121
+ span.setAttribute(semantic_convention_1.default.GEN_AI_OPERATION, semantic_convention_1.default.GEN_AI_OPERATION_TYPE_MEMORY);
122
+ span.setAttribute(semantic_convention_1.default.ATTR_DEPLOYMENT_ENVIRONMENT, environment);
123
+ span.setAttribute(semantic_conventions_1.ATTR_SERVICE_NAME, applicationName);
124
+ span.setAttribute(semantic_convention_1.default.GEN_AI_SDK_VERSION, sdkVersion);
125
+ const config = Mem0Wrapper._extractConfig(spanName, args);
126
+ // Session scope — present either at the top level of the config object or inside a
127
+ // nested `filters` object, in camelCase (v3 SDK) or snake_case (filters / hosted API).
128
+ const userId = Mem0Wrapper._scopeValue(config, 'userId', 'user_id');
129
+ const agentId = Mem0Wrapper._scopeValue(config, 'agentId', 'agent_id');
130
+ const runId = Mem0Wrapper._scopeValue(config, 'runId', 'run_id');
131
+ if (userId !== undefined)
132
+ span.setAttribute(semantic_convention_1.default.GEN_AI_USER_ID, userId);
133
+ if (agentId !== undefined)
134
+ span.setAttribute(semantic_convention_1.default.GEN_AI_AGENT_ID, agentId);
135
+ if (runId !== undefined)
136
+ span.setAttribute(semantic_convention_1.default.GEN_AI_RUN_ID, runId);
137
+ // Memory type / metadata.
138
+ const memoryType = config?.memoryType ?? config?.memory_type;
139
+ if (memoryType !== undefined) {
140
+ span.setAttribute(semantic_convention_1.default.GEN_AI_MEMORY_TYPE, memoryType);
141
+ }
142
+ if (config?.metadata !== undefined && config?.metadata !== null) {
143
+ span.setAttribute(semantic_convention_1.default.GEN_AI_MEMORY_METADATA, Mem0Wrapper._safeStringify(config.metadata));
144
+ }
145
+ Mem0Wrapper._setOperationAttributes(span, spanName, args, config);
146
+ Mem0Wrapper._setResponseAttributes(span, response);
147
+ (0, helpers_1.applyCustomSpanAttributes)(span);
148
+ }
149
+ static _setOperationAttributes(span, spanName, args, config) {
150
+ switch (spanName) {
151
+ case 'memory add': {
152
+ const messages = args[0];
153
+ if (config && Object.prototype.hasOwnProperty.call(config, 'infer')) {
154
+ span.setAttribute(semantic_convention_1.default.GEN_AI_MEMORY_INFER, config.infer);
155
+ }
156
+ if (Mem0Wrapper._hasMessages(messages)) {
157
+ const count = Array.isArray(messages) ? messages.length : 1;
158
+ span.setAttribute(semantic_convention_1.default.GEN_AI_MEMORY_COUNT, count);
159
+ }
160
+ break;
161
+ }
162
+ case 'memory search': {
163
+ const query = args[0];
164
+ if (query !== undefined) {
165
+ span.setAttribute(semantic_convention_1.default.GEN_AI_MEMORY_SEARCH_QUERY, query);
166
+ }
167
+ // v3 SDK uses `topK`; older / hosted shapes use `limit`.
168
+ const limit = config?.topK ?? config?.limit;
169
+ if (limit !== undefined) {
170
+ span.setAttribute(semantic_convention_1.default.GEN_AI_MEMORY_SEARCH_LIMIT, limit);
171
+ }
172
+ if (config?.threshold !== undefined) {
173
+ span.setAttribute(semantic_convention_1.default.GEN_AI_MEMORY_SEARCH_THRESHOLD, config.threshold);
174
+ }
175
+ break;
176
+ }
177
+ case 'memory update': {
178
+ const memoryId = args[0];
179
+ if (memoryId !== undefined)
180
+ span.setAttribute(semantic_convention_1.default.DB_UPDATE_ID, memoryId);
181
+ break;
182
+ }
183
+ case 'memory delete': {
184
+ const memoryId = args[0];
185
+ if (memoryId !== undefined)
186
+ span.setAttribute(semantic_convention_1.default.DB_DELETE_ID, memoryId);
187
+ break;
188
+ }
189
+ case 'memory get': {
190
+ const memoryId = args[0];
191
+ if (memoryId !== undefined)
192
+ span.setAttribute(semantic_convention_1.default.DB_OPERATION_ID, memoryId);
193
+ break;
194
+ }
195
+ default:
196
+ // get_all, delete_all, history: no extra operation-specific id attribute.
197
+ break;
198
+ }
199
+ }
200
+ static _setResponseAttributes(span, response) {
201
+ if (!response)
202
+ return;
203
+ let count;
204
+ if (Array.isArray(response)) {
205
+ count = response.length;
206
+ }
207
+ else if (typeof response === 'object') {
208
+ // A results array reflects the true count — an empty list is 0; a single-object
209
+ // response (e.g. get / update) counts as 1. NOTE: the Python reference reports 1
210
+ // for an empty results list (its `if results` is falsy on []); we intentionally
211
+ // report the accurate 0 here (per a Sourcery review; Python sync tracked separately).
212
+ count = Array.isArray(response.results) ? response.results.length : 1;
213
+ }
214
+ else {
215
+ count = 1;
216
+ }
217
+ span.setAttribute(semantic_convention_1.default.GEN_AI_MEMORY_OPERATION_RESULT_COUNT, count);
218
+ span.setAttribute(semantic_convention_1.default.GEN_AI_DATA_SOURCES, count);
219
+ }
220
+ /** Captures input (add) / output (search) content when capture is enabled. */
221
+ static _setContentAttributes(span, spanName, args, response) {
222
+ if (!config_1.default.captureMessageContent)
223
+ return;
224
+ try {
225
+ if (spanName === 'memory add') {
226
+ const messages = args[0];
227
+ if (Mem0Wrapper._hasMessages(messages)) {
228
+ const content = typeof messages === 'object' ? Mem0Wrapper._safeStringify(messages) : String(messages);
229
+ span.setAttribute(semantic_convention_1.default.GEN_AI_INPUT_MESSAGES, content);
230
+ }
231
+ }
232
+ if (spanName === 'memory search' && response) {
233
+ const content = typeof response === 'object' ? Mem0Wrapper._safeStringify(response) : String(response);
234
+ span.setAttribute(semantic_convention_1.default.GEN_AI_OUTPUT_MESSAGES, content);
235
+ }
236
+ }
237
+ catch {
238
+ /* best-effort content capture */
239
+ }
240
+ }
241
+ /**
242
+ * Returns the options/config object for an operation, accounting for the fact that
243
+ * its argument position differs by method: add/search take it as the 2nd arg, while
244
+ * getAll/deleteAll take it as the 1st. get/update/history take a positional id and
245
+ * carry no scope config.
246
+ */
247
+ static _extractConfig(spanName, args) {
248
+ switch (spanName) {
249
+ case 'memory add':
250
+ case 'memory search':
251
+ case 'memory delete':
252
+ return args[1] && typeof args[1] === 'object' ? args[1] : {};
253
+ case 'memory get_all':
254
+ case 'memory delete_all':
255
+ return args[0] && typeof args[0] === 'object' ? args[0] : {};
256
+ default:
257
+ return {};
258
+ }
259
+ }
260
+ static _scopeValue(config, camelKey, snakeKey) {
261
+ if (!config || typeof config !== 'object')
262
+ return undefined;
263
+ if (config[camelKey] !== undefined)
264
+ return config[camelKey];
265
+ if (config[snakeKey] !== undefined)
266
+ return config[snakeKey];
267
+ const filters = config.filters;
268
+ if (filters && typeof filters === 'object') {
269
+ if (filters[camelKey] !== undefined)
270
+ return filters[camelKey];
271
+ if (filters[snakeKey] !== undefined)
272
+ return filters[snakeKey];
273
+ }
274
+ return undefined;
275
+ }
276
+ static _hasMessages(messages) {
277
+ if (messages === undefined || messages === null)
278
+ return false;
279
+ if (Array.isArray(messages))
280
+ return messages.length > 0;
281
+ if (typeof messages === 'string')
282
+ return messages.length > 0;
283
+ return true;
284
+ }
285
+ static _safeStringify(value) {
286
+ if (typeof value === 'string')
287
+ return value;
288
+ try {
289
+ return JSON.stringify(value);
290
+ }
291
+ catch {
292
+ return String(value);
293
+ }
294
+ }
295
+ }
296
+ Mem0Wrapper.aiSystem = semantic_convention_1.default.GEN_AI_SYSTEM_MEM0;
297
+ exports.default = Mem0Wrapper;
298
+ //# sourceMappingURL=wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../../src/instrumentation/mem0/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAsF;AACtF,8EAAiG;AACjG,0DAA2C;AAC3C,6CAA0C;AAC1C,yDAA2E;AAC3E,oFAA2D;AAE3D,qFAAqF;AACrF,yFAAyF;AACzF,uFAAuF;AACvF,uFAAuF;AACvF,wFAAwF;AACxF,wFAAwF;AACxF,IAAI,cAAc,GAAG,SAAS,CAAC;AAC/B,IAAI,CAAC;IACH,8DAA8D;IAC9D,cAAc,GAAG,OAAO,CAAC,qBAAqB,CAAC,EAAE,OAAO,IAAI,SAAS,CAAC;AACxE,CAAC;AAAC,MAAM,CAAC;IACP,cAAc,GAAG,SAAS,CAAC;AAC7B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW;IAGf;;;;OAIG;IACH,MAAM,CAAC,qBAAqB,CAAC,MAAc,EAAE,QAAgB,EAAE,OAAgB;QAC7E,MAAM,UAAU,GAAG,OAAO,IAAI,cAAc,CAAC;QAC7C,OAAO,CAAC,cAAuC,EAAE,EAAE;YACjD,OAAO,KAAK,WAAsB,GAAG,IAAW;gBAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,cAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;gBACnE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBAE7B,OAAO,aAAO,CAAC,IAAI,CAAC,WAAK,CAAC,OAAO,CAAC,aAAO,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,KAAK,IAAI,EAAE;oBACpE,IAAI,CAAC;wBACH,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AAC;YAAE,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACxD,IAAI,OAAO,QAAQ,KAAK,QAAQ;YAAE,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,MAAM,CAAC,cAAc,CAAC,KAAU;QACtC,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5C,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;;AAzOM,oBAAQ,GAAG,6BAAkB,CAAC,kBAAkB,CAAC;AA4O1D,kBAAe,WAAW,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { InstrumentationBase, InstrumentationModuleDefinition } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationConfig } from '@opentelemetry/instrumentation';
3
+ export interface MilvusInstrumentationConfig extends InstrumentationConfig {
4
+ }
5
+ export default class Shield360MilvusInstrumentation extends InstrumentationBase {
6
+ constructor(config?: MilvusInstrumentationConfig);
7
+ protected init(): void | InstrumentationModuleDefinition | InstrumentationModuleDefinition[];
8
+ manualPatch(milvus: any): void;
9
+ protected _patch(moduleExports: any): void;
10
+ protected _unpatch(moduleExports: any): void;
11
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const instrumentation_1 = require("@opentelemetry/instrumentation");
7
+ const constant_1 = require("../../constant");
8
+ const wrapper_1 = __importDefault(require("./wrapper"));
9
+ class Shield360MilvusInstrumentation extends instrumentation_1.InstrumentationBase {
10
+ constructor(config = {}) {
11
+ super(`${constant_1.INSTRUMENTATION_PREFIX}/instrumentation-milvus`, '1.0.0', config);
12
+ }
13
+ init() {
14
+ const module = new instrumentation_1.InstrumentationNodeModuleDefinition('@zilliz/milvus2-sdk-node', ['>=2.0.0'], (moduleExports) => {
15
+ this._patch(moduleExports);
16
+ return moduleExports;
17
+ }, (moduleExports) => {
18
+ if (moduleExports !== undefined) {
19
+ this._unpatch(moduleExports);
20
+ }
21
+ });
22
+ return [module];
23
+ }
24
+ manualPatch(milvus) {
25
+ this._patch(milvus);
26
+ }
27
+ _patch(moduleExports) {
28
+ try {
29
+ const MilvusClient = moduleExports.MilvusClient;
30
+ if (!MilvusClient?.prototype)
31
+ return;
32
+ const patchMap = [
33
+ ['search', wrapper_1.default._patchSearch.bind(wrapper_1.default)],
34
+ ['insert', wrapper_1.default._patchInsert.bind(wrapper_1.default)],
35
+ ['delete', wrapper_1.default._patchDelete.bind(wrapper_1.default)],
36
+ ['query', wrapper_1.default._patchQuery.bind(wrapper_1.default)],
37
+ ['upsert', wrapper_1.default._patchUpsert.bind(wrapper_1.default)],
38
+ ];
39
+ for (const [method, patchFn] of patchMap) {
40
+ if (typeof MilvusClient.prototype[method] === 'function') {
41
+ if ((0, instrumentation_1.isWrapped)(MilvusClient.prototype[method])) {
42
+ this._unwrap(MilvusClient.prototype, method);
43
+ }
44
+ this._wrap(MilvusClient.prototype, method, patchFn(this.tracer));
45
+ }
46
+ }
47
+ }
48
+ catch (e) {
49
+ console.error('Error in Milvus _patch method:', e);
50
+ }
51
+ }
52
+ _unpatch(moduleExports) {
53
+ try {
54
+ const MilvusClient = moduleExports.MilvusClient;
55
+ if (!MilvusClient?.prototype)
56
+ return;
57
+ for (const method of ['search', 'insert', 'delete', 'query', 'upsert']) {
58
+ if (typeof MilvusClient.prototype[method] === 'function') {
59
+ this._unwrap(MilvusClient.prototype, method);
60
+ }
61
+ }
62
+ }
63
+ catch { /* ignore */ }
64
+ }
65
+ }
66
+ exports.default = Shield360MilvusInstrumentation;
67
+ //# sourceMappingURL=index.js.map
@@ -0,0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ACF;AA/DD,iDA+DC"}
@@ -0,0 +1,15 @@
1
+ import { Tracer } from '@opentelemetry/api';
2
+ import BaseWrapper from '../base-wrapper';
3
+ declare class MilvusWrapper extends BaseWrapper {
4
+ static dbSystem: string;
5
+ static serverAddress: string;
6
+ static serverPort: number;
7
+ static _setCommonAttributes(span: any, dbOperation: string, collectionName: string): void;
8
+ static _getCollectionName(params: any): string;
9
+ static _patchSearch(tracer: Tracer): any;
10
+ static _patchInsert(tracer: Tracer): any;
11
+ static _patchUpsert(tracer: Tracer): any;
12
+ static _patchDelete(tracer: Tracer): any;
13
+ static _patchQuery(tracer: Tracer): any;
14
+ }
15
+ export default MilvusWrapper;