langwatch 0.3.0-prerelease.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-WM2GRSRW.js → chunk-76KNOWLS.js} +2 -2
- package/dist/chunk-76KNOWLS.js.map +1 -0
- package/dist/{chunk-REUCVT7A.mjs → chunk-X62YT4WB.mjs} +2 -2
- package/dist/chunk-X62YT4WB.mjs.map +1 -0
- package/dist/client-browser.js +4 -4
- package/dist/client-browser.mjs +1 -1
- package/dist/client-node.js +3 -3
- package/dist/client-node.mjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-REUCVT7A.mjs.map +0 -1
- package/dist/chunk-WM2GRSRW.js.map +0 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkPCQVQ7SBjs = require('./chunk-PCQVQ7SB.js');
|
|
5
5
|
|
|
6
6
|
// package.json
|
|
7
|
-
var version = "0.3.0
|
|
7
|
+
var version = "0.3.0";
|
|
8
8
|
|
|
9
9
|
// src/observability/exporters/langwatch-exporter.ts
|
|
10
10
|
var _exportertraceotlphttp = require('@opentelemetry/exporter-trace-otlp-http');
|
|
@@ -36,4 +36,4 @@ var LangWatchExporter = class extends _exportertraceotlphttp.OTLPTraceExporter {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
exports.version = version; exports.LangWatchExporter = LangWatchExporter;
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-76KNOWLS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/langwatch/langwatch/typescript-sdk/dist/chunk-76KNOWLS.js","../package.json","../src/observability/exporters/langwatch-exporter.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,sDAA4B;AAC5B;AACA;ACHE,IAAA,QAAA,EAAW,OAAA;ADKb;AACA;AERA,gFAAkC;AA6B3B,IAAM,kBAAA,EAAN,MAAA,QAAgC,yCAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASvD,WAAA,CAAY,MAAA,EAAiB,WAAA,EAAsB;AACjD,IAAA,MAAM,UAAA,EAAY,OAAA,GAAA,KAAA,EAAA,OAAA,EAAU,wCAAA,CAAU;AACtC,IAAA,MAAM,YAAA,EAAc,YAAA,GAAA,KAAA,EAAA,YAAA,EAAe,0CAAA,CAAY;AAE/C,IAAA,KAAA,CAAM;AAAA,MACJ,OAAA,EAAS;AAAA,QACP,eAAA,EAAiB,CAAA,OAAA,EAAU,SAAS,CAAA,CAAA;AACT,QAAA;AACC,QAAA;AACJ,QAAA;AAC1B,MAAA;AACK,MAAA;AACN,IAAA;AACH,EAAA;AACF;AFnB6C;AACA;AACA;AACA;AACA","file":"/home/runner/work/langwatch/langwatch/typescript-sdk/dist/chunk-76KNOWLS.js","sourcesContent":[null,"{\n \"name\": \"langwatch\",\n \"version\": \"0.3.0\",\n \"description\": \"\",\n \"main\": \"dist/index.js\",\n \"module\": \"dist/index.mjs\",\n \"types\": \"dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.js\"\n },\n \"./evaluation\": {\n \"types\": \"./dist/evaluation/index.d.ts\",\n \"require\": \"./dist/evaluation/index.js\",\n \"import\": \"./dist/evaluation/index.mjs\"\n },\n \"./observability\": {\n \"types\": \"./dist/observability/index.d.ts\",\n \"require\": \"./dist/observability/index.js\",\n \"import\": \"./dist/observability/index.mjs\"\n },\n \"./observability/instrumentation/langchain\": {\n \"types\": \"./dist/observability/instrumentation/langchain/index.d.ts\",\n \"require\": \"./dist/observability/instrumentation/langchain/index.js\",\n \"import\": \"./dist/observability/instrumentation/langchain/index.mjs\"\n },\n \"./prompt\": {\n \"types\": \"./dist/prompt/index.d.ts\",\n \"require\": \"./dist/prompt/index.js\",\n \"import\": \"./dist/prompt/index.mjs\"\n },\n \"./node\": {\n \"types\": \"./dist/client-node.d.ts\",\n \"import\": \"./dist/client-node.mjs\",\n \"require\": \"./dist/client-node.js\"\n },\n \"./browser\": {\n \"types\": \"./dist/client-browser.d.ts\",\n \"import\": \"./dist/client-browser.mjs\",\n \"require\": \"./dist/client-browser.js\"\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/langwatch/langwatch.git\",\n \"directory\": \"typescript-sdk\"\n },\n \"scripts\": {\n \"prepare\": \"./copy-types.sh && pnpm run generate:openapi-types\",\n \"test\": \"vitest\",\n \"prebuild\": \"pnpm run prepare\",\n \"build\": \"tsgo --noEmit && tsup\",\n \"prepublish\": \"pnpm run build\",\n \"generate:openapi-types\": \"npx openapi-typescript ../langwatch/src/app/api/openapiLangWatch.json -o ./src/internal/generated/openapi/api-client.ts\"\n },\n \"author\": \"LangWatch\",\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=20\",\n \"pnpm\": \">=8\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.32.0\",\n \"@types/debug\": \"^4.1.12\",\n \"@types/node\": \"^24.1.0\",\n \"@typescript/native-preview\": \"7.0.0-dev.20250804.1\",\n \"@vitest/coverage-v8\": \"3.2.4\",\n \"dotenv\": \"^17.2.1\",\n \"esbuild\": \"^0.25.8\",\n \"eslint\": \"^9.32.0\",\n \"fets\": \"^0.8.5\",\n \"nock\": \"^14.0.8\",\n \"ts-to-zod\": \"3.15.0\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^5.9.2\",\n \"typescript-eslint\": \"^8.38.0\",\n \"vitest\": \"^3.2.4\"\n },\n \"dependencies\": {\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^2.0.1\",\n \"@opentelemetry/exporter-trace-otlp-http\": \"^0.203.0\",\n \"@opentelemetry/resources\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-base\": \"^2.0.1\",\n \"@opentelemetry/semantic-conventions\": \"^1.36.0\",\n \"liquidjs\": \"^10.21.1\",\n \"openapi-fetch\": \"^0.14.0\",\n \"xksuid\": \"^0.0.4\",\n \"zod\": \"^4.0.14\"\n },\n \"peerDependencies\": {\n \"@ai-sdk/openai\": \"^2.0.0\",\n \"@langchain/core\": \"^0.3.66\",\n \"@langchain/openai\": \"^0.6.3\",\n \"@langchain/langgraph\": \"^0.4.2\",\n \"@opentelemetry/context-async-hooks\": \"^2.0.1\",\n \"@opentelemetry/context-zone\": \"^2.0.1\",\n \"@opentelemetry/sdk-node\": \"^0.203.0\",\n \"@opentelemetry/sdk-trace-web\": \"^2.0.1\",\n \"@vercel/otel\": \"^1.13.0\",\n \"langchain\": \"^0.3.30\"\n }\n}\n","import { OTLPTraceExporter } from \"@opentelemetry/exporter-trace-otlp-http\";\nimport { version } from \"../../../package.json\";\nimport { getApiKey, getEndpoint } from \"../../client\";\n\n/**\n * LangWatchExporter extends the OpenTelemetry OTLP HTTP trace exporter\n * to send trace data to LangWatch with proper authentication and metadata headers.\n *\n * This exporter automatically configures:\n * - Authorization headers using the provided API key or environment variables/fallback\n * - SDK version and language identification headers\n * - Proper endpoint configuration for LangWatch ingestion using provided URL or environment variables/fallback\n *\n * @example\n * ```typescript\n * import { LangWatchExporter } from '@langwatch/observability';\n *\n * // Using environment variables/fallback configuration\n * const exporter = new LangWatchExporter();\n *\n * // Using custom API key and endpoint\n *\n * // With environment variables/fallback configuration\n * const exporter = new LangWatchExporter();\n *\n * // With custom API key and endpoint\n * const exporter = new LangWatchExporter('api-key', 'https://custom.langwatch.com');\n * ```\n */\nexport class LangWatchExporter extends OTLPTraceExporter {\n /**\n * Creates a new LangWatchExporter instance.\n *\n * @param apiKey - Optional API key for LangWatch authentication. If not provided,\n * will use environment variables or fallback configuration.\n * @param endpointURL - Optional custom endpoint URL for LangWatch ingestion.\n * If not provided, will use environment variables or fallback configuration.\n */\n constructor(apiKey?: string, endpointURL?: string) {\n const setApiKey = apiKey ?? getApiKey();\n const setEndpoint = endpointURL ?? getEndpoint();\n\n super({\n headers: {\n \"Authorization\": `Bearer ${setApiKey}`,\n \"X-LangWatch-SDK-Version\": version,\n \"X-LangWatch-SDK-Language\": `typescript-${typeof process !== \"undefined\" ? \"node\" : \"browser\"}`,\n \"X-LangWatch-SDK-Name\": \"langwatch-observability-sdk\",\n },\n url: setEndpoint,\n });\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-QEWDG5QE.mjs";
|
|
5
5
|
|
|
6
6
|
// package.json
|
|
7
|
-
var version = "0.3.0
|
|
7
|
+
var version = "0.3.0";
|
|
8
8
|
|
|
9
9
|
// src/observability/exporters/langwatch-exporter.ts
|
|
10
10
|
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
version,
|
|
37
37
|
LangWatchExporter
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-X62YT4WB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/observability/exporters/langwatch-exporter.ts"],"sourcesContent":["{\n \"name\": \"langwatch\",\n \"version\": \"0.3.0\",\n \"description\": \"\",\n \"main\": \"dist/index.js\",\n \"module\": \"dist/index.mjs\",\n \"types\": \"dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.js\"\n },\n \"./evaluation\": {\n \"types\": \"./dist/evaluation/index.d.ts\",\n \"require\": \"./dist/evaluation/index.js\",\n \"import\": \"./dist/evaluation/index.mjs\"\n },\n \"./observability\": {\n \"types\": \"./dist/observability/index.d.ts\",\n \"require\": \"./dist/observability/index.js\",\n \"import\": \"./dist/observability/index.mjs\"\n },\n \"./observability/instrumentation/langchain\": {\n \"types\": \"./dist/observability/instrumentation/langchain/index.d.ts\",\n \"require\": \"./dist/observability/instrumentation/langchain/index.js\",\n \"import\": \"./dist/observability/instrumentation/langchain/index.mjs\"\n },\n \"./prompt\": {\n \"types\": \"./dist/prompt/index.d.ts\",\n \"require\": \"./dist/prompt/index.js\",\n \"import\": \"./dist/prompt/index.mjs\"\n },\n \"./node\": {\n \"types\": \"./dist/client-node.d.ts\",\n \"import\": \"./dist/client-node.mjs\",\n \"require\": \"./dist/client-node.js\"\n },\n \"./browser\": {\n \"types\": \"./dist/client-browser.d.ts\",\n \"import\": \"./dist/client-browser.mjs\",\n \"require\": \"./dist/client-browser.js\"\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/langwatch/langwatch.git\",\n \"directory\": \"typescript-sdk\"\n },\n \"scripts\": {\n \"prepare\": \"./copy-types.sh && pnpm run generate:openapi-types\",\n \"test\": \"vitest\",\n \"prebuild\": \"pnpm run prepare\",\n \"build\": \"tsgo --noEmit && tsup\",\n \"prepublish\": \"pnpm run build\",\n \"generate:openapi-types\": \"npx openapi-typescript ../langwatch/src/app/api/openapiLangWatch.json -o ./src/internal/generated/openapi/api-client.ts\"\n },\n \"author\": \"LangWatch\",\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=20\",\n \"pnpm\": \">=8\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.32.0\",\n \"@types/debug\": \"^4.1.12\",\n \"@types/node\": \"^24.1.0\",\n \"@typescript/native-preview\": \"7.0.0-dev.20250804.1\",\n \"@vitest/coverage-v8\": \"3.2.4\",\n \"dotenv\": \"^17.2.1\",\n \"esbuild\": \"^0.25.8\",\n \"eslint\": \"^9.32.0\",\n \"fets\": \"^0.8.5\",\n \"nock\": \"^14.0.8\",\n \"ts-to-zod\": \"3.15.0\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^5.9.2\",\n \"typescript-eslint\": \"^8.38.0\",\n \"vitest\": \"^3.2.4\"\n },\n \"dependencies\": {\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^2.0.1\",\n \"@opentelemetry/exporter-trace-otlp-http\": \"^0.203.0\",\n \"@opentelemetry/resources\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-base\": \"^2.0.1\",\n \"@opentelemetry/semantic-conventions\": \"^1.36.0\",\n \"liquidjs\": \"^10.21.1\",\n \"openapi-fetch\": \"^0.14.0\",\n \"xksuid\": \"^0.0.4\",\n \"zod\": \"^4.0.14\"\n },\n \"peerDependencies\": {\n \"@ai-sdk/openai\": \"^2.0.0\",\n \"@langchain/core\": \"^0.3.66\",\n \"@langchain/openai\": \"^0.6.3\",\n \"@langchain/langgraph\": \"^0.4.2\",\n \"@opentelemetry/context-async-hooks\": \"^2.0.1\",\n \"@opentelemetry/context-zone\": \"^2.0.1\",\n \"@opentelemetry/sdk-node\": \"^0.203.0\",\n \"@opentelemetry/sdk-trace-web\": \"^2.0.1\",\n \"@vercel/otel\": \"^1.13.0\",\n \"langchain\": \"^0.3.30\"\n }\n}\n","import { OTLPTraceExporter } from \"@opentelemetry/exporter-trace-otlp-http\";\nimport { version } from \"../../../package.json\";\nimport { getApiKey, getEndpoint } from \"../../client\";\n\n/**\n * LangWatchExporter extends the OpenTelemetry OTLP HTTP trace exporter\n * to send trace data to LangWatch with proper authentication and metadata headers.\n *\n * This exporter automatically configures:\n * - Authorization headers using the provided API key or environment variables/fallback\n * - SDK version and language identification headers\n * - Proper endpoint configuration for LangWatch ingestion using provided URL or environment variables/fallback\n *\n * @example\n * ```typescript\n * import { LangWatchExporter } from '@langwatch/observability';\n *\n * // Using environment variables/fallback configuration\n * const exporter = new LangWatchExporter();\n *\n * // Using custom API key and endpoint\n *\n * // With environment variables/fallback configuration\n * const exporter = new LangWatchExporter();\n *\n * // With custom API key and endpoint\n * const exporter = new LangWatchExporter('api-key', 'https://custom.langwatch.com');\n * ```\n */\nexport class LangWatchExporter extends OTLPTraceExporter {\n /**\n * Creates a new LangWatchExporter instance.\n *\n * @param apiKey - Optional API key for LangWatch authentication. If not provided,\n * will use environment variables or fallback configuration.\n * @param endpointURL - Optional custom endpoint URL for LangWatch ingestion.\n * If not provided, will use environment variables or fallback configuration.\n */\n constructor(apiKey?: string, endpointURL?: string) {\n const setApiKey = apiKey ?? getApiKey();\n const setEndpoint = endpointURL ?? getEndpoint();\n\n super({\n headers: {\n \"Authorization\": `Bearer ${setApiKey}`,\n \"X-LangWatch-SDK-Version\": version,\n \"X-LangWatch-SDK-Language\": `typescript-${typeof process !== \"undefined\" ? \"node\" : \"browser\"}`,\n \"X-LangWatch-SDK-Name\": \"langwatch-observability-sdk\",\n },\n url: setEndpoint,\n });\n }\n}\n"],"mappings":";;;;;;AAEE,cAAW;;;ACFb,SAAS,yBAAyB;AA6B3B,IAAM,oBAAN,cAAgC,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASvD,YAAY,QAAiB,aAAsB;AACjD,UAAM,YAAY,0BAAU,UAAU;AACtC,UAAM,cAAc,oCAAe,YAAY;AAE/C,UAAM;AAAA,MACJ,SAAS;AAAA,QACP,iBAAiB,UAAU,SAAS;AAAA,QACpC,2BAA2B;AAAA,QAC3B,4BAA4B,cAAc,OAAO,YAAY,cAAc,SAAS,SAAS;AAAA,QAC7F,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/dist/client-browser.js
CHANGED
|
@@ -6,7 +6,7 @@ var _chunkLD74LVRUjs = require('./chunk-LD74LVRU.js');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk76KNOWLSjs = require('./chunk-76KNOWLS.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkKGDAENGDjs = require('./chunk-KGDAENGD.js');
|
|
@@ -40,12 +40,12 @@ async function setupLangWatch(options = {}) {
|
|
|
40
40
|
if (options.skipOpenTelemetrySetup) return;
|
|
41
41
|
const endpointURL = new URL("/api/otel/v1/traces", _chunkPCQVQ7SBjs.getEndpoint.call(void 0, ));
|
|
42
42
|
const langwatchSpanProcessor = new (0, _chunkKGDAENGDjs.FilterableBatchSpanProcessor)(
|
|
43
|
-
new (0,
|
|
43
|
+
new (0, _chunk76KNOWLSjs.LangWatchExporter)(_chunkPCQVQ7SBjs.getApiKey.call(void 0, ), endpointURL.toString()),
|
|
44
44
|
(_a = options.otelSpanProcessingExcludeRules) != null ? _a : []
|
|
45
45
|
);
|
|
46
46
|
const langwatchResource = _resources.resourceFromAttributes.call(void 0, _chunkVJSOCNPAjs.__spreadProps.call(void 0, _chunkVJSOCNPAjs.__spreadValues.call(void 0, {}, options.baseAttributes), {
|
|
47
47
|
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_LANGUAGE]: "typescript-browser",
|
|
48
|
-
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_VERSION]:
|
|
48
|
+
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_VERSION]: _chunk76KNOWLSjs.version,
|
|
49
49
|
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_NAME]: "langwatch-observability-sdk"
|
|
50
50
|
}));
|
|
51
51
|
if (_chunkLD74LVRUjs.isOtelInitialized.call(void 0, )) {
|
|
@@ -59,7 +59,7 @@ async function setupLangWatch(options = {}) {
|
|
|
59
59
|
provider = new (0, _sdktraceweb.WebTracerProvider)({
|
|
60
60
|
resource: _resources.resourceFromAttributes.call(void 0, {
|
|
61
61
|
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_LANGUAGE]: "typescript-browser",
|
|
62
|
-
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_VERSION]:
|
|
62
|
+
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_VERSION]: _chunk76KNOWLSjs.version,
|
|
63
63
|
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_NAME]: "langwatch-observability-sdk"
|
|
64
64
|
}),
|
|
65
65
|
spanProcessors: [langwatchSpanProcessor, ...(_c = options.otelSpanProcessors) != null ? _c : []]
|
package/dist/client-browser.mjs
CHANGED
package/dist/client-node.js
CHANGED
|
@@ -6,7 +6,7 @@ var _chunkLD74LVRUjs = require('./chunk-LD74LVRU.js');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk76KNOWLSjs = require('./chunk-76KNOWLS.js');
|
|
10
10
|
require('./chunk-G3AUABT7.js');
|
|
11
11
|
|
|
12
12
|
|
|
@@ -43,12 +43,12 @@ async function setupLangWatch(options = {}) {
|
|
|
43
43
|
if (options.skipOpenTelemetrySetup) return;
|
|
44
44
|
const endpointURL = new URL("/api/otel/v1/traces", _chunkPCQVQ7SBjs.getEndpoint.call(void 0, ));
|
|
45
45
|
const langwatchSpanProcessor = new (0, _chunkKGDAENGDjs.FilterableBatchSpanProcessor)(
|
|
46
|
-
new (0,
|
|
46
|
+
new (0, _chunk76KNOWLSjs.LangWatchExporter)(_chunkPCQVQ7SBjs.getApiKey.call(void 0, ), endpointURL.toString()),
|
|
47
47
|
(_a = options.otelSpanProcessingExcludeRules) != null ? _a : []
|
|
48
48
|
);
|
|
49
49
|
const langwatchResource = _resources.resourceFromAttributes.call(void 0, _chunkVJSOCNPAjs.__spreadProps.call(void 0, _chunkVJSOCNPAjs.__spreadValues.call(void 0, {}, options.baseAttributes), {
|
|
50
50
|
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_LANGUAGE]: "typescript-node",
|
|
51
|
-
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_VERSION]:
|
|
51
|
+
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_VERSION]: _chunk76KNOWLSjs.version,
|
|
52
52
|
[_chunkVJSOCNPAjs.ATTR_LANGWATCH_SDK_NAME]: "langwatch-observability-sdk"
|
|
53
53
|
}));
|
|
54
54
|
if (_chunkLD74LVRUjs.isOtelInitialized.call(void 0, )) {
|
package/dist/client-node.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk76KNOWLSjs = require('./chunk-76KNOWLS.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkHPC6Z7J4js = require('./chunk-HPC6Z7J4.js');
|
|
@@ -26,5 +26,5 @@ require('./chunk-VJSOCNPA.js');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
exports.FilterableBatchSpanProcessor = _chunkKGDAENGDjs.FilterableBatchSpanProcessor; exports.LangWatchExporter =
|
|
29
|
+
exports.FilterableBatchSpanProcessor = _chunkKGDAENGDjs.FilterableBatchSpanProcessor; exports.LangWatchExporter = _chunk76KNOWLSjs.LangWatchExporter; exports.getLangWatchTracer = _chunkSVJ7SCGBjs.getLangWatchTracer; exports.getPrompt = _chunkPTJ6AAI7js.getPrompt; exports.getPromptVersion = _chunkPTJ6AAI7js.getPromptVersion; exports.recordEvaluation = _chunkSVJ7SCGBjs.recordEvaluation; exports.runEvaluation = _chunkHPC6Z7J4js.runEvaluation;
|
|
30
30
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/observability/exporters/langwatch-exporter.ts"],"sourcesContent":["{\n \"name\": \"langwatch\",\n \"version\": \"0.3.0-prerelease.2\",\n \"description\": \"\",\n \"main\": \"dist/index.js\",\n \"module\": \"dist/index.mjs\",\n \"types\": \"dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.js\"\n },\n \"./evaluation\": {\n \"types\": \"./dist/evaluation/index.d.ts\",\n \"require\": \"./dist/evaluation/index.js\",\n \"import\": \"./dist/evaluation/index.mjs\"\n },\n \"./observability\": {\n \"types\": \"./dist/observability/index.d.ts\",\n \"require\": \"./dist/observability/index.js\",\n \"import\": \"./dist/observability/index.mjs\"\n },\n \"./observability/instrumentation/langchain\": {\n \"types\": \"./dist/observability/instrumentation/langchain/index.d.ts\",\n \"require\": \"./dist/observability/instrumentation/langchain/index.js\",\n \"import\": \"./dist/observability/instrumentation/langchain/index.mjs\"\n },\n \"./prompt\": {\n \"types\": \"./dist/prompt/index.d.ts\",\n \"require\": \"./dist/prompt/index.js\",\n \"import\": \"./dist/prompt/index.mjs\"\n },\n \"./node\": {\n \"types\": \"./dist/client-node.d.ts\",\n \"import\": \"./dist/client-node.mjs\",\n \"require\": \"./dist/client-node.js\"\n },\n \"./browser\": {\n \"types\": \"./dist/client-browser.d.ts\",\n \"import\": \"./dist/client-browser.mjs\",\n \"require\": \"./dist/client-browser.js\"\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/langwatch/langwatch.git\",\n \"directory\": \"typescript-sdk\"\n },\n \"scripts\": {\n \"prepare\": \"./copy-types.sh && pnpm run generate:openapi-types\",\n \"test\": \"vitest\",\n \"prebuild\": \"pnpm run prepare\",\n \"build\": \"tsgo --noEmit && tsup\",\n \"prepublish\": \"pnpm run build\",\n \"generate:openapi-types\": \"npx openapi-typescript ../langwatch/src/app/api/openapiLangWatch.json -o ./src/internal/generated/openapi/api-client.ts\"\n },\n \"author\": \"LangWatch\",\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=20\",\n \"pnpm\": \">=8\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.32.0\",\n \"@types/debug\": \"^4.1.12\",\n \"@types/node\": \"^24.1.0\",\n \"@typescript/native-preview\": \"7.0.0-dev.20250804.1\",\n \"@vitest/coverage-v8\": \"3.2.4\",\n \"dotenv\": \"^17.2.1\",\n \"esbuild\": \"^0.25.8\",\n \"eslint\": \"^9.32.0\",\n \"fets\": \"^0.8.5\",\n \"nock\": \"^14.0.8\",\n \"ts-to-zod\": \"3.15.0\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^5.9.2\",\n \"typescript-eslint\": \"^8.38.0\",\n \"vitest\": \"^3.2.4\"\n },\n \"dependencies\": {\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^2.0.1\",\n \"@opentelemetry/exporter-trace-otlp-http\": \"^0.203.0\",\n \"@opentelemetry/resources\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-base\": \"^2.0.1\",\n \"@opentelemetry/semantic-conventions\": \"^1.36.0\",\n \"liquidjs\": \"^10.21.1\",\n \"openapi-fetch\": \"^0.14.0\",\n \"xksuid\": \"^0.0.4\",\n \"zod\": \"^4.0.14\"\n },\n \"peerDependencies\": {\n \"@ai-sdk/openai\": \"^2.0.0\",\n \"@langchain/core\": \"^0.3.66\",\n \"@langchain/openai\": \"^0.6.3\",\n \"@langchain/langgraph\": \"^0.4.2\",\n \"@opentelemetry/context-async-hooks\": \"^2.0.1\",\n \"@opentelemetry/context-zone\": \"^2.0.1\",\n \"@opentelemetry/sdk-node\": \"^0.203.0\",\n \"@opentelemetry/sdk-trace-web\": \"^2.0.1\",\n \"@vercel/otel\": \"^1.13.0\",\n \"langchain\": \"^0.3.30\"\n }\n}\n","import { OTLPTraceExporter } from \"@opentelemetry/exporter-trace-otlp-http\";\nimport { version } from \"../../../package.json\";\nimport { getApiKey, getEndpoint } from \"../../client\";\n\n/**\n * LangWatchExporter extends the OpenTelemetry OTLP HTTP trace exporter\n * to send trace data to LangWatch with proper authentication and metadata headers.\n *\n * This exporter automatically configures:\n * - Authorization headers using the provided API key or environment variables/fallback\n * - SDK version and language identification headers\n * - Proper endpoint configuration for LangWatch ingestion using provided URL or environment variables/fallback\n *\n * @example\n * ```typescript\n * import { LangWatchExporter } from '@langwatch/observability';\n *\n * // Using environment variables/fallback configuration\n * const exporter = new LangWatchExporter();\n *\n * // Using custom API key and endpoint\n *\n * // With environment variables/fallback configuration\n * const exporter = new LangWatchExporter();\n *\n * // With custom API key and endpoint\n * const exporter = new LangWatchExporter('api-key', 'https://custom.langwatch.com');\n * ```\n */\nexport class LangWatchExporter extends OTLPTraceExporter {\n /**\n * Creates a new LangWatchExporter instance.\n *\n * @param apiKey - Optional API key for LangWatch authentication. If not provided,\n * will use environment variables or fallback configuration.\n * @param endpointURL - Optional custom endpoint URL for LangWatch ingestion.\n * If not provided, will use environment variables or fallback configuration.\n */\n constructor(apiKey?: string, endpointURL?: string) {\n const setApiKey = apiKey ?? getApiKey();\n const setEndpoint = endpointURL ?? getEndpoint();\n\n super({\n headers: {\n \"Authorization\": `Bearer ${setApiKey}`,\n \"X-LangWatch-SDK-Version\": version,\n \"X-LangWatch-SDK-Language\": `typescript-${typeof process !== \"undefined\" ? \"node\" : \"browser\"}`,\n \"X-LangWatch-SDK-Name\": \"langwatch-observability-sdk\",\n },\n url: setEndpoint,\n });\n }\n}\n"],"mappings":";;;;;;AAEE,cAAW;;;ACFb,SAAS,yBAAyB;AA6B3B,IAAM,oBAAN,cAAgC,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASvD,YAAY,QAAiB,aAAsB;AACjD,UAAM,YAAY,0BAAU,UAAU;AACtC,UAAM,cAAc,oCAAe,YAAY;AAE/C,UAAM;AAAA,MACJ,SAAS;AAAA,QACP,iBAAiB,UAAU,SAAS;AAAA,QACpC,2BAA2B;AAAA,QAC3B,4BAA4B,cAAc,OAAO,YAAY,cAAc,SAAS,SAAS;AAAA,QAC7F,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/langwatch/langwatch/typescript-sdk/dist/chunk-WM2GRSRW.js","../package.json","../src/observability/exporters/langwatch-exporter.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,sDAA4B;AAC5B;AACA;ACHE,IAAA,QAAA,EAAW,oBAAA;ADKb;AACA;AERA,gFAAkC;AA6B3B,IAAM,kBAAA,EAAN,MAAA,QAAgC,yCAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASvD,WAAA,CAAY,MAAA,EAAiB,WAAA,EAAsB;AACjD,IAAA,MAAM,UAAA,EAAY,OAAA,GAAA,KAAA,EAAA,OAAA,EAAU,wCAAA,CAAU;AACtC,IAAA,MAAM,YAAA,EAAc,YAAA,GAAA,KAAA,EAAA,YAAA,EAAe,0CAAA,CAAY;AAE/C,IAAA,KAAA,CAAM;AAAA,MACJ,OAAA,EAAS;AAAA,QACP,eAAA,EAAiB,CAAA,OAAA,EAAU,SAAS,CAAA,CAAA;AACT,QAAA;AACC,QAAA;AACJ,QAAA;AAC1B,MAAA;AACK,MAAA;AACN,IAAA;AACH,EAAA;AACF;AFnB6C;AACA;AACA;AACA;AACA","file":"/home/runner/work/langwatch/langwatch/typescript-sdk/dist/chunk-WM2GRSRW.js","sourcesContent":[null,"{\n \"name\": \"langwatch\",\n \"version\": \"0.3.0-prerelease.2\",\n \"description\": \"\",\n \"main\": \"dist/index.js\",\n \"module\": \"dist/index.mjs\",\n \"types\": \"dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.js\"\n },\n \"./evaluation\": {\n \"types\": \"./dist/evaluation/index.d.ts\",\n \"require\": \"./dist/evaluation/index.js\",\n \"import\": \"./dist/evaluation/index.mjs\"\n },\n \"./observability\": {\n \"types\": \"./dist/observability/index.d.ts\",\n \"require\": \"./dist/observability/index.js\",\n \"import\": \"./dist/observability/index.mjs\"\n },\n \"./observability/instrumentation/langchain\": {\n \"types\": \"./dist/observability/instrumentation/langchain/index.d.ts\",\n \"require\": \"./dist/observability/instrumentation/langchain/index.js\",\n \"import\": \"./dist/observability/instrumentation/langchain/index.mjs\"\n },\n \"./prompt\": {\n \"types\": \"./dist/prompt/index.d.ts\",\n \"require\": \"./dist/prompt/index.js\",\n \"import\": \"./dist/prompt/index.mjs\"\n },\n \"./node\": {\n \"types\": \"./dist/client-node.d.ts\",\n \"import\": \"./dist/client-node.mjs\",\n \"require\": \"./dist/client-node.js\"\n },\n \"./browser\": {\n \"types\": \"./dist/client-browser.d.ts\",\n \"import\": \"./dist/client-browser.mjs\",\n \"require\": \"./dist/client-browser.js\"\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/langwatch/langwatch.git\",\n \"directory\": \"typescript-sdk\"\n },\n \"scripts\": {\n \"prepare\": \"./copy-types.sh && pnpm run generate:openapi-types\",\n \"test\": \"vitest\",\n \"prebuild\": \"pnpm run prepare\",\n \"build\": \"tsgo --noEmit && tsup\",\n \"prepublish\": \"pnpm run build\",\n \"generate:openapi-types\": \"npx openapi-typescript ../langwatch/src/app/api/openapiLangWatch.json -o ./src/internal/generated/openapi/api-client.ts\"\n },\n \"author\": \"LangWatch\",\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=20\",\n \"pnpm\": \">=8\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.32.0\",\n \"@types/debug\": \"^4.1.12\",\n \"@types/node\": \"^24.1.0\",\n \"@typescript/native-preview\": \"7.0.0-dev.20250804.1\",\n \"@vitest/coverage-v8\": \"3.2.4\",\n \"dotenv\": \"^17.2.1\",\n \"esbuild\": \"^0.25.8\",\n \"eslint\": \"^9.32.0\",\n \"fets\": \"^0.8.5\",\n \"nock\": \"^14.0.8\",\n \"ts-to-zod\": \"3.15.0\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^5.9.2\",\n \"typescript-eslint\": \"^8.38.0\",\n \"vitest\": \"^3.2.4\"\n },\n \"dependencies\": {\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^2.0.1\",\n \"@opentelemetry/exporter-trace-otlp-http\": \"^0.203.0\",\n \"@opentelemetry/resources\": \"^2.0.1\",\n \"@opentelemetry/sdk-trace-base\": \"^2.0.1\",\n \"@opentelemetry/semantic-conventions\": \"^1.36.0\",\n \"liquidjs\": \"^10.21.1\",\n \"openapi-fetch\": \"^0.14.0\",\n \"xksuid\": \"^0.0.4\",\n \"zod\": \"^4.0.14\"\n },\n \"peerDependencies\": {\n \"@ai-sdk/openai\": \"^2.0.0\",\n \"@langchain/core\": \"^0.3.66\",\n \"@langchain/openai\": \"^0.6.3\",\n \"@langchain/langgraph\": \"^0.4.2\",\n \"@opentelemetry/context-async-hooks\": \"^2.0.1\",\n \"@opentelemetry/context-zone\": \"^2.0.1\",\n \"@opentelemetry/sdk-node\": \"^0.203.0\",\n \"@opentelemetry/sdk-trace-web\": \"^2.0.1\",\n \"@vercel/otel\": \"^1.13.0\",\n \"langchain\": \"^0.3.30\"\n }\n}\n","import { OTLPTraceExporter } from \"@opentelemetry/exporter-trace-otlp-http\";\nimport { version } from \"../../../package.json\";\nimport { getApiKey, getEndpoint } from \"../../client\";\n\n/**\n * LangWatchExporter extends the OpenTelemetry OTLP HTTP trace exporter\n * to send trace data to LangWatch with proper authentication and metadata headers.\n *\n * This exporter automatically configures:\n * - Authorization headers using the provided API key or environment variables/fallback\n * - SDK version and language identification headers\n * - Proper endpoint configuration for LangWatch ingestion using provided URL or environment variables/fallback\n *\n * @example\n * ```typescript\n * import { LangWatchExporter } from '@langwatch/observability';\n *\n * // Using environment variables/fallback configuration\n * const exporter = new LangWatchExporter();\n *\n * // Using custom API key and endpoint\n *\n * // With environment variables/fallback configuration\n * const exporter = new LangWatchExporter();\n *\n * // With custom API key and endpoint\n * const exporter = new LangWatchExporter('api-key', 'https://custom.langwatch.com');\n * ```\n */\nexport class LangWatchExporter extends OTLPTraceExporter {\n /**\n * Creates a new LangWatchExporter instance.\n *\n * @param apiKey - Optional API key for LangWatch authentication. If not provided,\n * will use environment variables or fallback configuration.\n * @param endpointURL - Optional custom endpoint URL for LangWatch ingestion.\n * If not provided, will use environment variables or fallback configuration.\n */\n constructor(apiKey?: string, endpointURL?: string) {\n const setApiKey = apiKey ?? getApiKey();\n const setEndpoint = endpointURL ?? getEndpoint();\n\n super({\n headers: {\n \"Authorization\": `Bearer ${setApiKey}`,\n \"X-LangWatch-SDK-Version\": version,\n \"X-LangWatch-SDK-Language\": `typescript-${typeof process !== \"undefined\" ? \"node\" : \"browser\"}`,\n \"X-LangWatch-SDK-Name\": \"langwatch-observability-sdk\",\n },\n url: setEndpoint,\n });\n }\n}\n"]}
|