MCPcopy Create free account
hub / github.com/Xyntopia/taskyon / updateStoreState

Function updateStoreState

src/modules/localVectorStore.ts:135–148  ·  view source on GitHub ↗
(documentStore: documentStoreType)

Source from the content-addressed store, hash-verified

133}
134
135async function updateStoreState(documentStore: documentStoreType) {
136 const documentNameSet = new Set(
137 (await documentStore.idb?.documents.toArray())?.map((doc) => doc.filehash)
138 );
139 const documentCount = documentNameSet.size;
140 if (documentStore) {
141 vectorStoreState.value = {
142 ...vectorStoreState.value,
143 maxElements: documentStore.index?.getMaxElements() || 0,
144 numElements: documentStore.index?.getCurrentCount() || 0,
145 documentCount: documentCount,
146 };
147 }
148}
149
150/*function parseCSV(csvData: string): string[][] {
151 // Regular expression to match CSV lines, even those containing quoted fields with commas and newlines

Callers 2

loadCollectionFunction · 0.85
uploadToIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected