@posthog/agent 1.12.0 → 1.13.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 (219) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  3. package/dist/_virtual/index.js +4 -0
  4. package/dist/_virtual/index.js.map +1 -0
  5. package/dist/node_modules/@ai-sdk/anthropic/dist/index.js +1154 -0
  6. package/dist/node_modules/@ai-sdk/anthropic/dist/index.js.map +1 -0
  7. package/dist/node_modules/@ai-sdk/provider/dist/index.js +296 -0
  8. package/dist/node_modules/@ai-sdk/provider/dist/index.js.map +1 -0
  9. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +576 -0
  10. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js.map +1 -0
  11. package/dist/node_modules/@ai-sdk/ui-utils/dist/index.js +741 -0
  12. package/dist/node_modules/@ai-sdk/ui-utils/dist/index.js.map +1 -0
  13. package/dist/node_modules/@opentelemetry/api/build/esm/api/context.js +112 -0
  14. package/dist/node_modules/@opentelemetry/api/build/esm/api/context.js.map +1 -0
  15. package/dist/node_modules/@opentelemetry/api/build/esm/api/diag.js +123 -0
  16. package/dist/node_modules/@opentelemetry/api/build/esm/api/diag.js.map +1 -0
  17. package/dist/node_modules/@opentelemetry/api/build/esm/api/metrics.js +62 -0
  18. package/dist/node_modules/@opentelemetry/api/build/esm/api/metrics.js.map +1 -0
  19. package/dist/node_modules/@opentelemetry/api/build/esm/api/propagation.js +91 -0
  20. package/dist/node_modules/@opentelemetry/api/build/esm/api/propagation.js.map +1 -0
  21. package/dist/node_modules/@opentelemetry/api/build/esm/api/trace.js +79 -0
  22. package/dist/node_modules/@opentelemetry/api/build/esm/api/trace.js.map +1 -0
  23. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js +59 -0
  24. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js.map +1 -0
  25. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js +99 -0
  26. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js.map +1 -0
  27. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/utils.js +31 -0
  28. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/utils.js.map +1 -0
  29. package/dist/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js +69 -0
  30. package/dist/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js.map +1 -0
  31. package/dist/node_modules/@opentelemetry/api/build/esm/context/context.js +54 -0
  32. package/dist/node_modules/@opentelemetry/api/build/esm/context/context.js.map +1 -0
  33. package/dist/node_modules/@opentelemetry/api/build/esm/context-api.js +22 -0
  34. package/dist/node_modules/@opentelemetry/api/build/esm/context-api.js.map +1 -0
  35. package/dist/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js +104 -0
  36. package/dist/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js.map +1 -0
  37. package/dist/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js +44 -0
  38. package/dist/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js.map +1 -0
  39. package/dist/node_modules/@opentelemetry/api/build/esm/diag/types.js +43 -0
  40. package/dist/node_modules/@opentelemetry/api/build/esm/diag/types.js.map +1 -0
  41. package/dist/node_modules/@opentelemetry/api/build/esm/diag-api.js +27 -0
  42. package/dist/node_modules/@opentelemetry/api/build/esm/diag-api.js.map +1 -0
  43. package/dist/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js +62 -0
  44. package/dist/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js.map +1 -0
  45. package/dist/node_modules/@opentelemetry/api/build/esm/internal/semver.js +121 -0
  46. package/dist/node_modules/@opentelemetry/api/build/esm/internal/semver.js.map +1 -0
  47. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js +167 -0
  48. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js.map +1 -0
  49. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js +33 -0
  50. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js.map +1 -0
  51. package/dist/node_modules/@opentelemetry/api/build/esm/metrics-api.js +22 -0
  52. package/dist/node_modules/@opentelemetry/api/build/esm/metrics-api.js.map +1 -0
  53. package/dist/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js +21 -0
  54. package/dist/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js.map +1 -0
  55. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js +35 -0
  56. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js.map +1 -0
  57. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js +40 -0
  58. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js.map +1 -0
  59. package/dist/node_modules/@opentelemetry/api/build/esm/propagation-api.js +22 -0
  60. package/dist/node_modules/@opentelemetry/api/build/esm/propagation-api.js.map +1 -0
  61. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js +70 -0
  62. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js.map +1 -0
  63. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js +78 -0
  64. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js.map +1 -0
  65. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js +34 -0
  66. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js.map +1 -0
  67. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js +55 -0
  68. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js.map +1 -0
  69. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js +56 -0
  70. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js.map +1 -0
  71. package/dist/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js +76 -0
  72. package/dist/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js.map +1 -0
  73. package/dist/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js +27 -0
  74. package/dist/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js.map +1 -0
  75. package/dist/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js +45 -0
  76. package/dist/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js.map +1 -0
  77. package/dist/node_modules/@opentelemetry/api/build/esm/trace/status.js +22 -0
  78. package/dist/node_modules/@opentelemetry/api/build/esm/trace/status.js.map +1 -0
  79. package/dist/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js +25 -0
  80. package/dist/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js.map +1 -0
  81. package/dist/node_modules/@opentelemetry/api/build/esm/trace-api.js +24 -0
  82. package/dist/node_modules/@opentelemetry/api/build/esm/trace-api.js.map +1 -0
  83. package/dist/node_modules/@opentelemetry/api/build/esm/version.js +20 -0
  84. package/dist/node_modules/@opentelemetry/api/build/esm/version.js.map +1 -0
  85. package/dist/node_modules/ai/dist/index.js +2870 -0
  86. package/dist/node_modules/ai/dist/index.js.map +1 -0
  87. package/dist/node_modules/nanoid/non-secure/index.js +13 -0
  88. package/dist/node_modules/nanoid/non-secure/index.js.map +1 -0
  89. package/dist/node_modules/secure-json-parse/index.js +133 -0
  90. package/dist/node_modules/secure-json-parse/index.js.map +1 -0
  91. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +37 -0
  92. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -0
  93. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +26 -0
  94. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -0
  95. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +17 -0
  96. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -0
  97. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +11 -0
  98. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +1 -0
  99. package/dist/node_modules/zod-to-json-schema/dist/esm/index.js +8 -0
  100. package/dist/node_modules/zod-to-json-schema/dist/esm/index.js.map +1 -0
  101. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +66 -0
  102. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -0
  103. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +21 -0
  104. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -0
  105. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +30 -0
  106. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -0
  107. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +53 -0
  108. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -0
  109. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +8 -0
  110. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -0
  111. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +8 -0
  112. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -0
  113. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +8 -0
  114. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -0
  115. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +50 -0
  116. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -0
  117. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +11 -0
  118. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -0
  119. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +11 -0
  120. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -0
  121. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +9 -0
  122. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -0
  123. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +56 -0
  124. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -0
  125. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +24 -0
  126. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -0
  127. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +30 -0
  128. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -0
  129. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +19 -0
  130. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -0
  131. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +15 -0
  132. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -0
  133. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +13 -0
  134. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -0
  135. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +37 -0
  136. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -0
  137. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +56 -0
  138. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -0
  139. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +76 -0
  140. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -0
  141. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +25 -0
  142. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -0
  143. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +24 -0
  144. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -0
  145. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +8 -0
  146. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -0
  147. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +8 -0
  148. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -0
  149. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +65 -0
  150. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -0
  151. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +24 -0
  152. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -0
  153. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +350 -0
  154. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
  155. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +36 -0
  156. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -0
  157. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +10 -0
  158. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -0
  159. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +84 -0
  160. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -0
  161. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +8 -0
  162. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -0
  163. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +110 -0
  164. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -0
  165. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +90 -0
  166. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -0
  167. package/dist/src/agent.d.ts +3 -0
  168. package/dist/src/agent.d.ts.map +1 -1
  169. package/dist/src/agent.js +93 -291
  170. package/dist/src/agent.js.map +1 -1
  171. package/dist/src/agents/planning.d.ts +1 -1
  172. package/dist/src/agents/planning.d.ts.map +1 -1
  173. package/dist/src/agents/planning.js +1 -2
  174. package/dist/src/agents/planning.js.map +1 -1
  175. package/dist/src/agents/research.d.ts +1 -1
  176. package/dist/src/agents/research.d.ts.map +1 -1
  177. package/dist/src/agents/research.js +3 -6
  178. package/dist/src/agents/research.js.map +1 -1
  179. package/dist/src/prompt-builder.d.ts.map +1 -1
  180. package/dist/src/prompt-builder.js +0 -1
  181. package/dist/src/prompt-builder.js.map +1 -1
  182. package/dist/src/structured-extraction.d.ts +2 -2
  183. package/dist/src/structured-extraction.d.ts.map +1 -1
  184. package/dist/src/structured-extraction.js +51 -110
  185. package/dist/src/structured-extraction.js.map +1 -1
  186. package/dist/src/workflow/config.d.ts +3 -0
  187. package/dist/src/workflow/config.d.ts.map +1 -0
  188. package/dist/src/workflow/config.js +43 -0
  189. package/dist/src/workflow/config.js.map +1 -0
  190. package/dist/src/workflow/steps/build.d.ts +3 -0
  191. package/dist/src/workflow/steps/build.d.ts.map +1 -0
  192. package/dist/src/workflow/steps/build.js +64 -0
  193. package/dist/src/workflow/steps/build.js.map +1 -0
  194. package/dist/src/workflow/steps/plan.d.ts +3 -0
  195. package/dist/src/workflow/steps/plan.d.ts.map +1 -0
  196. package/dist/src/workflow/steps/plan.js +86 -0
  197. package/dist/src/workflow/steps/plan.js.map +1 -0
  198. package/dist/src/workflow/steps/research.d.ts +3 -0
  199. package/dist/src/workflow/steps/research.d.ts.map +1 -0
  200. package/dist/src/workflow/steps/research.js +124 -0
  201. package/dist/src/workflow/steps/research.js.map +1 -0
  202. package/dist/src/workflow/types.d.ts +48 -0
  203. package/dist/src/workflow/types.d.ts.map +1 -0
  204. package/dist/src/workflow/utils.d.ts +12 -0
  205. package/dist/src/workflow/utils.d.ts.map +1 -0
  206. package/dist/src/workflow/utils.js +38 -0
  207. package/dist/src/workflow/utils.js.map +1 -0
  208. package/package.json +5 -2
  209. package/src/agent.ts +112 -321
  210. package/src/agents/planning.ts +1 -2
  211. package/src/agents/research.ts +3 -6
  212. package/src/prompt-builder.ts +0 -2
  213. package/src/structured-extraction.ts +58 -115
  214. package/src/workflow/config.ts +42 -0
  215. package/src/workflow/steps/build.ts +87 -0
  216. package/src/workflow/steps/plan.ts +112 -0
  217. package/src/workflow/steps/research.ts +156 -0
  218. package/src/workflow/types.ts +53 -0
  219. package/src/workflow/utils.ts +50 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../node_modules/@ai-sdk/ui-utils/dist/index.mjs"],"sourcesContent":["// src/index.ts\nimport { generateId } from \"@ai-sdk/provider-utils\";\n\n// src/assistant-stream-parts.ts\nvar textStreamPart = {\n code: \"0\",\n name: \"text\",\n parse: (value) => {\n if (typeof value !== \"string\") {\n throw new Error('\"text\" parts expect a string value.');\n }\n return { type: \"text\", value };\n }\n};\nvar errorStreamPart = {\n code: \"3\",\n name: \"error\",\n parse: (value) => {\n if (typeof value !== \"string\") {\n throw new Error('\"error\" parts expect a string value.');\n }\n return { type: \"error\", value };\n }\n};\nvar assistantMessageStreamPart = {\n code: \"4\",\n name: \"assistant_message\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"id\" in value) || !(\"role\" in value) || !(\"content\" in value) || typeof value.id !== \"string\" || typeof value.role !== \"string\" || value.role !== \"assistant\" || !Array.isArray(value.content) || !value.content.every(\n (item) => item != null && typeof item === \"object\" && \"type\" in item && item.type === \"text\" && \"text\" in item && item.text != null && typeof item.text === \"object\" && \"value\" in item.text && typeof item.text.value === \"string\"\n )) {\n throw new Error(\n '\"assistant_message\" parts expect an object with an \"id\", \"role\", and \"content\" property.'\n );\n }\n return {\n type: \"assistant_message\",\n value\n };\n }\n};\nvar assistantControlDataStreamPart = {\n code: \"5\",\n name: \"assistant_control_data\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"threadId\" in value) || !(\"messageId\" in value) || typeof value.threadId !== \"string\" || typeof value.messageId !== \"string\") {\n throw new Error(\n '\"assistant_control_data\" parts expect an object with a \"threadId\" and \"messageId\" property.'\n );\n }\n return {\n type: \"assistant_control_data\",\n value: {\n threadId: value.threadId,\n messageId: value.messageId\n }\n };\n }\n};\nvar dataMessageStreamPart = {\n code: \"6\",\n name: \"data_message\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"role\" in value) || !(\"data\" in value) || typeof value.role !== \"string\" || value.role !== \"data\") {\n throw new Error(\n '\"data_message\" parts expect an object with a \"role\" and \"data\" property.'\n );\n }\n return {\n type: \"data_message\",\n value\n };\n }\n};\nvar assistantStreamParts = [\n textStreamPart,\n errorStreamPart,\n assistantMessageStreamPart,\n assistantControlDataStreamPart,\n dataMessageStreamPart\n];\nvar assistantStreamPartsByCode = {\n [textStreamPart.code]: textStreamPart,\n [errorStreamPart.code]: errorStreamPart,\n [assistantMessageStreamPart.code]: assistantMessageStreamPart,\n [assistantControlDataStreamPart.code]: assistantControlDataStreamPart,\n [dataMessageStreamPart.code]: dataMessageStreamPart\n};\nvar StreamStringPrefixes = {\n [textStreamPart.name]: textStreamPart.code,\n [errorStreamPart.name]: errorStreamPart.code,\n [assistantMessageStreamPart.name]: assistantMessageStreamPart.code,\n [assistantControlDataStreamPart.name]: assistantControlDataStreamPart.code,\n [dataMessageStreamPart.name]: dataMessageStreamPart.code\n};\nvar validCodes = assistantStreamParts.map((part) => part.code);\nvar parseAssistantStreamPart = (line) => {\n const firstSeparatorIndex = line.indexOf(\":\");\n if (firstSeparatorIndex === -1) {\n throw new Error(\"Failed to parse stream string. No separator found.\");\n }\n const prefix = line.slice(0, firstSeparatorIndex);\n if (!validCodes.includes(prefix)) {\n throw new Error(`Failed to parse stream string. Invalid code ${prefix}.`);\n }\n const code = prefix;\n const textValue = line.slice(firstSeparatorIndex + 1);\n const jsonValue = JSON.parse(textValue);\n return assistantStreamPartsByCode[code].parse(jsonValue);\n};\nfunction formatAssistantStreamPart(type, value) {\n const streamPart = assistantStreamParts.find((part) => part.name === type);\n if (!streamPart) {\n throw new Error(`Invalid stream part type: ${type}`);\n }\n return `${streamPart.code}:${JSON.stringify(value)}\n`;\n}\n\n// src/process-chat-response.ts\nimport { generateId as generateIdFunction } from \"@ai-sdk/provider-utils\";\n\n// src/duplicated/usage.ts\nfunction calculateLanguageModelUsage({\n promptTokens,\n completionTokens\n}) {\n return {\n promptTokens,\n completionTokens,\n totalTokens: promptTokens + completionTokens\n };\n}\n\n// src/parse-partial-json.ts\nimport { safeParseJSON } from \"@ai-sdk/provider-utils\";\n\n// src/fix-json.ts\nfunction fixJson(input) {\n const stack = [\"ROOT\"];\n let lastValidIndex = -1;\n let literalStart = null;\n function processValueStart(char, i, swapState) {\n {\n switch (char) {\n case '\"': {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_STRING\");\n break;\n }\n case \"f\":\n case \"t\":\n case \"n\": {\n lastValidIndex = i;\n literalStart = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_LITERAL\");\n break;\n }\n case \"-\": {\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_NUMBER\");\n break;\n }\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\": {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_NUMBER\");\n break;\n }\n case \"{\": {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_OBJECT_START\");\n break;\n }\n case \"[\": {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_ARRAY_START\");\n break;\n }\n }\n }\n }\n function processAfterObjectValue(char, i) {\n switch (char) {\n case \",\": {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_AFTER_COMMA\");\n break;\n }\n case \"}\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n }\n }\n function processAfterArrayValue(char, i) {\n switch (char) {\n case \",\": {\n stack.pop();\n stack.push(\"INSIDE_ARRAY_AFTER_COMMA\");\n break;\n }\n case \"]\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n }\n }\n for (let i = 0; i < input.length; i++) {\n const char = input[i];\n const currentState = stack[stack.length - 1];\n switch (currentState) {\n case \"ROOT\":\n processValueStart(char, i, \"FINISH\");\n break;\n case \"INSIDE_OBJECT_START\": {\n switch (char) {\n case '\"': {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_KEY\");\n break;\n }\n case \"}\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n }\n break;\n }\n case \"INSIDE_OBJECT_AFTER_COMMA\": {\n switch (char) {\n case '\"': {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_KEY\");\n break;\n }\n }\n break;\n }\n case \"INSIDE_OBJECT_KEY\": {\n switch (char) {\n case '\"': {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_AFTER_KEY\");\n break;\n }\n }\n break;\n }\n case \"INSIDE_OBJECT_AFTER_KEY\": {\n switch (char) {\n case \":\": {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_BEFORE_VALUE\");\n break;\n }\n }\n break;\n }\n case \"INSIDE_OBJECT_BEFORE_VALUE\": {\n processValueStart(char, i, \"INSIDE_OBJECT_AFTER_VALUE\");\n break;\n }\n case \"INSIDE_OBJECT_AFTER_VALUE\": {\n processAfterObjectValue(char, i);\n break;\n }\n case \"INSIDE_STRING\": {\n switch (char) {\n case '\"': {\n stack.pop();\n lastValidIndex = i;\n break;\n }\n case \"\\\\\": {\n stack.push(\"INSIDE_STRING_ESCAPE\");\n break;\n }\n default: {\n lastValidIndex = i;\n }\n }\n break;\n }\n case \"INSIDE_ARRAY_START\": {\n switch (char) {\n case \"]\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n default: {\n lastValidIndex = i;\n processValueStart(char, i, \"INSIDE_ARRAY_AFTER_VALUE\");\n break;\n }\n }\n break;\n }\n case \"INSIDE_ARRAY_AFTER_VALUE\": {\n switch (char) {\n case \",\": {\n stack.pop();\n stack.push(\"INSIDE_ARRAY_AFTER_COMMA\");\n break;\n }\n case \"]\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n default: {\n lastValidIndex = i;\n break;\n }\n }\n break;\n }\n case \"INSIDE_ARRAY_AFTER_COMMA\": {\n processValueStart(char, i, \"INSIDE_ARRAY_AFTER_VALUE\");\n break;\n }\n case \"INSIDE_STRING_ESCAPE\": {\n stack.pop();\n lastValidIndex = i;\n break;\n }\n case \"INSIDE_NUMBER\": {\n switch (char) {\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\": {\n lastValidIndex = i;\n break;\n }\n case \"e\":\n case \"E\":\n case \"-\":\n case \".\": {\n break;\n }\n case \",\": {\n stack.pop();\n if (stack[stack.length - 1] === \"INSIDE_ARRAY_AFTER_VALUE\") {\n processAfterArrayValue(char, i);\n }\n if (stack[stack.length - 1] === \"INSIDE_OBJECT_AFTER_VALUE\") {\n processAfterObjectValue(char, i);\n }\n break;\n }\n case \"}\": {\n stack.pop();\n if (stack[stack.length - 1] === \"INSIDE_OBJECT_AFTER_VALUE\") {\n processAfterObjectValue(char, i);\n }\n break;\n }\n case \"]\": {\n stack.pop();\n if (stack[stack.length - 1] === \"INSIDE_ARRAY_AFTER_VALUE\") {\n processAfterArrayValue(char, i);\n }\n break;\n }\n default: {\n stack.pop();\n break;\n }\n }\n break;\n }\n case \"INSIDE_LITERAL\": {\n const partialLiteral = input.substring(literalStart, i + 1);\n if (!\"false\".startsWith(partialLiteral) && !\"true\".startsWith(partialLiteral) && !\"null\".startsWith(partialLiteral)) {\n stack.pop();\n if (stack[stack.length - 1] === \"INSIDE_OBJECT_AFTER_VALUE\") {\n processAfterObjectValue(char, i);\n } else if (stack[stack.length - 1] === \"INSIDE_ARRAY_AFTER_VALUE\") {\n processAfterArrayValue(char, i);\n }\n } else {\n lastValidIndex = i;\n }\n break;\n }\n }\n }\n let result = input.slice(0, lastValidIndex + 1);\n for (let i = stack.length - 1; i >= 0; i--) {\n const state = stack[i];\n switch (state) {\n case \"INSIDE_STRING\": {\n result += '\"';\n break;\n }\n case \"INSIDE_OBJECT_KEY\":\n case \"INSIDE_OBJECT_AFTER_KEY\":\n case \"INSIDE_OBJECT_AFTER_COMMA\":\n case \"INSIDE_OBJECT_START\":\n case \"INSIDE_OBJECT_BEFORE_VALUE\":\n case \"INSIDE_OBJECT_AFTER_VALUE\": {\n result += \"}\";\n break;\n }\n case \"INSIDE_ARRAY_START\":\n case \"INSIDE_ARRAY_AFTER_COMMA\":\n case \"INSIDE_ARRAY_AFTER_VALUE\": {\n result += \"]\";\n break;\n }\n case \"INSIDE_LITERAL\": {\n const partialLiteral = input.substring(literalStart, input.length);\n if (\"true\".startsWith(partialLiteral)) {\n result += \"true\".slice(partialLiteral.length);\n } else if (\"false\".startsWith(partialLiteral)) {\n result += \"false\".slice(partialLiteral.length);\n } else if (\"null\".startsWith(partialLiteral)) {\n result += \"null\".slice(partialLiteral.length);\n }\n }\n }\n }\n return result;\n}\n\n// src/parse-partial-json.ts\nfunction parsePartialJson(jsonText) {\n if (jsonText === void 0) {\n return { value: void 0, state: \"undefined-input\" };\n }\n let result = safeParseJSON({ text: jsonText });\n if (result.success) {\n return { value: result.value, state: \"successful-parse\" };\n }\n result = safeParseJSON({ text: fixJson(jsonText) });\n if (result.success) {\n return { value: result.value, state: \"repaired-parse\" };\n }\n return { value: void 0, state: \"failed-parse\" };\n}\n\n// src/data-stream-parts.ts\nvar textStreamPart2 = {\n code: \"0\",\n name: \"text\",\n parse: (value) => {\n if (typeof value !== \"string\") {\n throw new Error('\"text\" parts expect a string value.');\n }\n return { type: \"text\", value };\n }\n};\nvar dataStreamPart = {\n code: \"2\",\n name: \"data\",\n parse: (value) => {\n if (!Array.isArray(value)) {\n throw new Error('\"data\" parts expect an array value.');\n }\n return { type: \"data\", value };\n }\n};\nvar errorStreamPart2 = {\n code: \"3\",\n name: \"error\",\n parse: (value) => {\n if (typeof value !== \"string\") {\n throw new Error('\"error\" parts expect a string value.');\n }\n return { type: \"error\", value };\n }\n};\nvar messageAnnotationsStreamPart = {\n code: \"8\",\n name: \"message_annotations\",\n parse: (value) => {\n if (!Array.isArray(value)) {\n throw new Error('\"message_annotations\" parts expect an array value.');\n }\n return { type: \"message_annotations\", value };\n }\n};\nvar toolCallStreamPart = {\n code: \"9\",\n name: \"tool_call\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"toolCallId\" in value) || typeof value.toolCallId !== \"string\" || !(\"toolName\" in value) || typeof value.toolName !== \"string\" || !(\"args\" in value) || typeof value.args !== \"object\") {\n throw new Error(\n '\"tool_call\" parts expect an object with a \"toolCallId\", \"toolName\", and \"args\" property.'\n );\n }\n return {\n type: \"tool_call\",\n value\n };\n }\n};\nvar toolResultStreamPart = {\n code: \"a\",\n name: \"tool_result\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"toolCallId\" in value) || typeof value.toolCallId !== \"string\" || !(\"result\" in value)) {\n throw new Error(\n '\"tool_result\" parts expect an object with a \"toolCallId\" and a \"result\" property.'\n );\n }\n return {\n type: \"tool_result\",\n value\n };\n }\n};\nvar toolCallStreamingStartStreamPart = {\n code: \"b\",\n name: \"tool_call_streaming_start\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"toolCallId\" in value) || typeof value.toolCallId !== \"string\" || !(\"toolName\" in value) || typeof value.toolName !== \"string\") {\n throw new Error(\n '\"tool_call_streaming_start\" parts expect an object with a \"toolCallId\" and \"toolName\" property.'\n );\n }\n return {\n type: \"tool_call_streaming_start\",\n value\n };\n }\n};\nvar toolCallDeltaStreamPart = {\n code: \"c\",\n name: \"tool_call_delta\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"toolCallId\" in value) || typeof value.toolCallId !== \"string\" || !(\"argsTextDelta\" in value) || typeof value.argsTextDelta !== \"string\") {\n throw new Error(\n '\"tool_call_delta\" parts expect an object with a \"toolCallId\" and \"argsTextDelta\" property.'\n );\n }\n return {\n type: \"tool_call_delta\",\n value\n };\n }\n};\nvar finishMessageStreamPart = {\n code: \"d\",\n name: \"finish_message\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"finishReason\" in value) || typeof value.finishReason !== \"string\") {\n throw new Error(\n '\"finish_message\" parts expect an object with a \"finishReason\" property.'\n );\n }\n const result = {\n finishReason: value.finishReason\n };\n if (\"usage\" in value && value.usage != null && typeof value.usage === \"object\" && \"promptTokens\" in value.usage && \"completionTokens\" in value.usage) {\n result.usage = {\n promptTokens: typeof value.usage.promptTokens === \"number\" ? value.usage.promptTokens : Number.NaN,\n completionTokens: typeof value.usage.completionTokens === \"number\" ? value.usage.completionTokens : Number.NaN\n };\n }\n return {\n type: \"finish_message\",\n value: result\n };\n }\n};\nvar finishStepStreamPart = {\n code: \"e\",\n name: \"finish_step\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"finishReason\" in value) || typeof value.finishReason !== \"string\") {\n throw new Error(\n '\"finish_step\" parts expect an object with a \"finishReason\" property.'\n );\n }\n const result = {\n finishReason: value.finishReason,\n isContinued: false\n };\n if (\"usage\" in value && value.usage != null && typeof value.usage === \"object\" && \"promptTokens\" in value.usage && \"completionTokens\" in value.usage) {\n result.usage = {\n promptTokens: typeof value.usage.promptTokens === \"number\" ? value.usage.promptTokens : Number.NaN,\n completionTokens: typeof value.usage.completionTokens === \"number\" ? value.usage.completionTokens : Number.NaN\n };\n }\n if (\"isContinued\" in value && typeof value.isContinued === \"boolean\") {\n result.isContinued = value.isContinued;\n }\n return {\n type: \"finish_step\",\n value: result\n };\n }\n};\nvar startStepStreamPart = {\n code: \"f\",\n name: \"start_step\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"messageId\" in value) || typeof value.messageId !== \"string\") {\n throw new Error(\n '\"start_step\" parts expect an object with an \"id\" property.'\n );\n }\n return {\n type: \"start_step\",\n value: {\n messageId: value.messageId\n }\n };\n }\n};\nvar reasoningStreamPart = {\n code: \"g\",\n name: \"reasoning\",\n parse: (value) => {\n if (typeof value !== \"string\") {\n throw new Error('\"reasoning\" parts expect a string value.');\n }\n return { type: \"reasoning\", value };\n }\n};\nvar sourcePart = {\n code: \"h\",\n name: \"source\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\") {\n throw new Error('\"source\" parts expect a Source object.');\n }\n return {\n type: \"source\",\n value\n };\n }\n};\nvar redactedReasoningStreamPart = {\n code: \"i\",\n name: \"redacted_reasoning\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"data\" in value) || typeof value.data !== \"string\") {\n throw new Error(\n '\"redacted_reasoning\" parts expect an object with a \"data\" property.'\n );\n }\n return { type: \"redacted_reasoning\", value: { data: value.data } };\n }\n};\nvar reasoningSignatureStreamPart = {\n code: \"j\",\n name: \"reasoning_signature\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"signature\" in value) || typeof value.signature !== \"string\") {\n throw new Error(\n '\"reasoning_signature\" parts expect an object with a \"signature\" property.'\n );\n }\n return {\n type: \"reasoning_signature\",\n value: { signature: value.signature }\n };\n }\n};\nvar fileStreamPart = {\n code: \"k\",\n name: \"file\",\n parse: (value) => {\n if (value == null || typeof value !== \"object\" || !(\"data\" in value) || typeof value.data !== \"string\" || !(\"mimeType\" in value) || typeof value.mimeType !== \"string\") {\n throw new Error(\n '\"file\" parts expect an object with a \"data\" and \"mimeType\" property.'\n );\n }\n return { type: \"file\", value };\n }\n};\nvar dataStreamParts = [\n textStreamPart2,\n dataStreamPart,\n errorStreamPart2,\n messageAnnotationsStreamPart,\n toolCallStreamPart,\n toolResultStreamPart,\n toolCallStreamingStartStreamPart,\n toolCallDeltaStreamPart,\n finishMessageStreamPart,\n finishStepStreamPart,\n startStepStreamPart,\n reasoningStreamPart,\n sourcePart,\n redactedReasoningStreamPart,\n reasoningSignatureStreamPart,\n fileStreamPart\n];\nvar dataStreamPartsByCode = Object.fromEntries(\n dataStreamParts.map((part) => [part.code, part])\n);\nvar DataStreamStringPrefixes = Object.fromEntries(\n dataStreamParts.map((part) => [part.name, part.code])\n);\nvar validCodes2 = dataStreamParts.map((part) => part.code);\nvar parseDataStreamPart = (line) => {\n const firstSeparatorIndex = line.indexOf(\":\");\n if (firstSeparatorIndex === -1) {\n throw new Error(\"Failed to parse stream string. No separator found.\");\n }\n const prefix = line.slice(0, firstSeparatorIndex);\n if (!validCodes2.includes(prefix)) {\n throw new Error(`Failed to parse stream string. Invalid code ${prefix}.`);\n }\n const code = prefix;\n const textValue = line.slice(firstSeparatorIndex + 1);\n const jsonValue = JSON.parse(textValue);\n return dataStreamPartsByCode[code].parse(jsonValue);\n};\nfunction formatDataStreamPart(type, value) {\n const streamPart = dataStreamParts.find((part) => part.name === type);\n if (!streamPart) {\n throw new Error(`Invalid stream part type: ${type}`);\n }\n return `${streamPart.code}:${JSON.stringify(value)}\n`;\n}\n\n// src/process-data-stream.ts\nvar NEWLINE = \"\\n\".charCodeAt(0);\nfunction concatChunks(chunks, totalLength) {\n const concatenatedChunks = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n concatenatedChunks.set(chunk, offset);\n offset += chunk.length;\n }\n chunks.length = 0;\n return concatenatedChunks;\n}\nasync function processDataStream({\n stream,\n onTextPart,\n onReasoningPart,\n onReasoningSignaturePart,\n onRedactedReasoningPart,\n onSourcePart,\n onFilePart,\n onDataPart,\n onErrorPart,\n onToolCallStreamingStartPart,\n onToolCallDeltaPart,\n onToolCallPart,\n onToolResultPart,\n onMessageAnnotationsPart,\n onFinishMessagePart,\n onFinishStepPart,\n onStartStepPart\n}) {\n const reader = stream.getReader();\n const decoder = new TextDecoder();\n const chunks = [];\n let totalLength = 0;\n while (true) {\n const { value } = await reader.read();\n if (value) {\n chunks.push(value);\n totalLength += value.length;\n if (value[value.length - 1] !== NEWLINE) {\n continue;\n }\n }\n if (chunks.length === 0) {\n break;\n }\n const concatenatedChunks = concatChunks(chunks, totalLength);\n totalLength = 0;\n const streamParts = decoder.decode(concatenatedChunks, { stream: true }).split(\"\\n\").filter((line) => line !== \"\").map(parseDataStreamPart);\n for (const { type, value: value2 } of streamParts) {\n switch (type) {\n case \"text\":\n await (onTextPart == null ? void 0 : onTextPart(value2));\n break;\n case \"reasoning\":\n await (onReasoningPart == null ? void 0 : onReasoningPart(value2));\n break;\n case \"reasoning_signature\":\n await (onReasoningSignaturePart == null ? void 0 : onReasoningSignaturePart(value2));\n break;\n case \"redacted_reasoning\":\n await (onRedactedReasoningPart == null ? void 0 : onRedactedReasoningPart(value2));\n break;\n case \"file\":\n await (onFilePart == null ? void 0 : onFilePart(value2));\n break;\n case \"source\":\n await (onSourcePart == null ? void 0 : onSourcePart(value2));\n break;\n case \"data\":\n await (onDataPart == null ? void 0 : onDataPart(value2));\n break;\n case \"error\":\n await (onErrorPart == null ? void 0 : onErrorPart(value2));\n break;\n case \"message_annotations\":\n await (onMessageAnnotationsPart == null ? void 0 : onMessageAnnotationsPart(value2));\n break;\n case \"tool_call_streaming_start\":\n await (onToolCallStreamingStartPart == null ? void 0 : onToolCallStreamingStartPart(value2));\n break;\n case \"tool_call_delta\":\n await (onToolCallDeltaPart == null ? void 0 : onToolCallDeltaPart(value2));\n break;\n case \"tool_call\":\n await (onToolCallPart == null ? void 0 : onToolCallPart(value2));\n break;\n case \"tool_result\":\n await (onToolResultPart == null ? void 0 : onToolResultPart(value2));\n break;\n case \"finish_message\":\n await (onFinishMessagePart == null ? void 0 : onFinishMessagePart(value2));\n break;\n case \"finish_step\":\n await (onFinishStepPart == null ? void 0 : onFinishStepPart(value2));\n break;\n case \"start_step\":\n await (onStartStepPart == null ? void 0 : onStartStepPart(value2));\n break;\n default: {\n const exhaustiveCheck = type;\n throw new Error(`Unknown stream part type: ${exhaustiveCheck}`);\n }\n }\n }\n }\n}\n\n// src/process-chat-response.ts\nasync function processChatResponse({\n stream,\n update,\n onToolCall,\n onFinish,\n generateId: generateId2 = generateIdFunction,\n getCurrentDate = () => /* @__PURE__ */ new Date(),\n lastMessage\n}) {\n var _a, _b;\n const replaceLastMessage = (lastMessage == null ? void 0 : lastMessage.role) === \"assistant\";\n let step = replaceLastMessage ? 1 + // find max step in existing tool invocations:\n ((_b = (_a = lastMessage.toolInvocations) == null ? void 0 : _a.reduce((max, toolInvocation) => {\n var _a2;\n return Math.max(max, (_a2 = toolInvocation.step) != null ? _a2 : 0);\n }, 0)) != null ? _b : 0) : 0;\n const message = replaceLastMessage ? structuredClone(lastMessage) : {\n id: generateId2(),\n createdAt: getCurrentDate(),\n role: \"assistant\",\n content: \"\",\n parts: []\n };\n let currentTextPart = void 0;\n let currentReasoningPart = void 0;\n let currentReasoningTextDetail = void 0;\n function updateToolInvocationPart(toolCallId, invocation) {\n const part = message.parts.find(\n (part2) => part2.type === \"tool-invocation\" && part2.toolInvocation.toolCallId === toolCallId\n );\n if (part != null) {\n part.toolInvocation = invocation;\n } else {\n message.parts.push({\n type: \"tool-invocation\",\n toolInvocation: invocation\n });\n }\n }\n const data = [];\n let messageAnnotations = replaceLastMessage ? lastMessage == null ? void 0 : lastMessage.annotations : void 0;\n const partialToolCalls = {};\n let usage = {\n completionTokens: NaN,\n promptTokens: NaN,\n totalTokens: NaN\n };\n let finishReason = \"unknown\";\n function execUpdate() {\n const copiedData = [...data];\n if (messageAnnotations == null ? void 0 : messageAnnotations.length) {\n message.annotations = messageAnnotations;\n }\n const copiedMessage = {\n // deep copy the message to ensure that deep changes (msg attachments) are updated\n // with SolidJS. SolidJS uses referential integration of sub-objects to detect changes.\n ...structuredClone(message),\n // add a revision id to ensure that the message is updated with SWR. SWR uses a\n // hashing approach by default to detect changes, but it only works for shallow\n // changes. This is why we need to add a revision id to ensure that the message\n // is updated with SWR (without it, the changes get stuck in SWR and are not\n // forwarded to rendering):\n revisionId: generateId2()\n };\n update({\n message: copiedMessage,\n data: copiedData,\n replaceLastMessage\n });\n }\n await processDataStream({\n stream,\n onTextPart(value) {\n if (currentTextPart == null) {\n currentTextPart = {\n type: \"text\",\n text: value\n };\n message.parts.push(currentTextPart);\n } else {\n currentTextPart.text += value;\n }\n message.content += value;\n execUpdate();\n },\n onReasoningPart(value) {\n var _a2;\n if (currentReasoningTextDetail == null) {\n currentReasoningTextDetail = { type: \"text\", text: value };\n if (currentReasoningPart != null) {\n currentReasoningPart.details.push(currentReasoningTextDetail);\n }\n } else {\n currentReasoningTextDetail.text += value;\n }\n if (currentReasoningPart == null) {\n currentReasoningPart = {\n type: \"reasoning\",\n reasoning: value,\n details: [currentReasoningTextDetail]\n };\n message.parts.push(currentReasoningPart);\n } else {\n currentReasoningPart.reasoning += value;\n }\n message.reasoning = ((_a2 = message.reasoning) != null ? _a2 : \"\") + value;\n execUpdate();\n },\n onReasoningSignaturePart(value) {\n if (currentReasoningTextDetail != null) {\n currentReasoningTextDetail.signature = value.signature;\n }\n },\n onRedactedReasoningPart(value) {\n if (currentReasoningPart == null) {\n currentReasoningPart = {\n type: \"reasoning\",\n reasoning: \"\",\n details: []\n };\n message.parts.push(currentReasoningPart);\n }\n currentReasoningPart.details.push({\n type: \"redacted\",\n data: value.data\n });\n currentReasoningTextDetail = void 0;\n execUpdate();\n },\n onFilePart(value) {\n message.parts.push({\n type: \"file\",\n mimeType: value.mimeType,\n data: value.data\n });\n execUpdate();\n },\n onSourcePart(value) {\n message.parts.push({\n type: \"source\",\n source: value\n });\n execUpdate();\n },\n onToolCallStreamingStartPart(value) {\n if (message.toolInvocations == null) {\n message.toolInvocations = [];\n }\n partialToolCalls[value.toolCallId] = {\n text: \"\",\n step,\n toolName: value.toolName,\n index: message.toolInvocations.length\n };\n const invocation = {\n state: \"partial-call\",\n step,\n toolCallId: value.toolCallId,\n toolName: value.toolName,\n args: void 0\n };\n message.toolInvocations.push(invocation);\n updateToolInvocationPart(value.toolCallId, invocation);\n execUpdate();\n },\n onToolCallDeltaPart(value) {\n const partialToolCall = partialToolCalls[value.toolCallId];\n partialToolCall.text += value.argsTextDelta;\n const { value: partialArgs } = parsePartialJson(partialToolCall.text);\n const invocation = {\n state: \"partial-call\",\n step: partialToolCall.step,\n toolCallId: value.toolCallId,\n toolName: partialToolCall.toolName,\n args: partialArgs\n };\n message.toolInvocations[partialToolCall.index] = invocation;\n updateToolInvocationPart(value.toolCallId, invocation);\n execUpdate();\n },\n async onToolCallPart(value) {\n const invocation = {\n state: \"call\",\n step,\n ...value\n };\n if (partialToolCalls[value.toolCallId] != null) {\n message.toolInvocations[partialToolCalls[value.toolCallId].index] = invocation;\n } else {\n if (message.toolInvocations == null) {\n message.toolInvocations = [];\n }\n message.toolInvocations.push(invocation);\n }\n updateToolInvocationPart(value.toolCallId, invocation);\n execUpdate();\n if (onToolCall) {\n const result = await onToolCall({ toolCall: value });\n if (result != null) {\n const invocation2 = {\n state: \"result\",\n step,\n ...value,\n result\n };\n message.toolInvocations[message.toolInvocations.length - 1] = invocation2;\n updateToolInvocationPart(value.toolCallId, invocation2);\n execUpdate();\n }\n }\n },\n onToolResultPart(value) {\n const toolInvocations = message.toolInvocations;\n if (toolInvocations == null) {\n throw new Error(\"tool_result must be preceded by a tool_call\");\n }\n const toolInvocationIndex = toolInvocations.findIndex(\n (invocation2) => invocation2.toolCallId === value.toolCallId\n );\n if (toolInvocationIndex === -1) {\n throw new Error(\n \"tool_result must be preceded by a tool_call with the same toolCallId\"\n );\n }\n const invocation = {\n ...toolInvocations[toolInvocationIndex],\n state: \"result\",\n ...value\n };\n toolInvocations[toolInvocationIndex] = invocation;\n updateToolInvocationPart(value.toolCallId, invocation);\n execUpdate();\n },\n onDataPart(value) {\n data.push(...value);\n execUpdate();\n },\n onMessageAnnotationsPart(value) {\n if (messageAnnotations == null) {\n messageAnnotations = [...value];\n } else {\n messageAnnotations.push(...value);\n }\n execUpdate();\n },\n onFinishStepPart(value) {\n step += 1;\n currentTextPart = value.isContinued ? currentTextPart : void 0;\n currentReasoningPart = void 0;\n currentReasoningTextDetail = void 0;\n },\n onStartStepPart(value) {\n if (!replaceLastMessage) {\n message.id = value.messageId;\n }\n message.parts.push({ type: \"step-start\" });\n execUpdate();\n },\n onFinishMessagePart(value) {\n finishReason = value.finishReason;\n if (value.usage != null) {\n usage = calculateLanguageModelUsage(value.usage);\n }\n },\n onErrorPart(error) {\n throw new Error(error);\n }\n });\n onFinish == null ? void 0 : onFinish({ message, finishReason, usage });\n}\n\n// src/process-chat-text-response.ts\nimport { generateId as generateIdFunction2 } from \"@ai-sdk/provider-utils\";\n\n// src/process-text-stream.ts\nasync function processTextStream({\n stream,\n onTextPart\n}) {\n const reader = stream.pipeThrough(new TextDecoderStream()).getReader();\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n await onTextPart(value);\n }\n}\n\n// src/process-chat-text-response.ts\nasync function processChatTextResponse({\n stream,\n update,\n onFinish,\n getCurrentDate = () => /* @__PURE__ */ new Date(),\n generateId: generateId2 = generateIdFunction2\n}) {\n const textPart = { type: \"text\", text: \"\" };\n const resultMessage = {\n id: generateId2(),\n createdAt: getCurrentDate(),\n role: \"assistant\",\n content: \"\",\n parts: [textPart]\n };\n await processTextStream({\n stream,\n onTextPart: (chunk) => {\n resultMessage.content += chunk;\n textPart.text += chunk;\n update({\n message: { ...resultMessage },\n data: [],\n replaceLastMessage: false\n });\n }\n });\n onFinish == null ? void 0 : onFinish(resultMessage, {\n usage: { completionTokens: NaN, promptTokens: NaN, totalTokens: NaN },\n finishReason: \"unknown\"\n });\n}\n\n// src/call-chat-api.ts\nvar getOriginalFetch = () => fetch;\nasync function callChatApi({\n api,\n body,\n streamProtocol = \"data\",\n credentials,\n headers,\n abortController,\n restoreMessagesOnFailure,\n onResponse,\n onUpdate,\n onFinish,\n onToolCall,\n generateId: generateId2,\n fetch: fetch2 = getOriginalFetch(),\n lastMessage,\n requestType = \"generate\"\n}) {\n var _a, _b, _c;\n const request = requestType === \"resume\" ? fetch2(`${api}?chatId=${body.id}`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...headers\n },\n signal: (_a = abortController == null ? void 0 : abortController()) == null ? void 0 : _a.signal,\n credentials\n }) : fetch2(api, {\n method: \"POST\",\n body: JSON.stringify(body),\n headers: {\n \"Content-Type\": \"application/json\",\n ...headers\n },\n signal: (_b = abortController == null ? void 0 : abortController()) == null ? void 0 : _b.signal,\n credentials\n });\n const response = await request.catch((err) => {\n restoreMessagesOnFailure();\n throw err;\n });\n if (onResponse) {\n try {\n await onResponse(response);\n } catch (err) {\n throw err;\n }\n }\n if (!response.ok) {\n restoreMessagesOnFailure();\n throw new Error(\n (_c = await response.text()) != null ? _c : \"Failed to fetch the chat response.\"\n );\n }\n if (!response.body) {\n throw new Error(\"The response body is empty.\");\n }\n switch (streamProtocol) {\n case \"text\": {\n await processChatTextResponse({\n stream: response.body,\n update: onUpdate,\n onFinish,\n generateId: generateId2\n });\n return;\n }\n case \"data\": {\n await processChatResponse({\n stream: response.body,\n update: onUpdate,\n lastMessage,\n onToolCall,\n onFinish({ message, finishReason, usage }) {\n if (onFinish && message != null) {\n onFinish(message, { usage, finishReason });\n }\n },\n generateId: generateId2\n });\n return;\n }\n default: {\n const exhaustiveCheck = streamProtocol;\n throw new Error(`Unknown stream protocol: ${exhaustiveCheck}`);\n }\n }\n}\n\n// src/call-completion-api.ts\nvar getOriginalFetch2 = () => fetch;\nasync function callCompletionApi({\n api,\n prompt,\n credentials,\n headers,\n body,\n streamProtocol = \"data\",\n setCompletion,\n setLoading,\n setError,\n setAbortController,\n onResponse,\n onFinish,\n onError,\n onData,\n fetch: fetch2 = getOriginalFetch2()\n}) {\n var _a;\n try {\n setLoading(true);\n setError(void 0);\n const abortController = new AbortController();\n setAbortController(abortController);\n setCompletion(\"\");\n const response = await fetch2(api, {\n method: \"POST\",\n body: JSON.stringify({\n prompt,\n ...body\n }),\n credentials,\n headers: {\n \"Content-Type\": \"application/json\",\n ...headers\n },\n signal: abortController.signal\n }).catch((err) => {\n throw err;\n });\n if (onResponse) {\n try {\n await onResponse(response);\n } catch (err) {\n throw err;\n }\n }\n if (!response.ok) {\n throw new Error(\n (_a = await response.text()) != null ? _a : \"Failed to fetch the chat response.\"\n );\n }\n if (!response.body) {\n throw new Error(\"The response body is empty.\");\n }\n let result = \"\";\n switch (streamProtocol) {\n case \"text\": {\n await processTextStream({\n stream: response.body,\n onTextPart: (chunk) => {\n result += chunk;\n setCompletion(result);\n }\n });\n break;\n }\n case \"data\": {\n await processDataStream({\n stream: response.body,\n onTextPart(value) {\n result += value;\n setCompletion(result);\n },\n onDataPart(value) {\n onData == null ? void 0 : onData(value);\n },\n onErrorPart(value) {\n throw new Error(value);\n }\n });\n break;\n }\n default: {\n const exhaustiveCheck = streamProtocol;\n throw new Error(`Unknown stream protocol: ${exhaustiveCheck}`);\n }\n }\n if (onFinish) {\n onFinish(prompt, result);\n }\n setAbortController(null);\n return result;\n } catch (err) {\n if (err.name === \"AbortError\") {\n setAbortController(null);\n return null;\n }\n if (err instanceof Error) {\n if (onError) {\n onError(err);\n }\n }\n setError(err);\n } finally {\n setLoading(false);\n }\n}\n\n// src/data-url.ts\nfunction getTextFromDataUrl(dataUrl) {\n const [header, base64Content] = dataUrl.split(\",\");\n const mimeType = header.split(\";\")[0].split(\":\")[1];\n if (mimeType == null || base64Content == null) {\n throw new Error(\"Invalid data URL format\");\n }\n try {\n return window.atob(base64Content);\n } catch (error) {\n throw new Error(`Error decoding data URL`);\n }\n}\n\n// src/extract-max-tool-invocation-step.ts\nfunction extractMaxToolInvocationStep(toolInvocations) {\n return toolInvocations == null ? void 0 : toolInvocations.reduce((max, toolInvocation) => {\n var _a;\n return Math.max(max, (_a = toolInvocation.step) != null ? _a : 0);\n }, 0);\n}\n\n// src/get-message-parts.ts\nfunction getMessageParts(message) {\n var _a;\n return (_a = message.parts) != null ? _a : [\n ...message.toolInvocations ? message.toolInvocations.map((toolInvocation) => ({\n type: \"tool-invocation\",\n toolInvocation\n })) : [],\n ...message.reasoning ? [\n {\n type: \"reasoning\",\n reasoning: message.reasoning,\n details: [{ type: \"text\", text: message.reasoning }]\n }\n ] : [],\n ...message.content ? [{ type: \"text\", text: message.content }] : []\n ];\n}\n\n// src/fill-message-parts.ts\nfunction fillMessageParts(messages) {\n return messages.map((message) => ({\n ...message,\n parts: getMessageParts(message)\n }));\n}\n\n// src/is-deep-equal-data.ts\nfunction isDeepEqualData(obj1, obj2) {\n if (obj1 === obj2)\n return true;\n if (obj1 == null || obj2 == null)\n return false;\n if (typeof obj1 !== \"object\" && typeof obj2 !== \"object\")\n return obj1 === obj2;\n if (obj1.constructor !== obj2.constructor)\n return false;\n if (obj1 instanceof Date && obj2 instanceof Date) {\n return obj1.getTime() === obj2.getTime();\n }\n if (Array.isArray(obj1)) {\n if (obj1.length !== obj2.length)\n return false;\n for (let i = 0; i < obj1.length; i++) {\n if (!isDeepEqualData(obj1[i], obj2[i]))\n return false;\n }\n return true;\n }\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n if (keys1.length !== keys2.length)\n return false;\n for (const key of keys1) {\n if (!keys2.includes(key))\n return false;\n if (!isDeepEqualData(obj1[key], obj2[key]))\n return false;\n }\n return true;\n}\n\n// src/prepare-attachments-for-request.ts\nasync function prepareAttachmentsForRequest(attachmentsFromOptions) {\n if (!attachmentsFromOptions) {\n return [];\n }\n if (globalThis.FileList && attachmentsFromOptions instanceof globalThis.FileList) {\n return Promise.all(\n Array.from(attachmentsFromOptions).map(async (attachment) => {\n const { name, type } = attachment;\n const dataUrl = await new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (readerEvent) => {\n var _a;\n resolve((_a = readerEvent.target) == null ? void 0 : _a.result);\n };\n reader.onerror = (error) => reject(error);\n reader.readAsDataURL(attachment);\n });\n return {\n name,\n contentType: type,\n url: dataUrl\n };\n })\n );\n }\n if (Array.isArray(attachmentsFromOptions)) {\n return attachmentsFromOptions;\n }\n throw new Error(\"Invalid attachments type\");\n}\n\n// src/process-assistant-stream.ts\nvar NEWLINE2 = \"\\n\".charCodeAt(0);\nfunction concatChunks2(chunks, totalLength) {\n const concatenatedChunks = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n concatenatedChunks.set(chunk, offset);\n offset += chunk.length;\n }\n chunks.length = 0;\n return concatenatedChunks;\n}\nasync function processAssistantStream({\n stream,\n onTextPart,\n onErrorPart,\n onAssistantMessagePart,\n onAssistantControlDataPart,\n onDataMessagePart\n}) {\n const reader = stream.getReader();\n const decoder = new TextDecoder();\n const chunks = [];\n let totalLength = 0;\n while (true) {\n const { value } = await reader.read();\n if (value) {\n chunks.push(value);\n totalLength += value.length;\n if (value[value.length - 1] !== NEWLINE2) {\n continue;\n }\n }\n if (chunks.length === 0) {\n break;\n }\n const concatenatedChunks = concatChunks2(chunks, totalLength);\n totalLength = 0;\n const streamParts = decoder.decode(concatenatedChunks, { stream: true }).split(\"\\n\").filter((line) => line !== \"\").map(parseAssistantStreamPart);\n for (const { type, value: value2 } of streamParts) {\n switch (type) {\n case \"text\":\n await (onTextPart == null ? void 0 : onTextPart(value2));\n break;\n case \"error\":\n await (onErrorPart == null ? void 0 : onErrorPart(value2));\n break;\n case \"assistant_message\":\n await (onAssistantMessagePart == null ? void 0 : onAssistantMessagePart(value2));\n break;\n case \"assistant_control_data\":\n await (onAssistantControlDataPart == null ? void 0 : onAssistantControlDataPart(value2));\n break;\n case \"data_message\":\n await (onDataMessagePart == null ? void 0 : onDataMessagePart(value2));\n break;\n default: {\n const exhaustiveCheck = type;\n throw new Error(`Unknown stream part type: ${exhaustiveCheck}`);\n }\n }\n }\n }\n}\n\n// src/schema.ts\nimport { validatorSymbol } from \"@ai-sdk/provider-utils\";\n\n// src/zod-schema.ts\nimport zodToJsonSchema from \"zod-to-json-schema\";\nfunction zodSchema(zodSchema2, options) {\n var _a;\n const useReferences = (_a = options == null ? void 0 : options.useReferences) != null ? _a : false;\n return jsonSchema(\n zodToJsonSchema(zodSchema2, {\n $refStrategy: useReferences ? \"root\" : \"none\",\n target: \"jsonSchema7\"\n // note: openai mode breaks various gemini conversions\n }),\n {\n validate: (value) => {\n const result = zodSchema2.safeParse(value);\n return result.success ? { success: true, value: result.data } : { success: false, error: result.error };\n }\n }\n );\n}\n\n// src/schema.ts\nvar schemaSymbol = Symbol.for(\"vercel.ai.schema\");\nfunction jsonSchema(jsonSchema2, {\n validate\n} = {}) {\n return {\n [schemaSymbol]: true,\n _type: void 0,\n // should never be used directly\n [validatorSymbol]: true,\n jsonSchema: jsonSchema2,\n validate\n };\n}\nfunction isSchema(value) {\n return typeof value === \"object\" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && \"jsonSchema\" in value && \"validate\" in value;\n}\nfunction asSchema(schema) {\n return isSchema(schema) ? schema : zodSchema(schema);\n}\n\n// src/should-resubmit-messages.ts\nfunction shouldResubmitMessages({\n originalMaxToolInvocationStep,\n originalMessageCount,\n maxSteps,\n messages\n}) {\n var _a;\n const lastMessage = messages[messages.length - 1];\n return (\n // check if the feature is enabled:\n maxSteps > 1 && // ensure there is a last message:\n lastMessage != null && // ensure we actually have new steps (to prevent infinite loops in case of errors):\n (messages.length > originalMessageCount || extractMaxToolInvocationStep(lastMessage.toolInvocations) !== originalMaxToolInvocationStep) && // check that next step is possible:\n isAssistantMessageWithCompletedToolCalls(lastMessage) && // limit the number of automatic steps:\n ((_a = extractMaxToolInvocationStep(lastMessage.toolInvocations)) != null ? _a : 0) < maxSteps\n );\n}\nfunction isAssistantMessageWithCompletedToolCalls(message) {\n if (message.role !== \"assistant\") {\n return false;\n }\n const lastStepStartIndex = message.parts.reduce((lastIndex, part, index) => {\n return part.type === \"step-start\" ? index : lastIndex;\n }, -1);\n const lastStepToolInvocations = message.parts.slice(lastStepStartIndex + 1).filter((part) => part.type === \"tool-invocation\");\n return lastStepToolInvocations.length > 0 && lastStepToolInvocations.every((part) => \"result\" in part.toolInvocation);\n}\n\n// src/update-tool-call-result.ts\nfunction updateToolCallResult({\n messages,\n toolCallId,\n toolResult: result\n}) {\n var _a;\n const lastMessage = messages[messages.length - 1];\n const invocationPart = lastMessage.parts.find(\n (part) => part.type === \"tool-invocation\" && part.toolInvocation.toolCallId === toolCallId\n );\n if (invocationPart == null) {\n return;\n }\n const toolResult = {\n ...invocationPart.toolInvocation,\n state: \"result\",\n result\n };\n invocationPart.toolInvocation = toolResult;\n lastMessage.toolInvocations = (_a = lastMessage.toolInvocations) == null ? void 0 : _a.map(\n (toolInvocation) => toolInvocation.toolCallId === toolCallId ? toolResult : toolInvocation\n );\n}\nexport {\n asSchema,\n callChatApi,\n callCompletionApi,\n extractMaxToolInvocationStep,\n fillMessageParts,\n formatAssistantStreamPart,\n formatDataStreamPart,\n generateId,\n getMessageParts,\n getTextFromDataUrl,\n isAssistantMessageWithCompletedToolCalls,\n isDeepEqualData,\n jsonSchema,\n parseAssistantStreamPart,\n parseDataStreamPart,\n parsePartialJson,\n prepareAttachmentsForRequest,\n processAssistantStream,\n processDataStream,\n processTextStream,\n shouldResubmitMessages,\n updateToolCallResult,\n zodSchema\n};\n//# sourceMappingURL=index.mjs.map"],"names":[],"mappings":";;;;;AAAA;;AAGA;AACA,IAAI,cAAc,GAAG;AACrB,EAAE,IAAI,EAAE,GAAG;AACX,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,KAAK,EAAE,CAAC,KAAK,KAAK;AACpB,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,MAAM,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC;AAC5D,IAAI;AACJ,IAAI,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;AAClC,EAAE;AACF,CAAC;AACD,IAAI,eAAe,GAAG;AACtB,EAAE,IAAI,EA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EAAE,OAAO;AACT,IAAI,CAAC,YAAY,GAAG,IAAI;AACxB,IAAI,KAAK,EAAE,MAAM;AACjB;AACA,IAAI,CAAC,eAAe,GAAG,IAAI;AAC3B,IAAI,UAAU,EAAE,WAAW;AAC3B,IAAI;AACJ,GAAG;AACH;AACA,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,EAAE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,YAAY,IAAI,KAAK,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,IAAI,YAAY,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK;AAC7J;AACA,SAAS,QAAQ,CAAC,MAAM,EAAE;AAC1B,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;AACtD;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,112 @@
1
+ import { NoopContextManager } from '../context/NoopContextManager.js';
2
+ import { registerGlobal, getGlobal, unregisterGlobal } from '../internal/global-utils.js';
3
+ import { DiagAPI } from './diag.js';
4
+
5
+ /*
6
+ * Copyright The OpenTelemetry Authors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * https://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+ var __read = (undefined && undefined.__read) || function (o, n) {
21
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
22
+ if (!m) return o;
23
+ var i = m.call(o), r, ar = [], e;
24
+ try {
25
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
26
+ }
27
+ catch (error) { e = { error: error }; }
28
+ finally {
29
+ try {
30
+ if (r && !r.done && (m = i["return"])) m.call(i);
31
+ }
32
+ finally { if (e) throw e.error; }
33
+ }
34
+ return ar;
35
+ };
36
+ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
37
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
38
+ if (ar || !(i in from)) {
39
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
40
+ ar[i] = from[i];
41
+ }
42
+ }
43
+ return to.concat(ar || Array.prototype.slice.call(from));
44
+ };
45
+ var API_NAME = 'context';
46
+ var NOOP_CONTEXT_MANAGER = new NoopContextManager();
47
+ /**
48
+ * Singleton object which represents the entry point to the OpenTelemetry Context API
49
+ */
50
+ var ContextAPI = /** @class */ (function () {
51
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
52
+ function ContextAPI() {
53
+ }
54
+ /** Get the singleton instance of the Context API */
55
+ ContextAPI.getInstance = function () {
56
+ if (!this._instance) {
57
+ this._instance = new ContextAPI();
58
+ }
59
+ return this._instance;
60
+ };
61
+ /**
62
+ * Set the current context manager.
63
+ *
64
+ * @returns true if the context manager was successfully registered, else false
65
+ */
66
+ ContextAPI.prototype.setGlobalContextManager = function (contextManager) {
67
+ return registerGlobal(API_NAME, contextManager, DiagAPI.instance());
68
+ };
69
+ /**
70
+ * Get the currently active context
71
+ */
72
+ ContextAPI.prototype.active = function () {
73
+ return this._getContextManager().active();
74
+ };
75
+ /**
76
+ * Execute a function with an active context
77
+ *
78
+ * @param context context to be active during function execution
79
+ * @param fn function to execute in a context
80
+ * @param thisArg optional receiver to be used for calling fn
81
+ * @param args optional arguments forwarded to fn
82
+ */
83
+ ContextAPI.prototype.with = function (context, fn, thisArg) {
84
+ var _a;
85
+ var args = [];
86
+ for (var _i = 3; _i < arguments.length; _i++) {
87
+ args[_i - 3] = arguments[_i];
88
+ }
89
+ return (_a = this._getContextManager()).with.apply(_a, __spreadArray([context, fn, thisArg], __read(args), false));
90
+ };
91
+ /**
92
+ * Bind a context to a target function or event emitter
93
+ *
94
+ * @param context context to bind to the event emitter or function. Defaults to the currently active context
95
+ * @param target function or event emitter to bind
96
+ */
97
+ ContextAPI.prototype.bind = function (context, target) {
98
+ return this._getContextManager().bind(context, target);
99
+ };
100
+ ContextAPI.prototype._getContextManager = function () {
101
+ return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;
102
+ };
103
+ /** Disable and remove the global context manager */
104
+ ContextAPI.prototype.disable = function () {
105
+ this._getContextManager().disable();
106
+ unregisterGlobal(API_NAME, DiagAPI.instance());
107
+ };
108
+ return ContextAPI;
109
+ }());
110
+
111
+ export { ContextAPI };
112
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/api/context.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'context';\nvar NOOP_CONTEXT_MANAGER = new NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n */\nvar ContextAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function ContextAPI() {\n }\n /** Get the singleton instance of the Context API */\n ContextAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n };\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n ContextAPI.prototype.setGlobalContextManager = function (contextManager) {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n };\n /**\n * Get the currently active context\n */\n ContextAPI.prototype.active = function () {\n return this._getContextManager().active();\n };\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n ContextAPI.prototype.with = function (context, fn, thisArg) {\n var _a;\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return (_a = this._getContextManager()).with.apply(_a, __spreadArray([context, fn, thisArg], __read(args), false));\n };\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n ContextAPI.prototype.bind = function (context, target) {\n return this._getContextManager().bind(context, target);\n };\n ContextAPI.prototype._getContextManager = function () {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n };\n /** Disable and remove the global context manager */\n ContextAPI.prototype.disable = function () {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n return ContextAPI;\n}());\nexport { ContextAPI };\n//# sourceMappingURL=context.js.map"],"names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AE,CAAC;AACtD,IAAI,CAAC;AACL,IAAI,OAAO,UAAU;AACrB,CAAC,EAAE;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,123 @@
1
+ import { DiagComponentLogger } from '../diag/ComponentLogger.js';
2
+ import { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger.js';
3
+ import { DiagLogLevel } from '../diag/types.js';
4
+ import { unregisterGlobal, getGlobal, registerGlobal } from '../internal/global-utils.js';
5
+
6
+ /*
7
+ * Copyright The OpenTelemetry Authors
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * https://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+ var __read = (undefined && undefined.__read) || function (o, n) {
22
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
23
+ if (!m) return o;
24
+ var i = m.call(o), r, ar = [], e;
25
+ try {
26
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
27
+ }
28
+ catch (error) { e = { error: error }; }
29
+ finally {
30
+ try {
31
+ if (r && !r.done && (m = i["return"])) m.call(i);
32
+ }
33
+ finally { if (e) throw e.error; }
34
+ }
35
+ return ar;
36
+ };
37
+ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
38
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
39
+ if (ar || !(i in from)) {
40
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
41
+ ar[i] = from[i];
42
+ }
43
+ }
44
+ return to.concat(ar || Array.prototype.slice.call(from));
45
+ };
46
+ var API_NAME = 'diag';
47
+ /**
48
+ * Singleton object which represents the entry point to the OpenTelemetry internal
49
+ * diagnostic API
50
+ */
51
+ var DiagAPI = /** @class */ (function () {
52
+ /**
53
+ * Private internal constructor
54
+ * @private
55
+ */
56
+ function DiagAPI() {
57
+ function _logProxy(funcName) {
58
+ return function () {
59
+ var args = [];
60
+ for (var _i = 0; _i < arguments.length; _i++) {
61
+ args[_i] = arguments[_i];
62
+ }
63
+ var logger = getGlobal('diag');
64
+ // shortcut if logger not set
65
+ if (!logger)
66
+ return;
67
+ return logger[funcName].apply(logger, __spreadArray([], __read(args), false));
68
+ };
69
+ }
70
+ // Using self local variable for minification purposes as 'this' cannot be minified
71
+ var self = this;
72
+ // DiagAPI specific functions
73
+ var setLogger = function (logger, optionsOrLogLevel) {
74
+ var _a, _b, _c;
75
+ if (optionsOrLogLevel === void 0) { optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }; }
76
+ if (logger === self) {
77
+ // There isn't much we can do here.
78
+ // Logging to the console might break the user application.
79
+ // Try to log to self. If a logger was previously registered it will receive the log.
80
+ var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');
81
+ self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
82
+ return false;
83
+ }
84
+ if (typeof optionsOrLogLevel === 'number') {
85
+ optionsOrLogLevel = {
86
+ logLevel: optionsOrLogLevel,
87
+ };
88
+ }
89
+ var oldLogger = getGlobal('diag');
90
+ var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
91
+ // There already is an logger registered. We'll let it know before overwriting it.
92
+ if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
93
+ var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '<failed to generate stacktrace>';
94
+ oldLogger.warn("Current logger will be overwritten from " + stack);
95
+ newLogger.warn("Current logger will overwrite one already registered from " + stack);
96
+ }
97
+ return registerGlobal('diag', newLogger, self, true);
98
+ };
99
+ self.setLogger = setLogger;
100
+ self.disable = function () {
101
+ unregisterGlobal(API_NAME, self);
102
+ };
103
+ self.createComponentLogger = function (options) {
104
+ return new DiagComponentLogger(options);
105
+ };
106
+ self.verbose = _logProxy('verbose');
107
+ self.debug = _logProxy('debug');
108
+ self.info = _logProxy('info');
109
+ self.warn = _logProxy('warn');
110
+ self.error = _logProxy('error');
111
+ }
112
+ /** Get the singleton instance of the DiagAPI API */
113
+ DiagAPI.instance = function () {
114
+ if (!this._instance) {
115
+ this._instance = new DiagAPI();
116
+ }
117
+ return this._instance;
118
+ };
119
+ return DiagAPI;
120
+ }());
121
+
122
+ export { DiagAPI };
123
+ //# sourceMappingURL=diag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diag.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/api/diag.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport { DiagLogLevel, } from '../diag/types';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nvar API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n */\nvar DiagAPI = /** @class */ (function () {\n /**\n * Private internal constructor\n * @private\n */\n function DiagAPI() {\n function _logProxy(funcName) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName].apply(logger, __spreadArray([], __read(args), false));\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n var self = this;\n // DiagAPI specific functions\n var setLogger = function (logger, optionsOrLogLevel) {\n var _a, _b, _c;\n if (optionsOrLogLevel === void 0) { optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }; }\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n var oldLogger = getGlobal('diag');\n var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '<failed to generate stacktrace>';\n oldLogger.warn(\"Current logger will be overwritten from \" + stack);\n newLogger.warn(\"Current logger will overwrite one already registered from \" + stack);\n }\n return registerGlobal('diag', newLogger, self, true);\n };\n self.setLogger = setLogger;\n self.disable = function () {\n unregisterGlobal(API_NAME, self);\n };\n self.createComponentLogger = function (options) {\n return new DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n /** Get the singleton instance of the DiagAPI API */\n DiagAPI.instance = function () {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n };\n return DiagAPI;\n}());\nexport { DiagAPI };\n//# sourceMappingURL=diag.js.map"],"names":["this"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,GAAG,CAACA,SAAI,IAAIA,SAAI,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE,CAAC,EAAE;AACtD,IAAI,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC9D,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC;AACpB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC;AACpC,IAAI,IAAI;AACR,QAAQ,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AAClF,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1C,YAAY;AACZ,QAAQ,IAAI;AACZ,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,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AI;AACJ;AACA,IAAI,OAAO,CAAC,QAAQ,GAAG,YAAY;AACnC,QAAQ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AAC7B,YAAY,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,EAAE;AAC1C,QAAQ;AACR,QAAQ,OAAO,IAAI,CAAC,SAAS;AAC7B,IAAI,CAAC;AACL,IAAI,OAAO,OAAO;AAClB,CAAC,EAAE;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,62 @@
1
+ import { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider.js';
2
+ import { registerGlobal, getGlobal, unregisterGlobal } from '../internal/global-utils.js';
3
+ import { DiagAPI } from './diag.js';
4
+
5
+ /*
6
+ * Copyright The OpenTelemetry Authors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * https://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+ var API_NAME = 'metrics';
21
+ /**
22
+ * Singleton object which represents the entry point to the OpenTelemetry Metrics API
23
+ */
24
+ var MetricsAPI = /** @class */ (function () {
25
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
26
+ function MetricsAPI() {
27
+ }
28
+ /** Get the singleton instance of the Metrics API */
29
+ MetricsAPI.getInstance = function () {
30
+ if (!this._instance) {
31
+ this._instance = new MetricsAPI();
32
+ }
33
+ return this._instance;
34
+ };
35
+ /**
36
+ * Set the current global meter provider.
37
+ * Returns true if the meter provider was successfully registered, else false.
38
+ */
39
+ MetricsAPI.prototype.setGlobalMeterProvider = function (provider) {
40
+ return registerGlobal(API_NAME, provider, DiagAPI.instance());
41
+ };
42
+ /**
43
+ * Returns the global meter provider.
44
+ */
45
+ MetricsAPI.prototype.getMeterProvider = function () {
46
+ return getGlobal(API_NAME) || NOOP_METER_PROVIDER;
47
+ };
48
+ /**
49
+ * Returns a meter from the global meter provider.
50
+ */
51
+ MetricsAPI.prototype.getMeter = function (name, version, options) {
52
+ return this.getMeterProvider().getMeter(name, version, options);
53
+ };
54
+ /** Remove the global meter provider */
55
+ MetricsAPI.prototype.disable = function () {
56
+ unregisterGlobal(API_NAME, DiagAPI.instance());
57
+ };
58
+ return MetricsAPI;
59
+ }());
60
+
61
+ export { MetricsAPI };
62
+ //# sourceMappingURL=metrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/api/metrics.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'metrics';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nvar MetricsAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function MetricsAPI() {\n }\n /** Get the singleton instance of the Metrics API */\n MetricsAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n return this._instance;\n };\n /**\n * Set the current global meter provider.\n * Returns true if the meter provider was successfully registered, else false.\n */\n MetricsAPI.prototype.setGlobalMeterProvider = function (provider) {\n return registerGlobal(API_NAME, provider, DiagAPI.instance());\n };\n /**\n * Returns the global meter provider.\n */\n MetricsAPI.prototype.getMeterProvider = function () {\n return getGlobal(API_NAME) || NOOP_METER_PROVIDER;\n };\n /**\n * Returns a meter from the global meter provider.\n */\n MetricsAPI.prototype.getMeter = function (name, version, options) {\n return this.getMeterProvider().getMeter(name, version, options);\n };\n /** Remove the global meter provider */\n MetricsAPI.prototype.disable = function () {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n return MetricsAPI;\n}());\nexport { MetricsAPI };\n//# sourceMappingURL=metrics.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,IAAI,QAAQ,GAAG,SAAS;AACxB;AACA;AACA;AACG,IAAC,UAAU,kBAAkB,YAAY;AAC5C;AACA,IAAI,SAAS,UAAU,GAAG;AAC1B,IAAI;AACJ;AACA,IAAI,UAAU,CAAC,WAAW,GAAG,YAAY;AACzC,QAAQ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AAC7B,YAAY,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,EAAE;AAC7C,QAAQ;AACR,QAAQ,OAAO,IAAI,CAAC,SAAS;AAC7B,IAAI,CAAC;AACL;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,SAAS,CAAC,sBAAsB,GAAG,UAAU,QAAQ,EAAE;AACtE,QAAQ,OAAO,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;AACrE,IAAI,CAAC;AACL;AACA;AACA;AACA,IAAI,UAAU,CAAC,SAAS,CAAC,gBAAgB,GAAG,YAAY;AACxD,QAAQ,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,mBAAmB;AACzD,IAAI,CAAC;AACL;AACA;AACA;AACA,IAAI,UAAU,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;AACtE,QAAQ,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC;AACvE,IAAI,CAAC;AACL;AACA,IAAI,UAAU,CAAC,SAAS,CAAC,OAAO,GAAG,YAAY;AAC/C,QAAQ,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;AACtD,IAAI,CAAC;AACL,IAAI,OAAO,UAAU;AACrB,CAAC,EAAE;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,91 @@
1
+ import { registerGlobal, unregisterGlobal, getGlobal } from '../internal/global-utils.js';
2
+ import { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator.js';
3
+ import { defaultTextMapSetter, defaultTextMapGetter } from '../propagation/TextMapPropagator.js';
4
+ import { getBaggage, getActiveBaggage, setBaggage, deleteBaggage } from '../baggage/context-helpers.js';
5
+ import { createBaggage } from '../baggage/utils.js';
6
+ import { DiagAPI } from './diag.js';
7
+
8
+ /*
9
+ * Copyright The OpenTelemetry Authors
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * https://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License.
22
+ */
23
+ var API_NAME = 'propagation';
24
+ var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
25
+ /**
26
+ * Singleton object which represents the entry point to the OpenTelemetry Propagation API
27
+ */
28
+ var PropagationAPI = /** @class */ (function () {
29
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
30
+ function PropagationAPI() {
31
+ this.createBaggage = createBaggage;
32
+ this.getBaggage = getBaggage;
33
+ this.getActiveBaggage = getActiveBaggage;
34
+ this.setBaggage = setBaggage;
35
+ this.deleteBaggage = deleteBaggage;
36
+ }
37
+ /** Get the singleton instance of the Propagator API */
38
+ PropagationAPI.getInstance = function () {
39
+ if (!this._instance) {
40
+ this._instance = new PropagationAPI();
41
+ }
42
+ return this._instance;
43
+ };
44
+ /**
45
+ * Set the current propagator.
46
+ *
47
+ * @returns true if the propagator was successfully registered, else false
48
+ */
49
+ PropagationAPI.prototype.setGlobalPropagator = function (propagator) {
50
+ return registerGlobal(API_NAME, propagator, DiagAPI.instance());
51
+ };
52
+ /**
53
+ * Inject context into a carrier to be propagated inter-process
54
+ *
55
+ * @param context Context carrying tracing data to inject
56
+ * @param carrier carrier to inject context into
57
+ * @param setter Function used to set values on the carrier
58
+ */
59
+ PropagationAPI.prototype.inject = function (context, carrier, setter) {
60
+ if (setter === void 0) { setter = defaultTextMapSetter; }
61
+ return this._getGlobalPropagator().inject(context, carrier, setter);
62
+ };
63
+ /**
64
+ * Extract context from a carrier
65
+ *
66
+ * @param context Context which the newly created context will inherit from
67
+ * @param carrier Carrier to extract context from
68
+ * @param getter Function used to extract keys from a carrier
69
+ */
70
+ PropagationAPI.prototype.extract = function (context, carrier, getter) {
71
+ if (getter === void 0) { getter = defaultTextMapGetter; }
72
+ return this._getGlobalPropagator().extract(context, carrier, getter);
73
+ };
74
+ /**
75
+ * Return a list of all fields which may be used by the propagator.
76
+ */
77
+ PropagationAPI.prototype.fields = function () {
78
+ return this._getGlobalPropagator().fields();
79
+ };
80
+ /** Remove the global propagator */
81
+ PropagationAPI.prototype.disable = function () {
82
+ unregisterGlobal(API_NAME, DiagAPI.instance());
83
+ };
84
+ PropagationAPI.prototype._getGlobalPropagator = function () {
85
+ return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;
86
+ };
87
+ return PropagationAPI;
88
+ }());
89
+
90
+ export { PropagationAPI };
91
+ //# sourceMappingURL=propagation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propagation.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/api/propagation.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport { defaultTextMapGetter, defaultTextMapSetter, } from '../propagation/TextMapPropagator';\nimport { getBaggage, getActiveBaggage, setBaggage, deleteBaggage, } from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'propagation';\nvar NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n */\nvar PropagationAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function PropagationAPI() {\n this.createBaggage = createBaggage;\n this.getBaggage = getBaggage;\n this.getActiveBaggage = getActiveBaggage;\n this.setBaggage = setBaggage;\n this.deleteBaggage = deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n PropagationAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n };\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n PropagationAPI.prototype.setGlobalPropagator = function (propagator) {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n };\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n PropagationAPI.prototype.inject = function (context, carrier, setter) {\n if (setter === void 0) { setter = defaultTextMapSetter; }\n return this._getGlobalPropagator().inject(context, carrier, setter);\n };\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n PropagationAPI.prototype.extract = function (context, carrier, getter) {\n if (getter === void 0) { getter = defaultTextMapGetter; }\n return this._getGlobalPropagator().extract(context, carrier, getter);\n };\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n PropagationAPI.prototype.fields = function () {\n return this._getGlobalPropagator().fields();\n };\n /** Remove the global propagator */\n PropagationAPI.prototype.disable = function () {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n PropagationAPI.prototype._getGlobalPropagator = function () {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n };\n return PropagationAPI;\n}());\nexport { PropagationAPI };\n//# sourceMappingURL=propagation.js.map"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA,IAAI,QAAQ,GAAG,aAAa;AAC5B,IAAI,wBAAwB,GAAG,IAAI,qBAAqB,EAAE;AAC1D;AACA;AACA;AACG,IAAC,cAAc,kBAAkB,YAAY;AAChD;AACA,IAAI,SAAS,cAAc,GAAG;AAC9B,QAAQ,IAAI,CAAC,aAAa,GAAG,aAAa;AAC1C,QAAQ,IAAI,CAAC,UAAU,GAAG,UAAU;AACpC,QAAQ,IAAI,CAAC,gBAAgB,GAAG,gBAAgB;AAChD,QAAQ,IAAI,CAAC,UAAU,GAAG,UAAU;AACpC,QAAQ,IAAI,CAAC,aAAa,GAAG,aAAa;AAC1C,IAAI;AACJ;AACA,IAAI,cAAc,CAAC,WAAW,GAAG,YAAY;AAC7C,QAAQ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AAC7B,YAAY,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE;A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