evalution 1.0.7 → 2.0.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.
Files changed (26) hide show
  1. package/LICENSING.md +26 -44
  2. package/dist/{check-BTg6THHB.d.ts → check-ci7RhMcB.d.ts} +21 -848
  3. package/dist/checks/index.d.ts +2 -1
  4. package/dist/cli/index.js +257 -77
  5. package/dist/client/assets/DatasetView-BqSWI_pm.js +15 -0
  6. package/dist/client/assets/EvalRunView-CR6ZksSu.js +2 -0
  7. package/dist/client/assets/EvalView-JPEM5IY8.js +1 -0
  8. package/dist/client/assets/{data-grid-overlay-editor-CBVV2omk.js → data-grid-overlay-editor-B_nPhXKR.js} +1 -1
  9. package/dist/client/assets/{highlighted-body-KPVGNVTW-BqsjUFPI.js → highlighted-body-KPVGNVTW-dPpneB8R.js} +1 -1
  10. package/dist/client/assets/{index-B7OFMd2c.css → index-BGcZZetP.css} +1 -1
  11. package/dist/client/assets/{index-DOmAST6D.js → index-CwjMcK6S.js} +137 -137
  12. package/dist/client/assets/{number-overlay-editor-DhCVhD05.js → number-overlay-editor-CRWFlaQs.js} +1 -1
  13. package/dist/client/index.html +2 -2
  14. package/dist/{dataset-types-CSjbM_Vz.d.ts → dataset-types-8cDpOFYi.d.ts} +6 -236
  15. package/dist/index.d.ts +302 -1279
  16. package/dist/index.js +148 -485
  17. package/dist/{trace-Dn6Pfcc5.d.ts → trace-BlnjMp7o.d.ts} +2 -1
  18. package/dist/{trace-event-ingestor-DI-HkA4Q.js → trace-event-ingestor-DwI1hxGX.js} +2471 -8458
  19. package/dist/views/datasets/index.d.ts +1 -1
  20. package/dist/views/index.d.ts +3 -2
  21. package/dist/views/index.js +0 -4
  22. package/dist/views/react/index.d.ts +1 -1
  23. package/package.json +19 -16
  24. package/dist/client/assets/DatasetView-CWw3B_XI.js +0 -15
  25. package/dist/client/assets/EvalRunView-DJNSAydj.js +0 -2
  26. package/dist/client/assets/EvalView-R0Nkikzs.js +0 -1
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { $ as NormalizedPromptBase, $t as TraceCheckResult, A as DatasetRowsOverview, An as TraceWithSpans, At as EvalArm, B as ChatPromptUpdates, Bt as EvalInputs, C as DatasetFieldShape, Cn as TraceChangeEvent, Ct as ValueCatalogPreset, D as DatasetRow, Dn as TraceProviderInfo, Dt as VariationInfo, E as DatasetProviderInfo, En as TraceLiveEvent, Et as VariationId, F as KnownColumnSpec, Ft as EvalCheckOutcome, G as ExecutionInput, Gt as EvalRun, H as ConflictChoices, Ht as EvalResults, I as AddPromptContext, It as EvalCheckResult, J as InputLayout, Jt as EvalRunSummary, K as ExtractedProps, Kt as EvalRunProgress, L as AddPromptField, Lt as EvalCounts, M as ColumnPath, Mn as spanMessages, Mt as EvalChangeEvent, N as DatasetColumnSpec, Nt as EvalChangeType, O as DatasetRowSource, On as TraceStreamEvent, Ot as VersionId, P as ForeignColumnSpec, Pt as EvalCheck, Q as NormalizedPrompt, Qt as NewEvalRun, R as CalleeBinding, Rt as EvalDefinition, S as DatasetField, Sn as Trace, St as ValueCatalogGroup, T as DatasetPathChild, Tn as TraceEvalRun, Tt as VariationConflict, U as ExecuteRequest, Ut as EvalRowResult, V as CheckInfo, Vt as EvalProviderInfo, W as ExecuteResponse, Wt as EvalRowStatus, X as NormalizedMessage, Xt as EvalTraceRun, Y as NormalizedChatPrompt, Yt as EvalSummary, Z as NormalizedParameter, Zt as NewEvalDefinition, _ as isStandardSchema, _n as SpanMessageRole, _t as ResourceScope, a as check, an as AnnotationSource, at as PromptChangeEvent, b as DatasetChangeEvent, bn as SpanToolResultPart, bt as UpdatePromptResponse, c as ResolvedResourceInputs, cn as LLMSpanDetails, ct as PromptRef, d as ResourceInput, dn as SERVICE_NAME_ATTRIBUTE, dt as PropType, en as Annotation, et as NormalizedPromptUpdates, f as ResourceInputs, fn as Span, ft as PropValue, g as isResource, gn as SpanMessage, gt as ResourceInstanceInput, h as StaticResourceDefinition, hn as SpanKind, ht as ResourceInfo, i as CheckRun, in as AnnotationKind, it as PendingConflicts, j as DatasetSummary, jn as isCheckSpan, jt as EvalArmSpec, k as DatasetRowUpdate, kn as TraceSummary, kt as VersionInfo, l as Resource, ln as PLAYGROUND_ENVIRONMENT, lt as PromptStyle, m as ResourceOutputDefinition, mn as SpanImagePart, mt as RebaseResult, n as CheckDefinition, nn as AnnotationEvent, nt as NormalizedToolCall, o as isCheck, on as CHECK_ATTRIBUTE, ot as PromptInputSources, p as ResourceInstance, pn as SpanContentPart, pt as QuestionsPromptUpdates, q as FieldValues, qt as EvalRunStatus, r as CheckOutcome, rn as AnnotationEventOp, rt as ParsedPrompt, s as DynamicResourceDefinition, sn as DEPLOYMENT_ENVIRONMENT_ATTRIBUTE, st as PromptProviderInfo, t as Check, tn as AnnotationChanges, tt as NormalizedQuestionsPrompt, u as ResourceDefinition, un as PromptID, ut as PropDefinition, v as resource, vn as SpanTextPart, vt as RunResources, w as DatasetInstanceShape, wn as TraceChangeType, wt as ValueFactory, x as DatasetChangeType, xn as ToolSpanDetails, xt as ValueCatalog, y as Dataset, yn as SpanToolCallPart, yt as SourceSpan, z as ChangeEventType, zt as EvalDefinitionPatch } from "./check-BTg6THHB.js";
2
- import { AttributeValue, Attributes, Tracer } from "@opentelemetry/api";
3
- import { PropDefinition as PropDefinition$1, PropValue as PropValue$1, ValueFactory as ValueFactory$1 } from "ts-proppy";
1
+ import { $ as FieldValues, $t as VariationConflict, A as DatasetRowsOverview, At as SpanImagePart, B as AnnotationEvent, Bt as TraceChangeEvent, C as DatasetFieldShape, Cn as EvalSummary, Ct as ResourceInfo, D as DatasetRow, Dn as TraceCheckResult, Dt as SourceSpan, E as DatasetProviderInfo, En as NewEvalRun, Et as RunResources, F as KnownColumnSpec, Ft as SpanTextPart, G as ChangeEventType, Gt as TraceStreamEvent, H as AnnotationKind, Ht as TraceEvalRun, I as AddPromptContext, It as SpanToolCallPart, J as ConflictChoices, Jt as UpdatePromptResponse, K as ChatPromptUpdates, Kt as TraceSummary, L as AddPromptField, Lt as SpanToolResultPart, M as ColumnPath, Mt as SpanMessage, N as DatasetColumnSpec, Nt as SpanMessageRole, O as DatasetRowSource, Ot as Span, P as ForeignColumnSpec, Pt as SpanReasoningPart, Q as ExtractedProps, Qt as ValueFactory, R as Annotation, Rt as ToolSpanDetails, S as DatasetField, Sn as EvalRunSummary, St as RebaseResult, T as DatasetPathChild, Tn as NewEvalDefinition, Tt as ResourceScope, U as AnnotationSource, Ut as TraceLiveEvent, V as AnnotationEventOp, Vt as TraceChangeType, W as CalleeBinding, Wt as TraceProviderInfo, X as ExecuteResponse, Xt as ValueCatalogGroup, Y as ExecuteRequest, Yt as ValueCatalog, Z as ExecutionInput, Zt as ValueCatalogPreset, _ as isStandardSchema, _n as EvalRowResult, _t as PromptStyle, a as check, an as EvalArmSpec, at as NormalizedPrompt, b as DatasetChangeEvent, bn as EvalRunProgress, bt as PropValue, c as ResolvedResourceInputs, cn as EvalCheck, ct as NormalizedQuestionsPrompt, d as ResourceInput, dn as EvalCounts, dt as PendingConflicts, en as VariationId, et as InputLayout, f as ResourceInputs, fn as EvalDefinition, ft as PromptChangeEvent, g as isResource, gn as EvalResults, gt as PromptRef, h as StaticResourceDefinition, hn as EvalProviderInfo, ht as PromptProviderInfo, i as CheckRun, in as EvalArm, it as NormalizedParameter, j as DatasetSummary, jt as SpanKind, k as DatasetRowUpdate, kt as SpanContentPart, l as Resource, ln as EvalCheckOutcome, lt as NormalizedToolCall, m as ResourceOutputDefinition, mn as EvalInputs, mt as PromptInputSources, n as CheckDefinition, nn as VersionId, nt as NormalizedChatPrompt, o as isCheck, on as EvalChangeEvent, ot as NormalizedPromptBase, p as ResourceInstance, pn as EvalDefinitionPatch, pt as PromptID, q as CheckInfo, qt as TraceWithSpans, r as CheckOutcome, rn as VersionInfo, rt as NormalizedMessage, s as DynamicResourceDefinition, sn as EvalChangeType, st as NormalizedPromptUpdates, t as Check, tn as VariationInfo, tt as LLMSpanDetails, u as ResourceDefinition, un as EvalCheckResult, ut as ParsedPrompt, v as resource, vn as EvalRowStatus, vt as PropDefinition, w as DatasetInstanceShape, wn as EvalTraceRun, wt as ResourceInstanceInput, x as DatasetChangeType, xn as EvalRunStatus, xt as QuestionsPromptUpdates, y as Dataset, yn as EvalRun, yt as PropType, z as AnnotationChanges, zt as Trace } from "./check-ci7RhMcB.js";
2
+ import { Tracer } from "@opentelemetry/api";
3
+ import { PropDefinition as PropDefinition$1, PropValue as PropValue$1 } from "ts-proppy";
4
+ import { Annotation as Annotation$1, AnnotationChanges as AnnotationChanges$1, AnnotationEvent as AnnotationEvent$1, AnnotationEventOp as AnnotationEventOp$1, BaseTraceIngestor, BaseTraceIngestor as BaseTraceIngestor$1, CHECK_ATTRIBUTE, DEPLOYMENT_ENVIRONMENT_ATTRIBUTE, Evalution, EvalutionOptions, HttpTraceSink, HttpTraceSinkOptions, HttpTraceTarget, PLAYGROUND_ENVIRONMENT, PLAYGROUND_RESOURCE, PROMPT_ID_ATTRIBUTE, PROMPT_INPUTS_ATTRIBUTE, PROMPT_NAME_ATTRIBUTE, PROMPT_PROVIDER_ID_ATTRIBUTE, PROMPT_VARIATION_ATTRIBUTE, PROMPT_VERSION_ATTRIBUTE, PromptID as PromptID$1, PromptSpanInfo, PromptsFactory, PromptsHelper, PromptsHelperOptions, SERVICE_NAME_ATTRIBUTE, SPAN_KIND_ATTRIBUTE, Span as Span$1, TRACE_EVENTS_PATH, Trace as Trace$1, TraceChangeEvent as TraceChangeEvent$1, TraceEventsRequest, TraceIngestor, TraceIngestor as TraceIngestor$1, TraceSink, TraceSink as TraceSink$1, TraceSinkEvent, TraceSinkEvent as TraceSinkEvent$1, TraceStreamEvent as TraceStreamEvent$1, TraceSummary as TraceSummary$1, TraceWithSpans as TraceWithSpans$1, createTracerForPrompt, getPromptSpanAttributes, isCheckSpan, mergePromptIdentity, spanMessages } from "@evalution/sdk";
4
5
  import { Database } from "@tursodatabase/sync";
5
6
  import { migrateAsync } from "drizzle-orm/sqlite-core/async/session";
7
+ import { ExecuteConfigOptions, ExecutionHandle, FactoriesProbe, ProbeResult, ProbeResult as ProbeResult$1, ProbeResults, ProbeResults as ProbeResults$1, SDKAdapter, SDKAdapter as SDKAdapter$1, TypeExpressionProbe, TypeProbe, TypeProbe as TypeProbe$1, assertUpdateStyle } from "@evalution/sdk/adapter";
6
8
  import { StandardSchemaV1 } from "@standard-schema/spec";
7
9
  import { MigrationMeta } from "drizzle-orm/migrator";
8
- import { Questions, SystemOneRequest, SystemOneResult } from "@typesafe-ai/sdk";
9
- import { Telemetry } from "ai";
10
10
  import { SpanProcessor } from "@opentelemetry/sdk-trace-base";
11
11
 
12
12
  //#region src/cli/fresh-import-hook.d.ts
@@ -96,7 +96,7 @@ interface CreateDatasetInput {
96
96
  /** The schema. Ids are minted by the provider. */
97
97
  fields: Omit<DatasetField, "id">[];
98
98
  /** The prompt this dataset is created from, if any. */
99
- prompt?: PromptID;
99
+ prompt?: PromptID$1;
100
100
  }
101
101
  /**
102
102
  * Which rows {@link DatasetProvider.listRows} returns: a window onto the
@@ -312,416 +312,6 @@ interface EvalProvider {
312
312
  watch?(callback: (event: EvalChangeEvent) => void): () => void;
313
313
  }
314
314
  //#endregion
315
- //#region src/trace/prompt-tracer.d.ts
316
- interface PromptsHelperOptions {
317
- /**
318
- * Globally-unique stable identifier for this group of prompts.
319
- */
320
- readonly id: string;
321
- }
322
- type PromptsFactory<Args extends any[] = never[], Prompt = unknown> = (...args: Args) => Record<string, (...args: any[]) => Prompt>;
323
- /**
324
- * Intended to be used in the `satisfies` clause of a `prompts` export from an
325
- * SDK adapter package.
326
- */
327
- type PromptsHelper = (opts: PromptsHelperOptions, factory: PromptsFactory<any[], any>) => PromptsFactory<any[], any>;
328
- /**
329
- * Attribute name a span can set to pick one of evalution's span-kind values
330
- * (`'LLM'`, `'TOOL'`, `'AGENT'`, `'EMBEDDING'`, `'DEFAULT'`). Falls back to
331
- * `'DEFAULT'` when absent or unrecognised.
332
- */
333
- declare const SPAN_KIND_ATTRIBUTE = "evalution.span.type";
334
- /**
335
- * Attribute name a span can set to give a human-readable name to the prompt.
336
- */
337
- declare const PROMPT_NAME_ATTRIBUTE = "gen_ai.prompt.name";
338
- /**
339
- * Attribute name a span can set to link itself to a specific prompt. The value
340
- * is a globally-unique prompt ID unless {@link PROMPT_PROVIDER_ID_ATTRIBUTE} is
341
- * also set, in which case it is scoped to that provider.
342
- */
343
- declare const PROMPT_ID_ATTRIBUTE = "evalution.prompt.id";
344
- /**
345
- * Attribute name a span can set to scope its {@link PROMPT_ID_ATTRIBUTE} to a
346
- * specific prompt provider. When absent, the prompt ID is treated as global.
347
- */
348
- declare const PROMPT_PROVIDER_ID_ATTRIBUTE = "evalution.prompt.provider.id";
349
- /**
350
- * Attribute name a span can set to include an array of input parameters used
351
- * to construct the final prompt.
352
- */
353
- declare const PROMPT_INPUTS_ATTRIBUTE = "evalution.prompt.inputs";
354
- /**
355
- * Attribute name a span can set to record which version of its prompt ran —
356
- * for a file-based prompt, the commit checked out, when nothing was
357
- * uncommitted.
358
- */
359
- declare const PROMPT_VERSION_ATTRIBUTE = "evalution.prompt.version";
360
- /**
361
- * Attribute name a span can set to record which variation of its prompt ran,
362
- * on top of its {@link PROMPT_VERSION_ATTRIBUTE}.
363
- */
364
- declare const PROMPT_VARIATION_ATTRIBUTE = "evalution.prompt.variation";
365
- interface PromptSpanInfo {
366
- /** Globally-unique prompt id (e.g. `${groupId}#${name}`). */
367
- id?: string;
368
- /** Human-readable prompt name. */
369
- name: string;
370
- /**
371
- * Positional arguments the prompt function was called with.
372
- *
373
- * Only the `prompts()` helper records these, because it is the only caller
374
- * that sees the arguments and nothing else. A playground run records
375
- * {@link functionInputs} instead: its arguments may include a live database
376
- * handle, which is neither serializable nor the thing a replay needs.
377
- */
378
- functionParameters?: unknown[];
379
- /**
380
- * The unresolved inputs this run was launched with — the *recipe* rather
381
- * than the resolution.
382
- *
383
- * This is what makes a past run replayable. A resolved value cannot be
384
- * recorded faithfully (a live handle does not serialize) and would not be
385
- * the right thing to record anyway: replaying a resource means running its
386
- * `create()` again, which is the recipe, not the value it produced last
387
- * time. Each entry is JSON-safe by construction.
388
- */
389
- functionInputs?: unknown[];
390
- /** The unresolved execute-parameter inputs, keyed by parameter name. */
391
- executeInputs?: Record<string, unknown>;
392
- /**
393
- * The run's named resource instances, by name, each with the receipt its
394
- * `create()` produced. See `specs/resource-instances.md` §F.
395
- */
396
- resources?: Record<string, unknown>;
397
- /**
398
- * The prompt's parameter definitions as they stood when the run was
399
- * launched, recorded beside the inputs.
400
- *
401
- * For a file-based prompt git is the version, and the playground has no
402
- * business checking out old commits to replay one — so writing the shape
403
- * down at run time is the cheap equivalent. A later replay diffs two known
404
- * signatures instead of guessing whether the recorded inputs still fit.
405
- */
406
- parameterDefinitions?: unknown[];
407
- /**
408
- * The prompt's execute-parameter definitions, recorded for the same reason
409
- * as {@link parameterDefinitions}: without them an entry of
410
- * {@link executeInputs} has a name but no type.
411
- */
412
- executeParameterDefinitions?: unknown[];
413
- /** The version the run executed against. See {@link PROMPT_VERSION_ATTRIBUTE}. */
414
- version?: string;
415
- /** The variation the run applied. See {@link PROMPT_VARIATION_ATTRIBUTE}. */
416
- variation?: string;
417
- }
418
- /**
419
- * `identity` with any field it leaves unset filled from `fallback`.
420
- *
421
- * A config built by the `prompts()` helper carries an identity of its own —
422
- * the one to keep, since its id is the global one — but only the playground
423
- * knows what the run was launched with and against which version.
424
- */
425
- declare function mergePromptIdentity(identity: PromptSpanInfo | undefined, fallback: PromptSpanInfo | undefined): PromptSpanInfo | undefined;
426
- /**
427
- * Build the attributes that associate a span with a prompt.
428
- *
429
- * @param prompt - The prompt to attribute the span to.
430
- * @param attributes - Attributes to merge in; these take precedence.
431
- * @param includeInputs - Whether to stamp the run's inputs. Inputs belong on
432
- * the **root span only**: they are identical on every span of a trace, so
433
- * repeating them is invisible when the input is `["Ada"]` and wasteful when
434
- * it is a fifty-message thread — multiplied by span count, then persisted.
435
- */
436
- declare function getPromptSpanAttributes(prompt: PromptSpanInfo, attributes?: Attributes, includeInputs?: boolean): Record<string, AttributeValue>;
437
- /**
438
- * Wraps a {@link Tracer} so that every span it produces is tagged with the
439
- * attributes that associate it with a prompt — the prompt's name
440
- * ({@link PROMPT_NAME_ATTRIBUTE}), an optional global prompt ID
441
- * ({@link PROMPT_ID_ATTRIBUTE}), and an `'LLM'` span kind
442
- * ({@link SPAN_KIND_ATTRIBUTE}). Attributes set explicitly on an individual
443
- * span take precedence over these defaults.
444
- *
445
- * This depends only on `@opentelemetry/api`, so it can be re-used by SDK
446
- * adapter packages (e.g. `@evalution/vercel-ai-sdk`) without pulling in the
447
- * rest of evalution.
448
- *
449
- * @param prompt - The prompt to attribute spans to. `name` is a human-readable
450
- * name; the optional `id` is a globally-unique prompt ID used to resolve
451
- * runtime traces back to the prompt.
452
- * @param tracer - Tracer to wrap. Defaults to a tracer from the globally
453
- * registered tracer provider.
454
- * @returns A tracer that forwards to `tracer` while attaching the prompt
455
- * attributes to each span it creates.
456
- */
457
- declare function createTracerForPrompt(prompt: PromptSpanInfo, tracer?: Tracer): Tracer;
458
- //#endregion
459
- //#region src/trace/trace-provider.d.ts
460
- /**
461
- * A read-only store of execution traces that the playground can display and
462
- * subscribe to in real time. Implement this interface to integrate a tracing
463
- * backend.
464
- *
465
- * `TraceProvider` is a pure read interface — populating the store is the job
466
- * of a `TraceIngestor`, which feeds normalized spans into the provider's
467
- * write side (`TraceSink`, implemented by `BaseTraceProvider`).
468
- */
469
- interface TraceProvider {
470
- /**
471
- * Uniquely identifies this instance, even when multiple providers of the
472
- * same type are used.
473
- */
474
- readonly id: string;
475
- /** Human-readable name shown when choosing between providers. */
476
- readonly displayName?: string;
477
- /** Short description of what this provider offers. */
478
- readonly description?: string;
479
- /**
480
- * Returns compact summaries for every trace known to this provider, newest
481
- * first. Used to populate the Traces sidebar.
482
- */
483
- getAllTraces(): Promise<TraceSummary[]>;
484
- /**
485
- * Returns the trace with the given ID together with all of its spans, or
486
- * `undefined` when the trace is unknown.
487
- */
488
- getTrace(traceId: string): Promise<TraceWithSpans | undefined>;
489
- /**
490
- * Subscribes to real-time updates for a specific trace. The callback is
491
- * invoked for every {@link Span} change on this trace, for as long as the
492
- * returned cleanup function has not been called.
493
- *
494
- * Optional — providers that cannot track live changes may omit it.
495
- *
496
- * @returns A no-argument function that cancels the subscription.
497
- */
498
- subscribeTrace?(traceId: string, callback: (event: TraceStreamEvent) => void): () => void;
499
- /**
500
- * Registers a callback invoked whenever a trace is added, updated, or
501
- * removed. Used by the sidebar to stay in sync without polling.
502
- *
503
- * Optional — providers that cannot detect live changes may omit it.
504
- *
505
- * @returns A no-argument function that unregisters the watcher.
506
- */
507
- watch?(callback: (event: TraceChangeEvent) => void): () => void;
508
- /**
509
- * Permanently deletes a trace along with its spans and annotations, and
510
- * notifies {@link watch}ers with a `remove` event. Returns `false` if the trace
511
- * doesn't exist.
512
- *
513
- * Optional — a provider backed by a read-only source omits it, and the REST
514
- * route in `src/server/api-routes.ts` treats its absence as "not
515
- * supported" (405).
516
- */
517
- deleteTrace?(traceId: string): Promise<boolean>;
518
- /**
519
- * Runs one read-only SQL query (a `SELECT`) against this provider's
520
- * store and returns the rows — the ad-hoc counterpart to
521
- * {@link getAllTraces}, for questions a summary can't answer. The schema the
522
- * query is written against is {@link getQuerySchema}'s. Writes are refused.
523
- *
524
- * Optional — a provider not backed by SQL omits it, and the REST and MCP
525
- * handlers report "not supported".
526
- */
527
- query?(sql: string, options?: SqlQueryOptions): Promise<SqlQueryResult>;
528
- /**
529
- * Describes the tables {@link query} runs against, as annotated SQL DDL.
530
- * Present exactly when {@link query} is.
531
- */
532
- getQuerySchema?(): string;
533
- /** Lists every annotation on a trace, oldest first. */
534
- listAnnotations?(traceId: string): Promise<Annotation[]>;
535
- /** Creates a new annotation, minting its `id`/`createdAt`. */
536
- createAnnotation?(input: Omit<Annotation, "id" | "createdAt">): Promise<Annotation>;
537
- /**
538
- * Changes an annotation's `kind` and/or `note`, returning it as updated, or
539
- * `undefined` if it doesn't exist.
540
- */
541
- updateAnnotation?(id: string, changes: AnnotationChanges): Promise<Annotation | undefined>;
542
- /** Deletes an annotation by id. A no-op if it doesn't exist. */
543
- deleteAnnotation?(id: string): Promise<void>;
544
- /**
545
- * Subscribes to annotation changes on a specific trace — the counterpart
546
- * to {@link subscribeTrace} that a client's per-trace SSE connection also
547
- * opens, so both ride the same stream. Callers (the annotation REST
548
- * handlers) invoke {@link emitAnnotation} after a successful
549
- * create/update/delete; this only delivers what's explicitly emitted.
550
- *
551
- * @returns A no-argument function that cancels the subscription.
552
- */
553
- subscribeAnnotations?(traceId: string, callback: (event: AnnotationEvent) => void): () => void;
554
- /**
555
- * Notifies this trace's {@link subscribeAnnotations} subscribers of an
556
- * annotation change. Called by the annotation REST handlers immediately
557
- * after {@link createAnnotation}/{@link updateAnnotation}/{@link deleteAnnotation}
558
- * succeeds — the
559
- * provider itself never calls this on its own.
560
- */
561
- emitAnnotation?(traceId: string, op: AnnotationEventOp, annotation: Annotation): void;
562
- }
563
- //#endregion
564
- //#region src/trace/trace-sink.d.ts
565
- /**
566
- * The write side of a {@link TraceProvider}. A {@link TraceIngestor} feeds
567
- * normalized spans in; the sink owns root detection, trace creation, and
568
- * event emission.
569
- */
570
- interface TraceSink {
571
- /**
572
- * Records a span start. Creates a `running` trace for a new root. Returns
573
- * the stored (merged) span. Emits `span-start` (+ watch `add` for a new
574
- * trace).
575
- */
576
- recordSpanStart(span: Span): Promise<Span>;
577
- /**
578
- * Records a span end. For a root span, finalizes the trace and emits
579
- * `trace-end` (+ watch `update`). Returns the stored (merged) span.
580
- */
581
- recordSpanEnd(span: Span): Promise<Span>;
582
- /**
583
- * Finalizes a trace as `error` when execution fails before any span is
584
- * produced (e.g. a bad model id throws before `onStart`).
585
- */
586
- failTrace(traceId: string, errorMessage: string): Promise<void>;
587
- /**
588
- * Optional: resolves once everything recorded so far has been delivered,
589
- * for a sink that records in the background (e.g. `HttpTraceSink`).
590
- */
591
- flush?(): Promise<void>;
592
- }
593
- /**
594
- * Source-agnostic base class for a {@link TraceProvider}. Owns storage
595
- * delegation, subscriptions, watchers, and the generic trace lifecycle that
596
- * every concrete provider shares, regardless of how spans are produced.
597
- *
598
- * Subclasses implement the abstract storage hooks; ingestion is handled by
599
- * one or more {@link TraceIngestor}s that call {@link recordSpanStart} /
600
- * {@link recordSpanEnd} / {@link failTrace} on this instance (via
601
- * {@link TraceSink}).
602
- */
603
- declare abstract class BaseTraceProvider implements TraceProvider, TraceSink {
604
- readonly id: string;
605
- readonly displayName?: string;
606
- readonly description?: string;
607
- protected subscribers: Map<string, Set<(event: TraceStreamEvent) => void>>;
608
- private watchers;
609
- private annotationSubscribers;
610
- constructor(options: {
611
- id: string;
612
- displayName: string;
613
- description: string;
614
- });
615
- abstract getAllTraces(): Promise<TraceSummary[]>;
616
- abstract hasTrace(traceId: string): Promise<boolean>;
617
- protected abstract getTraceWithoutSpans(traceId: string): Promise<Trace | undefined>;
618
- protected abstract getTraceSpans(traceId: string): Promise<Span[]>;
619
- protected abstract addOrUpdateTrace(trace: Trace): Promise<void>;
620
- /**
621
- * Removes a trace together with its spans and annotations. Only called for
622
- * a trace that {@link hasTrace} confirmed exists.
623
- */
624
- protected abstract removeTrace(traceId: string): Promise<void>;
625
- /**
626
- * Stores a span, merging it into any existing span with the same ID (via
627
- * the `mergeSpans` helper). Returns the resulting stored span so callers
628
- * can stream the merged view rather than the partial snapshot they passed
629
- * in.
630
- */
631
- protected abstract addOrUpdateSpan(span: Span): Promise<Span>;
632
- getTrace(traceId: string): Promise<TraceWithSpans | undefined>;
633
- deleteTrace(traceId: string): Promise<boolean>;
634
- subscribeTrace(traceId: string, callback: (event: TraceStreamEvent) => void): () => void;
635
- watch(callback: (event: TraceChangeEvent) => void): () => void;
636
- /**
637
- * Generic pub-sub for annotation changes — every subclass gets a working
638
- * implementation "for free", even one with no annotation store of its own
639
- * (e.g. `MemoryTraceProvider`): nothing is ever delivered unless a caller
640
- * (the annotation REST handlers) explicitly calls {@link emitAnnotation}.
641
- */
642
- subscribeAnnotations(traceId: string, callback: (event: AnnotationEvent) => void): () => void;
643
- emitAnnotation(traceId: string, op: AnnotationEventOp, annotation: Annotation): void;
644
- recordSpanStart(span: Span): Promise<Span>;
645
- recordSpanEnd(span: Span): Promise<Span>;
646
- /**
647
- * Marks a trace that already ended as running again: its root span has just
648
- * been started anew (a failed run being retried), so the failure it recorded
649
- * is no longer its state.
650
- */
651
- private reopenTrace;
652
- failTrace(traceId: string, errorMessage: string): Promise<void>;
653
- protected emitStream(traceId: string, event: TraceStreamEvent): void;
654
- protected emitChange(event: TraceChangeEvent): void;
655
- }
656
- //#endregion
657
- //#region src/trace/trace-ingestor.d.ts
658
- /**
659
- * A source of trace data. Translates some upstream signal (OTel spans, native
660
- * AI SDK telemetry, an external collector) into normalized {@link Span}s and
661
- * feeds the {@link TraceSink}(s) it is connected to.
662
- */
663
- interface TraceIngestor {
664
- /**
665
- * Add a sink. May be called multiple times; the ingestor writes to every
666
- * added sink.
667
- */
668
- addSink(sink: TraceSink): void;
669
- /**
670
- * Remove a previously-added sink. Returns `true` if the given sink was found
671
- * and removed, otherwise `false`.
672
- */
673
- removeSink(sink: TraceSink): boolean;
674
- /**
675
- * Optional: returns true if `other` is made redundant by this ingestor and
676
- * should be excluded from the collected set. The decision may depend on
677
- * this ingestor's own configuration. Used by the server to consolidate
678
- * overlapping ingestors — e.g. `OTelTraceIngestor` reports any other
679
- * `OTelTraceIngestor` redundant because OTel is a single process-global
680
- * pipeline.
681
- */
682
- isRedundant?(other: TraceIngestor): boolean;
683
- /**
684
- * Optional: sets the resource attributes merged into every span this
685
- * ingestor records from now on, over whatever resource the source itself
686
- * reported. The server stamps {@link PLAYGROUND_RESOURCE} on the ingestors
687
- * that record its own runs.
688
- */
689
- setResource?(resource: Record<string, unknown>): void;
690
- }
691
- /**
692
- * The resource of every run evalution itself makes — from the playground, an
693
- * eval, or an MCP client — as opposed to one an app exported to it.
694
- */
695
- declare const PLAYGROUND_RESOURCE: Readonly<Record<string, string>>;
696
- /**
697
- * Base class that holds the added sinks and fans each normalized record out
698
- * to all of them. Concrete ingestors translate their source into
699
- * {@link Span}/{@link Trace} records and call these protected helpers.
700
- */
701
- declare abstract class BaseTraceIngestor implements TraceIngestor {
702
- protected sinks: TraceSink[];
703
- private resource?;
704
- /** Recordings still under way, which {@link flush} waits out. */
705
- private pending;
706
- setResource(resource: Record<string, unknown>): void;
707
- /** `span` with this ingestor's resource, if it has one, merged into its own. */
708
- private withResource;
709
- addSink(sink: TraceSink): void;
710
- removeSink(sink: TraceSink): boolean;
711
- /**
712
- * Resolves once everything recorded so far has reached every sink and been
713
- * delivered by those that deliver in the background. Await it before a
714
- * short-lived process (a script, a serverless function) exits, so no trace
715
- * data is lost.
716
- */
717
- flush(): Promise<void>;
718
- /** Registers `recording` for {@link flush} to wait out, and returns it. */
719
- private track;
720
- protected recordSpanStart(span: Span): Promise<void>;
721
- protected recordSpanEnd(span: Span): Promise<void>;
722
- protected failTrace(traceId: string, msg: string): Promise<void>;
723
- }
724
- //#endregion
725
315
  //#region src/shared/input-references.d.ts
726
316
  /**
727
317
  * One place an input can be plugged in: a prompt's parameter, or any slot
@@ -1676,7 +1266,7 @@ interface PromptProvider<TPrompt extends NormalizedPrompt = NormalizedPrompt> {
1676
1266
  *
1677
1267
  * Optional — providers with no tracing support may omit it.
1678
1268
  */
1679
- setupTraceIngestion?(): Promise<TraceIngestor | undefined>;
1269
+ setupTraceIngestion?(): Promise<TraceIngestor$1 | undefined>;
1680
1270
  /**
1681
1271
  * Returns the definition of the model slot for this provider's underlying
1682
1272
  * SDK, catalogs included, for prompts of the given style. See
@@ -1731,6 +1321,112 @@ interface PromptProvider<TPrompt extends NormalizedPrompt = NormalizedPrompt> {
1731
1321
  readonly variations?: PromptVariations;
1732
1322
  }
1733
1323
  //#endregion
1324
+ //#region src/trace/trace-provider.d.ts
1325
+ /**
1326
+ * A read-only store of execution traces that the playground can display and
1327
+ * subscribe to in real time. Implement this interface to integrate a tracing
1328
+ * backend.
1329
+ *
1330
+ * `TraceProvider` is a pure read interface — populating the store is the job
1331
+ * of a `TraceIngestor`, which feeds normalized spans into the provider's
1332
+ * write side (`TraceSink`, implemented by `BaseTraceProvider`).
1333
+ */
1334
+ interface TraceProvider {
1335
+ /**
1336
+ * Uniquely identifies this instance, even when multiple providers of the
1337
+ * same type are used.
1338
+ */
1339
+ readonly id: string;
1340
+ /** Human-readable name shown when choosing between providers. */
1341
+ readonly displayName?: string;
1342
+ /** Short description of what this provider offers. */
1343
+ readonly description?: string;
1344
+ /**
1345
+ * Returns compact summaries for every trace known to this provider, newest
1346
+ * first. Used to populate the Traces sidebar.
1347
+ */
1348
+ getAllTraces(): Promise<TraceSummary[]>;
1349
+ /**
1350
+ * Returns the trace with the given ID together with all of its spans, or
1351
+ * `undefined` when the trace is unknown.
1352
+ */
1353
+ getTrace(traceId: string): Promise<TraceWithSpans | undefined>;
1354
+ /**
1355
+ * Subscribes to real-time updates for a specific trace. The callback is
1356
+ * invoked for every {@link Span} change on this trace, for as long as the
1357
+ * returned cleanup function has not been called.
1358
+ *
1359
+ * Optional — providers that cannot track live changes may omit it.
1360
+ *
1361
+ * @returns A no-argument function that cancels the subscription.
1362
+ */
1363
+ subscribeTrace?(traceId: string, callback: (event: TraceStreamEvent) => void): () => void;
1364
+ /**
1365
+ * Registers a callback invoked whenever a trace is added, updated, or
1366
+ * removed. Used by the sidebar to stay in sync without polling.
1367
+ *
1368
+ * Optional — providers that cannot detect live changes may omit it.
1369
+ *
1370
+ * @returns A no-argument function that unregisters the watcher.
1371
+ */
1372
+ watch?(callback: (event: TraceChangeEvent) => void): () => void;
1373
+ /**
1374
+ * Permanently deletes a trace along with its spans and annotations, and
1375
+ * notifies {@link watch}ers with a `remove` event. Returns `false` if the trace
1376
+ * doesn't exist.
1377
+ *
1378
+ * Optional — a provider backed by a read-only source omits it, and the REST
1379
+ * route in `src/server/api-routes.ts` treats its absence as "not
1380
+ * supported" (405).
1381
+ */
1382
+ deleteTrace?(traceId: string): Promise<boolean>;
1383
+ /**
1384
+ * Runs one read-only SQL query (a `SELECT`) against this provider's
1385
+ * store and returns the rows — the ad-hoc counterpart to
1386
+ * {@link getAllTraces}, for questions a summary can't answer. The schema the
1387
+ * query is written against is {@link getQuerySchema}'s. Writes are refused.
1388
+ *
1389
+ * Optional — a provider not backed by SQL omits it, and the REST and MCP
1390
+ * handlers report "not supported".
1391
+ */
1392
+ query?(sql: string, options?: SqlQueryOptions): Promise<SqlQueryResult>;
1393
+ /**
1394
+ * Describes the tables {@link query} runs against, as annotated SQL DDL.
1395
+ * Present exactly when {@link query} is.
1396
+ */
1397
+ getQuerySchema?(): string;
1398
+ /** Lists every annotation on a trace, oldest first. */
1399
+ listAnnotations?(traceId: string): Promise<Annotation[]>;
1400
+ /** Creates a new annotation, minting its `id`/`createdAt`. */
1401
+ createAnnotation?(input: Omit<Annotation, "id" | "createdAt">): Promise<Annotation>;
1402
+ /**
1403
+ * Changes an annotation's `kind` and/or `note`, returning it as updated, or
1404
+ * `undefined` if it doesn't exist.
1405
+ */
1406
+ updateAnnotation?(id: string, changes: AnnotationChanges): Promise<Annotation | undefined>;
1407
+ /** Deletes an annotation by id. A no-op if it doesn't exist. */
1408
+ deleteAnnotation?(id: string): Promise<void>;
1409
+ /**
1410
+ * Subscribes to annotation changes on a specific trace — the counterpart
1411
+ * to {@link subscribeTrace} that a client's per-trace SSE connection also
1412
+ * opens, so both ride the same stream. Callers (the annotation REST
1413
+ * handlers) invoke {@link emitAnnotation} after a successful
1414
+ * create/update/delete; this only delivers what's explicitly emitted.
1415
+ *
1416
+ * @returns A no-argument function that cancels the subscription.
1417
+ */
1418
+ subscribeAnnotations?(traceId: string, callback: (event: AnnotationEvent) => void): () => void;
1419
+ /**
1420
+ * Notifies this trace's {@link subscribeAnnotations} subscribers of an
1421
+ * annotation change, and {@link watch}ers with an `update` event, since a
1422
+ * trace's summary carries its annotation counts. Called by the annotation
1423
+ * REST handlers immediately after
1424
+ * {@link createAnnotation}/{@link updateAnnotation}/{@link deleteAnnotation}
1425
+ * succeeds — the provider itself never calls this on its own.
1426
+ */
1427
+ emitAnnotation?(traceId: string, op: AnnotationEventOp, annotation: Annotation): void;
1428
+ }
1429
+ //#endregion
1734
1430
  //#region src/config.d.ts
1735
1431
  /**
1736
1432
  * Top-level configuration for an Evalution instance.
@@ -1746,7 +1442,8 @@ interface PromptProvider<TPrompt extends NormalizedPrompt = NormalizedPrompt> {
1746
1442
  * ```ts
1747
1443
  * // .evalution/config.ts
1748
1444
  * import type { EvalutionConfig } from 'evalution';
1749
- * import { FilePromptProvider, VercelAISDK } from 'evalution';
1445
+ * import { FilePromptProvider } from 'evalution';
1446
+ * import { VercelAISDK } from '@evalution/vercel-ai-sdk/config';
1750
1447
  *
1751
1448
  * export default {
1752
1449
  * promptProviders: [
@@ -2043,7 +1740,7 @@ interface EvalRunnerOptions {
2043
1740
  traceProviderId: string;
2044
1741
  tracer: Tracer;
2045
1742
  /** Resolves an eval's (possibly global) prompt id to a provider and prompt. */
2046
- resolvePrompt(prompt: PromptID): {
1743
+ resolvePrompt(prompt: PromptID$1): {
2047
1744
  providerId: string;
2048
1745
  promptId: string;
2049
1746
  } | undefined;
@@ -2358,6 +2055,87 @@ declare class OverlayFileProvider implements FileProvider {
2358
2055
  watch(patterns: readonly string[], options: FileWatchOptions, callback: FileWatchCallback): () => void;
2359
2056
  }
2360
2057
  //#endregion
2058
+ //#region src/prompt/variations/variation-store.d.ts
2059
+ /** A variation as stored: {@link VariationInfo} plus what only the store needs. */
2060
+ interface StoredVariation extends VariationInfo {
2061
+ /**
2062
+ * The prompt's `prompts()` id when it has one, so a rebase can find the
2063
+ * prompt at head after a file move or an export rename.
2064
+ */
2065
+ globalId?: string;
2066
+ /**
2067
+ * The prompt's values for the fields {@link updates} sets, as they were
2068
+ * when it was made — the base of the three-way merge that carries it onto
2069
+ * a changed working tree. See `fieldValuesOf`.
2070
+ */
2071
+ baseValues: FieldValues;
2072
+ }
2073
+ /** What identifies a variation's content. */
2074
+ interface VariationContent {
2075
+ promptId: string;
2076
+ globalId?: string;
2077
+ base?: VersionId;
2078
+ /** Canonical updates — see `canonicalizeUpdates`. */
2079
+ updates: NormalizedPromptUpdates;
2080
+ baseValues: FieldValues;
2081
+ }
2082
+ /** A new WIP variation. */
2083
+ interface NewWip extends VariationContent {
2084
+ /** Whether this WIP holds the unsaved edits to head. At most one per prompt. */
2085
+ onHead: boolean;
2086
+ /** The name of the variation it was opened from, if any. */
2087
+ originName?: string;
2088
+ }
2089
+ /** Changes to a WIP. Omitted fields are left alone; `null` clears. */
2090
+ interface WipChanges {
2091
+ updates?: NormalizedPromptUpdates;
2092
+ baseValues?: FieldValues;
2093
+ pending?: PendingConflicts | null;
2094
+ originName?: string | null;
2095
+ }
2096
+ /**
2097
+ * Where a {@link FilePromptProvider} keeps variations: immutable ("frozen")
2098
+ * ones, deduplicated by content, the one mutable WIP of unsaved edits to
2099
+ * head per prompt, and one per (prompt, old version).
2100
+ *
2101
+ * Nothing is garbage-collected: frozen rows are minted only when something
2102
+ * runs or gets a name, and they dedupe. See
2103
+ * `specs/prompt-versions-and-variations.md` §E.
2104
+ */
2105
+ interface VariationStore {
2106
+ /** The variation with this id, frozen or WIP. */
2107
+ get(id: VariationId): Promise<StoredVariation | undefined>;
2108
+ /**
2109
+ * Inserts a frozen variation, or returns the existing one with the same
2110
+ * content.
2111
+ */
2112
+ intern(v: VariationContent): Promise<StoredVariation>;
2113
+ /** The WIP of unsaved edits to an old version of a prompt, if any. */
2114
+ getWip(promptId: string, base: VersionId): Promise<StoredVariation | undefined>;
2115
+ /** The WIP holding a prompt's unsaved edits to head, if any. */
2116
+ getHeadWip(promptId: string): Promise<StoredVariation | undefined>;
2117
+ /** Every head WIP, of every prompt — what the dirty indicators come from. */
2118
+ listHeadWips(): Promise<StoredVariation[]>;
2119
+ /** Creates a WIP, replacing any that holds the same slot. */
2120
+ putWip(v: NewWip): Promise<StoredVariation>;
2121
+ /** Changes a WIP in place — to edit it, rebase it, or record conflicts. */
2122
+ updateWip(id: VariationId, changes: WipChanges): Promise<StoredVariation>;
2123
+ /** Deletes a WIP. A frozen variation is never deleted. */
2124
+ deleteWip(id: VariationId): Promise<void>;
2125
+ /** A prompt's named variations and its WIPs. */
2126
+ list(promptId: string): Promise<StoredVariation[]>;
2127
+ /** Names a frozen variation. A name is unique per prompt; naming again moves it. */
2128
+ name(id: VariationId, promptId: string, name: string): Promise<void>;
2129
+ /** Removes a name. */
2130
+ unname(promptId: string, name: string): Promise<void>;
2131
+ /**
2132
+ * Renames `from` to `to`, keeping the variation it points at, and returns
2133
+ * that variation's id. Throws if `from` doesn't exist, or `to` is already
2134
+ * taken.
2135
+ */
2136
+ rename(promptId: string, from: string, to: string): Promise<VariationId>;
2137
+ }
2138
+ //#endregion
2361
2139
  //#region src/prompt/file/prompt-file-type.d.ts
2362
2140
  /** Metadata attached to prompts that originate from a file on disk. */
2363
2141
  interface FilePromptMetadata {
@@ -2396,96 +2174,6 @@ interface ParsePromptsOptions {
2396
2174
  */
2397
2175
  companionFiles?: readonly string[];
2398
2176
  }
2399
- /**
2400
- * A type question for a {@link PromptFileType} to answer on an
2401
- * {@link SDKAdapter}'s behalf.
2402
- *
2403
- * Neither side can answer alone. Knowing that a Vercel AI SDK config's tools
2404
- * imply a `toolsContext` is SDK semantics; *evaluating* that mapping is a
2405
- * TypeScript capability. So the adapter says what to look for and the file
2406
- * type contributes the checker.
2407
- */
2408
- type TypeProbe = TypeExpressionProbe | FactoriesProbe;
2409
- /** A probe that resolves a type expression to a {@link PropDefinition}. */
2410
- interface TypeExpressionProbe {
2411
- kind: "type";
2412
- /**
2413
- * The name the result is reported under — for an execute parameter, its
2414
- * name, and the name of the resolved {@link PropDefinition}.
2415
- */
2416
- name: string;
2417
- /**
2418
- * Source text of a type expression, in the file type's
2419
- * {@link PromptFileType.language}, that resolves to the type.
2420
- *
2421
- * In a prompt probe, the token `$config` stands for the type of whatever the
2422
- * prompt returns, and the file type substitutes a way to name it — which
2423
- * shape a prompt file uses is the file type's knowledge, not the adapter's.
2424
- * A project probe has no prompt, so `$config` resolves to `never` there.
2425
- *
2426
- * Write it defensively: a probe that cannot find what it is looking for
2427
- * should resolve to `never` (which means "there is no such thing"), never
2428
- * fail to compile. That is what lets an adapter emit a probe without first
2429
- * inspecting the parse result.
2430
- *
2431
- * For instance, the Vercel AI SDK derives its `toolsContext` from whichever
2432
- * of a config's tools declare a `contextSchema`, with the `never` branch
2433
- * covering a config that has no tools at all:
2434
- *
2435
- * ```ts
2436
- * "$config extends { tools: infer T extends ToolSet } ? InferToolSetContext<T> : never"
2437
- * ```
2438
- */
2439
- expression: string;
2440
- /**
2441
- * How to label the resolved type in the UI, when the checker's own spelling
2442
- * would be unreadable — a deeply-instantiated mapped type is accurate and
2443
- * useless as a label. The resolved *shape* is unaffected.
2444
- */
2445
- syntax?: string;
2446
- /** Documentation shown beside the resolved definition in the UI. */
2447
- description?: string;
2448
- }
2449
- /**
2450
- * A probe that resolves to the {@link ValueFactory}s among some modules'
2451
- * exports: every export that can be called to produce a value assignable to
2452
- * {@link produces}.
2453
- *
2454
- * The adapter says *what* to look for; the file type knows *how* to ask in its
2455
- * language. A module that isn't installed contributes nothing rather than
2456
- * failing the probe.
2457
- */
2458
- interface FactoriesProbe {
2459
- kind: "factories";
2460
- /** The name the result is reported under. */
2461
- name: string;
2462
- /** Module specifiers whose exports to consider, e.g. `"@ai-sdk/openai"`. */
2463
- modules: string[];
2464
- /**
2465
- * A type expression, in the file type's language, naming what a factory's
2466
- * call must produce, e.g. `import("ai").LanguageModel`.
2467
- */
2468
- produces: string;
2469
- /**
2470
- * Consider a method of each export rather than the export itself: with
2471
- * `"evaluationModel"`, an exported provider object `typeSafeAi` whose
2472
- * `evaluationModel(…)` produces the type is found as the factory
2473
- * `typeSafeAi.evaluationModel`, still bound to the import of `typeSafeAi`.
2474
- */
2475
- member?: string;
2476
- }
2477
- /**
2478
- * What one probe resolved to: a {@link PropDefinition} for a `type` probe or
2479
- * the {@link ValueFactory}s found by a `factories` probe; `null` for a definite
2480
- * "no such thing" (the expression evaluated to `never`); or `undefined` for
2481
- * "could not be evaluated".
2482
- */
2483
- type ProbeResult = PropDefinition$1 | ValueFactory$1[] | null | undefined;
2484
- /**
2485
- * Project probe results, keyed by probe name. See
2486
- * {@link SDKAdapter.getProjectProbes}.
2487
- */
2488
- type ProbeResults = Record<string, ProbeResult>;
2489
2177
  /** The project-scoped half of a {@link TypeResolutionRequest}. */
2490
2178
  interface ProjectProbeRequest {
2491
2179
  /**
@@ -2494,12 +2182,12 @@ interface ProjectProbeRequest {
2494
2182
  */
2495
2183
  rootDir: string;
2496
2184
  /** The probes to evaluate. */
2497
- probes: readonly TypeProbe[];
2185
+ probes: readonly TypeProbe$1[];
2498
2186
  }
2499
2187
  /** A {@link TypeProbe} together with the prompt it is being asked about. */
2500
2188
  interface TypeProbeRequest {
2501
2189
  /** The probe to evaluate. */
2502
- probe: TypeProbe;
2190
+ probe: TypeProbe$1;
2503
2191
  /** Absolute path of the prompt's source file. */
2504
2192
  filePath: string;
2505
2193
  /** Name of the prompt within that file. */
@@ -2553,12 +2241,12 @@ interface TypeResolutionRequest {
2553
2241
  /** Answers to a {@link TypeResolutionRequest}, positional within each list. */
2554
2242
  interface TypeResolutionResult {
2555
2243
  /** One per probe request, with the same meaning as {@link PromptFileType.resolveTypeProbes}. */
2556
- probes: ProbeResult[];
2244
+ probes: ProbeResult$1[];
2557
2245
  /**
2558
2246
  * The project probes' results, by probe name. Every requested probe has an
2559
2247
  * entry, `undefined` when it could not be evaluated.
2560
2248
  */
2561
- project?: ProbeResults;
2249
+ project?: ProbeResults$1;
2562
2250
  /** One per slot match request, with the same meaning as {@link PromptFileType.resolveSlotMatches}. */
2563
2251
  slotMatches: Record<string, string[]>[];
2564
2252
  }
@@ -2669,7 +2357,7 @@ interface PromptFileType {
2669
2357
  * @param requests - The expressions to evaluate, each paired with the
2670
2358
  * prompt it concerns. See {@link TypeProbeRequest}.
2671
2359
  */
2672
- resolveTypeProbes?(requests: readonly TypeProbeRequest[]): Promise<ProbeResult[]>;
2360
+ resolveTypeProbes?(requests: readonly TypeProbeRequest[]): Promise<ProbeResult$1[]>;
2673
2361
  /**
2674
2362
  * Decides, for each request, which of its sources can supply which of the
2675
2363
  * prompt's input slots — the type-based half of source matching.
@@ -2695,299 +2383,26 @@ interface PromptFileType {
2695
2383
  /**
2696
2384
  * Answers probes and slot matches together: the same questions, with the
2697
2385
  * same answers, as {@link resolveTypeProbes} and {@link resolveSlotMatches},
2698
- * but sharing whatever it costs to answer them. For a checker-backed file
2699
- * type that is a whole program build, so a caller with both kinds of
2700
- * question should prefer this.
2701
- *
2702
- * Optional. When omitted, callers ask the two separately.
2703
- *
2704
- * @param requests - See {@link TypeResolutionRequest}.
2705
- */
2706
- resolveTypes?(requests: TypeResolutionRequest): Promise<TypeResolutionResult>;
2707
- /**
2708
- * A file type like this one that does all its file I/O — reading, writing
2709
- * and importing prompt files — through `fileProvider` instead.
2710
- *
2711
- * How a prompt variation is materialized: the provider hands the copy an
2712
- * {@link OverlayFileProvider} holding the variation's source at the
2713
- * prompt's real path, and parses, edits and runs it through that.
2714
- *
2715
- * Optional. A file type without it can't show or run variations.
2716
- */
2717
- withFileProvider?(fileProvider: FileProvider): PromptFileType;
2718
- }
2719
- //#endregion
2720
- //#region src/sdk/sdk-adapter.d.ts
2721
- /** Options for {@link SDKAdapter.executeConfig}. */
2722
- interface ExecuteConfigOptions {
2723
- /** The ID to use for the trace created by this execution, if any. */
2724
- traceId?: string;
2725
- /**
2726
- * The ID the route gave this execution's root span, if any. An adapter that
2727
- * records its own spans names the root span with this, so the span the
2728
- * client selects when a run starts is the one that actually arrives.
2729
- */
2730
- rootSpanId?: string;
2731
- /**
2732
- * The prompt's identity (id, name, inputs). Used to name and link the
2733
- * trace when the config wasn't built by the `prompts()` helper (which would
2734
- * otherwise carry that identity itself).
2735
- */
2736
- identity?: PromptSpanInfo;
2737
- /**
2738
- * Named values the SDK needs to execute this config, resolved from the
2739
- * prompt's `executeParameters` — the Vercel AI SDK's `toolsContext`, say.
2740
- *
2741
- * How they reach the underlying call is the adapter's business: merging
2742
- * them generically would assume an execute parameter's name is always a
2743
- * config key, which is true for `toolsContext` but is the adapter's fact to
2744
- * know rather than the caller's.
2745
- */
2746
- executeValues?: Record<string, any>;
2747
- }
2748
- /**
2749
- * Handle on an execution that has been dispatched.
2750
- *
2751
- * `executeConfig` deliberately resolves as soon as the call is in flight — the
2752
- * route answers with a trace id and the generation continues in the background
2753
- * — so this is how a caller learns when the run is actually over, which is
2754
- * what run-scoped resource teardown hangs off.
2755
- */
2756
- interface ExecutionHandle {
2757
- /**
2758
- * Settles when the run is over, successfully or not. Never rejects: a
2759
- * failure is already reported through the trace, and a caller awaiting this
2760
- * only wants to know that it is safe to tear down.
2761
- */
2762
- done: Promise<void>;
2763
- }
2764
- /**
2765
- * Adapter that provides values and execution for a particular AI SDK.
2766
- *
2767
- * Pass an instance of this to {@link FilePromptProvider} via the
2768
- * `sdk` option.
2769
- *
2770
- * Each `SDKAdapter` implementation should be paired with a companion package
2771
- * (named by {@link SDKAdapter.promptsHelperImport}) that exports a `prompts`
2772
- * function satisfying the {@link PromptsHelper} type. That function is the user-facing entry
2773
- * point for defining prompts that work with Evalution. It accepts a {@link PromptsHelperOptions}
2774
- * and a factory that can optionally receive SDK-specific parameters. The factory should return a
2775
- * record of prompt functions. Prompt functions should return a configuration that enables OpenTelemetry
2776
- * reporting, if possible, with the attributes returned by {@link getPromptSpanAttributes}.
2777
- */
2778
- interface SDKAdapter {
2779
- /**
2780
- * The package that exports the `prompts()` helper used in new prompt files
2781
- * (e.g. `'@evalution/vercel-ai-sdk'`). Used by {@link PromptFileType.newPromptSkeleton}.
2782
- */
2783
- promptsHelperImport: string;
2784
- /**
2785
- * Returns the definition of this SDK's model slot: its type, and the
2786
- * catalogs (providers, presets, free-form entries) the playground's model
2787
- * picker offers.
2788
- *
2789
- * A per-SDK call rather than something copied onto every prompt, since the
2790
- * suggestions a checker derives can run to hundreds of model IDs. It is
2791
- * asked per {@link PromptStyle}, since one SDK may drive different kinds of
2792
- * model — the Vercel AI SDK's chat prompts take a language model, and its
2793
- * evaluation prompts an evaluation model. An adapter that only produces one
2794
- * style may ignore it.
2795
- *
2796
- * @param project - What {@link getProjectProbes} resolved to, by probe name.
2797
- * Substitute a fallback for any `undefined` result.
2798
- * @param style - The style of the prompts the slot belongs to.
2799
- */
2800
- getModelDefinition(project: ProbeResults, style: PromptStyle): Promise<PropDefinition$1>;
2801
- /**
2802
- * Returns the list of model parameters that can be edited in the playground
2803
- * UI for projects rooted at `rootDir`. Typically extracted from the SDK's
2804
- * published TypeScript type definitions.
2805
- *
2806
- * @param rootDir - Absolute path to the project root.
2807
- */
2808
- getModelParameters(rootDir: string): PropDefinition$1[];
2809
- /**
2810
- * Executes a prompt config object.
2811
- *
2812
- * Resolves once the call has been dispatched, not once it has finished. Use
2813
- * the returned {@link ExecutionHandle} to await completion.
2814
- *
2815
- * @param config - The config object returned by the prompt function.
2816
- * @param options - Optional execution options (trace id, prompt identity,
2817
- * resolved execute values).
2818
- */
2819
- executeConfig(config: any, options?: ExecuteConfigOptions): Promise<ExecutionHandle | undefined>;
2820
- /**
2821
- * Called once, during server startup, before any prompt config is built,
2822
- * to perform whatever setup this SDK's tracing mechanism needs
2823
- * (e.g. registering a native telemetry integration, or standing up an
2824
- * OpenTelemetry pipeline).
2825
- *
2826
- * If this SDK's tracing is built on OpenTelemetry, its implementation of
2827
- * this method should call {@link setupGlobalOTelPipeline}, which
2828
- * ensures the global pipeline is only set up once, even if other SDK adapters
2829
- * also call it.
2830
- *
2831
- * Optional — adapters with no tracing support may omit it.
2832
- *
2833
- * @returns An ingestor to which {@link TraceSink}s should be added, or
2834
- * `undefined` if tracing cannot be set up.
2835
- */
2836
- setupTraceIngestion?(): Promise<TraceIngestor | undefined>;
2837
- /**
2838
- * Convert a low-level {@link ParsedPrompt} produced by a
2839
- * {@link PromptFileType} into a {@link NormalizedPrompt} that the UI can
2840
- * consume without knowing the SDK's specific property names or message shape.
2841
- *
2842
- * Stays synchronous: the expensive, asynchronous work of resolving probes
2843
- * happens in the provider, which passes the results back in.
2844
- *
2845
- * The adapter also chooses the prompt's {@link PromptStyle},
2846
- * which decides the editor the playground renders it in.
2847
- *
2848
- * @param prompt - The raw parsed prompt.
2849
- * @param promptProbes - What this prompt's {@link getPromptProbes} resolved
2850
- * to, in the order the probes were returned — see {@link ProbeResult}.
2851
- * Absent when the file type cannot evaluate probes at all, which an
2852
- * adapter should treat the same as `undefined`: declaring a parameter with
2853
- * an unresolved type rather than omitting it.
2854
- * @param project - What {@link getProjectProbes} resolved to, by probe name.
2855
- * An adapter substitutes its own fallback for any `undefined` result.
2856
- */
2857
- normalizePrompt(prompt: ParsedPrompt, promptProbes?: readonly ProbeResult[], project?: ProbeResults): NormalizedPrompt;
2858
- /**
2859
- * Returns the type expressions to evaluate for one prompt — chiefly to
2860
- * discover its **execute parameters**, the named values this SDK needs at
2861
- * run time that the prompt function's signature cannot express. Resolved
2862
- * per prompt, so an expression may reference `$config`.
2863
- *
2864
- * The file type declares the language and this method is asked *in* it, so
2865
- * the decision of whether the expression can be written at all belongs here,
2866
- * where the SDK knowledge is. Return `[]` for a language this adapter does
2867
- * not speak, rather than emitting every variant and hoping.
2868
- *
2869
- * Optional — an SDK whose configs are self-contained omits it.
2870
- *
2871
- * @param prompt - The parsed prompt to probe.
2872
- * @param language - The file type's {@link PromptFileType.language}.
2873
- */
2874
- getPromptProbes?(prompt: ParsedPrompt, language: string): TypeProbe[];
2875
- /**
2876
- * Returns the probes to evaluate about the project as a whole — the SDK's
2877
- * own types, as installed — rather than about any one prompt. They are
2878
- * resolved once per program build, in a virtual module at the project root
2879
- * (so they see the project's module resolution), and cached; `$config` has
2880
- * no meaning here.
2386
+ * but sharing whatever it costs to answer them. For a checker-backed file
2387
+ * type that is a whole program build, so a caller with both kinds of
2388
+ * question should prefer this.
2881
2389
  *
2882
- * Optional, and like {@link getPromptProbes}, return `[]` for a language
2883
- * this adapter does not speak.
2390
+ * Optional. When omitted, callers ask the two separately.
2884
2391
  *
2885
- * @param language - The file type's {@link PromptFileType.language}.
2392
+ * @param requests - See {@link TypeResolutionRequest}.
2886
2393
  */
2887
- getProjectProbes?(language: string): TypeProbe[];
2394
+ resolveTypes?(requests: TypeResolutionRequest): Promise<TypeResolutionResult>;
2888
2395
  /**
2889
- * Convert {@link NormalizedPromptUpdates} (what the UI sends back) into the
2890
- * raw property-name-keyed updates that {@link PromptFileType.updateProperty}
2891
- * and friends operate on.
2396
+ * A file type like this one that does all its file I/O — reading, writing
2397
+ * and importing prompt files — through `fileProvider` instead.
2892
2398
  *
2893
- * Throws on updates of a {@link PromptStyle} this adapter never
2894
- * produces: they were written against a different editor, and guessing at
2895
- * property names for them would corrupt the file.
2399
+ * How a prompt variation is materialized: the provider hands the copy an
2400
+ * {@link OverlayFileProvider} holding the variation's source at the
2401
+ * prompt's real path, and parses, edits and runs it through that.
2896
2402
  *
2897
- * @param updates - Updates expressed in the normalized vocabulary.
2898
- * @returns A `Record` keyed by the SDK's actual property names. Values may
2899
- * be `null` (to remove) or a `PropValue`.
2900
- */
2901
- denormalizeUpdates(updates: NormalizedPromptUpdates, currentValues?: Record<string, PropValue$1>): Record<string, PropValue$1 | null>;
2902
- }
2903
- /**
2904
- * Throws unless `updates` are in the style the adapter produces. For use at
2905
- * the top of {@link SDKAdapter.denormalizeUpdates}; narrows `updates` to that
2906
- * style's update type.
2907
- */
2908
- declare function assertUpdateStyle<S extends NormalizedPromptUpdates["style"]>(updates: NormalizedPromptUpdates, style: S): asserts updates is Extract<NormalizedPromptUpdates, {
2909
- style: S;
2910
- }>;
2911
- //#endregion
2912
- //#region src/prompt/variations/variation-store.d.ts
2913
- /** A variation as stored: {@link VariationInfo} plus what only the store needs. */
2914
- interface StoredVariation extends VariationInfo {
2915
- /**
2916
- * The prompt's `prompts()` id when it has one, so a rebase can find the
2917
- * prompt at head after a file move or an export rename.
2918
- */
2919
- globalId?: string;
2920
- /**
2921
- * The prompt's values for the fields {@link updates} sets, as they were
2922
- * when it was made — the base of the three-way merge that carries it onto
2923
- * a changed working tree. See `fieldValuesOf`.
2924
- */
2925
- baseValues: FieldValues;
2926
- }
2927
- /** What identifies a variation's content. */
2928
- interface VariationContent {
2929
- promptId: string;
2930
- globalId?: string;
2931
- base?: VersionId;
2932
- /** Canonical updates — see `canonicalizeUpdates`. */
2933
- updates: NormalizedPromptUpdates;
2934
- baseValues: FieldValues;
2935
- }
2936
- /** A new WIP variation. */
2937
- interface NewWip extends VariationContent {
2938
- /** Whether this WIP holds the unsaved edits to head. At most one per prompt. */
2939
- onHead: boolean;
2940
- /** The name of the variation it was opened from, if any. */
2941
- originName?: string;
2942
- }
2943
- /** Changes to a WIP. Omitted fields are left alone; `null` clears. */
2944
- interface WipChanges {
2945
- updates?: NormalizedPromptUpdates;
2946
- baseValues?: FieldValues;
2947
- pending?: PendingConflicts | null;
2948
- originName?: string | null;
2949
- }
2950
- /**
2951
- * Where a {@link FilePromptProvider} keeps variations: immutable ("frozen")
2952
- * ones, deduplicated by content, the one mutable WIP of unsaved edits to
2953
- * head per prompt, and one per (prompt, old version).
2954
- *
2955
- * Nothing is garbage-collected: frozen rows are minted only when something
2956
- * runs or gets a name, and they dedupe. See
2957
- * `specs/prompt-versions-and-variations.md` §E.
2958
- */
2959
- interface VariationStore {
2960
- /** The variation with this id, frozen or WIP. */
2961
- get(id: VariationId): Promise<StoredVariation | undefined>;
2962
- /**
2963
- * Inserts a frozen variation, or returns the existing one with the same
2964
- * content.
2965
- */
2966
- intern(v: VariationContent): Promise<StoredVariation>;
2967
- /** The WIP of unsaved edits to an old version of a prompt, if any. */
2968
- getWip(promptId: string, base: VersionId): Promise<StoredVariation | undefined>;
2969
- /** The WIP holding a prompt's unsaved edits to head, if any. */
2970
- getHeadWip(promptId: string): Promise<StoredVariation | undefined>;
2971
- /** Every head WIP, of every prompt — what the dirty indicators come from. */
2972
- listHeadWips(): Promise<StoredVariation[]>;
2973
- /** Creates a WIP, replacing any that holds the same slot. */
2974
- putWip(v: NewWip): Promise<StoredVariation>;
2975
- /** Changes a WIP in place — to edit it, rebase it, or record conflicts. */
2976
- updateWip(id: VariationId, changes: WipChanges): Promise<StoredVariation>;
2977
- /** Deletes a WIP. A frozen variation is never deleted. */
2978
- deleteWip(id: VariationId): Promise<void>;
2979
- /** A prompt's named variations and its WIPs. */
2980
- list(promptId: string): Promise<StoredVariation[]>;
2981
- /** Names a frozen variation. A name is unique per prompt; naming again moves it. */
2982
- name(id: VariationId, promptId: string, name: string): Promise<void>;
2983
- /** Removes a name. */
2984
- unname(promptId: string, name: string): Promise<void>;
2985
- /**
2986
- * Renames `from` to `to`, keeping the variation it points at, and returns
2987
- * that variation's id. Throws if `from` doesn't exist, or `to` is already
2988
- * taken.
2403
+ * Optional. A file type without it can't show or run variations.
2989
2404
  */
2990
- rename(promptId: string, from: string, to: string): Promise<VariationId>;
2405
+ withFileProvider?(fileProvider: FileProvider): PromptFileType;
2991
2406
  }
2992
2407
  //#endregion
2993
2408
  //#region src/prompt/file/file-prompt-provider.d.ts
@@ -3037,7 +2452,7 @@ interface FilePromptProviderOptions {
3037
2452
  /**
3038
2453
  * SDK adapter that governs prompt structure and execution.
3039
2454
  */
3040
- sdk: SDKAdapter;
2455
+ sdk: SDKAdapter$1;
3041
2456
  /**
3042
2457
  * How states of the world are named, so a trace records which content of a
3043
2458
  * prompt it ran and an old one can be reopened. See
@@ -3348,7 +2763,7 @@ declare class FilePromptProvider implements PromptProvider<NormalizedFilePrompt>
3348
2763
  * trace's `executeInputs` would have names but no types.
3349
2764
  */
3350
2765
  private parameterSnapshot;
3351
- setupTraceIngestion(): Promise<TraceIngestor | undefined>;
2766
+ setupTraceIngestion(): Promise<import("@evalution/sdk").TraceIngestor | undefined>;
3352
2767
  renamePrompt(promptId: string, newName: string): Promise<NormalizedFilePrompt>;
3353
2768
  addPrompt(partial: Partial<NormalizedFilePrompt>): Promise<NormalizedFilePrompt | AddPromptContext>;
3354
2769
  watch(callback: (event: PromptChangeEvent) => void): () => void;
@@ -3666,409 +3081,80 @@ declare class GitVersioning implements VersioningAdapter {
3666
3081
  private git;
3667
3082
  }
3668
3083
  //#endregion
3669
- //#region src/sdk/gemini-interactions-sdk.d.ts
3670
- type BaseCreateInteractionParams = Parameters<typeof import("@google/genai").GoogleGenAI.prototype.interactions.create>[0];
3671
- /**
3672
- * {@link SDKAdapter} implementation for the Google GenAI
3673
- * [Interactions API](https://ai.google.dev/gemini-api/docs/interactions)
3674
- * (`@google/genai` package). Currently experimental and untested.
3675
- */
3676
- declare class GeminiInteractionsSDK implements SDKAdapter {
3677
- readonly promptsHelperImport = "FIXME";
3678
- getProjectProbes(language: string): TypeProbe[];
3679
- /**
3680
- * One model row whose value is an honest config fragment —
3681
- * `{ model: "gemini-3.5-flash" }` or `{ agent: "deep-research-…" }` —
3682
- * because `interactions.create` takes one or the other, never both. The
3683
- * **Models** and **Agents** catalogs each narrow their free-form entry to
3684
- * their own variant.
3685
- */
3686
- getModelDefinition(project: ProbeResults): Promise<PropDefinition$1>;
3687
- getModelParameters(rootDir: string): PropDefinition$1[];
3688
- executeConfig(config: BaseCreateInteractionParams): Promise<undefined>;
3689
- normalizePrompt(prompt: ParsedPrompt): NormalizedChatPrompt;
3690
- denormalizeUpdates(updates: NormalizedPromptUpdates, currentValues?: Record<string, PropValue$1>): Record<string, PropValue$1 | null>;
3691
- }
3692
- //#endregion
3693
- //#region src/shared/setup-task.d.ts
3694
- /** Fields shared by every {@link SetupStep} kind. */
3695
- interface SetupStepBase {
3696
- /** Stable identifier, unique within the owning {@link SetupTask}. */
3697
- id: string;
3698
- /**
3699
- * Runtime completion status, populated by the server when listing tasks
3700
- * (e.g. the config file already exists, or the package is installed). Absent
3701
- * in the static step definitions held by the registry.
3702
- */
3703
- completed?: boolean;
3704
- }
3705
- /** Writes evalution's starter config file. */
3706
- interface SetupCreateConfigStep extends SetupStepBase {
3707
- /** Discriminant: this step creates the project config file. */
3708
- kind: "create_config";
3709
- /** Project-relative path the file will be written to. */
3710
- path: string;
3711
- /**
3712
- * Full contents of the file. Shown to the user as a copyable snippet and
3713
- * written verbatim by the server. This is display data: the server reads it
3714
- * from its own registry, never from a client request.
3715
- */
3716
- contents: string;
3717
- }
3718
- /**
3719
- * Runs a shell command in the project root, streamed to an interactive
3720
- * terminal so the user can watch it and respond to prompts.
3721
- */
3722
- interface SetupRunCommandStep extends SetupStepBase {
3723
- /** Discriminant: this step runs a shell command. */
3724
- kind: "run_command";
3725
- /** The command line to run, e.g. `npm run build`. */
3726
- command: string;
3727
- /** Optional human-friendly label shown alongside the command. */
3728
- label?: string;
3729
- }
3730
- /**
3731
- * Installs an npm package — a specialization of {@link SetupRunCommandStep}
3732
- * that runs `npm i <package>`. The server reports it as already
3733
- * {@link SetupStepBase.completed | completed} when the package is present in
3734
- * the project, so the user can skip it.
3735
- */
3736
- interface SetupInstallPackageStep extends SetupStepBase {
3737
- /** Discriminant: this step installs an npm package. */
3738
- kind: "install_package";
3739
- /** The npm package to install, e.g. `@evalution/vercel-ai-sdk`. */
3740
- package: string;
3741
- }
3742
- /**
3743
- * A single executable step within a {@link SetupTask}.
3744
- *
3745
- * Steps are defined server-side and addressed by {@link SetupTask.id} plus the
3746
- * step's `id`; the client references a step only by those ids when asking the
3747
- * server to run it.
3748
- */
3749
- type SetupStep = {
3750
- disabledReason?: string;
3751
- } & (SetupCreateConfigStep | SetupRunCommandStep | SetupInstallPackageStep);
3752
- /**
3753
- * A named onboarding task for a single AI SDK: what to show in the manual-setup
3754
- * picker, plus the ordered steps that wire the SDK up.
3755
- */
3756
- interface SetupTask {
3757
- /** Stable identifier, also used as the wire id for this SDK choice. */
3758
- id: string;
3759
- /** Display label for the picker (typically the SDK's product name). */
3760
- label: string;
3761
- /** Icon identifier, mapped to a bundled asset on the client. */
3762
- icon: string;
3763
- /** Ordered steps to run, in display order. */
3764
- steps: SetupStep[];
3765
- }
3766
- //#endregion
3767
- //#region src/sdk/typesafe-sdk/telemetry.d.ts
3768
- /**
3769
- * The key under which the `prompts()` helper attaches a config's prompt
3770
- * identity. A symbol, because a System One request object is sent to the API
3771
- * as-is: a string key would be sent along and fail validation, while a symbol
3772
- * survives a spread and is dropped by `JSON.stringify`.
3773
- */
3774
- declare const PROMPT_IDENTITY: unique symbol;
3775
- /** One System One call being recorded. See {@link TypeSafeTelemetry.startCall}. */
3776
- interface SystemOneCallRecord {
3777
- /** Records the call's result and ends its span. */
3778
- end(result: SystemOneResult<Questions>): Promise<void>;
3779
- /** Records the call's failure and ends its span as an error. */
3780
- fail(err: unknown): Promise<void>;
3781
- }
3782
- /** Options for {@link TypeSafeTelemetry.startCall}. */
3783
- interface SystemOneCallOptions {
3784
- /** The trace to record into. */
3785
- traceId: string;
3786
- /** The span's ID; defaults to the trace's conventional root span ID. */
3787
- spanId?: string;
3788
- /** The prompt the call was made for, if known. */
3789
- identity?: PromptSpanInfo;
3790
- /** The request, recorded as the span's input. */
3791
- request: SystemOneRequest<Questions>;
3792
- /** The model the request will be answered by, if the request doesn't say. */
3793
- defaultModel?: string;
3794
- }
3795
- /**
3796
- * Records System One calls as `LLM` spans. The SDK has no telemetry hook, so
3797
- * the adapter (in the playground) and `instrument()` (at run time) call it
3798
- * around each `systemOne` call.
3799
- */
3800
- declare class TypeSafeTelemetry extends BaseTraceIngestor {
3801
- /** Starts a span for a call; the returned record ends it. */
3802
- startCall({
3803
- traceId,
3804
- spanId,
3805
- identity,
3806
- request,
3807
- defaultModel
3808
- }: SystemOneCallOptions): Promise<SystemOneCallRecord>;
3809
- }
3810
- //#endregion
3811
- //#region src/sdk/typesafe-sdk/index.d.ts
3812
- type TypeSafeClientConfig = import("@typesafe-ai/sdk").TypeSafeClientConfig;
3813
- type SystemOneRequest$1 = import("@typesafe-ai/sdk").SystemOneRequest;
3814
- /** Options for {@link TypeSafeSDK}. */
3815
- interface TypeSafeSDKOptions {
3816
- /**
3817
- * Configuration for the `TypeSafeClient` this adapter builds to list models
3818
- * and execute prompts. Defaults to the SDK's own (API key and base URL from
3819
- * the environment).
3820
- */
3821
- client?: TypeSafeClientConfig;
3822
- }
3084
+ //#region src/shared/instance-names.d.ts
3823
3085
  /**
3824
- * {@link SDKAdapter} implementation for [TypeSafe](https://typesafe.ai)'s
3825
- * System One models (`@typesafe-ai/sdk`).
3826
- *
3827
- * A System One request isn't a chat: it asks a set of named, typed questions
3828
- * about a `state`. So its prompts are normalized to the `questions` style,
3829
- * whose editor is built around the questions rather than a message list.
3830
- *
3831
- * Every type the editor needs — the state, the questions, and the factories
3832
- * that build them — is read from the installed SDK through project probes, so
3833
- * a question type added by a later SDK version is editable without an
3834
- * Evalution release.
3086
+ * What a run's resource instance may be named — shared by the server, which
3087
+ * refuses anything else, and the client, which says so before sending. See
3088
+ * `specs/resource-instances.md` §A.2.
3835
3089
  */
3836
- declare class TypeSafeSDK implements SDKAdapter {
3837
- readonly promptsHelperImport = "@evalution/typesafe-sdk";
3838
- /**
3839
- * Onboarding task: install the SDK and the prompts helper, then drop a
3840
- * starter config.
3841
- * @internal
3842
- */
3843
- static readonly setupTask: SetupTask;
3844
- private readonly clientConfig;
3845
- private modelIds;
3846
- private clientPromise;
3847
- constructor({
3848
- client
3849
- }?: TypeSafeSDKOptions);
3850
- /** The model a request without one is answered by. */
3851
- private get defaultModel();
3852
- getProjectProbes(language: string): TypeProbe[];
3853
- /**
3854
- * A model name, with the account's models from `client.models.list()` as
3855
- * presets. Listing needs an API key and the network, so it falls back to the
3856
- * default model alone.
3857
- */
3858
- getModelDefinition(project: ProbeResults): Promise<PropDefinition$1>;
3859
- /** Model names from the API, listed once per adapter. */
3860
- private listModels;
3861
- /** Per-call options are transport settings, not prompt content. */
3862
- getModelParameters(): PropDefinition$1[];
3863
- normalizePrompt(prompt: ParsedPrompt, _promptProbes?: readonly ProbeResult[], project?: ProbeResults): NormalizedQuestionsPrompt;
3864
- /**
3865
- * Nearly the identity: a System One config's `model`, `state` and
3866
- * `questions` are the normalized fields, already in source shape.
3867
- */
3868
- denormalizeUpdates(updates: NormalizedPromptUpdates): Record<string, PropValue$1 | null>;
3869
- /**
3870
- * Calls `systemOne` with the config, recording it as the run's root span.
3871
- *
3872
- * Resolves as soon as the call is dispatched; the returned handle's `done`
3873
- * settles when it finishes, successfully or not.
3874
- */
3875
- executeConfig(config: SystemOneRequest$1, {
3876
- traceId,
3877
- rootSpanId,
3878
- identity
3879
- }?: ExecuteConfigOptions): Promise<ExecutionHandle>;
3880
- /** The client executions use, built once. */
3881
- private client;
3882
- setupTraceIngestion(): Promise<TypeSafeTelemetry>;
3883
- }
3090
+ /** Whether `name` is a valid instance name: `[A-Za-z_][A-Za-z0-9_-]*`. */
3091
+ declare function isValidInstanceName(name: string): boolean;
3884
3092
  //#endregion
3885
- //#region src/sdk/vercel-ai-sdk/index.d.ts
3093
+ //#region src/trace/base-trace-provider.d.ts
3886
3094
  /**
3887
- * {@link SDKAdapter} implementation for the
3888
- * [Vercel AI SDK](https://sdk.vercel.ai/).
3889
- *
3890
- * - `getModelParameters` reads `CallSettings` from the SDK's `.d.ts` bundle
3891
- * and surfaces parameters with simple types that can be edited in the UI.
3892
- * - `executeConfig` delegates to `generateText`.
3095
+ * Source-agnostic base class for a {@link TraceProvider}. Owns storage
3096
+ * delegation, subscriptions, watchers, and the generic trace lifecycle that
3097
+ * every concrete provider shares, regardless of how spans are produced.
3893
3098
  *
3894
- * A prompt whose config asks `questions` is an `experimental_evaluate` call
3895
- * instead: it is edited in the `questions` style and executed with
3896
- * `experimental_evaluate`. Both are traced through the same native telemetry.
3099
+ * Subclasses implement the abstract storage hooks; ingestion is handled by
3100
+ * one or more {@link TraceIngestor}s that call {@link recordSpanStart} /
3101
+ * {@link recordSpanEnd} / {@link failTrace} on this instance (via
3102
+ * {@link TraceSink}).
3897
3103
  */
3898
- declare class VercelAISDK implements SDKAdapter {
3899
- readonly promptsHelperImport: "@evalution/vercel-ai-sdk";
3900
- /**
3901
- * Onboarding task: install the SDK package, then drop a starter config.
3902
- * @internal
3903
- */
3904
- static readonly setupTask: SetupTask;
3905
- getProjectProbes(language: string): TypeProbe[];
3906
- /** A language model for chat prompts; an evaluation model for evaluation prompts. */
3907
- getModelDefinition(project: ProbeResults, style?: PromptStyle): Promise<PropDefinition$1>;
3908
- getModelParameters(rootDir: string): PropDefinition$1[];
3909
- /**
3910
- * The per-tool context object that `generateText` requires whenever a tool
3911
- * declares a `contextSchema`.
3912
- */
3913
- private static readonly TOOLS_CONTEXT_PROBE;
3914
- getPromptProbes(prompt: ParsedPrompt, language: string): TypeProbe[];
3915
- executeConfig(config: any, {
3916
- traceId,
3917
- identity,
3918
- executeValues
3919
- }?: ExecuteConfigOptions): Promise<ExecutionHandle>;
3920
- setupTraceIngestion(): Promise<TraceIngestor | undefined>;
3921
- private doSetupTraceIngestion;
3922
- normalizePrompt(prompt: ParsedPrompt, resolvedProbes?: readonly ProbeResult[], project?: ProbeResults): NormalizedPrompt;
3923
- private normalizeChatPrompt;
3924
- /**
3925
- * Assemble the prompt's execute parameters from what the probes resolved to.
3926
- *
3927
- * The interesting case is the third one. When no probe could run — a file
3928
- * type with no checker, an in-memory provider, a resolution failure — the
3929
- * parameter is still declared, with an unresolved type. "This prompt needs
3930
- * `toolsContext` and I cannot tell you its shape" is a usable state; staying
3931
- * silent reproduces exactly the failure this machinery exists to prevent,
3932
- * where the first tool call dies at run time with nothing having warned you.
3933
- *
3934
- * That degradation is scoped by a cheap syntactic check — does the config
3935
- * even have a `tools` property? — so a prompt that plainly has no tools does
3936
- * not sprout a mystery parameter.
3937
- */
3938
- private executeParametersFor;
3939
- denormalizeUpdates(updates: NormalizedPromptUpdates, currentValues?: Record<string, PropValue$1>): Record<string, PropValue$1 | null>;
3940
- }
3941
- //#endregion
3942
- //#region src/sdk/vercel-ai-sdk/telemetry.d.ts
3943
- interface PerPromptTelemetry extends Telemetry {
3944
- /**
3945
- * Returns a new instance that will use the given trace ID.
3946
- *
3947
- * @param runIdentity - What the caller knows about this run that the
3948
- * integration's own identity doesn't — the playground's inputs and the
3949
- * version it ran — filled in wherever the integration's identity is unset.
3950
- */
3951
- withTraceId(traceId: string, runIdentity?: PromptSpanInfo): PerTraceTelemetry;
3952
- }
3953
- interface PerTraceTelemetry extends PerPromptTelemetry {
3954
- /**
3955
- * Marks this run's trace as failed. Used by `executeConfig` to surface a
3956
- * `generateText` rejection that happens before `onStart` fires (e.g. a
3957
- * bad model id) — without this, the trace pre-created for the route's
3958
- * synchronous response would otherwise hang in `running` forever. If spans
3959
- * were already opened before the rejection, they are closed as `error` too.
3960
- * Does nothing if `onError` already closed the run.
3961
- */
3962
- fail(message: string): Promise<void>;
3963
- /**
3964
- * Whether the SDK has reported this run's start. An `ai` release too old to
3965
- * send an operation's events never will, which `executeConfig` checks so
3966
- * the trace doesn't hang in `running`.
3967
- */
3968
- wasStarted(): boolean;
3969
- }
3970
- interface VercelAISDKTelemetryOptions {
3971
- /**
3972
- * Native telemetry collection: `"auto"` (default) collects natively unless
3973
- * an OpenTelemetry integration is also active for the call, in which case
3974
- * it defers to OTel; `"always"` forces native telemetry collection, even
3975
- * alongside OTel; `"never"` always defers.
3976
- */
3977
- nativeTelemetry?: "auto" | "always" | "never";
3104
+ declare abstract class BaseTraceProvider implements TraceProvider, TraceSink$1 {
3105
+ readonly id: string;
3106
+ readonly displayName?: string;
3107
+ readonly description?: string;
3108
+ protected subscribers: Map<string, Set<(event: TraceStreamEvent$1) => void>>;
3109
+ private watchers;
3110
+ private annotationSubscribers;
3111
+ constructor(options: {
3112
+ id: string;
3113
+ displayName: string;
3114
+ description: string;
3115
+ });
3116
+ abstract getAllTraces(): Promise<TraceSummary$1[]>;
3117
+ abstract hasTrace(traceId: string): Promise<boolean>;
3118
+ protected abstract getTraceWithoutSpans(traceId: string): Promise<Trace$1 | undefined>;
3119
+ protected abstract getTraceSpans(traceId: string): Promise<Span$1[]>;
3120
+ protected abstract addOrUpdateTrace(trace: Trace$1): Promise<void>;
3978
3121
  /**
3979
- * The base URL of an evalution server to send traces to, through an
3980
- * {@link HttpTraceSink}. Defaults to the `EVALUTION_ENDPOINT` environment
3981
- * variable, if set; `false` sends nowhere, whatever the environment says.
3122
+ * Removes a trace together with its spans and annotations. Only called for
3123
+ * a trace that {@link hasTrace} confirmed exists.
3982
3124
  */
3983
- endpoint?: string | false;
3984
- }
3985
- type Callbacks = Required<Telemetry>;
3986
- /**
3987
- * Native v7 AI SDK `Telemetry` integration that records evalution traces
3988
- * without going through OpenTelemetry.
3989
- *
3990
- * When your app starts, register this globally via `registerTelemetry(new Evalution())` to capture
3991
- * every `generateText`/`streamText` call as a fallback (events are keyed by
3992
- * `callId`, so concurrent calls stay correctly separated, though the fallback
3993
- * lacks prompt identity). The `prompts()` helper additionally swaps in a
3994
- * per-call integration from {@link createTelemetryForPrompt} so
3995
- * helper-defined prompts are recorded with full identity.
3996
- *
3997
- * When it sends traces to an evalution server (see
3998
- * {@link VercelAISDKTelemetryOptions.endpoint}), they go in the background:
3999
- * `await` {@link flush} before a short-lived process — a script, a
4000
- * serverless function — exits, so none are lost.
4001
- *
4002
- * When an OpenTelemetry integration is also active, this class
4003
- * defers to it by default (see {@link VercelAISDKTelemetryOptions.nativeTelemetry}) rather
4004
- * than emitting a duplicate, parallel trace.
4005
- */
4006
- declare class VercelAISDKTelemetry extends BaseTraceIngestor implements Telemetry {
4007
- /**
4008
- * This instance's configured {@link VercelAISDKTelemetryOptions.nativeTelemetry}.
4009
- * Read by the `prompts()` helper to decide whether to defer to a sibling
4010
- * OpenTelemetry integration for a given call.
4011
- */
4012
- readonly nativeTelemetry: "auto" | "always" | "never";
4013
- private readonly runs;
4014
- constructor(options?: VercelAISDKTelemetryOptions);
4015
- private shouldDeferGlobally;
4016
- onStart: Callbacks["onStart"];
4017
- onStepStart: Callbacks["onStepStart"];
4018
- onToolExecutionStart: Callbacks["onToolExecutionStart"];
4019
- onToolExecutionEnd: Callbacks["onToolExecutionEnd"];
4020
- onStepEnd: Callbacks["onStepEnd"];
4021
- onEnd: Callbacks["onEnd"];
4022
- onAbort: Callbacks["onAbort"];
4023
- onError: Callbacks["onError"];
4024
- experimental_onEvaluateStart: Callbacks["experimental_onEvaluateStart"];
4025
- experimental_onEvaluateEnd: Callbacks["experimental_onEvaluateEnd"];
4026
- /**
4027
- * Mints a `PerPromptTelemetry` integration bound to the given prompt identity.
4028
- * Used by the `prompts()` helper so a helper-defined prompt is recorded with
4029
- * full identity. Called with no `identity` (e.g. by the playground for a raw,
4030
- * non-helper config) it still binds a trace id but records without prompt
4031
- * identity — the same data the global fallback would, just under a known id.
4032
- */
4033
- createTelemetryForPrompt(identity?: PromptSpanInfo): PerPromptTelemetry;
4034
- private handleStart;
3125
+ protected abstract removeTrace(traceId: string): Promise<void>;
4035
3126
  /**
4036
- * An `experimental_evaluate` call: one `LLM` span, since there are no steps
4037
- * or tools — the model answers every question in one call. Its input is the
4038
- * state and the questions, recorded as they were asked.
3127
+ * Stores a span, merging it into any existing span with the same ID (via
3128
+ * the `mergeSpans` helper). Returns the resulting stored span so callers
3129
+ * can stream the merged view rather than the partial snapshot they passed
3130
+ * in.
4039
3131
  */
4040
- private handleEvaluateStart;
4041
- private handleEvaluateEnd;
4042
- private handleStepStart;
4043
- private handleToolExecutionStart;
4044
- private handleToolExecutionEnd;
4045
- private handleStepEnd;
4046
- private handleEnd;
4047
- private handleAbort;
3132
+ protected abstract addOrUpdateSpan(span: Span$1): Promise<Span$1>;
3133
+ getTrace(traceId: string): Promise<TraceWithSpans$1 | undefined>;
3134
+ deleteTrace(traceId: string): Promise<boolean>;
3135
+ subscribeTrace(traceId: string, callback: (event: TraceStreamEvent$1) => void): () => void;
3136
+ watch(callback: (event: TraceChangeEvent$1) => void): () => void;
4048
3137
  /**
4049
- * Closes a run's still-open spans (tools, then step, then root) as `error`.
4050
- * Ending the root finalizes the trace as `error`. Used by both `onAbort` and
4051
- * the `fail()` path so a mid-flight rejection doesn't leave spans hanging in
4052
- * `running`.
3138
+ * Generic pub-sub for annotation changes — every subclass gets a working
3139
+ * implementation "for free", even one with no annotation store of its own
3140
+ * (e.g. `MemoryTraceProvider`): nothing is ever delivered unless a caller
3141
+ * (the annotation REST handlers) explicitly calls {@link emitAnnotation}.
4053
3142
  */
4054
- private endOpenSpansAsError;
3143
+ subscribeAnnotations(traceId: string, callback: (event: AnnotationEvent$1) => void): () => void;
3144
+ emitAnnotation(traceId: string, op: AnnotationEventOp$1, annotation: Annotation$1): void;
3145
+ recordSpanStart(span: Span$1): Promise<Span$1>;
3146
+ recordSpanEnd(span: Span$1): Promise<Span$1>;
4055
3147
  /**
4056
- * The SDK's report that a call failed. Nothing else closes its spans: a
4057
- * failed operation sends no `onEnd`. Returns whether it closed a run.
3148
+ * Marks a trace that already ended as running again: its root span has just
3149
+ * been started anew (a failed run being retried), so the failure it recorded
3150
+ * is no longer its state.
4058
3151
  */
4059
- private handleError;
4060
- private handleFail;
3152
+ private reopenTrace;
3153
+ failTrace(traceId: string, errorMessage: string): Promise<void>;
3154
+ protected emitStream(traceId: string, event: TraceStreamEvent$1): void;
3155
+ protected emitChange(event: TraceChangeEvent$1): void;
4061
3156
  }
4062
3157
  //#endregion
4063
- //#region src/shared/instance-names.d.ts
4064
- /**
4065
- * What a run's resource instance may be named — shared by the server, which
4066
- * refuses anything else, and the client, which says so before sending. See
4067
- * `specs/resource-instances.md` §A.2.
4068
- */
4069
- /** Whether `name` is a valid instance name: `[A-Za-z_][A-Za-z0-9_-]*`. */
4070
- declare function isValidInstanceName(name: string): boolean;
4071
- //#endregion
4072
3158
  //#region src/trace/db/local-turso-client.d.ts
4073
3159
  interface LocalTursoClientOptions {
4074
3160
  /** Path to the local SQLite file (e.g. `<rootDir>/.evalution/trace.db`). */
@@ -4122,70 +3208,7 @@ declare function createLocalTursoClient({
4122
3208
  * server. A test checks every column of `./schema.ts` is described here.
4123
3209
  */
4124
3210
  /** The trace database's tables, described for someone writing SQL against them. */
4125
- declare const TRACE_QUERY_SCHEMA = "-- Trace database (SQLite). Timestamps are milliseconds since the Unix epoch.\n-- Columns marked JSON hold JSON text; read into them with json_extract(),\n-- e.g. json_extract(llm_parameters, '$.temperature').\n\n-- One row per trace: a single run, e.g. one prompt execution.\nCREATE TABLE traces (\n id TEXT PRIMARY KEY,\n provider_id TEXT, -- the trace provider that recorded it\n name TEXT NOT NULL, -- usually the prompt's name\n start_time REAL NOT NULL, -- ms since epoch\n end_time REAL, -- ms since epoch; NULL while running\n status TEXT NOT NULL, -- 'running' | 'ok' | 'error'\n attributes TEXT -- JSON object of free-form attributes\n);\n\n-- One row per span. Spans form a tree per trace via parent_id.\nCREATE TABLE spans (\n id TEXT PRIMARY KEY,\n trace_id TEXT NOT NULL, -- traces.id\n parent_id TEXT, -- spans.id; NULL for the root span\n name TEXT NOT NULL,\n kind TEXT NOT NULL, -- 'LLM' | 'TOOL' | 'AGENT' | 'EMBEDDING' | 'CHECK' | 'DEFAULT'\n start_time REAL NOT NULL, -- ms since epoch\n end_time REAL, -- ms since epoch; NULL while running\n status TEXT, -- 'ok' | 'error'; NULL while running\n error_message TEXT,\n llm_provider TEXT, -- e.g. 'openai', 'anthropic'\n llm_model TEXT, -- e.g. 'gpt-4o'\n llm_finish_reason TEXT, -- e.g. 'stop', 'length', 'tool-calls'\n llm_prompt_tokens INTEGER, -- includes cache reads and writes\n llm_completion_tokens INTEGER,\n llm_total_tokens INTEGER,\n llm_cache_read_tokens INTEGER, -- of llm_prompt_tokens, read from a prompt cache\n llm_cache_write_tokens INTEGER, -- of llm_prompt_tokens, written to a prompt cache\n llm_cost_prompt REAL, -- USD, cache reads and writes included\n llm_cost_completion REAL, -- USD\n llm_cost_cache_read REAL, -- USD, the part of llm_cost_prompt spent on cache reads\n llm_cost_cache_write REAL, -- USD, the part of llm_cost_prompt spent on cache writes\n llm_input TEXT, -- JSON: an array of messages {role, content}, or any JSON object\n llm_output TEXT, -- JSON: always encoded, so a text output is a JSON string\n llm_parameters TEXT, -- JSON object of model parameters (temperature, ...)\n attributes TEXT, -- JSON object of free-form attributes; \"evalution.check\" is set on spans an eval check recorded while judging the trace (its CHECK span and everything under it), which aren't part of the run\n resource TEXT, -- JSON object: the OTel resource that produced the span (\"service.name\", \"deployment.environment.name\" = 'playground' for runs evalution made, ...)\n prompt TEXT, -- JSON {id, providerId?, version?, variation?, functionInputs?, executeInputs?, ...}: the prompt this span ran\n tool TEXT -- JSON {toolName, input, output?} for TOOL spans\n);\n\n-- Notes left on a trace, or on one span of it.\nCREATE TABLE annotations (\n id TEXT PRIMARY KEY,\n trace_id TEXT NOT NULL, -- traces.id\n span_id TEXT, -- spans.id; NULL for a note on the whole trace\n kind TEXT NOT NULL, -- 'issue' | 'good' | 'note'\n note TEXT NOT NULL,\n source TEXT NOT NULL, -- 'user' | 'claude-code' | 'codex' | 'agent'\n created_at REAL NOT NULL -- ms since epoch\n);\n";
4126
- //#endregion
4127
- //#region src/trace/http-trace-sink.d.ts
4128
- /**
4129
- * Where an evalution server accepts {@link TraceSinkEvent}s, relative to its
4130
- * base URL.
4131
- */
4132
- declare const TRACE_EVENTS_PATH = "/api/traces";
4133
- /** One {@link TraceSink} call, as {@link HttpTraceSink} sends it. */
4134
- type TraceSinkEvent = {
4135
- type: "span-start";
4136
- span: Span;
4137
- } | {
4138
- type: "span-end";
4139
- span: Span;
4140
- } | {
4141
- type: "trace-fail";
4142
- traceId: string;
4143
- errorMessage: string;
4144
- };
4145
- /** The body of a `POST` to {@link TRACE_EVENTS_PATH}. */
4146
- interface TraceEventsRequest {
4147
- /** The events to record, in the order they happened. */
4148
- events: TraceSinkEvent[];
4149
- }
4150
- /** Options for {@link HttpTraceSink}. */
4151
- interface HttpTraceSinkOptions {
4152
- /**
4153
- * The evalution server's base URL, e.g. `http://localhost:3000`. Events are
4154
- * posted to {@link TRACE_EVENTS_PATH} under it.
4155
- */
4156
- endpoint: string;
4157
- /** The `fetch` to send with. Defaults to the global one. */
4158
- fetch?: typeof fetch;
4159
- }
4160
- /**
4161
- * A {@link TraceSink} that sends what it's given to an evalution server,
4162
- * which records it through its own trace providers — so an app's traces show
4163
- * up in the playground without the app writing to a trace store itself.
4164
- *
4165
- * Calls return as soon as the event is queued, never waiting on the network,
4166
- * so tracing doesn't slow the app down. Queued events go out in order, batched
4167
- * into one request at a time, so a span's end never overtakes its start. A
4168
- * request that fails is logged and its events dropped: tracing never breaks
4169
- * the app. Await {@link flush} before a short-lived process exits to be sure
4170
- * everything was sent.
4171
- */
4172
- declare class HttpTraceSink implements TraceSink {
4173
- private readonly url;
4174
- private readonly fetch;
4175
- private queue;
4176
- private sending?;
4177
- /** Whether the last request failed, so a down server is reported once. */
4178
- private failing;
4179
- constructor(options: HttpTraceSinkOptions);
4180
- recordSpanStart(span: Span): Promise<Span>;
4181
- recordSpanEnd(span: Span): Promise<Span>;
4182
- failTrace(traceId: string, errorMessage: string): Promise<void>;
4183
- /** Resolves once every event recorded so far has been sent (or dropped). */
4184
- flush(): Promise<void>;
4185
- private enqueue;
4186
- private drain;
4187
- private send;
4188
- }
3211
+ declare const TRACE_QUERY_SCHEMA = "-- Trace database (SQLite). Timestamps are milliseconds since the Unix epoch.\n-- Columns marked JSON hold JSON text; read into them with json_extract(),\n-- e.g. json_extract(llm_parameters, '$.temperature').\n\n-- One row per trace: a single run, e.g. one prompt execution.\nCREATE TABLE traces (\n id TEXT PRIMARY KEY,\n provider_id TEXT, -- the trace provider that recorded it\n name TEXT NOT NULL, -- usually the prompt's name\n start_time REAL NOT NULL, -- ms since epoch\n end_time REAL, -- ms since epoch; NULL while running\n status TEXT NOT NULL, -- 'running' | 'ok' | 'error'\n attributes TEXT -- JSON object of free-form attributes\n);\n\n-- One row per span. Spans form a tree per trace via parent_id.\nCREATE TABLE spans (\n id TEXT PRIMARY KEY,\n trace_id TEXT NOT NULL, -- traces.id\n parent_id TEXT, -- spans.id; NULL for the root span\n name TEXT NOT NULL,\n kind TEXT NOT NULL, -- 'LLM' | 'TOOL' | 'AGENT' | 'EMBEDDING' | 'CHECK' | 'DEFAULT'\n start_time REAL NOT NULL, -- ms since epoch\n end_time REAL, -- ms since epoch; NULL while running\n status TEXT, -- 'ok' | 'error'; NULL while running\n error_message TEXT,\n llm_provider TEXT, -- e.g. 'openai', 'anthropic'\n llm_model TEXT, -- e.g. 'gpt-4o'\n llm_finish_reason TEXT, -- e.g. 'stop', 'length', 'tool-calls'\n llm_prompt_tokens INTEGER, -- includes cache reads and writes\n llm_completion_tokens INTEGER,\n llm_total_tokens INTEGER,\n llm_cache_read_tokens INTEGER, -- of llm_prompt_tokens, read from a prompt cache\n llm_cache_write_tokens INTEGER, -- of llm_prompt_tokens, written to a prompt cache\n llm_cost_prompt REAL, -- USD, cache reads and writes included\n llm_cost_completion REAL, -- USD\n llm_cost_cache_read REAL, -- USD, the part of llm_cost_prompt spent on cache reads\n llm_cost_cache_write REAL, -- USD, the part of llm_cost_prompt spent on cache writes\n llm_input TEXT, -- JSON: an array of messages {role, content}, or any JSON object\n llm_output TEXT, -- JSON: always encoded, so a text output is a JSON string\n llm_reasoning TEXT, -- the model's reasoning for this turn, as plain text\n llm_parameters TEXT, -- JSON object of model parameters (temperature, ...)\n attributes TEXT, -- JSON object of free-form attributes; \"evalution.check\" is set on spans an eval check recorded while judging the trace (its CHECK span and everything under it), which aren't part of the run\n resource TEXT, -- JSON object: the OTel resource that produced the span (\"service.name\", \"deployment.environment.name\" = 'playground' for runs evalution made, ...)\n prompt TEXT, -- JSON {id, providerId?, version?, variation?, functionInputs?, executeInputs?, ...}: the prompt this span ran\n tool TEXT -- JSON {toolName, input, output?} for TOOL spans\n);\n\n-- Notes left on a trace, or on one span of it.\nCREATE TABLE annotations (\n id TEXT PRIMARY KEY,\n trace_id TEXT NOT NULL, -- traces.id\n span_id TEXT, -- spans.id; NULL for a note on the whole trace\n kind TEXT NOT NULL, -- 'issue' | 'good' | 'note'\n note TEXT NOT NULL,\n source TEXT NOT NULL, -- 'user' | 'claude-code' | 'codex' | 'agent'\n created_at REAL NOT NULL -- ms since epoch\n);\n";
4189
3212
  //#endregion
4190
3213
  //#region src/trace/local-database-trace-provider.d.ts
4191
3214
  interface LocalDatabaseTraceProviderOptions {
@@ -4237,12 +3260,12 @@ declare class LocalDatabaseTraceProvider extends BaseTraceProvider {
4237
3260
  private ensureReal;
4238
3261
  private open;
4239
3262
  private bridgeTrace;
4240
- getAllTraces(): Promise<TraceSummary[]>;
3263
+ getAllTraces(): Promise<TraceSummary$1[]>;
4241
3264
  hasTrace(traceId: string): Promise<boolean>;
4242
- protected getTraceWithoutSpans(): Promise<Trace | undefined>;
4243
- protected getTraceSpans(): Promise<Span[]>;
3265
+ protected getTraceWithoutSpans(): Promise<Trace$1 | undefined>;
3266
+ protected getTraceSpans(): Promise<Span$1[]>;
4244
3267
  protected addOrUpdateTrace(): Promise<void>;
4245
- protected addOrUpdateSpan(): Promise<Span>;
3268
+ protected addOrUpdateSpan(): Promise<Span$1>;
4246
3269
  protected removeTrace(): Promise<void>;
4247
3270
  /**
4248
3271
  * Deletes a trace, its spans and its annotations. Returns `false` if the database
@@ -4258,25 +3281,25 @@ declare class LocalDatabaseTraceProvider extends BaseTraceProvider {
4258
3281
  query(sql: string, options?: SqlQueryOptions): Promise<SqlQueryResult>;
4259
3282
  /** The tables {@link query} runs against. */
4260
3283
  getQuerySchema(): string;
4261
- getTrace(traceId: string): Promise<TraceWithSpans | undefined>;
4262
- subscribeTrace(traceId: string, callback: (event: TraceStreamEvent) => void): () => void;
4263
- recordSpanStart(span: Span): Promise<Span>;
4264
- recordSpanEnd(span: Span): Promise<Span>;
3284
+ getTrace(traceId: string): Promise<TraceWithSpans$1 | undefined>;
3285
+ subscribeTrace(traceId: string, callback: (event: TraceStreamEvent$1) => void): () => void;
3286
+ recordSpanStart(span: Span$1): Promise<Span$1>;
3287
+ recordSpanEnd(span: Span$1): Promise<Span$1>;
4265
3288
  failTrace(traceId: string, errorMessage: string): Promise<void>;
4266
3289
  /** Lists every annotation on a trace, oldest first. Empty if nothing has been saved yet. */
4267
- listAnnotations(traceId: string): Promise<Annotation[]>;
3290
+ listAnnotations(traceId: string): Promise<Annotation$1[]>;
4268
3291
  /**
4269
3292
  * Creates a new annotation, minting its `id`/`createdAt`. Unlike span
4270
3293
  * recording, this throws when the database can't be opened — someone asked
4271
3294
  * for this note to be saved, so dropping it silently would be worse than
4272
3295
  * the error.
4273
3296
  */
4274
- createAnnotation(input: Omit<Annotation, "id" | "createdAt">): Promise<Annotation>;
3297
+ createAnnotation(input: Omit<Annotation$1, "id" | "createdAt">): Promise<Annotation$1>;
4275
3298
  /**
4276
3299
  * Changes an annotation's `kind` and/or `note`. `undefined` if it doesn't
4277
3300
  * exist — including when the database was never created.
4278
3301
  */
4279
- updateAnnotation(id: string, changes: AnnotationChanges): Promise<Annotation | undefined>;
3302
+ updateAnnotation(id: string, changes: AnnotationChanges$1): Promise<Annotation$1 | undefined>;
4280
3303
  /** Deletes an annotation by id. A no-op if the database was never created. */
4281
3304
  deleteAnnotation(id: string): Promise<void>;
4282
3305
  }
@@ -4317,9 +3340,9 @@ declare class MemoryTraceProvider extends BaseTraceProvider {
4317
3340
  * `OTelTraceIngestor` should be active per server — {@link isRedundant}
4318
3341
  * reports any other instance redundant so server wiring can consolidate.
4319
3342
  */
4320
- declare class OTelTraceIngestor extends BaseTraceIngestor {
3343
+ declare class OTelTraceIngestor extends BaseTraceIngestor$1 {
4321
3344
  private spanPromises;
4322
- isRedundant(other: TraceIngestor): boolean;
3345
+ isRedundant(other: TraceIngestor$1): boolean;
4323
3346
  /**
4324
3347
  * Returns a `SpanProcessor` that funnels every OpenTelemetry span the
4325
3348
  * caller's tracer produces into this ingestor's sinks.
@@ -4413,7 +3436,7 @@ declare function decodeOtlpProtobuf(buf: Uint8Array): {
4413
3436
  * Storage-agnostic like every ingestor: works against `MemoryTraceProvider`
4414
3437
  * in tests and any other `TraceSink` in production with no code change.
4415
3438
  */
4416
- declare class OtlpTraceIngestor extends BaseTraceIngestor {
3439
+ declare class OtlpTraceIngestor extends BaseTraceIngestor$1 {
4417
3440
  /** Ingests one OTLP export batch, already normalized by `./otlp/normalize.ts`. */
4418
3441
  ingest(spans: NormalizedOtlpSpan[]): Promise<void>;
4419
3442
  }
@@ -4438,7 +3461,7 @@ declare class OtlpTraceIngestor extends BaseTraceIngestor {
4438
3461
  * over the old `errorMessage`, status or attributes would describe a failure
4439
3462
  * the retry may not have had.
4440
3463
  */
4441
- declare function mergeSpans(existing: Span, incoming: Span): Span;
3464
+ declare function mergeSpans(existing: Span$1, incoming: Span$1): Span$1;
4442
3465
  //#endregion
4443
3466
  //#region src/trace/trace-event-ingestor.d.ts
4444
3467
  /**
@@ -4447,9 +3470,9 @@ declare function mergeSpans(existing: Span, incoming: Span): Span;
4447
3470
  * {@link TraceSink} calls, so this just replays them, in order, on its own
4448
3471
  * sinks.
4449
3472
  */
4450
- declare class TraceEventIngestor extends BaseTraceIngestor {
3473
+ declare class TraceEventIngestor extends BaseTraceIngestor$1 {
4451
3474
  /** Records one batch of events, in order. */
4452
- ingest(events: TraceSinkEvent[]): Promise<void>;
3475
+ ingest(events: TraceSinkEvent$1[]): Promise<void>;
4453
3476
  }
4454
3477
  //#endregion
4455
3478
  //#region src/trace/turso-trace-provider.d.ts
@@ -4498,7 +3521,7 @@ declare class TursoTraceProvider extends BaseTraceProvider {
4498
3521
  * start or end in the same tick land here concurrently.
4499
3522
  */
4500
3523
  private serializeWrite;
4501
- getAllTraces(): Promise<TraceSummary[]>;
3524
+ getAllTraces(): Promise<TraceSummary$1[]>;
4502
3525
  /**
4503
3526
  * Runs one read-only query against the `traces`, `spans`, and
4504
3527
  * `annotations` tables.
@@ -4507,9 +3530,9 @@ declare class TursoTraceProvider extends BaseTraceProvider {
4507
3530
  /** The tables {@link query} runs against — see `./db/query-schema.ts`. */
4508
3531
  getQuerySchema(): string;
4509
3532
  hasTrace(traceId: string): Promise<boolean>;
4510
- protected getTraceWithoutSpans(traceId: string): Promise<Trace | undefined>;
4511
- protected getTraceSpans(traceId: string): Promise<Span[]>;
4512
- protected addOrUpdateTrace(trace: Trace): Promise<void>;
3533
+ protected getTraceWithoutSpans(traceId: string): Promise<Trace$1 | undefined>;
3534
+ protected getTraceSpans(traceId: string): Promise<Span$1[]>;
3535
+ protected addOrUpdateTrace(trace: Trace$1): Promise<void>;
4513
3536
  /**
4514
3537
  * Deletes just the `traces` row — its spans go via the
4515
3538
  * `trg_spans_cascade_delete_trace` trigger, and its annotations via their
@@ -4524,18 +3547,18 @@ declare class TursoTraceProvider extends BaseTraceProvider {
4524
3547
  * `serializeWrite` slot), so a concurrent write can't interleave
4525
3548
  * between the read and the write.
4526
3549
  */
4527
- protected addOrUpdateSpan(span: Span): Promise<Span>;
3550
+ protected addOrUpdateSpan(span: Span$1): Promise<Span$1>;
4528
3551
  /** Lists every annotation on a trace, oldest first. */
4529
- listAnnotations(traceId: string): Promise<Annotation[]>;
3552
+ listAnnotations(traceId: string): Promise<Annotation$1[]>;
4530
3553
  /** Creates a new annotation, minting its `id`/`createdAt`. */
4531
- createAnnotation(input: Omit<Annotation, "id" | "createdAt">): Promise<Annotation>;
3554
+ createAnnotation(input: Omit<Annotation$1, "id" | "createdAt">): Promise<Annotation$1>;
4532
3555
  /**
4533
3556
  * Changes an annotation's `kind` and/or `note`. Returns it as updated, or
4534
3557
  * `undefined` if it doesn't exist.
4535
3558
  */
4536
- updateAnnotation(id: string, changes: AnnotationChanges): Promise<Annotation | undefined>;
3559
+ updateAnnotation(id: string, changes: AnnotationChanges$1): Promise<Annotation$1 | undefined>;
4537
3560
  /** Deletes an annotation by id. A no-op if it doesn't exist. */
4538
3561
  deleteAnnotation(id: string): Promise<void>;
4539
3562
  }
4540
3563
  //#endregion
4541
- export { type AddPromptContext, type AddPromptField, type Annotation, type AnnotationChanges, type AnnotationEvent, type AnnotationEventOp, type AnnotationKind, type AnnotationSource, BaseTraceIngestor, BaseTraceProvider, CHECK_ATTRIBUTE, type CalleeBinding, type ChangeEventType, type ChatPromptUpdates, type Check, type CheckDefinition, type CheckInfo, type CheckOutcome, type CheckRun, type ColumnPath, type ConflictChoices, type CreateDatasetInput, DEFAULT_EVAL_CONCURRENCY, DEFAULT_MAX_QUERY_ROWS, DEFAULT_PLAYGROUND_IGNORE_PATTERNS, DEFAULT_PLAYGROUND_INCLUDE_PATTERNS, DEFAULT_QUERY_TIMEOUT_MS, DEPLOYMENT_ENVIRONMENT_ATTRIBUTE, type Dataset, type DatasetChangeEvent, type DatasetChangeType, type DatasetColumnSpec, type DatasetField, type DatasetFieldShape, type DatasetInstanceShape, DatasetNotFoundError, type DatasetPathChild, type DatasetProvider, type DatasetProviderInfo, type DatasetRow, type DatasetRowSource, type DatasetRowUpdate, type DatasetRowsOverview, type DatasetSummary, DatasetValidationError, type DeclaredInstance, type DynamicResourceDefinition, type EvalArm, type EvalArmSpec, type EvalChangeEvent, type EvalChangeType, type EvalCheck, type EvalCheckOutcome, type EvalCheckResult, type EvalCounts, type EvalDefinition, type EvalDefinitionPatch, type EvalInputs, EvalNotFoundError, type EvalProvider, type EvalProviderInfo, type EvalResults, type EvalRowResult, type EvalRowStatus, type EvalRun, type EvalRunProgress, EvalRunRefusedError, type EvalRunStatus, type EvalRunSummary, EvalRunner, type EvalRunnerOptions, type EvalSummary, type EvalTraceRun, type EvalutionConfig, type ExecuteConfigOptions, type ExecuteOptions, type ExecuteRequest, type ExecuteResponse, type ExecuteResult, type ExecutionHandle, type ExecutionInput, type ExtractedProps, type FactoriesProbe, type FieldValues, type FilePromptMetadata, FilePromptProvider, type FilePromptProviderOptions, type FileProvider, type FileWatchCallback, type FileWatchOptions, type ForeignColumnSpec, GeminiInteractionsSDK, GitVersioning, type GitVersioningOptions, type GlobOptions, type HeadState, HttpTraceSink, type HttpTraceSinkOptions, type ImportOptions, type InputBindings, type InputLayout, type InputSignature, type InputSlot, type InputSource, type InstanceResolver, type KnownColumnSpec, type LLMSpanDetails, type ListRowsOptions, LocalDatabaseTraceProvider, type LocalDatabaseTraceProviderOptions, LocalDirectoryDatasetProvider, type LocalDirectoryDatasetProviderOptions, LocalEvalProvider, type LocalEvalProviderOptions, LocalFileProvider, type LocalTursoClientOptions, LocalVariationStore, MIGRATIONS_TABLE, MemoryFileProvider, MemoryTraceProvider, type MergeOutcome, type NewDatasetRow, type NewEvalDefinition, type NewEvalRun, type NewWip, type NormalizedChatPrompt, type NormalizedFilePrompt, type NormalizedMessage, type NormalizedOtlpEvent, type NormalizedOtlpSpan, type NormalizedParameter, type NormalizedPrompt, type NormalizedPromptBase, type NormalizedPromptUpdates, type NormalizedQuestionsPrompt, type NormalizedToolCall, OTelTraceIngestor, type OpenOnHeadOptions, OtlpTraceIngestor, OverlayFileProvider, PLAYGROUND_ENVIRONMENT, PLAYGROUND_RESOURCE, PROMPT_FIELD, PROMPT_IDENTITY, PROMPT_ID_ATTRIBUTE, PROMPT_INPUTS_ATTRIBUTE, PROMPT_NAME_ATTRIBUTE, PROMPT_PROVIDER_ID_ATTRIBUTE, PROMPT_VARIATION_ATTRIBUTE, PROMPT_VERSION_ATTRIBUTE, type ParsePromptsOptions, type ParsedFilePrompt, type ParsedPrompt, type PendingConflicts, type PerPromptTelemetry, type PerTraceTelemetry, type PlaygroundModuleError, type PreparedCheck, type ProbeResult, type ProbeResults, type ProjectProbeRequest, type PromptChangeEvent, type PromptFileType, type PromptID, type PromptInputSources, type PromptProvider, type PromptProviderInfo, type PromptRef, type PromptRefLike, type PromptSpanInfo, type PromptStyle, type PromptVariations, type PromptVersions, type PromptsFactory, type PromptsHelper, type PromptsHelperOptions, type PropDefinition, type PropType, type PropValue, type QuestionsPromptUpdates, type ReadOnlyQueryRunner, type RebaseResult, type RegisteredCheck, type RegisteredResource, type RegisteredSource, type ResolutionContext, type ResolvedPromptInputs, type ResolvedResourceInputs, type Resource, type ResourceBinding, type ResourceDefinition, type ResourceInfo, type ResourceInput, type ResourceInputs, type ResourceInstance, type ResourceInstanceInput, type ResourceLease, type ResourceOutputDefinition, ResourceRegistry, type ResourceScope, type RunResources, type SDKAdapter, SERVICE_NAME_ATTRIBUTE, SPAN_KIND_ATTRIBUTE, type SlotMatchRequest, type SlotMatchSource, type SourceSpan, type Span, type SpanContentPart, type SpanImagePart, type SpanKind, type SpanMessage, type SpanMessageRole, type SpanTextPart, type SpanToolCallPart, type SpanToolResultPart, SqlQueryError, type SqlQueryOptions, type SqlQueryResult, type StartEvalRunOptions, type StaticResourceDefinition, type StoredVariation, type SystemOneCallOptions, type SystemOneCallRecord, TRACE_EVENTS_PATH, TRACE_QUERY_SCHEMA, TSPromptFileType, type ToolSpanDetails, type Trace, type TraceChangeEvent, type TraceChangeType, type TraceCheckResult, type TraceEvalRun, TraceEventIngestor, type TraceEventsRequest, type TraceIngestor, type TraceLiveEvent, type TraceProvider, type TraceProviderInfo, type TraceSink, type TraceSinkEvent, type TraceStreamEvent, type TraceSummary, type TraceWithSpans, type TursoCreateDatasetOptions, TursoDatasetProvider, TursoEvalProvider, TursoTraceProvider, TursoVariationStore, type TypeExpressionProbe, type TypeProbe, type TypeProbeRequest, type TypeResolutionRequest, type TypeResolutionResult, TypeSafeSDK, type TypeSafeSDKOptions, TypeSafeTelemetry, type UpdatePromptResponse, type UpdatePromptResult, type ValueCatalog, type ValueCatalogGroup, type ValueCatalogPreset, type ValueFactory, type VariationConflict, VariationConflictError, type VariationContent, type VariationId, type VariationInfo, type VariationStore, VercelAISDK, VercelAISDKTelemetry, type VercelAISDKTelemetryOptions, type VersionHistoryOptions, type VersionId, type VersionInfo, type VersioningAdapter, type WipChanges, assertUpdateStyle, canonicalizeUpdates, check, collectInputSlots, createLocalTursoClient, createTracerForPrompt, decodeOtlpProtobuf, fieldValuesOf, findInputCycle, getPromptSpanAttributes, inputReferenceProblems, isCheck, isCheckSpan, isFreshImportHookRegistered, isResource, isStandardSchema, isValidInstanceName, isVariationLoaderHookRegistered, matchSourcesToSlots, mergeIntoWip, mergePromptIdentity, mergeSpans, mergeUpdates, namedBindings, normalizeOtlpRequest, openLocalEvalProvider, openLocalVariationStore, promptIdOf, rebaseUpdates, registerFreshImportHook, registerVariationLoaderHook, resolveConflicts, resolveExecutionInput, resolveExecutionInputs, resource, resourceParameterNames, runDatasetMigrations, runEvalMigrations, runMigrations, runVariationMigrations, serializeUpdates, setupGlobalOTelPipeline, spanMessages, stampReceipts, toPromptRef };
3564
+ export { type AddPromptContext, type AddPromptField, type Annotation, type AnnotationChanges, type AnnotationEvent, type AnnotationEventOp, type AnnotationKind, type AnnotationSource, BaseTraceIngestor, BaseTraceProvider, CHECK_ATTRIBUTE, type CalleeBinding, type ChangeEventType, type ChatPromptUpdates, type Check, type CheckDefinition, type CheckInfo, type CheckOutcome, type CheckRun, type ColumnPath, type ConflictChoices, type CreateDatasetInput, DEFAULT_EVAL_CONCURRENCY, DEFAULT_MAX_QUERY_ROWS, DEFAULT_PLAYGROUND_IGNORE_PATTERNS, DEFAULT_PLAYGROUND_INCLUDE_PATTERNS, DEFAULT_QUERY_TIMEOUT_MS, DEPLOYMENT_ENVIRONMENT_ATTRIBUTE, type Dataset, type DatasetChangeEvent, type DatasetChangeType, type DatasetColumnSpec, type DatasetField, type DatasetFieldShape, type DatasetInstanceShape, DatasetNotFoundError, type DatasetPathChild, type DatasetProvider, type DatasetProviderInfo, type DatasetRow, type DatasetRowSource, type DatasetRowUpdate, type DatasetRowsOverview, type DatasetSummary, DatasetValidationError, type DeclaredInstance, type DynamicResourceDefinition, type EvalArm, type EvalArmSpec, type EvalChangeEvent, type EvalChangeType, type EvalCheck, type EvalCheckOutcome, type EvalCheckResult, type EvalCounts, type EvalDefinition, type EvalDefinitionPatch, type EvalInputs, EvalNotFoundError, type EvalProvider, type EvalProviderInfo, type EvalResults, type EvalRowResult, type EvalRowStatus, type EvalRun, type EvalRunProgress, EvalRunRefusedError, type EvalRunStatus, type EvalRunSummary, EvalRunner, type EvalRunnerOptions, type EvalSummary, type EvalTraceRun, Evalution, type EvalutionConfig, type EvalutionOptions, type ExecuteConfigOptions, type ExecuteOptions, type ExecuteRequest, type ExecuteResponse, type ExecuteResult, type ExecutionHandle, type ExecutionInput, type ExtractedProps, type FactoriesProbe, type FieldValues, type FilePromptMetadata, FilePromptProvider, type FilePromptProviderOptions, type FileProvider, type FileWatchCallback, type FileWatchOptions, type ForeignColumnSpec, GitVersioning, type GitVersioningOptions, type GlobOptions, type HeadState, HttpTraceSink, type HttpTraceSinkOptions, type HttpTraceTarget, type ImportOptions, type InputBindings, type InputLayout, type InputSignature, type InputSlot, type InputSource, type InstanceResolver, type KnownColumnSpec, type LLMSpanDetails, type ListRowsOptions, LocalDatabaseTraceProvider, type LocalDatabaseTraceProviderOptions, LocalDirectoryDatasetProvider, type LocalDirectoryDatasetProviderOptions, LocalEvalProvider, type LocalEvalProviderOptions, LocalFileProvider, type LocalTursoClientOptions, LocalVariationStore, MIGRATIONS_TABLE, MemoryFileProvider, MemoryTraceProvider, type MergeOutcome, type NewDatasetRow, type NewEvalDefinition, type NewEvalRun, type NewWip, type NormalizedChatPrompt, type NormalizedFilePrompt, type NormalizedMessage, type NormalizedOtlpEvent, type NormalizedOtlpSpan, type NormalizedParameter, type NormalizedPrompt, type NormalizedPromptBase, type NormalizedPromptUpdates, type NormalizedQuestionsPrompt, type NormalizedToolCall, OTelTraceIngestor, type OpenOnHeadOptions, OtlpTraceIngestor, OverlayFileProvider, PLAYGROUND_ENVIRONMENT, PLAYGROUND_RESOURCE, PROMPT_FIELD, PROMPT_ID_ATTRIBUTE, PROMPT_INPUTS_ATTRIBUTE, PROMPT_NAME_ATTRIBUTE, PROMPT_PROVIDER_ID_ATTRIBUTE, PROMPT_VARIATION_ATTRIBUTE, PROMPT_VERSION_ATTRIBUTE, type ParsePromptsOptions, type ParsedFilePrompt, type ParsedPrompt, type PendingConflicts, type PlaygroundModuleError, type PreparedCheck, type ProbeResult, type ProbeResults, type ProjectProbeRequest, type PromptChangeEvent, type PromptFileType, type PromptID, type PromptInputSources, type PromptProvider, type PromptProviderInfo, type PromptRef, type PromptRefLike, type PromptSpanInfo, type PromptStyle, type PromptVariations, type PromptVersions, type PromptsFactory, type PromptsHelper, type PromptsHelperOptions, type PropDefinition, type PropType, type PropValue, type QuestionsPromptUpdates, type ReadOnlyQueryRunner, type RebaseResult, type RegisteredCheck, type RegisteredResource, type RegisteredSource, type ResolutionContext, type ResolvedPromptInputs, type ResolvedResourceInputs, type Resource, type ResourceBinding, type ResourceDefinition, type ResourceInfo, type ResourceInput, type ResourceInputs, type ResourceInstance, type ResourceInstanceInput, type ResourceLease, type ResourceOutputDefinition, ResourceRegistry, type ResourceScope, type RunResources, type SDKAdapter, SERVICE_NAME_ATTRIBUTE, SPAN_KIND_ATTRIBUTE, type SlotMatchRequest, type SlotMatchSource, type SourceSpan, type Span, type SpanContentPart, type SpanImagePart, type SpanKind, type SpanMessage, type SpanMessageRole, type SpanReasoningPart, type SpanTextPart, type SpanToolCallPart, type SpanToolResultPart, SqlQueryError, type SqlQueryOptions, type SqlQueryResult, type StartEvalRunOptions, type StaticResourceDefinition, type StoredVariation, TRACE_EVENTS_PATH, TRACE_QUERY_SCHEMA, TSPromptFileType, type ToolSpanDetails, type Trace, type TraceChangeEvent, type TraceChangeType, type TraceCheckResult, type TraceEvalRun, TraceEventIngestor, type TraceEventsRequest, type TraceIngestor, type TraceLiveEvent, type TraceProvider, type TraceProviderInfo, type TraceSink, type TraceSinkEvent, type TraceStreamEvent, type TraceSummary, type TraceWithSpans, type TursoCreateDatasetOptions, TursoDatasetProvider, TursoEvalProvider, TursoTraceProvider, TursoVariationStore, type TypeExpressionProbe, type TypeProbe, type TypeProbeRequest, type TypeResolutionRequest, type TypeResolutionResult, type UpdatePromptResponse, type UpdatePromptResult, type ValueCatalog, type ValueCatalogGroup, type ValueCatalogPreset, type ValueFactory, type VariationConflict, VariationConflictError, type VariationContent, type VariationId, type VariationInfo, type VariationStore, type VersionHistoryOptions, type VersionId, type VersionInfo, type VersioningAdapter, type WipChanges, assertUpdateStyle, canonicalizeUpdates, check, collectInputSlots, createLocalTursoClient, createTracerForPrompt, decodeOtlpProtobuf, fieldValuesOf, findInputCycle, getPromptSpanAttributes, inputReferenceProblems, isCheck, isCheckSpan, isFreshImportHookRegistered, isResource, isStandardSchema, isValidInstanceName, isVariationLoaderHookRegistered, matchSourcesToSlots, mergeIntoWip, mergePromptIdentity, mergeSpans, mergeUpdates, namedBindings, normalizeOtlpRequest, openLocalEvalProvider, openLocalVariationStore, promptIdOf, rebaseUpdates, registerFreshImportHook, registerVariationLoaderHook, resolveConflicts, resolveExecutionInput, resolveExecutionInputs, resource, resourceParameterNames, runDatasetMigrations, runEvalMigrations, runMigrations, runVariationMigrations, serializeUpdates, setupGlobalOTelPipeline, spanMessages, stampReceipts, toPromptRef };