@absolutejs/absolute 0.19.0-beta.543 → 0.19.0-beta.545

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ai/index.js CHANGED
@@ -4781,6 +4781,232 @@ var buildRAGRetrievalTracePresentation = (trace) => {
4781
4781
  steps
4782
4782
  };
4783
4783
  };
4784
+ var formatCompactList = (values) => values && values.length > 0 ? values.join(", ") : "none";
4785
+ var formatCoverageMap = (entries) => {
4786
+ if (!entries) {
4787
+ return "none";
4788
+ }
4789
+ const values = Object.entries(entries);
4790
+ return values.length > 0 ? values.map(([key, value]) => `${key} ${value}`).join(" \xB7 ") : "none";
4791
+ };
4792
+ var formatDurationLabel = (value) => {
4793
+ if (typeof value !== "number" || !Number.isFinite(value)) {
4794
+ return "n/a";
4795
+ }
4796
+ if (value < 1000) {
4797
+ return `${value}ms`;
4798
+ }
4799
+ if (value < 60000) {
4800
+ return `${(value / 1000).toFixed(value >= 1e4 ? 0 : 1)}s`;
4801
+ }
4802
+ if (value < 3600000) {
4803
+ return `${(value / 60000).toFixed(value >= 600000 ? 0 : 1)}m`;
4804
+ }
4805
+ return `${(value / 3600000).toFixed(value >= 36000000 ? 0 : 1)}h`;
4806
+ };
4807
+ var formatDateLabel = (value) => typeof value === "number" && Number.isFinite(value) ? new Date(value).toLocaleString("en-US") : "n/a";
4808
+ var formatAgeLabel = (value) => {
4809
+ if (typeof value !== "number" || !Number.isFinite(value)) {
4810
+ return "n/a";
4811
+ }
4812
+ if (value < 1000) {
4813
+ return `${Math.round(value)}ms`;
4814
+ }
4815
+ if (value < 60000) {
4816
+ return `${(value / 1000).toFixed(value >= 1e4 ? 0 : 1)}s`;
4817
+ }
4818
+ if (value < 3600000) {
4819
+ return `${(value / 60000).toFixed(value >= 600000 ? 0 : 1)}m`;
4820
+ }
4821
+ if (value < 86400000) {
4822
+ return `${(value / 3600000).toFixed(value >= 36000000 ? 0 : 1)}h`;
4823
+ }
4824
+ return `${(value / 86400000).toFixed(value >= 864000000 ? 0 : 1)}d`;
4825
+ };
4826
+ var buildSyncOverviewLatestRow = (sources) => {
4827
+ const latest = [...sources].filter((record) => typeof record.lastSuccessfulSyncAt === "number" || typeof record.lastSyncedAt === "number").sort((left, right) => (right.lastSuccessfulSyncAt ?? right.lastSyncedAt ?? 0) - (left.lastSuccessfulSyncAt ?? left.lastSyncedAt ?? 0))[0];
4828
+ if (!latest) {
4829
+ return {
4830
+ label: "Latest sync",
4831
+ value: "No completed run yet"
4832
+ };
4833
+ }
4834
+ return {
4835
+ label: "Latest sync",
4836
+ value: [
4837
+ latest.label,
4838
+ typeof latest.documentCount === "number" ? `${latest.documentCount} docs` : "",
4839
+ typeof latest.chunkCount === "number" ? `${latest.chunkCount} chunks` : "",
4840
+ typeof latest.lastSyncDurationMs === "number" ? formatDurationLabel(latest.lastSyncDurationMs) : "",
4841
+ typeof latest.lastSuccessfulSyncAt === "number" ? formatDateLabel(latest.lastSuccessfulSyncAt) : typeof latest.lastSyncedAt === "number" ? formatDateLabel(latest.lastSyncedAt) : ""
4842
+ ].filter(Boolean).join(" \xB7 ")
4843
+ };
4844
+ };
4845
+ var buildRAGReadinessPresentation = (readiness) => {
4846
+ if (!readiness) {
4847
+ return {
4848
+ sections: [
4849
+ {
4850
+ label: "Provider",
4851
+ title: "Unavailable",
4852
+ summary: "Readiness data is not available yet."
4853
+ }
4854
+ ]
4855
+ };
4856
+ }
4857
+ return {
4858
+ sections: [
4859
+ {
4860
+ label: "Provider",
4861
+ title: readiness.providerConfigured ? readiness.providerName ?? "Runtime provider routing" : "Not configured",
4862
+ summary: readiness.providerConfigured ? readiness.model ? `Requests route through ${readiness.providerName ?? "the runtime provider registry"} with default model ${readiness.model}.` : `Requests route through ${readiness.providerName ?? "the runtime provider registry"}.` : "Provider-backed retrieval is not configured yet."
4863
+ },
4864
+ {
4865
+ label: "Embeddings",
4866
+ title: readiness.embeddingConfigured ? readiness.embeddingModel === "collection-managed embeddings" ? "Collection-managed" : "Configured" : "Missing",
4867
+ summary: readiness.embeddingConfigured ? readiness.embeddingModel === "collection-managed embeddings" ? "Embeddings come from the collection and vector store layer, so retrieval stays vector-backed without a separate top-level embedding provider." : readiness.embeddingModel ?? "Embedding model configured." : "Embeddings are not configured yet."
4868
+ },
4869
+ {
4870
+ label: "Retrieval Stack",
4871
+ title: readiness.rerankerConfigured ? "Reranker ready" : "Vector only",
4872
+ summary: readiness.indexManagerConfigured ? "Index manager configured." : "Index manager not configured."
4873
+ },
4874
+ {
4875
+ label: "Extractors",
4876
+ title: readiness.extractorsConfigured ? `${readiness.extractorNames.length} configured` : "None configured",
4877
+ summary: readiness.extractorsConfigured ? `Configured extractors: ${formatCompactList(readiness.extractorNames)}` : "No extractors configured.",
4878
+ pills: readiness.extractorNames.length > 0 ? readiness.extractorNames : ["No extractors configured"]
4879
+ }
4880
+ ]
4881
+ };
4882
+ };
4883
+ var buildRAGCorpusHealthPresentation = (health) => {
4884
+ if (!health) {
4885
+ return {
4886
+ sections: [
4887
+ {
4888
+ label: "Corpus health",
4889
+ title: "Unavailable",
4890
+ summary: "Corpus health is not available yet."
4891
+ }
4892
+ ]
4893
+ };
4894
+ }
4895
+ return {
4896
+ sections: [
4897
+ {
4898
+ label: "Corpus coverage",
4899
+ title: `Formats: ${formatCoverageMap(health.coverageByFormat)}`,
4900
+ summary: `Kinds: ${formatCoverageMap(health.coverageByKind)}`,
4901
+ rows: [
4902
+ {
4903
+ label: "Average chunks per document",
4904
+ value: health.averageChunksPerDocument.toFixed(2)
4905
+ }
4906
+ ]
4907
+ },
4908
+ {
4909
+ label: "Chunk quality",
4910
+ title: `${health.averageChunksPerDocument.toFixed(2)} avg chunks/doc`,
4911
+ summary: `Empty docs ${health.emptyDocuments} \xB7 empty chunks ${health.emptyChunks} \xB7 low signal ${health.lowSignalChunks}`,
4912
+ rows: [
4913
+ {
4914
+ label: "Missing source",
4915
+ value: String(health.documentsMissingSource)
4916
+ },
4917
+ {
4918
+ label: "Missing title",
4919
+ value: String(health.documentsMissingTitle)
4920
+ },
4921
+ {
4922
+ label: "Missing metadata",
4923
+ value: String(health.documentsMissingMetadata)
4924
+ }
4925
+ ]
4926
+ },
4927
+ {
4928
+ label: "Freshness",
4929
+ title: `${health.staleDocuments.length} stale docs`,
4930
+ summary: `Stale threshold ${formatAgeLabel(health.staleAfterMs)}`,
4931
+ rows: [
4932
+ {
4933
+ label: "Oldest age",
4934
+ value: formatAgeLabel(health.oldestDocumentAgeMs)
4935
+ },
4936
+ {
4937
+ label: "Newest age",
4938
+ value: formatAgeLabel(health.newestDocumentAgeMs)
4939
+ }
4940
+ ]
4941
+ },
4942
+ {
4943
+ label: "Failures",
4944
+ title: `${health.failedIngestJobs} ingest \xB7 ${health.failedAdminJobs} admin`,
4945
+ summary: `Duplicate sources ${health.duplicateSourceGroups.length} \xB7 duplicate ids ${health.duplicateDocumentIdGroups.length}`,
4946
+ rows: [
4947
+ {
4948
+ label: "Failures by input",
4949
+ value: formatCoverageMap(health.failuresByInputKind)
4950
+ },
4951
+ {
4952
+ label: "Failures by extractor",
4953
+ value: formatCoverageMap(health.failuresByExtractor)
4954
+ },
4955
+ {
4956
+ label: "Failures by admin action",
4957
+ value: formatCoverageMap(health.failuresByAdminAction)
4958
+ }
4959
+ ]
4960
+ }
4961
+ ]
4962
+ };
4963
+ };
4964
+ var buildRAGSyncOverviewPresentation = (sources) => {
4965
+ const records = sources ?? [];
4966
+ if (records.length === 0) {
4967
+ return {
4968
+ rows: [
4969
+ { label: "Configured sync sources", value: "0" },
4970
+ {
4971
+ label: "Latest sync",
4972
+ value: "No sync sources configured yet."
4973
+ }
4974
+ ],
4975
+ sections: [
4976
+ {
4977
+ label: "Sync overview",
4978
+ title: "No sync sources configured",
4979
+ summary: "Add sync sources to monitor directories, URLs, storage, or mailboxes."
4980
+ }
4981
+ ]
4982
+ };
4983
+ }
4984
+ const countByStatus = (status) => records.filter((record) => record.status === status).length;
4985
+ return {
4986
+ rows: [
4987
+ { label: "Configured sync sources", value: String(records.length) },
4988
+ { label: "Completed", value: String(countByStatus("completed")) },
4989
+ { label: "Running", value: String(countByStatus("running")) },
4990
+ {
4991
+ label: "Failed",
4992
+ value: String(countByStatus("failed"))
4993
+ },
4994
+ buildSyncOverviewLatestRow(records)
4995
+ ],
4996
+ sections: [
4997
+ {
4998
+ label: "Sync overview",
4999
+ title: `${records.length} configured`,
5000
+ summary: `${countByStatus("completed")} completed \xB7 ${countByStatus("running")} running \xB7 ${countByStatus("failed")} failed`
5001
+ },
5002
+ {
5003
+ label: "Latest sync",
5004
+ title: buildSyncOverviewLatestRow(records).value,
5005
+ summary: "Most recent completed or last-known sync activity."
5006
+ }
5007
+ ]
5008
+ };
5009
+ };
4784
5010
  var formatMediaTimestamp = (value) => {
4785
5011
  if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
4786
5012
  return;
@@ -5956,7 +6182,7 @@ var buildRAGComparisonTraceDiffRows = (entry, leader) => {
5956
6182
  }
5957
6183
  return rows;
5958
6184
  };
5959
- var buildRAGRetrievalComparisonCardPresentations = (comparison) => {
6185
+ var buildRAGRetrievalComparisonPresentations = (comparison) => {
5960
6186
  const leader = comparison.entries[0];
5961
6187
  return comparison.entries.map((entry) => ({
5962
6188
  diffLabel: leader?.label ?? "Leader",
@@ -5973,7 +6199,7 @@ var buildRAGRetrievalComparisonOverviewPresentation = (comparison) => buildCompa
5973
6199
  resolveLabel: (id) => comparison.entries.find((entry) => entry.retrievalId === id)?.label ?? id ?? "n/a",
5974
6200
  summary: comparison.summary
5975
6201
  });
5976
- var buildRAGRerankerComparisonCardPresentations = (comparison) => {
6202
+ var buildRAGRerankerComparisonPresentations = (comparison) => {
5977
6203
  const leader = comparison.entries[0];
5978
6204
  return comparison.entries.map((entry) => ({
5979
6205
  diffLabel: leader?.label ?? "Leader",
@@ -5990,7 +6216,7 @@ var buildRAGRerankerComparisonOverviewPresentation = (comparison) => buildCompar
5990
6216
  resolveLabel: (id) => comparison.entries.find((entry) => entry.rerankerId === id)?.label ?? id ?? "n/a",
5991
6217
  summary: comparison.summary
5992
6218
  });
5993
- var buildRAGGroundingProviderCardPresentations = (entries) => entries.map((entry) => ({
6219
+ var buildRAGGroundingProviderPresentations = (entries) => entries.map((entry) => ({
5994
6220
  headline: [
5995
6221
  entry.label,
5996
6222
  `passing ${formatEvaluationPassingRate(entry.response.passingRate)}`,
@@ -6028,6 +6254,26 @@ var buildRAGGroundingProviderOverviewPresentation = (input) => {
6028
6254
  winnerSummary: winnerEntry ? `passing ${formatEvaluationPassingRate(winnerEntry.response.passingRate)} \xB7 citation f1 ${winnerEntry.response.summary.averageCitationF1.toFixed(3)} \xB7 resolved ${formatEvaluationPassingRate(winnerEntry.response.summary.averageResolvedCitationRate)}` : "Stored workflow evaluation"
6029
6255
  };
6030
6256
  };
6257
+ var buildRAGQualityOverviewPresentation = (input) => ({
6258
+ rows: [
6259
+ ...buildRAGRetrievalComparisonOverviewPresentation(input.retrievalComparison).rows,
6260
+ ...buildRAGRerankerComparisonOverviewPresentation(input.rerankerComparison).rows,
6261
+ {
6262
+ label: "Grounding",
6263
+ value: formatGroundingHistorySummaryValue(input.groundingEvaluation)
6264
+ },
6265
+ ...input.groundingProviderOverview?.rows ?? [
6266
+ {
6267
+ label: "Grounding providers",
6268
+ value: "Configure an AI provider to compare grounded answers."
6269
+ }
6270
+ ]
6271
+ ],
6272
+ insights: [
6273
+ "The example should answer three questions quickly: which strategy wins, whether grounding is stable, and whether the result regressed.",
6274
+ "Detailed case-by-case evidence stays behind collapsible sections so the page reads like a product surface instead of a console buffer."
6275
+ ]
6276
+ });
6031
6277
  var buildRAGGroundingProviderCaseComparisonPresentations = (comparisons) => comparisons.map((comparison) => {
6032
6278
  const resolveLabel = (key) => comparison.entries.find((entry) => entry.providerKey === key)?.label ?? key ?? "n/a";
6033
6279
  return {
@@ -12080,19 +12326,22 @@ export {
12080
12326
  buildRAGUpsertInputFromURLs,
12081
12327
  buildRAGUpsertInputFromDocuments,
12082
12328
  buildRAGUpsertInputFromDirectory,
12329
+ buildRAGSyncOverviewPresentation,
12083
12330
  buildRAGStreamProgress,
12084
12331
  buildRAGSourceSummaries,
12085
12332
  buildRAGSourceGroups,
12086
12333
  buildRAGRetrievalTracePresentation,
12334
+ buildRAGRetrievalComparisonPresentations,
12087
12335
  buildRAGRetrievalComparisonOverviewPresentation,
12088
- buildRAGRetrievalComparisonCardPresentations,
12336
+ buildRAGRerankerComparisonPresentations,
12089
12337
  buildRAGRerankerComparisonOverviewPresentation,
12090
- buildRAGRerankerComparisonCardPresentations,
12338
+ buildRAGReadinessPresentation,
12339
+ buildRAGQualityOverviewPresentation,
12091
12340
  buildRAGLexicalHaystack,
12092
12341
  buildRAGGroundingReferences,
12342
+ buildRAGGroundingProviderPresentations,
12093
12343
  buildRAGGroundingProviderOverviewPresentation,
12094
12344
  buildRAGGroundingProviderCaseComparisonPresentations,
12095
- buildRAGGroundingProviderCardPresentations,
12096
12345
  buildRAGGroundedAnswer,
12097
12346
  buildRAGEvaluationRunDiff,
12098
12347
  buildRAGEvaluationResponse,
@@ -12100,6 +12349,7 @@ export {
12100
12349
  buildRAGEvaluationHistoryRows,
12101
12350
  buildRAGEvaluationHistoryPresentation,
12102
12351
  buildRAGEvaluationCaseTracePresentations,
12352
+ buildRAGCorpusHealthPresentation,
12103
12353
  buildRAGContext,
12104
12354
  buildRAGComparisonTraceSummaryRows,
12105
12355
  buildRAGComparisonTraceDiffRows,
@@ -12121,5 +12371,5 @@ export {
12121
12371
  aiChat
12122
12372
  };
12123
12373
 
12124
- //# debugId=3C2A786B1639044464756E2164756E21
12374
+ //# debugId=6F47D6ED348FAE0A64756E2164756E21
12125
12375
  //# sourceMappingURL=index.js.map