@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
|
@@ -880,6 +880,37 @@ var createRAGClient = (options) => {
|
|
|
880
880
|
}
|
|
881
881
|
return parseJson(response);
|
|
882
882
|
},
|
|
883
|
+
async syncSources() {
|
|
884
|
+
const response = await fetchImpl(`${basePath}/sync`);
|
|
885
|
+
if (!response.ok) {
|
|
886
|
+
throw new Error(await toErrorMessage(response));
|
|
887
|
+
}
|
|
888
|
+
return parseJson(response);
|
|
889
|
+
},
|
|
890
|
+
async syncAllSources() {
|
|
891
|
+
const response = await fetchImpl(`${basePath}/sync`, {
|
|
892
|
+
method: "POST"
|
|
893
|
+
});
|
|
894
|
+
if (!response.ok) {
|
|
895
|
+
return {
|
|
896
|
+
error: await toErrorMessage(response),
|
|
897
|
+
ok: false
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
return parseJson(response);
|
|
901
|
+
},
|
|
902
|
+
async syncSource(id) {
|
|
903
|
+
const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
|
|
904
|
+
method: "POST"
|
|
905
|
+
});
|
|
906
|
+
if (!response.ok) {
|
|
907
|
+
return {
|
|
908
|
+
error: await toErrorMessage(response),
|
|
909
|
+
ok: false
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
return parseJson(response);
|
|
913
|
+
},
|
|
883
914
|
async reindexDocument(id) {
|
|
884
915
|
const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
|
|
885
916
|
method: "POST"
|
|
@@ -991,6 +1022,15 @@ class RAGClientService {
|
|
|
991
1022
|
ops(path) {
|
|
992
1023
|
return this.client(path).ops();
|
|
993
1024
|
}
|
|
1025
|
+
syncSources(path) {
|
|
1026
|
+
return this.client(path).syncSources();
|
|
1027
|
+
}
|
|
1028
|
+
syncAllSources(path) {
|
|
1029
|
+
return this.client(path).syncAllSources();
|
|
1030
|
+
}
|
|
1031
|
+
syncSource(path, id) {
|
|
1032
|
+
return this.client(path).syncSource(id);
|
|
1033
|
+
}
|
|
994
1034
|
documents(path, kind) {
|
|
995
1035
|
return this.client(path).documents(kind);
|
|
996
1036
|
}
|
|
@@ -1195,6 +1195,37 @@ var createRAGClient = (options) => {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
return parseJson(response);
|
|
1197
1197
|
},
|
|
1198
|
+
async syncSources() {
|
|
1199
|
+
const response = await fetchImpl(`${basePath}/sync`);
|
|
1200
|
+
if (!response.ok) {
|
|
1201
|
+
throw new Error(await toErrorMessage(response));
|
|
1202
|
+
}
|
|
1203
|
+
return parseJson(response);
|
|
1204
|
+
},
|
|
1205
|
+
async syncAllSources() {
|
|
1206
|
+
const response = await fetchImpl(`${basePath}/sync`, {
|
|
1207
|
+
method: "POST"
|
|
1208
|
+
});
|
|
1209
|
+
if (!response.ok) {
|
|
1210
|
+
return {
|
|
1211
|
+
error: await toErrorMessage(response),
|
|
1212
|
+
ok: false
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
return parseJson(response);
|
|
1216
|
+
},
|
|
1217
|
+
async syncSource(id) {
|
|
1218
|
+
const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
|
|
1219
|
+
method: "POST"
|
|
1220
|
+
});
|
|
1221
|
+
if (!response.ok) {
|
|
1222
|
+
return {
|
|
1223
|
+
error: await toErrorMessage(response),
|
|
1224
|
+
ok: false
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1227
|
+
return parseJson(response);
|
|
1228
|
+
},
|
|
1198
1229
|
async reindexDocument(id) {
|
|
1199
1230
|
const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
|
|
1200
1231
|
method: "POST"
|
|
@@ -1645,6 +1676,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1645
1676
|
const [error, setError] = useState5(null);
|
|
1646
1677
|
const [lastMutation, setLastMutation] = useState5(null);
|
|
1647
1678
|
const [backends, setBackends] = useState5(null);
|
|
1679
|
+
const [syncSources, setSyncSources] = useState5(null);
|
|
1648
1680
|
const run = useCallback6(async (operation) => {
|
|
1649
1681
|
setIsLoading(true);
|
|
1650
1682
|
setError(null);
|
|
@@ -1711,6 +1743,27 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1711
1743
|
setBackends(response);
|
|
1712
1744
|
return response;
|
|
1713
1745
|
}), [client, run]);
|
|
1746
|
+
const loadSyncSources = useCallback6(async () => run(async () => {
|
|
1747
|
+
const response = await client.syncSources();
|
|
1748
|
+
setSyncSources(response);
|
|
1749
|
+
return response;
|
|
1750
|
+
}), [client, run]);
|
|
1751
|
+
const syncAllSources = useCallback6(async () => run(async () => {
|
|
1752
|
+
const response = await client.syncAllSources();
|
|
1753
|
+
setSyncSources(response);
|
|
1754
|
+
if (!response.ok) {
|
|
1755
|
+
throw new Error(response.error ?? "Failed to sync sources");
|
|
1756
|
+
}
|
|
1757
|
+
return response;
|
|
1758
|
+
}), [client, run]);
|
|
1759
|
+
const syncSource = useCallback6(async (id) => run(async () => {
|
|
1760
|
+
const response = await client.syncSource(id);
|
|
1761
|
+
setSyncSources(response);
|
|
1762
|
+
if (!response.ok) {
|
|
1763
|
+
throw new Error(response.error ?? "Failed to sync source");
|
|
1764
|
+
}
|
|
1765
|
+
return response;
|
|
1766
|
+
}), [client, run]);
|
|
1714
1767
|
const clearIndex = useCallback6(async () => run(async () => {
|
|
1715
1768
|
const response = await client.clearIndex();
|
|
1716
1769
|
const mutation = {
|
|
@@ -1724,6 +1777,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1724
1777
|
setError(null);
|
|
1725
1778
|
setLastMutation(null);
|
|
1726
1779
|
setBackends(null);
|
|
1780
|
+
setSyncSources(null);
|
|
1727
1781
|
}, []);
|
|
1728
1782
|
return {
|
|
1729
1783
|
backends,
|
|
@@ -1738,7 +1792,11 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1738
1792
|
reindexSource,
|
|
1739
1793
|
reseed,
|
|
1740
1794
|
reset,
|
|
1741
|
-
resetState
|
|
1795
|
+
resetState,
|
|
1796
|
+
loadSyncSources,
|
|
1797
|
+
syncAllSources,
|
|
1798
|
+
syncSource,
|
|
1799
|
+
syncSources
|
|
1742
1800
|
};
|
|
1743
1801
|
};
|
|
1744
1802
|
|
|
@@ -1756,6 +1814,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1756
1814
|
const [readiness, setReadiness] = useState6();
|
|
1757
1815
|
const [documents, setDocuments] = useState6();
|
|
1758
1816
|
const [ingestJobs, setIngestJobs] = useState6([]);
|
|
1817
|
+
const [syncSources, setSyncSources] = useState6([]);
|
|
1759
1818
|
const [error, setError] = useState6(null);
|
|
1760
1819
|
const [isLoading, setIsLoading] = useState6(autoLoad);
|
|
1761
1820
|
const refresh = useCallback7(async () => {
|
|
@@ -1773,6 +1832,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1773
1832
|
setReadiness(response.readiness);
|
|
1774
1833
|
setDocuments(response.documents);
|
|
1775
1834
|
setIngestJobs(response.ingestJobs ?? []);
|
|
1835
|
+
setSyncSources(response.syncSources ?? []);
|
|
1776
1836
|
return response;
|
|
1777
1837
|
} catch (caught) {
|
|
1778
1838
|
const message = caught instanceof Error ? caught.message : String(caught);
|
|
@@ -1794,6 +1854,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1794
1854
|
setIngestJobs([]);
|
|
1795
1855
|
setIsLoading(false);
|
|
1796
1856
|
setReadiness(undefined);
|
|
1857
|
+
setSyncSources([]);
|
|
1797
1858
|
setStatus(undefined);
|
|
1798
1859
|
}, []);
|
|
1799
1860
|
useEffect3(() => {
|
|
@@ -1817,7 +1878,8 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1817
1878
|
readiness,
|
|
1818
1879
|
refresh,
|
|
1819
1880
|
reset,
|
|
1820
|
-
status
|
|
1881
|
+
status,
|
|
1882
|
+
syncSources
|
|
1821
1883
|
};
|
|
1822
1884
|
};
|
|
1823
1885
|
|
|
@@ -805,6 +805,37 @@ var createRAGClient = (options) => {
|
|
|
805
805
|
}
|
|
806
806
|
return parseJson(response);
|
|
807
807
|
},
|
|
808
|
+
async syncSources() {
|
|
809
|
+
const response = await fetchImpl(`${basePath}/sync`);
|
|
810
|
+
if (!response.ok) {
|
|
811
|
+
throw new Error(await toErrorMessage(response));
|
|
812
|
+
}
|
|
813
|
+
return parseJson(response);
|
|
814
|
+
},
|
|
815
|
+
async syncAllSources() {
|
|
816
|
+
const response = await fetchImpl(`${basePath}/sync`, {
|
|
817
|
+
method: "POST"
|
|
818
|
+
});
|
|
819
|
+
if (!response.ok) {
|
|
820
|
+
return {
|
|
821
|
+
error: await toErrorMessage(response),
|
|
822
|
+
ok: false
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
return parseJson(response);
|
|
826
|
+
},
|
|
827
|
+
async syncSource(id) {
|
|
828
|
+
const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
|
|
829
|
+
method: "POST"
|
|
830
|
+
});
|
|
831
|
+
if (!response.ok) {
|
|
832
|
+
return {
|
|
833
|
+
error: await toErrorMessage(response),
|
|
834
|
+
ok: false
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
return parseJson(response);
|
|
838
|
+
},
|
|
808
839
|
async reindexDocument(id) {
|
|
809
840
|
const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
|
|
810
841
|
method: "POST"
|
|
@@ -1607,6 +1638,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1607
1638
|
const error = ref6(null);
|
|
1608
1639
|
const lastMutation = ref6(null);
|
|
1609
1640
|
const backends = ref6(null);
|
|
1641
|
+
const syncSources = ref6(null);
|
|
1610
1642
|
const run = async (operation) => {
|
|
1611
1643
|
isLoading.value = true;
|
|
1612
1644
|
error.value = null;
|
|
@@ -1672,6 +1704,27 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1672
1704
|
backends.value = response;
|
|
1673
1705
|
return response;
|
|
1674
1706
|
});
|
|
1707
|
+
const loadSyncSources = async () => run(async () => {
|
|
1708
|
+
const response = await client.syncSources();
|
|
1709
|
+
syncSources.value = response;
|
|
1710
|
+
return response;
|
|
1711
|
+
});
|
|
1712
|
+
const syncAllSources = async () => run(async () => {
|
|
1713
|
+
const response = await client.syncAllSources();
|
|
1714
|
+
syncSources.value = response;
|
|
1715
|
+
if (!response.ok) {
|
|
1716
|
+
throw new Error(response.error ?? "Failed to sync sources");
|
|
1717
|
+
}
|
|
1718
|
+
return response;
|
|
1719
|
+
});
|
|
1720
|
+
const syncSource = async (id) => run(async () => {
|
|
1721
|
+
const response = await client.syncSource(id);
|
|
1722
|
+
syncSources.value = response;
|
|
1723
|
+
if (!response.ok) {
|
|
1724
|
+
throw new Error(response.error ?? "Failed to sync source");
|
|
1725
|
+
}
|
|
1726
|
+
return response;
|
|
1727
|
+
});
|
|
1675
1728
|
const clearIndex = async () => run(async () => {
|
|
1676
1729
|
const response = await client.clearIndex();
|
|
1677
1730
|
const mutation = { ok: response.ok };
|
|
@@ -1683,6 +1736,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1683
1736
|
error.value = null;
|
|
1684
1737
|
isLoading.value = false;
|
|
1685
1738
|
lastMutation.value = null;
|
|
1739
|
+
syncSources.value = null;
|
|
1686
1740
|
};
|
|
1687
1741
|
return {
|
|
1688
1742
|
backends,
|
|
@@ -1693,11 +1747,15 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1693
1747
|
isLoading,
|
|
1694
1748
|
lastMutation,
|
|
1695
1749
|
loadBackends,
|
|
1750
|
+
loadSyncSources,
|
|
1696
1751
|
reindexDocument,
|
|
1697
1752
|
reindexSource,
|
|
1698
1753
|
reseed,
|
|
1699
1754
|
reset,
|
|
1700
|
-
resetState
|
|
1755
|
+
resetState,
|
|
1756
|
+
syncAllSources,
|
|
1757
|
+
syncSource,
|
|
1758
|
+
syncSources
|
|
1701
1759
|
};
|
|
1702
1760
|
};
|
|
1703
1761
|
|
|
@@ -1715,6 +1773,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1715
1773
|
const readiness = ref7();
|
|
1716
1774
|
const documents = ref7();
|
|
1717
1775
|
const ingestJobs = ref7([]);
|
|
1776
|
+
const syncSources = ref7([]);
|
|
1718
1777
|
const error = ref7(null);
|
|
1719
1778
|
const isLoading = ref7(autoLoad);
|
|
1720
1779
|
const refresh = async () => {
|
|
@@ -1732,6 +1791,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1732
1791
|
readiness.value = response.readiness;
|
|
1733
1792
|
documents.value = response.documents;
|
|
1734
1793
|
ingestJobs.value = response.ingestJobs ?? [];
|
|
1794
|
+
syncSources.value = response.syncSources ?? [];
|
|
1735
1795
|
return response;
|
|
1736
1796
|
} catch (caught) {
|
|
1737
1797
|
error.value = caught instanceof Error ? caught.message : String(caught);
|
|
@@ -1752,6 +1812,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1752
1812
|
ingestJobs.value = [];
|
|
1753
1813
|
isLoading.value = false;
|
|
1754
1814
|
readiness.value = undefined;
|
|
1815
|
+
syncSources.value = [];
|
|
1755
1816
|
status.value = undefined;
|
|
1756
1817
|
};
|
|
1757
1818
|
onMounted(() => {
|
|
@@ -1775,7 +1836,8 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1775
1836
|
readiness,
|
|
1776
1837
|
refresh,
|
|
1777
1838
|
reset,
|
|
1778
|
-
status
|
|
1839
|
+
status,
|
|
1840
|
+
syncSources
|
|
1779
1841
|
};
|
|
1780
1842
|
};
|
|
1781
1843
|
|
package/dist/angular/ai/index.js
CHANGED
|
@@ -1016,6 +1016,37 @@ var createRAGClient = (options) => {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
return parseJson(response);
|
|
1018
1018
|
},
|
|
1019
|
+
async syncSources() {
|
|
1020
|
+
const response = await fetchImpl(`${basePath}/sync`);
|
|
1021
|
+
if (!response.ok) {
|
|
1022
|
+
throw new Error(await toErrorMessage(response));
|
|
1023
|
+
}
|
|
1024
|
+
return parseJson(response);
|
|
1025
|
+
},
|
|
1026
|
+
async syncAllSources() {
|
|
1027
|
+
const response = await fetchImpl(`${basePath}/sync`, {
|
|
1028
|
+
method: "POST"
|
|
1029
|
+
});
|
|
1030
|
+
if (!response.ok) {
|
|
1031
|
+
return {
|
|
1032
|
+
error: await toErrorMessage(response),
|
|
1033
|
+
ok: false
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
return parseJson(response);
|
|
1037
|
+
},
|
|
1038
|
+
async syncSource(id) {
|
|
1039
|
+
const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
|
|
1040
|
+
method: "POST"
|
|
1041
|
+
});
|
|
1042
|
+
if (!response.ok) {
|
|
1043
|
+
return {
|
|
1044
|
+
error: await toErrorMessage(response),
|
|
1045
|
+
ok: false
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
return parseJson(response);
|
|
1049
|
+
},
|
|
1019
1050
|
async reindexDocument(id) {
|
|
1020
1051
|
const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
|
|
1021
1052
|
method: "POST"
|
|
@@ -1127,6 +1158,15 @@ class RAGClientService {
|
|
|
1127
1158
|
ops(path) {
|
|
1128
1159
|
return this.client(path).ops();
|
|
1129
1160
|
}
|
|
1161
|
+
syncSources(path) {
|
|
1162
|
+
return this.client(path).syncSources();
|
|
1163
|
+
}
|
|
1164
|
+
syncAllSources(path) {
|
|
1165
|
+
return this.client(path).syncAllSources();
|
|
1166
|
+
}
|
|
1167
|
+
syncSource(path, id) {
|
|
1168
|
+
return this.client(path).syncSource(id);
|
|
1169
|
+
}
|
|
1130
1170
|
documents(path, kind) {
|
|
1131
1171
|
return this.client(path).documents(kind);
|
|
1132
1172
|
}
|
|
@@ -1584,5 +1624,5 @@ export {
|
|
|
1584
1624
|
AIStreamService
|
|
1585
1625
|
};
|
|
1586
1626
|
|
|
1587
|
-
//# debugId=
|
|
1627
|
+
//# debugId=801D23BCEFD22F6E64756E2164756E21
|
|
1588
1628
|
//# sourceMappingURL=index.js.map
|