@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.
- package/dist/ai/client/index.js +32 -1
- package/dist/ai/client/index.js.map +3 -3
- package/dist/ai/index.js +439 -18
- package/dist/ai/index.js.map +9 -8
- package/dist/ai-client/angular/ai/index.js +40 -0
- package/dist/ai-client/react/ai/index.js +64 -2
- package/dist/ai-client/vue/ai/index.js +64 -2
- package/dist/angular/ai/index.js +41 -1
- package/dist/angular/ai/index.js.map +4 -4
- package/dist/react/ai/index.js +65 -3
- package/dist/react/ai/index.js.map +5 -5
- package/dist/src/ai/client/ragClient.d.ts +4 -1
- package/dist/src/ai/index.d.ts +2 -2
- package/dist/src/ai/rag/chat.d.ts +59 -4
- package/dist/src/ai/rag/index.d.ts +2 -1
- package/dist/src/ai/rag/sync.d.ts +4 -0
- package/dist/src/ai/rag/types.d.ts +1 -1
- package/dist/src/angular/ai/rag-client.service.d.ts +3 -0
- package/dist/src/react/ai/useRAG.d.ts +17 -0
- package/dist/src/react/ai/useRAGIndexAdmin.d.ts +17 -1
- package/dist/src/react/ai/useRAGOps.d.ts +2 -1
- package/dist/src/svelte/ai/createRAG.d.ts +17 -0
- package/dist/src/svelte/ai/createRAGIndexAdmin.d.ts +17 -1
- package/dist/src/svelte/ai/createRAGOps.d.ts +2 -1
- package/dist/src/vue/ai/useRAG.d.ts +119 -4
- package/dist/src/vue/ai/useRAGIndexAdmin.d.ts +87 -1
- package/dist/src/vue/ai/useRAGOps.d.ts +34 -5
- package/dist/svelte/ai/index.js +65 -3
- package/dist/svelte/ai/index.js.map +5 -5
- package/dist/types/ai.d.ts +85 -2
- package/dist/vue/ai/index.js +65 -3
- package/dist/vue/ai/index.js.map +5 -5
- package/package.json +1 -1
|
@@ -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>;
|
package/dist/svelte/ai/index.js
CHANGED
|
@@ -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=
|
|
2508
|
+
//# debugId=D5B725F10268C73F64756E2164756E21
|
|
2447
2509
|
//# sourceMappingURL=index.js.map
|