@absolutejs/absolute 0.19.0-beta.534 → 0.19.0-beta.536

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  export { aiChat } from '../plugins/aiChat';
2
2
  export { streamAI } from './streamAI';
3
3
  export { ragChat } from './rag';
4
- export { buildRAGAnswerGroundingCaseDifficultyLeaderboard, buildRAGAnswerGroundingCaseDifficultyRunDiff, buildRAGAnswerGroundingEvaluationResponse, buildRAGAnswerGroundingEvaluationLeaderboard, buildRAGAnswerGroundingEvaluationRunDiff, buildRAGContext, buildRAGComparisonTraceDiffRows, buildRAGComparisonTraceSummaryRows, buildRAGEvaluationLeaderboard, buildRAGEvaluationHistoryRows, buildRAGEvaluationResponse, buildRAGEvaluationRunDiff, compareRAGRetrievalStrategies, compareRAGRerankers, createRAGFileAnswerGroundingCaseDifficultyHistoryStore, createRAGFileAnswerGroundingEvaluationHistoryStore, createRAGBunS3SyncClient, createRAGFileEvaluationHistoryStore, createRAGEvaluationSuite, createRAGDirectorySyncSource, createRAGEmailSyncSource, createRAGGmailEmailSyncClient, createRAGFileSyncStateStore, createRAGGraphEmailSyncClient, createRAGIMAPEmailSyncClient, createRAGStaticEmailSyncClient, createRAGStorageSyncSource, evaluateRAGAnswerGrounding, evaluateRAGAnswerGroundingCase, evaluateRAGCollection, executeDryRunRAGEvaluation, loadRAGAnswerGroundingCaseDifficultyHistory, loadRAGAnswerGroundingEvaluationHistory, loadRAGEvaluationHistory, persistRAGAnswerGroundingCaseDifficultyRun, persistRAGAnswerGroundingEvaluationRun, persistRAGEvaluationSuiteRun, runRAGEvaluationSuite, summarizeRAGEvaluationCase, summarizeRAGRerankerComparison, buildRAGCitations, buildRAGCitationReferenceMap, buildRAGLexicalHaystack, buildRAGGroundedAnswer, buildRAGGroundingReferences, buildRAGSourceGroups, buildRAGSourceSummaries, buildRAGUpsertInputFromDirectory, buildRAGUpsertInputFromDocuments, createBuiltinArchiveExpander, createEmailExtractor, createEPUBExtractor, createLegacyDocumentExtractor, createRAGPDFOCRExtractor, createRAGArchiveExpander, createRAGArchiveFileExtractor, createOfficeDocumentExtractor, createPDFFileExtractor, createRAGCollection, createRAGEmbeddingProvider, createRAGFileExtractor, createRAGImageOCRExtractor, createHeuristicRAGReranker, createHeuristicRAGQueryTransform, createRAGHTMXConfig, createRAGMediaFileExtractor, createRAGMediaTranscriber, createRAGSyncManager, createRAGSyncScheduler, createRAGOCRProvider, createRAGUrlSyncSource, createRAGQueryTransform, createRAGReranker, fuseRAGQueryResults, createTextFileExtractor, createRAGHTMXWorkflowRenderConfig, alibabaEmbeddings, anthropicOCR, deepseekEmbeddings, geminiEmbeddings, geminiOCR, getLatestAssistantMessage, getLatestRAGSources, buildRAGStreamProgress, googleEmbeddings, ingestDocuments, ingestRAGDocuments, loadRAGDocumentFile, loadRAGDocumentsFromDirectory, loadRAGDocumentFromURL, loadRAGDocumentsFromURLs, metaEmbeddings, mistralaiEmbeddings, moonshotEmbeddings, ollamaEmbeddings, ollamaOCR, ollamaTranscriber, openaiCompatibleEmbeddings, openaiCompatibleOCR, openaiCompatibleTranscriber, openaiEmbeddings, openaiOCR, openaiTranscriber, prepareRAGDirectoryDocuments, buildRAGUpsertInputFromUploads, loadRAGDocumentUpload, loadRAGDocumentsFromUploads, buildRAGUpsertInputFromURLs, prepareRAGDocument, prepareRAGDocumentFile, prepareRAGDocuments, ragPlugin, resolveRAGQueryTransform, resolveRAGEmbeddingProvider, resolveRAGHybridSearchOptions, resolveRAGReranker, resolveRAGStreamStage, searchDocuments, scoreRAGLexicalMatch, applyRAGReranking, applyRAGQueryTransform, validateRAGEmbeddingDimensions, xaiEmbeddings } from './rag';
4
+ export { buildRAGAnswerGroundingCaseDifficultyLeaderboard, buildRAGAnswerGroundingCaseDifficultyRunDiff, buildRAGAnswerGroundingEvaluationResponse, buildRAGAnswerGroundingEvaluationLeaderboard, buildRAGAnswerGroundingEvaluationRunDiff, buildRAGContext, buildRAGComparisonTraceDiffRows, buildRAGComparisonTraceSummaryRows, buildRAGEvaluationLeaderboard, buildRAGEvaluationHistoryRows, buildRAGEvaluationResponse, buildRAGEvaluationRunDiff, compareRAGRetrievalStrategies, compareRAGRerankers, createRAGFileAnswerGroundingCaseDifficultyHistoryStore, createRAGFileAnswerGroundingEvaluationHistoryStore, createRAGBunS3SyncClient, createRAGFileEvaluationHistoryStore, createRAGEvaluationSuite, createRAGDirectorySyncSource, createRAGEmailSyncSource, createRAGGmailEmailSyncClient, createRAGFileSyncStateStore, createRAGGraphEmailSyncClient, createRAGIMAPEmailSyncClient, createRAGStaticEmailSyncClient, createRAGStorageSyncSource, evaluateRAGAnswerGrounding, evaluateRAGAnswerGroundingCase, evaluateRAGCollection, executeDryRunRAGEvaluation, loadRAGAnswerGroundingCaseDifficultyHistory, loadRAGAnswerGroundingEvaluationHistory, loadRAGEvaluationHistory, persistRAGAnswerGroundingCaseDifficultyRun, persistRAGAnswerGroundingEvaluationRun, persistRAGEvaluationSuiteRun, runRAGEvaluationSuite, summarizeRAGEvaluationCase, summarizeRAGRerankerComparison, buildRAGCitations, buildRAGCitationReferenceMap, buildRAGLexicalHaystack, buildRAGGroundedAnswer, buildRAGGroundingReferences, buildRAGRetrievalTracePresentation, buildRAGSourceGroups, buildRAGSourceSummaries, buildRAGUpsertInputFromDirectory, buildRAGUpsertInputFromDocuments, createBuiltinArchiveExpander, createEmailExtractor, createEPUBExtractor, createLegacyDocumentExtractor, createRAGPDFOCRExtractor, createRAGArchiveExpander, createRAGArchiveFileExtractor, createOfficeDocumentExtractor, createPDFFileExtractor, createRAGCollection, createRAGEmbeddingProvider, createRAGFileExtractor, createRAGImageOCRExtractor, createHeuristicRAGReranker, createHeuristicRAGQueryTransform, createRAGHTMXConfig, createRAGMediaFileExtractor, createRAGMediaTranscriber, createRAGSyncManager, createRAGSyncScheduler, createRAGOCRProvider, createRAGUrlSyncSource, createRAGQueryTransform, createRAGReranker, formatRAGTraceValue, fuseRAGQueryResults, createTextFileExtractor, createRAGHTMXWorkflowRenderConfig, alibabaEmbeddings, anthropicOCR, deepseekEmbeddings, geminiEmbeddings, geminiOCR, getLatestAssistantMessage, getLatestRAGSources, buildRAGStreamProgress, googleEmbeddings, ingestDocuments, ingestRAGDocuments, loadRAGDocumentFile, loadRAGDocumentsFromDirectory, loadRAGDocumentFromURL, loadRAGDocumentsFromURLs, metaEmbeddings, mistralaiEmbeddings, moonshotEmbeddings, ollamaEmbeddings, ollamaOCR, ollamaTranscriber, openaiCompatibleEmbeddings, openaiCompatibleOCR, openaiCompatibleTranscriber, openaiEmbeddings, openaiOCR, openaiTranscriber, prepareRAGDirectoryDocuments, buildRAGUpsertInputFromUploads, loadRAGDocumentUpload, loadRAGDocumentsFromUploads, buildRAGUpsertInputFromURLs, prepareRAGDocument, prepareRAGDocumentFile, prepareRAGDocuments, ragPlugin, resolveRAGQueryTransform, resolveRAGEmbeddingProvider, resolveRAGHybridSearchOptions, resolveRAGReranker, resolveRAGStreamStage, searchDocuments, scoreRAGLexicalMatch, applyRAGReranking, applyRAGQueryTransform, validateRAGEmbeddingDimensions, xaiEmbeddings } from './rag';
5
5
  export { createInMemoryRAGStore } from './rag/adapters/inMemory';
6
6
  export { createSQLiteRAGStore } from './rag/adapters/sqlite';
7
7
  export { resolveAbsoluteSQLiteVec, resolveAbsoluteSQLiteVecExtensionPath } from './rag/resolveAbsoluteSQLiteVec';
@@ -8,7 +8,7 @@ export { alibabaEmbeddings, deepseekEmbeddings, geminiEmbeddings, googleEmbeddin
8
8
  export { anthropicOCR, geminiOCR, ollamaOCR, ollamaTranscriber, openaiCompatibleOCR, openaiCompatibleTranscriber, openaiOCR, openaiTranscriber } from './extractorProviders';
9
9
  export { createRAGGmailEmailSyncClient, createRAGGraphEmailSyncClient, createRAGIMAPEmailSyncClient } from './emailProviders';
10
10
  export { buildRAGUpsertInputFromDirectory, buildRAGUpsertInputFromDocuments, buildRAGUpsertInputFromUploads, createBuiltinArchiveExpander, createEmailExtractor, createEPUBExtractor, createLegacyDocumentExtractor, createRAGPDFOCRExtractor, createRAGArchiveExpander, createRAGArchiveFileExtractor, createOfficeDocumentExtractor, createPDFFileExtractor, createRAGFileExtractor, createRAGImageOCRExtractor, createRAGMediaFileExtractor, createRAGMediaTranscriber, createRAGOCRProvider, createTextFileExtractor, loadRAGDocumentFromURL, loadRAGDocumentUpload, loadRAGDocumentsFromUploads, buildRAGUpsertInputFromURLs, loadRAGDocumentFile, loadRAGDocumentsFromDirectory, loadRAGDocumentsFromURLs, prepareRAGDirectoryDocuments, prepareRAGDocument, prepareRAGDocumentFile, prepareRAGDocuments } from './ingestion';
11
- export { buildRAGAnswerWorkflowState, buildRAGCitations, buildRAGCitationReferenceMap, buildRAGGroundedAnswer, buildRAGGroundingReferences, buildRAGSourceGroups, buildRAGSourceSummaries, buildRAGStreamProgress, getLatestAssistantMessage, getLatestRAGSources, resolveRAGStreamStage } from './presentation';
11
+ export { buildRAGAnswerWorkflowState, buildRAGCitations, buildRAGCitationReferenceMap, buildRAGGroundedAnswer, buildRAGGroundingReferences, buildRAGRetrievalTracePresentation, buildRAGSourceGroups, buildRAGSourceSummaries, buildRAGStreamProgress, formatRAGTraceValue, getLatestAssistantMessage, getLatestRAGSources, resolveRAGStreamStage } from './presentation';
12
12
  export { buildRAGContext } from './types';
13
13
  export { buildRAGAnswerGroundingCaseDifficultyLeaderboard, buildRAGAnswerGroundingCaseDifficultyRunDiff, buildRAGAnswerGroundingEvaluationResponse, buildRAGAnswerGroundingEvaluationLeaderboard, buildRAGAnswerGroundingEvaluationRunDiff, buildRAGComparisonTraceDiffRows, buildRAGComparisonTraceSummaryRows, buildRAGEvaluationLeaderboard, buildRAGEvaluationHistoryRows, buildRAGEvaluationResponse, buildRAGEvaluationRunDiff, compareRAGRetrievalStrategies, compareRAGRerankers, createRAGFileAnswerGroundingCaseDifficultyHistoryStore, createRAGFileAnswerGroundingEvaluationHistoryStore, createRAGFileEvaluationHistoryStore, createRAGEvaluationSuite, evaluateRAGAnswerGrounding, evaluateRAGAnswerGroundingCase, evaluateRAGCollection, executeDryRunRAGEvaluation, loadRAGAnswerGroundingCaseDifficultyHistory, loadRAGAnswerGroundingEvaluationHistory, loadRAGEvaluationHistory, persistRAGAnswerGroundingCaseDifficultyRun, persistRAGAnswerGroundingEvaluationRun, persistRAGEvaluationSuiteRun, runRAGEvaluationSuite, summarizeRAGEvaluationCase, summarizeRAGRerankerComparison } from './quality';
14
14
  export { createRAGBunS3SyncClient, createRAGDirectorySyncSource, createRAGEmailSyncSource, createRAGFileSyncStateStore, createRAGStaticEmailSyncClient, createRAGStorageSyncSource, createRAGSyncManager, createRAGSyncScheduler, createRAGUrlSyncSource } from './sync';
@@ -1,4 +1,6 @@
1
- import type { AIMessage, RAGAnswerWorkflowState, RAGCitation, RAGCitationReferenceMap, RAGGroundedAnswer, RAGGroundingReference, RAGRetrievalTrace, RAGSourceSummary, RAGStreamStage, RAGSource, RAGSourceGroup } from '../../../types/ai';
1
+ import type { AIMessage, RAGAnswerWorkflowState, RAGCitation, RAGCitationReferenceMap, RAGGroundedAnswer, RAGGroundingReference, RAGRetrievalTrace, RAGRetrievalTracePresentation, RAGSourceSummary, RAGStreamStage, RAGSource, RAGSourceGroup } from '../../../types/ai';
2
+ export declare const formatRAGTraceValue: (value: unknown) => string;
3
+ export declare const buildRAGRetrievalTracePresentation: (trace?: RAGRetrievalTrace) => RAGRetrievalTracePresentation;
2
4
  export declare const buildRAGCitationReferenceMap: (citations: RAGCitation[]) => RAGCitationReferenceMap;
3
5
  export declare const buildRAGCitations: (sources: RAGSource[]) => RAGCitation[];
4
6
  export declare const buildRAGGroundedAnswer: (content: string, sources: RAGSource[]) => RAGGroundedAnswer;
@@ -1,4 +1,4 @@
1
- import type { RAGAnswerGroundingCaseDifficultyHistory, RAGAnswerGroundingCaseDifficultyHistoryStore, RAGAnswerGroundingCaseDifficultyRun, RAGAnswerGroundingCaseDifficultyRunDiff, RAGAnswerGroundingEvaluationCase, RAGAnswerGroundingEvaluationCaseDifficultyEntry, RAGAnswerGroundingEvaluationCaseResult, RAGAnswerGroundingEvaluationHistory, RAGAnswerGroundingEvaluationLeaderboardEntry, RAGAnswerGroundingEvaluationHistoryStore, RAGAnswerGroundingEvaluationInput, RAGAnswerGroundingEvaluationResponse, RAGAnswerGroundingEvaluationRun, RAGAnswerGroundingEvaluationRunDiff, RAGCollection, RAGEvaluationCase, RAGEvaluationCaseResult, RAGEvaluationHistory, RAGEvaluationHistoryStore, RAGEvaluationInput, RAGEvaluationLeaderboardEntry, RAGEvaluationResponse, RAGEvaluationRunDiff, RAGLabelValueRow, RAGEvaluationSuite, RAGEvaluationSuiteRun, RAGRetrievalCandidate, RAGRetrievalComparison, RAGRetrievalComparisonEntry, RAGRetrievalComparisonSummary, RAGRerankerCandidate, RAGRerankerComparison, RAGRerankerComparisonEntry, RAGRerankerComparisonSummary, RAGRerankerProviderLike } from '../../../types/ai';
1
+ import type { RAGAnswerGroundingCaseDifficultyHistory, RAGAnswerGroundingCaseDifficultyHistoryStore, RAGAnswerGroundingCaseDifficultyRun, RAGAnswerGroundingCaseDifficultyRunDiff, RAGAnswerGroundingEvaluationCase, RAGAnswerGroundingEvaluationCaseDifficultyEntry, RAGAnswerGroundingEvaluationCaseResult, RAGAnswerGroundingEvaluationHistory, RAGAnswerGroundingEvaluationLeaderboardEntry, RAGAnswerGroundingEvaluationHistoryStore, RAGAnswerGroundingEvaluationInput, RAGAnswerGroundingEvaluationResponse, RAGAnswerGroundingEvaluationRun, RAGAnswerGroundingEvaluationRunDiff, RAGCollection, RAGEvaluationCase, RAGEvaluationCaseTraceSnapshot, RAGEvaluationCaseResult, RAGEvaluationHistory, RAGEvaluationHistoryStore, RAGEvaluationInput, RAGEvaluationLeaderboardEntry, RAGEvaluationResponse, RAGEvaluationRunDiff, RAGLabelValueRow, RAGEvaluationSuite, RAGEvaluationSuiteRun, RAGRetrievalCandidate, RAGRetrievalComparison, RAGRetrievalComparisonEntry, RAGRetrievalTraceComparisonSummary, RAGRetrievalComparisonSummary, RAGRerankerCandidate, RAGRerankerComparison, RAGRerankerComparisonEntry, RAGRerankerComparisonSummary, RAGRerankerProviderLike } from '../../../types/ai';
2
2
  export declare const buildRAGEvaluationLeaderboard: (runs: RAGEvaluationSuiteRun[]) => RAGEvaluationLeaderboardEntry[];
3
3
  export declare const buildRAGAnswerGroundingEvaluationLeaderboard: (runs: RAGAnswerGroundingEvaluationRun[]) => RAGAnswerGroundingEvaluationLeaderboardEntry[];
4
4
  export declare const buildRAGAnswerGroundingCaseDifficultyLeaderboard: (entries: Array<{
@@ -77,11 +77,13 @@ export declare const evaluateRAGCollection: ({ collection, input, defaultTopK, r
77
77
  rerank?: RAGRerankerProviderLike;
78
78
  }) => Promise<RAGEvaluationResponse>;
79
79
  export declare const executeDryRunRAGEvaluation: (input: RAGEvaluationInput, defaultTopK?: number) => RAGEvaluationCaseResult[];
80
- export declare const runRAGEvaluationSuite: ({ suite, evaluate, overrides }: {
80
+ export declare const runRAGEvaluationSuite: ({ suite, evaluate, overrides, artifacts }: {
81
81
  suite: RAGEvaluationSuite;
82
82
  evaluate: (input: RAGEvaluationInput) => Promise<RAGEvaluationResponse>;
83
83
  overrides?: Partial<RAGEvaluationInput>;
84
+ artifacts?: Pick<RAGEvaluationSuiteRun, "traceSummary" | "caseTraceSnapshots">;
84
85
  }) => Promise<{
86
+ caseTraceSnapshots: RAGEvaluationCaseTraceSnapshot[] | undefined;
85
87
  elapsedMs: number;
86
88
  finishedAt: number;
87
89
  id: `${string}-${string}-${string}-${string}-${string}`;
@@ -90,6 +92,7 @@ export declare const runRAGEvaluationSuite: ({ suite, evaluate, overrides }: {
90
92
  response: RAGEvaluationResponse;
91
93
  startedAt: number;
92
94
  suiteId: string;
95
+ traceSummary: RAGRetrievalTraceComparisonSummary | undefined;
93
96
  }>;
94
97
  export declare const summarizeRAGEvaluationCase: ({ caseIndex, caseInput, query, mode, retrievedIds, expectedIds, elapsedMs }: {
95
98
  caseIndex: number;
@@ -40,6 +40,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
40
40
  removeSuite: (id: string) => void;
41
41
  reset: () => void;
42
42
  runSuite: (suite: import("../..").RAGEvaluationSuite, overrides?: Partial<import("../..").RAGEvaluationInput>) => Promise<{
43
+ caseTraceSnapshots: import("../..").RAGEvaluationCaseTraceSnapshot[] | undefined;
43
44
  elapsedMs: number;
44
45
  finishedAt: number;
45
46
  id: `${string}-${string}-${string}-${string}-${string}`;
@@ -48,6 +49,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
48
49
  response: import("../..").RAGEvaluationResponse;
49
50
  startedAt: number;
50
51
  suiteId: string;
52
+ traceSummary: import("../..").RAGRetrievalTraceComparisonSummary | undefined;
51
53
  }>;
52
54
  saveSuite: (suite: import("../..").RAGEvaluationSuite) => import("../..").RAGEvaluationSuite;
53
55
  suiteRuns: import("../..").RAGEvaluationSuiteRun[];
@@ -10,6 +10,7 @@ export declare const useRAGEvaluate: (path: string) => {
10
10
  removeSuite: (id: string) => void;
11
11
  reset: () => void;
12
12
  runSuite: (suite: RAGEvaluationSuite, overrides?: Partial<RAGEvaluationInput>) => Promise<{
13
+ caseTraceSnapshots: import("../..").RAGEvaluationCaseTraceSnapshot[] | undefined;
13
14
  elapsedMs: number;
14
15
  finishedAt: number;
15
16
  id: `${string}-${string}-${string}-${string}-${string}`;
@@ -18,6 +19,7 @@ export declare const useRAGEvaluate: (path: string) => {
18
19
  response: RAGEvaluationResponse;
19
20
  startedAt: number;
20
21
  suiteId: string;
22
+ traceSummary: import("../..").RAGRetrievalTraceComparisonSummary | undefined;
21
23
  }>;
22
24
  saveSuite: (suite: RAGEvaluationSuite) => RAGEvaluationSuite;
23
25
  suiteRuns: RAGEvaluationSuiteRun[];
@@ -40,6 +40,7 @@ export declare const createRAG: (path: string, options?: CreateRAGOptions) => {
40
40
  removeSuite: (id: string) => void;
41
41
  reset: () => void;
42
42
  runSuite: (suite: import("../..").RAGEvaluationSuite, overrides?: Partial<import("../..").RAGEvaluationInput>) => Promise<{
43
+ caseTraceSnapshots: import("../..").RAGEvaluationCaseTraceSnapshot[] | undefined;
43
44
  elapsedMs: number;
44
45
  finishedAt: number;
45
46
  id: `${string}-${string}-${string}-${string}-${string}`;
@@ -48,6 +49,7 @@ export declare const createRAG: (path: string, options?: CreateRAGOptions) => {
48
49
  response: import("../..").RAGEvaluationResponse;
49
50
  startedAt: number;
50
51
  suiteId: string;
52
+ traceSummary: import("../..").RAGRetrievalTraceComparisonSummary | undefined;
51
53
  }>;
52
54
  saveSuite: (suite: import("../..").RAGEvaluationSuite) => import("../..").RAGEvaluationSuite;
53
55
  suiteRuns: import("svelte/store").Writable<import("../..").RAGEvaluationSuiteRun[]>;
@@ -10,6 +10,7 @@ export declare const createRAGEvaluate: (path: string) => {
10
10
  removeSuite: (id: string) => void;
11
11
  reset: () => void;
12
12
  runSuite: (suite: RAGEvaluationSuite, overrides?: Partial<RAGEvaluationInput>) => Promise<{
13
+ caseTraceSnapshots: import("../..").RAGEvaluationCaseTraceSnapshot[] | undefined;
13
14
  elapsedMs: number;
14
15
  finishedAt: number;
15
16
  id: `${string}-${string}-${string}-${string}-${string}`;
@@ -18,6 +19,7 @@ export declare const createRAGEvaluate: (path: string) => {
18
19
  response: RAGEvaluationResponse;
19
20
  startedAt: number;
20
21
  suiteId: string;
22
+ traceSummary: import("../..").RAGRetrievalTraceComparisonSummary | undefined;
21
23
  }>;
22
24
  saveSuite: (suite: RAGEvaluationSuite) => RAGEvaluationSuite;
23
25
  suiteRuns: import("svelte/store").Writable<RAGEvaluationSuiteRun[]>;
@@ -254,6 +254,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
254
254
  removeSuite: (id: string) => void;
255
255
  reset: () => void;
256
256
  runSuite: (suite: import("../..").RAGEvaluationSuite, overrides?: Partial<import("../..").RAGEvaluationInput>) => Promise<{
257
+ caseTraceSnapshots: import("../..").RAGEvaluationCaseTraceSnapshot[] | undefined;
257
258
  elapsedMs: number;
258
259
  finishedAt: number;
259
260
  id: `${string}-${string}-${string}-${string}-${string}`;
@@ -262,6 +263,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
262
263
  response: import("../..").RAGEvaluationResponse;
263
264
  startedAt: number;
264
265
  suiteId: string;
266
+ traceSummary: import("../..").RAGRetrievalTraceComparisonSummary | undefined;
265
267
  }>;
266
268
  saveSuite: (suite: import("../..").RAGEvaluationSuite) => import("../..").RAGEvaluationSuite;
267
269
  suiteRuns: import("vue").Ref<{
@@ -331,6 +333,51 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
331
333
  finalize?: number | undefined;
332
334
  };
333
335
  } | undefined;
336
+ caseTraceSnapshots?: {
337
+ caseId: string;
338
+ label?: string | undefined;
339
+ query: string;
340
+ status: import("../..").RAGEvaluationCaseResult["status"];
341
+ traceMode?: import("../..").RAGHybridRetrievalMode | undefined;
342
+ previousTraceMode?: import("../..").RAGHybridRetrievalMode | undefined;
343
+ transformedQuery?: string | undefined;
344
+ previousTransformedQuery?: string | undefined;
345
+ variantQueries: string[];
346
+ previousVariantQueries: string[];
347
+ finalCount: number;
348
+ previousFinalCount?: number | undefined;
349
+ vectorCount: number;
350
+ previousVectorCount?: number | undefined;
351
+ lexicalCount: number;
352
+ previousLexicalCount?: number | undefined;
353
+ candidateTopK: number;
354
+ previousCandidateTopK?: number | undefined;
355
+ lexicalTopK: number;
356
+ previousLexicalTopK?: number | undefined;
357
+ stageCounts: {
358
+ input?: number | undefined;
359
+ embed?: number | undefined;
360
+ query_transform?: number | undefined;
361
+ vector_search?: number | undefined;
362
+ lexical_search?: number | undefined;
363
+ fusion?: number | undefined;
364
+ rerank?: number | undefined;
365
+ score_filter?: number | undefined;
366
+ finalize?: number | undefined;
367
+ };
368
+ previousStageCounts: {
369
+ input?: number | undefined;
370
+ embed?: number | undefined;
371
+ query_transform?: number | undefined;
372
+ vector_search?: number | undefined;
373
+ lexical_search?: number | undefined;
374
+ fusion?: number | undefined;
375
+ rerank?: number | undefined;
376
+ score_filter?: number | undefined;
377
+ finalize?: number | undefined;
378
+ };
379
+ traceChange: "new" | "changed" | "unchanged";
380
+ }[] | undefined;
334
381
  metadata?: Record<string, unknown> | undefined;
335
382
  }[], import("../..").RAGEvaluationSuiteRun[] | {
336
383
  id: string;
@@ -399,6 +446,51 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
399
446
  finalize?: number | undefined;
400
447
  };
401
448
  } | undefined;
449
+ caseTraceSnapshots?: {
450
+ caseId: string;
451
+ label?: string | undefined;
452
+ query: string;
453
+ status: import("../..").RAGEvaluationCaseResult["status"];
454
+ traceMode?: import("../..").RAGHybridRetrievalMode | undefined;
455
+ previousTraceMode?: import("../..").RAGHybridRetrievalMode | undefined;
456
+ transformedQuery?: string | undefined;
457
+ previousTransformedQuery?: string | undefined;
458
+ variantQueries: string[];
459
+ previousVariantQueries: string[];
460
+ finalCount: number;
461
+ previousFinalCount?: number | undefined;
462
+ vectorCount: number;
463
+ previousVectorCount?: number | undefined;
464
+ lexicalCount: number;
465
+ previousLexicalCount?: number | undefined;
466
+ candidateTopK: number;
467
+ previousCandidateTopK?: number | undefined;
468
+ lexicalTopK: number;
469
+ previousLexicalTopK?: number | undefined;
470
+ stageCounts: {
471
+ input?: number | undefined;
472
+ embed?: number | undefined;
473
+ query_transform?: number | undefined;
474
+ vector_search?: number | undefined;
475
+ lexical_search?: number | undefined;
476
+ fusion?: number | undefined;
477
+ rerank?: number | undefined;
478
+ score_filter?: number | undefined;
479
+ finalize?: number | undefined;
480
+ };
481
+ previousStageCounts: {
482
+ input?: number | undefined;
483
+ embed?: number | undefined;
484
+ query_transform?: number | undefined;
485
+ vector_search?: number | undefined;
486
+ lexical_search?: number | undefined;
487
+ fusion?: number | undefined;
488
+ rerank?: number | undefined;
489
+ score_filter?: number | undefined;
490
+ finalize?: number | undefined;
491
+ };
492
+ traceChange: "new" | "changed" | "unchanged";
493
+ }[] | undefined;
402
494
  metadata?: Record<string, unknown> | undefined;
403
495
  }[]>;
404
496
  suites: import("vue").Ref<{
@@ -118,6 +118,7 @@ export declare const useRAGEvaluate: (path: string) => {
118
118
  removeSuite: (id: string) => void;
119
119
  reset: () => void;
120
120
  runSuite: (suite: RAGEvaluationSuite, overrides?: Partial<RAGEvaluationInput>) => Promise<{
121
+ caseTraceSnapshots: import("../..").RAGEvaluationCaseTraceSnapshot[] | undefined;
121
122
  elapsedMs: number;
122
123
  finishedAt: number;
123
124
  id: `${string}-${string}-${string}-${string}-${string}`;
@@ -126,6 +127,7 @@ export declare const useRAGEvaluate: (path: string) => {
126
127
  response: RAGEvaluationResponse;
127
128
  startedAt: number;
128
129
  suiteId: string;
130
+ traceSummary: import("../..").RAGRetrievalTraceComparisonSummary | undefined;
129
131
  }>;
130
132
  saveSuite: (suite: RAGEvaluationSuite) => RAGEvaluationSuite;
131
133
  suiteRuns: import("vue").Ref<{
@@ -195,6 +197,51 @@ export declare const useRAGEvaluate: (path: string) => {
195
197
  finalize?: number | undefined;
196
198
  };
197
199
  } | undefined;
200
+ caseTraceSnapshots?: {
201
+ caseId: string;
202
+ label?: string | undefined;
203
+ query: string;
204
+ status: import("../..").RAGEvaluationCaseResult["status"];
205
+ traceMode?: import("../..").RAGHybridRetrievalMode | undefined;
206
+ previousTraceMode?: import("../..").RAGHybridRetrievalMode | undefined;
207
+ transformedQuery?: string | undefined;
208
+ previousTransformedQuery?: string | undefined;
209
+ variantQueries: string[];
210
+ previousVariantQueries: string[];
211
+ finalCount: number;
212
+ previousFinalCount?: number | undefined;
213
+ vectorCount: number;
214
+ previousVectorCount?: number | undefined;
215
+ lexicalCount: number;
216
+ previousLexicalCount?: number | undefined;
217
+ candidateTopK: number;
218
+ previousCandidateTopK?: number | undefined;
219
+ lexicalTopK: number;
220
+ previousLexicalTopK?: number | undefined;
221
+ stageCounts: {
222
+ input?: number | undefined;
223
+ embed?: number | undefined;
224
+ query_transform?: number | undefined;
225
+ vector_search?: number | undefined;
226
+ lexical_search?: number | undefined;
227
+ fusion?: number | undefined;
228
+ rerank?: number | undefined;
229
+ score_filter?: number | undefined;
230
+ finalize?: number | undefined;
231
+ };
232
+ previousStageCounts: {
233
+ input?: number | undefined;
234
+ embed?: number | undefined;
235
+ query_transform?: number | undefined;
236
+ vector_search?: number | undefined;
237
+ lexical_search?: number | undefined;
238
+ fusion?: number | undefined;
239
+ rerank?: number | undefined;
240
+ score_filter?: number | undefined;
241
+ finalize?: number | undefined;
242
+ };
243
+ traceChange: "new" | "changed" | "unchanged";
244
+ }[] | undefined;
198
245
  metadata?: Record<string, unknown> | undefined;
199
246
  }[], RAGEvaluationSuiteRun[] | {
200
247
  id: string;
@@ -263,6 +310,51 @@ export declare const useRAGEvaluate: (path: string) => {
263
310
  finalize?: number | undefined;
264
311
  };
265
312
  } | undefined;
313
+ caseTraceSnapshots?: {
314
+ caseId: string;
315
+ label?: string | undefined;
316
+ query: string;
317
+ status: import("../..").RAGEvaluationCaseResult["status"];
318
+ traceMode?: import("../..").RAGHybridRetrievalMode | undefined;
319
+ previousTraceMode?: import("../..").RAGHybridRetrievalMode | undefined;
320
+ transformedQuery?: string | undefined;
321
+ previousTransformedQuery?: string | undefined;
322
+ variantQueries: string[];
323
+ previousVariantQueries: string[];
324
+ finalCount: number;
325
+ previousFinalCount?: number | undefined;
326
+ vectorCount: number;
327
+ previousVectorCount?: number | undefined;
328
+ lexicalCount: number;
329
+ previousLexicalCount?: number | undefined;
330
+ candidateTopK: number;
331
+ previousCandidateTopK?: number | undefined;
332
+ lexicalTopK: number;
333
+ previousLexicalTopK?: number | undefined;
334
+ stageCounts: {
335
+ input?: number | undefined;
336
+ embed?: number | undefined;
337
+ query_transform?: number | undefined;
338
+ vector_search?: number | undefined;
339
+ lexical_search?: number | undefined;
340
+ fusion?: number | undefined;
341
+ rerank?: number | undefined;
342
+ score_filter?: number | undefined;
343
+ finalize?: number | undefined;
344
+ };
345
+ previousStageCounts: {
346
+ input?: number | undefined;
347
+ embed?: number | undefined;
348
+ query_transform?: number | undefined;
349
+ vector_search?: number | undefined;
350
+ lexical_search?: number | undefined;
351
+ fusion?: number | undefined;
352
+ rerank?: number | undefined;
353
+ score_filter?: number | undefined;
354
+ finalize?: number | undefined;
355
+ };
356
+ traceChange: "new" | "changed" | "unchanged";
357
+ }[] | undefined;
266
358
  metadata?: Record<string, unknown> | undefined;
267
359
  }[]>;
268
360
  suites: import("vue").Ref<{
@@ -1138,6 +1138,69 @@ var formatTimestampLabel = (value) => {
1138
1138
  timeStyle: "short"
1139
1139
  });
1140
1140
  };
1141
+ var formatRAGTraceValue = (value) => {
1142
+ if (typeof value === "string")
1143
+ return value;
1144
+ if (typeof value === "number" || typeof value === "boolean") {
1145
+ return String(value);
1146
+ }
1147
+ if (Array.isArray(value)) {
1148
+ return value.join(", ");
1149
+ }
1150
+ if (value && typeof value === "object") {
1151
+ return JSON.stringify(value);
1152
+ }
1153
+ return "n/a";
1154
+ };
1155
+ var buildRAGRetrievalTracePresentation = (trace) => {
1156
+ if (!trace) {
1157
+ return {
1158
+ details: [],
1159
+ stats: [],
1160
+ steps: []
1161
+ };
1162
+ }
1163
+ const stats = [
1164
+ { label: "Mode", value: trace.mode },
1165
+ { label: "Final Results", value: String(trace.resultCounts.final) },
1166
+ {
1167
+ label: "Vector Candidates",
1168
+ value: String(trace.resultCounts.vector)
1169
+ },
1170
+ {
1171
+ label: "Lexical Candidates",
1172
+ value: String(trace.resultCounts.lexical)
1173
+ }
1174
+ ];
1175
+ const details = [
1176
+ { label: "Transformed query", value: trace.transformedQuery },
1177
+ {
1178
+ label: "Variant queries",
1179
+ value: trace.variantQueries.length > 0 ? trace.variantQueries.join(" \xB7 ") : "none"
1180
+ },
1181
+ { label: "Candidate topK", value: String(trace.candidateTopK) },
1182
+ { label: "Lexical topK", value: String(trace.lexicalTopK) }
1183
+ ];
1184
+ const steps = trace.steps.map((step) => ({
1185
+ count: step.count,
1186
+ label: step.label,
1187
+ rows: [
1188
+ { label: "stage", value: step.stage },
1189
+ ...typeof step.count === "number" ? [{ label: "count", value: String(step.count) }] : [],
1190
+ ...typeof step.durationMs === "number" ? [{ label: "durationMs", value: String(step.durationMs) }] : [],
1191
+ ...Object.entries(step.metadata ?? {}).map(([key, value]) => ({
1192
+ label: key,
1193
+ value: formatRAGTraceValue(value)
1194
+ }))
1195
+ ],
1196
+ stage: step.stage
1197
+ }));
1198
+ return {
1199
+ details,
1200
+ stats,
1201
+ steps
1202
+ };
1203
+ };
1141
1204
  var formatMediaTimestamp = (value) => {
1142
1205
  if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
1143
1206
  return;
@@ -2157,6 +2220,98 @@ var buildGroundingCaseSnapshots = ({
2157
2220
  };
2158
2221
  });
2159
2222
  };
2223
+ var areStageCountsEqual = (left, right) => {
2224
+ const keys = new Set([
2225
+ ...Object.keys(left),
2226
+ ...Object.keys(right)
2227
+ ]);
2228
+ for (const key of keys) {
2229
+ if ((left[key] ?? 0) !== (right[key] ?? 0)) {
2230
+ return false;
2231
+ }
2232
+ }
2233
+ return true;
2234
+ };
2235
+ var buildEvaluationCaseTraceSnapshot = ({
2236
+ caseResult,
2237
+ currentTrace,
2238
+ previousTrace
2239
+ }) => {
2240
+ const stageCounts = currentTrace ? buildTraceStageCounts([currentTrace]) : {};
2241
+ const previousStageCounts = previousTrace?.stageCounts ?? {};
2242
+ const traceChange = !previousTrace ? currentTrace ? "new" : "unchanged" : previousTrace.traceMode !== currentTrace?.mode || previousTrace.transformedQuery !== (currentTrace?.transformedQuery || undefined) || previousTrace.variantQueries.join("|") !== (currentTrace?.variantQueries ?? []).join("|") || previousTrace.finalCount !== (currentTrace?.resultCounts.final ?? 0) || previousTrace.vectorCount !== (currentTrace?.resultCounts.vector ?? 0) || previousTrace.lexicalCount !== (currentTrace?.resultCounts.lexical ?? 0) || previousTrace.candidateTopK !== (currentTrace?.candidateTopK ?? 0) || previousTrace.lexicalTopK !== (currentTrace?.lexicalTopK ?? 0) || !areStageCountsEqual(previousStageCounts, stageCounts) ? "changed" : "unchanged";
2243
+ return {
2244
+ candidateTopK: currentTrace?.candidateTopK ?? 0,
2245
+ caseId: caseResult.caseId,
2246
+ finalCount: currentTrace?.resultCounts.final ?? 0,
2247
+ label: caseResult.label,
2248
+ lexicalCount: currentTrace?.resultCounts.lexical ?? 0,
2249
+ lexicalTopK: currentTrace?.lexicalTopK ?? 0,
2250
+ previousCandidateTopK: previousTrace?.candidateTopK,
2251
+ previousFinalCount: previousTrace?.finalCount,
2252
+ previousLexicalCount: previousTrace?.lexicalCount,
2253
+ previousLexicalTopK: previousTrace?.lexicalTopK,
2254
+ previousStageCounts,
2255
+ previousTraceMode: previousTrace?.traceMode,
2256
+ previousTransformedQuery: previousTrace?.transformedQuery,
2257
+ previousVariantQueries: previousTrace?.variantQueries ?? [],
2258
+ previousVectorCount: previousTrace?.vectorCount,
2259
+ query: caseResult.query,
2260
+ stageCounts,
2261
+ status: caseResult.status,
2262
+ traceChange,
2263
+ traceMode: currentTrace?.mode,
2264
+ transformedQuery: currentTrace?.transformedQuery || undefined,
2265
+ variantQueries: currentTrace?.variantQueries ?? [],
2266
+ vectorCount: currentTrace?.resultCounts.vector ?? 0
2267
+ };
2268
+ };
2269
+ var buildEvaluationCaseTraceSnapshotsFromEvaluated = (evaluated) => evaluated.map(({ caseResult, trace }) => buildEvaluationCaseTraceSnapshot({
2270
+ caseResult,
2271
+ currentTrace: trace
2272
+ }));
2273
+ var buildEvaluationCaseTraceSnapshots = ({
2274
+ current,
2275
+ previous
2276
+ }) => {
2277
+ if (!current) {
2278
+ return [];
2279
+ }
2280
+ const currentTraces = new Map((current.caseTraceSnapshots ?? []).map((entry) => [entry.caseId, entry]));
2281
+ const previousTraces = new Map((previous?.caseTraceSnapshots ?? []).map((entry) => [
2282
+ entry.caseId,
2283
+ entry
2284
+ ]));
2285
+ return current.response.cases.map((caseResult) => buildEvaluationCaseTraceSnapshot({
2286
+ caseResult,
2287
+ currentTrace: (() => {
2288
+ const currentSnapshot = currentTraces.get(caseResult.caseId);
2289
+ if (!currentSnapshot) {
2290
+ return;
2291
+ }
2292
+ return {
2293
+ candidateTopK: currentSnapshot.candidateTopK,
2294
+ lexicalTopK: currentSnapshot.lexicalTopK,
2295
+ mode: currentSnapshot.traceMode ?? "vector",
2296
+ query: caseResult.query,
2297
+ resultCounts: {
2298
+ final: currentSnapshot.finalCount,
2299
+ fused: currentSnapshot.finalCount,
2300
+ lexical: currentSnapshot.lexicalCount,
2301
+ reranked: currentSnapshot.finalCount,
2302
+ vector: currentSnapshot.vectorCount
2303
+ },
2304
+ runLexical: currentSnapshot.lexicalCount > 0,
2305
+ runVector: currentSnapshot.vectorCount > 0,
2306
+ steps: [],
2307
+ topK: caseResult.topK,
2308
+ transformedQuery: currentSnapshot.transformedQuery ?? caseResult.query,
2309
+ variantQueries: currentSnapshot.variantQueries
2310
+ };
2311
+ })(),
2312
+ previousTrace: previousTraces.get(caseResult.caseId)
2313
+ }));
2314
+ };
2160
2315
  var getStatusRank = (status) => status === "pass" ? 2 : status === "partial" ? 1 : 0;
2161
2316
  var formatSignedDelta = (value, decimals = 0, suffix = "") => `${value >= 0 ? "+" : ""}${value.toFixed(decimals)}${suffix}`;
2162
2317
  var formatEvaluationSummary = (response) => `${response.summary.passedCases}/${response.totalCases} pass \xB7 f1 ${response.summary.averageF1.toFixed(3)} \xB7 latency ${response.summary.averageLatencyMs.toFixed(1)}ms`;
@@ -2316,6 +2471,13 @@ var buildRAGEvaluationHistoryRows = (history) => {
2316
2471
  rows.push({ label: "Trace stage delta", value: stageDelta });
2317
2472
  }
2318
2473
  }
2474
+ if (history.caseTraceSnapshots.length > 0) {
2475
+ const changedCases = history.caseTraceSnapshots.filter((entry) => entry.traceChange === "changed");
2476
+ rows.push({
2477
+ label: "Trace drift cases",
2478
+ value: changedCases.length > 0 ? changedCases.map((entry) => entry.label ?? entry.caseId).slice(0, 4).join(", ") : "none"
2479
+ });
2480
+ }
2319
2481
  return rows;
2320
2482
  };
2321
2483
  var buildRAGEvaluationRunDiff = ({
@@ -2505,6 +2667,10 @@ var loadRAGEvaluationHistory = async ({
2505
2667
  const latestRun = runs[0];
2506
2668
  const previousRun = runs[1];
2507
2669
  return {
2670
+ caseTraceSnapshots: buildEvaluationCaseTraceSnapshots({
2671
+ current: latestRun,
2672
+ previous: previousRun
2673
+ }),
2508
2674
  diff: latestRun && previousRun ? buildRAGEvaluationRunDiff({
2509
2675
  current: latestRun,
2510
2676
  previous: previousRun
@@ -2716,6 +2882,7 @@ var compareRAGRerankers = async ({
2716
2882
  });
2717
2883
  const response = buildRAGEvaluationResponse(evaluated.map((entry) => entry.caseResult));
2718
2884
  return {
2885
+ caseTraceSnapshots: buildEvaluationCaseTraceSnapshotsFromEvaluated(evaluated),
2719
2886
  label: candidate.label ?? candidate.id,
2720
2887
  providerName: typeof candidate.rerank === "function" ? undefined : candidate.rerank?.providerName,
2721
2888
  response,
@@ -2802,6 +2969,7 @@ var compareRAGRetrievalStrategies = async ({
2802
2969
  });
2803
2970
  const response = buildRAGEvaluationResponse(evaluated.map((entry) => entry.caseResult));
2804
2971
  return {
2972
+ caseTraceSnapshots: buildEvaluationCaseTraceSnapshotsFromEvaluated(evaluated),
2805
2973
  label: candidate.label ?? candidate.id,
2806
2974
  response,
2807
2975
  retrievalId: candidate.id,
@@ -2870,7 +3038,8 @@ var executeDryRunRAGEvaluation = (input, defaultTopK = DEFAULT_TOP_K) => input.c
2870
3038
  var runRAGEvaluationSuite = async ({
2871
3039
  suite,
2872
3040
  evaluate,
2873
- overrides
3041
+ overrides,
3042
+ artifacts
2874
3043
  }) => {
2875
3044
  const startedAt = Date.now();
2876
3045
  const response = await evaluate({
@@ -2880,6 +3049,7 @@ var runRAGEvaluationSuite = async ({
2880
3049
  });
2881
3050
  const finishedAt = Date.now();
2882
3051
  return {
3052
+ caseTraceSnapshots: artifacts?.caseTraceSnapshots,
2883
3053
  elapsedMs: finishedAt - startedAt,
2884
3054
  finishedAt,
2885
3055
  id: generateId(),
@@ -2887,7 +3057,8 @@ var runRAGEvaluationSuite = async ({
2887
3057
  metadata: suite.metadata,
2888
3058
  response,
2889
3059
  startedAt,
2890
- suiteId: suite.id
3060
+ suiteId: suite.id,
3061
+ traceSummary: artifacts?.traceSummary
2891
3062
  };
2892
3063
  };
2893
3064
  var summarizeRAGEvaluationCase = ({
@@ -3614,5 +3785,5 @@ export {
3614
3785
  createAIStream
3615
3786
  };
3616
3787
 
3617
- //# debugId=E92A24FDA13560A364756E2164756E21
3788
+ //# debugId=7BEF42FAF2022A4E64756E2164756E21
3618
3789
  //# sourceMappingURL=index.js.map