@absolutejs/absolute 0.19.0-beta.496 → 0.19.0-beta.498

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.
@@ -520,18 +520,19 @@ export type RAGCorpusHealth = {
520
520
  };
521
521
  export type RAGAdminActionRecord = {
522
522
  id: string;
523
- action: 'clear_index' | 'create_document' | 'delete_document' | 'reindex_document' | 'reindex_source' | 'reseed' | 'reset';
523
+ action: 'clear_index' | 'create_document' | 'delete_document' | 'reindex_document' | 'reindex_source' | 'sync_all_sources' | 'sync_source' | 'reseed' | 'reset';
524
524
  status: 'completed' | 'failed';
525
525
  startedAt: number;
526
526
  finishedAt?: number;
527
527
  elapsedMs?: number;
528
528
  documentId?: string;
529
+ target?: string;
529
530
  error?: string;
530
531
  };
531
532
  export type RAGAdminJobStatus = 'running' | 'completed' | 'failed';
532
533
  export type RAGAdminJobRecord = {
533
534
  id: string;
534
- action: 'clear_index' | 'create_document' | 'delete_document' | 'reindex_document' | 'reindex_source' | 'reseed' | 'reset';
535
+ action: 'clear_index' | 'create_document' | 'delete_document' | 'reindex_document' | 'reindex_source' | 'sync_all_sources' | 'sync_source' | 'reseed' | 'reset';
535
536
  status: RAGAdminJobStatus;
536
537
  startedAt: number;
537
538
  finishedAt?: number;
@@ -543,10 +544,87 @@ export type RAGAdminCapabilities = {
543
544
  canClearIndex: boolean;
544
545
  canCreateDocument: boolean;
545
546
  canDeleteDocument: boolean;
547
+ canListSyncSources: boolean;
546
548
  canReindexDocument: boolean;
547
549
  canReindexSource: boolean;
548
550
  canReseed: boolean;
549
551
  canReset: boolean;
552
+ canSyncAllSources: boolean;
553
+ canSyncSource: boolean;
554
+ };
555
+ export type RAGSyncSourceStatus = 'idle' | 'running' | 'completed' | 'failed' | 'disabled';
556
+ export type RAGSyncSourceRecord = {
557
+ id: string;
558
+ label: string;
559
+ kind: 'directory' | 'url' | 'storage' | 'email' | 'custom';
560
+ status: RAGSyncSourceStatus;
561
+ description?: string;
562
+ target?: string;
563
+ lastSyncedAt?: number;
564
+ lastSyncDurationMs?: number;
565
+ lastError?: string;
566
+ documentCount?: number;
567
+ chunkCount?: number;
568
+ metadata?: Record<string, unknown>;
569
+ };
570
+ export type RAGSyncSourceRunResult = {
571
+ documentCount?: number;
572
+ chunkCount?: number;
573
+ metadata?: Record<string, unknown>;
574
+ };
575
+ export type RAGSyncSourceDefinition = {
576
+ id: string;
577
+ label: string;
578
+ kind: RAGSyncSourceRecord['kind'];
579
+ description?: string;
580
+ target?: string;
581
+ metadata?: Record<string, unknown>;
582
+ sync: (input: RAGSyncSourceContext) => Promise<RAGSyncSourceRunResult> | RAGSyncSourceRunResult;
583
+ };
584
+ export type RAGSyncSourceContext = {
585
+ collection: RAGCollection;
586
+ listDocuments?: () => Promise<RAGIndexedDocument[]> | RAGIndexedDocument[];
587
+ deleteDocument?: (id: string) => Promise<boolean> | boolean;
588
+ signal?: AbortSignal;
589
+ };
590
+ export type RAGDirectorySyncSourceOptions = {
591
+ id: string;
592
+ label: string;
593
+ directory: string;
594
+ description?: string;
595
+ baseMetadata?: Record<string, unknown>;
596
+ defaultChunking?: RAGChunkingOptions;
597
+ extractors?: RAGFileExtractor[];
598
+ includeExtensions?: string[];
599
+ metadata?: Record<string, unknown>;
600
+ recursive?: boolean;
601
+ };
602
+ export type RAGUrlSyncSourceOptions = {
603
+ id: string;
604
+ label: string;
605
+ urls: RAGDocumentUrlInput[];
606
+ description?: string;
607
+ baseMetadata?: Record<string, unknown>;
608
+ defaultChunking?: RAGChunkingOptions;
609
+ extractors?: RAGFileExtractor[];
610
+ metadata?: Record<string, unknown>;
611
+ };
612
+ export type RAGSyncManager = Pick<RAGIndexManager, 'listSyncSources' | 'syncSource' | 'syncAllSources'>;
613
+ export type CreateRAGSyncManagerOptions = {
614
+ collection: RAGCollection;
615
+ deleteDocument?: (id: string) => Promise<boolean> | boolean;
616
+ listDocuments?: () => Promise<RAGIndexedDocument[]> | RAGIndexedDocument[];
617
+ sources: RAGSyncSourceDefinition[];
618
+ };
619
+ export type RAGSyncResponse = {
620
+ ok: true;
621
+ source: RAGSyncSourceRecord;
622
+ } | {
623
+ ok: true;
624
+ sources: RAGSyncSourceRecord[];
625
+ } | {
626
+ ok: false;
627
+ error: string;
550
628
  };
551
629
  export type RAGExtractorReadiness = {
552
630
  providerConfigured: boolean;
@@ -570,6 +648,7 @@ export type RAGOperationsResponse = {
570
648
  health: RAGCorpusHealth;
571
649
  readiness: RAGExtractorReadiness;
572
650
  ingestJobs: RAGIngestJobRecord[];
651
+ syncSources: RAGSyncSourceRecord[];
573
652
  };
574
653
  export type RAGStatusResponse = {
575
654
  ok: true;
@@ -582,6 +661,7 @@ export type RAGStatusResponse = {
582
661
  health?: RAGCorpusHealth;
583
662
  readiness?: RAGExtractorReadiness;
584
663
  ingestJobs?: RAGIngestJobRecord[];
664
+ syncSources?: RAGSyncSourceRecord[];
585
665
  };
586
666
  export type RAGDocumentsResponse = {
587
667
  ok: true;
@@ -760,6 +840,9 @@ export type RAGIndexManager = {
760
840
  deleteDocument?: (id: string) => Promise<boolean> | boolean;
761
841
  reindexDocument?: (id: string) => Promise<RAGMutationResponse | void> | RAGMutationResponse | void;
762
842
  reindexSource?: (source: string) => Promise<RAGMutationResponse | void> | RAGMutationResponse | void;
843
+ listSyncSources?: () => Promise<RAGSyncSourceRecord[]> | RAGSyncSourceRecord[];
844
+ syncSource?: (id: string) => Promise<RAGSyncResponse | void> | RAGSyncResponse | void;
845
+ syncAllSources?: () => Promise<RAGSyncResponse | void> | RAGSyncResponse | void;
763
846
  reseed?: () => Promise<RAGMutationResponse | void> | RAGMutationResponse | void;
764
847
  reset?: () => Promise<RAGMutationResponse | void> | RAGMutationResponse | void;
765
848
  listBackends?: () => Promise<Omit<RAGBackendsResponse, 'ok'> | RAGBackendDescriptor[]> | Omit<RAGBackendsResponse, 'ok'> | RAGBackendDescriptor[];
@@ -941,6 +941,37 @@ var createRAGClient = (options) => {
941
941
  }
942
942
  return parseJson(response);
943
943
  },
944
+ async syncSources() {
945
+ const response = await fetchImpl(`${basePath}/sync`);
946
+ if (!response.ok) {
947
+ throw new Error(await toErrorMessage(response));
948
+ }
949
+ return parseJson(response);
950
+ },
951
+ async syncAllSources() {
952
+ const response = await fetchImpl(`${basePath}/sync`, {
953
+ method: "POST"
954
+ });
955
+ if (!response.ok) {
956
+ return {
957
+ error: await toErrorMessage(response),
958
+ ok: false
959
+ };
960
+ }
961
+ return parseJson(response);
962
+ },
963
+ async syncSource(id) {
964
+ const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
965
+ method: "POST"
966
+ });
967
+ if (!response.ok) {
968
+ return {
969
+ error: await toErrorMessage(response),
970
+ ok: false
971
+ };
972
+ }
973
+ return parseJson(response);
974
+ },
944
975
  async reindexDocument(id) {
945
976
  const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
946
977
  method: "POST"
@@ -2021,6 +2052,7 @@ var useRAGIndexAdmin = (path) => {
2021
2052
  const error = ref6(null);
2022
2053
  const lastMutation = ref6(null);
2023
2054
  const backends = ref6(null);
2055
+ const syncSources = ref6(null);
2024
2056
  const run = async (operation) => {
2025
2057
  isLoading.value = true;
2026
2058
  error.value = null;
@@ -2086,6 +2118,27 @@ var useRAGIndexAdmin = (path) => {
2086
2118
  backends.value = response;
2087
2119
  return response;
2088
2120
  });
2121
+ const loadSyncSources = async () => run(async () => {
2122
+ const response = await client.syncSources();
2123
+ syncSources.value = response;
2124
+ return response;
2125
+ });
2126
+ const syncAllSources = async () => run(async () => {
2127
+ const response = await client.syncAllSources();
2128
+ syncSources.value = response;
2129
+ if (!response.ok) {
2130
+ throw new Error(response.error ?? "Failed to sync sources");
2131
+ }
2132
+ return response;
2133
+ });
2134
+ const syncSource = async (id) => run(async () => {
2135
+ const response = await client.syncSource(id);
2136
+ syncSources.value = response;
2137
+ if (!response.ok) {
2138
+ throw new Error(response.error ?? "Failed to sync source");
2139
+ }
2140
+ return response;
2141
+ });
2089
2142
  const clearIndex = async () => run(async () => {
2090
2143
  const response = await client.clearIndex();
2091
2144
  const mutation = { ok: response.ok };
@@ -2097,6 +2150,7 @@ var useRAGIndexAdmin = (path) => {
2097
2150
  error.value = null;
2098
2151
  isLoading.value = false;
2099
2152
  lastMutation.value = null;
2153
+ syncSources.value = null;
2100
2154
  };
2101
2155
  return {
2102
2156
  backends,
@@ -2107,11 +2161,15 @@ var useRAGIndexAdmin = (path) => {
2107
2161
  isLoading,
2108
2162
  lastMutation,
2109
2163
  loadBackends,
2164
+ loadSyncSources,
2110
2165
  reindexDocument,
2111
2166
  reindexSource,
2112
2167
  reseed,
2113
2168
  reset,
2114
- resetState
2169
+ resetState,
2170
+ syncAllSources,
2171
+ syncSource,
2172
+ syncSources
2115
2173
  };
2116
2174
  };
2117
2175
 
@@ -2129,6 +2187,7 @@ var useRAGOps = (path, autoLoad = true) => {
2129
2187
  const readiness = ref7();
2130
2188
  const documents = ref7();
2131
2189
  const ingestJobs = ref7([]);
2190
+ const syncSources = ref7([]);
2132
2191
  const error = ref7(null);
2133
2192
  const isLoading = ref7(autoLoad);
2134
2193
  const refresh = async () => {
@@ -2146,6 +2205,7 @@ var useRAGOps = (path, autoLoad = true) => {
2146
2205
  readiness.value = response.readiness;
2147
2206
  documents.value = response.documents;
2148
2207
  ingestJobs.value = response.ingestJobs ?? [];
2208
+ syncSources.value = response.syncSources ?? [];
2149
2209
  return response;
2150
2210
  } catch (caught) {
2151
2211
  error.value = caught instanceof Error ? caught.message : String(caught);
@@ -2166,6 +2226,7 @@ var useRAGOps = (path, autoLoad = true) => {
2166
2226
  ingestJobs.value = [];
2167
2227
  isLoading.value = false;
2168
2228
  readiness.value = undefined;
2229
+ syncSources.value = [];
2169
2230
  status.value = undefined;
2170
2231
  };
2171
2232
  onMounted(() => {
@@ -2189,7 +2250,8 @@ var useRAGOps = (path, autoLoad = true) => {
2189
2250
  readiness,
2190
2251
  refresh,
2191
2252
  reset,
2192
- status
2253
+ status,
2254
+ syncSources
2193
2255
  };
2194
2256
  };
2195
2257
 
@@ -2426,5 +2488,5 @@ export {
2426
2488
  AIStreamKey
2427
2489
  };
2428
2490
 
2429
- //# debugId=E21AE4418B18819564756E2164756E21
2491
+ //# debugId=1477F3A16DE9B05264756E2164756E21
2430
2492
  //# sourceMappingURL=index.js.map