44 * SPDX-License-Identifier: Apache-2.0
55 */
66
7- import { InMemoryTabularStorage , InMemoryVectorStorage } from "@workglow/storage" ;
87import {
98 createKnowledgeBase ,
9+ getGlobalKnowledgeBaseRepository ,
1010 isSharedTableMode ,
1111 registerKnowledgeBase ,
12- getGlobalKnowledgeBaseRepository ,
1312 ScopedTabularStorage ,
1413 ScopedVectorStorage ,
1514 SharedChunkIndexes ,
@@ -19,11 +18,15 @@ import {
1918 SharedDocumentPrimaryKey ,
2019 SharedDocumentStorageSchema ,
2120} from "@workglow/knowledge-base" ;
21+ import { InMemoryTabularStorage , InMemoryVectorStorage } from "@workglow/storage" ;
2222import { uuid4 } from "@workglow/util" ;
2323import { afterEach , beforeEach , describe , expect , test , vi } from "vitest" ;
2424
2525describe ( "ScopedTabularStorage" , ( ) => {
26- let sharedStorage : InstanceType < typeof InMemoryTabularStorage > ;
26+ let sharedStorage : InMemoryTabularStorage <
27+ typeof SharedDocumentStorageSchema ,
28+ typeof SharedDocumentPrimaryKey
29+ > ;
2730 let scopeA : ScopedTabularStorage < any , any > ;
2831 let scopeB : ScopedTabularStorage < any , any > ;
2932
@@ -244,7 +247,10 @@ describe("ScopedTabularStorage", () => {
244247} ) ;
245248
246249describe ( "ScopedVectorStorage" , ( ) => {
247- let sharedStorage : InstanceType < typeof InMemoryVectorStorage > ;
250+ let sharedStorage : InMemoryVectorStorage <
251+ typeof SharedChunkVectorStorageSchema ,
252+ typeof SharedChunkPrimaryKey
253+ > ;
248254 let scopeA : ScopedVectorStorage < any , any > ;
249255 let scopeB : ScopedVectorStorage < any , any > ;
250256
@@ -261,7 +267,7 @@ describe("ScopedVectorStorage", () => {
261267 } ) ;
262268
263269 afterEach ( ( ) => {
264- sharedStorage . destroy ( ) ;
270+ sharedStorage ? .destroy ?. ( ) ;
265271 } ) ;
266272
267273 test ( "getVectorDimensions delegates to inner" , ( ) => {
0 commit comments