@framers/agentos 0.1.124 → 0.1.126
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/api/AgentOS.d.ts.map +1 -1
- package/dist/api/AgentOS.js +142 -0
- package/dist/api/AgentOS.js.map +1 -1
- package/dist/core/provenance/crypto/AgentKeyManager.d.ts.map +1 -1
- package/dist/core/provenance/crypto/AgentKeyManager.js +9 -3
- package/dist/core/provenance/crypto/AgentKeyManager.js.map +1 -1
- package/dist/core/text-processing/ITextProcessor.d.ts +43 -0
- package/dist/core/text-processing/ITextProcessor.d.ts.map +1 -0
- package/dist/core/text-processing/ITextProcessor.js +6 -0
- package/dist/core/text-processing/ITextProcessor.js.map +1 -0
- package/dist/core/text-processing/TextProcessingPipeline.d.ts +49 -0
- package/dist/core/text-processing/TextProcessingPipeline.d.ts.map +1 -0
- package/dist/core/text-processing/TextProcessingPipeline.js +61 -0
- package/dist/core/text-processing/TextProcessingPipeline.js.map +1 -0
- package/dist/core/text-processing/filters/StopWordFilter.d.ts +30 -0
- package/dist/core/text-processing/filters/StopWordFilter.d.ts.map +1 -0
- package/dist/core/text-processing/filters/StopWordFilter.js +76 -0
- package/dist/core/text-processing/filters/StopWordFilter.js.map +1 -0
- package/dist/core/text-processing/index.d.ts +20 -0
- package/dist/core/text-processing/index.d.ts.map +1 -0
- package/dist/core/text-processing/index.js +24 -0
- package/dist/core/text-processing/index.js.map +1 -0
- package/dist/core/text-processing/lemmatizers/NoOpLemmatizer.d.ts +11 -0
- package/dist/core/text-processing/lemmatizers/NoOpLemmatizer.d.ts.map +1 -0
- package/dist/core/text-processing/lemmatizers/NoOpLemmatizer.js +13 -0
- package/dist/core/text-processing/lemmatizers/NoOpLemmatizer.js.map +1 -0
- package/dist/core/text-processing/lemmatizers/WordNetLemmatizer.d.ts +25 -0
- package/dist/core/text-processing/lemmatizers/WordNetLemmatizer.d.ts.map +1 -0
- package/dist/core/text-processing/lemmatizers/WordNetLemmatizer.js +64 -0
- package/dist/core/text-processing/lemmatizers/WordNetLemmatizer.js.map +1 -0
- package/dist/core/text-processing/normalizers/AccentStripper.d.ts +17 -0
- package/dist/core/text-processing/normalizers/AccentStripper.d.ts.map +1 -0
- package/dist/core/text-processing/normalizers/AccentStripper.js +22 -0
- package/dist/core/text-processing/normalizers/AccentStripper.js.map +1 -0
- package/dist/core/text-processing/normalizers/LowercaseNormalizer.d.ts +11 -0
- package/dist/core/text-processing/normalizers/LowercaseNormalizer.d.ts.map +1 -0
- package/dist/core/text-processing/normalizers/LowercaseNormalizer.js +13 -0
- package/dist/core/text-processing/normalizers/LowercaseNormalizer.js.map +1 -0
- package/dist/core/text-processing/presets.d.ts +22 -0
- package/dist/core/text-processing/presets.d.ts.map +1 -0
- package/dist/core/text-processing/presets.js +45 -0
- package/dist/core/text-processing/presets.js.map +1 -0
- package/dist/core/text-processing/stemmers/NoOpStemmer.d.ts +14 -0
- package/dist/core/text-processing/stemmers/NoOpStemmer.d.ts.map +1 -0
- package/dist/core/text-processing/stemmers/NoOpStemmer.js +16 -0
- package/dist/core/text-processing/stemmers/NoOpStemmer.js.map +1 -0
- package/dist/core/text-processing/stemmers/PorterStemmer.d.ts +31 -0
- package/dist/core/text-processing/stemmers/PorterStemmer.d.ts.map +1 -0
- package/dist/core/text-processing/stemmers/PorterStemmer.js +62 -0
- package/dist/core/text-processing/stemmers/PorterStemmer.js.map +1 -0
- package/dist/core/text-processing/tokenizers/CodeTokenizer.d.ts +25 -0
- package/dist/core/text-processing/tokenizers/CodeTokenizer.d.ts.map +1 -0
- package/dist/core/text-processing/tokenizers/CodeTokenizer.js +75 -0
- package/dist/core/text-processing/tokenizers/CodeTokenizer.js.map +1 -0
- package/dist/core/text-processing/tokenizers/StandardTokenizer.d.ts +22 -0
- package/dist/core/text-processing/tokenizers/StandardTokenizer.d.ts.map +1 -0
- package/dist/core/text-processing/tokenizers/StandardTokenizer.js +37 -0
- package/dist/core/text-processing/tokenizers/StandardTokenizer.js.map +1 -0
- package/dist/core/text-processing/types.d.ts +18 -0
- package/dist/core/text-processing/types.d.ts.map +1 -0
- package/dist/core/text-processing/types.js +6 -0
- package/dist/core/text-processing/types.js.map +1 -0
- package/dist/core/tools/IToolOrchestrator.d.ts +6 -0
- package/dist/core/tools/IToolOrchestrator.d.ts.map +1 -1
- package/dist/core/tools/ToolOrchestrator.d.ts +10 -0
- package/dist/core/tools/ToolOrchestrator.d.ts.map +1 -1
- package/dist/core/tools/ToolOrchestrator.js +25 -0
- package/dist/core/tools/ToolOrchestrator.js.map +1 -1
- package/dist/core/vector-search/HnswIndexSidecar.d.ts +91 -0
- package/dist/core/vector-search/HnswIndexSidecar.d.ts.map +1 -0
- package/dist/core/vector-search/HnswIndexSidecar.js +270 -0
- package/dist/core/vector-search/HnswIndexSidecar.js.map +1 -0
- package/dist/core/vector-search/index.d.ts +7 -0
- package/dist/core/vector-search/index.d.ts.map +1 -0
- package/dist/core/vector-search/index.js +6 -0
- package/dist/core/vector-search/index.js.map +1 -0
- package/dist/core/vector-search/types.d.ts +42 -0
- package/dist/core/vector-search/types.d.ts.map +1 -0
- package/dist/core/vector-search/types.js +6 -0
- package/dist/core/vector-search/types.js.map +1 -0
- package/dist/memory/CognitiveMemoryManager.js +3 -3
- package/dist/memory/CognitiveMemoryManager.js.map +1 -1
- package/dist/memory/consolidation/ConsolidationLoop.js +3 -3
- package/dist/memory/consolidation/ConsolidationLoop.js.map +1 -1
- package/dist/memory/facade/Memory.d.ts +21 -0
- package/dist/memory/facade/Memory.d.ts.map +1 -1
- package/dist/memory/facade/Memory.js +124 -62
- package/dist/memory/facade/Memory.js.map +1 -1
- package/dist/memory/io/ChatGptImporter.d.ts.map +1 -1
- package/dist/memory/io/ChatGptImporter.js +7 -6
- package/dist/memory/io/ChatGptImporter.js.map +1 -1
- package/dist/memory/io/CsvImporter.d.ts +15 -0
- package/dist/memory/io/CsvImporter.d.ts.map +1 -1
- package/dist/memory/io/CsvImporter.js +28 -7
- package/dist/memory/io/CsvImporter.js.map +1 -1
- package/dist/memory/io/JsonExporter.d.ts +14 -0
- package/dist/memory/io/JsonExporter.d.ts.map +1 -1
- package/dist/memory/io/JsonExporter.js +22 -3
- package/dist/memory/io/JsonExporter.js.map +1 -1
- package/dist/memory/io/JsonImporter.d.ts +15 -0
- package/dist/memory/io/JsonImporter.d.ts.map +1 -1
- package/dist/memory/io/JsonImporter.js +35 -16
- package/dist/memory/io/JsonImporter.js.map +1 -1
- package/dist/memory/io/MarkdownImporter.d.ts.map +1 -1
- package/dist/memory/io/MarkdownImporter.js +7 -5
- package/dist/memory/io/MarkdownImporter.js.map +1 -1
- package/dist/memory/io/ObsidianImporter.d.ts.map +1 -1
- package/dist/memory/io/ObsidianImporter.js +9 -23
- package/dist/memory/io/ObsidianImporter.js.map +1 -1
- package/dist/memory/io/SqliteExporter.d.ts.map +1 -1
- package/dist/memory/io/SqliteExporter.js +1 -3
- package/dist/memory/io/SqliteExporter.js.map +1 -1
- package/dist/memory/io/SqliteImporter.d.ts.map +1 -1
- package/dist/memory/io/SqliteImporter.js +10 -11
- package/dist/memory/io/SqliteImporter.js.map +1 -1
- package/dist/memory/store/HnswSidecar.d.ts +7 -0
- package/dist/memory/store/HnswSidecar.d.ts.map +1 -1
- package/dist/memory/store/HnswSidecar.js +7 -0
- package/dist/memory/store/HnswSidecar.js.map +1 -1
- package/dist/memory/store/SqliteBrain.d.ts +14 -2
- package/dist/memory/store/SqliteBrain.d.ts.map +1 -1
- package/dist/memory/store/SqliteBrain.js +37 -34
- package/dist/memory/store/SqliteBrain.js.map +1 -1
- package/dist/memory/store/SqliteKnowledgeGraph.d.ts.map +1 -1
- package/dist/memory/store/SqliteKnowledgeGraph.js +12 -55
- package/dist/memory/store/SqliteKnowledgeGraph.js.map +1 -1
- package/dist/memory/store/SqliteMemoryGraph.d.ts.map +1 -1
- package/dist/memory/store/SqliteMemoryGraph.js +11 -16
- package/dist/memory/store/SqliteMemoryGraph.js.map +1 -1
- package/dist/memory/store/tracePersistence.d.ts +1 -1
- package/dist/memory/store/tracePersistence.d.ts.map +1 -1
- package/dist/memory/store/tracePersistence.js +3 -3
- package/dist/memory/store/tracePersistence.js.map +1 -1
- package/dist/memory/tools/MemoryAddTool.d.ts.map +1 -1
- package/dist/memory/tools/MemoryAddTool.js +2 -7
- package/dist/memory/tools/MemoryAddTool.js.map +1 -1
- package/dist/memory/tools/MemoryMergeTool.d.ts.map +1 -1
- package/dist/memory/tools/MemoryMergeTool.js +2 -3
- package/dist/memory/tools/MemoryMergeTool.js.map +1 -1
- package/dist/memory/tools/MemorySearchTool.d.ts.map +1 -1
- package/dist/memory/tools/MemorySearchTool.js +6 -5
- package/dist/memory/tools/MemorySearchTool.js.map +1 -1
- package/dist/memory/tools/MemoryUpdateTool.d.ts.map +1 -1
- package/dist/memory/tools/MemoryUpdateTool.js +2 -3
- package/dist/memory/tools/MemoryUpdateTool.js.map +1 -1
- package/dist/memory/util/crossPlatformCrypto.d.ts +31 -0
- package/dist/memory/util/crossPlatformCrypto.d.ts.map +1 -0
- package/dist/memory/util/crossPlatformCrypto.js +60 -0
- package/dist/memory/util/crossPlatformCrypto.js.map +1 -0
- package/dist/rag/VectorStoreManager.d.ts.map +1 -1
- package/dist/rag/VectorStoreManager.js +4 -2
- package/dist/rag/VectorStoreManager.js.map +1 -1
- package/dist/rag/implementations/vector_stores/HnswlibVectorStore.d.ts +6 -0
- package/dist/rag/implementations/vector_stores/HnswlibVectorStore.d.ts.map +1 -1
- package/dist/rag/implementations/vector_stores/HnswlibVectorStore.js +9 -0
- package/dist/rag/implementations/vector_stores/HnswlibVectorStore.js.map +1 -1
- package/dist/rag/implementations/vector_stores/SqlVectorStore.d.ts +23 -0
- package/dist/rag/implementations/vector_stores/SqlVectorStore.d.ts.map +1 -1
- package/dist/rag/implementations/vector_stores/SqlVectorStore.js +109 -5
- package/dist/rag/implementations/vector_stores/SqlVectorStore.js.map +1 -1
- package/dist/rag/search/BM25Index.d.ts +13 -0
- package/dist/rag/search/BM25Index.d.ts.map +1 -1
- package/dist/rag/search/BM25Index.js +14 -20
- package/dist/rag/search/BM25Index.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Configurable text processing pipeline.
|
|
3
|
+
* Chains a tokenizer + N processors to produce processed tokens from raw text.
|
|
4
|
+
*
|
|
5
|
+
* @module agentos/core/text-processing/TextProcessingPipeline
|
|
6
|
+
*/
|
|
7
|
+
import type { Token } from './types';
|
|
8
|
+
import type { ITextProcessor, ITokenizer } from './ITextProcessor';
|
|
9
|
+
/**
|
|
10
|
+
* Orchestrates a chain of text processors: tokenizer → processors → output.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const pipeline = new TextProcessingPipeline(new StandardTokenizer())
|
|
14
|
+
* .add(new LowercaseNormalizer())
|
|
15
|
+
* .add(new StopWordFilter(ENGLISH_STOP_WORDS))
|
|
16
|
+
* .add(new PorterStemmer());
|
|
17
|
+
*
|
|
18
|
+
* const tokens = pipeline.process('The quick brown foxes are running');
|
|
19
|
+
* // tokens[0].text === 'quick', tokens[0].stem === 'quick'
|
|
20
|
+
* // tokens[1].text === 'brown', ...
|
|
21
|
+
*/
|
|
22
|
+
export declare class TextProcessingPipeline {
|
|
23
|
+
private tokenizer;
|
|
24
|
+
private processors;
|
|
25
|
+
/**
|
|
26
|
+
* @param tokenizer — the first stage that splits raw text into tokens
|
|
27
|
+
*/
|
|
28
|
+
constructor(tokenizer: ITokenizer);
|
|
29
|
+
/** Add a processing stage to the pipeline. Returns `this` for chaining. */
|
|
30
|
+
add(processor: ITextProcessor): this;
|
|
31
|
+
/**
|
|
32
|
+
* Process raw text through the full pipeline.
|
|
33
|
+
*
|
|
34
|
+
* @param text — raw input text
|
|
35
|
+
* @returns array of processed tokens with position and linguistic annotations
|
|
36
|
+
*/
|
|
37
|
+
process(text: string): Token[];
|
|
38
|
+
/**
|
|
39
|
+
* Convenience: process text and return just the token strings.
|
|
40
|
+
* Useful for BM25 indexing and FTS where only the text values are needed.
|
|
41
|
+
*
|
|
42
|
+
* @param text — raw input text
|
|
43
|
+
* @returns array of processed token strings
|
|
44
|
+
*/
|
|
45
|
+
processToStrings(text: string): string[];
|
|
46
|
+
/** Get the names of all stages for debugging. */
|
|
47
|
+
getStageNames(): string[];
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=TextProcessingPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextProcessingPipeline.d.ts","sourceRoot":"","sources":["../../../src/core/text-processing/TextProcessingPipeline.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,UAAU,CAAwB;IAE1C;;OAEG;gBACS,SAAS,EAAE,UAAU;IAIjC,2EAA2E;IAC3E,GAAG,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI;IAKpC;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,EAAE;IAU9B;;;;;;OAMG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAIxC,iDAAiD;IACjD,aAAa,IAAI,MAAM,EAAE;CAG1B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Configurable text processing pipeline.
|
|
3
|
+
* Chains a tokenizer + N processors to produce processed tokens from raw text.
|
|
4
|
+
*
|
|
5
|
+
* @module agentos/core/text-processing/TextProcessingPipeline
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Orchestrates a chain of text processors: tokenizer → processors → output.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const pipeline = new TextProcessingPipeline(new StandardTokenizer())
|
|
12
|
+
* .add(new LowercaseNormalizer())
|
|
13
|
+
* .add(new StopWordFilter(ENGLISH_STOP_WORDS))
|
|
14
|
+
* .add(new PorterStemmer());
|
|
15
|
+
*
|
|
16
|
+
* const tokens = pipeline.process('The quick brown foxes are running');
|
|
17
|
+
* // tokens[0].text === 'quick', tokens[0].stem === 'quick'
|
|
18
|
+
* // tokens[1].text === 'brown', ...
|
|
19
|
+
*/
|
|
20
|
+
export class TextProcessingPipeline {
|
|
21
|
+
/**
|
|
22
|
+
* @param tokenizer — the first stage that splits raw text into tokens
|
|
23
|
+
*/
|
|
24
|
+
constructor(tokenizer) {
|
|
25
|
+
this.processors = [];
|
|
26
|
+
this.tokenizer = tokenizer;
|
|
27
|
+
}
|
|
28
|
+
/** Add a processing stage to the pipeline. Returns `this` for chaining. */
|
|
29
|
+
add(processor) {
|
|
30
|
+
this.processors.push(processor);
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Process raw text through the full pipeline.
|
|
35
|
+
*
|
|
36
|
+
* @param text — raw input text
|
|
37
|
+
* @returns array of processed tokens with position and linguistic annotations
|
|
38
|
+
*/
|
|
39
|
+
process(text) {
|
|
40
|
+
let tokens = this.tokenizer.tokenize(text);
|
|
41
|
+
for (const processor of this.processors) {
|
|
42
|
+
tokens = processor.process(tokens);
|
|
43
|
+
}
|
|
44
|
+
return tokens;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Convenience: process text and return just the token strings.
|
|
48
|
+
* Useful for BM25 indexing and FTS where only the text values are needed.
|
|
49
|
+
*
|
|
50
|
+
* @param text — raw input text
|
|
51
|
+
* @returns array of processed token strings
|
|
52
|
+
*/
|
|
53
|
+
processToStrings(text) {
|
|
54
|
+
return this.process(text).map(t => t.text);
|
|
55
|
+
}
|
|
56
|
+
/** Get the names of all stages for debugging. */
|
|
57
|
+
getStageNames() {
|
|
58
|
+
return [this.tokenizer.name, ...this.processors.map(p => p.name)];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=TextProcessingPipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextProcessingPipeline.js","sourceRoot":"","sources":["../../../src/core/text-processing/TextProcessingPipeline.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,sBAAsB;IAIjC;;OAEG;IACH,YAAY,SAAqB;QALzB,eAAU,GAAqB,EAAE,CAAC;QAMxC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,2EAA2E;IAC3E,GAAG,CAAC,SAAyB;QAC3B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,IAAY;QAClB,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAE3C,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACxC,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,IAAY;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,iDAAiD;IACjD,aAAa;QACX,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Removes tokens that match a configurable stop word list.
|
|
3
|
+
* @module agentos/core/text-processing/filters/StopWordFilter
|
|
4
|
+
*/
|
|
5
|
+
import type { Token } from '../types';
|
|
6
|
+
import type { ITextProcessor } from '../ITextProcessor';
|
|
7
|
+
/** ~120 common English stop words. */
|
|
8
|
+
export declare const ENGLISH_STOP_WORDS: ReadonlySet<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Stop words for code search. These are noise in code but NOT programming keywords.
|
|
11
|
+
* Note: `class`, `function`, `import`, `const`, `let`, `var`, `return`, `this`
|
|
12
|
+
* are deliberately NOT in this list — they're meaningful in code search.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CODE_STOP_WORDS: ReadonlySet<string>;
|
|
15
|
+
export declare function getNaturalStopWords(): ReadonlySet<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Filters tokens whose `.text` appears in the provided stop word set.
|
|
18
|
+
* Case-sensitive — apply after LowercaseNormalizer for case-insensitive filtering.
|
|
19
|
+
*/
|
|
20
|
+
export declare class StopWordFilter implements ITextProcessor {
|
|
21
|
+
readonly name = "StopWordFilter";
|
|
22
|
+
private stopWords;
|
|
23
|
+
/**
|
|
24
|
+
* @param stopWords — stop word set to filter against. Defaults to `natural`'s
|
|
25
|
+
* 170-word list when available, falls back to the built-in 120-word ENGLISH_STOP_WORDS.
|
|
26
|
+
*/
|
|
27
|
+
constructor(stopWords?: ReadonlySet<string>);
|
|
28
|
+
process(tokens: Token[]): Token[];
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=StopWordFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StopWordFilter.d.ts","sourceRoot":"","sources":["../../../../src/core/text-processing/filters/StopWordFilter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,sCAAsC;AACtC,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAejD,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAW9C,CAAC;AAOH,wBAAgB,mBAAmB,IAAI,WAAW,CAAC,MAAM,CAAC,CAYzD;AAED;;;GAGG;AACH,qBAAa,cAAe,YAAW,cAAc;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IACjC,OAAO,CAAC,SAAS,CAAsB;IAEvC;;;OAGG;gBACS,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAI3C,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;CAGlC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Removes tokens that match a configurable stop word list.
|
|
3
|
+
* @module agentos/core/text-processing/filters/StopWordFilter
|
|
4
|
+
*/
|
|
5
|
+
/** ~120 common English stop words. */
|
|
6
|
+
export const ENGLISH_STOP_WORDS = new Set([
|
|
7
|
+
'a', 'about', 'above', 'after', 'again', 'against', 'all', 'am', 'an', 'and',
|
|
8
|
+
'any', 'are', 'as', 'at', 'be', 'because', 'been', 'before', 'being', 'below',
|
|
9
|
+
'between', 'both', 'but', 'by', 'can', 'could', 'did', 'do', 'does', 'doing',
|
|
10
|
+
'down', 'during', 'each', 'few', 'for', 'from', 'further', 'get', 'got', 'had',
|
|
11
|
+
'has', 'have', 'having', 'he', 'her', 'here', 'hers', 'herself', 'him',
|
|
12
|
+
'himself', 'his', 'how', 'if', 'in', 'into', 'is', 'it', 'its', 'itself',
|
|
13
|
+
'just', 'me', 'might', 'more', 'most', 'must', 'my', 'myself', 'no', 'nor',
|
|
14
|
+
'not', 'now', 'of', 'off', 'on', 'once', 'only', 'or', 'other', 'our', 'ours',
|
|
15
|
+
'ourselves', 'out', 'over', 'own', 'same', 'she', 'should', 'so', 'some',
|
|
16
|
+
'such', 'than', 'that', 'the', 'their', 'theirs', 'them', 'themselves', 'then',
|
|
17
|
+
'there', 'these', 'they', 'this', 'those', 'through', 'to', 'too', 'under',
|
|
18
|
+
'until', 'up', 'very', 'was', 'we', 'were', 'what', 'when', 'where', 'which',
|
|
19
|
+
'while', 'who', 'whom', 'why', 'will', 'with', 'would', 'you', 'your', 'yours',
|
|
20
|
+
'yourself', 'yourselves',
|
|
21
|
+
]);
|
|
22
|
+
/**
|
|
23
|
+
* Stop words for code search. These are noise in code but NOT programming keywords.
|
|
24
|
+
* Note: `class`, `function`, `import`, `const`, `let`, `var`, `return`, `this`
|
|
25
|
+
* are deliberately NOT in this list — they're meaningful in code search.
|
|
26
|
+
*/
|
|
27
|
+
export const CODE_STOP_WORDS = new Set([
|
|
28
|
+
'a', 'an', 'the', 'is', 'are', 'was', 'were', 'be', 'been', 'being',
|
|
29
|
+
'have', 'has', 'had', 'do', 'does', 'did', 'will', 'would', 'could',
|
|
30
|
+
'should', 'may', 'might', 'can', 'shall', 'to', 'of', 'in', 'for',
|
|
31
|
+
'on', 'with', 'at', 'by', 'from', 'as', 'into', 'through', 'during',
|
|
32
|
+
'before', 'after', 'above', 'below', 'between', 'out', 'off', 'over',
|
|
33
|
+
'under', 'again', 'further', 'then', 'once', 'here', 'there', 'when',
|
|
34
|
+
'where', 'why', 'how', 'all', 'each', 'every', 'both', 'few', 'more',
|
|
35
|
+
'most', 'other', 'some', 'such', 'no', 'nor', 'not', 'only', 'own',
|
|
36
|
+
'same', 'so', 'than', 'too', 'very', 'just', 'because', 'but', 'and',
|
|
37
|
+
'or', 'if', 'while', 'about', 'up', 'out', 'also', 'it', 'its',
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* Extended stop word list from the `natural` NLP library (170 words).
|
|
41
|
+
* Loaded lazily — falls back to ENGLISH_STOP_WORDS if natural is unavailable.
|
|
42
|
+
*/
|
|
43
|
+
let _naturalStopWords = null;
|
|
44
|
+
export function getNaturalStopWords() {
|
|
45
|
+
if (_naturalStopWords)
|
|
46
|
+
return _naturalStopWords;
|
|
47
|
+
try {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
49
|
+
const natural = require('natural');
|
|
50
|
+
if (natural.stopwords && Array.isArray(natural.stopwords)) {
|
|
51
|
+
_naturalStopWords = new Set(natural.stopwords);
|
|
52
|
+
return _naturalStopWords;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch { /* natural not installed */ }
|
|
56
|
+
_naturalStopWords = ENGLISH_STOP_WORDS;
|
|
57
|
+
return _naturalStopWords;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Filters tokens whose `.text` appears in the provided stop word set.
|
|
61
|
+
* Case-sensitive — apply after LowercaseNormalizer for case-insensitive filtering.
|
|
62
|
+
*/
|
|
63
|
+
export class StopWordFilter {
|
|
64
|
+
/**
|
|
65
|
+
* @param stopWords — stop word set to filter against. Defaults to `natural`'s
|
|
66
|
+
* 170-word list when available, falls back to the built-in 120-word ENGLISH_STOP_WORDS.
|
|
67
|
+
*/
|
|
68
|
+
constructor(stopWords) {
|
|
69
|
+
this.name = 'StopWordFilter';
|
|
70
|
+
this.stopWords = stopWords ?? getNaturalStopWords();
|
|
71
|
+
}
|
|
72
|
+
process(tokens) {
|
|
73
|
+
return tokens.filter(t => !this.stopWords.has(t.text));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=StopWordFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StopWordFilter.js","sourceRoot":"","sources":["../../../../src/core/text-processing/filters/StopWordFilter.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pluggable text processing pipeline for AgentOS.
|
|
3
|
+
* Feeds into BM25 keyword search, FTS5, and embedding generation.
|
|
4
|
+
*
|
|
5
|
+
* @module agentos/core/text-processing
|
|
6
|
+
*/
|
|
7
|
+
export { TextProcessingPipeline } from './TextProcessingPipeline';
|
|
8
|
+
export type { ITextProcessor, ITokenizer } from './ITextProcessor';
|
|
9
|
+
export type { Token } from './types';
|
|
10
|
+
export { StandardTokenizer } from './tokenizers/StandardTokenizer';
|
|
11
|
+
export { CodeTokenizer } from './tokenizers/CodeTokenizer';
|
|
12
|
+
export { LowercaseNormalizer } from './normalizers/LowercaseNormalizer';
|
|
13
|
+
export { AccentStripper } from './normalizers/AccentStripper';
|
|
14
|
+
export { StopWordFilter, ENGLISH_STOP_WORDS, CODE_STOP_WORDS, getNaturalStopWords } from './filters/StopWordFilter';
|
|
15
|
+
export { PorterStemmer } from './stemmers/PorterStemmer';
|
|
16
|
+
export { NoOpStemmer } from './stemmers/NoOpStemmer';
|
|
17
|
+
export { WordNetLemmatizer } from './lemmatizers/WordNetLemmatizer';
|
|
18
|
+
export { NoOpLemmatizer } from './lemmatizers/NoOpLemmatizer';
|
|
19
|
+
export { createProsePipeline, createCodePipeline, createRagPipeline } from './presets';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/text-processing/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnE,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpH,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pluggable text processing pipeline for AgentOS.
|
|
3
|
+
* Feeds into BM25 keyword search, FTS5, and embedding generation.
|
|
4
|
+
*
|
|
5
|
+
* @module agentos/core/text-processing
|
|
6
|
+
*/
|
|
7
|
+
export { TextProcessingPipeline } from './TextProcessingPipeline.js';
|
|
8
|
+
// Tokenizers
|
|
9
|
+
export { StandardTokenizer } from './tokenizers/StandardTokenizer.js';
|
|
10
|
+
export { CodeTokenizer } from './tokenizers/CodeTokenizer.js';
|
|
11
|
+
// Normalizers
|
|
12
|
+
export { LowercaseNormalizer } from './normalizers/LowercaseNormalizer.js';
|
|
13
|
+
export { AccentStripper } from './normalizers/AccentStripper.js';
|
|
14
|
+
// Filters
|
|
15
|
+
export { StopWordFilter, ENGLISH_STOP_WORDS, CODE_STOP_WORDS, getNaturalStopWords } from './filters/StopWordFilter.js';
|
|
16
|
+
// Stemmers
|
|
17
|
+
export { PorterStemmer } from './stemmers/PorterStemmer.js';
|
|
18
|
+
export { NoOpStemmer } from './stemmers/NoOpStemmer.js';
|
|
19
|
+
// Lemmatizers
|
|
20
|
+
export { WordNetLemmatizer } from './lemmatizers/WordNetLemmatizer.js';
|
|
21
|
+
export { NoOpLemmatizer } from './lemmatizers/NoOpLemmatizer.js';
|
|
22
|
+
// Presets
|
|
23
|
+
export { createProsePipeline, createCodePipeline, createRagPipeline } from './presets.js';
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/text-processing/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,cAAc;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,UAAU;AACV,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpH,WAAW;AACX,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,cAAc;AACd,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,UAAU;AACV,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pass-through lemmatizer that does nothing.
|
|
3
|
+
* @module agentos/core/text-processing/lemmatizers/NoOpLemmatizer
|
|
4
|
+
*/
|
|
5
|
+
import type { Token } from '../types';
|
|
6
|
+
import type { ITextProcessor } from '../ITextProcessor';
|
|
7
|
+
export declare class NoOpLemmatizer implements ITextProcessor {
|
|
8
|
+
readonly name = "NoOpLemmatizer";
|
|
9
|
+
process(tokens: Token[]): Token[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=NoOpLemmatizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoOpLemmatizer.d.ts","sourceRoot":"","sources":["../../../../src/core/text-processing/lemmatizers/NoOpLemmatizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,qBAAa,cAAe,YAAW,cAAc;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IAEjC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;CAGlC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pass-through lemmatizer that does nothing.
|
|
3
|
+
* @module agentos/core/text-processing/lemmatizers/NoOpLemmatizer
|
|
4
|
+
*/
|
|
5
|
+
export class NoOpLemmatizer {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.name = 'NoOpLemmatizer';
|
|
8
|
+
}
|
|
9
|
+
process(tokens) {
|
|
10
|
+
return tokens;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=NoOpLemmatizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoOpLemmatizer.js","sourceRoot":"","sources":["../../../../src/core/text-processing/lemmatizers/NoOpLemmatizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,OAAO,cAAc;IAA3B;QACW,SAAI,GAAG,gBAAgB,CAAC;IAKnC,CAAC;IAHC,OAAO,CAAC,MAAe;QACrB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview WordNet lemmatizer wrapping the `natural` package.
|
|
3
|
+
* Falls back to no-op if `natural` is not installed.
|
|
4
|
+
*
|
|
5
|
+
* Lemmatization produces the dictionary form of a word:
|
|
6
|
+
* `ran` → `run`, `better` → `good`, `mice` → `mouse`.
|
|
7
|
+
*
|
|
8
|
+
* @module agentos/core/text-processing/lemmatizers/WordNetLemmatizer
|
|
9
|
+
*/
|
|
10
|
+
import type { Token } from '../types';
|
|
11
|
+
import type { ITextProcessor } from '../ITextProcessor';
|
|
12
|
+
/**
|
|
13
|
+
* WordNet-based lemmatizer. Reduces words to their dictionary (lemma) form.
|
|
14
|
+
*
|
|
15
|
+
* Sets `token.lemma` and updates `token.text` to the lemmatized form.
|
|
16
|
+
* Falls back to Lancaster stemming if full WordNet lookup is unavailable.
|
|
17
|
+
*/
|
|
18
|
+
export declare class WordNetLemmatizer implements ITextProcessor {
|
|
19
|
+
readonly name = "WordNetLemmatizer";
|
|
20
|
+
private initialized;
|
|
21
|
+
private ensureLoaded;
|
|
22
|
+
process(tokens: Token[]): Token[];
|
|
23
|
+
initialize(): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=WordNetLemmatizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WordNetLemmatizer.d.ts","sourceRoot":"","sources":["../../../../src/core/text-processing/lemmatizers/WordNetLemmatizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA0BxD;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IACtD,QAAQ,CAAC,IAAI,uBAAuB;IAEpC,OAAO,CAAC,WAAW,CAAS;YAEd,YAAY;IAO1B,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;IAS3B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGlC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview WordNet lemmatizer wrapping the `natural` package.
|
|
3
|
+
* Falls back to no-op if `natural` is not installed.
|
|
4
|
+
*
|
|
5
|
+
* Lemmatization produces the dictionary form of a word:
|
|
6
|
+
* `ran` → `run`, `better` → `good`, `mice` → `mouse`.
|
|
7
|
+
*
|
|
8
|
+
* @module agentos/core/text-processing/lemmatizers/WordNetLemmatizer
|
|
9
|
+
*/
|
|
10
|
+
/** Lazy-loaded lemmatize function from the `natural` package. */
|
|
11
|
+
let lemmatizeFn = null;
|
|
12
|
+
let loadAttempted = false;
|
|
13
|
+
async function loadLemmatizer() {
|
|
14
|
+
if (loadAttempted)
|
|
15
|
+
return;
|
|
16
|
+
loadAttempted = true;
|
|
17
|
+
try {
|
|
18
|
+
const natural = await import('natural');
|
|
19
|
+
const wordnet = new natural.WordNet();
|
|
20
|
+
lemmatizeFn = (word) => {
|
|
21
|
+
/* WordNet lookup is async in natural, but we need sync for the pipeline.
|
|
22
|
+
Use the synchronous stemmer-based lemmatizer as a practical fallback. */
|
|
23
|
+
try {
|
|
24
|
+
return natural.LancasterStemmer.stem(word);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return word;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
lemmatizeFn = null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* WordNet-based lemmatizer. Reduces words to their dictionary (lemma) form.
|
|
37
|
+
*
|
|
38
|
+
* Sets `token.lemma` and updates `token.text` to the lemmatized form.
|
|
39
|
+
* Falls back to Lancaster stemming if full WordNet lookup is unavailable.
|
|
40
|
+
*/
|
|
41
|
+
export class WordNetLemmatizer {
|
|
42
|
+
constructor() {
|
|
43
|
+
this.name = 'WordNetLemmatizer';
|
|
44
|
+
this.initialized = false;
|
|
45
|
+
}
|
|
46
|
+
async ensureLoaded() {
|
|
47
|
+
if (!this.initialized) {
|
|
48
|
+
await loadLemmatizer();
|
|
49
|
+
this.initialized = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
process(tokens) {
|
|
53
|
+
if (!lemmatizeFn)
|
|
54
|
+
return tokens;
|
|
55
|
+
return tokens.map(t => {
|
|
56
|
+
const lemma = lemmatizeFn(t.text);
|
|
57
|
+
return { ...t, text: lemma, lemma };
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async initialize() {
|
|
61
|
+
await this.ensureLoaded();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=WordNetLemmatizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WordNetLemmatizer.js","sourceRoot":"","sources":["../../../../src/core/text-processing/lemmatizers/WordNetLemmatizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,iEAAiE;AACjE,IAAI,WAAW,GAAsC,IAAI,CAAC;AAC1D,IAAI,aAAa,GAAG,KAAK,CAAC;AAE1B,KAAK,UAAU,cAAc;IAC3B,IAAI,aAAa;QAAE,OAAO;IAC1B,aAAa,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;QACxC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACtC,WAAW,GAAG,CAAC,IAAY,EAAE,EAAE;YAC7B;uFAC2E;YAC3E,IAAI,CAAC;gBACH,OAAO,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7C,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,WAAW,GAAG,IAAI,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QACW,SAAI,GAAG,mBAAmB,CAAC;QAE5B,gBAAW,GAAG,KAAK,CAAC;IAqB9B,CAAC;IAnBS,KAAK,CAAC,YAAY;QACxB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,MAAM,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,CAAC,MAAe;QACrB,IAAI,CAAC,WAAW;YAAE,OAAO,MAAM,CAAC;QAEhC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YACpB,MAAM,KAAK,GAAG,WAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACnC,OAAO,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Strips diacritics/accents from token text.
|
|
3
|
+
* `café` → `cafe`, `naïve` → `naive`.
|
|
4
|
+
*
|
|
5
|
+
* @module agentos/core/text-processing/normalizers/AccentStripper
|
|
6
|
+
*/
|
|
7
|
+
import type { Token } from '../types';
|
|
8
|
+
import type { ITextProcessor } from '../ITextProcessor';
|
|
9
|
+
/**
|
|
10
|
+
* Removes combining diacritical marks after Unicode NFD decomposition.
|
|
11
|
+
* This makes accent-insensitive search possible.
|
|
12
|
+
*/
|
|
13
|
+
export declare class AccentStripper implements ITextProcessor {
|
|
14
|
+
readonly name = "AccentStripper";
|
|
15
|
+
process(tokens: Token[]): Token[];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=AccentStripper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccentStripper.d.ts","sourceRoot":"","sources":["../../../../src/core/text-processing/normalizers/AccentStripper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;GAGG;AACH,qBAAa,cAAe,YAAW,cAAc;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IAEjC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;CAMlC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Strips diacritics/accents from token text.
|
|
3
|
+
* `café` → `cafe`, `naïve` → `naive`.
|
|
4
|
+
*
|
|
5
|
+
* @module agentos/core/text-processing/normalizers/AccentStripper
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Removes combining diacritical marks after Unicode NFD decomposition.
|
|
9
|
+
* This makes accent-insensitive search possible.
|
|
10
|
+
*/
|
|
11
|
+
export class AccentStripper {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.name = 'AccentStripper';
|
|
14
|
+
}
|
|
15
|
+
process(tokens) {
|
|
16
|
+
return tokens.map(t => ({
|
|
17
|
+
...t,
|
|
18
|
+
text: t.text.normalize('NFD').replace(/[\u0300-\u036f]/g, ''),
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=AccentStripper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccentStripper.js","sourceRoot":"","sources":["../../../../src/core/text-processing/normalizers/AccentStripper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;GAGG;AACH,MAAM,OAAO,cAAc;IAA3B;QACW,SAAI,GAAG,gBAAgB,CAAC;IAQnC,CAAC;IANC,OAAO,CAAC,MAAe;QACrB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACtB,GAAG,CAAC;YACJ,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;SAC9D,CAAC,CAAC,CAAC;IACN,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Lowercases all token text. Preserves original.
|
|
3
|
+
* @module agentos/core/text-processing/normalizers/LowercaseNormalizer
|
|
4
|
+
*/
|
|
5
|
+
import type { Token } from '../types';
|
|
6
|
+
import type { ITextProcessor } from '../ITextProcessor';
|
|
7
|
+
export declare class LowercaseNormalizer implements ITextProcessor {
|
|
8
|
+
readonly name = "LowercaseNormalizer";
|
|
9
|
+
process(tokens: Token[]): Token[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=LowercaseNormalizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LowercaseNormalizer.d.ts","sourceRoot":"","sources":["../../../../src/core/text-processing/normalizers/LowercaseNormalizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,qBAAa,mBAAoB,YAAW,cAAc;IACxD,QAAQ,CAAC,IAAI,yBAAyB;IAEtC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;CAGlC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Lowercases all token text. Preserves original.
|
|
3
|
+
* @module agentos/core/text-processing/normalizers/LowercaseNormalizer
|
|
4
|
+
*/
|
|
5
|
+
export class LowercaseNormalizer {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.name = 'LowercaseNormalizer';
|
|
8
|
+
}
|
|
9
|
+
process(tokens) {
|
|
10
|
+
return tokens.map(t => ({ ...t, text: t.text.toLowerCase() }));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=LowercaseNormalizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LowercaseNormalizer.js","sourceRoot":"","sources":["../../../../src/core/text-processing/normalizers/LowercaseNormalizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,OAAO,mBAAmB;IAAhC;QACW,SAAI,GAAG,qBAAqB,CAAC;IAKxC,CAAC;IAHC,OAAO,CAAC,MAAe;QACrB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pre-built pipeline configurations for common use cases.
|
|
3
|
+
* @module agentos/core/text-processing/presets
|
|
4
|
+
*/
|
|
5
|
+
import { TextProcessingPipeline } from './TextProcessingPipeline';
|
|
6
|
+
/**
|
|
7
|
+
* Pipeline for English prose text.
|
|
8
|
+
* Standard tokenizer → lowercase → strip accents → remove stop words → Porter stem.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createProsePipeline(): TextProcessingPipeline;
|
|
11
|
+
/**
|
|
12
|
+
* Pipeline for source code and technical identifiers.
|
|
13
|
+
* Code tokenizer (camelCase/snake_case split) → lowercase → code stop words → no stemming.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createCodePipeline(): TextProcessingPipeline;
|
|
16
|
+
/**
|
|
17
|
+
* Default pipeline for RAG / hybrid search.
|
|
18
|
+
* Standard tokenizer → lowercase → remove stop words → Porter stem.
|
|
19
|
+
* Good balance of recall and precision for mixed-content corpora.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createRagPipeline(): TextProcessingPipeline;
|
|
22
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/core/text-processing/presets.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AASlE;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,sBAAsB,CAM5D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,sBAAsB,CAK3D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,sBAAsB,CAK1D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pre-built pipeline configurations for common use cases.
|
|
3
|
+
* @module agentos/core/text-processing/presets
|
|
4
|
+
*/
|
|
5
|
+
import { TextProcessingPipeline } from './TextProcessingPipeline.js';
|
|
6
|
+
import { StandardTokenizer } from './tokenizers/StandardTokenizer.js';
|
|
7
|
+
import { CodeTokenizer } from './tokenizers/CodeTokenizer.js';
|
|
8
|
+
import { LowercaseNormalizer } from './normalizers/LowercaseNormalizer.js';
|
|
9
|
+
import { AccentStripper } from './normalizers/AccentStripper.js';
|
|
10
|
+
import { StopWordFilter, CODE_STOP_WORDS } from './filters/StopWordFilter.js';
|
|
11
|
+
import { PorterStemmer } from './stemmers/PorterStemmer.js';
|
|
12
|
+
import { NoOpStemmer } from './stemmers/NoOpStemmer.js';
|
|
13
|
+
/**
|
|
14
|
+
* Pipeline for English prose text.
|
|
15
|
+
* Standard tokenizer → lowercase → strip accents → remove stop words → Porter stem.
|
|
16
|
+
*/
|
|
17
|
+
export function createProsePipeline() {
|
|
18
|
+
return new TextProcessingPipeline(new StandardTokenizer())
|
|
19
|
+
.add(new LowercaseNormalizer())
|
|
20
|
+
.add(new AccentStripper())
|
|
21
|
+
.add(new StopWordFilter()) /* default: getNaturalStopWords() → 170 words when natural available */
|
|
22
|
+
.add(new PorterStemmer());
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Pipeline for source code and technical identifiers.
|
|
26
|
+
* Code tokenizer (camelCase/snake_case split) → lowercase → code stop words → no stemming.
|
|
27
|
+
*/
|
|
28
|
+
export function createCodePipeline() {
|
|
29
|
+
return new TextProcessingPipeline(new CodeTokenizer())
|
|
30
|
+
.add(new LowercaseNormalizer())
|
|
31
|
+
.add(new StopWordFilter(CODE_STOP_WORDS))
|
|
32
|
+
.add(new NoOpStemmer());
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Default pipeline for RAG / hybrid search.
|
|
36
|
+
* Standard tokenizer → lowercase → remove stop words → Porter stem.
|
|
37
|
+
* Good balance of recall and precision for mixed-content corpora.
|
|
38
|
+
*/
|
|
39
|
+
export function createRagPipeline() {
|
|
40
|
+
return new TextProcessingPipeline(new StandardTokenizer())
|
|
41
|
+
.add(new LowercaseNormalizer())
|
|
42
|
+
.add(new StopWordFilter()) /* default: getNaturalStopWords() → 170 words when natural available */
|
|
43
|
+
.add(new PorterStemmer());
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../src/core/text-processing/presets.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,sBAAsB,CAAC,IAAI,iBAAiB,EAAE,CAAC;SACvD,GAAG,CAAC,IAAI,mBAAmB,EAAE,CAAC;SAC9B,GAAG,CAAC,IAAI,cAAc,EAAE,CAAC;SACzB,GAAG,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC,uEAAuE;SACjG,GAAG,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,sBAAsB,CAAC,IAAI,aAAa,EAAE,CAAC;SACnD,GAAG,CAAC,IAAI,mBAAmB,EAAE,CAAC;SAC9B,GAAG,CAAC,IAAI,cAAc,CAAC,eAAe,CAAC,CAAC;SACxC,GAAG,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,sBAAsB,CAAC,IAAI,iBAAiB,EAAE,CAAC;SACvD,GAAG,CAAC,IAAI,mBAAmB,EAAE,CAAC;SAC9B,GAAG,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC,uEAAuE;SACjG,GAAG,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pass-through stemmer that does nothing.
|
|
3
|
+
* Use for code identifiers where stemming would be harmful
|
|
4
|
+
* (e.g. `kubernetes` → `kubernet` is wrong).
|
|
5
|
+
*
|
|
6
|
+
* @module agentos/core/text-processing/stemmers/NoOpStemmer
|
|
7
|
+
*/
|
|
8
|
+
import type { Token } from '../types';
|
|
9
|
+
import type { ITextProcessor } from '../ITextProcessor';
|
|
10
|
+
export declare class NoOpStemmer implements ITextProcessor {
|
|
11
|
+
readonly name = "NoOpStemmer";
|
|
12
|
+
process(tokens: Token[]): Token[];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=NoOpStemmer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoOpStemmer.d.ts","sourceRoot":"","sources":["../../../../src/core/text-processing/stemmers/NoOpStemmer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,qBAAa,WAAY,YAAW,cAAc;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAE9B,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;CAGlC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pass-through stemmer that does nothing.
|
|
3
|
+
* Use for code identifiers where stemming would be harmful
|
|
4
|
+
* (e.g. `kubernetes` → `kubernet` is wrong).
|
|
5
|
+
*
|
|
6
|
+
* @module agentos/core/text-processing/stemmers/NoOpStemmer
|
|
7
|
+
*/
|
|
8
|
+
export class NoOpStemmer {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.name = 'NoOpStemmer';
|
|
11
|
+
}
|
|
12
|
+
process(tokens) {
|
|
13
|
+
return tokens;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=NoOpStemmer.js.map
|