@lmnr-ai/types 0.8.44 → 0.8.46
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 +97 -3
- package/dist/index.d.mts +97 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -4
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 |
|
|
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;;AACF,EAAA,CAAA,CAAA;;;ACjCA,MAAa,gBAAgB,UAC3B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK"}
|
package/dist/index.d.cts
CHANGED
|
@@ -263,6 +263,66 @@ interface InitializeOptions {
|
|
|
263
263
|
spanProcessor?: SpanProcessor;
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
|
+
//#region src/llm-profiles.d.ts
|
|
267
|
+
/**
|
|
268
|
+
* Workspace LLM profile wire shapes (`/v1/cli/llm-profiles`, mirrored from
|
|
269
|
+
* app-server's `LlmProfileResponse`). Self-hosted only; on Laminar Cloud every
|
|
270
|
+
* route 404s with `{error: "LLM profiles are not available on this deployment"}`.
|
|
271
|
+
*/
|
|
272
|
+
type LlmProfileProvider = "openai_completions" | "openai_responses" | "gemini" | "bedrock" | "azure_chat_completions" | "azure_responses" | "azure_anthropic" | "custom";
|
|
273
|
+
/**
|
|
274
|
+
* How the profile authenticates. `api_key` for every provider except Bedrock,
|
|
275
|
+
* which takes AWS keys (secret arrives separately in `secrets`) or a bearer
|
|
276
|
+
* token.
|
|
277
|
+
*/
|
|
278
|
+
type LlmProfileAuth = {
|
|
279
|
+
type: "api_key";
|
|
280
|
+
} | {
|
|
281
|
+
type: "aws_keys";
|
|
282
|
+
accessKeyId: string;
|
|
283
|
+
} | {
|
|
284
|
+
type: "bearer_token";
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* Non-secret provider options. The server normalizes per provider: absent
|
|
288
|
+
* fields are omitted on the wire, never `null`.
|
|
289
|
+
*/
|
|
290
|
+
interface LlmProfileConfig {
|
|
291
|
+
auth: LlmProfileAuth;
|
|
292
|
+
/** Bedrock. */
|
|
293
|
+
region?: string;
|
|
294
|
+
/** Azure: exactly one of `resourceId` / `baseUrl`. */
|
|
295
|
+
resourceId?: string;
|
|
296
|
+
/** Azure (alternative to `resourceId`) or `custom` (required). */
|
|
297
|
+
baseUrl?: string;
|
|
298
|
+
/** Azure. */
|
|
299
|
+
apiVersion?: string;
|
|
300
|
+
/** `custom`: header names whose values live in `secrets.headers`. */
|
|
301
|
+
headerNames?: string[];
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* What reads return instead of secrets: a `first3***last3` mask per stored
|
|
305
|
+
* value (fully starred when short) and custom header names only. Absent slots
|
|
306
|
+
* arrive as explicit `null` (the server does not omit them).
|
|
307
|
+
*/
|
|
308
|
+
interface LlmProfileSecretMasks {
|
|
309
|
+
apiKey?: string | null;
|
|
310
|
+
secretAccessKey?: string | null;
|
|
311
|
+
token?: string | null;
|
|
312
|
+
headers: string[];
|
|
313
|
+
}
|
|
314
|
+
interface LlmProfile {
|
|
315
|
+
id: string;
|
|
316
|
+
workspaceId: string;
|
|
317
|
+
name: string;
|
|
318
|
+
provider: LlmProfileProvider;
|
|
319
|
+
config: LlmProfileConfig;
|
|
320
|
+
models: string[];
|
|
321
|
+
secrets: LlmProfileSecretMasks;
|
|
322
|
+
createdAt: string;
|
|
323
|
+
updatedAt: string;
|
|
324
|
+
}
|
|
325
|
+
//#endregion
|
|
266
326
|
//#region src/session-block.d.ts
|
|
267
327
|
/**
|
|
268
328
|
* Shared contract for debugger-session blocks — an ordered list of blocks (see
|
|
@@ -377,6 +437,40 @@ interface Signal {
|
|
|
377
437
|
trigger: SignalTrigger;
|
|
378
438
|
filters: SignalFilter[];
|
|
379
439
|
mode: SignalMode;
|
|
440
|
+
/** Workspace LLM profile id; `null` = runs on the server's env LLM. */
|
|
441
|
+
llmProfileId: string | null;
|
|
442
|
+
/** Display name of `llmProfileId`; `null` alongside it. */
|
|
443
|
+
llmProfileName: string | null;
|
|
444
|
+
/** Model pinned within the profile; `null` alongside `llmProfileId`. */
|
|
445
|
+
model: string | null;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Stored version blob on `GET /signals/{id}/versions`. Schema key is
|
|
449
|
+
* `structuredOutputSchema`, not `structuredOutput` (that name is only on
|
|
450
|
+
* `GET /signals/{id}`). `trigger`/`filters` are stored Filter[] JSON
|
|
451
|
+
* (`signal_triggers.value` / `filters`), not the CLI tagged {@link SignalTrigger}.
|
|
452
|
+
*/
|
|
453
|
+
interface SignalDefinition {
|
|
454
|
+
name: string;
|
|
455
|
+
prompt: string;
|
|
456
|
+
structuredOutputSchema: SignalStructuredOutput;
|
|
457
|
+
trigger: SignalFilter[];
|
|
458
|
+
filters: SignalFilter[];
|
|
459
|
+
mode: SignalMode;
|
|
460
|
+
sampleRate: number | null;
|
|
461
|
+
disabled: boolean;
|
|
462
|
+
/** Both `null` = env-var routing. Cloud signals stay `null`. */
|
|
463
|
+
llmProfileId: string | null;
|
|
464
|
+
llmModel: string | null;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* One historical judge definition. `GET /signals/{id}`'s `version` field is
|
|
468
|
+
* only the current pointer; this is the version log.
|
|
469
|
+
*/
|
|
470
|
+
interface SignalVersion {
|
|
471
|
+
version: number;
|
|
472
|
+
definition: SignalDefinition;
|
|
473
|
+
createdAt: string;
|
|
380
474
|
}
|
|
381
475
|
//#endregion
|
|
382
476
|
//#region src/sql-schema.d.ts
|
|
@@ -426,12 +520,12 @@ interface SqlSchema {
|
|
|
426
520
|
* Pipeline spans are top-level spans created by the pipeline runner.
|
|
427
521
|
* Executor and evaluator spans are top-level spans added automatically when doing evaluations.
|
|
428
522
|
*/
|
|
429
|
-
type SpanType =
|
|
523
|
+
type SpanType = "DEFAULT" | "LLM" | "EXECUTOR" | "EVALUATOR" | "HUMAN_EVALUATOR" | "EVALUATION" | "TOOL" | "CACHED";
|
|
430
524
|
/**
|
|
431
525
|
* Trace types to categorize traces.
|
|
432
526
|
* They are used as association properties passed to all spans in a trace.
|
|
433
527
|
*/
|
|
434
|
-
type TraceType =
|
|
528
|
+
type TraceType = "DEFAULT" | "EVALUATION";
|
|
435
529
|
/**
|
|
436
530
|
* Tracing levels to conditionally disable tracing.
|
|
437
531
|
*
|
|
@@ -496,5 +590,5 @@ type Event = {
|
|
|
496
590
|
value: number | string | null;
|
|
497
591
|
};
|
|
498
592
|
//#endregion
|
|
499
|
-
export { CachedSpan, CommandBlockContent, DEBUG_SESSION_DIR, DEBUG_SESSION_FILE, Datapoint, Dataset, DebugContext, DebugSessionFile, EvaluationBlockContent, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionBlock, SessionBlockContent, SessionBlockType, SessionRecordingOptions, Signal, SignalFilter, SignalMode, SignalStructuredOutput, SignalTrigger, SpanExporter, SpanProcessor, SpanType, SqlSchema, SqlSchemaColumn, SqlSchemaEnum, SqlSchemaTable, StringUUID, TextBlockContent, TraceBlockContent, TraceType, TracingLevel, errorMessage };
|
|
593
|
+
export { CachedSpan, CommandBlockContent, DEBUG_SESSION_DIR, DEBUG_SESSION_FILE, Datapoint, Dataset, DebugContext, DebugSessionFile, EvaluationBlockContent, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, LlmProfile, LlmProfileAuth, LlmProfileConfig, LlmProfileProvider, LlmProfileSecretMasks, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionBlock, SessionBlockContent, SessionBlockType, SessionRecordingOptions, Signal, SignalDefinition, SignalFilter, SignalMode, SignalStructuredOutput, SignalTrigger, SignalVersion, SpanExporter, SpanProcessor, SpanType, SqlSchema, SqlSchemaColumn, SqlSchemaEnum, SqlSchemaTable, StringUUID, TextBlockContent, TraceBlockContent, TraceType, TracingLevel, errorMessage };
|
|
500
594
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -263,6 +263,66 @@ interface InitializeOptions {
|
|
|
263
263
|
spanProcessor?: SpanProcessor;
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
|
+
//#region src/llm-profiles.d.ts
|
|
267
|
+
/**
|
|
268
|
+
* Workspace LLM profile wire shapes (`/v1/cli/llm-profiles`, mirrored from
|
|
269
|
+
* app-server's `LlmProfileResponse`). Self-hosted only; on Laminar Cloud every
|
|
270
|
+
* route 404s with `{error: "LLM profiles are not available on this deployment"}`.
|
|
271
|
+
*/
|
|
272
|
+
type LlmProfileProvider = "openai_completions" | "openai_responses" | "gemini" | "bedrock" | "azure_chat_completions" | "azure_responses" | "azure_anthropic" | "custom";
|
|
273
|
+
/**
|
|
274
|
+
* How the profile authenticates. `api_key` for every provider except Bedrock,
|
|
275
|
+
* which takes AWS keys (secret arrives separately in `secrets`) or a bearer
|
|
276
|
+
* token.
|
|
277
|
+
*/
|
|
278
|
+
type LlmProfileAuth = {
|
|
279
|
+
type: "api_key";
|
|
280
|
+
} | {
|
|
281
|
+
type: "aws_keys";
|
|
282
|
+
accessKeyId: string;
|
|
283
|
+
} | {
|
|
284
|
+
type: "bearer_token";
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* Non-secret provider options. The server normalizes per provider: absent
|
|
288
|
+
* fields are omitted on the wire, never `null`.
|
|
289
|
+
*/
|
|
290
|
+
interface LlmProfileConfig {
|
|
291
|
+
auth: LlmProfileAuth;
|
|
292
|
+
/** Bedrock. */
|
|
293
|
+
region?: string;
|
|
294
|
+
/** Azure: exactly one of `resourceId` / `baseUrl`. */
|
|
295
|
+
resourceId?: string;
|
|
296
|
+
/** Azure (alternative to `resourceId`) or `custom` (required). */
|
|
297
|
+
baseUrl?: string;
|
|
298
|
+
/** Azure. */
|
|
299
|
+
apiVersion?: string;
|
|
300
|
+
/** `custom`: header names whose values live in `secrets.headers`. */
|
|
301
|
+
headerNames?: string[];
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* What reads return instead of secrets: a `first3***last3` mask per stored
|
|
305
|
+
* value (fully starred when short) and custom header names only. Absent slots
|
|
306
|
+
* arrive as explicit `null` (the server does not omit them).
|
|
307
|
+
*/
|
|
308
|
+
interface LlmProfileSecretMasks {
|
|
309
|
+
apiKey?: string | null;
|
|
310
|
+
secretAccessKey?: string | null;
|
|
311
|
+
token?: string | null;
|
|
312
|
+
headers: string[];
|
|
313
|
+
}
|
|
314
|
+
interface LlmProfile {
|
|
315
|
+
id: string;
|
|
316
|
+
workspaceId: string;
|
|
317
|
+
name: string;
|
|
318
|
+
provider: LlmProfileProvider;
|
|
319
|
+
config: LlmProfileConfig;
|
|
320
|
+
models: string[];
|
|
321
|
+
secrets: LlmProfileSecretMasks;
|
|
322
|
+
createdAt: string;
|
|
323
|
+
updatedAt: string;
|
|
324
|
+
}
|
|
325
|
+
//#endregion
|
|
266
326
|
//#region src/session-block.d.ts
|
|
267
327
|
/**
|
|
268
328
|
* Shared contract for debugger-session blocks — an ordered list of blocks (see
|
|
@@ -377,6 +437,40 @@ interface Signal {
|
|
|
377
437
|
trigger: SignalTrigger;
|
|
378
438
|
filters: SignalFilter[];
|
|
379
439
|
mode: SignalMode;
|
|
440
|
+
/** Workspace LLM profile id; `null` = runs on the server's env LLM. */
|
|
441
|
+
llmProfileId: string | null;
|
|
442
|
+
/** Display name of `llmProfileId`; `null` alongside it. */
|
|
443
|
+
llmProfileName: string | null;
|
|
444
|
+
/** Model pinned within the profile; `null` alongside `llmProfileId`. */
|
|
445
|
+
model: string | null;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Stored version blob on `GET /signals/{id}/versions`. Schema key is
|
|
449
|
+
* `structuredOutputSchema`, not `structuredOutput` (that name is only on
|
|
450
|
+
* `GET /signals/{id}`). `trigger`/`filters` are stored Filter[] JSON
|
|
451
|
+
* (`signal_triggers.value` / `filters`), not the CLI tagged {@link SignalTrigger}.
|
|
452
|
+
*/
|
|
453
|
+
interface SignalDefinition {
|
|
454
|
+
name: string;
|
|
455
|
+
prompt: string;
|
|
456
|
+
structuredOutputSchema: SignalStructuredOutput;
|
|
457
|
+
trigger: SignalFilter[];
|
|
458
|
+
filters: SignalFilter[];
|
|
459
|
+
mode: SignalMode;
|
|
460
|
+
sampleRate: number | null;
|
|
461
|
+
disabled: boolean;
|
|
462
|
+
/** Both `null` = env-var routing. Cloud signals stay `null`. */
|
|
463
|
+
llmProfileId: string | null;
|
|
464
|
+
llmModel: string | null;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* One historical judge definition. `GET /signals/{id}`'s `version` field is
|
|
468
|
+
* only the current pointer; this is the version log.
|
|
469
|
+
*/
|
|
470
|
+
interface SignalVersion {
|
|
471
|
+
version: number;
|
|
472
|
+
definition: SignalDefinition;
|
|
473
|
+
createdAt: string;
|
|
380
474
|
}
|
|
381
475
|
//#endregion
|
|
382
476
|
//#region src/sql-schema.d.ts
|
|
@@ -426,12 +520,12 @@ interface SqlSchema {
|
|
|
426
520
|
* Pipeline spans are top-level spans created by the pipeline runner.
|
|
427
521
|
* Executor and evaluator spans are top-level spans added automatically when doing evaluations.
|
|
428
522
|
*/
|
|
429
|
-
type SpanType =
|
|
523
|
+
type SpanType = "DEFAULT" | "LLM" | "EXECUTOR" | "EVALUATOR" | "HUMAN_EVALUATOR" | "EVALUATION" | "TOOL" | "CACHED";
|
|
430
524
|
/**
|
|
431
525
|
* Trace types to categorize traces.
|
|
432
526
|
* They are used as association properties passed to all spans in a trace.
|
|
433
527
|
*/
|
|
434
|
-
type TraceType =
|
|
528
|
+
type TraceType = "DEFAULT" | "EVALUATION";
|
|
435
529
|
/**
|
|
436
530
|
* Tracing levels to conditionally disable tracing.
|
|
437
531
|
*
|
|
@@ -496,5 +590,5 @@ type Event = {
|
|
|
496
590
|
value: number | string | null;
|
|
497
591
|
};
|
|
498
592
|
//#endregion
|
|
499
|
-
export { CachedSpan, CommandBlockContent, DEBUG_SESSION_DIR, DEBUG_SESSION_FILE, Datapoint, Dataset, DebugContext, DebugSessionFile, EvaluationBlockContent, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionBlock, SessionBlockContent, SessionBlockType, SessionRecordingOptions, Signal, SignalFilter, SignalMode, SignalStructuredOutput, SignalTrigger, SpanExporter, SpanProcessor, SpanType, SqlSchema, SqlSchemaColumn, SqlSchemaEnum, SqlSchemaTable, StringUUID, TextBlockContent, TraceBlockContent, TraceType, TracingLevel, errorMessage };
|
|
593
|
+
export { CachedSpan, CommandBlockContent, DEBUG_SESSION_DIR, DEBUG_SESSION_FILE, Datapoint, Dataset, DebugContext, DebugSessionFile, EvaluationBlockContent, EvaluationDatapoint, EvaluationDatapointDatasetLink, Event, GetDatapointsResponse, InitEvaluationResponse, InitializeOptions, LaminarSpanContext, LlmProfile, LlmProfileAuth, LlmProfileConfig, LlmProfileProvider, LlmProfileSecretMasks, MaskInputOptions, PushDatapointsResponse, SemanticSearchResponse, SemanticSearchResult, SessionBlock, SessionBlockContent, SessionBlockType, SessionRecordingOptions, Signal, SignalDefinition, SignalFilter, SignalMode, SignalStructuredOutput, SignalTrigger, SignalVersion, SpanExporter, SpanProcessor, SpanType, SqlSchema, SqlSchemaColumn, SqlSchemaEnum, SqlSchemaTable, StringUUID, TextBlockContent, TraceBlockContent, TraceType, TracingLevel, errorMessage };
|
|
500
594
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 |
|
|
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;;AACF,EAAA,CAAA,CAAA;;;ACjCA,MAAa,gBAAgB,UAC3B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmnr-ai/types",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.46",
|
|
4
4
|
"description": "Shared types for Laminar AI SDK",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -41,8 +41,6 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
|
-
"build": "tsdown"
|
|
45
|
-
"lint": "eslint",
|
|
46
|
-
"lint:fix": "eslint --fix"
|
|
44
|
+
"build": "tsdown"
|
|
47
45
|
}
|
|
48
46
|
}
|