@absolutejs/absolute 0.19.0-beta.497 → 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.
@@ -1,28 +1,30 @@
1
- import type { RAGAdminActionRecord, RAGAdminJobRecord, RAGAdminCapabilities, RAGBackendCapabilities, RAGCorpusHealth, RAGDocumentSummary, RAGExtractorReadiness, RAGIngestJobRecord, RAGOperationsResponse, RAGVectorStoreStatus } from '../../../types/ai';
1
+ import type { RAGAdminActionRecord, RAGAdminJobRecord, RAGAdminCapabilities, RAGBackendCapabilities, RAGCorpusHealth, RAGDocumentSummary, RAGExtractorReadiness, RAGIngestJobRecord, RAGOperationsResponse, RAGSyncSourceRecord, RAGVectorStoreStatus } from '../../../types/ai';
2
2
  export declare const useRAGOps: (path: string, autoLoad?: boolean) => {
3
3
  admin: import("vue").Ref<RAGAdminCapabilities | undefined, RAGAdminCapabilities | undefined>;
4
4
  adminActions: import("vue").Ref<{
5
5
  id: string;
6
- action: "clear_index" | "create_document" | "delete_document" | "reindex_document" | "reindex_source" | "reseed" | "reset";
6
+ action: "clear_index" | "create_document" | "delete_document" | "reindex_document" | "reindex_source" | "sync_all_sources" | "sync_source" | "reseed" | "reset";
7
7
  status: "completed" | "failed";
8
8
  startedAt: number;
9
9
  finishedAt?: number | undefined;
10
10
  elapsedMs?: number | undefined;
11
11
  documentId?: string | undefined;
12
+ target?: string | undefined;
12
13
  error?: string | undefined;
13
14
  }[], RAGAdminActionRecord[] | {
14
15
  id: string;
15
- action: "clear_index" | "create_document" | "delete_document" | "reindex_document" | "reindex_source" | "reseed" | "reset";
16
+ action: "clear_index" | "create_document" | "delete_document" | "reindex_document" | "reindex_source" | "sync_all_sources" | "sync_source" | "reseed" | "reset";
16
17
  status: "completed" | "failed";
17
18
  startedAt: number;
18
19
  finishedAt?: number | undefined;
19
20
  elapsedMs?: number | undefined;
20
21
  documentId?: string | undefined;
22
+ target?: string | undefined;
21
23
  error?: string | undefined;
22
24
  }[]>;
23
25
  adminJobs: import("vue").Ref<{
24
26
  id: string;
25
- action: "clear_index" | "create_document" | "delete_document" | "reindex_document" | "reindex_source" | "reseed" | "reset";
27
+ action: "clear_index" | "create_document" | "delete_document" | "reindex_document" | "reindex_source" | "sync_all_sources" | "sync_source" | "reseed" | "reset";
26
28
  status: import("../..").RAGAdminJobStatus;
27
29
  startedAt: number;
28
30
  finishedAt?: number | undefined;
@@ -31,7 +33,7 @@ export declare const useRAGOps: (path: string, autoLoad?: boolean) => {
31
33
  error?: string | undefined;
32
34
  }[], RAGAdminJobRecord[] | {
33
35
  id: string;
34
- action: "clear_index" | "create_document" | "delete_document" | "reindex_document" | "reindex_source" | "reseed" | "reset";
36
+ action: "clear_index" | "create_document" | "delete_document" | "reindex_document" | "reindex_source" | "sync_all_sources" | "sync_source" | "reseed" | "reset";
35
37
  status: import("../..").RAGAdminJobStatus;
36
38
  startedAt: number;
37
39
  finishedAt?: number | undefined;
@@ -74,5 +76,32 @@ export declare const useRAGOps: (path: string, autoLoad?: boolean) => {
74
76
  refresh: () => Promise<RAGOperationsResponse>;
75
77
  reset: () => void;
76
78
  status: import("vue").Ref<RAGVectorStoreStatus | undefined, RAGVectorStoreStatus | undefined>;
79
+ syncSources: import("vue").Ref<{
80
+ id: string;
81
+ label: string;
82
+ kind: "directory" | "url" | "storage" | "email" | "custom";
83
+ status: import("../..").RAGSyncSourceStatus;
84
+ description?: string | undefined;
85
+ target?: string | undefined;
86
+ lastSyncedAt?: number | undefined;
87
+ lastSyncDurationMs?: number | undefined;
88
+ lastError?: string | undefined;
89
+ documentCount?: number | undefined;
90
+ chunkCount?: number | undefined;
91
+ metadata?: Record<string, unknown> | undefined;
92
+ }[], RAGSyncSourceRecord[] | {
93
+ id: string;
94
+ label: string;
95
+ kind: "directory" | "url" | "storage" | "email" | "custom";
96
+ status: import("../..").RAGSyncSourceStatus;
97
+ description?: string | undefined;
98
+ target?: string | undefined;
99
+ lastSyncedAt?: number | undefined;
100
+ lastSyncDurationMs?: number | undefined;
101
+ lastError?: string | undefined;
102
+ documentCount?: number | undefined;
103
+ chunkCount?: number | undefined;
104
+ metadata?: Record<string, unknown> | undefined;
105
+ }[]>;
77
106
  };
78
107
  export type UseRAGOpsResult = ReturnType<typeof useRAGOps>;
@@ -946,6 +946,37 @@ var createRAGClient = (options) => {
946
946
  }
947
947
  return parseJson(response);
948
948
  },
949
+ async syncSources() {
950
+ const response = await fetchImpl(`${basePath}/sync`);
951
+ if (!response.ok) {
952
+ throw new Error(await toErrorMessage(response));
953
+ }
954
+ return parseJson(response);
955
+ },
956
+ async syncAllSources() {
957
+ const response = await fetchImpl(`${basePath}/sync`, {
958
+ method: "POST"
959
+ });
960
+ if (!response.ok) {
961
+ return {
962
+ error: await toErrorMessage(response),
963
+ ok: false
964
+ };
965
+ }
966
+ return parseJson(response);
967
+ },
968
+ async syncSource(id) {
969
+ const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
970
+ method: "POST"
971
+ });
972
+ if (!response.ok) {
973
+ return {
974
+ error: await toErrorMessage(response),
975
+ ok: false
976
+ };
977
+ }
978
+ return parseJson(response);
979
+ },
949
980
  async reindexDocument(id) {
950
981
  const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
951
982
  method: "POST"
@@ -2024,6 +2055,7 @@ var createRAGIndexAdmin = (path) => {
2024
2055
  const error = writable5(null);
2025
2056
  const lastMutation = writable5(null);
2026
2057
  const backends = writable5(null);
2058
+ const syncSources = writable5(null);
2027
2059
  const run = async (operation) => {
2028
2060
  isLoading.set(true);
2029
2061
  error.set(null);
@@ -2089,6 +2121,27 @@ var createRAGIndexAdmin = (path) => {
2089
2121
  backends.set(response);
2090
2122
  return response;
2091
2123
  });
2124
+ const loadSyncSources = async () => run(async () => {
2125
+ const response = await client.syncSources();
2126
+ syncSources.set(response);
2127
+ return response;
2128
+ });
2129
+ const syncAllSources = async () => run(async () => {
2130
+ const response = await client.syncAllSources();
2131
+ syncSources.set(response);
2132
+ if (!response.ok) {
2133
+ throw new Error(response.error ?? "Failed to sync sources");
2134
+ }
2135
+ return response;
2136
+ });
2137
+ const syncSource = async (id) => run(async () => {
2138
+ const response = await client.syncSource(id);
2139
+ syncSources.set(response);
2140
+ if (!response.ok) {
2141
+ throw new Error(response.error ?? "Failed to sync source");
2142
+ }
2143
+ return response;
2144
+ });
2092
2145
  const clearIndex = async () => run(async () => {
2093
2146
  const response = await client.clearIndex();
2094
2147
  const mutation = { ok: response.ok };
@@ -2100,6 +2153,7 @@ var createRAGIndexAdmin = (path) => {
2100
2153
  error.set(null);
2101
2154
  isLoading.set(false);
2102
2155
  lastMutation.set(null);
2156
+ syncSources.set(null);
2103
2157
  };
2104
2158
  return {
2105
2159
  backends,
@@ -2110,11 +2164,15 @@ var createRAGIndexAdmin = (path) => {
2110
2164
  isLoading,
2111
2165
  lastMutation,
2112
2166
  loadBackends,
2167
+ loadSyncSources,
2113
2168
  reindexDocument,
2114
2169
  reindexSource,
2115
2170
  reseed,
2116
2171
  reset,
2117
- resetState
2172
+ resetState,
2173
+ syncAllSources,
2174
+ syncSource,
2175
+ syncSources
2118
2176
  };
2119
2177
  };
2120
2178
 
@@ -2132,6 +2190,7 @@ var createRAGOps = (path, autoLoad = true) => {
2132
2190
  const readiness = writable6(undefined);
2133
2191
  const documents = writable6(undefined);
2134
2192
  const ingestJobs = writable6([]);
2193
+ const syncSources = writable6([]);
2135
2194
  const error = writable6(null);
2136
2195
  const isLoading = writable6(autoLoad);
2137
2196
  const refresh = async () => {
@@ -2149,6 +2208,7 @@ var createRAGOps = (path, autoLoad = true) => {
2149
2208
  readiness.set(response.readiness);
2150
2209
  documents.set(response.documents);
2151
2210
  ingestJobs.set(response.ingestJobs ?? []);
2211
+ syncSources.set(response.syncSources ?? []);
2152
2212
  return response;
2153
2213
  } catch (caught) {
2154
2214
  error.set(caught instanceof Error ? caught.message : String(caught));
@@ -2169,6 +2229,7 @@ var createRAGOps = (path, autoLoad = true) => {
2169
2229
  ingestJobs.set([]);
2170
2230
  isLoading.set(false);
2171
2231
  readiness.set(undefined);
2232
+ syncSources.set([]);
2172
2233
  status.set(undefined);
2173
2234
  };
2174
2235
  if (autoLoad) {
@@ -2190,7 +2251,8 @@ var createRAGOps = (path, autoLoad = true) => {
2190
2251
  readiness,
2191
2252
  refresh,
2192
2253
  reset,
2193
- status
2254
+ status,
2255
+ syncSources
2194
2256
  };
2195
2257
  };
2196
2258
 
@@ -2443,5 +2505,5 @@ export {
2443
2505
  createAIStream
2444
2506
  };
2445
2507
 
2446
- //# debugId=65C6A24C0063194364756E2164756E21
2508
+ //# debugId=D5B725F10268C73F64756E2164756E21
2447
2509
  //# sourceMappingURL=index.js.map