@absolutejs/rag 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +277 -1
- package/dist/index.js.map +5 -4
- package/dist/presentation/ui.js +298 -2
- package/dist/presentation/ui.js.map +5 -4
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/src/presentation/htmxCitationFragments.d.ts +76 -0
- package/dist/src/presentation/htmxRenderers.d.ts +5 -1
- package/dist/src/presentation/ui.d.ts +2 -0
- package/dist/svelte/index.js +1 -1
- package/dist/svelte/index.js.map +1 -1
- package/dist/vue/index.js +1 -1
- package/dist/vue/index.js.map +1 -1
- package/package.json +1 -1
package/dist/presentation/ui.js
CHANGED
|
@@ -11221,6 +11221,210 @@ var summarizeRAGRetrievalComparison = (entries) => ({
|
|
|
11221
11221
|
bestByLowestRuntimeCandidateBudgetExhaustedCases: selectComparisonEntryByLowestTraceMetric(entries, "retrievalId", "runtimeCandidateBudgetExhaustedCases"),
|
|
11222
11222
|
bestByLowestRuntimeUnderfilledTopKCases: selectComparisonEntryByLowestTraceMetric(entries, "retrievalId", "runtimeUnderfilledTopKCases")
|
|
11223
11223
|
});
|
|
11224
|
+
// src/presentation/htmxCitationFragments.ts
|
|
11225
|
+
var formatScore = (value) => Number.isFinite(value) ? value.toFixed(3) : "0.000";
|
|
11226
|
+
var buildSearchTargetId = (prefix, value) => {
|
|
11227
|
+
const normalized = value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
11228
|
+
return `${prefix}-${normalized || "item"}`;
|
|
11229
|
+
};
|
|
11230
|
+
var buildSourceSummarySectionGroups = (summaries) => {
|
|
11231
|
+
const groups = new Map;
|
|
11232
|
+
for (const summary of summaries ?? []) {
|
|
11233
|
+
const label = summary.contextLabel ?? summary.label;
|
|
11234
|
+
const id = buildSearchTargetId("source-summary-section", label);
|
|
11235
|
+
const existing = groups.get(id);
|
|
11236
|
+
if (existing) {
|
|
11237
|
+
existing.summaries.push(summary);
|
|
11238
|
+
existing.summary = `${existing.summaries.length} evidence summar${existing.summaries.length === 1 ? "y" : "ies"}`;
|
|
11239
|
+
continue;
|
|
11240
|
+
}
|
|
11241
|
+
groups.set(id, {
|
|
11242
|
+
id,
|
|
11243
|
+
label,
|
|
11244
|
+
targetId: id,
|
|
11245
|
+
summary: "1 evidence summary",
|
|
11246
|
+
summaries: [summary]
|
|
11247
|
+
});
|
|
11248
|
+
}
|
|
11249
|
+
return [...groups.values()].sort((left, right) => {
|
|
11250
|
+
const leftScore = Math.max(...left.summaries.map((summary) => summary.bestScore));
|
|
11251
|
+
const rightScore = Math.max(...right.summaries.map((summary) => summary.bestScore));
|
|
11252
|
+
return rightScore - leftScore;
|
|
11253
|
+
});
|
|
11254
|
+
};
|
|
11255
|
+
var buildGroundingReferenceGroups = (references) => {
|
|
11256
|
+
const groups = new Map;
|
|
11257
|
+
for (const reference of references ?? []) {
|
|
11258
|
+
const label = reference.contextLabel ?? reference.label ?? reference.source ?? reference.chunkId;
|
|
11259
|
+
const id = buildSearchTargetId("grounding-reference-section", label);
|
|
11260
|
+
const existing = groups.get(id);
|
|
11261
|
+
if (existing) {
|
|
11262
|
+
existing.references.push(reference);
|
|
11263
|
+
existing.summary = `${existing.references.length} grounding reference${existing.references.length === 1 ? "" : "s"}`;
|
|
11264
|
+
continue;
|
|
11265
|
+
}
|
|
11266
|
+
groups.set(id, {
|
|
11267
|
+
id,
|
|
11268
|
+
label,
|
|
11269
|
+
targetId: id,
|
|
11270
|
+
summary: "1 grounding reference",
|
|
11271
|
+
references: [reference]
|
|
11272
|
+
});
|
|
11273
|
+
}
|
|
11274
|
+
return [...groups.values()].sort((left, right) => {
|
|
11275
|
+
const leftScore = Math.max(...left.references.map((reference) => reference.score));
|
|
11276
|
+
const rightScore = Math.max(...right.references.map((reference) => reference.score));
|
|
11277
|
+
return rightScore - leftScore;
|
|
11278
|
+
});
|
|
11279
|
+
};
|
|
11280
|
+
var buildCitationGroups = (citations) => {
|
|
11281
|
+
const groups = new Map;
|
|
11282
|
+
for (const citation of citations ?? []) {
|
|
11283
|
+
const label = citation.contextLabel ?? citation.label ?? citation.source ?? citation.chunkId;
|
|
11284
|
+
const id = buildSearchTargetId("citation-section", label);
|
|
11285
|
+
const existing = groups.get(id);
|
|
11286
|
+
if (existing) {
|
|
11287
|
+
existing.citations.push(citation);
|
|
11288
|
+
existing.summary = `${existing.citations.length} citation${existing.citations.length === 1 ? "" : "s"}`;
|
|
11289
|
+
continue;
|
|
11290
|
+
}
|
|
11291
|
+
groups.set(id, {
|
|
11292
|
+
id,
|
|
11293
|
+
label,
|
|
11294
|
+
targetId: id,
|
|
11295
|
+
summary: "1 citation",
|
|
11296
|
+
citations: [citation]
|
|
11297
|
+
});
|
|
11298
|
+
}
|
|
11299
|
+
return [...groups.values()].sort((left, right) => {
|
|
11300
|
+
const leftScore = Math.max(...left.citations.map((citation) => citation.score));
|
|
11301
|
+
const rightScore = Math.max(...right.citations.map((citation) => citation.score));
|
|
11302
|
+
return rightScore - leftScore;
|
|
11303
|
+
});
|
|
11304
|
+
};
|
|
11305
|
+
var formatCitationLabel = (citation) => [citation.label, citation.contextLabel, citation.locatorLabel].filter(Boolean).join(" \xB7 ");
|
|
11306
|
+
var formatCitationSummary = (citation) => citation.source ?? citation.title ?? citation.chunkId;
|
|
11307
|
+
var formatCitationExcerpt = (citation) => citation.excerpt || citation.text;
|
|
11308
|
+
var formatEvidenceDetailLine = (label, value) => value && value.length > 0 ? `${label}: ${value}` : "";
|
|
11309
|
+
var formatEvidenceContextLine = (contextLabel, locatorLabel) => {
|
|
11310
|
+
const value = [locatorLabel, contextLabel].filter((entry) => Boolean(entry && entry.length > 0)).join(" \xB7 ");
|
|
11311
|
+
return value.length > 0 ? `location: ${value}` : "";
|
|
11312
|
+
};
|
|
11313
|
+
var formatSourceSummaryDetails = (summary) => [
|
|
11314
|
+
`best score: ${formatScore(summary.bestScore)}`,
|
|
11315
|
+
`coverage: ${summary.count} chunk(s) \xB7 citations ${summary.citationNumbers.map((value) => `[${value}]`).join(" ") || "none"}`,
|
|
11316
|
+
formatEvidenceContextLine(summary.contextLabel, summary.locatorLabel),
|
|
11317
|
+
formatEvidenceDetailLine("provenance", summary.provenanceLabel)
|
|
11318
|
+
].filter((value) => value.length > 0);
|
|
11319
|
+
var formatCitationDetails = (citation) => [
|
|
11320
|
+
formatEvidenceDetailLine("evidence", citation.source ?? citation.title ?? citation.chunkId),
|
|
11321
|
+
formatEvidenceContextLine(citation.contextLabel, citation.locatorLabel),
|
|
11322
|
+
formatEvidenceDetailLine("provenance", citation.provenanceLabel),
|
|
11323
|
+
`score: ${formatScore(citation.score)}`
|
|
11324
|
+
].filter((value) => value.length > 0);
|
|
11325
|
+
var formatSectionDiagnosticPercent = (value) => typeof value === "number" ? `${Math.round(value * 100)}%` : null;
|
|
11326
|
+
var formatSectionDiagnosticReason = (reason) => reason.replaceAll("_", " ");
|
|
11327
|
+
var formatSectionDiagnosticStage = (stage) => stage.replaceAll("_", " ");
|
|
11328
|
+
var formatSectionDiagnosticWeightReason = (reason) => ({
|
|
11329
|
+
final_stage_concentration: "final stage concentrated on this section",
|
|
11330
|
+
final_stage_dominant_within_parent: "final stage stayed ahead inside its parent",
|
|
11331
|
+
rerank_preserved_lead: "rerank kept this section in front",
|
|
11332
|
+
stage_runner_up_pressure: "runner-up stayed close in this stage",
|
|
11333
|
+
stage_expanded: "this section expanded in this stage",
|
|
11334
|
+
stage_held: "this section held steady in this stage",
|
|
11335
|
+
stage_narrowed: "this section narrowed in this stage"
|
|
11336
|
+
})[reason] ?? reason.replaceAll("_", " ");
|
|
11337
|
+
var formatSectionQueryAttributionReason = (reason) => ({
|
|
11338
|
+
base_query_only: "came only from the base query",
|
|
11339
|
+
transformed_query_only: "came only from the transformed query",
|
|
11340
|
+
variant_only: "came only from query variants",
|
|
11341
|
+
transform_introduced: "the transformed query introduced this section",
|
|
11342
|
+
variant_supported: "query variants reinforced this section",
|
|
11343
|
+
mixed_query_sources: "multiple query forms contributed"
|
|
11344
|
+
})[reason] ?? reason.replaceAll("_", " ");
|
|
11345
|
+
var formatSectionDiagnosticChannels = (diagnostic) => `Channels \xB7 hybrid ${diagnostic.hybridHits} \xB7 vector ${diagnostic.vectorHits} \xB7 lexical ${diagnostic.lexicalHits}`;
|
|
11346
|
+
var formatSectionDiagnosticAttributionFocus = (diagnostic) => {
|
|
11347
|
+
const mode = diagnostic.queryAttribution?.mode ?? "mixed";
|
|
11348
|
+
const label = mode === "primary" ? "Attribution \xB7 base-query-only" : mode === "transformed" ? "Attribution \xB7 transformed-only" : mode === "variant" ? "Attribution \xB7 variant-only" : "Attribution \xB7 mixed";
|
|
11349
|
+
const parts = [label];
|
|
11350
|
+
if ((diagnostic.queryAttribution?.primaryHits ?? 0) > 0)
|
|
11351
|
+
parts.push(`base ${diagnostic.queryAttribution?.primaryHits}`);
|
|
11352
|
+
if ((diagnostic.queryAttribution?.transformedHits ?? 0) > 0)
|
|
11353
|
+
parts.push(`transformed ${diagnostic.queryAttribution?.transformedHits}`);
|
|
11354
|
+
if ((diagnostic.queryAttribution?.variantHits ?? 0) > 0)
|
|
11355
|
+
parts.push(`variant ${diagnostic.queryAttribution?.variantHits}`);
|
|
11356
|
+
return parts.join(" \xB7 ");
|
|
11357
|
+
};
|
|
11358
|
+
var formatSectionDiagnosticPipeline = (diagnostic) => {
|
|
11359
|
+
const requestedMode = diagnostic.requestedMode ?? diagnostic.retrievalMode ?? "n/a";
|
|
11360
|
+
const selectedMode = diagnostic.retrievalMode ?? "n/a";
|
|
11361
|
+
const routeLabel = diagnostic.routingLabel ?? "default route";
|
|
11362
|
+
const transformLabel = diagnostic.queryTransformLabel ?? "no transform";
|
|
11363
|
+
return `Mode ${selectedMode} \xB7 requested ${requestedMode} \xB7 route ${routeLabel} \xB7 transform ${transformLabel} \xB7 rerank ${diagnostic.rerankApplied ? "on" : "off"} \xB7 source balance ${diagnostic.sourceBalanceApplied ? "on" : "off"} \xB7 threshold ${diagnostic.scoreThresholdApplied ? "on" : "off"} \xB7 query ${diagnostic.queryAttribution?.mode ?? "n/a"}`;
|
|
11364
|
+
};
|
|
11365
|
+
var formatSectionDiagnosticStageFlow = (diagnostic) => diagnostic.stageCounts.length > 0 ? `Stage flow \xB7 ${diagnostic.stageCounts.map((entry) => `${formatSectionDiagnosticStage(entry.stage)} ${entry.count}`).join(" \u2192 ")}` : null;
|
|
11366
|
+
var formatSectionDiagnosticStageBounds = (diagnostic) => {
|
|
11367
|
+
const parts = [];
|
|
11368
|
+
if (diagnostic.firstSeenStage)
|
|
11369
|
+
parts.push(`first seen ${formatSectionDiagnosticStage(diagnostic.firstSeenStage)}`);
|
|
11370
|
+
if (diagnostic.lastSeenStage)
|
|
11371
|
+
parts.push(`last seen ${formatSectionDiagnosticStage(diagnostic.lastSeenStage)}`);
|
|
11372
|
+
if (diagnostic.peakStage)
|
|
11373
|
+
parts.push(`peak ${formatSectionDiagnosticStage(diagnostic.peakStage)} ${diagnostic.peakCount}`);
|
|
11374
|
+
const finalRetention = formatSectionDiagnosticPercent(diagnostic.finalRetentionRate);
|
|
11375
|
+
if (finalRetention)
|
|
11376
|
+
parts.push(`final retention ${finalRetention}`);
|
|
11377
|
+
if (typeof diagnostic.dropFromPeak === "number")
|
|
11378
|
+
parts.push(`drop from peak ${diagnostic.dropFromPeak}`);
|
|
11379
|
+
return parts.length > 0 ? parts.join(" \xB7 ") : null;
|
|
11380
|
+
};
|
|
11381
|
+
var formatSectionDiagnosticStageWeightRows = (diagnostic) => (diagnostic.stageWeights ?? []).filter((entry) => entry.reasons.length > 0 || entry.stage === "rerank" || entry.stage === "finalize").map((entry) => {
|
|
11382
|
+
const parts = [
|
|
11383
|
+
`${formatSectionDiagnosticStage(entry.stage)} ${(entry.stageShare * 100).toFixed(0)}% of stage`,
|
|
11384
|
+
typeof entry.stageScoreShare === "number" ? `${(entry.stageScoreShare * 100).toFixed(0)}% of stage score` : null,
|
|
11385
|
+
typeof entry.retentionRate === "number" && entry.previousStage && entry.retentionRate !== 1 ? `${(entry.retentionRate * 100).toFixed(0)}% retained from ${formatSectionDiagnosticStage(entry.previousStage)}` : null,
|
|
11386
|
+
typeof entry.countDelta === "number" && entry.countDelta !== 0 ? `delta ${entry.countDelta >= 0 ? "+" : ""}${entry.countDelta}` : null,
|
|
11387
|
+
typeof entry.parentStageShare === "number" && entry.strongestSiblingLabel ? `${(entry.parentStageShare * 100).toFixed(0)}% of parent stage` : null,
|
|
11388
|
+
typeof entry.parentStageScoreShare === "number" && entry.strongestSiblingLabel ? `${(entry.parentStageScoreShare * 100).toFixed(0)}% of parent stage score` : null,
|
|
11389
|
+
typeof entry.stageShareGap === "number" ? `gap ${(entry.stageShareGap * 100).toFixed(0)}%` : null,
|
|
11390
|
+
typeof entry.stageScoreShareGap === "number" ? `score gap ${(entry.stageScoreShareGap * 100).toFixed(0)}%` : null,
|
|
11391
|
+
entry.strongestSiblingLabel ? `runner-up ${entry.strongestSiblingLabel}` : null
|
|
11392
|
+
].filter((value) => Boolean(value));
|
|
11393
|
+
return parts.join(" \xB7 ");
|
|
11394
|
+
});
|
|
11395
|
+
var formatSectionDiagnosticStageWeightReasons = (diagnostic) => (diagnostic.stageWeights ?? []).flatMap((entry) => entry.reasons.map((reason) => `${formatSectionDiagnosticStage(entry.stage)} \xB7 ${formatSectionDiagnosticWeightReason(reason)}`));
|
|
11396
|
+
var formatSectionDiagnosticQueryAttributionReasons = (diagnostic) => (diagnostic.queryAttribution?.reasons ?? []).map((reason) => formatSectionQueryAttributionReason(reason));
|
|
11397
|
+
var formatSectionDiagnosticCompetition = (diagnostic) => {
|
|
11398
|
+
const parts = [];
|
|
11399
|
+
const parentShare = formatSectionDiagnosticPercent(diagnostic.parentShare);
|
|
11400
|
+
const parentShareGap = formatSectionDiagnosticPercent(diagnostic.parentShareGap);
|
|
11401
|
+
if (!diagnostic.strongestSiblingLabel)
|
|
11402
|
+
return "";
|
|
11403
|
+
if (parentShare)
|
|
11404
|
+
parts.push(`parent share ${parentShare}`);
|
|
11405
|
+
if (parentShareGap)
|
|
11406
|
+
parts.push(`gap ${parentShareGap}`);
|
|
11407
|
+
parts.push(`runner-up ${diagnostic.strongestSiblingLabel}`);
|
|
11408
|
+
return parts.join(" \xB7 ");
|
|
11409
|
+
};
|
|
11410
|
+
var formatSectionDiagnosticTopEntry = (diagnostic) => {
|
|
11411
|
+
const parts = [];
|
|
11412
|
+
if (diagnostic.topSource)
|
|
11413
|
+
parts.push(`top source ${diagnostic.topSource}`);
|
|
11414
|
+
if (diagnostic.topChunkId)
|
|
11415
|
+
parts.push(`lead chunk ${diagnostic.topChunkId}`);
|
|
11416
|
+
parts.push(`${diagnostic.sourceCount} source${diagnostic.sourceCount === 1 ? "" : "s"}`);
|
|
11417
|
+
parts.push(`primary ${diagnostic.queryAttribution?.primaryHits ?? 0} \xB7 transformed ${diagnostic.queryAttribution?.transformedHits ?? 0} \xB7 variant ${diagnostic.queryAttribution?.variantHits ?? 0}`);
|
|
11418
|
+
return parts.join(" \xB7 ");
|
|
11419
|
+
};
|
|
11420
|
+
var formatSectionDiagnosticReasons = (diagnostic) => [
|
|
11421
|
+
...diagnostic.reasons.map((reason) => formatSectionDiagnosticReason(reason)),
|
|
11422
|
+
...formatSectionDiagnosticQueryAttributionReasons(diagnostic),
|
|
11423
|
+
...diagnostic.routingReason ? [`routing \xB7 ${diagnostic.routingReason}`] : [],
|
|
11424
|
+
...diagnostic.queryTransformReason ? [`transform \xB7 ${diagnostic.queryTransformReason}`] : []
|
|
11425
|
+
];
|
|
11426
|
+
var formatSectionDiagnosticDistributionRows = (diagnostic) => diagnostic.parentDistribution.map((entry) => `${entry.isActive ? "Active" : "Peer"} \xB7 ${entry.label} \xB7 ${entry.count} hit${entry.count === 1 ? "" : "s"} \xB7 ${formatSectionDiagnosticPercent(entry.parentShare) ?? "0%"}`);
|
|
11427
|
+
|
|
11224
11428
|
// src/presentation/htmxRenderers.ts
|
|
11225
11429
|
var STREAM_STAGES = [
|
|
11226
11430
|
"submitting",
|
|
@@ -11361,15 +11565,87 @@ var makeAdminActionCards = (prefix) => (actions) => {
|
|
|
11361
11565
|
</article>`;
|
|
11362
11566
|
}).join("")}</div>`;
|
|
11363
11567
|
};
|
|
11568
|
+
var makeCitations = (prefix) => (sources) => {
|
|
11569
|
+
const citations = buildRAGCitations(sources);
|
|
11570
|
+
if (citations.length === 0) {
|
|
11571
|
+
return "";
|
|
11572
|
+
}
|
|
11573
|
+
return [
|
|
11574
|
+
`<div class="${prefix}-results">`,
|
|
11575
|
+
"<h4>Citation Trail</h4>",
|
|
11576
|
+
`<p class="${prefix}-metadata">Each citation maps a concrete retrieved chunk to a stable reference number you can carry into the answer UI.</p>`,
|
|
11577
|
+
`<div class="${prefix}-result-grid">`,
|
|
11578
|
+
buildCitationGroups(citations).map((group) => `
|
|
11579
|
+
<article class="${prefix}-result-item" id="${escapeHtml(group.targetId)}">
|
|
11580
|
+
<h3>${escapeHtml(group.label)}</h3>
|
|
11581
|
+
<p class="${prefix}-result-source">${escapeHtml(group.summary)}</p>
|
|
11582
|
+
<div class="${prefix}-result-grid">
|
|
11583
|
+
${group.citations.map((citation, index) => `
|
|
11584
|
+
<article class="${prefix}-result-item ${prefix}-citation-card">
|
|
11585
|
+
<p class="${prefix}-citation-badge">[${index + 1}] ${escapeHtml(formatCitationLabel(citation))}</p>
|
|
11586
|
+
<p class="${prefix}-result-score">${escapeHtml(formatCitationSummary(citation))}</p>
|
|
11587
|
+
${formatCitationDetails(citation).map((line) => `<p class="${prefix}-metadata">${escapeHtml(line)}</p>`).join("")}
|
|
11588
|
+
<p class="${prefix}-result-text">${escapeHtml(formatCitationExcerpt(citation))}</p>
|
|
11589
|
+
</article>`).join("")}
|
|
11590
|
+
</div>
|
|
11591
|
+
</article>`).join(""),
|
|
11592
|
+
"</div>",
|
|
11593
|
+
"</div>"
|
|
11594
|
+
].join("");
|
|
11595
|
+
};
|
|
11596
|
+
var makeSourceSummaries = (prefix) => (sources) => {
|
|
11597
|
+
const summaries = buildRAGSourceSummaries(sources);
|
|
11598
|
+
if (summaries.length === 0) {
|
|
11599
|
+
return `<p class="${prefix}-metadata">Retrieved source groups: 0</p>`;
|
|
11600
|
+
}
|
|
11601
|
+
const groups = buildSourceSummarySectionGroups(summaries);
|
|
11602
|
+
return [
|
|
11603
|
+
`<p class="${prefix}-metadata">Retrieved source groups: ${summaries.length}</p>`,
|
|
11604
|
+
`<div class="${prefix}-result-grid">`,
|
|
11605
|
+
groups.map((group) => `
|
|
11606
|
+
<article class="${prefix}-result-item" id="${escapeHtml(group.targetId)}">
|
|
11607
|
+
<h3>${escapeHtml(group.label)}</h3>
|
|
11608
|
+
<p class="${prefix}-result-source">${escapeHtml(group.summary)}</p>
|
|
11609
|
+
<div class="${prefix}-result-grid">
|
|
11610
|
+
${group.summaries.map((summary) => `
|
|
11611
|
+
<article class="${prefix}-result-item">
|
|
11612
|
+
<h4>${escapeHtml(summary.label)}</h4>
|
|
11613
|
+
${formatSourceSummaryDetails(summary).map((line) => `<p class="${prefix}-metadata">${escapeHtml(line)}</p>`).join("")}
|
|
11614
|
+
<p class="${prefix}-result-text">${escapeHtml(summary.excerpt)}</p>
|
|
11615
|
+
</article>`).join("")}
|
|
11616
|
+
</div>
|
|
11617
|
+
</article>`).join(""),
|
|
11618
|
+
"</div>"
|
|
11619
|
+
].join("");
|
|
11620
|
+
};
|
|
11621
|
+
var makeSectionDiagnosticCard = (prefix) => (diagnostic) => [
|
|
11622
|
+
`<article class="${prefix}-result-item">`,
|
|
11623
|
+
`<h4>${escapeHtml(diagnostic.label)}</h4>`,
|
|
11624
|
+
`<p class="${prefix}-result-source">${escapeHtml(diagnostic.summary)}</p>`,
|
|
11625
|
+
`<p class="${prefix}-metadata">${escapeHtml(formatSectionDiagnosticChannels(diagnostic))}</p>`,
|
|
11626
|
+
`<p class="${prefix}-metadata">${escapeHtml(formatSectionDiagnosticAttributionFocus(diagnostic))}</p>`,
|
|
11627
|
+
`<p class="${prefix}-metadata">${escapeHtml(formatSectionDiagnosticPipeline(diagnostic))}</p>`,
|
|
11628
|
+
`${formatSectionDiagnosticStageFlow(diagnostic) ? `<p class="${prefix}-metadata">${escapeHtml(formatSectionDiagnosticStageFlow(diagnostic) ?? "")}</p>` : ""}`,
|
|
11629
|
+
`${formatSectionDiagnosticStageBounds(diagnostic) ? `<p class="${prefix}-metadata">${escapeHtml(formatSectionDiagnosticStageBounds(diagnostic) ?? "")}</p>` : ""}`,
|
|
11630
|
+
`${formatSectionDiagnosticStageWeightRows(diagnostic).map((line) => `<p class="${prefix}-metadata">${escapeHtml(line)}</p>`).join("")}`,
|
|
11631
|
+
`<p class="${prefix}-metadata">${escapeHtml(formatSectionDiagnosticTopEntry(diagnostic))}</p>`,
|
|
11632
|
+
`${formatSectionDiagnosticCompetition(diagnostic) ? `<p class="${prefix}-metadata">${escapeHtml(formatSectionDiagnosticCompetition(diagnostic) ?? "")}</p>` : ""}`,
|
|
11633
|
+
`${[...formatSectionDiagnosticReasons(diagnostic), ...formatSectionDiagnosticStageWeightReasons(diagnostic)].length > 0 ? `<div class="${prefix}-badge-row">${[...formatSectionDiagnosticReasons(diagnostic), ...formatSectionDiagnosticStageWeightReasons(diagnostic)].map((reason) => `<span class="${prefix}-state-chip">${escapeHtml(reason)}</span>`).join("")}</div>` : ""}`,
|
|
11634
|
+
`${formatSectionDiagnosticDistributionRows(diagnostic).map((line) => `<p class="${prefix}-metadata">${escapeHtml(line)}</p>`).join("")}`,
|
|
11635
|
+
`</article>`
|
|
11636
|
+
].join("");
|
|
11364
11637
|
var resolveRAGHTMXRenderers = (custom = {}) => {
|
|
11365
11638
|
const classPrefix = custom.classPrefix ?? "rag";
|
|
11366
11639
|
return {
|
|
11367
11640
|
adminActionCards: custom.adminActionCards ?? makeAdminActionCards(classPrefix),
|
|
11368
11641
|
adminJobCards: custom.adminJobCards ?? makeAdminJobCards(classPrefix),
|
|
11369
11642
|
capabilities: custom.capabilities ?? makeCapabilities(classPrefix),
|
|
11643
|
+
citations: custom.citations ?? makeCitations(classPrefix),
|
|
11370
11644
|
classPrefix,
|
|
11371
11645
|
detailList: custom.detailList ?? makeDetailList(classPrefix),
|
|
11372
11646
|
nativeSource: custom.nativeSource ?? defaultNativeSource,
|
|
11647
|
+
sectionDiagnosticCard: custom.sectionDiagnosticCard ?? makeSectionDiagnosticCard(classPrefix),
|
|
11648
|
+
sourceSummaries: custom.sourceSummaries ?? makeSourceSummaries(classPrefix),
|
|
11373
11649
|
stageRow: custom.stageRow ?? makeStageRow(classPrefix),
|
|
11374
11650
|
statusMessage: custom.statusMessage ?? defaultStatusMessage,
|
|
11375
11651
|
statusSummary: custom.statusSummary ?? defaultStatusSummary,
|
|
@@ -11381,6 +11657,24 @@ export {
|
|
|
11381
11657
|
resolveRAGHTMXRenderers,
|
|
11382
11658
|
getLatestRAGSources,
|
|
11383
11659
|
getLatestAssistantMessage,
|
|
11660
|
+
formatSourceSummaryDetails,
|
|
11661
|
+
formatSectionDiagnosticTopEntry,
|
|
11662
|
+
formatSectionDiagnosticStageWeightRows,
|
|
11663
|
+
formatSectionDiagnosticStageWeightReasons,
|
|
11664
|
+
formatSectionDiagnosticStageFlow,
|
|
11665
|
+
formatSectionDiagnosticStageBounds,
|
|
11666
|
+
formatSectionDiagnosticReasons,
|
|
11667
|
+
formatSectionDiagnosticPipeline,
|
|
11668
|
+
formatSectionDiagnosticDistributionRows,
|
|
11669
|
+
formatSectionDiagnosticCompetition,
|
|
11670
|
+
formatSectionDiagnosticChannels,
|
|
11671
|
+
formatSectionDiagnosticAttributionFocus,
|
|
11672
|
+
formatCitationSummary,
|
|
11673
|
+
formatCitationLabel,
|
|
11674
|
+
formatCitationExcerpt,
|
|
11675
|
+
formatCitationDetails,
|
|
11676
|
+
buildSourceSummarySectionGroups,
|
|
11677
|
+
buildSearchTargetId,
|
|
11384
11678
|
buildRAGSyncSourcePresentations,
|
|
11385
11679
|
buildRAGSyncSourcePresentation,
|
|
11386
11680
|
buildRAGSyncOverviewPresentation,
|
|
@@ -11431,8 +11725,10 @@ export {
|
|
|
11431
11725
|
buildRAGAdminJobPresentations,
|
|
11432
11726
|
buildRAGAdminJobPresentation,
|
|
11433
11727
|
buildRAGAdminActionPresentations,
|
|
11434
|
-
buildRAGAdminActionPresentation
|
|
11728
|
+
buildRAGAdminActionPresentation,
|
|
11729
|
+
buildGroundingReferenceGroups,
|
|
11730
|
+
buildCitationGroups
|
|
11435
11731
|
};
|
|
11436
11732
|
|
|
11437
|
-
//# debugId=
|
|
11733
|
+
//# debugId=FCAE71C0401EF18B64756E2164756E21
|
|
11438
11734
|
//# sourceMappingURL=ui.js.map
|