weflayr 0.24.0 → 0.26.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 (234) hide show
  1. package/README.md +2 -2
  2. package/dist/{api → src/api}/generated/facade.gen.d.ts +86 -12
  3. package/dist/{api → src/api}/generated/facade.gen.js +4 -2
  4. package/dist/src/api/generated/index.d.ts +2 -0
  5. package/dist/{api → src/api}/generated/index.js +3 -1
  6. package/dist/{api → src/api}/generated/sdk.gen.d.ts +11 -3
  7. package/dist/{api → src/api}/generated/sdk.gen.js +34 -4
  8. package/{src/api/generated/types.gen.ts → dist/src/api/generated/types.gen.d.ts} +436 -153
  9. package/dist/{api → src/api}/makeEndpoint.js +1 -3
  10. package/dist/src/auto-instrument.d.ts +42 -0
  11. package/dist/src/auto-instrument.js +156 -0
  12. package/dist/src/index.d.ts +9 -0
  13. package/dist/src/index.js +49 -0
  14. package/dist/src/instrumentation/anthropic/get_cache_and_reasoning_telemetry.d.ts +20 -0
  15. package/dist/src/instrumentation/anthropic/get_cache_and_reasoning_telemetry.js +114 -0
  16. package/dist/src/instrumentation/anthropic/get_cache_config_telemetry.d.ts +28 -0
  17. package/dist/src/instrumentation/anthropic/get_cache_config_telemetry.js +92 -0
  18. package/dist/src/instrumentation/anthropic/get_streaming_accumulation_telemetry.d.ts +25 -0
  19. package/dist/src/instrumentation/anthropic/get_streaming_accumulation_telemetry.js +141 -0
  20. package/dist/src/instrumentation/anthropic/get_structured_output_schema_telemetry.d.ts +9 -0
  21. package/dist/src/instrumentation/anthropic/get_structured_output_schema_telemetry.js +17 -0
  22. package/dist/src/instrumentation/anthropic/get_tool_definitions_telemetry.d.ts +15 -0
  23. package/dist/src/instrumentation/anthropic/get_tool_definitions_telemetry.js +50 -0
  24. package/dist/src/instrumentation/anthropic/set_telemetry_attributes.d.ts +15 -0
  25. package/dist/src/instrumentation/anthropic/set_telemetry_attributes.js +39 -0
  26. package/dist/src/instrumentation/bedrock/get_cache_config_telemetry.d.ts +22 -0
  27. package/dist/src/instrumentation/bedrock/get_cache_config_telemetry.js +97 -0
  28. package/dist/src/instrumentation/bedrock/get_cache_telemetry.d.ts +22 -0
  29. package/dist/src/instrumentation/bedrock/get_cache_telemetry.js +102 -0
  30. package/dist/src/instrumentation/bedrock/get_input_message_content_telemetry.d.ts +15 -0
  31. package/dist/src/instrumentation/bedrock/get_input_message_content_telemetry.js +91 -0
  32. package/dist/src/instrumentation/bedrock/get_model_id_telemetry.d.ts +21 -0
  33. package/dist/src/instrumentation/bedrock/get_model_id_telemetry.js +54 -0
  34. package/dist/src/instrumentation/bedrock/get_reasoning_output_telemetry.d.ts +19 -0
  35. package/dist/src/instrumentation/bedrock/get_reasoning_output_telemetry.js +81 -0
  36. package/dist/src/instrumentation/bedrock/get_streaming_output_message_telemetry.d.ts +27 -0
  37. package/dist/src/instrumentation/bedrock/get_streaming_output_message_telemetry.js +126 -0
  38. package/dist/src/instrumentation/bedrock/get_tool_call_output_telemetry.d.ts +17 -0
  39. package/dist/src/instrumentation/bedrock/get_tool_call_output_telemetry.js +85 -0
  40. package/dist/src/instrumentation/bedrock/get_tool_definitions_telemetry.d.ts +15 -0
  41. package/dist/src/instrumentation/bedrock/get_tool_definitions_telemetry.js +68 -0
  42. package/dist/src/instrumentation/bedrock/set_telemetry_attributes.d.ts +18 -0
  43. package/dist/src/instrumentation/bedrock/set_telemetry_attributes.js +47 -0
  44. package/dist/src/instrumentation/cohere/get_chat_telemetry.d.ts +23 -0
  45. package/dist/src/instrumentation/cohere/get_chat_telemetry.js +77 -0
  46. package/dist/src/instrumentation/cohere/get_embeddings_telemetry.d.ts +18 -0
  47. package/dist/src/instrumentation/cohere/get_embeddings_telemetry.js +88 -0
  48. package/dist/src/instrumentation/cohere/get_structured_output_schema_telemetry.d.ts +12 -0
  49. package/dist/src/instrumentation/cohere/get_structured_output_schema_telemetry.js +18 -0
  50. package/dist/src/instrumentation/cohere/get_tool_call_output_telemetry.d.ts +31 -0
  51. package/dist/src/instrumentation/cohere/get_tool_call_output_telemetry.js +106 -0
  52. package/dist/src/instrumentation/cohere/get_tool_definitions_telemetry.d.ts +27 -0
  53. package/dist/src/instrumentation/cohere/get_tool_definitions_telemetry.js +75 -0
  54. package/dist/src/instrumentation/cohere/set_telemetry_attributes.d.ts +17 -0
  55. package/dist/src/instrumentation/cohere/set_telemetry_attributes.js +44 -0
  56. package/dist/src/instrumentation/elevenlabs/full_instrumentation.d.ts +28 -0
  57. package/dist/src/instrumentation/elevenlabs/full_instrumentation.js +209 -0
  58. package/dist/src/instrumentation/google/get_audio_telemetry.d.ts +9 -0
  59. package/dist/src/instrumentation/google/get_audio_telemetry.js +28 -0
  60. package/dist/src/instrumentation/google/get_cache_operations_telemetry.d.ts +23 -0
  61. package/dist/src/instrumentation/google/get_cache_operations_telemetry.js +154 -0
  62. package/dist/src/instrumentation/google/get_cache_telemetry.d.ts +16 -0
  63. package/{src → dist/src}/instrumentation/google/get_cache_telemetry.js +18 -19
  64. package/dist/src/instrumentation/google/get_embeddings_telemetry.d.ts +12 -0
  65. package/dist/src/instrumentation/google/get_embeddings_telemetry.js +85 -0
  66. package/dist/src/instrumentation/google/get_provider_name.d.ts +11 -0
  67. package/{src → dist/src}/instrumentation/google/get_provider_name.js +11 -12
  68. package/{src/instrumentation/google/get_reasoning_telemetry.js → dist/src/instrumentation/google/get_reasoning_telemetry.d.ts} +1 -11
  69. package/dist/src/instrumentation/google/get_reasoning_telemetry.js +21 -0
  70. package/dist/src/instrumentation/google/get_structured_output_schema_telemetry.d.ts +12 -0
  71. package/dist/src/instrumentation/google/get_structured_output_schema_telemetry.js +19 -0
  72. package/dist/src/instrumentation/google/set_telemetry_attributes.d.ts +18 -0
  73. package/dist/src/instrumentation/google/set_telemetry_attributes.js +98 -0
  74. package/dist/src/instrumentation/openai/get_audio_telemetry.d.ts +25 -0
  75. package/dist/src/instrumentation/openai/get_audio_telemetry.js +123 -0
  76. package/dist/src/instrumentation/openai/get_bedrock_mantle_telemetry.d.ts +35 -0
  77. package/dist/src/instrumentation/openai/get_bedrock_mantle_telemetry.js +148 -0
  78. package/dist/src/instrumentation/openai/get_cache_and_reasoning_telemetry.d.ts +27 -0
  79. package/dist/src/instrumentation/openai/get_cache_and_reasoning_telemetry.js +72 -0
  80. package/dist/src/instrumentation/openai/get_cache_config_telemetry.d.ts +28 -0
  81. package/dist/src/instrumentation/openai/get_cache_config_telemetry.js +91 -0
  82. package/dist/src/instrumentation/openai/get_embeddings_telemetry.d.ts +18 -0
  83. package/dist/src/instrumentation/openai/get_embeddings_telemetry.js +86 -0
  84. package/dist/src/instrumentation/openai/get_streaming_usage.d.ts +21 -0
  85. package/dist/src/instrumentation/openai/get_streaming_usage.js +74 -0
  86. package/dist/src/instrumentation/openai/get_structured_output_schema_telemetry.d.ts +12 -0
  87. package/dist/src/instrumentation/openai/get_structured_output_schema_telemetry.js +20 -0
  88. package/dist/src/instrumentation/openai/set_telemetry_attributes.d.ts +17 -0
  89. package/dist/src/instrumentation/openai/set_telemetry_attributes.js +47 -0
  90. package/dist/src/instrumentation/shared/get_structured_output_schema_telemetry.d.ts +35 -0
  91. package/dist/src/instrumentation/shared/get_structured_output_schema_telemetry.js +76 -0
  92. package/dist/src/instrumentation/vercel/full_instrumentation.d.ts +3 -0
  93. package/dist/src/instrumentation/vercel/full_instrumentation.js +54 -0
  94. package/dist/src/instrumentation/vercel/get_cache_creation_telemetry.d.ts +22 -0
  95. package/dist/src/instrumentation/vercel/get_cache_creation_telemetry.js +66 -0
  96. package/dist/src/instrumentation/vercel/get_structured_output_schema_telemetry.d.ts +24 -0
  97. package/dist/src/instrumentation/vercel/get_structured_output_schema_telemetry.js +84 -0
  98. package/dist/src/logger.d.ts +1 -0
  99. package/dist/src/logger.js +6 -0
  100. package/dist/src/otel/exporter.d.ts +19 -0
  101. package/dist/src/otel/exporter.js +94 -0
  102. package/dist/src/otel/propagation.d.ts +46 -0
  103. package/dist/src/otel/propagation.js +110 -0
  104. package/dist/src/otel/span-filter.d.ts +3 -0
  105. package/dist/src/otel/span-filter.js +61 -0
  106. package/dist/src/otel/span-processor.d.ts +55 -0
  107. package/dist/src/otel/span-processor.js +169 -0
  108. package/dist/src/otel/vercel-ai-sdk-span-filter.d.ts +12 -0
  109. package/dist/src/otel/vercel-ai-sdk-span-filter.js +88 -0
  110. package/dist/src/setup.d.ts +50 -0
  111. package/dist/src/setup.js +155 -0
  112. package/package.json +11 -5
  113. package/.prettierignore +0 -2
  114. package/.prettierrc.json +0 -7
  115. package/LICENSE-MIT +0 -21
  116. package/NOTICE +0 -12
  117. package/dist/api/generated/index.d.ts +0 -2
  118. package/dist/api/generated/types.gen.d.ts +0 -1005
  119. package/eslint.config.mjs +0 -36
  120. package/index.d.ts +0 -170
  121. package/openapi-ts.config.mjs +0 -9
  122. package/scripts/generate_facade.mjs +0 -86
  123. package/src/api/caseConversion.ts +0 -58
  124. package/src/api/generated/client/client.gen.ts +0 -277
  125. package/src/api/generated/client/index.ts +0 -27
  126. package/src/api/generated/client/types.gen.ts +0 -218
  127. package/src/api/generated/client/utils.gen.ts +0 -316
  128. package/src/api/generated/client.gen.ts +0 -16
  129. package/src/api/generated/core/auth.gen.ts +0 -48
  130. package/src/api/generated/core/bodySerializer.gen.ts +0 -82
  131. package/src/api/generated/core/params.gen.ts +0 -178
  132. package/src/api/generated/core/pathSerializer.gen.ts +0 -171
  133. package/src/api/generated/core/queryKeySerializer.gen.ts +0 -117
  134. package/src/api/generated/core/serverSentEvents.gen.ts +0 -242
  135. package/src/api/generated/core/types.gen.ts +0 -110
  136. package/src/api/generated/core/utils.gen.ts +0 -140
  137. package/src/api/generated/facade.gen.ts +0 -104
  138. package/src/api/generated/index.ts +0 -4
  139. package/src/api/generated/sdk.gen.ts +0 -175
  140. package/src/api/index.ts +0 -45
  141. package/src/api/makeEndpoint.ts +0 -54
  142. package/src/auto-instrument.js +0 -172
  143. package/src/index.js +0 -19
  144. package/src/instrumentation/anthropic/get_cache_and_reasoning_telemetry.js +0 -118
  145. package/src/instrumentation/anthropic/get_cache_config_telemetry.js +0 -90
  146. package/src/instrumentation/anthropic/get_streaming_stop_reason_telemetry.js +0 -121
  147. package/src/instrumentation/anthropic/get_tool_definitions_telemetry.js +0 -55
  148. package/src/instrumentation/anthropic/set_telemetry_attributes.js +0 -39
  149. package/src/instrumentation/bedrock/get_cache_config_telemetry.js +0 -106
  150. package/src/instrumentation/bedrock/get_cache_telemetry.js +0 -109
  151. package/src/instrumentation/bedrock/get_input_message_content_telemetry.js +0 -94
  152. package/src/instrumentation/bedrock/get_streaming_output_message_telemetry.js +0 -87
  153. package/src/instrumentation/bedrock/set_telemetry_attributes.js +0 -40
  154. package/src/instrumentation/cohere/get_chat_telemetry.js +0 -88
  155. package/src/instrumentation/cohere/get_embeddings_telemetry.js +0 -107
  156. package/src/instrumentation/cohere/set_telemetry_attributes.js +0 -32
  157. package/src/instrumentation/elevenlabs/full_instrumentation.js +0 -236
  158. package/src/instrumentation/google/get_audio_telemetry.js +0 -30
  159. package/src/instrumentation/google/get_cache_operations_telemetry.js +0 -171
  160. package/src/instrumentation/google/get_embeddings_telemetry.js +0 -99
  161. package/src/instrumentation/google/set_telemetry_attributes.js +0 -104
  162. package/src/instrumentation/openai/get_audio_telemetry.js +0 -149
  163. package/src/instrumentation/openai/get_cache_and_reasoning_telemetry.js +0 -71
  164. package/src/instrumentation/openai/get_cache_config_telemetry.js +0 -63
  165. package/src/instrumentation/openai/get_embeddings_telemetry.js +0 -107
  166. package/src/instrumentation/openai/get_streaming_usage.js +0 -81
  167. package/src/instrumentation/openai/set_telemetry_attributes.js +0 -41
  168. package/src/instrumentation/vercel/full_instrumentation.js +0 -52
  169. package/src/instrumentation/vercel/get_cache_creation_telemetry.js +0 -70
  170. package/src/logger.js +0 -8
  171. package/src/otel/exporter.js +0 -108
  172. package/src/otel/propagation.js +0 -146
  173. package/src/otel/span-filter.js +0 -69
  174. package/src/otel/span-processor.js +0 -170
  175. package/src/otel/vercel-ai-sdk-span-filter.js +0 -79
  176. package/src/setup.js +0 -167
  177. package/tests/api/index.test.js +0 -437
  178. package/tests/index.test.js +0 -884
  179. package/tests/instrumentation/anthropic/get_cache_and_reasoning_telemetry.test.js +0 -181
  180. package/tests/instrumentation/anthropic/get_cache_config_telemetry.test.js +0 -92
  181. package/tests/instrumentation/anthropic/get_streaming_stop_reason_telemetry.test.js +0 -117
  182. package/tests/instrumentation/anthropic/get_tool_definitions_telemetry.test.js +0 -97
  183. package/tests/instrumentation/bedrock/get_cache_config_telemetry.test.js +0 -107
  184. package/tests/instrumentation/bedrock/get_cache_telemetry.test.js +0 -118
  185. package/tests/instrumentation/bedrock/get_input_message_content_telemetry.test.js +0 -89
  186. package/tests/instrumentation/bedrock/get_streaming_output_message_telemetry.test.js +0 -87
  187. package/tests/instrumentation/cohere/get_chat_telemetry.test.js +0 -148
  188. package/tests/instrumentation/cohere/get_embeddings_telemetry.test.js +0 -132
  189. package/tests/instrumentation/elevenlabs/full_instrumentation.test.js +0 -258
  190. package/tests/instrumentation/google/get_cache_operations_telemetry.test.js +0 -130
  191. package/tests/instrumentation/google/get_embeddings_telemetry.test.js +0 -128
  192. package/tests/instrumentation/google/get_reasoning_telemetry.test.js +0 -41
  193. package/tests/instrumentation/google/set_telemetry_attributes.test.js +0 -219
  194. package/tests/instrumentation/openai/get_audio_telemetry.test.js +0 -170
  195. package/tests/instrumentation/openai/get_cache_and_reasoning_telemetry.test.js +0 -83
  196. package/tests/instrumentation/openai/get_cache_config_telemetry.test.js +0 -83
  197. package/tests/instrumentation/openai/get_embeddings_telemetry.test.js +0 -145
  198. package/tests/instrumentation/openai/get_streaming_usage.test.js +0 -105
  199. package/tests/instrumentation/vercel/full_instrumentation.test.js +0 -16
  200. package/tests/instrumentation/vercel/get_cache_creation_telemetry.test.js +0 -96
  201. package/tests/otel/vercel-ai-sdk-span-filter.test.js +0 -159
  202. package/tsconfig.json +0 -18
  203. /package/dist/{api → src/api}/caseConversion.d.ts +0 -0
  204. /package/dist/{api → src/api}/caseConversion.js +0 -0
  205. /package/dist/{api → src/api}/generated/client/client.gen.d.ts +0 -0
  206. /package/dist/{api → src/api}/generated/client/client.gen.js +0 -0
  207. /package/dist/{api → src/api}/generated/client/index.d.ts +0 -0
  208. /package/dist/{api → src/api}/generated/client/index.js +0 -0
  209. /package/dist/{api → src/api}/generated/client/types.gen.d.ts +0 -0
  210. /package/dist/{api → src/api}/generated/client/types.gen.js +0 -0
  211. /package/dist/{api → src/api}/generated/client/utils.gen.d.ts +0 -0
  212. /package/dist/{api → src/api}/generated/client/utils.gen.js +0 -0
  213. /package/dist/{api → src/api}/generated/client.gen.d.ts +0 -0
  214. /package/dist/{api → src/api}/generated/client.gen.js +0 -0
  215. /package/dist/{api → src/api}/generated/core/auth.gen.d.ts +0 -0
  216. /package/dist/{api → src/api}/generated/core/auth.gen.js +0 -0
  217. /package/dist/{api → src/api}/generated/core/bodySerializer.gen.d.ts +0 -0
  218. /package/dist/{api → src/api}/generated/core/bodySerializer.gen.js +0 -0
  219. /package/dist/{api → src/api}/generated/core/params.gen.d.ts +0 -0
  220. /package/dist/{api → src/api}/generated/core/params.gen.js +0 -0
  221. /package/dist/{api → src/api}/generated/core/pathSerializer.gen.d.ts +0 -0
  222. /package/dist/{api → src/api}/generated/core/pathSerializer.gen.js +0 -0
  223. /package/dist/{api → src/api}/generated/core/queryKeySerializer.gen.d.ts +0 -0
  224. /package/dist/{api → src/api}/generated/core/queryKeySerializer.gen.js +0 -0
  225. /package/dist/{api → src/api}/generated/core/serverSentEvents.gen.d.ts +0 -0
  226. /package/dist/{api → src/api}/generated/core/serverSentEvents.gen.js +0 -0
  227. /package/dist/{api → src/api}/generated/core/types.gen.d.ts +0 -0
  228. /package/dist/{api → src/api}/generated/core/types.gen.js +0 -0
  229. /package/dist/{api → src/api}/generated/core/utils.gen.d.ts +0 -0
  230. /package/dist/{api → src/api}/generated/core/utils.gen.js +0 -0
  231. /package/dist/{api → src/api}/generated/types.gen.js +0 -0
  232. /package/dist/{api → src/api}/index.d.ts +0 -0
  233. /package/dist/{api → src/api}/index.js +0 -0
  234. /package/dist/{api → src/api}/makeEndpoint.d.ts +0 -0
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ // Copyright 2024 Langfuse GmbH
3
+ // Licensed under the MIT License.
4
+ // Original source: https://github.com/langfuse/langfuse-js/blob/main/packages/otel/src/span-processor.ts
5
+ //
6
+ // Modifications copyright 2026 Weflayr
7
+ // This file has been modified from its original form:
8
+ // - Translated from TypeScript to JavaScript
9
+ // - Removed MediaService integration (no media upload support yet)
10
+ // - Removed LangfuseAPIClient / app-root marker logic (not used)
11
+ // - Removed Langfuse-specific span attributes (TRACE_INPUT/OUTPUT/METADATA, IS_APP_ROOT, ENVIRONMENT, RELEASE)
12
+ // - Mask hook now receives the full flat attribute bag, not a {data} envelope, and runs synchronously
13
+ // - default_tags are applied as span attributes in onStart
14
+ // - propagated tags come from Weflayr's tag bag (see propagation.js), not Langfuse's typed schema
15
+ //
16
+ // See LICENSE-MIT in the package root for the full license text.
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.WeflayrSpanProcessor = exports.CONTENT_CAPTURE_ENV = void 0;
19
+ const api_1 = require("@opentelemetry/api");
20
+ const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
21
+ const propagation_1 = require("./propagation");
22
+ const span_filter_1 = require("./span-filter");
23
+ const vercel_ai_sdk_span_filter_1 = require("./vercel-ai-sdk-span-filter");
24
+ const logger_1 = require("../logger");
25
+ // setup({captureMessageContent: ...}) records the choice in this env var (the
26
+ // official OTel GenAI one). Instrumentors gate content on their own knobs
27
+ // (openllmetry reads its own config and captures by default), so the processor
28
+ // enforces the flag itself: when the env var is "false", message content is
29
+ // stripped from every span before export.
30
+ exports.CONTENT_CAPTURE_ENV = 'OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT';
31
+ // The new-semconv JSON message attributes and the legacy indexed
32
+ // `gen_ai.prompt.{i}.*` / `gen_ai.completion.{i}.*` attributes - plus the
33
+ // request's tool definitions and structured-output schema (`ai.schema` is the
34
+ // Vercel AI SDK's spelling): their descriptions are prompt content the same
35
+ // way the messages are.
36
+ const CONTENT_ATTRIBUTES = [
37
+ 'gen_ai.input.messages',
38
+ 'gen_ai.output.messages',
39
+ 'gen_ai.system_instructions',
40
+ 'gen_ai.tool.definitions',
41
+ 'gen_ai.request.structured_output_schema',
42
+ // The legacy Vercel AI SDK's (ai <= 6) response content. finishReason and
43
+ // providerMetadata are NOT stripped: metadata and billing, not content.
44
+ 'ai.schema',
45
+ 'ai.response.text',
46
+ 'ai.response.object',
47
+ 'ai.response.reasoning',
48
+ 'ai.response.toolCalls',
49
+ ];
50
+ const CONTENT_ATTRIBUTE_PREFIXES = ['gen_ai.prompt.', 'gen_ai.completion.', 'ai.prompt'];
51
+ function _isContentAttribute(key) {
52
+ return (CONTENT_ATTRIBUTES.includes(key) ||
53
+ CONTENT_ATTRIBUTE_PREFIXES.some((prefix) => key.startsWith(prefix)));
54
+ }
55
+ // Stamped on every exported span when a `mask` is configured: the mask
56
+ // function's source code, so the stored raw event shows what redaction ran
57
+ // client-side when debugging missing attributes.
58
+ const MASK_FUNCTION_ATTRIBUTE = 'weflayr.mask_function';
59
+ class WeflayrSpanProcessor {
60
+ _delegate;
61
+ _defaultTags;
62
+ _mask;
63
+ _maskFunctionSource;
64
+ _shouldExportSpan;
65
+ _vercelAiSdkSpanFilter;
66
+ // LLM spans we've started but not yet seen end. On forceFlush we end any
67
+ // leftovers with ERROR status — covers cases like openllmetry's anthropic
68
+ // streaming wrapper, which leaks the span when the underlying call
69
+ // rejects. Generic across providers; no per-provider patching needed.
70
+ _openLlmSpans;
71
+ constructor({ exporter, exportMode = 'batch', defaultTags = {}, mask, shouldExportSpan, }) {
72
+ if (!exporter) {
73
+ throw new Error('WeflayrSpanProcessor: exporter is required');
74
+ }
75
+ this._delegate =
76
+ exportMode === 'immediate'
77
+ ? new sdk_trace_base_1.SimpleSpanProcessor(exporter)
78
+ : new sdk_trace_base_1.BatchSpanProcessor(exporter);
79
+ this._defaultTags = defaultTags;
80
+ this._mask = mask;
81
+ this._maskFunctionSource = mask ? String(mask) : null;
82
+ this._shouldExportSpan = shouldExportSpan ?? span_filter_1.isDefaultExportSpan;
83
+ this._vercelAiSdkSpanFilter = new vercel_ai_sdk_span_filter_1.VercelAiSdkSpanFilter();
84
+ this._openLlmSpans = new Set();
85
+ }
86
+ onStart(span, parentContext) {
87
+ for (const [k, v] of Object.entries(this._defaultTags)) {
88
+ span.setAttribute(`${propagation_1.EXTRA_TAG_PREFIX}${k}`, v);
89
+ }
90
+ const propagated = (0, propagation_1.getMergedMetadataFromContext)(parentContext);
91
+ for (const [k, v] of Object.entries(propagated)) {
92
+ span.setAttribute(k, v);
93
+ }
94
+ if ((0, span_filter_1.isKnownLLMInstrumentor)(span)) {
95
+ this._openLlmSpans.add(span);
96
+ }
97
+ this._vercelAiSdkSpanFilter.onStart(span);
98
+ (0, logger_1.debug)('span start: name=%s defaultTags=%d propagatedMetadata=%d', span.name, Object.keys(this._defaultTags).length, Object.keys(propagated).length);
99
+ return this._delegate.onStart(span, parentContext);
100
+ }
101
+ onEnd(span) {
102
+ // Same concrete object stored in onStart, viewed here as a ReadableSpan.
103
+ this._openLlmSpans.delete(span);
104
+ try {
105
+ const vercelVerdict = this._vercelAiSdkSpanFilter.shouldExport(span);
106
+ if (vercelVerdict === true) {
107
+ (0, vercel_ai_sdk_span_filter_1.stampVercelGatewayProviderName)(span);
108
+ }
109
+ if (vercelVerdict === false || (vercelVerdict === null && !this._shouldExportSpan(span))) {
110
+ (0, logger_1.debug)('span end: filtered out name=%s scope=%s', span.name, span.instrumentationScope?.name);
111
+ return;
112
+ }
113
+ }
114
+ catch {
115
+ return;
116
+ }
117
+ (0, logger_1.debug)('span end: exporting name=%s scope=%s', span.name, span.instrumentationScope?.name);
118
+ if ((process.env[exports.CONTENT_CAPTURE_ENV] || '').toLowerCase() === 'false') {
119
+ for (const key of Object.keys(span.attributes)) {
120
+ if (_isContentAttribute(key))
121
+ delete span.attributes[key];
122
+ }
123
+ }
124
+ if (this._mask) {
125
+ try {
126
+ const masked = this._mask(span.attributes);
127
+ if (masked && masked !== span.attributes) {
128
+ for (const k of Object.keys(span.attributes))
129
+ delete span.attributes[k];
130
+ Object.assign(span.attributes, masked);
131
+ }
132
+ }
133
+ catch {
134
+ for (const k of Object.keys(span.attributes))
135
+ delete span.attributes[k];
136
+ }
137
+ // Stamped after masking so the mask can't strip it.
138
+ span.attributes[MASK_FUNCTION_ATTRIBUTE] = this._maskFunctionSource;
139
+ }
140
+ return this._delegate.onEnd(span);
141
+ }
142
+ async forceFlush() {
143
+ this._endOrphanedLlmSpans();
144
+ return this._delegate.forceFlush();
145
+ }
146
+ _endOrphanedLlmSpans() {
147
+ const orphans = [...this._openLlmSpans];
148
+ this._openLlmSpans.clear();
149
+ for (const span of orphans) {
150
+ try {
151
+ if (typeof span.isRecording === 'function' && !span.isRecording())
152
+ continue;
153
+ span.setStatus({
154
+ code: api_1.SpanStatusCode.ERROR,
155
+ message: 'weflayr: span did not complete before flush',
156
+ });
157
+ span.end();
158
+ (0, logger_1.debug)('forceFlush: ended orphaned LLM span name=%s', span.name);
159
+ }
160
+ catch (err) {
161
+ (0, logger_1.debug)('forceFlush: failed to end orphan span: %s', err?.message || err);
162
+ }
163
+ }
164
+ }
165
+ shutdown() {
166
+ return this._delegate.shutdown();
167
+ }
168
+ }
169
+ exports.WeflayrSpanProcessor = WeflayrSpanProcessor;
@@ -0,0 +1,12 @@
1
+ import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
2
+ export declare class VercelAiSdkSpanFilter {
3
+ private _openSpanOperations;
4
+ private _openLegacySchemas;
5
+ onStart(span: ReadableSpan): void;
6
+ /**
7
+ * Export verdict for a Vercel AI SDK span, or null when the span is not
8
+ * one (the caller falls back to the default filter).
9
+ */
10
+ shouldExport(span: ReadableSpan): boolean | null;
11
+ }
12
+ export declare function stampVercelGatewayProviderName(span: ReadableSpan): void;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ // The Vercel AI SDK's OTel integrations emit aggregate spans around each model
3
+ // call, all repeating the same usage counts:
4
+ // - `@ai-sdk/otel` (ai >= 7, scope "gen_ai"): per-call "chat" spans are
5
+ // wrapped in "agent_step" + "invoke_agent" spans, and embed/embedMany
6
+ // emits an outer "embeddings" operation span around the model-call
7
+ // "embeddings" span(s).
8
+ // - the legacy integration (ai <= 6, scope "ai"): `ai.<fn>.do<Call>` spans
9
+ // are wrapped in an outer `ai.<fn>` span.
10
+ // Exactly one span per model call may reach the exporter — exporting an
11
+ // aggregate alongside its children would bill every call twice.
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.VercelAiSdkSpanFilter = void 0;
14
+ exports.stampVercelGatewayProviderName = stampVercelGatewayProviderName;
15
+ const VERCEL_SEMCONV_SCOPE = 'gen_ai';
16
+ const VERCEL_LEGACY_SCOPE = 'ai';
17
+ const LEGACY_MODEL_CALL_SPAN_NAME = /\.do(Generate|Stream|Embed)$/;
18
+ function _parentSpanId(span) {
19
+ return span.parentSpanContext?.spanId ?? span.parentSpanId;
20
+ }
21
+ class VercelAiSdkSpanFilter {
22
+ // spanId -> gen_ai.operation.name for open "gen_ai"-scope spans, so a
23
+ // span can check what its parent is (children end before their parent).
24
+ _openSpanOperations = new Map();
25
+ // spanId -> ai.schema of open legacy generateObject/streamObject ROOT spans:
26
+ // ai <= 6 records the schema only there, and this filter drops the root, so
27
+ // the schema is copied onto the model-call child when it starts (the root's
28
+ // creation attributes are already set by then).
29
+ _openLegacySchemas = new Map();
30
+ onStart(span) {
31
+ const scope = span.instrumentationScope?.name;
32
+ if (scope === VERCEL_LEGACY_SCOPE) {
33
+ const schema = span.attributes['ai.schema'];
34
+ if (schema !== undefined && !LEGACY_MODEL_CALL_SPAN_NAME.test(span.name)) {
35
+ this._openLegacySchemas.set(span.spanContext().spanId, schema);
36
+ }
37
+ const parentSpanId = _parentSpanId(span);
38
+ if (parentSpanId &&
39
+ span.attributes['ai.schema'] === undefined &&
40
+ this._openLegacySchemas.has(parentSpanId)) {
41
+ span.attributes['ai.schema'] = this._openLegacySchemas.get(parentSpanId);
42
+ }
43
+ return;
44
+ }
45
+ if (scope !== VERCEL_SEMCONV_SCOPE)
46
+ return;
47
+ this._openSpanOperations.set(span.spanContext().spanId, span.attributes['gen_ai.operation.name']);
48
+ }
49
+ /**
50
+ * Export verdict for a Vercel AI SDK span, or null when the span is not
51
+ * one (the caller falls back to the default filter).
52
+ */
53
+ shouldExport(span) {
54
+ const scope = span.instrumentationScope?.name;
55
+ if (scope === VERCEL_LEGACY_SCOPE) {
56
+ this._openLegacySchemas.delete(span.spanContext().spanId);
57
+ return LEGACY_MODEL_CALL_SPAN_NAME.test(span.name);
58
+ }
59
+ if (scope !== VERCEL_SEMCONV_SCOPE) {
60
+ return null;
61
+ }
62
+ const operation = span.attributes['gen_ai.operation.name'];
63
+ this._openSpanOperations.delete(span.spanContext().spanId);
64
+ if (operation === 'chat') {
65
+ return true;
66
+ }
67
+ if (operation === 'embeddings') {
68
+ // Keep the outer aggregate (one event per embed/embedMany call, with the
69
+ // total usage) and drop the nested model-call span(s) repeating it.
70
+ const parentSpanId = _parentSpanId(span);
71
+ return (parentSpanId && this._openSpanOperations.get(parentSpanId)) !== 'embeddings';
72
+ }
73
+ // invoke_agent / agent_step (usage aggregates) and execute_tool (no usage).
74
+ return false;
75
+ }
76
+ }
77
+ exports.VercelAiSdkSpanFilter = VercelAiSdkSpanFilter;
78
+ // `@ai-sdk/otel` reports the Vercel AI Gateway as the bare provider id
79
+ // "gateway" — too generic a name to special-case downstream. Stamp the weflayr
80
+ // provider override (which the normalizer prefers) with the canonical name.
81
+ // A providerNameOverride set through propagateMetadata was stamped at span start and
82
+ // wins.
83
+ function stampVercelGatewayProviderName(span) {
84
+ if (span.attributes['gen_ai.provider.name'] === 'gateway' &&
85
+ span.attributes['weflayr.provider_name'] === undefined) {
86
+ span.attributes['weflayr.provider_name'] = 'vercel_ai_gateway';
87
+ }
88
+ }
@@ -0,0 +1,50 @@
1
+ import { type TracerProvider } from '@opentelemetry/api';
2
+ import { WeflayrSpanProcessor, type OtelSpanAttributes, type Tags } from './otel/span-processor';
3
+ export interface SetupOptions {
4
+ /** Weflayr API key. Defaults to the `WEFLAYR_API_KEY` environment variable. */
5
+ apiKey?: string;
6
+ /** Override the intake base URL. Defaults to WEFLAYR_BASE_URL or https://api.weflayr.com. */
7
+ baseUrl?: string;
8
+ /** Tags applied to every emitted span. */
9
+ defaultTags?: Tags;
10
+ /**
11
+ * `'batch'` (default) groups spans for throughput. `'immediate'` flushes every
12
+ * span synchronously — recommended for short-lived runtimes (Lambda, edge).
13
+ */
14
+ exportMode?: 'batch' | 'immediate';
15
+ /**
16
+ * When `false`, sets OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=false
17
+ * so instrumentations strip `gen_ai.prompt` / `gen_ai.completion` from spans
18
+ * before they're emitted. Defaults to `true`.
19
+ */
20
+ captureMessageContent?: boolean;
21
+ /**
22
+ * Last-line-of-defense scrubber. Receives the span attribute bag just before
23
+ * export; return the (optionally mutated) bag.
24
+ */
25
+ mask?: (attrs: OtelSpanAttributes) => OtelSpanAttributes;
26
+ /** Whether the exporter logs a warning to stderr on every failed export. Defaults to `true`. */
27
+ warnOnExportError?: boolean;
28
+ }
29
+ interface State {
30
+ tracerProvider: TracerProvider | null;
31
+ processor: WeflayrSpanProcessor | null;
32
+ beforeExitListener: (() => Promise<void>) | null;
33
+ }
34
+ export declare const _state: State;
35
+ /**
36
+ * Configure the Weflayr SDK.
37
+ *
38
+ * Call once per process, before `autoInstrument`. For per-request or
39
+ * per-tenant data in a long-running server use `propagateMetadata(...)` —
40
+ * it stores metadata in OTel's `Context` (built on AsyncLocalStorage) and
41
+ * isolates correctly across concurrent requests.
42
+ *
43
+ * Calling `setup` again is supported but replaces the previous
44
+ * configuration: the prior processor is shut down and detached so we never
45
+ * stack exporters (which would otherwise double-export every span and leak
46
+ * HTTP pools).
47
+ */
48
+ export declare function setup(options: SetupOptions): void;
49
+ export declare function flush(): Promise<void>;
50
+ export {};
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._state = void 0;
4
+ exports.setup = setup;
5
+ exports.flush = flush;
6
+ const api_1 = require("@opentelemetry/api");
7
+ const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
8
+ const resources_1 = require("@opentelemetry/resources");
9
+ const exporter_1 = require("./otel/exporter");
10
+ const span_processor_1 = require("./otel/span-processor");
11
+ const logger_1 = require("./logger");
12
+ const package_json_1 = require("../package.json");
13
+ const SDK_LANGUAGE = 'javascript';
14
+ const DEFAULT_BASE_URL = 'https://api.weflayr.com';
15
+ exports._state = {
16
+ tracerProvider: null,
17
+ processor: null,
18
+ beforeExitListener: null,
19
+ };
20
+ // `trace.getTracerProvider()` returns a ProxyTracerProvider that forwards to
21
+ // whoever called `.register()` last. Unwrap it to reach the real provider.
22
+ // The delegate/registration internals aren't part of the public TracerProvider
23
+ // type, so this reaches into them dynamically.
24
+ function _unwrapTracerProvider(p) {
25
+ const maybeProxy = p;
26
+ if (maybeProxy && typeof maybeProxy.getDelegate === 'function') {
27
+ return maybeProxy.getDelegate();
28
+ }
29
+ return p;
30
+ }
31
+ // `NodeTracerProvider` 2.x dropped the public `addSpanProcessor` API —
32
+ // processors are construction-time only. To attach to a provider somebody
33
+ // else owns, we splice into the internal MultiSpanProcessor. This matches
34
+ // the actual public OTel JS guidance for composing post-construction.
35
+ function _attachProcessorToExistingProvider(provider, processor) {
36
+ if (!provider)
37
+ return false;
38
+ const internals = provider;
39
+ if (typeof internals.addSpanProcessor === 'function') {
40
+ internals.addSpanProcessor(processor);
41
+ return true;
42
+ }
43
+ const multi = internals._activeSpanProcessor;
44
+ if (multi && Array.isArray(multi._spanProcessors)) {
45
+ multi._spanProcessors.push(processor);
46
+ return true;
47
+ }
48
+ return false;
49
+ }
50
+ /**
51
+ * Configure the Weflayr SDK.
52
+ *
53
+ * Call once per process, before `autoInstrument`. For per-request or
54
+ * per-tenant data in a long-running server use `propagateMetadata(...)` —
55
+ * it stores metadata in OTel's `Context` (built on AsyncLocalStorage) and
56
+ * isolates correctly across concurrent requests.
57
+ *
58
+ * Calling `setup` again is supported but replaces the previous
59
+ * configuration: the prior processor is shut down and detached so we never
60
+ * stack exporters (which would otherwise double-export every span and leak
61
+ * HTTP pools).
62
+ */
63
+ function setup(options) {
64
+ const opts = options || {};
65
+ const apiKey = opts.apiKey || process.env.WEFLAYR_API_KEY;
66
+ if (typeof apiKey !== 'string' || !apiKey) {
67
+ throw new Error('weflayr.setup: `apiKey` is required (pass it explicitly or set WEFLAYR_API_KEY)');
68
+ }
69
+ const resolvedOptions = { ...opts, apiKey };
70
+ if (resolvedOptions.captureMessageContent === false) {
71
+ process.env[span_processor_1.CONTENT_CAPTURE_ENV] = 'false';
72
+ }
73
+ else if (resolvedOptions.captureMessageContent === true) {
74
+ process.env[span_processor_1.CONTENT_CAPTURE_ENV] = 'true';
75
+ }
76
+ _detachPreviousWeflayrProcessor();
77
+ const baseUrl = resolvedOptions.baseUrl || process.env.WEFLAYR_BASE_URL || DEFAULT_BASE_URL;
78
+ const exporter = (0, exporter_1.buildExporter)({
79
+ baseUrl,
80
+ apiKey: resolvedOptions.apiKey,
81
+ warnOnExportError: resolvedOptions.warnOnExportError !== false,
82
+ });
83
+ const processor = new span_processor_1.WeflayrSpanProcessor({
84
+ exporter,
85
+ exportMode: resolvedOptions.exportMode || 'batch',
86
+ defaultTags: resolvedOptions.defaultTags || {},
87
+ mask: resolvedOptions.mask,
88
+ });
89
+ // Adopt an existing TracerProvider when there is one — e.g. the user already
90
+ // configured Datadog/Honeycomb/OTel, or called weflayr.setup() before.
91
+ // provider.register() silently refuses to override the proxy if another
92
+ // provider is already wired in, so naively creating a new provider would
93
+ // leave our processor attached to a dead one and we'd drop every LLM span.
94
+ const currentTracerProvider = _unwrapTracerProvider(api_1.trace.getTracerProvider());
95
+ let tracerProvider;
96
+ if (_attachProcessorToExistingProvider(currentTracerProvider, processor)) {
97
+ tracerProvider = currentTracerProvider;
98
+ }
99
+ else {
100
+ const nodeTracerProvider = new sdk_trace_node_1.NodeTracerProvider({
101
+ resource: (0, resources_1.resourceFromAttributes)({
102
+ sdk_version: package_json_1.version,
103
+ sdk_language: SDK_LANGUAGE,
104
+ }),
105
+ spanProcessors: [processor],
106
+ });
107
+ nodeTracerProvider.register();
108
+ tracerProvider = nodeTracerProvider;
109
+ }
110
+ // beforeExit fires when the event loop empties on a clean exit, giving us a
111
+ // last async tick to drain buffered spans. It does NOT fire on process.exit()
112
+ // or uncaught fatals — callers handling those paths still need to call flush
113
+ // explicitly (e.g. in a finally) for the OTLP HTTP request to complete.
114
+ if (!exports._state.beforeExitListener) {
115
+ exports._state.beforeExitListener = async () => {
116
+ try {
117
+ await flush();
118
+ }
119
+ catch {
120
+ // best-effort: process is already winding down.
121
+ }
122
+ };
123
+ process.on('beforeExit', exports._state.beforeExitListener);
124
+ }
125
+ exports._state.tracerProvider = tracerProvider;
126
+ exports._state.processor = processor;
127
+ (0, logger_1.debug)('setup ready: baseUrl=%s exportMode=%s defaultTags=%d', baseUrl, resolvedOptions.exportMode || 'batch', Object.keys(resolvedOptions.defaultTags || {}).length);
128
+ }
129
+ async function flush() {
130
+ if (!exports._state.processor)
131
+ return;
132
+ (0, logger_1.debug)('flush: forcing exporter flush');
133
+ await exports._state.processor.forceFlush();
134
+ }
135
+ // Shut down + detach the prior weflayr processor — idempotency for setup().
136
+ // Without this, calling setup() twice (key rotation, hot reload, tests that
137
+ // reconfigure) would leave the first processor wired in alongside the new
138
+ // one, double-exporting every span and leaking exporter HTTP pools.
139
+ function _detachPreviousWeflayrProcessor() {
140
+ const previousProcessor = exports._state.processor;
141
+ if (!previousProcessor)
142
+ return;
143
+ const tp = exports._state.tracerProvider;
144
+ const multi = tp && tp._activeSpanProcessor;
145
+ if (multi && Array.isArray(multi._spanProcessors)) {
146
+ multi._spanProcessors = multi._spanProcessors.filter((processor) => processor !== previousProcessor);
147
+ }
148
+ try {
149
+ previousProcessor.shutdown();
150
+ }
151
+ catch {
152
+ // best-effort cleanup.
153
+ }
154
+ exports._state.processor = null;
155
+ }
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "weflayr",
3
- "version": "0.24.0",
4
- "description": "Weflayr Node.js SDK — instrument any LLM client via JS Proxy",
5
- "main": "src/index.js",
6
- "types": "index.d.ts",
3
+ "version": "0.26.0",
4
+ "description": "Weflayr JS/TS SDK — instrument any LLM client",
5
+ "main": "dist/src/index.js",
6
+ "types": "dist/src/index.d.ts",
7
+ "files": [
8
+ "dist/src"
9
+ ],
7
10
  "scripts": {
8
11
  "build": "tsc",
9
12
  "generate-api": "openapi-ts && node scripts/generate_facade.mjs",
@@ -36,9 +39,12 @@
36
39
  },
37
40
  "devDependencies": {
38
41
  "@hey-api/openapi-ts": "^0.99.0",
42
+ "@opentelemetry/context-async-hooks": "^2.8.0",
43
+ "@types/async-retry": "^1.4.9",
39
44
  "@types/node": "^26.1.1",
40
45
  "eslint": "^9.18.0",
41
46
  "prettier": "^3.4.2",
42
- "typescript": "^6.0.3"
47
+ "typescript": "^6.0.3",
48
+ "typescript-eslint": "^8.65.0"
43
49
  }
44
50
  }
package/.prettierignore DELETED
@@ -1,2 +0,0 @@
1
- src/api/generated/
2
- dist/
package/.prettierrc.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "semi": true,
3
- "singleQuote": true,
4
- "trailingComma": "es5",
5
- "printWidth": 100,
6
- "tabWidth": 2
7
- }
package/LICENSE-MIT DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Langfuse GmbH
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/NOTICE DELETED
@@ -1,12 +0,0 @@
1
- Weflayr Node.js SDK
2
- Copyright 2026 Weflayr
3
-
4
- This product includes software derived from langfuse-js
5
- (https://github.com/langfuse/langfuse-js), Copyright 2024 Langfuse GmbH,
6
- licensed under the MIT License.
7
-
8
- Specifically, the OpenTelemetry span filter, span processor, and tag-propagation
9
- helpers in src/otel/ are derived from langfuse-js packages/otel and packages/core
10
- and have been adapted for the Weflayr intake API and tag schema.
11
-
12
- See LICENSE-MIT for the full MIT license text.
@@ -1,2 +0,0 @@
1
- export { deleteCustomersTags, deleteKeyMetrics, deleteRevenue, getCustomers, getCustomersTags, getFeatures, getKeyMetrics, getMargin, getModels, getProject, getProviders, getRevenue, getTags, type Options, setCustomersTags, setKeyMetrics, setRevenue } from './sdk.gen.js';
2
- export type { AllCustomerTagsOutput, ApiErrorOutput, ClientOptions, CustomerMarginRow, CustomerOutput, CustomersOutput, CustomersUpdatedOutput, CustomerTags, CustomerTagsOutput, DeleteCustomersTagsData, DeleteCustomersTagsError, DeleteCustomersTagsErrors, DeleteCustomersTagsResponse, DeleteCustomersTagsResponses, DeleteKeyMetricsData, DeleteKeyMetricsError, DeleteKeyMetricsErrors, DeleteKeyMetricsResponse, DeleteKeyMetricsResponses, DeleteRevenueData, DeleteRevenueError, DeleteRevenueErrors, DeleteRevenueResponse, DeleteRevenueResponses, FeaturesOutput, GetCustomersData, GetCustomersError, GetCustomersErrors, GetCustomersResponse, GetCustomersResponses, GetCustomersTagsData, GetCustomersTagsError, GetCustomersTagsErrors, GetCustomersTagsResponse, GetCustomersTagsResponses, GetFeaturesData, GetFeaturesError, GetFeaturesErrors, GetFeaturesResponse, GetFeaturesResponses, GetKeyMetricsData, GetKeyMetricsError, GetKeyMetricsErrors, GetKeyMetricsResponse, GetKeyMetricsResponses, GetMarginData, GetMarginError, GetMarginErrors, GetMarginResponse, GetMarginResponses, GetModelsData, GetModelsError, GetModelsErrors, GetModelsResponse, GetModelsResponses, GetProjectData, GetProjectError, GetProjectErrors, GetProjectResponse, GetProjectResponses, GetProvidersData, GetProvidersError, GetProvidersErrors, GetProvidersResponse, GetProvidersResponses, GetRevenueData, GetRevenueError, GetRevenueErrors, GetRevenueResponse, GetRevenueResponses, GetTagsData, GetTagsError, GetTagsErrors, GetTagsResponse, GetTagsResponses, InvalidFieldDetail, InvalidPayloadOutput, KeyMetricOutput, KeyMetricRow, KeyMetricRowOutput, MarginListOutput, ModelsOutput, ProjectOutput, ProvidersOutput, RevenueOrKeyMetricDeletedRowOutput, RevenueOrKeyMetricImportedRowOutput, RevenueOutput, RevenueRow, RevenueRowOutput, SetCustomersTagsData, SetCustomersTagsError, SetCustomersTagsErrors, SetCustomersTagsResponse, SetCustomersTagsResponses, SetCustomerTagsInput, SetKeyMetricsData, SetKeyMetricsError, SetKeyMetricsErrors, SetKeyMetricsInput, SetKeyMetricsResponse, SetKeyMetricsResponses, SetRevenueData, SetRevenueError, SetRevenueErrors, SetRevenueInput, SetRevenueResponse, SetRevenueResponses, TagsDeletedOutput, TagsOutput } from './types.gen.js';