@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.
- package/dist/ai/client/index.js +36 -1
- package/dist/ai/client/index.js.map +3 -3
- package/dist/ai/index.js +647 -12
- package/dist/ai/index.js.map +7 -6
- package/dist/ai-client/angular/ai/index.js +44 -0
- package/dist/ai-client/react/ai/index.js +68 -2
- package/dist/ai-client/vue/ai/index.js +68 -2
- package/dist/angular/ai/index.js +45 -1
- package/dist/angular/ai/index.js.map +4 -4
- package/dist/react/ai/index.js +69 -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 +9 -0
- package/dist/src/ai/rag/types.d.ts +1 -1
- package/dist/src/angular/ai/rag-client.service.d.ts +4 -1
- package/dist/src/react/ai/useRAG.d.ts +25 -0
- package/dist/src/react/ai/useRAGIndexAdmin.d.ts +25 -1
- package/dist/src/react/ai/useRAGOps.d.ts +2 -1
- package/dist/src/svelte/ai/createRAG.d.ts +25 -0
- package/dist/src/svelte/ai/createRAGIndexAdmin.d.ts +25 -1
- package/dist/src/svelte/ai/createRAGOps.d.ts +2 -1
- package/dist/src/vue/ai/useRAG.d.ts +165 -4
- package/dist/src/vue/ai/useRAGIndexAdmin.d.ts +123 -1
- package/dist/src/vue/ai/useRAGOps.d.ts +44 -5
- package/dist/svelte/ai/index.js +69 -3
- package/dist/svelte/ai/index.js.map +5 -5
- package/dist/types/ai.d.ts +127 -2
- package/dist/vue/ai/index.js +69 -3
- package/dist/vue/ai/index.js.map +5 -5
- package/package.json +1 -1
|
@@ -880,6 +880,41 @@ 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(options2) {
|
|
891
|
+
const response = await fetchImpl(`${basePath}/sync`, {
|
|
892
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
893
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
894
|
+
method: "POST"
|
|
895
|
+
});
|
|
896
|
+
if (!response.ok) {
|
|
897
|
+
return {
|
|
898
|
+
error: await toErrorMessage(response),
|
|
899
|
+
ok: false
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
return parseJson(response);
|
|
903
|
+
},
|
|
904
|
+
async syncSource(id, options2) {
|
|
905
|
+
const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
|
|
906
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
907
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
908
|
+
method: "POST"
|
|
909
|
+
});
|
|
910
|
+
if (!response.ok) {
|
|
911
|
+
return {
|
|
912
|
+
error: await toErrorMessage(response),
|
|
913
|
+
ok: false
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
return parseJson(response);
|
|
917
|
+
},
|
|
883
918
|
async reindexDocument(id) {
|
|
884
919
|
const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
|
|
885
920
|
method: "POST"
|
|
@@ -991,6 +1026,15 @@ class RAGClientService {
|
|
|
991
1026
|
ops(path) {
|
|
992
1027
|
return this.client(path).ops();
|
|
993
1028
|
}
|
|
1029
|
+
syncSources(path) {
|
|
1030
|
+
return this.client(path).syncSources();
|
|
1031
|
+
}
|
|
1032
|
+
syncAllSources(path, options) {
|
|
1033
|
+
return this.client(path).syncAllSources(options);
|
|
1034
|
+
}
|
|
1035
|
+
syncSource(path, id, options) {
|
|
1036
|
+
return this.client(path).syncSource(id, options);
|
|
1037
|
+
}
|
|
994
1038
|
documents(path, kind) {
|
|
995
1039
|
return this.client(path).documents(kind);
|
|
996
1040
|
}
|
|
@@ -1195,6 +1195,41 @@ 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(options2) {
|
|
1206
|
+
const response = await fetchImpl(`${basePath}/sync`, {
|
|
1207
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
1208
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
1209
|
+
method: "POST"
|
|
1210
|
+
});
|
|
1211
|
+
if (!response.ok) {
|
|
1212
|
+
return {
|
|
1213
|
+
error: await toErrorMessage(response),
|
|
1214
|
+
ok: false
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
return parseJson(response);
|
|
1218
|
+
},
|
|
1219
|
+
async syncSource(id, options2) {
|
|
1220
|
+
const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
|
|
1221
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
1222
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
1223
|
+
method: "POST"
|
|
1224
|
+
});
|
|
1225
|
+
if (!response.ok) {
|
|
1226
|
+
return {
|
|
1227
|
+
error: await toErrorMessage(response),
|
|
1228
|
+
ok: false
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
return parseJson(response);
|
|
1232
|
+
},
|
|
1198
1233
|
async reindexDocument(id) {
|
|
1199
1234
|
const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
|
|
1200
1235
|
method: "POST"
|
|
@@ -1645,6 +1680,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1645
1680
|
const [error, setError] = useState5(null);
|
|
1646
1681
|
const [lastMutation, setLastMutation] = useState5(null);
|
|
1647
1682
|
const [backends, setBackends] = useState5(null);
|
|
1683
|
+
const [syncSources, setSyncSources] = useState5(null);
|
|
1648
1684
|
const run = useCallback6(async (operation) => {
|
|
1649
1685
|
setIsLoading(true);
|
|
1650
1686
|
setError(null);
|
|
@@ -1711,6 +1747,27 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1711
1747
|
setBackends(response);
|
|
1712
1748
|
return response;
|
|
1713
1749
|
}), [client, run]);
|
|
1750
|
+
const loadSyncSources = useCallback6(async () => run(async () => {
|
|
1751
|
+
const response = await client.syncSources();
|
|
1752
|
+
setSyncSources(response);
|
|
1753
|
+
return response;
|
|
1754
|
+
}), [client, run]);
|
|
1755
|
+
const syncAllSources = useCallback6(async () => run(async () => {
|
|
1756
|
+
const response = await client.syncAllSources();
|
|
1757
|
+
setSyncSources(response);
|
|
1758
|
+
if (!response.ok) {
|
|
1759
|
+
throw new Error(response.error ?? "Failed to sync sources");
|
|
1760
|
+
}
|
|
1761
|
+
return response;
|
|
1762
|
+
}), [client, run]);
|
|
1763
|
+
const syncSource = useCallback6(async (id) => run(async () => {
|
|
1764
|
+
const response = await client.syncSource(id);
|
|
1765
|
+
setSyncSources(response);
|
|
1766
|
+
if (!response.ok) {
|
|
1767
|
+
throw new Error(response.error ?? "Failed to sync source");
|
|
1768
|
+
}
|
|
1769
|
+
return response;
|
|
1770
|
+
}), [client, run]);
|
|
1714
1771
|
const clearIndex = useCallback6(async () => run(async () => {
|
|
1715
1772
|
const response = await client.clearIndex();
|
|
1716
1773
|
const mutation = {
|
|
@@ -1724,6 +1781,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1724
1781
|
setError(null);
|
|
1725
1782
|
setLastMutation(null);
|
|
1726
1783
|
setBackends(null);
|
|
1784
|
+
setSyncSources(null);
|
|
1727
1785
|
}, []);
|
|
1728
1786
|
return {
|
|
1729
1787
|
backends,
|
|
@@ -1738,7 +1796,11 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1738
1796
|
reindexSource,
|
|
1739
1797
|
reseed,
|
|
1740
1798
|
reset,
|
|
1741
|
-
resetState
|
|
1799
|
+
resetState,
|
|
1800
|
+
loadSyncSources,
|
|
1801
|
+
syncAllSources,
|
|
1802
|
+
syncSource,
|
|
1803
|
+
syncSources
|
|
1742
1804
|
};
|
|
1743
1805
|
};
|
|
1744
1806
|
|
|
@@ -1756,6 +1818,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1756
1818
|
const [readiness, setReadiness] = useState6();
|
|
1757
1819
|
const [documents, setDocuments] = useState6();
|
|
1758
1820
|
const [ingestJobs, setIngestJobs] = useState6([]);
|
|
1821
|
+
const [syncSources, setSyncSources] = useState6([]);
|
|
1759
1822
|
const [error, setError] = useState6(null);
|
|
1760
1823
|
const [isLoading, setIsLoading] = useState6(autoLoad);
|
|
1761
1824
|
const refresh = useCallback7(async () => {
|
|
@@ -1773,6 +1836,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1773
1836
|
setReadiness(response.readiness);
|
|
1774
1837
|
setDocuments(response.documents);
|
|
1775
1838
|
setIngestJobs(response.ingestJobs ?? []);
|
|
1839
|
+
setSyncSources(response.syncSources ?? []);
|
|
1776
1840
|
return response;
|
|
1777
1841
|
} catch (caught) {
|
|
1778
1842
|
const message = caught instanceof Error ? caught.message : String(caught);
|
|
@@ -1794,6 +1858,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1794
1858
|
setIngestJobs([]);
|
|
1795
1859
|
setIsLoading(false);
|
|
1796
1860
|
setReadiness(undefined);
|
|
1861
|
+
setSyncSources([]);
|
|
1797
1862
|
setStatus(undefined);
|
|
1798
1863
|
}, []);
|
|
1799
1864
|
useEffect3(() => {
|
|
@@ -1817,7 +1882,8 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1817
1882
|
readiness,
|
|
1818
1883
|
refresh,
|
|
1819
1884
|
reset,
|
|
1820
|
-
status
|
|
1885
|
+
status,
|
|
1886
|
+
syncSources
|
|
1821
1887
|
};
|
|
1822
1888
|
};
|
|
1823
1889
|
|
|
@@ -805,6 +805,41 @@ 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(options2) {
|
|
816
|
+
const response = await fetchImpl(`${basePath}/sync`, {
|
|
817
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
818
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
819
|
+
method: "POST"
|
|
820
|
+
});
|
|
821
|
+
if (!response.ok) {
|
|
822
|
+
return {
|
|
823
|
+
error: await toErrorMessage(response),
|
|
824
|
+
ok: false
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
return parseJson(response);
|
|
828
|
+
},
|
|
829
|
+
async syncSource(id, options2) {
|
|
830
|
+
const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
|
|
831
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
832
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
833
|
+
method: "POST"
|
|
834
|
+
});
|
|
835
|
+
if (!response.ok) {
|
|
836
|
+
return {
|
|
837
|
+
error: await toErrorMessage(response),
|
|
838
|
+
ok: false
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
return parseJson(response);
|
|
842
|
+
},
|
|
808
843
|
async reindexDocument(id) {
|
|
809
844
|
const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
|
|
810
845
|
method: "POST"
|
|
@@ -1607,6 +1642,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1607
1642
|
const error = ref6(null);
|
|
1608
1643
|
const lastMutation = ref6(null);
|
|
1609
1644
|
const backends = ref6(null);
|
|
1645
|
+
const syncSources = ref6(null);
|
|
1610
1646
|
const run = async (operation) => {
|
|
1611
1647
|
isLoading.value = true;
|
|
1612
1648
|
error.value = null;
|
|
@@ -1672,6 +1708,27 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1672
1708
|
backends.value = response;
|
|
1673
1709
|
return response;
|
|
1674
1710
|
});
|
|
1711
|
+
const loadSyncSources = async () => run(async () => {
|
|
1712
|
+
const response = await client.syncSources();
|
|
1713
|
+
syncSources.value = response;
|
|
1714
|
+
return response;
|
|
1715
|
+
});
|
|
1716
|
+
const syncAllSources = async () => run(async () => {
|
|
1717
|
+
const response = await client.syncAllSources();
|
|
1718
|
+
syncSources.value = response;
|
|
1719
|
+
if (!response.ok) {
|
|
1720
|
+
throw new Error(response.error ?? "Failed to sync sources");
|
|
1721
|
+
}
|
|
1722
|
+
return response;
|
|
1723
|
+
});
|
|
1724
|
+
const syncSource = async (id) => run(async () => {
|
|
1725
|
+
const response = await client.syncSource(id);
|
|
1726
|
+
syncSources.value = response;
|
|
1727
|
+
if (!response.ok) {
|
|
1728
|
+
throw new Error(response.error ?? "Failed to sync source");
|
|
1729
|
+
}
|
|
1730
|
+
return response;
|
|
1731
|
+
});
|
|
1675
1732
|
const clearIndex = async () => run(async () => {
|
|
1676
1733
|
const response = await client.clearIndex();
|
|
1677
1734
|
const mutation = { ok: response.ok };
|
|
@@ -1683,6 +1740,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1683
1740
|
error.value = null;
|
|
1684
1741
|
isLoading.value = false;
|
|
1685
1742
|
lastMutation.value = null;
|
|
1743
|
+
syncSources.value = null;
|
|
1686
1744
|
};
|
|
1687
1745
|
return {
|
|
1688
1746
|
backends,
|
|
@@ -1693,11 +1751,15 @@ var useRAGIndexAdmin = (path) => {
|
|
|
1693
1751
|
isLoading,
|
|
1694
1752
|
lastMutation,
|
|
1695
1753
|
loadBackends,
|
|
1754
|
+
loadSyncSources,
|
|
1696
1755
|
reindexDocument,
|
|
1697
1756
|
reindexSource,
|
|
1698
1757
|
reseed,
|
|
1699
1758
|
reset,
|
|
1700
|
-
resetState
|
|
1759
|
+
resetState,
|
|
1760
|
+
syncAllSources,
|
|
1761
|
+
syncSource,
|
|
1762
|
+
syncSources
|
|
1701
1763
|
};
|
|
1702
1764
|
};
|
|
1703
1765
|
|
|
@@ -1715,6 +1777,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1715
1777
|
const readiness = ref7();
|
|
1716
1778
|
const documents = ref7();
|
|
1717
1779
|
const ingestJobs = ref7([]);
|
|
1780
|
+
const syncSources = ref7([]);
|
|
1718
1781
|
const error = ref7(null);
|
|
1719
1782
|
const isLoading = ref7(autoLoad);
|
|
1720
1783
|
const refresh = async () => {
|
|
@@ -1732,6 +1795,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1732
1795
|
readiness.value = response.readiness;
|
|
1733
1796
|
documents.value = response.documents;
|
|
1734
1797
|
ingestJobs.value = response.ingestJobs ?? [];
|
|
1798
|
+
syncSources.value = response.syncSources ?? [];
|
|
1735
1799
|
return response;
|
|
1736
1800
|
} catch (caught) {
|
|
1737
1801
|
error.value = caught instanceof Error ? caught.message : String(caught);
|
|
@@ -1752,6 +1816,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1752
1816
|
ingestJobs.value = [];
|
|
1753
1817
|
isLoading.value = false;
|
|
1754
1818
|
readiness.value = undefined;
|
|
1819
|
+
syncSources.value = [];
|
|
1755
1820
|
status.value = undefined;
|
|
1756
1821
|
};
|
|
1757
1822
|
onMounted(() => {
|
|
@@ -1775,7 +1840,8 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
1775
1840
|
readiness,
|
|
1776
1841
|
refresh,
|
|
1777
1842
|
reset,
|
|
1778
|
-
status
|
|
1843
|
+
status,
|
|
1844
|
+
syncSources
|
|
1779
1845
|
};
|
|
1780
1846
|
};
|
|
1781
1847
|
|
package/dist/angular/ai/index.js
CHANGED
|
@@ -1016,6 +1016,41 @@ 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(options2) {
|
|
1027
|
+
const response = await fetchImpl(`${basePath}/sync`, {
|
|
1028
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
1029
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
1030
|
+
method: "POST"
|
|
1031
|
+
});
|
|
1032
|
+
if (!response.ok) {
|
|
1033
|
+
return {
|
|
1034
|
+
error: await toErrorMessage(response),
|
|
1035
|
+
ok: false
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
return parseJson(response);
|
|
1039
|
+
},
|
|
1040
|
+
async syncSource(id, options2) {
|
|
1041
|
+
const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
|
|
1042
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
1043
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
1044
|
+
method: "POST"
|
|
1045
|
+
});
|
|
1046
|
+
if (!response.ok) {
|
|
1047
|
+
return {
|
|
1048
|
+
error: await toErrorMessage(response),
|
|
1049
|
+
ok: false
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
return parseJson(response);
|
|
1053
|
+
},
|
|
1019
1054
|
async reindexDocument(id) {
|
|
1020
1055
|
const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
|
|
1021
1056
|
method: "POST"
|
|
@@ -1127,6 +1162,15 @@ class RAGClientService {
|
|
|
1127
1162
|
ops(path) {
|
|
1128
1163
|
return this.client(path).ops();
|
|
1129
1164
|
}
|
|
1165
|
+
syncSources(path) {
|
|
1166
|
+
return this.client(path).syncSources();
|
|
1167
|
+
}
|
|
1168
|
+
syncAllSources(path, options) {
|
|
1169
|
+
return this.client(path).syncAllSources(options);
|
|
1170
|
+
}
|
|
1171
|
+
syncSource(path, id, options) {
|
|
1172
|
+
return this.client(path).syncSource(id, options);
|
|
1173
|
+
}
|
|
1130
1174
|
documents(path, kind) {
|
|
1131
1175
|
return this.client(path).documents(kind);
|
|
1132
1176
|
}
|
|
@@ -1584,5 +1628,5 @@ export {
|
|
|
1584
1628
|
AIStreamService
|
|
1585
1629
|
};
|
|
1586
1630
|
|
|
1587
|
-
//# debugId=
|
|
1631
|
+
//# debugId=41CC5F65D8327B0E64756E2164756E21
|
|
1588
1632
|
//# sourceMappingURL=index.js.map
|