@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.
@@ -928,6 +928,82 @@ var buildSyncOverviewLatestRow = (sources) => {
928
928
  ].filter(Boolean).join(" \xB7 ")
929
929
  };
930
930
  };
931
+ var buildRAGSyncSourceRunPresentations = (source) => {
932
+ if (!Array.isArray(source.metadata?.recentRuns)) {
933
+ return [];
934
+ }
935
+ return source.metadata.recentRuns.slice(0, 3).map((entry, index) => {
936
+ const trigger = typeof entry.trigger === "string" ? entry.trigger : "sync";
937
+ const status = typeof entry.status === "string" ? entry.status : "unknown";
938
+ const finishedAt = typeof entry.finishedAt === "number" ? formatDateLabel(entry.finishedAt) : "n/a";
939
+ const duration = typeof entry.durationMs === "number" ? formatDurationLabel(entry.durationMs) : "n/a";
940
+ const docs = typeof entry.documentCount === "number" ? `${entry.documentCount} docs` : "n/a";
941
+ const chunks = typeof entry.chunkCount === "number" ? `${entry.chunkCount} chunks` : "n/a";
942
+ const error = typeof entry.error === "string" && entry.error.length > 0 ? entry.error : undefined;
943
+ return {
944
+ label: `Run ${index + 1}`,
945
+ status,
946
+ summary: `${trigger} \xB7 ${status} \xB7 ${docs} \xB7 ${chunks} \xB7 ${duration} \xB7 ${finishedAt}`,
947
+ rows: [
948
+ { label: "Trigger", value: trigger },
949
+ { label: "Status", value: status },
950
+ { label: "Output", value: `${docs} \xB7 ${chunks}` },
951
+ { label: "Duration", value: duration },
952
+ { label: "Finished", value: finishedAt },
953
+ ...error ? [{ label: "Error", value: error }] : []
954
+ ]
955
+ };
956
+ });
957
+ };
958
+ var buildRAGSyncSourcePresentation = (source) => {
959
+ const provider = typeof source.metadata?.provider === "string" ? source.metadata.provider : undefined;
960
+ const accountMode = typeof source.metadata?.accountMode === "string" ? source.metadata.accountMode : undefined;
961
+ const schedule = typeof source.metadata?.schedule === "string" ? source.metadata.schedule : undefined;
962
+ const lastTrigger = typeof source.metadata?.lastTrigger === "string" ? source.metadata.lastTrigger : undefined;
963
+ const liveReady = typeof source.metadata?.liveReady === "string" ? source.metadata.liveReady : undefined;
964
+ return {
965
+ id: source.id,
966
+ label: source.label,
967
+ kind: source.kind,
968
+ status: source.status,
969
+ summary: [
970
+ source.kind,
971
+ source.status,
972
+ typeof source.documentCount === "number" ? `${source.documentCount} docs` : "",
973
+ typeof source.chunkCount === "number" ? `${source.chunkCount} chunks` : "",
974
+ typeof source.lastSyncDurationMs === "number" ? formatDurationLabel(source.lastSyncDurationMs) : "",
975
+ typeof source.lastSuccessfulSyncAt === "number" ? `last success ${formatDateLabel(source.lastSuccessfulSyncAt)}` : typeof source.lastSyncedAt === "number" ? `last sync ${formatDateLabel(source.lastSyncedAt)}` : ""
976
+ ].filter(Boolean).join(" \xB7 "),
977
+ rows: [
978
+ ...source.target ? [{ label: "Target", value: source.target }] : [],
979
+ ...provider ? [{ label: "Provider", value: provider }] : [],
980
+ ...accountMode ? [{ label: "Account mode", value: accountMode }] : [],
981
+ ...schedule ? [{ label: "Schedule", value: schedule }] : [],
982
+ ...lastTrigger ? [{ label: "Last trigger", value: lastTrigger }] : [],
983
+ ...typeof source.lastSuccessfulSyncAt === "number" ? [
984
+ {
985
+ label: "Last success",
986
+ value: formatDateLabel(source.lastSuccessfulSyncAt)
987
+ }
988
+ ] : [],
989
+ ...typeof source.nextRetryAt === "number" ? [
990
+ {
991
+ label: "Next retry",
992
+ value: formatDateLabel(source.nextRetryAt)
993
+ }
994
+ ] : [],
995
+ ...source.lastError ? [{ label: "Last error", value: source.lastError }] : []
996
+ ],
997
+ tags: [
998
+ provider,
999
+ accountMode ? `mode ${accountMode}` : undefined,
1000
+ liveReady
1001
+ ].filter((value) => Boolean(value)),
1002
+ extendedSummary: source.description ?? liveReady,
1003
+ runs: buildRAGSyncSourceRunPresentations(source)
1004
+ };
1005
+ };
1006
+ var buildRAGSyncSourcePresentations = (sources) => (sources ?? []).map(buildRAGSyncSourcePresentation);
931
1007
  var buildRAGReadinessPresentation = (readiness) => {
932
1008
  if (!readiness) {
933
1009
  return {
@@ -3682,5 +3758,5 @@ export {
3682
3758
  buildRAGAnswerWorkflowState
3683
3759
  };
3684
3760
 
3685
- //# debugId=6C53CDC025CE17EB64756E2164756E21
3761
+ //# debugId=63C5869DB16E2E6264756E2164756E21
3686
3762
  //# sourceMappingURL=index.js.map