@absolutejs/absolute 0.19.0-beta.548 → 0.19.0-beta.549

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.
@@ -1321,6 +1321,23 @@ export type RAGSyncOverviewPresentation = {
1321
1321
  rows: RAGLabelValueRow[];
1322
1322
  sections: RAGSummarySectionPresentation[];
1323
1323
  };
1324
+ export type RAGSyncSourceRunPresentation = {
1325
+ label: string;
1326
+ status: string;
1327
+ summary: string;
1328
+ rows?: RAGLabelValueRow[];
1329
+ };
1330
+ export type RAGSyncSourcePresentation = {
1331
+ id: string;
1332
+ label: string;
1333
+ kind: RAGSyncSourceRecord['kind'];
1334
+ status: RAGSyncSourceRecord['status'];
1335
+ summary: string;
1336
+ rows: RAGLabelValueRow[];
1337
+ tags?: string[];
1338
+ extendedSummary?: string;
1339
+ runs?: RAGSyncSourceRunPresentation[];
1340
+ };
1324
1341
  export type RAGEvaluationCaseTracePresentation = {
1325
1342
  caseId: string;
1326
1343
  label: string;
@@ -1259,6 +1259,82 @@ var buildSyncOverviewLatestRow = (sources) => {
1259
1259
  ].filter(Boolean).join(" \xB7 ")
1260
1260
  };
1261
1261
  };
1262
+ var buildRAGSyncSourceRunPresentations = (source) => {
1263
+ if (!Array.isArray(source.metadata?.recentRuns)) {
1264
+ return [];
1265
+ }
1266
+ return source.metadata.recentRuns.slice(0, 3).map((entry, index) => {
1267
+ const trigger = typeof entry.trigger === "string" ? entry.trigger : "sync";
1268
+ const status = typeof entry.status === "string" ? entry.status : "unknown";
1269
+ const finishedAt = typeof entry.finishedAt === "number" ? formatDateLabel(entry.finishedAt) : "n/a";
1270
+ const duration = typeof entry.durationMs === "number" ? formatDurationLabel(entry.durationMs) : "n/a";
1271
+ const docs = typeof entry.documentCount === "number" ? `${entry.documentCount} docs` : "n/a";
1272
+ const chunks = typeof entry.chunkCount === "number" ? `${entry.chunkCount} chunks` : "n/a";
1273
+ const error = typeof entry.error === "string" && entry.error.length > 0 ? entry.error : undefined;
1274
+ return {
1275
+ label: `Run ${index + 1}`,
1276
+ status,
1277
+ summary: `${trigger} \xB7 ${status} \xB7 ${docs} \xB7 ${chunks} \xB7 ${duration} \xB7 ${finishedAt}`,
1278
+ rows: [
1279
+ { label: "Trigger", value: trigger },
1280
+ { label: "Status", value: status },
1281
+ { label: "Output", value: `${docs} \xB7 ${chunks}` },
1282
+ { label: "Duration", value: duration },
1283
+ { label: "Finished", value: finishedAt },
1284
+ ...error ? [{ label: "Error", value: error }] : []
1285
+ ]
1286
+ };
1287
+ });
1288
+ };
1289
+ var buildRAGSyncSourcePresentation = (source) => {
1290
+ const provider = typeof source.metadata?.provider === "string" ? source.metadata.provider : undefined;
1291
+ const accountMode = typeof source.metadata?.accountMode === "string" ? source.metadata.accountMode : undefined;
1292
+ const schedule = typeof source.metadata?.schedule === "string" ? source.metadata.schedule : undefined;
1293
+ const lastTrigger = typeof source.metadata?.lastTrigger === "string" ? source.metadata.lastTrigger : undefined;
1294
+ const liveReady = typeof source.metadata?.liveReady === "string" ? source.metadata.liveReady : undefined;
1295
+ return {
1296
+ id: source.id,
1297
+ label: source.label,
1298
+ kind: source.kind,
1299
+ status: source.status,
1300
+ summary: [
1301
+ source.kind,
1302
+ source.status,
1303
+ typeof source.documentCount === "number" ? `${source.documentCount} docs` : "",
1304
+ typeof source.chunkCount === "number" ? `${source.chunkCount} chunks` : "",
1305
+ typeof source.lastSyncDurationMs === "number" ? formatDurationLabel(source.lastSyncDurationMs) : "",
1306
+ typeof source.lastSuccessfulSyncAt === "number" ? `last success ${formatDateLabel(source.lastSuccessfulSyncAt)}` : typeof source.lastSyncedAt === "number" ? `last sync ${formatDateLabel(source.lastSyncedAt)}` : ""
1307
+ ].filter(Boolean).join(" \xB7 "),
1308
+ rows: [
1309
+ ...source.target ? [{ label: "Target", value: source.target }] : [],
1310
+ ...provider ? [{ label: "Provider", value: provider }] : [],
1311
+ ...accountMode ? [{ label: "Account mode", value: accountMode }] : [],
1312
+ ...schedule ? [{ label: "Schedule", value: schedule }] : [],
1313
+ ...lastTrigger ? [{ label: "Last trigger", value: lastTrigger }] : [],
1314
+ ...typeof source.lastSuccessfulSyncAt === "number" ? [
1315
+ {
1316
+ label: "Last success",
1317
+ value: formatDateLabel(source.lastSuccessfulSyncAt)
1318
+ }
1319
+ ] : [],
1320
+ ...typeof source.nextRetryAt === "number" ? [
1321
+ {
1322
+ label: "Next retry",
1323
+ value: formatDateLabel(source.nextRetryAt)
1324
+ }
1325
+ ] : [],
1326
+ ...source.lastError ? [{ label: "Last error", value: source.lastError }] : []
1327
+ ],
1328
+ tags: [
1329
+ provider,
1330
+ accountMode ? `mode ${accountMode}` : undefined,
1331
+ liveReady
1332
+ ].filter((value) => Boolean(value)),
1333
+ extendedSummary: source.description ?? liveReady,
1334
+ runs: buildRAGSyncSourceRunPresentations(source)
1335
+ };
1336
+ };
1337
+ var buildRAGSyncSourcePresentations = (sources) => (sources ?? []).map(buildRAGSyncSourcePresentation);
1262
1338
  var buildRAGReadinessPresentation = (readiness) => {
1263
1339
  if (!readiness) {
1264
1340
  return {
@@ -4345,5 +4421,5 @@ export {
4345
4421
  AIStreamKey
4346
4422
  };
4347
4423
 
4348
- //# debugId=D7C9B3BC24B5466464756E2164756E21
4424
+ //# debugId=937ABBD6575B6D4664756E2164756E21
4349
4425
  //# sourceMappingURL=index.js.map