@lmnr-ai/types 0.8.27 → 0.8.29
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/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -4
- package/dist/index.d.mts +28 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/tracing.ts","../src/utils.ts"],"sourcesContent":["import { type StringUUID } from \"./utils\";\n\n/**\n * Span types to categorize spans.\n *\n * LLM spans are auto-instrumented LLM spans.\n * Pipeline spans are top-level spans created by the pipeline runner.\n * Executor and evaluator spans are top-level spans added automatically when doing evaluations.\n */\nexport type SpanType =\n | 'DEFAULT'\n | 'LLM'\n | 'EXECUTOR'\n | 'EVALUATOR'\n | 'HUMAN_EVALUATOR'\n | 'EVALUATION'\n | 'TOOL'\n | 'CACHED';\n\n/**\n * Trace types to categorize traces.\n * They are used as association properties passed to all spans in a trace.\n */\nexport type TraceType = 'DEFAULT' | 'EVALUATION';\n\n/**\n * Tracing levels to conditionally disable tracing.\n *\n * OFF - No tracing is sent.\n * META_ONLY - Only metadata is sent (e.g. tokens, costs, etc.).\n * ALL - All data is sent.\n */\nexport enum TracingLevel {\n OFF = 'off',\n META_ONLY = 'meta_only',\n ALL = 'all',\n}\n\n/**\n * Laminar representation of an OpenTelemetry span context.\n *\n * spanId - The ID of the span.\n * traceId - The ID of the trace.\n * isRemote - Whether the span is remote.\n * spanPath - The span path (span names) leading to this span.\n * spanIdsPath - The span IDs path leading to this span.\n */\nexport type LaminarSpanContext = {\n spanId: StringUUID;\n traceId: StringUUID;\n isRemote: boolean;\n spanPath?: string[];\n spanIdsPath?: StringUUID[];\n userId?: string;\n sessionId?: string;\n metadata?: Record<string, any>;\n traceType?: TraceType;\n tracingLevel?: TracingLevel;\n};\n\nexport type Event = {\n id: StringUUID;\n templateName: string;\n timestamp: Date;\n spanId: StringUUID;\n value: number | string | null;\n};\n","// UUID type alias\nexport type StringUUID = `${string}-${string}-${string}-${string}-${string}`;\n\nexport const errorMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error);\n"],"mappings":";;;;;;;;;AAgCA,IAAY,eAAL,yBAAA,cAAA;CACL,aAAA,SAAA;CACA,aAAA,eAAA;CACA,aAAA,SAAA;;KACD;;;ACjCD,MAAa,gBAAgB,UAC3B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/tracing.ts","../src/utils.ts"],"sourcesContent":["import { type StringUUID } from \"./utils\";\n\n/**\n * Span types to categorize spans.\n *\n * LLM spans are auto-instrumented LLM spans.\n * Pipeline spans are top-level spans created by the pipeline runner.\n * Executor and evaluator spans are top-level spans added automatically when doing evaluations.\n */\nexport type SpanType =\n | 'DEFAULT'\n | 'LLM'\n | 'EXECUTOR'\n | 'EVALUATOR'\n | 'HUMAN_EVALUATOR'\n | 'EVALUATION'\n | 'TOOL'\n | 'CACHED';\n\n/**\n * Trace types to categorize traces.\n * They are used as association properties passed to all spans in a trace.\n */\nexport type TraceType = 'DEFAULT' | 'EVALUATION';\n\n/**\n * Tracing levels to conditionally disable tracing.\n *\n * OFF - No tracing is sent.\n * META_ONLY - Only metadata is sent (e.g. tokens, costs, etc.).\n * ALL - All data is sent.\n */\nexport enum TracingLevel {\n OFF = 'off',\n META_ONLY = 'meta_only',\n ALL = 'all',\n}\n\n/**\n * Debugger context propagated as ONE nested block of a LaminarSpanContext.\n *\n * Carries the debug-replay v2 coordinates a downstream run needs to consult the\n * same server-side cache window as the run that produced this context. Laminar\n * is the only producer; a hand-forged or `enabled: false` block is treated as\n * absent by the consumer (behaviour is explicitly undefined).\n *\n * enabled - armed flag — only `true` blocks are ever constructed by us.\n * sessionId - the run's session id, a hyphenated UUID (undefined when absent).\n * replayTraceId - the source trace to replay, a hyphenated UUID (undefined when\n * absent).\n * cacheUntil - the cache-window span-id needle, kept VERBATIM (hyphenated or\n * not, full UUID or short suffix) — the server resolves it.\n */\nexport type DebugContext = {\n enabled: boolean;\n sessionId?: string;\n replayTraceId?: string;\n cacheUntil?: string;\n};\n\n/**\n * Laminar representation of an OpenTelemetry span context.\n *\n * spanId - The ID of the span.\n * traceId - The ID of the trace.\n * isRemote - Whether the span is remote.\n * spanPath - The span path (span names) leading to this span.\n * spanIdsPath - The span IDs path leading to this span.\n * debug - Propagated debugger context, if any (debug-replay v2).\n */\nexport type LaminarSpanContext = {\n spanId: StringUUID;\n traceId: StringUUID;\n isRemote: boolean;\n spanPath?: string[];\n spanIdsPath?: StringUUID[];\n userId?: string;\n sessionId?: string;\n metadata?: Record<string, any>;\n traceType?: TraceType;\n tracingLevel?: TracingLevel;\n debug?: DebugContext;\n};\n\nexport type Event = {\n id: StringUUID;\n templateName: string;\n timestamp: Date;\n spanId: StringUUID;\n value: number | string | null;\n};\n","// UUID type alias\nexport type StringUUID = `${string}-${string}-${string}-${string}-${string}`;\n\nexport const errorMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error);\n"],"mappings":";;;;;;;;;AAgCA,IAAY,eAAL,yBAAA,cAAA;CACL,aAAA,SAAA;CACA,aAAA,eAAA;CACA,aAAA,SAAA;;KACD;;;ACjCD,MAAa,gBAAgB,UAC3B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM"}
|
package/dist/index.d.cts
CHANGED
|
@@ -19,8 +19,9 @@ interface SessionRecordingOptions {
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/debug.d.ts
|
|
21
21
|
/**
|
|
22
|
-
* A single cached LLM
|
|
23
|
-
*
|
|
22
|
+
* A single cached LLM response served by a debug-replay cache HIT. The provider
|
|
23
|
+
* wrappers consume `output` (a JSON string) and `attributes` to reconstruct the
|
|
24
|
+
* call result; `name`/`input` are unused by replay.
|
|
24
25
|
*/
|
|
25
26
|
interface CachedSpan {
|
|
26
27
|
name: string;
|
|
@@ -37,7 +38,7 @@ interface DebugRunPointer {
|
|
|
37
38
|
trace_id: string;
|
|
38
39
|
session_id: string;
|
|
39
40
|
replay_trace_id: string | null;
|
|
40
|
-
cache_until:
|
|
41
|
+
cache_until: string | null;
|
|
41
42
|
debugger_url: string | null;
|
|
42
43
|
started_at: string;
|
|
43
44
|
}
|
|
@@ -264,6 +265,27 @@ declare enum TracingLevel {
|
|
|
264
265
|
META_ONLY = "meta_only",
|
|
265
266
|
ALL = "all"
|
|
266
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* Debugger context propagated as ONE nested block of a LaminarSpanContext.
|
|
270
|
+
*
|
|
271
|
+
* Carries the debug-replay v2 coordinates a downstream run needs to consult the
|
|
272
|
+
* same server-side cache window as the run that produced this context. Laminar
|
|
273
|
+
* is the only producer; a hand-forged or `enabled: false` block is treated as
|
|
274
|
+
* absent by the consumer (behaviour is explicitly undefined).
|
|
275
|
+
*
|
|
276
|
+
* enabled - armed flag — only `true` blocks are ever constructed by us.
|
|
277
|
+
* sessionId - the run's session id, a hyphenated UUID (undefined when absent).
|
|
278
|
+
* replayTraceId - the source trace to replay, a hyphenated UUID (undefined when
|
|
279
|
+
* absent).
|
|
280
|
+
* cacheUntil - the cache-window span-id needle, kept VERBATIM (hyphenated or
|
|
281
|
+
* not, full UUID or short suffix) — the server resolves it.
|
|
282
|
+
*/
|
|
283
|
+
type DebugContext = {
|
|
284
|
+
enabled: boolean;
|
|
285
|
+
sessionId?: string;
|
|
286
|
+
replayTraceId?: string;
|
|
287
|
+
cacheUntil?: string;
|
|
288
|
+
};
|
|
267
289
|
/**
|
|
268
290
|
* Laminar representation of an OpenTelemetry span context.
|
|
269
291
|
*
|
|
@@ -272,6 +294,7 @@ declare enum TracingLevel {
|
|
|
272
294
|
* isRemote - Whether the span is remote.
|
|
273
295
|
* spanPath - The span path (span names) leading to this span.
|
|
274
296
|
* spanIdsPath - The span IDs path leading to this span.
|
|
297
|
+
* debug - Propagated debugger context, if any (debug-replay v2).
|
|
275
298
|
*/
|
|
276
299
|
type LaminarSpanContext = {
|
|
277
300
|
spanId: StringUUID;
|
|
@@ -284,6 +307,7 @@ type LaminarSpanContext = {
|
|
|
284
307
|
metadata?: Record<string, any>;
|
|
285
308
|
traceType?: TraceType;
|
|
286
309
|
tracingLevel?: TracingLevel;
|
|
310
|
+
debug?: DebugContext;
|
|
287
311
|
};
|
|
288
312
|
type Event = {
|
|
289
313
|
id: StringUUID;
|
|
@@ -293,5 +317,5 @@ type Event = {
|
|
|
293
317
|
value: number | string | null;
|
|
294
318
|
};
|
|
295
319
|
//#endregion
|
|
296
|
-
export { CachedSpan, Datapoint, Dataset, DebugRunPointer, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionRecordingOptions, SpanExporter, SpanProcessor, SpanType, StringUUID, TraceType, TracingLevel, errorMessage };
|
|
320
|
+
export { CachedSpan, Datapoint, Dataset, DebugContext, DebugRunPointer, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionRecordingOptions, SpanExporter, SpanProcessor, SpanType, StringUUID, TraceType, TracingLevel, errorMessage };
|
|
297
321
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -19,8 +19,9 @@ interface SessionRecordingOptions {
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/debug.d.ts
|
|
21
21
|
/**
|
|
22
|
-
* A single cached LLM
|
|
23
|
-
*
|
|
22
|
+
* A single cached LLM response served by a debug-replay cache HIT. The provider
|
|
23
|
+
* wrappers consume `output` (a JSON string) and `attributes` to reconstruct the
|
|
24
|
+
* call result; `name`/`input` are unused by replay.
|
|
24
25
|
*/
|
|
25
26
|
interface CachedSpan {
|
|
26
27
|
name: string;
|
|
@@ -37,7 +38,7 @@ interface DebugRunPointer {
|
|
|
37
38
|
trace_id: string;
|
|
38
39
|
session_id: string;
|
|
39
40
|
replay_trace_id: string | null;
|
|
40
|
-
cache_until:
|
|
41
|
+
cache_until: string | null;
|
|
41
42
|
debugger_url: string | null;
|
|
42
43
|
started_at: string;
|
|
43
44
|
}
|
|
@@ -264,6 +265,27 @@ declare enum TracingLevel {
|
|
|
264
265
|
META_ONLY = "meta_only",
|
|
265
266
|
ALL = "all"
|
|
266
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* Debugger context propagated as ONE nested block of a LaminarSpanContext.
|
|
270
|
+
*
|
|
271
|
+
* Carries the debug-replay v2 coordinates a downstream run needs to consult the
|
|
272
|
+
* same server-side cache window as the run that produced this context. Laminar
|
|
273
|
+
* is the only producer; a hand-forged or `enabled: false` block is treated as
|
|
274
|
+
* absent by the consumer (behaviour is explicitly undefined).
|
|
275
|
+
*
|
|
276
|
+
* enabled - armed flag — only `true` blocks are ever constructed by us.
|
|
277
|
+
* sessionId - the run's session id, a hyphenated UUID (undefined when absent).
|
|
278
|
+
* replayTraceId - the source trace to replay, a hyphenated UUID (undefined when
|
|
279
|
+
* absent).
|
|
280
|
+
* cacheUntil - the cache-window span-id needle, kept VERBATIM (hyphenated or
|
|
281
|
+
* not, full UUID or short suffix) — the server resolves it.
|
|
282
|
+
*/
|
|
283
|
+
type DebugContext = {
|
|
284
|
+
enabled: boolean;
|
|
285
|
+
sessionId?: string;
|
|
286
|
+
replayTraceId?: string;
|
|
287
|
+
cacheUntil?: string;
|
|
288
|
+
};
|
|
267
289
|
/**
|
|
268
290
|
* Laminar representation of an OpenTelemetry span context.
|
|
269
291
|
*
|
|
@@ -272,6 +294,7 @@ declare enum TracingLevel {
|
|
|
272
294
|
* isRemote - Whether the span is remote.
|
|
273
295
|
* spanPath - The span path (span names) leading to this span.
|
|
274
296
|
* spanIdsPath - The span IDs path leading to this span.
|
|
297
|
+
* debug - Propagated debugger context, if any (debug-replay v2).
|
|
275
298
|
*/
|
|
276
299
|
type LaminarSpanContext = {
|
|
277
300
|
spanId: StringUUID;
|
|
@@ -284,6 +307,7 @@ type LaminarSpanContext = {
|
|
|
284
307
|
metadata?: Record<string, any>;
|
|
285
308
|
traceType?: TraceType;
|
|
286
309
|
tracingLevel?: TracingLevel;
|
|
310
|
+
debug?: DebugContext;
|
|
287
311
|
};
|
|
288
312
|
type Event = {
|
|
289
313
|
id: StringUUID;
|
|
@@ -293,5 +317,5 @@ type Event = {
|
|
|
293
317
|
value: number | string | null;
|
|
294
318
|
};
|
|
295
319
|
//#endregion
|
|
296
|
-
export { CachedSpan, Datapoint, Dataset, DebugRunPointer, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionRecordingOptions, SpanExporter, SpanProcessor, SpanType, StringUUID, TraceType, TracingLevel, errorMessage };
|
|
320
|
+
export { CachedSpan, Datapoint, Dataset, DebugContext, DebugRunPointer, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionRecordingOptions, SpanExporter, SpanProcessor, SpanType, StringUUID, TraceType, TracingLevel, errorMessage };
|
|
297
321
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/tracing.ts","../src/utils.ts"],"sourcesContent":["import { type StringUUID } from \"./utils\";\n\n/**\n * Span types to categorize spans.\n *\n * LLM spans are auto-instrumented LLM spans.\n * Pipeline spans are top-level spans created by the pipeline runner.\n * Executor and evaluator spans are top-level spans added automatically when doing evaluations.\n */\nexport type SpanType =\n | 'DEFAULT'\n | 'LLM'\n | 'EXECUTOR'\n | 'EVALUATOR'\n | 'HUMAN_EVALUATOR'\n | 'EVALUATION'\n | 'TOOL'\n | 'CACHED';\n\n/**\n * Trace types to categorize traces.\n * They are used as association properties passed to all spans in a trace.\n */\nexport type TraceType = 'DEFAULT' | 'EVALUATION';\n\n/**\n * Tracing levels to conditionally disable tracing.\n *\n * OFF - No tracing is sent.\n * META_ONLY - Only metadata is sent (e.g. tokens, costs, etc.).\n * ALL - All data is sent.\n */\nexport enum TracingLevel {\n OFF = 'off',\n META_ONLY = 'meta_only',\n ALL = 'all',\n}\n\n/**\n * Laminar representation of an OpenTelemetry span context.\n *\n * spanId - The ID of the span.\n * traceId - The ID of the trace.\n * isRemote - Whether the span is remote.\n * spanPath - The span path (span names) leading to this span.\n * spanIdsPath - The span IDs path leading to this span.\n */\nexport type LaminarSpanContext = {\n spanId: StringUUID;\n traceId: StringUUID;\n isRemote: boolean;\n spanPath?: string[];\n spanIdsPath?: StringUUID[];\n userId?: string;\n sessionId?: string;\n metadata?: Record<string, any>;\n traceType?: TraceType;\n tracingLevel?: TracingLevel;\n};\n\nexport type Event = {\n id: StringUUID;\n templateName: string;\n timestamp: Date;\n spanId: StringUUID;\n value: number | string | null;\n};\n","// UUID type alias\nexport type StringUUID = `${string}-${string}-${string}-${string}-${string}`;\n\nexport const errorMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error);\n"],"mappings":";;;;;;;;AAgCA,IAAY,eAAL,yBAAA,cAAA;CACL,aAAA,SAAA;CACA,aAAA,eAAA;CACA,aAAA,SAAA;;KACD;;;ACjCD,MAAa,gBAAgB,UAC3B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/tracing.ts","../src/utils.ts"],"sourcesContent":["import { type StringUUID } from \"./utils\";\n\n/**\n * Span types to categorize spans.\n *\n * LLM spans are auto-instrumented LLM spans.\n * Pipeline spans are top-level spans created by the pipeline runner.\n * Executor and evaluator spans are top-level spans added automatically when doing evaluations.\n */\nexport type SpanType =\n | 'DEFAULT'\n | 'LLM'\n | 'EXECUTOR'\n | 'EVALUATOR'\n | 'HUMAN_EVALUATOR'\n | 'EVALUATION'\n | 'TOOL'\n | 'CACHED';\n\n/**\n * Trace types to categorize traces.\n * They are used as association properties passed to all spans in a trace.\n */\nexport type TraceType = 'DEFAULT' | 'EVALUATION';\n\n/**\n * Tracing levels to conditionally disable tracing.\n *\n * OFF - No tracing is sent.\n * META_ONLY - Only metadata is sent (e.g. tokens, costs, etc.).\n * ALL - All data is sent.\n */\nexport enum TracingLevel {\n OFF = 'off',\n META_ONLY = 'meta_only',\n ALL = 'all',\n}\n\n/**\n * Debugger context propagated as ONE nested block of a LaminarSpanContext.\n *\n * Carries the debug-replay v2 coordinates a downstream run needs to consult the\n * same server-side cache window as the run that produced this context. Laminar\n * is the only producer; a hand-forged or `enabled: false` block is treated as\n * absent by the consumer (behaviour is explicitly undefined).\n *\n * enabled - armed flag — only `true` blocks are ever constructed by us.\n * sessionId - the run's session id, a hyphenated UUID (undefined when absent).\n * replayTraceId - the source trace to replay, a hyphenated UUID (undefined when\n * absent).\n * cacheUntil - the cache-window span-id needle, kept VERBATIM (hyphenated or\n * not, full UUID or short suffix) — the server resolves it.\n */\nexport type DebugContext = {\n enabled: boolean;\n sessionId?: string;\n replayTraceId?: string;\n cacheUntil?: string;\n};\n\n/**\n * Laminar representation of an OpenTelemetry span context.\n *\n * spanId - The ID of the span.\n * traceId - The ID of the trace.\n * isRemote - Whether the span is remote.\n * spanPath - The span path (span names) leading to this span.\n * spanIdsPath - The span IDs path leading to this span.\n * debug - Propagated debugger context, if any (debug-replay v2).\n */\nexport type LaminarSpanContext = {\n spanId: StringUUID;\n traceId: StringUUID;\n isRemote: boolean;\n spanPath?: string[];\n spanIdsPath?: StringUUID[];\n userId?: string;\n sessionId?: string;\n metadata?: Record<string, any>;\n traceType?: TraceType;\n tracingLevel?: TracingLevel;\n debug?: DebugContext;\n};\n\nexport type Event = {\n id: StringUUID;\n templateName: string;\n timestamp: Date;\n spanId: StringUUID;\n value: number | string | null;\n};\n","// UUID type alias\nexport type StringUUID = `${string}-${string}-${string}-${string}-${string}`;\n\nexport const errorMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error);\n"],"mappings":";;;;;;;;AAgCA,IAAY,eAAL,yBAAA,cAAA;CACL,aAAA,SAAA;CACA,aAAA,eAAA;CACA,aAAA,SAAA;;KACD;;;ACjCD,MAAa,gBAAgB,UAC3B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM"}
|