@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
package/dist/types/ai.d.ts
CHANGED
|
@@ -520,18 +520,19 @@ export type RAGCorpusHealth = {
|
|
|
520
520
|
};
|
|
521
521
|
export type RAGAdminActionRecord = {
|
|
522
522
|
id: string;
|
|
523
|
-
action: 'clear_index' | 'create_document' | 'delete_document' | 'reindex_document' | 'reindex_source' | 'reseed' | 'reset';
|
|
523
|
+
action: 'clear_index' | 'create_document' | 'delete_document' | 'reindex_document' | 'reindex_source' | 'sync_all_sources' | 'sync_source' | 'reseed' | 'reset';
|
|
524
524
|
status: 'completed' | 'failed';
|
|
525
525
|
startedAt: number;
|
|
526
526
|
finishedAt?: number;
|
|
527
527
|
elapsedMs?: number;
|
|
528
528
|
documentId?: string;
|
|
529
|
+
target?: string;
|
|
529
530
|
error?: string;
|
|
530
531
|
};
|
|
531
532
|
export type RAGAdminJobStatus = 'running' | 'completed' | 'failed';
|
|
532
533
|
export type RAGAdminJobRecord = {
|
|
533
534
|
id: string;
|
|
534
|
-
action: 'clear_index' | 'create_document' | 'delete_document' | 'reindex_document' | 'reindex_source' | 'reseed' | 'reset';
|
|
535
|
+
action: 'clear_index' | 'create_document' | 'delete_document' | 'reindex_document' | 'reindex_source' | 'sync_all_sources' | 'sync_source' | 'reseed' | 'reset';
|
|
535
536
|
status: RAGAdminJobStatus;
|
|
536
537
|
startedAt: number;
|
|
537
538
|
finishedAt?: number;
|
|
@@ -543,10 +544,129 @@ export type RAGAdminCapabilities = {
|
|
|
543
544
|
canClearIndex: boolean;
|
|
544
545
|
canCreateDocument: boolean;
|
|
545
546
|
canDeleteDocument: boolean;
|
|
547
|
+
canListSyncSources: boolean;
|
|
546
548
|
canReindexDocument: boolean;
|
|
547
549
|
canReindexSource: boolean;
|
|
548
550
|
canReseed: boolean;
|
|
549
551
|
canReset: boolean;
|
|
552
|
+
canSyncAllSources: boolean;
|
|
553
|
+
canSyncSource: boolean;
|
|
554
|
+
};
|
|
555
|
+
export type RAGSyncSourceStatus = 'idle' | 'running' | 'completed' | 'failed' | 'disabled';
|
|
556
|
+
export type RAGSyncSourceRecord = {
|
|
557
|
+
id: string;
|
|
558
|
+
label: string;
|
|
559
|
+
kind: 'directory' | 'url' | 'storage' | 'email' | 'custom';
|
|
560
|
+
status: RAGSyncSourceStatus;
|
|
561
|
+
description?: string;
|
|
562
|
+
target?: string;
|
|
563
|
+
lastStartedAt?: number;
|
|
564
|
+
lastSyncedAt?: number;
|
|
565
|
+
lastSyncDurationMs?: number;
|
|
566
|
+
lastError?: string;
|
|
567
|
+
lastSuccessfulSyncAt?: number;
|
|
568
|
+
consecutiveFailures?: number;
|
|
569
|
+
retryAttempts?: number;
|
|
570
|
+
nextRetryAt?: number;
|
|
571
|
+
documentCount?: number;
|
|
572
|
+
chunkCount?: number;
|
|
573
|
+
metadata?: Record<string, unknown>;
|
|
574
|
+
};
|
|
575
|
+
export type RAGSyncSourceRunResult = {
|
|
576
|
+
documentCount?: number;
|
|
577
|
+
chunkCount?: number;
|
|
578
|
+
metadata?: Record<string, unknown>;
|
|
579
|
+
};
|
|
580
|
+
export type RAGSyncSourceDefinition = {
|
|
581
|
+
id: string;
|
|
582
|
+
label: string;
|
|
583
|
+
kind: RAGSyncSourceRecord['kind'];
|
|
584
|
+
description?: string;
|
|
585
|
+
target?: string;
|
|
586
|
+
metadata?: Record<string, unknown>;
|
|
587
|
+
retryAttempts?: number;
|
|
588
|
+
retryDelayMs?: number;
|
|
589
|
+
sync: (input: RAGSyncSourceContext) => Promise<RAGSyncSourceRunResult> | RAGSyncSourceRunResult;
|
|
590
|
+
};
|
|
591
|
+
export type RAGSyncSourceContext = {
|
|
592
|
+
collection: RAGCollection;
|
|
593
|
+
listDocuments?: () => Promise<RAGIndexedDocument[]> | RAGIndexedDocument[];
|
|
594
|
+
deleteDocument?: (id: string) => Promise<boolean> | boolean;
|
|
595
|
+
signal?: AbortSignal;
|
|
596
|
+
};
|
|
597
|
+
export type RAGDirectorySyncSourceOptions = {
|
|
598
|
+
id: string;
|
|
599
|
+
label: string;
|
|
600
|
+
directory: string;
|
|
601
|
+
description?: string;
|
|
602
|
+
baseMetadata?: Record<string, unknown>;
|
|
603
|
+
defaultChunking?: RAGChunkingOptions;
|
|
604
|
+
extractors?: RAGFileExtractor[];
|
|
605
|
+
includeExtensions?: string[];
|
|
606
|
+
metadata?: Record<string, unknown>;
|
|
607
|
+
recursive?: boolean;
|
|
608
|
+
retryAttempts?: number;
|
|
609
|
+
retryDelayMs?: number;
|
|
610
|
+
};
|
|
611
|
+
export type RAGUrlSyncSourceOptions = {
|
|
612
|
+
id: string;
|
|
613
|
+
label: string;
|
|
614
|
+
urls: RAGDocumentUrlInput[];
|
|
615
|
+
description?: string;
|
|
616
|
+
baseMetadata?: Record<string, unknown>;
|
|
617
|
+
defaultChunking?: RAGChunkingOptions;
|
|
618
|
+
extractors?: RAGFileExtractor[];
|
|
619
|
+
metadata?: Record<string, unknown>;
|
|
620
|
+
retryAttempts?: number;
|
|
621
|
+
retryDelayMs?: number;
|
|
622
|
+
};
|
|
623
|
+
export type RAGSyncManager = Pick<RAGIndexManager, 'listSyncSources' | 'syncSource' | 'syncAllSources'>;
|
|
624
|
+
export type RAGSyncRunOptions = {
|
|
625
|
+
background?: boolean;
|
|
626
|
+
};
|
|
627
|
+
export type CreateRAGSyncManagerOptions = {
|
|
628
|
+
collection: RAGCollection;
|
|
629
|
+
deleteDocument?: (id: string) => Promise<boolean> | boolean;
|
|
630
|
+
listDocuments?: () => Promise<RAGIndexedDocument[]> | RAGIndexedDocument[];
|
|
631
|
+
loadState?: () => Promise<RAGSyncSourceRecord[]> | RAGSyncSourceRecord[];
|
|
632
|
+
saveState?: (records: RAGSyncSourceRecord[]) => Promise<void> | void;
|
|
633
|
+
backgroundByDefault?: boolean;
|
|
634
|
+
continueOnError?: boolean;
|
|
635
|
+
retryAttempts?: number;
|
|
636
|
+
retryDelayMs?: number;
|
|
637
|
+
sources: RAGSyncSourceDefinition[];
|
|
638
|
+
};
|
|
639
|
+
export type RAGSyncStateStore = {
|
|
640
|
+
load: () => Promise<RAGSyncSourceRecord[]> | RAGSyncSourceRecord[];
|
|
641
|
+
save: (records: RAGSyncSourceRecord[]) => Promise<void> | void;
|
|
642
|
+
};
|
|
643
|
+
export type RAGSyncSchedule = {
|
|
644
|
+
id: string;
|
|
645
|
+
label?: string;
|
|
646
|
+
sourceIds?: string[];
|
|
647
|
+
intervalMs: number;
|
|
648
|
+
runImmediately?: boolean;
|
|
649
|
+
background?: boolean;
|
|
650
|
+
};
|
|
651
|
+
export type RAGSyncScheduler = {
|
|
652
|
+
start: () => Promise<void> | void;
|
|
653
|
+
stop: () => void;
|
|
654
|
+
isRunning: () => boolean;
|
|
655
|
+
listSchedules: () => RAGSyncSchedule[];
|
|
656
|
+
};
|
|
657
|
+
export type RAGSyncResponse = {
|
|
658
|
+
ok: true;
|
|
659
|
+
source: RAGSyncSourceRecord;
|
|
660
|
+
partial?: boolean;
|
|
661
|
+
} | {
|
|
662
|
+
ok: true;
|
|
663
|
+
sources: RAGSyncSourceRecord[];
|
|
664
|
+
partial?: boolean;
|
|
665
|
+
failedSourceIds?: string[];
|
|
666
|
+
errorsBySource?: Record<string, string>;
|
|
667
|
+
} | {
|
|
668
|
+
ok: false;
|
|
669
|
+
error: string;
|
|
550
670
|
};
|
|
551
671
|
export type RAGExtractorReadiness = {
|
|
552
672
|
providerConfigured: boolean;
|
|
@@ -570,6 +690,7 @@ export type RAGOperationsResponse = {
|
|
|
570
690
|
health: RAGCorpusHealth;
|
|
571
691
|
readiness: RAGExtractorReadiness;
|
|
572
692
|
ingestJobs: RAGIngestJobRecord[];
|
|
693
|
+
syncSources: RAGSyncSourceRecord[];
|
|
573
694
|
};
|
|
574
695
|
export type RAGStatusResponse = {
|
|
575
696
|
ok: true;
|
|
@@ -582,6 +703,7 @@ export type RAGStatusResponse = {
|
|
|
582
703
|
health?: RAGCorpusHealth;
|
|
583
704
|
readiness?: RAGExtractorReadiness;
|
|
584
705
|
ingestJobs?: RAGIngestJobRecord[];
|
|
706
|
+
syncSources?: RAGSyncSourceRecord[];
|
|
585
707
|
};
|
|
586
708
|
export type RAGDocumentsResponse = {
|
|
587
709
|
ok: true;
|
|
@@ -760,6 +882,9 @@ export type RAGIndexManager = {
|
|
|
760
882
|
deleteDocument?: (id: string) => Promise<boolean> | boolean;
|
|
761
883
|
reindexDocument?: (id: string) => Promise<RAGMutationResponse | void> | RAGMutationResponse | void;
|
|
762
884
|
reindexSource?: (source: string) => Promise<RAGMutationResponse | void> | RAGMutationResponse | void;
|
|
885
|
+
listSyncSources?: () => Promise<RAGSyncSourceRecord[]> | RAGSyncSourceRecord[];
|
|
886
|
+
syncSource?: (id: string, options?: RAGSyncRunOptions) => Promise<RAGSyncResponse | void> | RAGSyncResponse | void;
|
|
887
|
+
syncAllSources?: (options?: RAGSyncRunOptions) => Promise<RAGSyncResponse | void> | RAGSyncResponse | void;
|
|
763
888
|
reseed?: () => Promise<RAGMutationResponse | void> | RAGMutationResponse | void;
|
|
764
889
|
reset?: () => Promise<RAGMutationResponse | void> | RAGMutationResponse | void;
|
|
765
890
|
listBackends?: () => Promise<Omit<RAGBackendsResponse, 'ok'> | RAGBackendDescriptor[]> | Omit<RAGBackendsResponse, 'ok'> | RAGBackendDescriptor[];
|
package/dist/vue/ai/index.js
CHANGED
|
@@ -941,6 +941,41 @@ var createRAGClient = (options) => {
|
|
|
941
941
|
}
|
|
942
942
|
return parseJson(response);
|
|
943
943
|
},
|
|
944
|
+
async syncSources() {
|
|
945
|
+
const response = await fetchImpl(`${basePath}/sync`);
|
|
946
|
+
if (!response.ok) {
|
|
947
|
+
throw new Error(await toErrorMessage(response));
|
|
948
|
+
}
|
|
949
|
+
return parseJson(response);
|
|
950
|
+
},
|
|
951
|
+
async syncAllSources(options2) {
|
|
952
|
+
const response = await fetchImpl(`${basePath}/sync`, {
|
|
953
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
954
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
955
|
+
method: "POST"
|
|
956
|
+
});
|
|
957
|
+
if (!response.ok) {
|
|
958
|
+
return {
|
|
959
|
+
error: await toErrorMessage(response),
|
|
960
|
+
ok: false
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
return parseJson(response);
|
|
964
|
+
},
|
|
965
|
+
async syncSource(id, options2) {
|
|
966
|
+
const response = await fetchImpl(`${basePath}/sync/${encodeURIComponent(id)}`, {
|
|
967
|
+
body: options2?.background === true ? JSON.stringify({ background: true }) : undefined,
|
|
968
|
+
headers: options2?.background === true ? jsonHeaders : undefined,
|
|
969
|
+
method: "POST"
|
|
970
|
+
});
|
|
971
|
+
if (!response.ok) {
|
|
972
|
+
return {
|
|
973
|
+
error: await toErrorMessage(response),
|
|
974
|
+
ok: false
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
return parseJson(response);
|
|
978
|
+
},
|
|
944
979
|
async reindexDocument(id) {
|
|
945
980
|
const response = await fetchImpl(`${basePath}/reindex/documents/${encodeURIComponent(id)}`, {
|
|
946
981
|
method: "POST"
|
|
@@ -2021,6 +2056,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
2021
2056
|
const error = ref6(null);
|
|
2022
2057
|
const lastMutation = ref6(null);
|
|
2023
2058
|
const backends = ref6(null);
|
|
2059
|
+
const syncSources = ref6(null);
|
|
2024
2060
|
const run = async (operation) => {
|
|
2025
2061
|
isLoading.value = true;
|
|
2026
2062
|
error.value = null;
|
|
@@ -2086,6 +2122,27 @@ var useRAGIndexAdmin = (path) => {
|
|
|
2086
2122
|
backends.value = response;
|
|
2087
2123
|
return response;
|
|
2088
2124
|
});
|
|
2125
|
+
const loadSyncSources = async () => run(async () => {
|
|
2126
|
+
const response = await client.syncSources();
|
|
2127
|
+
syncSources.value = response;
|
|
2128
|
+
return response;
|
|
2129
|
+
});
|
|
2130
|
+
const syncAllSources = async () => run(async () => {
|
|
2131
|
+
const response = await client.syncAllSources();
|
|
2132
|
+
syncSources.value = response;
|
|
2133
|
+
if (!response.ok) {
|
|
2134
|
+
throw new Error(response.error ?? "Failed to sync sources");
|
|
2135
|
+
}
|
|
2136
|
+
return response;
|
|
2137
|
+
});
|
|
2138
|
+
const syncSource = async (id) => run(async () => {
|
|
2139
|
+
const response = await client.syncSource(id);
|
|
2140
|
+
syncSources.value = response;
|
|
2141
|
+
if (!response.ok) {
|
|
2142
|
+
throw new Error(response.error ?? "Failed to sync source");
|
|
2143
|
+
}
|
|
2144
|
+
return response;
|
|
2145
|
+
});
|
|
2089
2146
|
const clearIndex = async () => run(async () => {
|
|
2090
2147
|
const response = await client.clearIndex();
|
|
2091
2148
|
const mutation = { ok: response.ok };
|
|
@@ -2097,6 +2154,7 @@ var useRAGIndexAdmin = (path) => {
|
|
|
2097
2154
|
error.value = null;
|
|
2098
2155
|
isLoading.value = false;
|
|
2099
2156
|
lastMutation.value = null;
|
|
2157
|
+
syncSources.value = null;
|
|
2100
2158
|
};
|
|
2101
2159
|
return {
|
|
2102
2160
|
backends,
|
|
@@ -2107,11 +2165,15 @@ var useRAGIndexAdmin = (path) => {
|
|
|
2107
2165
|
isLoading,
|
|
2108
2166
|
lastMutation,
|
|
2109
2167
|
loadBackends,
|
|
2168
|
+
loadSyncSources,
|
|
2110
2169
|
reindexDocument,
|
|
2111
2170
|
reindexSource,
|
|
2112
2171
|
reseed,
|
|
2113
2172
|
reset,
|
|
2114
|
-
resetState
|
|
2173
|
+
resetState,
|
|
2174
|
+
syncAllSources,
|
|
2175
|
+
syncSource,
|
|
2176
|
+
syncSources
|
|
2115
2177
|
};
|
|
2116
2178
|
};
|
|
2117
2179
|
|
|
@@ -2129,6 +2191,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
2129
2191
|
const readiness = ref7();
|
|
2130
2192
|
const documents = ref7();
|
|
2131
2193
|
const ingestJobs = ref7([]);
|
|
2194
|
+
const syncSources = ref7([]);
|
|
2132
2195
|
const error = ref7(null);
|
|
2133
2196
|
const isLoading = ref7(autoLoad);
|
|
2134
2197
|
const refresh = async () => {
|
|
@@ -2146,6 +2209,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
2146
2209
|
readiness.value = response.readiness;
|
|
2147
2210
|
documents.value = response.documents;
|
|
2148
2211
|
ingestJobs.value = response.ingestJobs ?? [];
|
|
2212
|
+
syncSources.value = response.syncSources ?? [];
|
|
2149
2213
|
return response;
|
|
2150
2214
|
} catch (caught) {
|
|
2151
2215
|
error.value = caught instanceof Error ? caught.message : String(caught);
|
|
@@ -2166,6 +2230,7 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
2166
2230
|
ingestJobs.value = [];
|
|
2167
2231
|
isLoading.value = false;
|
|
2168
2232
|
readiness.value = undefined;
|
|
2233
|
+
syncSources.value = [];
|
|
2169
2234
|
status.value = undefined;
|
|
2170
2235
|
};
|
|
2171
2236
|
onMounted(() => {
|
|
@@ -2189,7 +2254,8 @@ var useRAGOps = (path, autoLoad = true) => {
|
|
|
2189
2254
|
readiness,
|
|
2190
2255
|
refresh,
|
|
2191
2256
|
reset,
|
|
2192
|
-
status
|
|
2257
|
+
status,
|
|
2258
|
+
syncSources
|
|
2193
2259
|
};
|
|
2194
2260
|
};
|
|
2195
2261
|
|
|
@@ -2426,5 +2492,5 @@ export {
|
|
|
2426
2492
|
AIStreamKey
|
|
2427
2493
|
};
|
|
2428
2494
|
|
|
2429
|
-
//# debugId=
|
|
2495
|
+
//# debugId=E693BD507BF5A9B264756E2164756E21
|
|
2430
2496
|
//# sourceMappingURL=index.js.map
|