{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/anthropic-ai/index.ts"],"sourcesContent":["import type { AnthropicAiOptions, IntegrationFn } from '@sentry/core';\nimport { ANTHROPIC_AI_INTEGRATION_NAME, defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { SentryAnthropicAiInstrumentation } from './instrumentation';\n\nexport const instrumentAnthropicAi = generateInstrumentOnce(\n ANTHROPIC_AI_INTEGRATION_NAME,\n options => new SentryAnthropicAiInstrumentation(options),\n);\n\nconst _anthropicAIIntegration = ((options: AnthropicAiOptions = {}) => {\n return {\n name: ANTHROPIC_AI_INTEGRATION_NAME,\n options,\n setupOnce() {\n instrumentAnthropicAi(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the Anthropic AI SDK.\n *\n * This integration is enabled by default.\n *\n * When configured, this integration automatically instruments Anthropic AI SDK client instances\n * to capture telemetry data following OpenTelemetry Semantic Conventions for Generative AI.\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.init({\n * integrations: [Sentry.anthropicAIIntegration()],\n * });\n * ```\n *\n * ## Options\n *\n * - `recordInputs`: Whether to record prompt messages (default: follows `sendDefaultPii` or `dataCollection.genAI.inputs`)\n * - `recordOutputs`: Whether to record response text (default: follows `sendDefaultPii` or `dataCollection.genAI.outputs`)\n *\n * ### Default Behavior\n *\n * By default, the integration will:\n * - Record inputs and outputs based on `sendDefaultPii` or `dataCollection.genAI` in your Sentry client options\n * - Integration-level `recordInputs`/`recordOutputs` options take precedence over global config\n *\n * @example\n * ```javascript\n * // Always record inputs and outputs regardless of global dataCollection config\n * Sentry.init({\n * integrations: [\n * Sentry.anthropicAIIntegration({\n * recordInputs: true,\n * recordOutputs: true\n * })\n * ],\n * });\n *\n * // Never record inputs/outputs regardless of global dataCollection config\n * Sentry.init({\n * dataCollection: { genAI: { inputs: true, outputs: true } },\n * integrations: [\n * Sentry.anthropicAIIntegration({\n * recordInputs: false,\n * recordOutputs: false\n * })\n * ],\n * });\n * ```\n *\n */\nexport const anthropicAIIntegration = defineIntegration(_anthropicAIIntegration);\n"],"names":["generateInstrumentOnce","ANTHROPIC_AI_INTEGRATION_NAME","SentryAnthropicAiInstrumentation","defineIntegration"],"mappings":";;;;;;AAKO,MAAM,qBAAA,GAAwBA,+BAAA;AAAA,EACnCC,kCAAA;AAAA,EACA,CAAA,OAAA,KAAW,IAAIC,gDAAA,CAAiC,OAAO;AACzD;AAEA,MAAM,uBAAA,IAA2B,CAAC,OAAA,GAA8B,EAAC,KAAM;AACrE,EAAA,OAAO;AAAA,IACL,IAAA,EAAMD,kCAAA;AAAA,IACN,OAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,qBAAA,CAAsB,OAAO,CAAA;AAAA,IAC/B;AAAA,GACF;AACF,CAAA,CAAA;AAuDO,MAAM,sBAAA,GAAyBE,uBAAkB,uBAAuB;;;;;"}