@absolutejs/rag 0.0.2 → 0.0.3

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 (94) hide show
  1. package/dist/ai/client/index.js +12 -49
  2. package/dist/ai/client/index.js.map +8 -8
  3. package/dist/ai/client/ui.js +12 -49
  4. package/dist/ai/client/ui.js.map +5 -5
  5. package/dist/ai/rag/index.js +34 -157
  6. package/dist/ai/rag/index.js.map +30 -30
  7. package/dist/ai/rag/quality.js +12 -49
  8. package/dist/ai/rag/quality.js.map +5 -5
  9. package/dist/ai/rag/ui.js +12 -49
  10. package/dist/ai/rag/ui.js.map +5 -5
  11. package/dist/angular/ai/index.js.map +8 -8
  12. package/dist/react/ai/index.js.map +22 -22
  13. package/dist/src/ai/client/createRAGAnswerWorkflow.d.ts +1 -1
  14. package/dist/src/ai/client/createRAGStream.d.ts +2 -2
  15. package/dist/src/ai/client/createRAGWorkflow.d.ts +3 -3
  16. package/dist/src/ai/client/index.d.ts +8 -8
  17. package/dist/src/ai/client/ragClient.d.ts +6 -6
  18. package/dist/src/ai/client/ui.d.ts +5 -5
  19. package/dist/src/ai/rag/accessControl.d.ts +1 -1
  20. package/dist/src/ai/rag/adapters/inMemory.d.ts +2 -2
  21. package/dist/src/ai/rag/adapters/postgres.d.ts +3 -3
  22. package/dist/src/ai/rag/adapters/sqlite.d.ts +4 -4
  23. package/dist/src/ai/rag/chat.d.ts +2 -2
  24. package/dist/src/ai/rag/collection.d.ts +1 -1
  25. package/dist/src/ai/rag/emailProviders.d.ts +1 -1
  26. package/dist/src/ai/rag/embedding.d.ts +1 -1
  27. package/dist/src/ai/rag/embeddingProviders.d.ts +1 -1
  28. package/dist/src/ai/rag/extractorProviders.d.ts +1 -1
  29. package/dist/src/ai/rag/grounding.d.ts +1 -1
  30. package/dist/src/ai/rag/htmxConfig.d.ts +1 -1
  31. package/dist/src/ai/rag/htmxWorkflowRenderers.d.ts +1 -1
  32. package/dist/src/ai/rag/index.d.ts +31 -31
  33. package/dist/src/ai/rag/ingestion.d.ts +1 -1
  34. package/dist/src/ai/rag/jobState.d.ts +1 -1
  35. package/dist/src/ai/rag/lexical.d.ts +2 -2
  36. package/dist/src/ai/rag/presentation.d.ts +9 -9
  37. package/dist/src/ai/rag/quality.d.ts +67 -67
  38. package/dist/src/ai/rag/queryTransforms.d.ts +2 -2
  39. package/dist/src/ai/rag/reranking.d.ts +2 -2
  40. package/dist/src/ai/rag/resolveAbsoluteSQLiteVec.d.ts +1 -1
  41. package/dist/src/ai/rag/retrievalStrategies.d.ts +1 -1
  42. package/dist/src/ai/rag/sync.d.ts +2 -2
  43. package/dist/src/ai/rag/types.d.ts +4 -4
  44. package/dist/src/ai/rag/ui.d.ts +4 -4
  45. package/dist/src/ai/rag/workflowState.d.ts +1 -1
  46. package/dist/src/angular/ai/ai-rag-stream.service.d.ts +1 -1
  47. package/dist/src/angular/ai/ai-rag-workflow.service.d.ts +1 -1
  48. package/dist/src/angular/ai/index.d.ts +3 -3
  49. package/dist/src/angular/ai/rag-client.service.d.ts +42 -42
  50. package/dist/src/react/ai/index.d.ts +18 -18
  51. package/dist/src/react/ai/useRAGChunkPreview.d.ts +1 -1
  52. package/dist/src/react/ai/useRAGCitations.d.ts +1 -1
  53. package/dist/src/react/ai/useRAGDocuments.d.ts +1 -1
  54. package/dist/src/react/ai/useRAGEvaluate.d.ts +1 -1
  55. package/dist/src/react/ai/useRAGGrounding.d.ts +1 -1
  56. package/dist/src/react/ai/useRAGIndexAdmin.d.ts +1 -1
  57. package/dist/src/react/ai/useRAGIngest.d.ts +1 -1
  58. package/dist/src/react/ai/useRAGOps.d.ts +1 -1
  59. package/dist/src/react/ai/useRAGSearch.d.ts +3 -3
  60. package/dist/src/react/ai/useRAGSources.d.ts +1 -1
  61. package/dist/src/react/ai/useRAGStatus.d.ts +1 -1
  62. package/dist/src/react/ai/useRAGStream.d.ts +1 -1
  63. package/dist/src/react/ai/useRAGStreamProgress.d.ts +2 -2
  64. package/dist/src/svelte/ai/createRAGChunkPreview.d.ts +1 -1
  65. package/dist/src/svelte/ai/createRAGCitations.d.ts +2 -2
  66. package/dist/src/svelte/ai/createRAGDocuments.d.ts +1 -1
  67. package/dist/src/svelte/ai/createRAGEvaluate.d.ts +1 -1
  68. package/dist/src/svelte/ai/createRAGGrounding.d.ts +2 -2
  69. package/dist/src/svelte/ai/createRAGIndexAdmin.d.ts +1 -1
  70. package/dist/src/svelte/ai/createRAGIngest.d.ts +1 -1
  71. package/dist/src/svelte/ai/createRAGOps.d.ts +1 -1
  72. package/dist/src/svelte/ai/createRAGSearch.d.ts +3 -3
  73. package/dist/src/svelte/ai/createRAGSources.d.ts +2 -2
  74. package/dist/src/svelte/ai/createRAGStatus.d.ts +1 -1
  75. package/dist/src/svelte/ai/createRAGStream.d.ts +1 -1
  76. package/dist/src/svelte/ai/createRAGStreamProgress.d.ts +2 -2
  77. package/dist/src/svelte/ai/index.d.ts +17 -17
  78. package/dist/src/vue/ai/index.d.ts +17 -17
  79. package/dist/src/vue/ai/useRAGChunkPreview.d.ts +1 -1
  80. package/dist/src/vue/ai/useRAGCitations.d.ts +2 -2
  81. package/dist/src/vue/ai/useRAGDocuments.d.ts +1 -1
  82. package/dist/src/vue/ai/useRAGEvaluate.d.ts +1 -1
  83. package/dist/src/vue/ai/useRAGGrounding.d.ts +2 -2
  84. package/dist/src/vue/ai/useRAGIndexAdmin.d.ts +1 -1
  85. package/dist/src/vue/ai/useRAGIngest.d.ts +1 -1
  86. package/dist/src/vue/ai/useRAGOps.d.ts +1 -1
  87. package/dist/src/vue/ai/useRAGSearch.d.ts +3 -3
  88. package/dist/src/vue/ai/useRAGSources.d.ts +2 -2
  89. package/dist/src/vue/ai/useRAGStatus.d.ts +1 -1
  90. package/dist/src/vue/ai/useRAGStream.d.ts +1 -1
  91. package/dist/src/vue/ai/useRAGStreamProgress.d.ts +2 -2
  92. package/dist/svelte/ai/index.js.map +20 -20
  93. package/dist/vue/ai/index.js.map +20 -20
  94. package/package.json +104 -80
@@ -3514,9 +3514,7 @@ var buildRAGComparisonTraceDiffRows = (entry, leader) => {
3514
3514
  const delta = (trace.stageCounts[typedStage] ?? 0) - (leaderTrace.stageCounts[typedStage] ?? 0);
3515
3515
  return delta === 0 ? null : `${typedStage} ${formatTraceCountDelta(delta)}`;
3516
3516
  }).filter((value) => Boolean(value)).slice(0, 3).join(" \xB7 ");
3517
- const rows = [
3518
- { label: "Baseline", value: leader.label }
3519
- ];
3517
+ const rows = [{ label: "Baseline", value: leader.label }];
3520
3518
  if (formatTraceModes(trace.modes) !== formatTraceModes(leaderTrace.modes)) {
3521
3519
  rows.push({
3522
3520
  label: "Modes vs leader",
@@ -3703,9 +3701,7 @@ var buildRAGGroundingProviderCaseComparisonPresentations = (comparisons) => comp
3703
3701
  });
3704
3702
  var buildRAGEvaluationHistoryRows = (history) => {
3705
3703
  if (!history?.latestRun) {
3706
- return [
3707
- { label: "History", value: "No persisted benchmark runs yet." }
3708
- ];
3704
+ return [{ label: "History", value: "No persisted benchmark runs yet." }];
3709
3705
  }
3710
3706
  const rows = [
3711
3707
  { label: "Runs recorded", value: String(history.runs.length) },
@@ -4924,12 +4920,7 @@ var detectMediaEvidence = (ids, sources = []) => ids.some((id) => hasSourceExten
4924
4920
  ".mkv",
4925
4921
  ".webm"
4926
4922
  ]) || hasMetadataString(source.metadata, "mediaKind") || hasMetadataString(source.metadata, "speaker") || hasMetadataNumber(source.metadata, "startMs"));
4927
- var detectOCREvidence = (ids, sources = []) => ids.some((id) => hasSourceExtension(id, [".png", ".jpg", ".jpeg", ".webp"])) || sources.some((source) => hasSourceExtension(source.source, [
4928
- ".png",
4929
- ".jpg",
4930
- ".jpeg",
4931
- ".webp"
4932
- ]) || hasMetadataNumber(source.metadata, "ocrConfidence") || hasMetadataNumber(source.metadata, "ocrRegionConfidence") || hasMetadataString(source.metadata, "ocrEngine") || source.metadata?.pdfTextMode === "ocr");
4923
+ var detectOCREvidence = (ids, sources = []) => ids.some((id) => hasSourceExtension(id, [".png", ".jpg", ".jpeg", ".webp"])) || sources.some((source) => hasSourceExtension(source.source, [".png", ".jpg", ".jpeg", ".webp"]) || hasMetadataNumber(source.metadata, "ocrConfidence") || hasMetadataNumber(source.metadata, "ocrRegionConfidence") || hasMetadataString(source.metadata, "ocrEngine") || source.metadata?.pdfTextMode === "ocr");
4933
4924
  var getRetrievalTrace = (trace) => trace && ("trace" in trace) ? trace.trace : trace;
4934
4925
  var classifyRAGEvaluationFailure = (input) => {
4935
4926
  const classes = [];
@@ -6353,10 +6344,7 @@ var buildEvaluationCaseTraceSnapshots = ({
6353
6344
  return [];
6354
6345
  }
6355
6346
  const currentTraces = new Map((current.caseTraceSnapshots ?? []).map((entry) => [entry.caseId, entry]));
6356
- const previousTraces = new Map((previous?.caseTraceSnapshots ?? []).map((entry) => [
6357
- entry.caseId,
6358
- entry
6359
- ]));
6347
+ const previousTraces = new Map((previous?.caseTraceSnapshots ?? []).map((entry) => [entry.caseId, entry]));
6360
6348
  return current.response.cases.map((caseResult) => buildEvaluationCaseTraceSnapshot({
6361
6349
  caseResult,
6362
6350
  currentSnapshot: currentTraces.get(caseResult.caseId),
@@ -6400,10 +6388,7 @@ var buildRAGEvaluationRunDiff = ({
6400
6388
  const regressedCases = diffs.filter((entry) => getStatusRank(entry.currentStatus) < getStatusRank(entry.previousStatus ?? "fail"));
6401
6389
  const improvedCases = diffs.filter((entry) => getStatusRank(entry.currentStatus) > getStatusRank(entry.previousStatus ?? "fail"));
6402
6390
  const unchangedCases = diffs.filter((entry) => getStatusRank(entry.currentStatus) === getStatusRank(entry.previousStatus ?? "fail"));
6403
- const previousCaseTraces = new Map((previous?.caseTraceSnapshots ?? []).map((entry) => [
6404
- entry.caseId,
6405
- entry
6406
- ]));
6391
+ const previousCaseTraces = new Map((previous?.caseTraceSnapshots ?? []).map((entry) => [entry.caseId, entry]));
6407
6392
  const traceLeadChanges = (current.caseTraceSnapshots ?? []).map((entry) => {
6408
6393
  const previousEntry = previousCaseTraces.get(entry.caseId);
6409
6394
  const currentLead = buildCaseTraceLeadLabel(entry);
@@ -6620,14 +6605,7 @@ var createRAGFileEvaluationSuiteSnapshotHistoryStore = (path) => ({
6620
6605
  }
6621
6606
  });
6622
6607
  var createRAGFileRetrievalComparisonHistoryStore = (path) => ({
6623
- listRuns: async ({
6624
- groupKey,
6625
- label,
6626
- limit,
6627
- suiteId,
6628
- tag,
6629
- winnerId
6630
- } = {}) => {
6608
+ listRuns: async ({ groupKey, label, limit, suiteId, tag, winnerId } = {}) => {
6631
6609
  let parsed = [];
6632
6610
  try {
6633
6611
  const content = await readFile(path, "utf8");
@@ -10868,10 +10846,7 @@ var createRAGPresentationCueBenchmarkSuite = (input) => createRAGEvaluationSuite
10868
10846
  cases: [
10869
10847
  {
10870
10848
  expectedDocumentIds: ["slide-title-doc"],
10871
- hardNegativeDocumentIds: [
10872
- "slide-body-doc",
10873
- "slide-notes-doc"
10874
- ],
10849
+ hardNegativeDocumentIds: ["slide-body-doc", "slide-notes-doc"],
10875
10850
  id: "presentation-title-led",
10876
10851
  label: "Repeated-title deck selects title-led slide evidence",
10877
10852
  query: "Which presentation title covers the release handoff summary?",
@@ -10879,10 +10854,7 @@ var createRAGPresentationCueBenchmarkSuite = (input) => createRAGEvaluationSuite
10879
10854
  },
10880
10855
  {
10881
10856
  expectedDocumentIds: ["slide-body-doc"],
10882
- hardNegativeDocumentIds: [
10883
- "slide-title-doc",
10884
- "slide-notes-doc"
10885
- ],
10857
+ hardNegativeDocumentIds: ["slide-title-doc", "slide-notes-doc"],
10886
10858
  id: "presentation-body-led",
10887
10859
  label: "Repeated-title deck selects body-led slide evidence",
10888
10860
  query: "Which slide mentions escalation review in the body?",
@@ -10890,10 +10862,7 @@ var createRAGPresentationCueBenchmarkSuite = (input) => createRAGEvaluationSuite
10890
10862
  },
10891
10863
  {
10892
10864
  expectedDocumentIds: ["slide-notes-doc"],
10893
- hardNegativeDocumentIds: [
10894
- "slide-title-doc",
10895
- "slide-body-doc"
10896
- ],
10865
+ hardNegativeDocumentIds: ["slide-title-doc", "slide-body-doc"],
10897
10866
  id: "presentation-notes-led",
10898
10867
  label: "Repeated-title deck selects notes-led slide evidence",
10899
10868
  query: "Which slide notes are the primary handoff evidence?",
@@ -10938,10 +10907,7 @@ var createRAGSpreadsheetCueBenchmarkSuite = (input) => createRAGEvaluationSuite(
10938
10907
  cases: [
10939
10908
  {
10940
10909
  expectedDocumentIds: ["sheet-led-doc"],
10941
- hardNegativeDocumentIds: [
10942
- "table-led-doc",
10943
- "column-led-doc"
10944
- ],
10910
+ hardNegativeDocumentIds: ["table-led-doc", "column-led-doc"],
10945
10911
  id: "spreadsheet-sheet-led",
10946
10912
  label: "Workbook selects sheet-led spreadsheet evidence",
10947
10913
  query: "Which spreadsheet sheet lists owner status and due date?",
@@ -10949,10 +10915,7 @@ var createRAGSpreadsheetCueBenchmarkSuite = (input) => createRAGEvaluationSuite(
10949
10915
  },
10950
10916
  {
10951
10917
  expectedDocumentIds: ["table-led-doc"],
10952
- hardNegativeDocumentIds: [
10953
- "sheet-led-doc",
10954
- "column-led-doc"
10955
- ],
10918
+ hardNegativeDocumentIds: ["sheet-led-doc", "column-led-doc"],
10956
10919
  id: "spreadsheet-table-led",
10957
10920
  label: "Workbook selects table-led spreadsheet evidence",
10958
10921
  query: "Which spreadsheet table lists the escalation status rows?",
@@ -11563,12 +11526,7 @@ var rankRAGLexicalMatches = (query, results) => {
11563
11526
  var hasAnyToken = (tokens, values) => values.some((value) => tokens.includes(value));
11564
11527
  var resolveFileKindBoost = (queryTokens, metadata) => {
11565
11528
  const fileKind = typeof metadata?.fileKind === "string" ? metadata.fileKind : "";
11566
- if (fileKind === "office" && hasAnyToken(queryTokens, [
11567
- "sheet",
11568
- "worksheet",
11569
- "workbook",
11570
- "spreadsheet"
11571
- ])) {
11529
+ if (fileKind === "office" && hasAnyToken(queryTokens, ["sheet", "worksheet", "workbook", "spreadsheet"])) {
11572
11530
  return 0.75;
11573
11531
  }
11574
11532
  if (fileKind === "archive" && hasAnyToken(queryTokens, [
@@ -12284,12 +12242,7 @@ var scoreStructuredEvidenceMatch = (query, queryTokens, result) => {
12284
12242
  if (hasSpreadsheetRows && queryHasAnyToken(queryTokens, ["row", "rows", "sheet", "spreadsheet"])) {
12285
12243
  score += 0.18;
12286
12244
  }
12287
- if (typeof spreadsheetTableIndex === "number" && queryHasAnyToken(queryTokens, [
12288
- "table",
12289
- "tables",
12290
- "sheet",
12291
- "spreadsheet"
12292
- ])) {
12245
+ if (typeof spreadsheetTableIndex === "number" && queryHasAnyToken(queryTokens, ["table", "tables", "sheet", "spreadsheet"])) {
12293
12246
  score += 0.16;
12294
12247
  if (typeof spreadsheetTableCount === "number" && spreadsheetTableCount > 1) {
12295
12248
  score += 0.08;
@@ -12314,12 +12267,7 @@ var scoreStructuredEvidenceMatch = (query, queryTokens, result) => {
12314
12267
  ]) || queryTokens.some((token) => slideTitle.includes(token)))) {
12315
12268
  score += 0.4;
12316
12269
  }
12317
- if (slideNotesText && queryHasAnyToken(queryTokens, [
12318
- "notes",
12319
- "speaker",
12320
- "speakers",
12321
- "talking"
12322
- ])) {
12270
+ if (slideNotesText && queryHasAnyToken(queryTokens, ["notes", "speaker", "speakers", "talking"])) {
12323
12271
  score += 0.2;
12324
12272
  }
12325
12273
  if (speaker && queryHasAnyToken(queryTokens, ["speaker", "speakers", "said", "says"])) {
@@ -12328,24 +12276,14 @@ var scoreStructuredEvidenceMatch = (query, queryTokens, result) => {
12328
12276
  if (speaker) {
12329
12277
  if (queryHasQuotedPhraseMatch(query, speaker)) {
12330
12278
  score += 0.42;
12331
- if (queryHasAnyToken(queryTokens, [
12332
- "speaker",
12333
- "speakers",
12334
- "said",
12335
- "says"
12336
- ])) {
12279
+ if (queryHasAnyToken(queryTokens, ["speaker", "speakers", "said", "says"])) {
12337
12280
  score += 0.08;
12338
12281
  }
12339
12282
  }
12340
12283
  const speakerPhraseScore = scoreLoosePhraseMatch2(query, speaker);
12341
12284
  if (speakerPhraseScore > 0) {
12342
12285
  score += 0.32 * speakerPhraseScore;
12343
- if (queryHasAnyToken(queryTokens, [
12344
- "speaker",
12345
- "speakers",
12346
- "said",
12347
- "says"
12348
- ])) {
12286
+ if (queryHasAnyToken(queryTokens, ["speaker", "speakers", "said", "says"])) {
12349
12287
  score += 0.08;
12350
12288
  }
12351
12289
  }
@@ -12435,12 +12373,7 @@ var scoreStructuredEvidenceMatch = (query, queryTokens, result) => {
12435
12373
  }
12436
12374
  }
12437
12375
  }
12438
- if (typeof mediaSegmentGapToNextMs === "number" && queryHasAnyToken(queryTokens, [
12439
- "before",
12440
- "previous",
12441
- "prior",
12442
- "earlier"
12443
- ])) {
12376
+ if (typeof mediaSegmentGapToNextMs === "number" && queryHasAnyToken(queryTokens, ["before", "previous", "prior", "earlier"])) {
12444
12377
  if (mediaSegmentGapToNextMs === 0) {
12445
12378
  score += 0.24;
12446
12379
  } else if (mediaSegmentGapToNextMs <= 1000) {
@@ -12484,12 +12417,7 @@ var scoreStructuredEvidenceMatch = (query, queryTokens, result) => {
12484
12417
  ]) || queryTokens.some((token) => threadTopic.includes(token)))) {
12485
12418
  score += 0.34;
12486
12419
  }
12487
- if (typeof threadMessageCount === "number" && threadMessageCount > 1 && queryHasAnyToken(queryTokens, [
12488
- "thread",
12489
- "reply",
12490
- "replies",
12491
- "attachment"
12492
- ])) {
12420
+ if (typeof threadMessageCount === "number" && threadMessageCount > 1 && queryHasAnyToken(queryTokens, ["thread", "reply", "replies", "attachment"])) {
12493
12421
  score += 0.08;
12494
12422
  }
12495
12423
  if (attachmentName && queryHasAnyToken(queryTokens, [
@@ -13127,12 +13055,7 @@ var scoreStructuredEvidenceMatch = (query, queryTokens, result) => {
13127
13055
  ]) || queryTokens.some((token) => (archiveFullPath ?? archivePath ?? "").includes(token)))) {
13128
13056
  score += 0.34;
13129
13057
  }
13130
- if (archiveContainerPath && queryHasAnyToken(queryTokens, [
13131
- "nested",
13132
- "inner",
13133
- "container",
13134
- "archive"
13135
- ])) {
13058
+ if (archiveContainerPath && queryHasAnyToken(queryTokens, ["nested", "inner", "container", "archive"])) {
13136
13059
  score += 0.12;
13137
13060
  }
13138
13061
  if (typeof archiveNestedDepth === "number" && archiveNestedDepth > 1 && queryHasAnyToken(queryTokens, ["nested", "inner", "archive"])) {
@@ -15656,9 +15579,7 @@ var officeDocumentBlocks = (entries) => {
15656
15579
  for (const match of body.matchAll(blockPattern)) {
15657
15580
  const blockXml = match[0] ?? "";
15658
15581
  if (blockXml.startsWith("<w:tbl")) {
15659
- const tableRows = [...blockXml.matchAll(/<w:tr\b[\s\S]*?<\/w:tr>/g)].map((rowMatch) => [
15660
- ...(rowMatch[0] ?? "").matchAll(/<w:tc\b[\s\S]*?<\/w:tc>/g)
15661
- ].map((cellMatch) => extractOfficeParagraphText(cellMatch[0] ?? "")).filter(Boolean)).filter((cells) => cells.length > 0);
15582
+ const tableRows = [...blockXml.matchAll(/<w:tr\b[\s\S]*?<\/w:tr>/g)].map((rowMatch) => [...(rowMatch[0] ?? "").matchAll(/<w:tc\b[\s\S]*?<\/w:tc>/g)].map((cellMatch) => extractOfficeParagraphText(cellMatch[0] ?? "")).filter(Boolean)).filter((cells) => cells.length > 0);
15662
15583
  const rows = tableRows.map((cells, rowIndex) => {
15663
15584
  return `Row ${rowIndex + 1}. ${cells.map((cell, cellIndex) => `${String.fromCharCode(65 + cellIndex)}: ${cell}`).join(" | ")}`;
15664
15585
  }).filter(Boolean);
@@ -15727,9 +15648,7 @@ var officeDocumentSectionCount = (entries) => {
15727
15648
  const count = officeDocumentBlocks(entries).length;
15728
15649
  return count > 0 ? count : undefined;
15729
15650
  };
15730
- var spreadsheetSharedStrings = (entries) => entries.filter((entry) => entry.path === "xl/sharedStrings.xml").flatMap((entry) => [
15731
- ...decodeUtf8(entry.data).matchAll(/<t[^>]*>([\s\S]*?)<\/t>/g)
15732
- ].map((match) => decodeHtmlEntities(match[1] ?? "")));
15651
+ var spreadsheetSharedStrings = (entries) => entries.filter((entry) => entry.path === "xl/sharedStrings.xml").flatMap((entry) => [...decodeUtf8(entry.data).matchAll(/<t[^>]*>([\s\S]*?)<\/t>/g)].map((match) => decodeHtmlEntities(match[1] ?? "")));
15733
15652
  var spreadsheetColumnLabel = (reference) => {
15734
15653
  const match = reference?.match(/([A-Z]+)/i);
15735
15654
  return match?.[1]?.toUpperCase() ?? "";
@@ -16009,9 +15928,7 @@ var spreadsheetText = (entries) => normalizeWhitespace(spreadsheetSheetTexts(ent
16009
15928
  ${sheet.text}`).join(`
16010
15929
 
16011
15930
  `));
16012
- var spreadsheetSheetNames = (entries) => entries.filter((entry) => entry.path === "xl/workbook.xml").flatMap((entry) => [
16013
- ...decodeUtf8(entry.data).matchAll(/<sheet[^>]*name="([^"]+)"/g)
16014
- ].map((match) => match[1] ?? "")).filter(Boolean);
15931
+ var spreadsheetSheetNames = (entries) => entries.filter((entry) => entry.path === "xl/workbook.xml").flatMap((entry) => [...decodeUtf8(entry.data).matchAll(/<sheet[^>]*name="([^"]+)"/g)].map((match) => match[1] ?? "")).filter(Boolean);
16015
15932
  var presentationNotesByIndex = (entries) => new Map(entries.filter((entry) => entry.path.startsWith("ppt/notesSlides/") && entry.path.endsWith(".xml")).sort((left, right) => left.path.localeCompare(right.path)).map((entry) => {
16016
15933
  const indexMatch = entry.path.match(/notesSlide(\d+)\.xml$/i);
16017
15934
  const index = Number(indexMatch?.[1] ?? "0") - 1;
@@ -17337,10 +17254,7 @@ var extractEmailDocumentsFromRawMessage = async (input, raw, options) => {
17337
17254
  const emailMessageLineageAttachmentSources = emailMessageLineage.map((entry) => entry.attachmentSource).filter((value) => typeof value === "string");
17338
17255
  const emailMessageDepth = emailMessageLineage.length;
17339
17256
  const emailAncestorMessageIds = [
17340
- ...new Set([
17341
- ...parentAncestorMessageIds,
17342
- ...emailMessageLineageMessageIds
17343
- ])
17257
+ ...new Set([...parentAncestorMessageIds, ...emailMessageLineageMessageIds])
17344
17258
  ];
17345
17259
  const emailAncestorMessageSources = [
17346
17260
  ...new Set([
@@ -17941,10 +17855,7 @@ var createMailboxContainerExtractor = () => ({
17941
17855
  source: `${messageSource}#attachments/${attachment.fileName}`,
17942
17856
  title: messageDocument?.title ? `${messageDocument.title} \xB7 ${attachment.fileName}` : attachment.fileName
17943
17857
  })));
17944
- return [
17945
- ...extractedDocuments,
17946
- ...mailboxAttachmentDocuments.flat()
17947
- ];
17858
+ return [...extractedDocuments, ...mailboxAttachmentDocuments.flat()];
17948
17859
  }));
17949
17860
  return documents.flat();
17950
17861
  }
@@ -19913,12 +19824,7 @@ var buildPresentationRerankTraceMetadata = (query, result) => {
19913
19824
  const slideTitle = typeof metadata.slideTitle === "string" && metadata.slideTitle.trim().length > 0 ? metadata.slideTitle.trim() : undefined;
19914
19825
  const slideNotesText = typeof metadata.slideNotesText === "string" && metadata.slideNotesText.trim().length > 0 ? metadata.slideNotesText.trim() : undefined;
19915
19826
  const chunkText = typeof result.chunkText === "string" ? result.chunkText : undefined;
19916
- if (slideNotesText && queryHasAnyTraceToken(query, [
19917
- "notes",
19918
- "speaker",
19919
- "speakers",
19920
- "talking"
19921
- ])) {
19827
+ if (slideNotesText && queryHasAnyTraceToken(query, ["notes", "speaker", "speakers", "talking"])) {
19922
19828
  traceMetadata.leadPresentationCue = "notes";
19923
19829
  return traceMetadata;
19924
19830
  }
@@ -22161,10 +22067,7 @@ ${extraContext}` : content;
22161
22067
  };
22162
22068
  });
22163
22069
  return {
22164
- content: [
22165
- ...attachmentsBlocks,
22166
- ...toAssistantTextBlock(contextContent)
22167
- ],
22070
+ content: [...attachmentsBlocks, ...toAssistantTextBlock(contextContent)],
22168
22071
  role: "user"
22169
22072
  };
22170
22073
  }
@@ -24145,16 +24048,10 @@ var ragChat = (config) => {
24145
24048
  groupKey: input.groupKey,
24146
24049
  gateStatus: undefined,
24147
24050
  ready: Boolean(input.baseline),
24148
- reasons: input.baseline ? [
24149
- "baseline is active in the target rollout lane"
24150
- ] : [],
24051
+ reasons: input.baseline ? ["baseline is active in the target rollout lane"] : [],
24151
24052
  requiresApproval: Boolean(getRetrievalReleasePolicy(input.groupKey, targetRolloutLabel).requireApprovalBeforePromotion),
24152
24053
  requiresOverride: false,
24153
- remediationActions: input.baseline ? [
24154
- "Monitor the active lane and verify post-promotion behavior."
24155
- ] : [
24156
- "Review the latest lane readiness reasons before continuing."
24157
- ],
24054
+ remediationActions: input.baseline ? ["Monitor the active lane and verify post-promotion behavior."] : ["Review the latest lane readiness reasons before continuing."],
24158
24055
  remediationSteps: input.baseline ? [
24159
24056
  {
24160
24057
  kind: "monitor_lane",
@@ -28073,9 +27970,7 @@ var ragChat = (config) => {
28073
27970
  "approval has gone stale and should be renewed before promotion"
28074
27971
  ] : candidate && candidate.requiresApproval && candidate.approved !== true && candidate.reviewStatus === "blocked" ? [
28075
27972
  "candidate needs an explicit approval decision before promotion"
28076
- ] : candidate?.ready ? [
28077
- "latest candidate is ready to promote"
28078
- ] : ["continue monitoring release state"];
27973
+ ] : candidate?.ready ? ["latest candidate is ready to promote"] : ["continue monitoring release state"];
28079
27974
  const classification = candidate?.reasons?.length ? classifyGovernanceReasons(candidate.reasons) : (recentIncidents ?? []).some((entry) => entry.groupKey === group.groupKey && entry.targetRolloutLabel === targetRolloutLabel && entry.classification === "runtime") ? "runtime" : (recentIncidents ?? []).some((entry) => entry.groupKey === group.groupKey && entry.targetRolloutLabel === targetRolloutLabel && entry.classification === "cue") ? "cue" : (recentIncidents ?? []).some((entry) => entry.groupKey === group.groupKey && entry.targetRolloutLabel === targetRolloutLabel && entry.classification === "evidence") ? "evidence" : (recentIncidents ?? []).some((entry) => entry.groupKey === group.groupKey && entry.targetRolloutLabel === targetRolloutLabel && entry.classification === "multivector") ? "multivector" : "general";
28080
27975
  summaries.push({
28081
27976
  baselineRetrievalId: candidate?.baselineRetrievalId,
@@ -33551,10 +33446,7 @@ var createRAGSiteDiscoverySyncSource = (options) => ({
33551
33446
  for (const site of options.sites) {
33552
33447
  if (options.autoDiscoverFeeds !== false) {
33553
33448
  const feedMap = new Map;
33554
- for (const feed of [
33555
- site,
33556
- ...await discoverFeedsFromHTML(site)
33557
- ]) {
33449
+ for (const feed of [site, ...await discoverFeedsFromHTML(site)]) {
33558
33450
  if (!feedMap.has(feed.url)) {
33559
33451
  feedMap.set(feed.url, feed);
33560
33452
  }
@@ -33777,12 +33669,7 @@ var createRAGStorageSyncSource = (options) => ({
33777
33669
  retryAttempts: options.retryAttempts,
33778
33670
  retryDelayMs: options.retryDelayMs,
33779
33671
  target: options.keys?.length ? `${options.keys.length} object${options.keys.length === 1 ? "" : "s"}` : options.prefix ?? "storage://",
33780
- sync: async ({
33781
- collection,
33782
- deleteDocument,
33783
- listDocuments,
33784
- sourceRecord
33785
- }) => {
33672
+ sync: async ({ collection, deleteDocument, listDocuments, sourceRecord }) => {
33786
33673
  const storageListing = options.keys && options.keys.length > 0 ? {
33787
33674
  complete: true,
33788
33675
  keys: options.keys,
@@ -33931,12 +33818,7 @@ var createRAGEmailSyncSource = (options) => ({
33931
33818
  retryAttempts: options.retryAttempts,
33932
33819
  retryDelayMs: options.retryDelayMs,
33933
33820
  target: options.label,
33934
- sync: async ({
33935
- collection,
33936
- deleteDocument,
33937
- listDocuments,
33938
- sourceRecord
33939
- }) => {
33821
+ sync: async ({ collection, deleteDocument, listDocuments, sourceRecord }) => {
33940
33822
  const listed = await (async () => {
33941
33823
  let cursor = options.resumeFromLastCursor === false ? undefined : getSyncMetadataString(sourceRecord?.metadata, "resumeNextCursor");
33942
33824
  const messages = [];
@@ -36484,12 +36366,7 @@ var initializeNativeBackend = (input) => {
36484
36366
  };
36485
36367
  var createNativeInitializationError = (error, nativeTableName) => new Error(`Failed to initialize sqlite vec0 backend for table "${nativeTableName}". ` + `Install @absolutejs/absolute-rag-sqlite for your platform, set native.extensionPath, or pre-register the sqlite-vec extension in the Database connection. ` + `Details: ${getErrorMessage2(error)}`);
36486
36368
  var initializeNativeBackendSafely = (input) => {
36487
- const {
36488
- nativeConfig,
36489
- nativeDiagnostics,
36490
- nativeResolution,
36491
- nativeTableName
36492
- } = input;
36369
+ const { nativeConfig, nativeDiagnostics, nativeResolution, nativeTableName } = input;
36493
36370
  try {
36494
36371
  return initializeNativeBackend(input);
36495
36372
  } catch (error) {
@@ -37142,5 +37019,5 @@ export {
37142
37019
  addRAGEvaluationSuiteCase
37143
37020
  };
37144
37021
 
37145
- //# debugId=F8C1E9C3E652619864756E2164756E21
37022
+ //# debugId=5909A1093B5AC6D464756E2164756E21
37146
37023
  //# sourceMappingURL=index.js.map