@narumitw/pi-langfuse 0.50.5 → 0.51.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.
@@ -1,218 +0,0 @@
1
- // @generated by scripts/build-runtime.mjs; do not edit.
2
- // @ts-nocheck -- the generated entry uses a .ts extension for Pi's Jiti loader.
3
-
4
- // src/runtime.ts
5
- import { createHash } from "node:crypto";
6
- import { LangfuseSpanProcessor } from "@langfuse/otel";
7
- import {
8
- LangfuseOtelSpanAttributes,
9
- setLangfuseTracerProvider,
10
- startObservation
11
- } from "@langfuse/tracing";
12
- import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
13
- var RUNTIME_KEY = /* @__PURE__ */ Symbol.for("@narumitw/pi-langfuse/runtime/v1");
14
- var ProductionObservation = class {
15
- constructor(native) {
16
- this.native = native;
17
- }
18
- native;
19
- update(attributes) {
20
- const { sessionId, userId, ...observationAttributes } = attributes;
21
- this.native.updateOtelSpanAttributes(observationAttributes);
22
- applySessionId(this.native, sessionId);
23
- applyUserId(this.native, userId);
24
- return this;
25
- }
26
- updateTrace(attributes) {
27
- const { input, output, metadata, name, sessionId, userId, tags, version } = attributes;
28
- if (input !== void 0 || output !== void 0) {
29
- this.native.setTraceIO({ input, output });
30
- }
31
- if (name !== void 0) {
32
- this.native.otelSpan.setAttribute(LangfuseOtelSpanAttributes.TRACE_NAME, name);
33
- }
34
- applySessionId(this.native, sessionId);
35
- applyUserId(this.native, userId);
36
- if (tags !== void 0) {
37
- this.native.otelSpan.setAttribute(LangfuseOtelSpanAttributes.TRACE_TAGS, tags);
38
- }
39
- if (version !== void 0) {
40
- this.native.otelSpan.setAttribute(LangfuseOtelSpanAttributes.VERSION, version);
41
- }
42
- for (const [key, value] of Object.entries(metadata ?? {})) {
43
- this.native.otelSpan.setAttribute(
44
- `${LangfuseOtelSpanAttributes.TRACE_METADATA}.${key}`,
45
- String(value)
46
- );
47
- }
48
- return this;
49
- }
50
- end(endTime) {
51
- this.native.end(endTime);
52
- return this;
53
- }
54
- };
55
- var ProductionTraceBackend = class {
56
- constructor(provider, processor) {
57
- this.provider = provider;
58
- this.processor = processor;
59
- }
60
- provider;
61
- processor;
62
- start(name, attributes, options) {
63
- const { sessionId, userId, ...observationAttributes } = attributes;
64
- const parent = options.parent;
65
- const native = parent instanceof ProductionObservation ? startChild(parent.native, name, observationAttributes, options.asType) : startRoot(name, observationAttributes, options.asType);
66
- applySessionId(native, sessionId);
67
- applyUserId(native, userId);
68
- return new ProductionObservation(native);
69
- }
70
- async forceFlush() {
71
- await this.processor.forceFlush();
72
- }
73
- async shutdown() {
74
- await this.provider.shutdown();
75
- }
76
- };
77
- async function createProductionBackend(config, factoryOverrides = {}) {
78
- const globalRuntime = globalThis;
79
- const fingerprint = configFingerprint(config);
80
- const existing = globalRuntime[RUNTIME_KEY];
81
- if (existing) {
82
- const runtime = await existing;
83
- if (runtime.shutdown) {
84
- throw new Error("Langfuse tracing was already shut down; restart Pi to enable it again.");
85
- }
86
- if (runtime.fingerprint !== fingerprint) {
87
- throw new Error("Langfuse configuration changed; restart Pi to apply the new credentials.");
88
- }
89
- return runtime.backend;
90
- }
91
- const factories = { ...defaultFactories, ...factoryOverrides };
92
- const initializing = initializeRuntime(config, fingerprint, factories);
93
- globalRuntime[RUNTIME_KEY] = initializing;
94
- try {
95
- return (await initializing).backend;
96
- } catch (error) {
97
- delete globalRuntime[RUNTIME_KEY];
98
- throw error;
99
- }
100
- }
101
- async function initializeRuntime(config, fingerprint, factories) {
102
- const processor = factories.createProcessor(config);
103
- let provider;
104
- try {
105
- provider = factories.createProvider(processor);
106
- factories.selectProvider(provider);
107
- } catch (error) {
108
- await (provider?.shutdown() ?? processor.shutdown()).catch(() => void 0);
109
- throw error;
110
- }
111
- const backend = new ProductionTraceBackend(provider, processor);
112
- const runtime = { fingerprint, backend, shutdown: false };
113
- const originalShutdown = backend.shutdown.bind(backend);
114
- backend.shutdown = async () => {
115
- if (runtime.shutdown) return;
116
- runtime.shutdown = true;
117
- await originalShutdown();
118
- };
119
- return runtime;
120
- }
121
- var defaultFactories = {
122
- createProcessor: (config) => {
123
- const secrets = [config.secretKey, config.publicKey];
124
- return new LangfuseSpanProcessor({
125
- publicKey: config.publicKey,
126
- secretKey: config.secretKey,
127
- baseUrl: config.baseUrl,
128
- environment: config.environment ?? "",
129
- release: config.release ?? "",
130
- flushAt: 512,
131
- flushInterval: 5,
132
- timeout: 5,
133
- mask: ({ data }) => maskSecrets(data, secrets),
134
- shouldExportSpan: ({ otelSpan }) => typeof otelSpan.attributes["langfuse.observation.type"] === "string"
135
- });
136
- },
137
- createProvider: (processor) => new NodeTracerProvider({ spanProcessors: [processor] }),
138
- selectProvider: setLangfuseTracerProvider
139
- };
140
- function applySessionId(observation, sessionId) {
141
- if (sessionId !== void 0) {
142
- observation.otelSpan.setAttribute(LangfuseOtelSpanAttributes.TRACE_SESSION_ID, sessionId);
143
- }
144
- }
145
- function applyUserId(observation, userId) {
146
- if (userId !== void 0) {
147
- observation.otelSpan.setAttribute(LangfuseOtelSpanAttributes.TRACE_USER_ID, userId);
148
- }
149
- }
150
- function startRoot(name, attributes, type) {
151
- if (type === "agent") {
152
- return startObservation(name, attributes, { asType: "agent" });
153
- }
154
- if (type === "generation") {
155
- return startObservation(name, attributes, {
156
- asType: "generation"
157
- });
158
- }
159
- if (type === "tool") {
160
- return startObservation(name, attributes, { asType: "tool" });
161
- }
162
- return startObservation(name, attributes, { asType: "span" });
163
- }
164
- function startChild(parent, name, attributes, type) {
165
- if (type === "agent") {
166
- return parent.startObservation(name, attributes, {
167
- asType: "agent"
168
- });
169
- }
170
- if (type === "generation") {
171
- return parent.startObservation(name, attributes, {
172
- asType: "generation"
173
- });
174
- }
175
- if (type === "tool") {
176
- return parent.startObservation(name, attributes, {
177
- asType: "tool"
178
- });
179
- }
180
- return parent.startObservation(name, attributes, {
181
- asType: "span"
182
- });
183
- }
184
- function configFingerprint(config) {
185
- return createHash("sha256").update(
186
- `${config.publicKey}\0${config.secretKey}\0${config.baseUrl}\0${config.environment ?? ""}\0${config.release ?? ""}`
187
- ).digest("hex");
188
- }
189
- function maskSecrets(data, secrets) {
190
- return maskSecretValue(data, secrets, /* @__PURE__ */ new WeakSet());
191
- }
192
- function maskSecretValue(data, secrets, active) {
193
- if (typeof data === "string") {
194
- let masked = data.replace(/\b(?:sk|pk)-lf-[A-Za-z0-9_-]+\b/g, "[LANGFUSE_KEY_REDACTED]");
195
- for (const secret of secrets) {
196
- if (secret) masked = masked.replaceAll(secret, "[LANGFUSE_KEY_REDACTED]");
197
- }
198
- return masked;
199
- }
200
- if (!data || typeof data !== "object") return data;
201
- if (active.has(data)) return "[circular]";
202
- active.add(data);
203
- try {
204
- if (Array.isArray(data)) {
205
- return data.map((item) => maskSecretValue(item, secrets, active));
206
- }
207
- return Object.fromEntries(
208
- Object.entries(data).map(([key, value]) => [key, maskSecretValue(value, secrets, active)])
209
- );
210
- } finally {
211
- active.delete(data);
212
- }
213
- }
214
- export {
215
- createProductionBackend,
216
- maskSecrets
217
- };
218
- //# sourceMappingURL=runtime-247EMSG3.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/runtime.ts"],
4
- "sourcesContent": ["import { createHash } from \"node:crypto\";\nimport { LangfuseSpanProcessor } from \"@langfuse/otel\";\nimport {\n\ttype LangfuseObservation,\n\ttype LangfuseObservationAttributes,\n\tLangfuseOtelSpanAttributes,\n\tsetLangfuseTracerProvider,\n\tstartObservation,\n} from \"@langfuse/tracing\";\nimport type { SpanProcessor } from \"@opentelemetry/sdk-trace-base\";\nimport { NodeTracerProvider } from \"@opentelemetry/sdk-trace-node\";\nimport type { LangfuseConfig } from \"./config.js\";\nimport type {\n\tObservation,\n\tObservationAttributes,\n\tObservationType,\n\tTraceBackend,\n} from \"./tracing.js\";\n\nconst RUNTIME_KEY = Symbol.for(\"@narumitw/pi-langfuse/runtime/v1\");\n\ninterface SharedRuntime {\n\tfingerprint: string;\n\tbackend: ProductionTraceBackend;\n\tshutdown: boolean;\n}\n\ntype GlobalWithRuntime = typeof globalThis & {\n\t[RUNTIME_KEY]?: Promise<SharedRuntime>;\n};\n\nexport interface RuntimeFactories {\n\tcreateProcessor(config: LangfuseConfig): SpanProcessor;\n\tcreateProvider(processor: SpanProcessor): NodeTracerProvider;\n\tselectProvider(provider: NodeTracerProvider): void;\n}\n\nclass ProductionObservation implements Observation {\n\tconstructor(readonly native: LangfuseObservation) {}\n\n\tupdate(attributes: ObservationAttributes): Observation {\n\t\tconst { sessionId, userId, ...observationAttributes } = attributes;\n\t\tthis.native.updateOtelSpanAttributes(observationAttributes as LangfuseObservationAttributes);\n\t\tapplySessionId(this.native, sessionId);\n\t\tapplyUserId(this.native, userId);\n\t\treturn this;\n\t}\n\n\tupdateTrace(attributes: ObservationAttributes): Observation {\n\t\tconst { input, output, metadata, name, sessionId, userId, tags, version } = attributes;\n\t\tif (input !== undefined || output !== undefined) {\n\t\t\tthis.native.setTraceIO({ input, output });\n\t\t}\n\t\tif (name !== undefined) {\n\t\t\tthis.native.otelSpan.setAttribute(LangfuseOtelSpanAttributes.TRACE_NAME, name);\n\t\t}\n\t\tapplySessionId(this.native, sessionId);\n\t\tapplyUserId(this.native, userId);\n\t\tif (tags !== undefined) {\n\t\t\tthis.native.otelSpan.setAttribute(LangfuseOtelSpanAttributes.TRACE_TAGS, tags);\n\t\t}\n\t\tif (version !== undefined) {\n\t\t\tthis.native.otelSpan.setAttribute(LangfuseOtelSpanAttributes.VERSION, version);\n\t\t}\n\t\tfor (const [key, value] of Object.entries(metadata ?? {})) {\n\t\t\tthis.native.otelSpan.setAttribute(\n\t\t\t\t`${LangfuseOtelSpanAttributes.TRACE_METADATA}.${key}`,\n\t\t\t\tString(value),\n\t\t\t);\n\t\t}\n\t\treturn this;\n\t}\n\n\tend(endTime?: number): Observation {\n\t\tthis.native.end(endTime);\n\t\treturn this;\n\t}\n}\n\nclass ProductionTraceBackend implements TraceBackend {\n\tconstructor(\n\t\tprivate readonly provider: NodeTracerProvider,\n\t\tprivate readonly processor: SpanProcessor,\n\t) {}\n\n\tstart(\n\t\tname: string,\n\t\tattributes: ObservationAttributes,\n\t\toptions: { asType: ObservationType; parent?: Observation },\n\t): Observation {\n\t\tconst { sessionId, userId, ...observationAttributes } = attributes;\n\t\tconst parent = options.parent;\n\t\tconst native =\n\t\t\tparent instanceof ProductionObservation\n\t\t\t\t? startChild(parent.native, name, observationAttributes, options.asType)\n\t\t\t\t: startRoot(name, observationAttributes, options.asType);\n\t\tapplySessionId(native, sessionId);\n\t\tapplyUserId(native, userId);\n\t\treturn new ProductionObservation(native);\n\t}\n\n\tasync forceFlush(): Promise<void> {\n\t\tawait this.processor.forceFlush();\n\t}\n\n\tasync shutdown(): Promise<void> {\n\t\tawait this.provider.shutdown();\n\t}\n}\n\nexport async function createProductionBackend(\n\tconfig: LangfuseConfig,\n\tfactoryOverrides: Partial<RuntimeFactories> = {},\n): Promise<TraceBackend> {\n\tconst globalRuntime = globalThis as GlobalWithRuntime;\n\tconst fingerprint = configFingerprint(config);\n\tconst existing = globalRuntime[RUNTIME_KEY];\n\tif (existing) {\n\t\tconst runtime = await existing;\n\t\tif (runtime.shutdown) {\n\t\t\tthrow new Error(\"Langfuse tracing was already shut down; restart Pi to enable it again.\");\n\t\t}\n\t\tif (runtime.fingerprint !== fingerprint) {\n\t\t\tthrow new Error(\"Langfuse configuration changed; restart Pi to apply the new credentials.\");\n\t\t}\n\t\treturn runtime.backend;\n\t}\n\n\tconst factories = { ...defaultFactories, ...factoryOverrides };\n\tconst initializing = initializeRuntime(config, fingerprint, factories);\n\tglobalRuntime[RUNTIME_KEY] = initializing;\n\ttry {\n\t\treturn (await initializing).backend;\n\t} catch (error) {\n\t\tdelete globalRuntime[RUNTIME_KEY];\n\t\tthrow error;\n\t}\n}\n\nasync function initializeRuntime(\n\tconfig: LangfuseConfig,\n\tfingerprint: string,\n\tfactories: RuntimeFactories,\n): Promise<SharedRuntime> {\n\tconst processor = factories.createProcessor(config);\n\tlet provider: NodeTracerProvider | undefined;\n\ttry {\n\t\tprovider = factories.createProvider(processor);\n\t\tfactories.selectProvider(provider);\n\t} catch (error) {\n\t\tawait (provider?.shutdown() ?? processor.shutdown()).catch(() => undefined);\n\t\tthrow error;\n\t}\n\tconst backend = new ProductionTraceBackend(provider, processor);\n\tconst runtime: SharedRuntime = { fingerprint, backend, shutdown: false };\n\tconst originalShutdown = backend.shutdown.bind(backend);\n\tbackend.shutdown = async () => {\n\t\tif (runtime.shutdown) return;\n\t\truntime.shutdown = true;\n\t\tawait originalShutdown();\n\t};\n\treturn runtime;\n}\n\nconst defaultFactories: RuntimeFactories = {\n\tcreateProcessor: (config) => {\n\t\tconst secrets = [config.secretKey, config.publicKey];\n\t\treturn new LangfuseSpanProcessor({\n\t\t\tpublicKey: config.publicKey,\n\t\t\tsecretKey: config.secretKey,\n\t\t\tbaseUrl: config.baseUrl,\n\t\t\tenvironment: config.environment ?? \"\",\n\t\t\trelease: config.release ?? \"\",\n\t\t\tflushAt: 512,\n\t\t\tflushInterval: 5,\n\t\t\ttimeout: 5,\n\t\t\tmask: ({ data }) => maskSecrets(data, secrets),\n\t\t\tshouldExportSpan: ({ otelSpan }) =>\n\t\t\t\ttypeof otelSpan.attributes[\"langfuse.observation.type\"] === \"string\",\n\t\t});\n\t},\n\tcreateProvider: (processor) => new NodeTracerProvider({ spanProcessors: [processor] }),\n\tselectProvider: setLangfuseTracerProvider,\n};\n\nfunction applySessionId(observation: LangfuseObservation, sessionId: string | undefined): void {\n\tif (sessionId !== undefined) {\n\t\tobservation.otelSpan.setAttribute(LangfuseOtelSpanAttributes.TRACE_SESSION_ID, sessionId);\n\t}\n}\n\nfunction applyUserId(observation: LangfuseObservation, userId: string | undefined): void {\n\tif (userId !== undefined) {\n\t\tobservation.otelSpan.setAttribute(LangfuseOtelSpanAttributes.TRACE_USER_ID, userId);\n\t}\n}\n\nfunction startRoot(\n\tname: string,\n\tattributes: ObservationAttributes,\n\ttype: ObservationType,\n): LangfuseObservation {\n\tif (type === \"agent\") {\n\t\treturn startObservation(name, attributes as LangfuseObservationAttributes, { asType: \"agent\" });\n\t}\n\tif (type === \"generation\") {\n\t\treturn startObservation(name, attributes as LangfuseObservationAttributes, {\n\t\t\tasType: \"generation\",\n\t\t});\n\t}\n\tif (type === \"tool\") {\n\t\treturn startObservation(name, attributes as LangfuseObservationAttributes, { asType: \"tool\" });\n\t}\n\treturn startObservation(name, attributes as LangfuseObservationAttributes, { asType: \"span\" });\n}\n\nfunction startChild(\n\tparent: LangfuseObservation,\n\tname: string,\n\tattributes: ObservationAttributes,\n\ttype: ObservationType,\n): LangfuseObservation {\n\tif (type === \"agent\") {\n\t\treturn parent.startObservation(name, attributes as LangfuseObservationAttributes, {\n\t\t\tasType: \"agent\",\n\t\t});\n\t}\n\tif (type === \"generation\") {\n\t\treturn parent.startObservation(name, attributes as LangfuseObservationAttributes, {\n\t\t\tasType: \"generation\",\n\t\t});\n\t}\n\tif (type === \"tool\") {\n\t\treturn parent.startObservation(name, attributes as LangfuseObservationAttributes, {\n\t\t\tasType: \"tool\",\n\t\t});\n\t}\n\treturn parent.startObservation(name, attributes as LangfuseObservationAttributes, {\n\t\tasType: \"span\",\n\t});\n}\n\nfunction configFingerprint(config: LangfuseConfig): string {\n\treturn createHash(\"sha256\")\n\t\t.update(\n\t\t\t`${config.publicKey}\\0${config.secretKey}\\0${config.baseUrl}\\0${config.environment ?? \"\"}\\0${config.release ?? \"\"}`,\n\t\t)\n\t\t.digest(\"hex\");\n}\n\nexport function maskSecrets(data: unknown, secrets: readonly string[]): unknown {\n\treturn maskSecretValue(data, secrets, new WeakSet<object>());\n}\n\nfunction maskSecretValue(\n\tdata: unknown,\n\tsecrets: readonly string[],\n\tactive: WeakSet<object>,\n): unknown {\n\tif (typeof data === \"string\") {\n\t\tlet masked = data.replace(/\\b(?:sk|pk)-lf-[A-Za-z0-9_-]+\\b/g, \"[LANGFUSE_KEY_REDACTED]\");\n\t\tfor (const secret of secrets) {\n\t\t\tif (secret) masked = masked.replaceAll(secret, \"[LANGFUSE_KEY_REDACTED]\");\n\t\t}\n\t\treturn masked;\n\t}\n\tif (!data || typeof data !== \"object\") return data;\n\tif (active.has(data)) return \"[circular]\";\n\n\tactive.add(data);\n\ttry {\n\t\tif (Array.isArray(data)) {\n\t\t\treturn data.map((item) => maskSecretValue(item, secrets, active));\n\t\t}\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries(data).map(([key, value]) => [key, maskSecretValue(value, secrets, active)]),\n\t\t);\n\t} finally {\n\t\tactive.delete(data);\n\t}\n}\n"],
5
- "mappings": ";;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,6BAA6B;AACtC;AAAA,EAGC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,SAAS,0BAA0B;AASnC,IAAM,cAAc,uBAAO,IAAI,kCAAkC;AAkBjE,IAAM,wBAAN,MAAmD;AAAA,EAClD,YAAqB,QAA6B;AAA7B;AAAA,EAA8B;AAAA,EAA9B;AAAA,EAErB,OAAO,YAAgD;AACtD,UAAM,EAAE,WAAW,QAAQ,GAAG,sBAAsB,IAAI;AACxD,SAAK,OAAO,yBAAyB,qBAAsD;AAC3F,mBAAe,KAAK,QAAQ,SAAS;AACrC,gBAAY,KAAK,QAAQ,MAAM;AAC/B,WAAO;AAAA,EACR;AAAA,EAEA,YAAY,YAAgD;AAC3D,UAAM,EAAE,OAAO,QAAQ,UAAU,MAAM,WAAW,QAAQ,MAAM,QAAQ,IAAI;AAC5E,QAAI,UAAU,UAAa,WAAW,QAAW;AAChD,WAAK,OAAO,WAAW,EAAE,OAAO,OAAO,CAAC;AAAA,IACzC;AACA,QAAI,SAAS,QAAW;AACvB,WAAK,OAAO,SAAS,aAAa,2BAA2B,YAAY,IAAI;AAAA,IAC9E;AACA,mBAAe,KAAK,QAAQ,SAAS;AACrC,gBAAY,KAAK,QAAQ,MAAM;AAC/B,QAAI,SAAS,QAAW;AACvB,WAAK,OAAO,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