@absolutejs/absolute 0.19.0-beta.497 → 0.19.0-beta.499

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,4 +1,4 @@
1
- import type { RAGBackendsResponse, RAGContentFormat, RAGChunkingStrategy, RAGMutationResponse } from '../../../types/ai';
1
+ import type { RAGBackendsResponse, RAGContentFormat, RAGChunkingStrategy, RAGMutationResponse, RAGSyncResponse } from '../../../types/ai';
2
2
  export declare const useRAGIndexAdmin: (path: string) => {
3
3
  backends: import("vue").Ref<{
4
4
  ok: true;
@@ -201,10 +201,132 @@ export declare const useRAGIndexAdmin: (path: string) => {
201
201
  } | undefined;
202
202
  } | null>;
203
203
  loadBackends: () => Promise<RAGBackendsResponse>;
204
+ loadSyncSources: () => Promise<RAGSyncResponse>;
204
205
  reindexDocument: (id: string) => Promise<RAGMutationResponse>;
205
206
  reindexSource: (source: string) => Promise<RAGMutationResponse>;
206
207
  reseed: () => Promise<RAGMutationResponse>;
207
208
  reset: () => Promise<RAGMutationResponse>;
208
209
  resetState: () => void;
210
+ syncAllSources: () => Promise<{
211
+ ok: true;
212
+ source: import("../..").RAGSyncSourceRecord;
213
+ partial?: boolean;
214
+ } | {
215
+ ok: true;
216
+ sources: import("../..").RAGSyncSourceRecord[];
217
+ partial?: boolean;
218
+ failedSourceIds?: string[];
219
+ errorsBySource?: Record<string, string>;
220
+ }>;
221
+ syncSource: (id: string) => Promise<{
222
+ ok: true;
223
+ source: import("../..").RAGSyncSourceRecord;
224
+ partial?: boolean;
225
+ } | {
226
+ ok: true;
227
+ sources: import("../..").RAGSyncSourceRecord[];
228
+ partial?: boolean;
229
+ failedSourceIds?: string[];
230
+ errorsBySource?: Record<string, string>;
231
+ }>;
232
+ syncSources: import("vue").Ref<{
233
+ ok: true;
234
+ source: {
235
+ id: string;
236
+ label: string;
237
+ kind: "directory" | "url" | "storage" | "email" | "custom";
238
+ status: import("../..").RAGSyncSourceStatus;
239
+ description?: string | undefined;
240
+ target?: string | undefined;
241
+ lastStartedAt?: number | undefined;
242
+ lastSyncedAt?: number | undefined;
243
+ lastSyncDurationMs?: number | undefined;
244
+ lastError?: string | undefined;
245
+ lastSuccessfulSyncAt?: number | undefined;
246
+ consecutiveFailures?: number | undefined;
247
+ retryAttempts?: number | undefined;
248
+ nextRetryAt?: number | undefined;
249
+ documentCount?: number | undefined;
250
+ chunkCount?: number | undefined;
251
+ metadata?: Record<string, unknown> | undefined;
252
+ };
253
+ partial?: boolean | undefined;
254
+ } | {
255
+ ok: true;
256
+ sources: {
257
+ id: string;
258
+ label: string;
259
+ kind: "directory" | "url" | "storage" | "email" | "custom";
260
+ status: import("../..").RAGSyncSourceStatus;
261
+ description?: string | undefined;
262
+ target?: string | undefined;
263
+ lastStartedAt?: number | undefined;
264
+ lastSyncedAt?: number | undefined;
265
+ lastSyncDurationMs?: number | undefined;
266
+ lastError?: string | undefined;
267
+ lastSuccessfulSyncAt?: number | undefined;
268
+ consecutiveFailures?: number | undefined;
269
+ retryAttempts?: number | undefined;
270
+ nextRetryAt?: number | undefined;
271
+ documentCount?: number | undefined;
272
+ chunkCount?: number | undefined;
273
+ metadata?: Record<string, unknown> | undefined;
274
+ }[];
275
+ partial?: boolean | undefined;
276
+ failedSourceIds?: string[] | undefined;
277
+ errorsBySource?: Record<string, string> | undefined;
278
+ } | {
279
+ ok: false;
280
+ error: string;
281
+ } | null, RAGSyncResponse | {
282
+ ok: true;
283
+ source: {
284
+ id: string;
285
+ label: string;
286
+ kind: "directory" | "url" | "storage" | "email" | "custom";
287
+ status: import("../..").RAGSyncSourceStatus;
288
+ description?: string | undefined;
289
+ target?: string | undefined;
290
+ lastStartedAt?: number | undefined;
291
+ lastSyncedAt?: number | undefined;
292
+ lastSyncDurationMs?: number | undefined;
293
+ lastError?: string | undefined;
294
+ lastSuccessfulSyncAt?: number | undefined;
295
+ consecutiveFailures?: number | undefined;
296
+ retryAttempts?: number | undefined;
297
+ nextRetryAt?: number | undefined;
298
+ documentCount?: number | undefined;
299
+ chunkCount?: number | undefined;
300
+ metadata?: Record<string, unknown> | undefined;
301
+ };
302
+ partial?: boolean | undefined;
303
+ } | {
304
+ ok: true;
305
+ sources: {
306
+ id: string;
307
+ label: string;
308
+ kind: "directory" | "url" | "storage" | "email" | "custom";
309
+ status: import("../..").RAGSyncSourceStatus;
310
+ description?: string | undefined;
311
+ target?: string | undefined;
312
+ lastStartedAt?: number | undefined;
313
+ lastSyncedAt?: number | undefined;
314
+ lastSyncDurationMs?: number | undefined;
315
+ lastError?: string | undefined;
316
+ lastSuccessfulSyncAt?: number | undefined;
317
+ consecutiveFailures?: number | undefined;
318
+ retryAttempts?: number | undefined;
319
+ nextRetryAt?: number | undefined;
320
+ documentCount?: number | undefined;
321
+ chunkCount?: number | undefined;
322
+ metadata?: Record<string, unknown> | undefined;
323
+ }[];
324
+ partial?: boolean | undefined;
325
+ failedSourceIds?: string[] | undefined;
326
+ errorsBySource?: Record<string, string> | undefined;
327
+ } | {
328
+ ok: false;
329
+ error: string;
330
+ } | null>;
209
331
  };
210
332
  export type UseRAGIndexAdminResult = ReturnType<typeof useRAGIndexAdmin>;
@@ -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,42 @@ 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
+ lastStartedAt?: number | undefined;
87
+ lastSyncedAt?: number | undefined;
88
+ lastSyncDurationMs?: number | undefined;
89
+ lastError?: string | undefined;
90
+ lastSuccessfulSyncAt?: number | undefined;
91
+ consecutiveFailures?: number | undefined;
92
+ retryAttempts?: number | undefined;
93
+ nextRetryAt?: number | undefined;
94
+ documentCount?: number | undefined;
95
+ chunkCount?: number | undefined;
96
+ metadata?: Record<string, unknown> | undefined;
97
+ }[], RAGSyncSourceRecord[] | {
98
+ id: string;
99
+ label: string;
100
+ kind: "directory" | "url" | "storage" | "email" | "custom";
101
+ status: import("../..").RAGSyncSourceStatus;
102
+ description?: string | undefined;
103
+ target?: string | undefined;
104
+ lastStartedAt?: number | undefined;
105
+ lastSyncedAt?: number | undefined;
106
+ lastSyncDurationMs?: number | undefined;
107
+ lastError?: string | undefined;
108
+ lastSuccessfulSyncAt?: number | undefined;
109
+ consecutiveFailures?: number | undefined;
110
+ retryAttempts?: number | undefined;
111
+ nextRetryAt?: number | undefined;
112
+ documentCount?: number | undefined;
113
+ chunkCount?: number | undefined;
114
+ metadata?: Record<string, unknown> | undefined;
115
+ }[]>;
77
116
  };
78
117
  export type UseRAGOpsResult = ReturnType<typeof useRAGOps>;
@@ -946,6 +946,41 @@ 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(options2) {
957
+ const response = await fetchImpl(`${basePath}/sync`, {
958
+ body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
959
+ headers: options2?.background === true ? jsonHeaders : undefined,
960
+ method: "POST"
961
+ });
962
+ if (!response.ok) {
963
+ return {
964
+ error: await toErrorMessage(response),
965
+ ok: false
966
+ };
967
+ }
968
+ return parseJson(response);
969
+ },
970
+ async syncSource(id, options2) {
971
+ const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
972
+ body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
973
+ headers: options2?.background === true ? jsonHeaders : undefined,
974
+ method: "POST"
975
+ });
976
+ if (!response.ok) {
977
+ return {
978
+ error: await toErrorMessage(response),
979
+ ok: false
980
+ };
981
+ }
982
+ return parseJson(response);
983
+ },
949
984
  async reindexDocument(id) {
950
985
  const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
951
986
  method: "POST"
@@ -2024,6 +2059,7 @@ var createRAGIndexAdmin = (path) => {
2024
2059
  const error = writable5(null);
2025
2060
  const lastMutation = writable5(null);
2026
2061
  const backends = writable5(null);
2062
+ const syncSources = writable5(null);
2027
2063
  const run = async (operation) => {
2028
2064
  isLoading.set(true);
2029
2065
  error.set(null);
@@ -2089,6 +2125,27 @@ var createRAGIndexAdmin = (path) => {
2089
2125
  backends.set(response);
2090
2126
  return response;
2091
2127
  });
2128
+ const loadSyncSources = async () => run(async () => {
2129
+ const response = await client.syncSources();
2130
+ syncSources.set(response);
2131
+ return response;
2132
+ });
2133
+ const syncAllSources = async () => run(async () => {
2134
+ const response = await client.syncAllSources();
2135
+ syncSources.set(response);
2136
+ if (!response.ok) {
2137
+ throw new Error(response.error ?? "Failed to sync sources");
2138
+ }
2139
+ return response;
2140
+ });
2141
+ const syncSource = async (id) => run(async () => {
2142
+ const response = await client.syncSource(id);
2143
+ syncSources.set(response);
2144
+ if (!response.ok) {
2145
+ throw new Error(response.error ?? "Failed to sync source");
2146
+ }
2147
+ return response;
2148
+ });
2092
2149
  const clearIndex = async () => run(async () => {
2093
2150
  const response = await client.clearIndex();
2094
2151
  const mutation = { ok: response.ok };
@@ -2100,6 +2157,7 @@ var createRAGIndexAdmin = (path) => {
2100
2157
  error.set(null);
2101
2158
  isLoading.set(false);
2102
2159
  lastMutation.set(null);
2160
+ syncSources.set(null);
2103
2161
  };
2104
2162
  return {
2105
2163
  backends,
@@ -2110,11 +2168,15 @@ var createRAGIndexAdmin = (path) => {
2110
2168
  isLoading,
2111
2169
  lastMutation,
2112
2170
  loadBackends,
2171
+ loadSyncSources,
2113
2172
  reindexDocument,
2114
2173
  reindexSource,
2115
2174
  reseed,
2116
2175
  reset,
2117
- resetState
2176
+ resetState,
2177
+ syncAllSources,
2178
+ syncSource,
2179
+ syncSources
2118
2180
  };
2119
2181
  };
2120
2182
 
@@ -2132,6 +2194,7 @@ var createRAGOps = (path, autoLoad = true) => {
2132
2194
  const readiness = writable6(undefined);
2133
2195
  const documents = writable6(undefined);
2134
2196
  const ingestJobs = writable6([]);
2197
+ const syncSources = writable6([]);
2135
2198
  const error = writable6(null);
2136
2199
  const isLoading = writable6(autoLoad);
2137
2200
  const refresh = async () => {
@@ -2149,6 +2212,7 @@ var createRAGOps = (path, autoLoad = true) => {
2149
2212
  readiness.set(response.readiness);
2150
2213
  documents.set(response.documents);
2151
2214
  ingestJobs.set(response.ingestJobs ?? []);
2215
+ syncSources.set(response.syncSources ?? []);
2152
2216
  return response;
2153
2217
  } catch (caught) {
2154
2218
  error.set(caught instanceof Error ? caught.message : String(caught));
@@ -2169,6 +2233,7 @@ var createRAGOps = (path, autoLoad = true) => {
2169
2233
  ingestJobs.set([]);
2170
2234
  isLoading.set(false);
2171
2235
  readiness.set(undefined);
2236
+ syncSources.set([]);
2172
2237
  status.set(undefined);
2173
2238
  };
2174
2239
  if (autoLoad) {
@@ -2190,7 +2255,8 @@ var createRAGOps = (path, autoLoad = true) => {
2190
2255
  readiness,
2191
2256
  refresh,
2192
2257
  reset,
2193
- status
2258
+ status,
2259
+ syncSources
2194
2260
  };
2195
2261
  };
2196
2262
 
@@ -2443,5 +2509,5 @@ export {
2443
2509
  createAIStream
2444
2510
  };
2445
2511
 
2446
- //# debugId=65C6A24C0063194364756E2164756E21
2512
+ //# debugId=5EFDB7E0593FB6EB64756E2164756E21
2447
2513
  //# sourceMappingURL=index.js.map