@eclipse-lyra/extension-rag-system 0.0.0

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.
Files changed (62) hide show
  1. package/dist/api.d.ts +9 -0
  2. package/dist/api.d.ts.map +1 -0
  3. package/dist/api.js +90 -0
  4. package/dist/api.js.map +1 -0
  5. package/dist/chunkers/chunker-interface.d.ts +21 -0
  6. package/dist/chunkers/chunker-interface.d.ts.map +1 -0
  7. package/dist/chunkers/document-chunker.d.ts +12 -0
  8. package/dist/chunkers/document-chunker.d.ts.map +1 -0
  9. package/dist/chunkers/fallback-chunker.d.ts +10 -0
  10. package/dist/chunkers/fallback-chunker.d.ts.map +1 -0
  11. package/dist/chunkers/langchain-chunker.d.ts +12 -0
  12. package/dist/chunkers/langchain-chunker.d.ts.map +1 -0
  13. package/dist/document-index-service.d.ts +102 -0
  14. package/dist/document-index-service.d.ts.map +1 -0
  15. package/dist/embedding-service.d.ts +18 -0
  16. package/dist/embedding-service.d.ts.map +1 -0
  17. package/dist/extractors/document-extractor-interface.d.ts +26 -0
  18. package/dist/extractors/document-extractor-interface.d.ts.map +1 -0
  19. package/dist/extractors/document-extractor.d.ts +13 -0
  20. package/dist/extractors/document-extractor.d.ts.map +1 -0
  21. package/dist/extractors/llm-ocr-extractor.d.ts +16 -0
  22. package/dist/extractors/llm-ocr-extractor.d.ts.map +1 -0
  23. package/dist/extractors/pdfjs-extractor.d.ts +7 -0
  24. package/dist/extractors/pdfjs-extractor.d.ts.map +1 -0
  25. package/dist/i18n.json.d.ts +13 -0
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +22 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/rag-integration-DO7-zvk2.js +191 -0
  31. package/dist/rag-integration-DO7-zvk2.js.map +1 -0
  32. package/dist/rag-integration.d.ts +6 -0
  33. package/dist/rag-integration.d.ts.map +1 -0
  34. package/dist/rag-service-BKBGCuO-.js +1872 -0
  35. package/dist/rag-service-BKBGCuO-.js.map +1 -0
  36. package/dist/rag-service.d.ts +25 -0
  37. package/dist/rag-service.d.ts.map +1 -0
  38. package/dist/rag-system-extension-DfD6H8Vr.js +1142 -0
  39. package/dist/rag-system-extension-DfD6H8Vr.js.map +1 -0
  40. package/dist/rag-system-extension.d.ts +2 -0
  41. package/dist/rag-system-extension.d.ts.map +1 -0
  42. package/dist/rag-system-manager.d.ts +41 -0
  43. package/dist/rag-system-manager.d.ts.map +1 -0
  44. package/dist/rxdb-loader.d.ts +9 -0
  45. package/dist/rxdb-loader.d.ts.map +1 -0
  46. package/dist/services/rag-result-formatter.d.ts +23 -0
  47. package/dist/services/rag-result-formatter.d.ts.map +1 -0
  48. package/dist/services/relevance-calculator.d.ts +7 -0
  49. package/dist/services/relevance-calculator.d.ts.map +1 -0
  50. package/dist/utils/constants.d.ts +35 -0
  51. package/dist/utils/constants.d.ts.map +1 -0
  52. package/dist/utils/context-scopes.d.ts +39 -0
  53. package/dist/utils/context-scopes.d.ts.map +1 -0
  54. package/dist/utils/query-utils.d.ts +7 -0
  55. package/dist/utils/query-utils.d.ts.map +1 -0
  56. package/dist/utils/snippet-extractor.d.ts +22 -0
  57. package/dist/utils/snippet-extractor.d.ts.map +1 -0
  58. package/dist/utils/workspace-utils.d.ts +8 -0
  59. package/dist/utils/workspace-utils.d.ts.map +1 -0
  60. package/dist/vector-utils.d.ts +28 -0
  61. package/dist/vector-utils.d.ts.map +1 -0
  62. package/package.json +39 -0
package/dist/api.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export { documentIndexService, type DocumentSearchScope, type IndexedDocument, type DocumentIndexOptions, } from './document-index-service';
2
+ export { embeddingService, type EmbeddingOptions } from './embedding-service';
3
+ export { ragService, searchWorkspaceDocuments, type RAGSearchOptions, type RAGSearchResult, } from './rag-service';
4
+ export { ragPromptEnhancer, createRAGToolExecutor, registerRAGCommands, integrateRAGWithAI, } from './rag-integration';
5
+ export type { VectorEmbedding, IndexValues, SampleVector } from './vector-utils';
6
+ export { euclideanDistance, cosineSimilarity, createIndexValuesFromArray, getIndexValueArray } from './vector-utils';
7
+ export { createEditorScope, createDirectoryScope, createFileTypeScope, combineScopes, } from './utils/context-scopes';
8
+ export type { ContextScopeProvider } from './utils/context-scopes';
9
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,oBAAoB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,UAAU,EACV,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACrH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
package/dist/api.js ADDED
@@ -0,0 +1,90 @@
1
+ import { c, a, d, e, b, g, r, s } from "./rag-service-BKBGCuO-.js";
2
+ import { createRAGToolExecutor, integrateRAGWithAI, ragPromptEnhancer, registerRAGCommands } from "./rag-integration-DO7-zvk2.js";
3
+ function createEditorScope(openFiles) {
4
+ return {
5
+ includePaths: openFiles
6
+ };
7
+ }
8
+ function createDirectoryScope(directoryPath, recursive = true) {
9
+ const pattern = recursive ? `^${directoryPath.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/.*` : `^${directoryPath.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/[^/]+$`;
10
+ return {
11
+ pathPattern: new RegExp(pattern)
12
+ };
13
+ }
14
+ function createFileTypeScope(fileTypes) {
15
+ const pattern = `\\.(${fileTypes.join("|")})$`;
16
+ return {
17
+ pathPattern: new RegExp(pattern)
18
+ };
19
+ }
20
+ function combineScopes(...scopes) {
21
+ const validScopes = scopes.filter((s2) => s2 !== null);
22
+ if (validScopes.length === 0) {
23
+ return null;
24
+ }
25
+ if (validScopes.length === 1) {
26
+ return validScopes[0];
27
+ }
28
+ const combined = {};
29
+ const allIncludePaths = [];
30
+ const allExcludePaths = [];
31
+ const allTags = [];
32
+ const allMetadataFilters = [];
33
+ for (const scope of validScopes) {
34
+ if (scope.includePaths) {
35
+ allIncludePaths.push(...scope.includePaths);
36
+ }
37
+ if (scope.excludePaths) {
38
+ allExcludePaths.push(...scope.excludePaths);
39
+ }
40
+ if (scope.tags) {
41
+ allTags.push(...scope.tags);
42
+ }
43
+ if (scope.metadataFilter) {
44
+ allMetadataFilters.push(scope.metadataFilter);
45
+ }
46
+ if (scope.pathPattern) {
47
+ const existingPattern = combined.pathPattern;
48
+ if (existingPattern) {
49
+ const newPattern = scope.pathPattern instanceof RegExp ? scope.pathPattern : new RegExp(scope.pathPattern);
50
+ combined.pathPattern = new RegExp(`(${existingPattern instanceof RegExp ? existingPattern.source : existingPattern})|(${newPattern.source})`);
51
+ } else {
52
+ combined.pathPattern = scope.pathPattern;
53
+ }
54
+ }
55
+ }
56
+ if (allIncludePaths.length > 0) {
57
+ combined.includePaths = [...new Set(allIncludePaths)];
58
+ }
59
+ if (allExcludePaths.length > 0) {
60
+ combined.excludePaths = [...new Set(allExcludePaths)];
61
+ }
62
+ if (allTags.length > 0) {
63
+ combined.tags = [...new Set(allTags)];
64
+ }
65
+ if (allMetadataFilters.length > 0) {
66
+ combined.metadataFilter = (doc) => {
67
+ return allMetadataFilters.every((filter) => filter(doc));
68
+ };
69
+ }
70
+ return combined;
71
+ }
72
+ export {
73
+ combineScopes,
74
+ c as cosineSimilarity,
75
+ createDirectoryScope,
76
+ createEditorScope,
77
+ createFileTypeScope,
78
+ a as createIndexValuesFromArray,
79
+ createRAGToolExecutor,
80
+ d as documentIndexService,
81
+ e as embeddingService,
82
+ b as euclideanDistance,
83
+ g as getIndexValueArray,
84
+ integrateRAGWithAI,
85
+ ragPromptEnhancer,
86
+ r as ragService,
87
+ registerRAGCommands,
88
+ s as searchWorkspaceDocuments
89
+ };
90
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sources":["../src/utils/context-scopes.ts"],"sourcesContent":["import { DocumentSearchScope } from '../document-index-service';\nimport { IndexedDocument } from '../document-index-service';\n\nexport interface ContextScopeProvider {\n getScope(): DocumentSearchScope | null;\n getName(): string;\n}\n\nexport class PathBasedScope implements ContextScopeProvider {\n constructor(\n private includePaths: string[],\n private excludePaths: string[] = [],\n private name: string = 'Path-based scope'\n ) {}\n\n getScope(): DocumentSearchScope {\n return {\n includePaths: this.includePaths,\n excludePaths: this.excludePaths\n };\n }\n\n getName(): string {\n return this.name;\n }\n}\n\nexport class PatternBasedScope implements ContextScopeProvider {\n constructor(\n private pattern: string | RegExp,\n private name: string = 'Pattern-based scope'\n ) {}\n\n getScope(): DocumentSearchScope {\n return {\n pathPattern: this.pattern\n };\n }\n\n getName(): string {\n return this.name;\n }\n}\n\nexport class TagBasedScope implements ContextScopeProvider {\n constructor(\n private tags: string[],\n private name: string = 'Tag-based scope'\n ) {}\n\n getScope(): DocumentSearchScope {\n return {\n tags: this.tags\n };\n }\n\n getName(): string {\n return this.name;\n }\n}\n\nexport class CustomScope implements ContextScopeProvider {\n constructor(\n private scope: DocumentSearchScope,\n private name: string = 'Custom scope'\n ) {}\n\n getScope(): DocumentSearchScope {\n return this.scope;\n }\n\n getName(): string {\n return this.name;\n }\n}\n\nexport function createEditorScope(openFiles: string[]): DocumentSearchScope {\n return {\n includePaths: openFiles\n };\n}\n\nexport function createDirectoryScope(directoryPath: string, recursive: boolean = true): DocumentSearchScope {\n const pattern = recursive \n ? `^${directoryPath.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}/.*`\n : `^${directoryPath.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}/[^/]+$`;\n return {\n pathPattern: new RegExp(pattern)\n };\n}\n\nexport function createFileTypeScope(fileTypes: string[]): DocumentSearchScope {\n const pattern = `\\\\.(${fileTypes.join('|')})$`;\n return {\n pathPattern: new RegExp(pattern)\n };\n}\n\nexport function combineScopes(...scopes: (DocumentSearchScope | null)[]): DocumentSearchScope | null {\n const validScopes = scopes.filter((s): s is DocumentSearchScope => s !== null);\n if (validScopes.length === 0) {\n return null;\n }\n if (validScopes.length === 1) {\n return validScopes[0];\n }\n\n const combined: DocumentSearchScope = {};\n \n const allIncludePaths: string[] = [];\n const allExcludePaths: string[] = [];\n const allTags: string[] = [];\n const allMetadataFilters: Array<(doc: IndexedDocument) => boolean> = [];\n\n for (const scope of validScopes) {\n if (scope.includePaths) {\n allIncludePaths.push(...scope.includePaths);\n }\n if (scope.excludePaths) {\n allExcludePaths.push(...scope.excludePaths);\n }\n if (scope.tags) {\n allTags.push(...scope.tags);\n }\n if (scope.metadataFilter) {\n allMetadataFilters.push(scope.metadataFilter);\n }\n if (scope.pathPattern) {\n const existingPattern = combined.pathPattern;\n if (existingPattern) {\n const newPattern = scope.pathPattern instanceof RegExp \n ? scope.pathPattern \n : new RegExp(scope.pathPattern);\n combined.pathPattern = new RegExp(`(${existingPattern instanceof RegExp ? existingPattern.source : existingPattern})|(${newPattern.source})`);\n } else {\n combined.pathPattern = scope.pathPattern;\n }\n }\n }\n\n if (allIncludePaths.length > 0) {\n combined.includePaths = [...new Set(allIncludePaths)];\n }\n if (allExcludePaths.length > 0) {\n combined.excludePaths = [...new Set(allExcludePaths)];\n }\n if (allTags.length > 0) {\n combined.tags = [...new Set(allTags)];\n }\n if (allMetadataFilters.length > 0) {\n combined.metadataFilter = (doc: IndexedDocument) => {\n return allMetadataFilters.every(filter => filter(doc));\n };\n }\n\n return combined;\n}\n\n"],"names":["s"],"mappings":";;AA4EO,SAAS,kBAAkB,WAA0C;AACxE,SAAO;AAAA,IACH,cAAc;AAAA,EAAA;AAEtB;AAEO,SAAS,qBAAqB,eAAuB,YAAqB,MAA2B;AACxG,QAAM,UAAU,YACV,IAAI,cAAc,QAAQ,uBAAuB,MAAM,CAAC,QACxD,IAAI,cAAc,QAAQ,uBAAuB,MAAM,CAAC;AAC9D,SAAO;AAAA,IACH,aAAa,IAAI,OAAO,OAAO;AAAA,EAAA;AAEvC;AAEO,SAAS,oBAAoB,WAA0C;AAC1E,QAAM,UAAU,OAAO,UAAU,KAAK,GAAG,CAAC;AAC1C,SAAO;AAAA,IACH,aAAa,IAAI,OAAO,OAAO;AAAA,EAAA;AAEvC;AAEO,SAAS,iBAAiB,QAAoE;AACjG,QAAM,cAAc,OAAO,OAAO,CAACA,OAAgCA,OAAM,IAAI;AAC7E,MAAI,YAAY,WAAW,GAAG;AAC1B,WAAO;AAAA,EACX;AACA,MAAI,YAAY,WAAW,GAAG;AAC1B,WAAO,YAAY,CAAC;AAAA,EACxB;AAEA,QAAM,WAAgC,CAAA;AAEtC,QAAM,kBAA4B,CAAA;AAClC,QAAM,kBAA4B,CAAA;AAClC,QAAM,UAAoB,CAAA;AAC1B,QAAM,qBAA+D,CAAA;AAErE,aAAW,SAAS,aAAa;AAC7B,QAAI,MAAM,cAAc;AACpB,sBAAgB,KAAK,GAAG,MAAM,YAAY;AAAA,IAC9C;AACA,QAAI,MAAM,cAAc;AACpB,sBAAgB,KAAK,GAAG,MAAM,YAAY;AAAA,IAC9C;AACA,QAAI,MAAM,MAAM;AACZ,cAAQ,KAAK,GAAG,MAAM,IAAI;AAAA,IAC9B;AACA,QAAI,MAAM,gBAAgB;AACtB,yBAAmB,KAAK,MAAM,cAAc;AAAA,IAChD;AACA,QAAI,MAAM,aAAa;AACnB,YAAM,kBAAkB,SAAS;AACjC,UAAI,iBAAiB;AACjB,cAAM,aAAa,MAAM,uBAAuB,SAC1C,MAAM,cACN,IAAI,OAAO,MAAM,WAAW;AAClC,iBAAS,cAAc,IAAI,OAAO,IAAI,2BAA2B,SAAS,gBAAgB,SAAS,eAAe,MAAM,WAAW,MAAM,GAAG;AAAA,MAChJ,OAAO;AACH,iBAAS,cAAc,MAAM;AAAA,MACjC;AAAA,IACJ;AAAA,EACJ;AAEA,MAAI,gBAAgB,SAAS,GAAG;AAC5B,aAAS,eAAe,CAAC,GAAG,IAAI,IAAI,eAAe,CAAC;AAAA,EACxD;AACA,MAAI,gBAAgB,SAAS,GAAG;AAC5B,aAAS,eAAe,CAAC,GAAG,IAAI,IAAI,eAAe,CAAC;AAAA,EACxD;AACA,MAAI,QAAQ,SAAS,GAAG;AACpB,aAAS,OAAO,CAAC,GAAG,IAAI,IAAI,OAAO,CAAC;AAAA,EACxC;AACA,MAAI,mBAAmB,SAAS,GAAG;AAC/B,aAAS,iBAAiB,CAAC,QAAyB;AAChD,aAAO,mBAAmB,MAAM,CAAA,WAAU,OAAO,GAAG,CAAC;AAAA,IACzD;AAAA,EACJ;AAEA,SAAO;AACX;"}
@@ -0,0 +1,21 @@
1
+ export interface DocumentChunk {
2
+ id: string;
3
+ documentId: string;
4
+ chunkIndex: number;
5
+ text: string;
6
+ startOffset: number;
7
+ endOffset: number;
8
+ }
9
+ export interface ChunkingOptions {
10
+ /** Maximum chunk size in words (default: 500) */
11
+ chunkSize?: number;
12
+ /** Overlap between chunks in words (default: 50) */
13
+ chunkOverlap?: number;
14
+ /** Minimum chunk size in words (used by fallback chunker) */
15
+ minChunkSize?: number;
16
+ }
17
+ export interface IDocumentChunker {
18
+ chunkDocument(documentId: string, content: string, fileName: string): DocumentChunk[] | Promise<DocumentChunk[]>;
19
+ getChunkContext(chunk: DocumentChunk, allChunks: DocumentChunk[]): string;
20
+ }
21
+ //# sourceMappingURL=chunker-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunker-interface.d.ts","sourceRoot":"","sources":["../../src/chunkers/chunker-interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC5B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC7B,aAAa,CACT,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACjB,aAAa,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAE9C,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;CAC7E"}
@@ -0,0 +1,12 @@
1
+ import { ChunkingOptions, IDocumentChunker, DocumentChunk } from './chunker-interface';
2
+ export type { DocumentChunk, ChunkingOptions, IDocumentChunker } from './chunker-interface';
3
+ export { FallbackChunker } from './fallback-chunker';
4
+ export { LangChainChunker } from './langchain-chunker';
5
+ export declare class DocumentChunker implements IDocumentChunker {
6
+ private chunker;
7
+ constructor(options?: ChunkingOptions);
8
+ chunkDocument(documentId: string, content: string, fileName: string): Promise<DocumentChunk[]>;
9
+ getChunkContext(chunk: any, allChunks: any[]): string;
10
+ }
11
+ export declare const defaultChunker: DocumentChunker;
12
+ //# sourceMappingURL=document-chunker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-chunker.d.ts","sourceRoot":"","sources":["../../src/chunkers/document-chunker.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAKvD,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAI5F,qBAAa,eAAgB,YAAW,gBAAgB;IACpD,OAAO,CAAC,OAAO,CAAmB;gBAEtB,OAAO,GAAE,eAAoB;IAUnC,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAWzE,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE;CAG/C;AAED,eAAO,MAAM,cAAc,iBAAwB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { DocumentChunk, ChunkingOptions, IDocumentChunker } from './chunker-interface';
2
+ export declare class FallbackChunker implements IDocumentChunker {
3
+ private readonly chunkSize;
4
+ private readonly chunkOverlap;
5
+ private readonly minChunkSize;
6
+ constructor(options?: ChunkingOptions);
7
+ chunkDocument(documentId: string, content: string, fileName: string): DocumentChunk[];
8
+ getChunkContext(chunk: DocumentChunk, allChunks: DocumentChunk[]): string;
9
+ }
10
+ //# sourceMappingURL=fallback-chunker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fallback-chunker.d.ts","sourceRoot":"","sources":["../../src/chunkers/fallback-chunker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5F,qBAAa,eAAgB,YAAW,gBAAgB;IACpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAE1B,OAAO,GAAE,eAAoB;IAMzC,aAAa,CACT,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACjB,aAAa,EAAE;IA8ClB,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM;CAmB5E"}
@@ -0,0 +1,12 @@
1
+ import { DocumentChunk, ChunkingOptions, IDocumentChunker } from './chunker-interface';
2
+ export declare class LangChainChunker implements IDocumentChunker {
3
+ private textSplitter;
4
+ private readonly chunkSize;
5
+ private readonly chunkOverlap;
6
+ constructor(options?: ChunkingOptions);
7
+ private getTextSplitter;
8
+ chunkDocument(documentId: string, content: string, fileName: string): Promise<DocumentChunk[]>;
9
+ private validateNoWordSplitting;
10
+ getChunkContext(chunk: DocumentChunk, allChunks: DocumentChunk[]): string;
11
+ }
12
+ //# sourceMappingURL=langchain-chunker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"langchain-chunker.d.ts","sourceRoot":"","sources":["../../src/chunkers/langchain-chunker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAe5F,qBAAa,gBAAiB,YAAW,gBAAgB;IACrD,OAAO,CAAC,YAAY,CAA+C;IACnE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAE1B,OAAO,GAAE,eAAoB;YAK3B,eAAe;IAqBvB,aAAa,CACf,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,EAAE,CAAC;IA+D3B,OAAO,CAAC,uBAAuB;IAsB/B,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM;CAmB5E"}
@@ -0,0 +1,102 @@
1
+ import { File, Directory } from '@eclipse-lyra/core';
2
+ export interface DocumentSearchScope {
3
+ includePaths?: string[];
4
+ excludePaths?: string[];
5
+ pathPattern?: string | RegExp;
6
+ tags?: string[];
7
+ metadataFilter?: (doc: IndexedDocument) => boolean;
8
+ }
9
+ export interface IndexedDocument {
10
+ id: string;
11
+ workspacePath: string;
12
+ filePath: string;
13
+ fileName: string;
14
+ fileType: string;
15
+ content: string;
16
+ contentHash: string;
17
+ metadata: {
18
+ size: number;
19
+ lastModified: number;
20
+ language?: string;
21
+ tags?: string[];
22
+ };
23
+ indexedAt: number;
24
+ updatedAt: number;
25
+ }
26
+ export interface DocumentIndexOptions {
27
+ includeContent?: boolean;
28
+ maxFileSize?: number;
29
+ fileTypes?: string[];
30
+ excludePatterns?: string[];
31
+ tags?: string[];
32
+ }
33
+ declare class DocumentIndexService {
34
+ private db?;
35
+ private documentsCollection?;
36
+ private vectorsCollection?;
37
+ private sampleVectors;
38
+ private isInitialized;
39
+ private readonly DEFAULT_MAX_FILE_SIZE;
40
+ private readonly chunker;
41
+ private readonly documentExtractor;
42
+ private readonly DEFAULT_INDEXABLE_TYPES;
43
+ initialize(): Promise<void>;
44
+ private ensureInitialized;
45
+ private initializeSampleVectors;
46
+ private generateDocumentId;
47
+ private computeContentHash;
48
+ private isIndexableFile;
49
+ private detectLanguage;
50
+ indexDocument(file: File, options?: DocumentIndexOptions): Promise<IndexedDocument>;
51
+ getDocument(id: string): Promise<IndexedDocument | null>;
52
+ getDocumentByPath(workspacePath: string, filePath: string): Promise<IndexedDocument | null>;
53
+ listDocuments(workspacePath?: string): Promise<IndexedDocument[]>;
54
+ deleteDocument(id: string): Promise<boolean>;
55
+ deleteDocumentByPath(workspacePath: string, filePath: string): Promise<boolean>;
56
+ private handleSchemaMigration;
57
+ deleteWorkspace(workspacePath: string): Promise<number>;
58
+ updateDocumentMetadata(id: string, updates: Partial<Pick<IndexedDocument, 'metadata'>>): Promise<IndexedDocument | null>;
59
+ indexWorkspace(workspace: Directory, options?: DocumentIndexOptions): Promise<{
60
+ indexed: number;
61
+ failed: number;
62
+ errors: string[];
63
+ }>;
64
+ private collectFiles;
65
+ reindexDocument(file: File, options?: DocumentIndexOptions): Promise<IndexedDocument>;
66
+ reindexAllDocuments(options?: DocumentIndexOptions): Promise<{
67
+ total: number;
68
+ succeeded: number;
69
+ failed: number;
70
+ }>;
71
+ getStats(): Promise<{
72
+ totalDocuments: number;
73
+ byWorkspace: Record<string, number>;
74
+ }>;
75
+ private handleWorkspaceChange;
76
+ private generateAndStoreEmbedding;
77
+ searchSimilar(queryText: string, options?: {
78
+ limit?: number;
79
+ workspacePath?: string;
80
+ fileType?: string;
81
+ indexDistance?: number;
82
+ docsPerIndexSide?: number;
83
+ }): Promise<Array<{
84
+ document: IndexedDocument;
85
+ similarity: number;
86
+ chunkIndex?: number;
87
+ chunkStartOffset?: number;
88
+ chunkEndOffset?: number;
89
+ }>>;
90
+ indexFileInContext(file: File, context: DocumentSearchScope, options?: DocumentIndexOptions): Promise<IndexedDocument>;
91
+ indexFilesInContext(files: File[], context: DocumentSearchScope, options?: DocumentIndexOptions): Promise<{
92
+ succeeded: number;
93
+ failed: number;
94
+ }>;
95
+ reindexFileInContext(file: File, context: DocumentSearchScope, options?: DocumentIndexOptions): Promise<IndexedDocument>;
96
+ removeFileFromContext(file: File, context: DocumentSearchScope): Promise<void>;
97
+ clearContext(context: DocumentSearchScope): Promise<void>;
98
+ getFilePathsInContext(context: DocumentSearchScope): Promise<string[]>;
99
+ }
100
+ export declare const documentIndexService: DocumentIndexService;
101
+ export {};
102
+ //# sourceMappingURL=document-index-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-index-service.d.ts","sourceRoot":"","sources":["../src/document-index-service.ts"],"names":[],"mappings":"A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,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAsB3C,oBAAoB,CACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,oBAAyB,GACnC,OAAO,CAAC,eAAe,CAAC;IAQrB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B9E,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BzD,qBAAqB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAY/E;AAED,eAAO,MAAM,oBAAoB,sBAA6B,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface EmbeddingOptions {
2
+ pooling?: 'mean' | 'cls' | 'none';
3
+ normalize?: boolean;
4
+ }
5
+ declare class EmbeddingService {
6
+ private pipePromise?;
7
+ private modelName;
8
+ private readonly EMBEDDING_DIMENSION;
9
+ private readonly DEFAULT_OPTIONS;
10
+ initialize(): Promise<void>;
11
+ generateEmbedding(text: string, options?: EmbeddingOptions): Promise<number[]>;
12
+ generateEmbeddings(texts: string[], options?: EmbeddingOptions): Promise<number[][]>;
13
+ getEmbeddingDimension(): number;
14
+ getModelName(): string;
15
+ }
16
+ export declare const embeddingService: EmbeddingService;
17
+ export {};
18
+ //# sourceMappingURL=embedding-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedding-service.d.ts","sourceRoot":"","sources":["../src/embedding-service.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,cAAM,gBAAgB;IAClB,OAAO,CAAC,WAAW,CAAC,CAAqC;IACzD,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAO;IAC3C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAG9B;IAEI,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA8B3B,iBAAiB,CACnB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,gBAAqB,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC;IA2Bd,kBAAkB,CACpB,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,GAAE,gBAAqB,GAC/B,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAWtB,qBAAqB,IAAI,MAAM;IAI/B,YAAY,IAAI,MAAM;CAGzB;AAED,eAAO,MAAM,gBAAgB,kBAAyB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { File } from '@eclipse-lyra/core';
2
+ export interface DocumentExtractionOptions {
3
+ /** Include page numbers in extracted text (default: true for PDFs) */
4
+ includePageNumbers?: boolean;
5
+ /** Custom page separator (default: '\n\n') */
6
+ pageSeparator?: string;
7
+ /** File type hint (auto-detected from file extension if not provided) */
8
+ fileType?: string;
9
+ }
10
+ export interface IDocumentExtractor {
11
+ /**
12
+ * Checks if this extractor can handle the given file type.
13
+ * @param fileType The file type (extension) to check
14
+ * @returns true if this extractor can handle the file type
15
+ */
16
+ canExtract(fileType: string): boolean;
17
+ /**
18
+ * Extracts text content from a document file.
19
+ * @param file The file to extract text from
20
+ * @param options Optional extraction options
21
+ * @returns The extracted text content
22
+ * @throws Error if extraction fails or file contains no extractable text
23
+ */
24
+ extractText(file: File, options?: DocumentExtractionOptions): Promise<string>;
25
+ }
26
+ //# sourceMappingURL=document-extractor-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-extractor-interface.d.ts","sourceRoot":"","sources":["../../src/extractors/document-extractor-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,WAAW,yBAAyB;IACtC,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IAC/B;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtC;;;;;;OAMG;IACH,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACjF"}
@@ -0,0 +1,13 @@
1
+ import { IDocumentExtractor, DocumentExtractionOptions } from './document-extractor-interface';
2
+ import { File } from '@eclipse-lyra/core';
3
+ export type { IDocumentExtractor, DocumentExtractionOptions } from './document-extractor-interface';
4
+ export { PDFJSExtractor } from './pdfjs-extractor';
5
+ export { LLMOCRExtractor } from './llm-ocr-extractor';
6
+ export declare class DocumentExtractor implements IDocumentExtractor {
7
+ private extractors;
8
+ constructor();
9
+ canExtract(fileType: string): boolean;
10
+ extractText(file: File, options?: DocumentExtractionOptions): Promise<string>;
11
+ }
12
+ export declare const defaultDocumentExtractor: DocumentExtractor;
13
+ //# sourceMappingURL=document-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-extractor.d.ts","sourceRoot":"","sources":["../../src/extractors/document-extractor.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AACpG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAI/C,qBAAa,iBAAkB,YAAW,kBAAkB;IACxD,OAAO,CAAC,UAAU,CAAuB;;IASzC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI/B,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC;CAyCtF;AAED,eAAO,MAAM,wBAAwB,mBAA0B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { File } from '@eclipse-lyra/core';
2
+ import { IDocumentExtractor, DocumentExtractionOptions } from './document-extractor-interface';
3
+ /**
4
+ * LLM-based OCR extractor for document files using Mistral OCR.
5
+ *
6
+ * This extractor uses Mistral OCR API to perform OCR on document files,
7
+ * particularly useful for scanned documents or image-based files
8
+ * that cannot be processed by standard text extraction methods.
9
+ */
10
+ export declare class LLMOCRExtractor implements IDocumentExtractor {
11
+ canExtract(fileType: string): boolean;
12
+ extractText(file: File, options?: DocumentExtractionOptions): Promise<string>;
13
+ private blobToBase64;
14
+ private getMimeType;
15
+ }
16
+ //# sourceMappingURL=llm-ocr-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-ocr-extractor.d.ts","sourceRoot":"","sources":["../../src/extractors/llm-ocr-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAKpG;;;;;;GAMG;AACH,qBAAa,eAAgB,YAAW,kBAAkB;IACtD,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI/B,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE,yBAA8B,GAAG,OAAO,CAAC,MAAM,CAAC;YA6EzE,YAAY;IAa1B,OAAO,CAAC,WAAW;CAWtB"}
@@ -0,0 +1,7 @@
1
+ import { File } from '@eclipse-lyra/core';
2
+ import { IDocumentExtractor, DocumentExtractionOptions } from './document-extractor-interface';
3
+ export declare class PDFJSExtractor implements IDocumentExtractor {
4
+ canExtract(fileType: string): boolean;
5
+ extractText(file: File, options?: DocumentExtractionOptions): Promise<string>;
6
+ }
7
+ //# sourceMappingURL=pdfjs-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdfjs-extractor.d.ts","sourceRoot":"","sources":["../../src/extractors/pdfjs-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAIpG,qBAAa,cAAe,YAAW,kBAAkB;IACrD,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI/B,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE,yBAA8B,GAAG,OAAO,CAAC,MAAM,CAAC;CAsD1F"}
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ "namespace": "extensions",
3
+ "en": {
4
+ "EXT_RAG_SYSTEM_NAME": "RAG System",
5
+ "EXT_RAG_SYSTEM_DESC": "Retrieval-Augmented Generation system for document indexing, search and retrieval"
6
+ },
7
+ "de": {
8
+ "EXT_RAG_SYSTEM_NAME": "RAG-System",
9
+ "EXT_RAG_SYSTEM_DESC": "Retrieval-Augmented Generation System für Dokumentenindizierung, Suche und Abruf"
10
+ }
11
+ };
12
+
13
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ import { contributionRegistry, SYSTEM_LANGUAGE_BUNDLES, i18nLazy, extensionRegistry } from "@eclipse-lyra/core";
2
+ import pkg from "../package.json";
3
+ const namespace = "extensions";
4
+ const en = { "EXT_RAG_SYSTEM_NAME": "RAG System", "EXT_RAG_SYSTEM_DESC": "Retrieval-Augmented Generation system for document indexing, search and retrieval" };
5
+ const de = { "EXT_RAG_SYSTEM_NAME": "RAG-System", "EXT_RAG_SYSTEM_DESC": "Retrieval-Augmented Generation System für Dokumentenindizierung, Suche und Abruf" };
6
+ const bundle = {
7
+ namespace,
8
+ en,
9
+ de
10
+ };
11
+ contributionRegistry.registerContribution(SYSTEM_LANGUAGE_BUNDLES, bundle);
12
+ const t = i18nLazy("extensions");
13
+ extensionRegistry.registerExtension({
14
+ id: pkg.name,
15
+ name: t("EXT_RAG_SYSTEM_NAME"),
16
+ description: t("EXT_RAG_SYSTEM_DESC"),
17
+ loader: () => import("./rag-system-extension-DfD6H8Vr.js"),
18
+ icon: "database",
19
+ experimental: true,
20
+ dependencies: ["@eclipse-lyra/extension-ai-system", "@eclipse-lyra/extension-in-browser-ml"]
21
+ });
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { extensionRegistry, i18nLazy, contributionRegistry, SYSTEM_LANGUAGE_BUNDLES } from '@eclipse-lyra/core';\nimport bundle from './i18n.json';\nimport pkg from '../package.json';\n\ncontributionRegistry.registerContribution(SYSTEM_LANGUAGE_BUNDLES, bundle as any);\n\nconst t = i18nLazy('extensions');\n\nextensionRegistry.registerExtension({\n id: pkg.name,\n name: t('EXT_RAG_SYSTEM_NAME'),\n description: t('EXT_RAG_SYSTEM_DESC'),\n loader: () => import(\"./rag-system-extension\"),\n icon: \"database\",\n experimental: true,\n dependencies: [\"@eclipse-lyra/extension-ai-system\", \"@eclipse-lyra/extension-in-browser-ml\"],\n});\n"],"names":[],"mappings":";;;;;;;;;;AAIA,qBAAqB,qBAAqB,yBAAyB,MAAa;AAEhF,MAAM,IAAI,SAAS,YAAY;AAE/B,kBAAkB,kBAAkB;AAAA,EAClC,IAAI,IAAI;AAAA,EACR,MAAM,EAAE,qBAAqB;AAAA,EAC7B,aAAa,EAAE,qBAAqB;AAAA,EACpC,QAAQ,MAAM,OAAO,oCAAwB;AAAA,EAC7C,MAAM;AAAA,EACN,cAAc;AAAA,EACd,cAAc,CAAC,qCAAqC,uCAAuC;AAC7F,CAAC;"}