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.
- package/LICENSE +201 -0
- package/README.md +310 -0
- package/dist/__tests__/manual-trace.test.d.ts +1 -0
- package/dist/__tests__/manual-trace.test.js +118 -0
- package/dist/__tests__/manual-trace.test.js.map +1 -0
- package/dist/__tests__/register.test.d.ts +0 -0
- package/dist/__tests__/register.test.js +90 -0
- package/dist/__tests__/register.test.js.map +1 -0
- package/dist/config.d.ts +28 -0
- package/dist/config.js +22 -0
- package/dist/config.js.map +1 -0
- package/dist/constant.d.ts +6 -0
- package/dist/constant.js +14 -0
- package/dist/constant.js.map +1 -0
- package/dist/evals/__tests__/offline.test.d.ts +1 -0
- package/dist/evals/__tests__/offline.test.js +427 -0
- package/dist/evals/__tests__/offline.test.js.map +1 -0
- package/dist/evals/index.d.ts +2 -0
- package/dist/evals/index.js +15 -0
- package/dist/evals/index.js.map +1 -0
- package/dist/evals/offline.d.ts +6 -0
- package/dist/evals/offline.js +350 -0
- package/dist/evals/offline.js.map +1 -0
- package/dist/evals/types.d.ts +74 -0
- package/dist/evals/types.js +23 -0
- package/dist/evals/types.js.map +1 -0
- package/dist/features/__tests__/rule-engine.test.d.ts +1 -0
- package/dist/features/__tests__/rule-engine.test.js +146 -0
- package/dist/features/__tests__/rule-engine.test.js.map +1 -0
- package/dist/features/base.d.ts +8 -0
- package/dist/features/base.js +15 -0
- package/dist/features/base.js.map +1 -0
- package/dist/features/prompt-hub.d.ts +4 -0
- package/dist/features/prompt-hub.js +66 -0
- package/dist/features/prompt-hub.js.map +1 -0
- package/dist/features/rule-engine.d.ts +6 -0
- package/dist/features/rule-engine.js +60 -0
- package/dist/features/rule-engine.js.map +1 -0
- package/dist/features/vault.d.ts +4 -0
- package/dist/features/vault.js +63 -0
- package/dist/features/vault.js.map +1 -0
- package/dist/guard/__tests__/findings.test.d.ts +1 -0
- package/dist/guard/__tests__/findings.test.js +79 -0
- package/dist/guard/__tests__/findings.test.js.map +1 -0
- package/dist/guard/__tests__/integration.test.d.ts +1 -0
- package/dist/guard/__tests__/integration.test.js +215 -0
- package/dist/guard/__tests__/integration.test.js.map +1 -0
- package/dist/guard/__tests__/pii.test.d.ts +1 -0
- package/dist/guard/__tests__/pii.test.js +131 -0
- package/dist/guard/__tests__/pii.test.js.map +1 -0
- package/dist/guard/__tests__/pipeline.test.d.ts +1 -0
- package/dist/guard/__tests__/pipeline.test.js +162 -0
- package/dist/guard/__tests__/pipeline.test.js.map +1 -0
- package/dist/guard/__tests__/prompt-injection.test.d.ts +1 -0
- package/dist/guard/__tests__/prompt-injection.test.js +92 -0
- package/dist/guard/__tests__/prompt-injection.test.js.map +1 -0
- package/dist/guard/__tests__/report.test.d.ts +1 -0
- package/dist/guard/__tests__/report.test.js +50 -0
- package/dist/guard/__tests__/report.test.js.map +1 -0
- package/dist/guard/base.d.ts +79 -0
- package/dist/guard/base.js +136 -0
- package/dist/guard/base.js.map +1 -0
- package/dist/guard/custom.d.ts +19 -0
- package/dist/guard/custom.js +46 -0
- package/dist/guard/custom.js.map +1 -0
- package/dist/guard/findings.d.ts +31 -0
- package/dist/guard/findings.js +156 -0
- package/dist/guard/findings.js.map +1 -0
- package/dist/guard/index.d.ts +24 -0
- package/dist/guard/index.js +42 -0
- package/dist/guard/index.js.map +1 -0
- package/dist/guard/integration.d.ts +44 -0
- package/dist/guard/integration.js +363 -0
- package/dist/guard/integration.js.map +1 -0
- package/dist/guard/moderation.d.ts +18 -0
- package/dist/guard/moderation.js +61 -0
- package/dist/guard/moderation.js.map +1 -0
- package/dist/guard/pii.d.ts +17 -0
- package/dist/guard/pii.js +114 -0
- package/dist/guard/pii.js.map +1 -0
- package/dist/guard/pipeline.d.ts +26 -0
- package/dist/guard/pipeline.js +139 -0
- package/dist/guard/pipeline.js.map +1 -0
- package/dist/guard/prompt-injection.d.ts +21 -0
- package/dist/guard/prompt-injection.js +70 -0
- package/dist/guard/prompt-injection.js.map +1 -0
- package/dist/guard/report.d.ts +34 -0
- package/dist/guard/report.js +182 -0
- package/dist/guard/report.js.map +1 -0
- package/dist/guard/schema.d.ts +20 -0
- package/dist/guard/schema.js +99 -0
- package/dist/guard/schema.js.map +1 -0
- package/dist/guard/sensitive-topic.d.ts +23 -0
- package/dist/guard/sensitive-topic.js +89 -0
- package/dist/guard/sensitive-topic.js.map +1 -0
- package/dist/guard/topic-restriction.d.ts +22 -0
- package/dist/guard/topic-restriction.js +54 -0
- package/dist/guard/topic-restriction.js.map +1 -0
- package/dist/helpers.d.ts +246 -0
- package/dist/helpers.js +903 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.js +234 -0
- package/dist/index.js.map +1 -0
- package/dist/instrumentation/__tests__/ai21-rag-trace-comparison.test.d.ts +13 -0
- package/dist/instrumentation/__tests__/ai21-rag-trace-comparison.test.js +176 -0
- package/dist/instrumentation/__tests__/ai21-rag-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/ai21-trace-comparison.test.d.ts +10 -0
- package/dist/instrumentation/__tests__/ai21-trace-comparison.test.js +203 -0
- package/dist/instrumentation/__tests__/ai21-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/anthropic-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/anthropic-wrapper.test.js +284 -0
- package/dist/instrumentation/__tests__/anthropic-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/assemblyai-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/assemblyai-wrapper.test.js +284 -0
- package/dist/instrumentation/__tests__/assemblyai-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/astra-trace-comparison.test.d.ts +7 -0
- package/dist/instrumentation/__tests__/astra-trace-comparison.test.js +160 -0
- package/dist/instrumentation/__tests__/astra-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/base-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/base-wrapper.test.js +171 -0
- package/dist/instrumentation/__tests__/base-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/bedrock-trace-comparison.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/bedrock-trace-comparison.test.js +422 -0
- package/dist/instrumentation/__tests__/bedrock-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/browser-use-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/browser-use-wrapper.test.js +284 -0
- package/dist/instrumentation/__tests__/browser-use-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/cache-pricing.test.d.ts +15 -0
- package/dist/instrumentation/__tests__/cache-pricing.test.js +155 -0
- package/dist/instrumentation/__tests__/cache-pricing.test.js.map +1 -0
- package/dist/instrumentation/__tests__/chroma-trace-comparison.test.d.ts +18 -0
- package/dist/instrumentation/__tests__/chroma-trace-comparison.test.js +209 -0
- package/dist/instrumentation/__tests__/chroma-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/cohere-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/cohere-wrapper.test.js +256 -0
- package/dist/instrumentation/__tests__/cohere-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/elevenlabs-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/elevenlabs-wrapper.test.js +282 -0
- package/dist/instrumentation/__tests__/elevenlabs-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/firecrawl-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/firecrawl-wrapper.test.js +238 -0
- package/dist/instrumentation/__tests__/firecrawl-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/google-ai-trace-comparison.test.d.ts +4 -0
- package/dist/instrumentation/__tests__/google-ai-trace-comparison.test.js +229 -0
- package/dist/instrumentation/__tests__/google-ai-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/gpu-collector.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/gpu-collector.test.js +247 -0
- package/dist/instrumentation/__tests__/gpu-collector.test.js.map +1 -0
- package/dist/instrumentation/__tests__/gradient-trace-comparison.test.d.ts +11 -0
- package/dist/instrumentation/__tests__/gradient-trace-comparison.test.js +391 -0
- package/dist/instrumentation/__tests__/gradient-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/groq-trace-comparison.test.d.ts +7 -0
- package/dist/instrumentation/__tests__/groq-trace-comparison.test.js +687 -0
- package/dist/instrumentation/__tests__/groq-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/helpers-genai.test.d.ts +14 -0
- package/dist/instrumentation/__tests__/helpers-genai.test.js +347 -0
- package/dist/instrumentation/__tests__/helpers-genai.test.js.map +1 -0
- package/dist/instrumentation/__tests__/huggingface-trace-comparison.test.d.ts +7 -0
- package/dist/instrumentation/__tests__/huggingface-trace-comparison.test.js +529 -0
- package/dist/instrumentation/__tests__/huggingface-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/langchain-role-map.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/langchain-role-map.test.js +19 -0
- package/dist/instrumentation/__tests__/langchain-role-map.test.js.map +1 -0
- package/dist/instrumentation/__tests__/langchain-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/langchain-wrapper.test.js +282 -0
- package/dist/instrumentation/__tests__/langchain-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/letta-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/letta-wrapper.test.js +285 -0
- package/dist/instrumentation/__tests__/letta-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/mem0-trace-comparison.test.d.ts +13 -0
- package/dist/instrumentation/__tests__/mem0-trace-comparison.test.js +208 -0
- package/dist/instrumentation/__tests__/mem0-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/milvus-trace-comparison.test.d.ts +17 -0
- package/dist/instrumentation/__tests__/milvus-trace-comparison.test.js +206 -0
- package/dist/instrumentation/__tests__/milvus-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/mistral-trace-comparison.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/mistral-trace-comparison.test.js +345 -0
- package/dist/instrumentation/__tests__/mistral-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/openai-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/openai-wrapper.test.js +179 -0
- package/dist/instrumentation/__tests__/openai-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/pg-trace-comparison.test.d.ts +21 -0
- package/dist/instrumentation/__tests__/pg-trace-comparison.test.js +455 -0
- package/dist/instrumentation/__tests__/pg-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/qdrant-trace-comparison.test.d.ts +17 -0
- package/dist/instrumentation/__tests__/qdrant-trace-comparison.test.js +182 -0
- package/dist/instrumentation/__tests__/qdrant-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/replicate-trace-comparison.test.d.ts +8 -0
- package/dist/instrumentation/__tests__/replicate-trace-comparison.test.js +346 -0
- package/dist/instrumentation/__tests__/replicate-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/together-trace-comparison.test.d.ts +4 -0
- package/dist/instrumentation/__tests__/together-trace-comparison.test.js +289 -0
- package/dist/instrumentation/__tests__/together-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/trace-comparison-utils.d.ts +67 -0
- package/dist/instrumentation/__tests__/trace-comparison-utils.js +255 -0
- package/dist/instrumentation/__tests__/trace-comparison-utils.js.map +1 -0
- package/dist/instrumentation/__tests__/transformers-trace-comparison.test.d.ts +11 -0
- package/dist/instrumentation/__tests__/transformers-trace-comparison.test.js +214 -0
- package/dist/instrumentation/__tests__/transformers-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/vercel-ai-trace-comparison.test.d.ts +8 -0
- package/dist/instrumentation/__tests__/vercel-ai-trace-comparison.test.js +446 -0
- package/dist/instrumentation/__tests__/vercel-ai-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/vertexai-trace-comparison.test.d.ts +6 -0
- package/dist/instrumentation/__tests__/vertexai-trace-comparison.test.js +409 -0
- package/dist/instrumentation/__tests__/vertexai-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/vllm-trace-comparison.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/vllm-trace-comparison.test.js +519 -0
- package/dist/instrumentation/__tests__/vllm-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/ai21/index.d.ts +11 -0
- package/dist/instrumentation/ai21/index.js +67 -0
- package/dist/instrumentation/ai21/index.js.map +1 -0
- package/dist/instrumentation/ai21/wrapper.d.ts +54 -0
- package/dist/instrumentation/ai21/wrapper.js +511 -0
- package/dist/instrumentation/ai21/wrapper.js.map +1 -0
- package/dist/instrumentation/anthropic/index.d.ts +11 -0
- package/dist/instrumentation/anthropic/index.js +45 -0
- package/dist/instrumentation/anthropic/index.js.map +1 -0
- package/dist/instrumentation/anthropic/wrapper.d.ts +34 -0
- package/dist/instrumentation/anthropic/wrapper.js +426 -0
- package/dist/instrumentation/anthropic/wrapper.js.map +1 -0
- package/dist/instrumentation/assemblyai/index.d.ts +12 -0
- package/dist/instrumentation/assemblyai/index.js +91 -0
- package/dist/instrumentation/assemblyai/index.js.map +1 -0
- package/dist/instrumentation/assemblyai/wrapper.d.ts +35 -0
- package/dist/instrumentation/assemblyai/wrapper.js +238 -0
- package/dist/instrumentation/assemblyai/wrapper.js.map +1 -0
- package/dist/instrumentation/astra/index.d.ts +11 -0
- package/dist/instrumentation/astra/index.js +87 -0
- package/dist/instrumentation/astra/index.js.map +1 -0
- package/dist/instrumentation/astra/wrapper.d.ts +39 -0
- package/dist/instrumentation/astra/wrapper.js +349 -0
- package/dist/instrumentation/astra/wrapper.js.map +1 -0
- package/dist/instrumentation/azure-ai-inference/index.d.ts +11 -0
- package/dist/instrumentation/azure-ai-inference/index.js +76 -0
- package/dist/instrumentation/azure-ai-inference/index.js.map +1 -0
- package/dist/instrumentation/azure-ai-inference/wrapper.d.ts +55 -0
- package/dist/instrumentation/azure-ai-inference/wrapper.js +580 -0
- package/dist/instrumentation/azure-ai-inference/wrapper.js.map +1 -0
- package/dist/instrumentation/base-wrapper.d.ts +16 -0
- package/dist/instrumentation/base-wrapper.js +139 -0
- package/dist/instrumentation/base-wrapper.js.map +1 -0
- package/dist/instrumentation/bedrock/index.d.ts +11 -0
- package/dist/instrumentation/bedrock/index.js +52 -0
- package/dist/instrumentation/bedrock/index.js.map +1 -0
- package/dist/instrumentation/bedrock/wrapper.d.ts +41 -0
- package/dist/instrumentation/bedrock/wrapper.js +494 -0
- package/dist/instrumentation/bedrock/wrapper.js.map +1 -0
- package/dist/instrumentation/browser-use/index.d.ts +11 -0
- package/dist/instrumentation/browser-use/index.js +98 -0
- package/dist/instrumentation/browser-use/index.js.map +1 -0
- package/dist/instrumentation/browser-use/wrapper.d.ts +12 -0
- package/dist/instrumentation/browser-use/wrapper.js +706 -0
- package/dist/instrumentation/browser-use/wrapper.js.map +1 -0
- package/dist/instrumentation/chroma/index.d.ts +11 -0
- package/dist/instrumentation/chroma/index.js +70 -0
- package/dist/instrumentation/chroma/index.js.map +1 -0
- package/dist/instrumentation/chroma/wrapper.d.ts +10 -0
- package/dist/instrumentation/chroma/wrapper.js +127 -0
- package/dist/instrumentation/chroma/wrapper.js.map +1 -0
- package/dist/instrumentation/claude-agent-sdk/index.d.ts +23 -0
- package/dist/instrumentation/claude-agent-sdk/index.js +83 -0
- package/dist/instrumentation/claude-agent-sdk/index.js.map +1 -0
- package/dist/instrumentation/claude-agent-sdk/wrapper.d.ts +13 -0
- package/dist/instrumentation/claude-agent-sdk/wrapper.js +1123 -0
- package/dist/instrumentation/claude-agent-sdk/wrapper.js.map +1 -0
- package/dist/instrumentation/cohere/index.d.ts +11 -0
- package/dist/instrumentation/cohere/index.js +53 -0
- package/dist/instrumentation/cohere/index.js.map +1 -0
- package/dist/instrumentation/cohere/wrapper.d.ts +50 -0
- package/dist/instrumentation/cohere/wrapper.js +452 -0
- package/dist/instrumentation/cohere/wrapper.js.map +1 -0
- package/dist/instrumentation/cursor-sdk/index.d.ts +21 -0
- package/dist/instrumentation/cursor-sdk/index.js +58 -0
- package/dist/instrumentation/cursor-sdk/index.js.map +1 -0
- package/dist/instrumentation/cursor-sdk/wrapper.d.ts +17 -0
- package/dist/instrumentation/cursor-sdk/wrapper.js +789 -0
- package/dist/instrumentation/cursor-sdk/wrapper.js.map +1 -0
- package/dist/instrumentation/elevenlabs/index.d.ts +12 -0
- package/dist/instrumentation/elevenlabs/index.js +92 -0
- package/dist/instrumentation/elevenlabs/index.js.map +1 -0
- package/dist/instrumentation/elevenlabs/wrapper.d.ts +34 -0
- package/dist/instrumentation/elevenlabs/wrapper.js +280 -0
- package/dist/instrumentation/elevenlabs/wrapper.js.map +1 -0
- package/dist/instrumentation/firecrawl/index.d.ts +13 -0
- package/dist/instrumentation/firecrawl/index.js +115 -0
- package/dist/instrumentation/firecrawl/index.js.map +1 -0
- package/dist/instrumentation/firecrawl/wrapper.d.ts +22 -0
- package/dist/instrumentation/firecrawl/wrapper.js +378 -0
- package/dist/instrumentation/firecrawl/wrapper.js.map +1 -0
- package/dist/instrumentation/google-adk/index.d.ts +57 -0
- package/dist/instrumentation/google-adk/index.js +371 -0
- package/dist/instrumentation/google-adk/index.js.map +1 -0
- package/dist/instrumentation/google-adk/utils.d.ts +45 -0
- package/dist/instrumentation/google-adk/utils.js +663 -0
- package/dist/instrumentation/google-adk/utils.js.map +1 -0
- package/dist/instrumentation/google-adk/wrapper.d.ts +11 -0
- package/dist/instrumentation/google-adk/wrapper.js +391 -0
- package/dist/instrumentation/google-adk/wrapper.js.map +1 -0
- package/dist/instrumentation/google-ai/index.d.ts +11 -0
- package/dist/instrumentation/google-ai/index.js +48 -0
- package/dist/instrumentation/google-ai/index.js.map +1 -0
- package/dist/instrumentation/google-ai/wrapper.d.ts +52 -0
- package/dist/instrumentation/google-ai/wrapper.js +466 -0
- package/dist/instrumentation/google-ai/wrapper.js.map +1 -0
- package/dist/instrumentation/gpu/index.d.ts +38 -0
- package/dist/instrumentation/gpu/index.js +233 -0
- package/dist/instrumentation/gpu/index.js.map +1 -0
- package/dist/instrumentation/gradient/index.d.ts +12 -0
- package/dist/instrumentation/gradient/index.js +74 -0
- package/dist/instrumentation/gradient/index.js.map +1 -0
- package/dist/instrumentation/gradient/utils.d.ts +14 -0
- package/dist/instrumentation/gradient/utils.js +119 -0
- package/dist/instrumentation/gradient/utils.js.map +1 -0
- package/dist/instrumentation/gradient/wrapper.d.ts +76 -0
- package/dist/instrumentation/gradient/wrapper.js +584 -0
- package/dist/instrumentation/gradient/wrapper.js.map +1 -0
- package/dist/instrumentation/groq/index.d.ts +11 -0
- package/dist/instrumentation/groq/index.js +43 -0
- package/dist/instrumentation/groq/index.js.map +1 -0
- package/dist/instrumentation/groq/wrapper.d.ts +35 -0
- package/dist/instrumentation/groq/wrapper.js +442 -0
- package/dist/instrumentation/groq/wrapper.js.map +1 -0
- package/dist/instrumentation/huggingface/index.d.ts +13 -0
- package/dist/instrumentation/huggingface/index.js +110 -0
- package/dist/instrumentation/huggingface/index.js.map +1 -0
- package/dist/instrumentation/huggingface/wrapper.d.ts +54 -0
- package/dist/instrumentation/huggingface/wrapper.js +514 -0
- package/dist/instrumentation/huggingface/wrapper.js.map +1 -0
- package/dist/instrumentation/index.d.ts +7 -0
- package/dist/instrumentation/index.js +176 -0
- package/dist/instrumentation/index.js.map +1 -0
- package/dist/instrumentation/langchain/index.d.ts +16 -0
- package/dist/instrumentation/langchain/index.js +91 -0
- package/dist/instrumentation/langchain/index.js.map +1 -0
- package/dist/instrumentation/langchain/wrapper.d.ts +41 -0
- package/dist/instrumentation/langchain/wrapper.js +1235 -0
- package/dist/instrumentation/langchain/wrapper.js.map +1 -0
- package/dist/instrumentation/langgraph/index.d.ts +12 -0
- package/dist/instrumentation/langgraph/index.js +99 -0
- package/dist/instrumentation/langgraph/index.js.map +1 -0
- package/dist/instrumentation/langgraph/wrapper.d.ts +20 -0
- package/dist/instrumentation/langgraph/wrapper.js +620 -0
- package/dist/instrumentation/langgraph/wrapper.js.map +1 -0
- package/dist/instrumentation/letta/index.d.ts +10 -0
- package/dist/instrumentation/letta/index.js +122 -0
- package/dist/instrumentation/letta/index.js.map +1 -0
- package/dist/instrumentation/letta/utils.d.ts +24 -0
- package/dist/instrumentation/letta/utils.js +343 -0
- package/dist/instrumentation/letta/utils.js.map +1 -0
- package/dist/instrumentation/letta/wrapper.d.ts +37 -0
- package/dist/instrumentation/letta/wrapper.js +180 -0
- package/dist/instrumentation/letta/wrapper.js.map +1 -0
- package/dist/instrumentation/llamaindex/index.d.ts +36 -0
- package/dist/instrumentation/llamaindex/index.js +221 -0
- package/dist/instrumentation/llamaindex/index.js.map +1 -0
- package/dist/instrumentation/llamaindex/wrapper.d.ts +36 -0
- package/dist/instrumentation/llamaindex/wrapper.js +811 -0
- package/dist/instrumentation/llamaindex/wrapper.js.map +1 -0
- package/dist/instrumentation/mcp/index.d.ts +20 -0
- package/dist/instrumentation/mcp/index.js +282 -0
- package/dist/instrumentation/mcp/index.js.map +1 -0
- package/dist/instrumentation/mcp/wrapper.d.ts +72 -0
- package/dist/instrumentation/mcp/wrapper.js +571 -0
- package/dist/instrumentation/mcp/wrapper.js.map +1 -0
- package/dist/instrumentation/mem0/index.d.ts +17 -0
- package/dist/instrumentation/mem0/index.js +113 -0
- package/dist/instrumentation/mem0/index.js.map +1 -0
- package/dist/instrumentation/mem0/wrapper.d.ts +37 -0
- package/dist/instrumentation/mem0/wrapper.js +298 -0
- package/dist/instrumentation/mem0/wrapper.js.map +1 -0
- package/dist/instrumentation/milvus/index.d.ts +11 -0
- package/dist/instrumentation/milvus/index.js +67 -0
- package/dist/instrumentation/milvus/index.js.map +1 -0
- package/dist/instrumentation/milvus/wrapper.d.ts +15 -0
- package/dist/instrumentation/milvus/wrapper.js +219 -0
- package/dist/instrumentation/milvus/wrapper.js.map +1 -0
- package/dist/instrumentation/mistral/index.d.ts +11 -0
- package/dist/instrumentation/mistral/index.js +66 -0
- package/dist/instrumentation/mistral/index.js.map +1 -0
- package/dist/instrumentation/mistral/wrapper.d.ts +49 -0
- package/dist/instrumentation/mistral/wrapper.js +482 -0
- package/dist/instrumentation/mistral/wrapper.js.map +1 -0
- package/dist/instrumentation/ollama/index.d.ts +11 -0
- package/dist/instrumentation/ollama/index.js +72 -0
- package/dist/instrumentation/ollama/index.js.map +1 -0
- package/dist/instrumentation/ollama/wrapper.d.ts +73 -0
- package/dist/instrumentation/ollama/wrapper.js +629 -0
- package/dist/instrumentation/ollama/wrapper.js.map +1 -0
- package/dist/instrumentation/openai/index.d.ts +11 -0
- package/dist/instrumentation/openai/index.js +79 -0
- package/dist/instrumentation/openai/index.js.map +1 -0
- package/dist/instrumentation/openai/wrapper.d.ts +80 -0
- package/dist/instrumentation/openai/wrapper.js +1121 -0
- package/dist/instrumentation/openai/wrapper.js.map +1 -0
- package/dist/instrumentation/openai-agents/index.d.ts +20 -0
- package/dist/instrumentation/openai-agents/index.js +174 -0
- package/dist/instrumentation/openai-agents/index.js.map +1 -0
- package/dist/instrumentation/openai-agents/processor.d.ts +35 -0
- package/dist/instrumentation/openai-agents/processor.js +249 -0
- package/dist/instrumentation/openai-agents/processor.js.map +1 -0
- package/dist/instrumentation/openai-agents/utils.d.ts +20 -0
- package/dist/instrumentation/openai-agents/utils.js +624 -0
- package/dist/instrumentation/openai-agents/utils.js.map +1 -0
- package/dist/instrumentation/pg/index.d.ts +20 -0
- package/dist/instrumentation/pg/index.js +74 -0
- package/dist/instrumentation/pg/index.js.map +1 -0
- package/dist/instrumentation/pg/wrapper.d.ts +66 -0
- package/dist/instrumentation/pg/wrapper.js +441 -0
- package/dist/instrumentation/pg/wrapper.js.map +1 -0
- package/dist/instrumentation/pinecone/index.d.ts +11 -0
- package/dist/instrumentation/pinecone/index.js +79 -0
- package/dist/instrumentation/pinecone/index.js.map +1 -0
- package/dist/instrumentation/pinecone/wrapper.d.ts +14 -0
- package/dist/instrumentation/pinecone/wrapper.js +198 -0
- package/dist/instrumentation/pinecone/wrapper.js.map +1 -0
- package/dist/instrumentation/qdrant/index.d.ts +11 -0
- package/dist/instrumentation/qdrant/index.js +67 -0
- package/dist/instrumentation/qdrant/index.js.map +1 -0
- package/dist/instrumentation/qdrant/wrapper.d.ts +14 -0
- package/dist/instrumentation/qdrant/wrapper.js +213 -0
- package/dist/instrumentation/qdrant/wrapper.js.map +1 -0
- package/dist/instrumentation/replicate/index.d.ts +11 -0
- package/dist/instrumentation/replicate/index.js +57 -0
- package/dist/instrumentation/replicate/index.js.map +1 -0
- package/dist/instrumentation/replicate/wrapper.d.ts +28 -0
- package/dist/instrumentation/replicate/wrapper.js +242 -0
- package/dist/instrumentation/replicate/wrapper.js.map +1 -0
- package/dist/instrumentation/strands/index.d.ts +21 -0
- package/dist/instrumentation/strands/index.js +83 -0
- package/dist/instrumentation/strands/index.js.map +1 -0
- package/dist/instrumentation/strands/processor.d.ts +51 -0
- package/dist/instrumentation/strands/processor.js +625 -0
- package/dist/instrumentation/strands/processor.js.map +1 -0
- package/dist/instrumentation/strands/utils.d.ts +24 -0
- package/dist/instrumentation/strands/utils.js +373 -0
- package/dist/instrumentation/strands/utils.js.map +1 -0
- package/dist/instrumentation/together/index.d.ts +11 -0
- package/dist/instrumentation/together/index.js +43 -0
- package/dist/instrumentation/together/index.js.map +1 -0
- package/dist/instrumentation/together/wrapper.d.ts +48 -0
- package/dist/instrumentation/together/wrapper.js +409 -0
- package/dist/instrumentation/together/wrapper.js.map +1 -0
- package/dist/instrumentation/transformers/index.d.ts +35 -0
- package/dist/instrumentation/transformers/index.js +119 -0
- package/dist/instrumentation/transformers/index.js.map +1 -0
- package/dist/instrumentation/transformers/wrapper.d.ts +49 -0
- package/dist/instrumentation/transformers/wrapper.js +472 -0
- package/dist/instrumentation/transformers/wrapper.js.map +1 -0
- package/dist/instrumentation/vercel-ai/index.d.ts +10 -0
- package/dist/instrumentation/vercel-ai/index.js +59 -0
- package/dist/instrumentation/vercel-ai/index.js.map +1 -0
- package/dist/instrumentation/vercel-ai/wrapper.d.ts +50 -0
- package/dist/instrumentation/vercel-ai/wrapper.js +539 -0
- package/dist/instrumentation/vercel-ai/wrapper.js.map +1 -0
- package/dist/instrumentation/vertexai/index.d.ts +11 -0
- package/dist/instrumentation/vertexai/index.js +70 -0
- package/dist/instrumentation/vertexai/index.js.map +1 -0
- package/dist/instrumentation/vertexai/wrapper.d.ts +67 -0
- package/dist/instrumentation/vertexai/wrapper.js +530 -0
- package/dist/instrumentation/vertexai/wrapper.js.map +1 -0
- package/dist/instrumentation/vllm/index.d.ts +13 -0
- package/dist/instrumentation/vllm/index.js +67 -0
- package/dist/instrumentation/vllm/index.js.map +1 -0
- package/dist/instrumentation/vllm/wrapper.d.ts +60 -0
- package/dist/instrumentation/vllm/wrapper.js +482 -0
- package/dist/instrumentation/vllm/wrapper.js.map +1 -0
- package/dist/llm/anthropic.d.ts +5 -0
- package/dist/llm/anthropic.js +39 -0
- package/dist/llm/anthropic.js.map +1 -0
- package/dist/llm/index.d.ts +10 -0
- package/dist/llm/index.js +93 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/openai.d.ts +6 -0
- package/dist/llm/openai.js +52 -0
- package/dist/llm/openai.js.map +1 -0
- package/dist/llm/providers.d.ts +7 -0
- package/dist/llm/providers.js +10 -0
- package/dist/llm/providers.js.map +1 -0
- package/dist/manual-trace.d.ts +40 -0
- package/dist/manual-trace.js +103 -0
- package/dist/manual-trace.js.map +1 -0
- package/dist/otel/__tests__/metrics.test.d.ts +1 -0
- package/dist/otel/__tests__/metrics.test.js +40 -0
- package/dist/otel/__tests__/metrics.test.js.map +1 -0
- package/dist/otel/events.d.ts +11 -0
- package/dist/otel/events.js +74 -0
- package/dist/otel/events.js.map +1 -0
- package/dist/otel/metrics.d.ts +35 -0
- package/dist/otel/metrics.js +219 -0
- package/dist/otel/metrics.js.map +1 -0
- package/dist/otel/tracing.d.ts +12 -0
- package/dist/otel/tracing.js +93 -0
- package/dist/otel/tracing.js.map +1 -0
- package/dist/otel/utils.d.ts +11 -0
- package/dist/otel/utils.js +34 -0
- package/dist/otel/utils.js.map +1 -0
- package/dist/pricing.json +951 -0
- package/dist/prompt-hub.d.ts +4 -0
- package/dist/prompt-hub.js +66 -0
- package/dist/prompt-hub.js.map +1 -0
- package/dist/register.d.ts +4 -0
- package/dist/register.js +52 -0
- package/dist/register.js.map +1 -0
- package/dist/score/__tests__/score.test.d.ts +1 -0
- package/dist/score/__tests__/score.test.js +143 -0
- package/dist/score/__tests__/score.test.js.map +1 -0
- package/dist/score/index.d.ts +2 -0
- package/dist/score/index.js +6 -0
- package/dist/score/index.js.map +1 -0
- package/dist/score/score.d.ts +15 -0
- package/dist/score/score.js +135 -0
- package/dist/score/score.js.map +1 -0
- package/dist/semantic-convention.d.ts +555 -0
- package/dist/semantic-convention.js +630 -0
- package/dist/semantic-convention.js.map +1 -0
- package/dist/types.d.ts +131 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +136 -0
|
@@ -0,0 +1,494 @@
|
|
|
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 config_1 = __importDefault(require("../../config"));
|
|
41
|
+
const helpers_1 = __importStar(require("../../helpers"));
|
|
42
|
+
const semantic_convention_1 = __importDefault(require("../../semantic-convention"));
|
|
43
|
+
const base_wrapper_1 = __importDefault(require("../base-wrapper"));
|
|
44
|
+
function mapFinishReason(stopReason) {
|
|
45
|
+
const map = {
|
|
46
|
+
end_turn: 'stop',
|
|
47
|
+
max_tokens: 'max_tokens',
|
|
48
|
+
stop_sequence: 'stop',
|
|
49
|
+
tool_use: 'tool_calls',
|
|
50
|
+
content_filtered: 'content_filter',
|
|
51
|
+
guardrail_intervention: 'content_filter',
|
|
52
|
+
};
|
|
53
|
+
return map[stopReason] || stopReason;
|
|
54
|
+
}
|
|
55
|
+
function spanCreationAttrs(operationName, requestModel) {
|
|
56
|
+
return {
|
|
57
|
+
[semantic_convention_1.default.GEN_AI_OPERATION]: operationName,
|
|
58
|
+
[semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL]: semantic_convention_1.default.GEN_AI_SYSTEM_AWS_BEDROCK,
|
|
59
|
+
[semantic_convention_1.default.GEN_AI_REQUEST_MODEL]: requestModel,
|
|
60
|
+
[semantic_convention_1.default.SERVER_ADDRESS]: BedrockWrapper.serverAddress,
|
|
61
|
+
[semantic_convention_1.default.SERVER_PORT]: BedrockWrapper.serverPort,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Convert Bedrock message content blocks ({text: "..."}) to the format
|
|
66
|
+
* expected by Shield360Helper.buildInputMessages ({type: "text", text: "..."}).
|
|
67
|
+
*/
|
|
68
|
+
function convertBedrockMessages(messages) {
|
|
69
|
+
return (messages || []).map((m) => {
|
|
70
|
+
const role = m.role || 'user';
|
|
71
|
+
const content = m.content;
|
|
72
|
+
if (!Array.isArray(content)) {
|
|
73
|
+
return { role, content: typeof content === 'string' ? content : '' };
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
role,
|
|
77
|
+
content: content.map((c) => {
|
|
78
|
+
if (c.text !== undefined)
|
|
79
|
+
return { type: 'text', text: c.text };
|
|
80
|
+
if (c.toolUse) {
|
|
81
|
+
return {
|
|
82
|
+
type: 'tool_use',
|
|
83
|
+
id: c.toolUse.toolUseId || '',
|
|
84
|
+
name: c.toolUse.name || '',
|
|
85
|
+
input: c.toolUse.input || {},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (c.toolResult) {
|
|
89
|
+
const rc = c.toolResult.content;
|
|
90
|
+
return {
|
|
91
|
+
type: 'tool_result',
|
|
92
|
+
tool_use_id: c.toolResult.toolUseId || '',
|
|
93
|
+
content: typeof rc === 'string' ? rc : JSON.stringify(rc || ''),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return c;
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
class BedrockWrapper extends base_wrapper_1.default {
|
|
102
|
+
/**
|
|
103
|
+
* Stamp `shield360.agent.version_hash` (auto) and `gen_ai.agent.version`
|
|
104
|
+
* (user override, if set) on the span and return the same attributes so
|
|
105
|
+
* the caller can merge them into the inference event extras.
|
|
106
|
+
*/
|
|
107
|
+
static _stampAgentVersion(span, args) {
|
|
108
|
+
const out = {};
|
|
109
|
+
try {
|
|
110
|
+
const versionHash = helpers_1.default.computeAgentVersionHash({
|
|
111
|
+
systemInstructions: args.systemInstructionsJson ?? null,
|
|
112
|
+
toolDefinitions: args.toolDefinitionsJson ?? null,
|
|
113
|
+
primaryModel: args.primaryModel ?? null,
|
|
114
|
+
runtimeConfig: {
|
|
115
|
+
temperature: args.temperature ?? null,
|
|
116
|
+
top_p: args.top_p ?? null,
|
|
117
|
+
max_tokens: args.max_tokens ?? null,
|
|
118
|
+
provider: semantic_convention_1.default.GEN_AI_SYSTEM_AWS_BEDROCK,
|
|
119
|
+
},
|
|
120
|
+
providers: [semantic_convention_1.default.GEN_AI_SYSTEM_AWS_BEDROCK],
|
|
121
|
+
});
|
|
122
|
+
if (versionHash) {
|
|
123
|
+
out[semantic_convention_1.default.SHIELD360_AGENT_VERSION_HASH] = versionHash;
|
|
124
|
+
span.setAttribute(semantic_convention_1.default.SHIELD360_AGENT_VERSION_HASH, versionHash);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// Hash computation must never fail the wrapped call.
|
|
129
|
+
}
|
|
130
|
+
const versionLabel = (0, helpers_1.getCurrentAgentVersion)();
|
|
131
|
+
if (versionLabel) {
|
|
132
|
+
out[semantic_convention_1.default.GEN_AI_AGENT_VERSION] = versionLabel;
|
|
133
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_AGENT_VERSION, versionLabel);
|
|
134
|
+
}
|
|
135
|
+
return out;
|
|
136
|
+
}
|
|
137
|
+
static _patchSend(tracer) {
|
|
138
|
+
return (originalMethod) => {
|
|
139
|
+
return async function (...args) {
|
|
140
|
+
if ((0, helpers_1.isFrameworkLlmActive)())
|
|
141
|
+
return originalMethod.apply(this, args);
|
|
142
|
+
const command = args[0];
|
|
143
|
+
if (!command)
|
|
144
|
+
return originalMethod.apply(this, args);
|
|
145
|
+
const commandName = command.constructor?.name || '';
|
|
146
|
+
if (commandName === 'ConverseCommand') {
|
|
147
|
+
return BedrockWrapper._handleConverseCommand(tracer, originalMethod, this, args);
|
|
148
|
+
}
|
|
149
|
+
if (commandName === 'ConverseStreamCommand') {
|
|
150
|
+
return BedrockWrapper._handleConverseStreamCommand(tracer, originalMethod, this, args);
|
|
151
|
+
}
|
|
152
|
+
return originalMethod.apply(this, args);
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
static async _handleConverseCommand(tracer, originalMethod, instance, args) {
|
|
157
|
+
const command = args[0];
|
|
158
|
+
const input = command.input || {};
|
|
159
|
+
const modelId = input.modelId || 'amazon.titan-text-express-v1';
|
|
160
|
+
const genAIEndpoint = 'bedrock.converse';
|
|
161
|
+
const spanName = `${semantic_convention_1.default.GEN_AI_OPERATION_TYPE_CHAT} ${modelId}`;
|
|
162
|
+
const effectiveCtx = (0, helpers_1.getFrameworkParentContext)() ?? api_1.context.active();
|
|
163
|
+
const span = tracer.startSpan(spanName, {
|
|
164
|
+
kind: api_1.SpanKind.CLIENT,
|
|
165
|
+
attributes: spanCreationAttrs(semantic_convention_1.default.GEN_AI_OPERATION_TYPE_CHAT, modelId),
|
|
166
|
+
}, effectiveCtx);
|
|
167
|
+
return api_1.context
|
|
168
|
+
.with(api_1.trace.setSpan(effectiveCtx, span), async () => {
|
|
169
|
+
return originalMethod.apply(instance, args);
|
|
170
|
+
})
|
|
171
|
+
.then((response) => {
|
|
172
|
+
return BedrockWrapper._converseComplete({ input, genAIEndpoint, response, span, modelId });
|
|
173
|
+
})
|
|
174
|
+
.catch((e) => {
|
|
175
|
+
helpers_1.default.handleException(span, e);
|
|
176
|
+
base_wrapper_1.default.recordMetrics(span, {
|
|
177
|
+
genAIEndpoint,
|
|
178
|
+
model: modelId,
|
|
179
|
+
aiSystem: BedrockWrapper.aiSystem,
|
|
180
|
+
serverAddress: BedrockWrapper.serverAddress,
|
|
181
|
+
serverPort: BedrockWrapper.serverPort,
|
|
182
|
+
errorType: e?.constructor?.name || '_OTHER',
|
|
183
|
+
});
|
|
184
|
+
span.end();
|
|
185
|
+
throw e;
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
static async _converseComplete({ input, genAIEndpoint, response, span, modelId, }) {
|
|
189
|
+
let metricParams;
|
|
190
|
+
try {
|
|
191
|
+
metricParams = BedrockWrapper._converseCommonSetter({
|
|
192
|
+
input,
|
|
193
|
+
genAIEndpoint,
|
|
194
|
+
result: response,
|
|
195
|
+
span,
|
|
196
|
+
modelId,
|
|
197
|
+
isStream: false,
|
|
198
|
+
});
|
|
199
|
+
return response;
|
|
200
|
+
}
|
|
201
|
+
catch (e) {
|
|
202
|
+
helpers_1.default.handleException(span, e);
|
|
203
|
+
throw e;
|
|
204
|
+
}
|
|
205
|
+
finally {
|
|
206
|
+
span.end();
|
|
207
|
+
if (metricParams) {
|
|
208
|
+
base_wrapper_1.default.recordMetrics(span, metricParams);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
static async _handleConverseStreamCommand(tracer, originalMethod, instance, args) {
|
|
213
|
+
const command = args[0];
|
|
214
|
+
const input = command.input || {};
|
|
215
|
+
const modelId = input.modelId || 'amazon.titan-text-express-v1';
|
|
216
|
+
const genAIEndpoint = 'bedrock.converse_stream';
|
|
217
|
+
const startTime = Date.now();
|
|
218
|
+
const spanName = `${semantic_convention_1.default.GEN_AI_OPERATION_TYPE_CHAT} ${modelId}`;
|
|
219
|
+
const effectiveCtx = (0, helpers_1.getFrameworkParentContext)() ?? api_1.context.active();
|
|
220
|
+
const span = tracer.startSpan(spanName, {
|
|
221
|
+
kind: api_1.SpanKind.CLIENT,
|
|
222
|
+
attributes: spanCreationAttrs(semantic_convention_1.default.GEN_AI_OPERATION_TYPE_CHAT, modelId),
|
|
223
|
+
}, effectiveCtx);
|
|
224
|
+
let response;
|
|
225
|
+
try {
|
|
226
|
+
response = await api_1.context.with(api_1.trace.setSpan(effectiveCtx, span), () => originalMethod.apply(instance, args));
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
helpers_1.default.handleException(span, e);
|
|
230
|
+
base_wrapper_1.default.recordMetrics(span, {
|
|
231
|
+
genAIEndpoint,
|
|
232
|
+
model: modelId,
|
|
233
|
+
aiSystem: BedrockWrapper.aiSystem,
|
|
234
|
+
serverAddress: BedrockWrapper.serverAddress,
|
|
235
|
+
serverPort: BedrockWrapper.serverPort,
|
|
236
|
+
errorType: e?.constructor?.name || '_OTHER',
|
|
237
|
+
});
|
|
238
|
+
span.end();
|
|
239
|
+
throw e;
|
|
240
|
+
}
|
|
241
|
+
let llmResponse = '';
|
|
242
|
+
let finishReason = 'stop';
|
|
243
|
+
let inputTokens = 0;
|
|
244
|
+
let outputTokens = 0;
|
|
245
|
+
let cacheReadTokens = 0;
|
|
246
|
+
let cacheWriteTokens = 0;
|
|
247
|
+
const timestamps = [];
|
|
248
|
+
const originalStream = response.stream;
|
|
249
|
+
async function* wrappedStream() {
|
|
250
|
+
try {
|
|
251
|
+
for await (const event of originalStream) {
|
|
252
|
+
timestamps.push(Date.now());
|
|
253
|
+
if (event.contentBlockDelta?.delta?.text)
|
|
254
|
+
llmResponse += event.contentBlockDelta.delta.text;
|
|
255
|
+
if (event.messageStop?.stopReason)
|
|
256
|
+
finishReason = mapFinishReason(event.messageStop.stopReason);
|
|
257
|
+
if (event.metadata?.usage) {
|
|
258
|
+
inputTokens = event.metadata.usage.inputTokens || 0;
|
|
259
|
+
outputTokens = event.metadata.usage.outputTokens || 0;
|
|
260
|
+
cacheReadTokens = event.metadata.usage.cacheReadInputTokens || 0;
|
|
261
|
+
cacheWriteTokens = event.metadata.usage.cacheWriteInputTokens || 0;
|
|
262
|
+
}
|
|
263
|
+
yield event;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
try {
|
|
268
|
+
const ttft = timestamps.length > 0 ? (timestamps[0] - startTime) / 1000 : 0;
|
|
269
|
+
let tbt = 0;
|
|
270
|
+
if (timestamps.length > 1) {
|
|
271
|
+
const timeDiffs = timestamps.slice(1).map((t, i) => t - timestamps[i]);
|
|
272
|
+
tbt = timeDiffs.reduce((a, b) => a + b, 0) / timeDiffs.length / 1000;
|
|
273
|
+
}
|
|
274
|
+
const result = {
|
|
275
|
+
output: { message: { content: [{ text: llmResponse }] } },
|
|
276
|
+
stopReason: finishReason,
|
|
277
|
+
usage: {
|
|
278
|
+
inputTokens,
|
|
279
|
+
outputTokens,
|
|
280
|
+
cacheReadInputTokens: cacheReadTokens,
|
|
281
|
+
cacheWriteInputTokens: cacheWriteTokens,
|
|
282
|
+
},
|
|
283
|
+
$metadata: response.$metadata,
|
|
284
|
+
};
|
|
285
|
+
const metricParams = BedrockWrapper._converseCommonSetter({
|
|
286
|
+
input,
|
|
287
|
+
genAIEndpoint,
|
|
288
|
+
result,
|
|
289
|
+
span,
|
|
290
|
+
modelId,
|
|
291
|
+
isStream: true,
|
|
292
|
+
ttft,
|
|
293
|
+
tbt,
|
|
294
|
+
});
|
|
295
|
+
base_wrapper_1.default.recordMetrics(span, metricParams);
|
|
296
|
+
}
|
|
297
|
+
catch { /* ignore telemetry errors in finally */ }
|
|
298
|
+
finally {
|
|
299
|
+
span.end();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return { ...response, stream: wrappedStream() };
|
|
304
|
+
}
|
|
305
|
+
static _converseCommonSetter({ input, genAIEndpoint, result, span, modelId, isStream, ttft = 0, tbt = 0, }) {
|
|
306
|
+
const captureContent = config_1.default.captureMessageContent;
|
|
307
|
+
const inferenceConfig = input.inferenceConfig || {};
|
|
308
|
+
if (inferenceConfig.temperature !== undefined) {
|
|
309
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_TEMPERATURE, inferenceConfig.temperature);
|
|
310
|
+
}
|
|
311
|
+
if (inferenceConfig.topP !== undefined) {
|
|
312
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_TOP_P, inferenceConfig.topP);
|
|
313
|
+
}
|
|
314
|
+
if (inferenceConfig.topK !== undefined) {
|
|
315
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_TOP_K, inferenceConfig.topK);
|
|
316
|
+
}
|
|
317
|
+
if (inferenceConfig.maxTokens != null) {
|
|
318
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_MAX_TOKENS, inferenceConfig.maxTokens);
|
|
319
|
+
}
|
|
320
|
+
if (inferenceConfig.stopSequences) {
|
|
321
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_STOP_SEQUENCES, inferenceConfig.stopSequences);
|
|
322
|
+
}
|
|
323
|
+
if (inferenceConfig.frequencyPenalty) {
|
|
324
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_FREQUENCY_PENALTY, inferenceConfig.frequencyPenalty);
|
|
325
|
+
}
|
|
326
|
+
if (inferenceConfig.presencePenalty) {
|
|
327
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_PRESENCE_PENALTY, inferenceConfig.presencePenalty);
|
|
328
|
+
}
|
|
329
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_IS_STREAM, isStream);
|
|
330
|
+
const usage = result.usage || {};
|
|
331
|
+
const inputTokens = usage.inputTokens || 0;
|
|
332
|
+
const outputTokens = usage.outputTokens || 0;
|
|
333
|
+
const cacheReadTokens = usage.cacheReadInputTokens || 0;
|
|
334
|
+
const cacheWriteTokens = usage.cacheWriteInputTokens || 0;
|
|
335
|
+
const responseModel = modelId;
|
|
336
|
+
const finishReason = mapFinishReason(result.stopReason || 'stop');
|
|
337
|
+
// Bedrock Converse reports inputTokens exclusive of cache read/write.
|
|
338
|
+
const pricingInfo = config_1.default.pricingInfo || {};
|
|
339
|
+
const cost = helpers_1.default.getChatModelCost(modelId, pricingInfo, inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens, false);
|
|
340
|
+
BedrockWrapper.setBaseSpanAttributes(span, {
|
|
341
|
+
genAIEndpoint,
|
|
342
|
+
model: modelId,
|
|
343
|
+
cost,
|
|
344
|
+
aiSystem: BedrockWrapper.aiSystem,
|
|
345
|
+
serverAddress: BedrockWrapper.serverAddress,
|
|
346
|
+
serverPort: BedrockWrapper.serverPort,
|
|
347
|
+
});
|
|
348
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_RESPONSE_MODEL, responseModel);
|
|
349
|
+
const requestId = result.$metadata?.requestId;
|
|
350
|
+
if (requestId) {
|
|
351
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_RESPONSE_ID, requestId);
|
|
352
|
+
}
|
|
353
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_USAGE_INPUT_TOKENS, inputTokens);
|
|
354
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_USAGE_OUTPUT_TOKENS, outputTokens);
|
|
355
|
+
if (cacheReadTokens > 0) {
|
|
356
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS, cacheReadTokens);
|
|
357
|
+
}
|
|
358
|
+
if (cacheWriteTokens > 0) {
|
|
359
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS, cacheWriteTokens);
|
|
360
|
+
}
|
|
361
|
+
if (ttft > 0) {
|
|
362
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_SERVER_TTFT, ttft);
|
|
363
|
+
}
|
|
364
|
+
if (tbt > 0) {
|
|
365
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_SERVER_TBT, tbt);
|
|
366
|
+
}
|
|
367
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_RESPONSE_FINISH_REASON, [finishReason]);
|
|
368
|
+
const outputText = result.output?.message?.content?.map((c) => c.text || '').join('') || '';
|
|
369
|
+
const outputType = typeof outputText === 'string'
|
|
370
|
+
? semantic_convention_1.default.GEN_AI_OUTPUT_TYPE_TEXT
|
|
371
|
+
: semantic_convention_1.default.GEN_AI_OUTPUT_TYPE_JSON;
|
|
372
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_OUTPUT_TYPE, outputType);
|
|
373
|
+
const contentBlocks = result.output?.message?.content || [];
|
|
374
|
+
const toolCalls = contentBlocks
|
|
375
|
+
.filter((c) => c.toolUse)
|
|
376
|
+
.map((c) => ({
|
|
377
|
+
id: c.toolUse.toolUseId || '',
|
|
378
|
+
name: c.toolUse.name || '',
|
|
379
|
+
arguments: c.toolUse.input || {},
|
|
380
|
+
}));
|
|
381
|
+
if (toolCalls.length > 0) {
|
|
382
|
+
const toolNames = toolCalls.map((t) => t.name).filter(Boolean);
|
|
383
|
+
const toolIds = toolCalls.map((t) => t.id).filter(Boolean);
|
|
384
|
+
const toolArgs = toolCalls
|
|
385
|
+
.map((t) => (typeof t.arguments === 'string' ? t.arguments : JSON.stringify(t.arguments)))
|
|
386
|
+
.filter(Boolean);
|
|
387
|
+
if (toolNames.length > 0) {
|
|
388
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_TOOL_NAME, toolNames.join(', '));
|
|
389
|
+
}
|
|
390
|
+
if (toolIds.length > 0) {
|
|
391
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_TOOL_CALL_ID, toolIds.join(', '));
|
|
392
|
+
}
|
|
393
|
+
if (toolArgs.length > 0) {
|
|
394
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_TOOL_ARGS, toolArgs.join(', '));
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
const messages = convertBedrockMessages(input.messages || []);
|
|
398
|
+
const systemBlock = input.system || [];
|
|
399
|
+
const systemParts = [];
|
|
400
|
+
if (Array.isArray(systemBlock)) {
|
|
401
|
+
for (const item of systemBlock) {
|
|
402
|
+
if (item?.text) {
|
|
403
|
+
systemParts.push({ type: 'text', content: item.text });
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
// Bedrock Converse API expresses tools as
|
|
408
|
+
// `toolConfig.tools: [{ toolSpec: { name, description, inputSchema: { json } } }, ...]`.
|
|
409
|
+
// Normalize to the flat shape understood by `buildToolDefinitions`.
|
|
410
|
+
let bedrockToolDefs;
|
|
411
|
+
const rawBedrockTools = input.toolConfig?.tools;
|
|
412
|
+
if (Array.isArray(rawBedrockTools)) {
|
|
413
|
+
bedrockToolDefs = rawBedrockTools
|
|
414
|
+
.map((tool) => {
|
|
415
|
+
const spec = tool?.toolSpec ?? tool;
|
|
416
|
+
if (!spec || typeof spec !== 'object')
|
|
417
|
+
return null;
|
|
418
|
+
return {
|
|
419
|
+
name: spec.name ?? '',
|
|
420
|
+
description: spec.description ?? '',
|
|
421
|
+
parameters: spec.inputSchema?.json ?? spec.inputSchema ?? spec.parameters ?? {},
|
|
422
|
+
};
|
|
423
|
+
})
|
|
424
|
+
.filter((t) => t && t.name);
|
|
425
|
+
}
|
|
426
|
+
const toolDefinitionsJson = helpers_1.default.buildToolDefinitions(bedrockToolDefs);
|
|
427
|
+
let inputMessagesJson;
|
|
428
|
+
let outputMessagesJson;
|
|
429
|
+
// Compute system_instructions and version hash regardless of
|
|
430
|
+
// captureContent so versions still group correctly when content
|
|
431
|
+
// capture is disabled.
|
|
432
|
+
const systemInstructionsJson = systemParts.length > 0 ? JSON.stringify(systemParts) : undefined;
|
|
433
|
+
const versionExtras = BedrockWrapper._stampAgentVersion(span, {
|
|
434
|
+
systemInstructionsJson,
|
|
435
|
+
toolDefinitionsJson,
|
|
436
|
+
primaryModel: responseModel || modelId,
|
|
437
|
+
temperature: inferenceConfig.temperature ?? null,
|
|
438
|
+
top_p: inferenceConfig.topP ?? null,
|
|
439
|
+
max_tokens: inferenceConfig.maxTokens ?? null,
|
|
440
|
+
});
|
|
441
|
+
if (captureContent) {
|
|
442
|
+
inputMessagesJson = helpers_1.default.buildInputMessages(messages);
|
|
443
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_INPUT_MESSAGES, inputMessagesJson);
|
|
444
|
+
if (systemInstructionsJson) {
|
|
445
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_SYSTEM_INSTRUCTIONS, systemInstructionsJson);
|
|
446
|
+
}
|
|
447
|
+
outputMessagesJson = helpers_1.default.buildOutputMessages(outputText, finishReason, toolCalls.length > 0 ? toolCalls : undefined);
|
|
448
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_OUTPUT_MESSAGES, outputMessagesJson);
|
|
449
|
+
}
|
|
450
|
+
if (toolDefinitionsJson) {
|
|
451
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_TOOL_DEFINITIONS, toolDefinitionsJson);
|
|
452
|
+
}
|
|
453
|
+
if (!config_1.default.disableEvents) {
|
|
454
|
+
const eventAttrs = {
|
|
455
|
+
[semantic_convention_1.default.GEN_AI_OPERATION]: semantic_convention_1.default.GEN_AI_OPERATION_TYPE_CHAT,
|
|
456
|
+
[semantic_convention_1.default.GEN_AI_REQUEST_MODEL]: modelId,
|
|
457
|
+
[semantic_convention_1.default.GEN_AI_RESPONSE_MODEL]: responseModel,
|
|
458
|
+
[semantic_convention_1.default.SERVER_ADDRESS]: BedrockWrapper.serverAddress,
|
|
459
|
+
[semantic_convention_1.default.SERVER_PORT]: BedrockWrapper.serverPort,
|
|
460
|
+
[semantic_convention_1.default.GEN_AI_RESPONSE_FINISH_REASON]: [finishReason],
|
|
461
|
+
[semantic_convention_1.default.GEN_AI_OUTPUT_TYPE]: outputType,
|
|
462
|
+
[semantic_convention_1.default.GEN_AI_USAGE_INPUT_TOKENS]: inputTokens,
|
|
463
|
+
[semantic_convention_1.default.GEN_AI_USAGE_OUTPUT_TOKENS]: outputTokens,
|
|
464
|
+
...versionExtras,
|
|
465
|
+
};
|
|
466
|
+
if (requestId) {
|
|
467
|
+
eventAttrs[semantic_convention_1.default.GEN_AI_RESPONSE_ID] = requestId;
|
|
468
|
+
}
|
|
469
|
+
if (captureContent) {
|
|
470
|
+
if (inputMessagesJson)
|
|
471
|
+
eventAttrs[semantic_convention_1.default.GEN_AI_INPUT_MESSAGES] = inputMessagesJson;
|
|
472
|
+
if (outputMessagesJson)
|
|
473
|
+
eventAttrs[semantic_convention_1.default.GEN_AI_OUTPUT_MESSAGES] = outputMessagesJson;
|
|
474
|
+
if (systemInstructionsJson) {
|
|
475
|
+
eventAttrs[semantic_convention_1.default.GEN_AI_SYSTEM_INSTRUCTIONS] = systemInstructionsJson;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if (toolDefinitionsJson)
|
|
479
|
+
eventAttrs[semantic_convention_1.default.GEN_AI_TOOL_DEFINITIONS] = toolDefinitionsJson;
|
|
480
|
+
helpers_1.default.emitInferenceEvent(span, eventAttrs);
|
|
481
|
+
}
|
|
482
|
+
return {
|
|
483
|
+
genAIEndpoint,
|
|
484
|
+
model: modelId,
|
|
485
|
+
cost,
|
|
486
|
+
aiSystem: BedrockWrapper.aiSystem,
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
BedrockWrapper.aiSystem = semantic_convention_1.default.GEN_AI_SYSTEM_AWS_BEDROCK;
|
|
491
|
+
BedrockWrapper.serverAddress = 'bedrock-runtime.amazonaws.com';
|
|
492
|
+
BedrockWrapper.serverPort = 443;
|
|
493
|
+
exports.default = BedrockWrapper;
|
|
494
|
+
//# sourceMappingURL=wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../../src/instrumentation/bedrock/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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rumentationBase, InstrumentationModuleDefinition } from '@opentelemetry/instrumentation';
|
|
2
|
+
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
3
|
+
export default class BrowserUseInstrumentation extends InstrumentationBase {
|
|
4
|
+
constructor(config?: InstrumentationConfig);
|
|
5
|
+
protected init(): InstrumentationModuleDefinition | InstrumentationModuleDefinition[] | void;
|
|
6
|
+
manualPatch(moduleExports: any, moduleVersion?: string): void;
|
|
7
|
+
private _patchAgent;
|
|
8
|
+
private _patchController;
|
|
9
|
+
private _unpatchAgent;
|
|
10
|
+
private _unpatchController;
|
|
11
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
const SUPPORTED_VERSIONS = ['>=0.1.0'];
|
|
11
|
+
const AGENT_METHODS = [
|
|
12
|
+
{ name: 'run', patch: wrapper_1.default._patchAgentRun },
|
|
13
|
+
{ name: 'step', patch: wrapper_1.default._patchAgentStep },
|
|
14
|
+
{ name: 'pause', patch: (tracer, version) => wrapper_1.default._patchAgentLifecycle(tracer, 'pause', version) },
|
|
15
|
+
{ name: 'resume', patch: (tracer, version) => wrapper_1.default._patchAgentLifecycle(tracer, 'resume', version) },
|
|
16
|
+
{ name: 'stop', patch: (tracer, version) => wrapper_1.default._patchAgentLifecycle(tracer, 'stop', version) },
|
|
17
|
+
];
|
|
18
|
+
class BrowserUseInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
19
|
+
constructor(config = {}) {
|
|
20
|
+
super(`${constant_1.INSTRUMENTATION_PREFIX}/instrumentation-browser-use`, '1.0.0', config);
|
|
21
|
+
}
|
|
22
|
+
init() {
|
|
23
|
+
return [
|
|
24
|
+
new instrumentation_1.InstrumentationNodeModuleDefinition('browser-use', SUPPORTED_VERSIONS, (moduleExports, moduleVersion) => {
|
|
25
|
+
this._patchAgent(moduleExports, moduleVersion);
|
|
26
|
+
return moduleExports;
|
|
27
|
+
}, (moduleExports) => {
|
|
28
|
+
if (moduleExports !== undefined) {
|
|
29
|
+
this._unpatchAgent(moduleExports);
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
new instrumentation_1.InstrumentationNodeModuleDefinition('browser-use/controller', SUPPORTED_VERSIONS, (moduleExports, moduleVersion) => {
|
|
33
|
+
this._patchController(moduleExports, moduleVersion);
|
|
34
|
+
return moduleExports;
|
|
35
|
+
}, (moduleExports) => {
|
|
36
|
+
if (moduleExports !== undefined) {
|
|
37
|
+
this._unpatchController(moduleExports);
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
manualPatch(moduleExports, moduleVersion) {
|
|
43
|
+
this._patchAgent(moduleExports, moduleVersion);
|
|
44
|
+
this._patchController(moduleExports, moduleVersion);
|
|
45
|
+
}
|
|
46
|
+
_patchAgent(moduleExports, moduleVersion) {
|
|
47
|
+
try {
|
|
48
|
+
const AgentClass = moduleExports?.Agent ?? moduleExports?.default;
|
|
49
|
+
const proto = AgentClass?.prototype;
|
|
50
|
+
if (!proto) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const sdkVersion = moduleVersion ? String(moduleVersion) : undefined;
|
|
54
|
+
for (const { name, patch } of AGENT_METHODS) {
|
|
55
|
+
if (typeof proto[name] !== 'function' || (0, instrumentation_1.isWrapped)(proto[name])) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
this._wrap(proto, name, patch(this.tracer, sdkVersion));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
api_1.diag.error('browser-use instrumentation: failed to patch Agent methods', e);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
_patchController(moduleExports, moduleVersion) {
|
|
66
|
+
try {
|
|
67
|
+
const ControllerClass = moduleExports?.Controller ?? moduleExports?.default;
|
|
68
|
+
const proto = ControllerClass?.prototype;
|
|
69
|
+
if (!proto || typeof proto.act !== 'function' || (0, instrumentation_1.isWrapped)(proto.act)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this._wrap(proto, 'act', wrapper_1.default._patchControllerAct(this.tracer, moduleVersion ? String(moduleVersion) : undefined));
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
api_1.diag.error('browser-use instrumentation: failed to patch Controller.act', e);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
_unpatchAgent(moduleExports) {
|
|
79
|
+
const AgentClass = moduleExports?.Agent ?? moduleExports?.default;
|
|
80
|
+
const proto = AgentClass?.prototype;
|
|
81
|
+
if (!proto)
|
|
82
|
+
return;
|
|
83
|
+
for (const { name } of AGENT_METHODS) {
|
|
84
|
+
if (proto[name] && (0, instrumentation_1.isWrapped)(proto[name])) {
|
|
85
|
+
this._unwrap(proto, name);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
_unpatchController(moduleExports) {
|
|
90
|
+
const ControllerClass = moduleExports?.Controller ?? moduleExports?.default;
|
|
91
|
+
const proto = ControllerClass?.prototype;
|
|
92
|
+
if (proto?.act && (0, instrumentation_1.isWrapped)(proto.act)) {
|
|
93
|
+
this._unwrap(proto, 'act');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.default = BrowserUseInstrumentation;
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/instrumentation/browser-use/index.ts"],"names":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O,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAEO,kBAAkB,CAAC,aAAkB;QAC3C,MAAM,eAAe,GAAG,aAAa,EAAE,UAAU,IAAI,aAAa,EAAE,OAAO,CAAC;QAC5E,MAAM,KAAK,GAAG,eAAe,EAAE,SAAS,CAAC;QACzC,IAAI,KAAK,EAAE,GAAG,IAAI,IAAA,2BAAS,EAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;CACF;AArGD,4CAqGC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tracer } from '@opentelemetry/api';
|
|
2
|
+
export interface BrowserUseAgentContext {
|
|
3
|
+
agentName: string;
|
|
4
|
+
sdkVersion: string;
|
|
5
|
+
}
|
|
6
|
+
declare class BrowserUseWrapper {
|
|
7
|
+
static _patchAgentRun(tracer: Tracer, version?: string): any;
|
|
8
|
+
static _patchAgentStep(tracer: Tracer, version?: string): any;
|
|
9
|
+
static _patchAgentLifecycle(tracer: Tracer, operation: string, version?: string): any;
|
|
10
|
+
static _patchControllerAct(tracer: Tracer, version?: string): any;
|
|
11
|
+
}
|
|
12
|
+
export default BrowserUseWrapper;
|