@lmnr-ai/types 0.8.30 → 0.8.31

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 CHANGED
@@ -1,4 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/debug-session.ts
3
+ /** Directory the debug-session file lives in, relative to the working dir. */
4
+ const DEBUG_SESSION_DIR = ".lmnr";
5
+ /** Filename of the debug-session file inside {@link DEBUG_SESSION_DIR}. */
6
+ const DEBUG_SESSION_FILE = "debug-session.json";
7
+ //#endregion
2
8
  //#region src/tracing.ts
3
9
  /**
4
10
  * Tracing levels to conditionally disable tracing.
@@ -17,6 +23,8 @@ let TracingLevel = /* @__PURE__ */ function(TracingLevel) {
17
23
  //#region src/utils.ts
18
24
  const errorMessage = (error) => error instanceof Error ? error.message : String(error);
19
25
  //#endregion
26
+ exports.DEBUG_SESSION_DIR = DEBUG_SESSION_DIR;
27
+ exports.DEBUG_SESSION_FILE = DEBUG_SESSION_FILE;
20
28
  exports.TracingLevel = TracingLevel;
21
29
  exports.errorMessage = errorMessage;
22
30
 
@@ -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 * 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"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/debug-session.ts","../src/tracing.ts","../src/utils.ts"],"sourcesContent":["/**\n * Shared `.lmnr/debug-session.json` contract.\n *\n * Single source of truth for the persisted debug-session record's SHAPE and\n * location, imported by both `@lmnr-ai/lmnr` (the SDK — reads at init, writes at\n * shutdown) and `lmnr-cli` (resets it via `debug session new`). `@lmnr-ai/types`\n * stays type-only (no `node:fs`), so the fs read/write helpers live in each\n * consumer; they all import this interface + the filename consts, which is what\n * keeps the on-disk shape from drifting between writers.\n */\n\n/**\n * Persisted debug-session record at `${CWD}/.lmnr/debug-session.json`.\n *\n * Replaces the old `.lmnr/last-run.json` pointer; it is the default persistence\n * for a debug run (no opt-in env var). `session_id` is the PRIMARY field read at\n * startup to decide \"join existing session vs. mint a new one\".\n */\nexport interface DebugSessionFile {\n /** Current debug session id (UUID). The thing read at startup. Required. */\n session_id: string;\n /** Root trace id produced by the most recent run in this session, or null. */\n trace_id: string | null;\n /** Replay-source trace id, or null. */\n replay_trace_id: string | null;\n /** Span-id needle bounding the replay window, or null. Verbatim. */\n cache_until: string | null;\n /** Full per-session debugger URL, or null until known. */\n debugger_url: string | null;\n /** ISO-8601 timestamp this session was created/started. */\n started_at: string;\n}\n\n/** Directory the debug-session file lives in, relative to the working dir. */\nexport const DEBUG_SESSION_DIR = \".lmnr\";\n/** Filename of the debug-session file inside {@link DEBUG_SESSION_DIR}. */\nexport const DEBUG_SESSION_FILE = \"debug-session.json\";\n","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":";;;AAkCA,MAAa,oBAAoB;;AAEjC,MAAa,qBAAqB;;;;;;;;;;ACJlC,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
@@ -29,19 +29,43 @@ interface CachedSpan {
29
29
  output: string;
30
30
  attributes: Record<string, any>;
31
31
  }
32
+ //#endregion
33
+ //#region src/debug-session.d.ts
32
34
  /**
33
- * The debug-run pointer (§5). Emitted once at process shutdown as a console line
34
- * and to `${CWD}/.lmnr/last-run.json`. Key order is part of the cross-language
35
- * parity contract with the Python SDK.
35
+ * Shared `.lmnr/debug-session.json` contract.
36
+ *
37
+ * Single source of truth for the persisted debug-session record's SHAPE and
38
+ * location, imported by both `@lmnr-ai/lmnr` (the SDK — reads at init, writes at
39
+ * shutdown) and `lmnr-cli` (resets it via `debug session new`). `@lmnr-ai/types`
40
+ * stays type-only (no `node:fs`), so the fs read/write helpers live in each
41
+ * consumer; they all import this interface + the filename consts, which is what
42
+ * keeps the on-disk shape from drifting between writers.
43
+ */
44
+ /**
45
+ * Persisted debug-session record at `${CWD}/.lmnr/debug-session.json`.
46
+ *
47
+ * Replaces the old `.lmnr/last-run.json` pointer; it is the default persistence
48
+ * for a debug run (no opt-in env var). `session_id` is the PRIMARY field read at
49
+ * startup to decide "join existing session vs. mint a new one".
36
50
  */
37
- interface DebugRunPointer {
38
- trace_id: string;
51
+ interface DebugSessionFile {
52
+ /** Current debug session id (UUID). The thing read at startup. Required. */
39
53
  session_id: string;
54
+ /** Root trace id produced by the most recent run in this session, or null. */
55
+ trace_id: string | null;
56
+ /** Replay-source trace id, or null. */
40
57
  replay_trace_id: string | null;
58
+ /** Span-id needle bounding the replay window, or null. Verbatim. */
41
59
  cache_until: string | null;
60
+ /** Full per-session debugger URL, or null until known. */
42
61
  debugger_url: string | null;
62
+ /** ISO-8601 timestamp this session was created/started. */
43
63
  started_at: string;
44
64
  }
65
+ /** Directory the debug-session file lives in, relative to the working dir. */
66
+ declare const DEBUG_SESSION_DIR = ".lmnr";
67
+ /** Filename of the debug-session file inside {@link DEBUG_SESSION_DIR}. */
68
+ declare const DEBUG_SESSION_FILE = "debug-session.json";
45
69
  //#endregion
46
70
  //#region src/utils.d.ts
47
71
  type StringUUID = `${string}-${string}-${string}-${string}-${string}`;
@@ -317,5 +341,5 @@ type Event = {
317
341
  value: number | string | null;
318
342
  };
319
343
  //#endregion
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 };
344
+ export { CachedSpan, DEBUG_SESSION_DIR, DEBUG_SESSION_FILE, Datapoint, Dataset, DebugContext, DebugSessionFile, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionRecordingOptions, SpanExporter, SpanProcessor, SpanType, StringUUID, TraceType, TracingLevel, errorMessage };
321
345
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.mts CHANGED
@@ -29,19 +29,43 @@ interface CachedSpan {
29
29
  output: string;
30
30
  attributes: Record<string, any>;
31
31
  }
32
+ //#endregion
33
+ //#region src/debug-session.d.ts
32
34
  /**
33
- * The debug-run pointer (§5). Emitted once at process shutdown as a console line
34
- * and to `${CWD}/.lmnr/last-run.json`. Key order is part of the cross-language
35
- * parity contract with the Python SDK.
35
+ * Shared `.lmnr/debug-session.json` contract.
36
+ *
37
+ * Single source of truth for the persisted debug-session record's SHAPE and
38
+ * location, imported by both `@lmnr-ai/lmnr` (the SDK — reads at init, writes at
39
+ * shutdown) and `lmnr-cli` (resets it via `debug session new`). `@lmnr-ai/types`
40
+ * stays type-only (no `node:fs`), so the fs read/write helpers live in each
41
+ * consumer; they all import this interface + the filename consts, which is what
42
+ * keeps the on-disk shape from drifting between writers.
43
+ */
44
+ /**
45
+ * Persisted debug-session record at `${CWD}/.lmnr/debug-session.json`.
46
+ *
47
+ * Replaces the old `.lmnr/last-run.json` pointer; it is the default persistence
48
+ * for a debug run (no opt-in env var). `session_id` is the PRIMARY field read at
49
+ * startup to decide "join existing session vs. mint a new one".
36
50
  */
37
- interface DebugRunPointer {
38
- trace_id: string;
51
+ interface DebugSessionFile {
52
+ /** Current debug session id (UUID). The thing read at startup. Required. */
39
53
  session_id: string;
54
+ /** Root trace id produced by the most recent run in this session, or null. */
55
+ trace_id: string | null;
56
+ /** Replay-source trace id, or null. */
40
57
  replay_trace_id: string | null;
58
+ /** Span-id needle bounding the replay window, or null. Verbatim. */
41
59
  cache_until: string | null;
60
+ /** Full per-session debugger URL, or null until known. */
42
61
  debugger_url: string | null;
62
+ /** ISO-8601 timestamp this session was created/started. */
43
63
  started_at: string;
44
64
  }
65
+ /** Directory the debug-session file lives in, relative to the working dir. */
66
+ declare const DEBUG_SESSION_DIR = ".lmnr";
67
+ /** Filename of the debug-session file inside {@link DEBUG_SESSION_DIR}. */
68
+ declare const DEBUG_SESSION_FILE = "debug-session.json";
45
69
  //#endregion
46
70
  //#region src/utils.d.ts
47
71
  type StringUUID = `${string}-${string}-${string}-${string}-${string}`;
@@ -317,5 +341,5 @@ type Event = {
317
341
  value: number | string | null;
318
342
  };
319
343
  //#endregion
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 };
344
+ export { CachedSpan, DEBUG_SESSION_DIR, DEBUG_SESSION_FILE, Datapoint, Dataset, DebugContext, DebugSessionFile, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionRecordingOptions, SpanExporter, SpanProcessor, SpanType, StringUUID, TraceType, TracingLevel, errorMessage };
321
345
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1,3 +1,9 @@
1
+ //#region src/debug-session.ts
2
+ /** Directory the debug-session file lives in, relative to the working dir. */
3
+ const DEBUG_SESSION_DIR = ".lmnr";
4
+ /** Filename of the debug-session file inside {@link DEBUG_SESSION_DIR}. */
5
+ const DEBUG_SESSION_FILE = "debug-session.json";
6
+ //#endregion
1
7
  //#region src/tracing.ts
2
8
  /**
3
9
  * Tracing levels to conditionally disable tracing.
@@ -16,6 +22,6 @@ let TracingLevel = /* @__PURE__ */ function(TracingLevel) {
16
22
  //#region src/utils.ts
17
23
  const errorMessage = (error) => error instanceof Error ? error.message : String(error);
18
24
  //#endregion
19
- export { TracingLevel, errorMessage };
25
+ export { DEBUG_SESSION_DIR, DEBUG_SESSION_FILE, TracingLevel, errorMessage };
20
26
 
21
27
  //# sourceMappingURL=index.mjs.map
@@ -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 * 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"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/debug-session.ts","../src/tracing.ts","../src/utils.ts"],"sourcesContent":["/**\n * Shared `.lmnr/debug-session.json` contract.\n *\n * Single source of truth for the persisted debug-session record's SHAPE and\n * location, imported by both `@lmnr-ai/lmnr` (the SDK — reads at init, writes at\n * shutdown) and `lmnr-cli` (resets it via `debug session new`). `@lmnr-ai/types`\n * stays type-only (no `node:fs`), so the fs read/write helpers live in each\n * consumer; they all import this interface + the filename consts, which is what\n * keeps the on-disk shape from drifting between writers.\n */\n\n/**\n * Persisted debug-session record at `${CWD}/.lmnr/debug-session.json`.\n *\n * Replaces the old `.lmnr/last-run.json` pointer; it is the default persistence\n * for a debug run (no opt-in env var). `session_id` is the PRIMARY field read at\n * startup to decide \"join existing session vs. mint a new one\".\n */\nexport interface DebugSessionFile {\n /** Current debug session id (UUID). The thing read at startup. Required. */\n session_id: string;\n /** Root trace id produced by the most recent run in this session, or null. */\n trace_id: string | null;\n /** Replay-source trace id, or null. */\n replay_trace_id: string | null;\n /** Span-id needle bounding the replay window, or null. Verbatim. */\n cache_until: string | null;\n /** Full per-session debugger URL, or null until known. */\n debugger_url: string | null;\n /** ISO-8601 timestamp this session was created/started. */\n started_at: string;\n}\n\n/** Directory the debug-session file lives in, relative to the working dir. */\nexport const DEBUG_SESSION_DIR = \".lmnr\";\n/** Filename of the debug-session file inside {@link DEBUG_SESSION_DIR}. */\nexport const DEBUG_SESSION_FILE = \"debug-session.json\";\n","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":";;AAkCA,MAAa,oBAAoB;;AAEjC,MAAa,qBAAqB;;;;;;;;;;ACJlC,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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmnr-ai/types",
3
- "version": "0.8.30",
3
+ "version": "0.8.31",
4
4
  "description": "Shared types for Laminar AI SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",