rag-lite-ts 1.0.1
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/LICENSE +21 -0
- package/README.md +240 -0
- package/dist/api-errors.d.ts +90 -0
- package/dist/api-errors.d.ts.map +1 -0
- package/dist/api-errors.js +320 -0
- package/dist/api-errors.js.map +1 -0
- package/dist/chunker.d.ts +47 -0
- package/dist/chunker.d.ts.map +1 -0
- package/dist/chunker.js +256 -0
- package/dist/chunker.js.map +1 -0
- package/dist/cli/indexer.d.ts +11 -0
- package/dist/cli/indexer.d.ts.map +1 -0
- package/dist/cli/indexer.js +272 -0
- package/dist/cli/indexer.js.map +1 -0
- package/dist/cli/search.d.ts +7 -0
- package/dist/cli/search.d.ts.map +1 -0
- package/dist/cli/search.js +206 -0
- package/dist/cli/search.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +362 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +90 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +281 -0
- package/dist/config.js.map +1 -0
- package/dist/db.d.ts +90 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +340 -0
- package/dist/db.js.map +1 -0
- package/dist/embedder.d.ts +101 -0
- package/dist/embedder.d.ts.map +1 -0
- package/dist/embedder.js +323 -0
- package/dist/embedder.js.map +1 -0
- package/dist/error-handler.d.ts +91 -0
- package/dist/error-handler.d.ts.map +1 -0
- package/dist/error-handler.js +196 -0
- package/dist/error-handler.js.map +1 -0
- package/dist/file-processor.d.ts +59 -0
- package/dist/file-processor.d.ts.map +1 -0
- package/dist/file-processor.js +312 -0
- package/dist/file-processor.js.map +1 -0
- package/dist/index-manager.d.ts +99 -0
- package/dist/index-manager.d.ts.map +1 -0
- package/dist/index-manager.js +444 -0
- package/dist/index-manager.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer.d.ts +7 -0
- package/dist/indexer.d.ts.map +1 -0
- package/dist/indexer.js +51 -0
- package/dist/indexer.js.map +1 -0
- package/dist/ingestion.d.ts +175 -0
- package/dist/ingestion.d.ts.map +1 -0
- package/dist/ingestion.js +705 -0
- package/dist/ingestion.js.map +1 -0
- package/dist/mcp-server.d.ts +14 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +680 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/path-manager.d.ts +42 -0
- package/dist/path-manager.d.ts.map +1 -0
- package/dist/path-manager.js +66 -0
- package/dist/path-manager.js.map +1 -0
- package/dist/preprocess.d.ts +19 -0
- package/dist/preprocess.d.ts.map +1 -0
- package/dist/preprocess.js +203 -0
- package/dist/preprocess.js.map +1 -0
- package/dist/preprocessors/index.d.ts +17 -0
- package/dist/preprocessors/index.d.ts.map +1 -0
- package/dist/preprocessors/index.js +38 -0
- package/dist/preprocessors/index.js.map +1 -0
- package/dist/preprocessors/mdx.d.ts +25 -0
- package/dist/preprocessors/mdx.d.ts.map +1 -0
- package/dist/preprocessors/mdx.js +101 -0
- package/dist/preprocessors/mdx.js.map +1 -0
- package/dist/preprocessors/mermaid.d.ts +68 -0
- package/dist/preprocessors/mermaid.d.ts.map +1 -0
- package/dist/preprocessors/mermaid.js +329 -0
- package/dist/preprocessors/mermaid.js.map +1 -0
- package/dist/preprocessors/registry.d.ts +56 -0
- package/dist/preprocessors/registry.d.ts.map +1 -0
- package/dist/preprocessors/registry.js +179 -0
- package/dist/preprocessors/registry.js.map +1 -0
- package/dist/reranker.d.ts +40 -0
- package/dist/reranker.d.ts.map +1 -0
- package/dist/reranker.js +212 -0
- package/dist/reranker.js.map +1 -0
- package/dist/resource-manager-demo.d.ts +7 -0
- package/dist/resource-manager-demo.d.ts.map +1 -0
- package/dist/resource-manager-demo.js +52 -0
- package/dist/resource-manager-demo.js.map +1 -0
- package/dist/resource-manager.d.ts +129 -0
- package/dist/resource-manager.d.ts.map +1 -0
- package/dist/resource-manager.js +389 -0
- package/dist/resource-manager.js.map +1 -0
- package/dist/search-standalone.d.ts +7 -0
- package/dist/search-standalone.d.ts.map +1 -0
- package/dist/search-standalone.js +117 -0
- package/dist/search-standalone.js.map +1 -0
- package/dist/search.d.ts +92 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +454 -0
- package/dist/search.js.map +1 -0
- package/dist/test-utils.d.ts +36 -0
- package/dist/test-utils.d.ts.map +1 -0
- package/dist/test-utils.js +27 -0
- package/dist/test-utils.js.map +1 -0
- package/dist/tokenizer.d.ts +21 -0
- package/dist/tokenizer.d.ts.map +1 -0
- package/dist/tokenizer.js +59 -0
- package/dist/tokenizer.js.map +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/vector-index.d.ts +64 -0
- package/dist/vector-index.d.ts.map +1 -0
- package/dist/vector-index.js +308 -0
- package/dist/vector-index.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Preprocessor, PreprocessorOptions } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Mermaid preprocessor for handling Mermaid diagrams in Markdown files
|
|
4
|
+
* Supports strip, extract, and placeholder modes
|
|
5
|
+
*/
|
|
6
|
+
export declare class MermaidPreprocessor implements Preprocessor {
|
|
7
|
+
/**
|
|
8
|
+
* Check if this preprocessor applies to the given language/content type
|
|
9
|
+
* Applies to mermaid code blocks and content with Mermaid syntax
|
|
10
|
+
*/
|
|
11
|
+
appliesTo(language: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Process Mermaid content based on the specified mode
|
|
14
|
+
*/
|
|
15
|
+
process(content: string, options: PreprocessorOptions): string;
|
|
16
|
+
/**
|
|
17
|
+
* Strip Mermaid diagrams entirely
|
|
18
|
+
*/
|
|
19
|
+
private stripMermaid;
|
|
20
|
+
/**
|
|
21
|
+
* Replace Mermaid diagrams with descriptive placeholders
|
|
22
|
+
*/
|
|
23
|
+
private replaceWithPlaceholders;
|
|
24
|
+
/**
|
|
25
|
+
* Extract semantic information from Mermaid diagrams
|
|
26
|
+
* Converts diagram edges to plain text while ignoring styling and layout instructions
|
|
27
|
+
*/
|
|
28
|
+
private extractMermaidEdges;
|
|
29
|
+
/**
|
|
30
|
+
* Extract edges and relationships from a Mermaid diagram
|
|
31
|
+
* Ignores styling, layout, and formatting instructions
|
|
32
|
+
*/
|
|
33
|
+
private extractEdgesFromDiagram;
|
|
34
|
+
/**
|
|
35
|
+
* Build a mapping of node IDs to their labels by scanning all lines
|
|
36
|
+
*/
|
|
37
|
+
private buildNodeLabelMap;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a line is a layout instruction (should be ignored)
|
|
40
|
+
*/
|
|
41
|
+
private isLayoutInstruction;
|
|
42
|
+
/**
|
|
43
|
+
* Check if a line is a styling instruction (should be ignored)
|
|
44
|
+
*/
|
|
45
|
+
private isStyleInstruction;
|
|
46
|
+
/**
|
|
47
|
+
* Extract the meaningful label from a node definition
|
|
48
|
+
* Examples: A[Start] -> "Start", B{Decision} -> "Decision", C((End)) -> "End", D -> "D"
|
|
49
|
+
*/
|
|
50
|
+
private extractNodeLabel;
|
|
51
|
+
/**
|
|
52
|
+
* Extract edge information from a single line
|
|
53
|
+
*/
|
|
54
|
+
private extractEdgeFromLine;
|
|
55
|
+
/**
|
|
56
|
+
* Interpret flowchart connector symbols
|
|
57
|
+
*/
|
|
58
|
+
private interpretConnector;
|
|
59
|
+
/**
|
|
60
|
+
* Interpret class diagram connector symbols
|
|
61
|
+
*/
|
|
62
|
+
private interpretClassConnector;
|
|
63
|
+
/**
|
|
64
|
+
* Interpret ER diagram connector symbols
|
|
65
|
+
*/
|
|
66
|
+
private interpretERConnector;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=mermaid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../../src/preprocessors/mermaid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGhE;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IACtD;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIpC;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM;IAmB9D;;OAEG;IACH,OAAO,CAAC,YAAY;IAiBpB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAY/B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IA8C/B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmBzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAa3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAqCxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAsF3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAQ1B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAc/B;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAS7B"}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { ContentTypeDetector } from './registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Mermaid preprocessor for handling Mermaid diagrams in Markdown files
|
|
4
|
+
* Supports strip, extract, and placeholder modes
|
|
5
|
+
*/
|
|
6
|
+
export class MermaidPreprocessor {
|
|
7
|
+
/**
|
|
8
|
+
* Check if this preprocessor applies to the given language/content type
|
|
9
|
+
* Applies to mermaid code blocks and content with Mermaid syntax
|
|
10
|
+
*/
|
|
11
|
+
appliesTo(language) {
|
|
12
|
+
return language === 'mermaid';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Process Mermaid content based on the specified mode
|
|
16
|
+
*/
|
|
17
|
+
process(content, options) {
|
|
18
|
+
// Only process if content actually contains Mermaid diagrams
|
|
19
|
+
if (!ContentTypeDetector.hasMermaidContent(content)) {
|
|
20
|
+
return content;
|
|
21
|
+
}
|
|
22
|
+
switch (options.mode) {
|
|
23
|
+
case 'strip':
|
|
24
|
+
return this.stripMermaid(content);
|
|
25
|
+
case 'extract':
|
|
26
|
+
return this.extractMermaidEdges(content);
|
|
27
|
+
case 'placeholder':
|
|
28
|
+
return this.replaceWithPlaceholders(content);
|
|
29
|
+
default:
|
|
30
|
+
console.log(`Unknown Mermaid processing mode: ${options.mode}, using placeholder`);
|
|
31
|
+
return this.replaceWithPlaceholders(content);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Strip Mermaid diagrams entirely
|
|
36
|
+
*/
|
|
37
|
+
stripMermaid(content) {
|
|
38
|
+
let cleaned = content;
|
|
39
|
+
// Remove mermaid code blocks: ```mermaid ... ```
|
|
40
|
+
cleaned = cleaned.replace(/```mermaid[\s\S]*?```/gi, '');
|
|
41
|
+
// Clean up multiple consecutive newlines and trim
|
|
42
|
+
cleaned = cleaned.replace(/\n\s*\n\s*\n/g, '\n\n').trim();
|
|
43
|
+
// Ensure we never return empty content (requirement 6.4)
|
|
44
|
+
if (!cleaned.trim()) {
|
|
45
|
+
return '[content removed]';
|
|
46
|
+
}
|
|
47
|
+
return cleaned;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Replace Mermaid diagrams with descriptive placeholders
|
|
51
|
+
*/
|
|
52
|
+
replaceWithPlaceholders(content) {
|
|
53
|
+
let cleaned = content;
|
|
54
|
+
// Replace mermaid code blocks with placeholder
|
|
55
|
+
cleaned = cleaned.replace(/```mermaid[\s\S]*?```/gi, '[diagram removed]');
|
|
56
|
+
// Clean up multiple consecutive newlines and trim
|
|
57
|
+
cleaned = cleaned.replace(/\n\s*\n\s*\n/g, '\n\n').trim();
|
|
58
|
+
return cleaned;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Extract semantic information from Mermaid diagrams
|
|
62
|
+
* Converts diagram edges to plain text while ignoring styling and layout instructions
|
|
63
|
+
*/
|
|
64
|
+
extractMermaidEdges(content) {
|
|
65
|
+
let processed = content;
|
|
66
|
+
// Process each mermaid code block
|
|
67
|
+
processed = processed.replace(/```mermaid([\s\S]*?)```/gi, (match, diagramContent) => {
|
|
68
|
+
const edges = this.extractEdgesFromDiagram(diagramContent);
|
|
69
|
+
return edges.length > 0 ? edges.join('\n') : '[diagram content extracted]';
|
|
70
|
+
});
|
|
71
|
+
return processed;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Extract edges and relationships from a Mermaid diagram
|
|
75
|
+
* Ignores styling, layout, and formatting instructions
|
|
76
|
+
*/
|
|
77
|
+
extractEdgesFromDiagram(diagramContent) {
|
|
78
|
+
const edges = [];
|
|
79
|
+
const lines = diagramContent.split('\n');
|
|
80
|
+
// Detect diagram type from first non-empty line
|
|
81
|
+
let diagramType = 'flowchart'; // default
|
|
82
|
+
for (const line of lines) {
|
|
83
|
+
const trimmed = line.trim();
|
|
84
|
+
if (trimmed && !trimmed.startsWith('%')) {
|
|
85
|
+
if (trimmed.includes('sequenceDiagram'))
|
|
86
|
+
diagramType = 'sequence';
|
|
87
|
+
else if (trimmed.includes('classDiagram'))
|
|
88
|
+
diagramType = 'class';
|
|
89
|
+
else if (trimmed.includes('stateDiagram'))
|
|
90
|
+
diagramType = 'state';
|
|
91
|
+
else if (trimmed.includes('erDiagram'))
|
|
92
|
+
diagramType = 'er';
|
|
93
|
+
else if (trimmed.includes('graph') || trimmed.includes('flowchart'))
|
|
94
|
+
diagramType = 'flowchart';
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// For flowcharts, build a node label mapping first
|
|
99
|
+
const nodeLabelMap = new Map();
|
|
100
|
+
if (diagramType === 'flowchart') {
|
|
101
|
+
this.buildNodeLabelMap(lines, nodeLabelMap);
|
|
102
|
+
}
|
|
103
|
+
for (const line of lines) {
|
|
104
|
+
const trimmedLine = line.trim();
|
|
105
|
+
// Skip empty lines, comments, and diagram type declarations
|
|
106
|
+
if (!trimmedLine ||
|
|
107
|
+
trimmedLine.startsWith('%') ||
|
|
108
|
+
trimmedLine.startsWith('%%') ||
|
|
109
|
+
this.isLayoutInstruction(trimmedLine) ||
|
|
110
|
+
this.isStyleInstruction(trimmedLine)) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
// Extract edges from different diagram types
|
|
114
|
+
const edge = this.extractEdgeFromLine(trimmedLine, diagramType, nodeLabelMap);
|
|
115
|
+
if (edge) {
|
|
116
|
+
edges.push(edge);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return edges;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Build a mapping of node IDs to their labels by scanning all lines
|
|
123
|
+
*/
|
|
124
|
+
buildNodeLabelMap(lines, nodeLabelMap) {
|
|
125
|
+
for (const line of lines) {
|
|
126
|
+
const trimmedLine = line.trim();
|
|
127
|
+
if (!trimmedLine || trimmedLine.startsWith('%') || trimmedLine.startsWith('%%')) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
// Find all node definitions in the line (both source and target)
|
|
131
|
+
const nodeMatches = trimmedLine.matchAll(/(\w+)(?:\[([^\]]+)\]|\{([^}]+)\}|\(\(([^)]+)\)\)|\(([^)]+)\))/g);
|
|
132
|
+
for (const match of nodeMatches) {
|
|
133
|
+
const [, nodeId, squareLabel, curlyLabel, doubleParenLabel, parenLabel] = match;
|
|
134
|
+
const label = squareLabel || curlyLabel || doubleParenLabel || parenLabel;
|
|
135
|
+
if (label) {
|
|
136
|
+
nodeLabelMap.set(nodeId, label.trim());
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Check if a line is a layout instruction (should be ignored)
|
|
143
|
+
*/
|
|
144
|
+
isLayoutInstruction(line) {
|
|
145
|
+
const layoutPatterns = [
|
|
146
|
+
/^(graph|flowchart)\s+(TD|TB|BT|RL|LR)/i,
|
|
147
|
+
/^(sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt)/i,
|
|
148
|
+
/^pie\s+title/i,
|
|
149
|
+
/^direction\s+(TD|TB|BT|RL|LR)/i,
|
|
150
|
+
/^subgraph/i,
|
|
151
|
+
/^end$/i
|
|
152
|
+
];
|
|
153
|
+
return layoutPatterns.some(pattern => pattern.test(line));
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Check if a line is a styling instruction (should be ignored)
|
|
157
|
+
*/
|
|
158
|
+
isStyleInstruction(line) {
|
|
159
|
+
const stylePatterns = [
|
|
160
|
+
/^classDef\s+/i,
|
|
161
|
+
/^class\s+.*\s+\w+$/i,
|
|
162
|
+
/^style\s+/i,
|
|
163
|
+
/^fill:/i,
|
|
164
|
+
/^stroke:/i,
|
|
165
|
+
/^color:/i,
|
|
166
|
+
/:::.*$/, // CSS class assignments
|
|
167
|
+
/^linkStyle\s+/i,
|
|
168
|
+
/^click\s+/i
|
|
169
|
+
];
|
|
170
|
+
return stylePatterns.some(pattern => pattern.test(line));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Extract the meaningful label from a node definition
|
|
174
|
+
* Examples: A[Start] -> "Start", B{Decision} -> "Decision", C((End)) -> "End", D -> "D"
|
|
175
|
+
*/
|
|
176
|
+
extractNodeLabel(nodeText, nodeLabelMap) {
|
|
177
|
+
// Handle square brackets: A[Start]
|
|
178
|
+
const squareMatch = nodeText.match(/\w+\[([^\]]+)\]/);
|
|
179
|
+
if (squareMatch) {
|
|
180
|
+
return squareMatch[1].trim();
|
|
181
|
+
}
|
|
182
|
+
// Handle curly braces: B{Decision}
|
|
183
|
+
const curlyMatch = nodeText.match(/\w+\{([^}]+)\}/);
|
|
184
|
+
if (curlyMatch) {
|
|
185
|
+
return curlyMatch[1].trim();
|
|
186
|
+
}
|
|
187
|
+
// Handle double parentheses: C((End))
|
|
188
|
+
const doubleParenMatch = nodeText.match(/\w+\(\(([^)]+)\)\)/);
|
|
189
|
+
if (doubleParenMatch) {
|
|
190
|
+
return doubleParenMatch[1].trim();
|
|
191
|
+
}
|
|
192
|
+
// Handle single parentheses: D(Text)
|
|
193
|
+
const parenMatch = nodeText.match(/\w+\(([^)]+)\)/);
|
|
194
|
+
if (parenMatch) {
|
|
195
|
+
return parenMatch[1].trim();
|
|
196
|
+
}
|
|
197
|
+
// If no inline label found, check the node label map
|
|
198
|
+
const idMatch = nodeText.match(/(\w+)/);
|
|
199
|
+
const nodeId = idMatch ? idMatch[1] : nodeText;
|
|
200
|
+
if (nodeLabelMap && nodeLabelMap.has(nodeId)) {
|
|
201
|
+
return nodeLabelMap.get(nodeId);
|
|
202
|
+
}
|
|
203
|
+
// Return the node ID as fallback
|
|
204
|
+
return nodeId;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Extract edge information from a single line
|
|
208
|
+
*/
|
|
209
|
+
extractEdgeFromLine(line, diagramType = 'flowchart', nodeLabelMap) {
|
|
210
|
+
// Handle based on diagram type
|
|
211
|
+
if (diagramType === 'sequence') {
|
|
212
|
+
// Sequence diagram: A->>B: message or A-->>B: message
|
|
213
|
+
const sequenceMatch = line.match(/(\w+)\s*--?>>?\+?\s*(\w+)\s*:\s*(.+)/);
|
|
214
|
+
if (sequenceMatch) {
|
|
215
|
+
const [, from, to, message] = sequenceMatch;
|
|
216
|
+
return `${from} sends to ${to}: ${message.trim()}`;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (diagramType === 'class') {
|
|
220
|
+
// Class diagram inheritance: Animal --|> Dog
|
|
221
|
+
const inheritanceMatch = line.match(/(\w+)\s*--\|>\s*(\w+)/);
|
|
222
|
+
if (inheritanceMatch) {
|
|
223
|
+
const [, from, to] = inheritanceMatch;
|
|
224
|
+
return `${from} inherits from ${to}`;
|
|
225
|
+
}
|
|
226
|
+
// Class diagram other relationships
|
|
227
|
+
const classMatch = line.match(/(\w+)\s*(<\|--|--\||<\|--\|>|\*--|--\*|o--|--o)\s*(\w+)/);
|
|
228
|
+
if (classMatch) {
|
|
229
|
+
const [, from, connector, to] = classMatch;
|
|
230
|
+
const relationship = this.interpretClassConnector(connector);
|
|
231
|
+
return `${from} ${relationship} ${to}`;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (diagramType === 'er') {
|
|
235
|
+
// ER diagram: CUSTOMER ||--o{ ORDER
|
|
236
|
+
const erMatch = line.match(/(\w+)\s*(\|\|--o\{|\}o--\|\||\|\|--\|\||o\{--\|\|)\s*(\w+)/);
|
|
237
|
+
if (erMatch) {
|
|
238
|
+
const [, from, connector, to] = erMatch;
|
|
239
|
+
const relationship = this.interpretERConnector(connector);
|
|
240
|
+
return `${from} ${relationship} ${to}`;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (diagramType === 'state') {
|
|
244
|
+
// State diagram: state1 --> state2 (but not [*] --> state)
|
|
245
|
+
const stateMatch = line.match(/^(?!\s*\[\*\])\s*(\w+)\s*-->\s*(\w+)$/);
|
|
246
|
+
if (stateMatch) {
|
|
247
|
+
const [, from, to] = stateMatch;
|
|
248
|
+
return `${from} transitions to ${to}`;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (diagramType === 'flowchart') {
|
|
252
|
+
// Flowchart/Graph edges with labels: A --> B | label | (not A -->|label| B)
|
|
253
|
+
const flowchartLabelMatch = line.match(/(\w+(?:\[[^\]]+\]|\{[^}]+\}|\(\([^)]+\)\)|\([^)]+\))?)\s*(-->|---|-.->|-\.-|->|--)\s+(\w+(?:\[[^\]]+\]|\{[^}]+\}|\(\([^)]+\)\)|\([^)]+\))?)\s*\|\s*([^|]+)\s*\|/);
|
|
254
|
+
if (flowchartLabelMatch) {
|
|
255
|
+
const [, fromNode, connector, toNode, edgeLabel] = flowchartLabelMatch;
|
|
256
|
+
const from = this.extractNodeLabel(fromNode, nodeLabelMap);
|
|
257
|
+
const to = this.extractNodeLabel(toNode, nodeLabelMap);
|
|
258
|
+
const relationship = this.interpretConnector(connector);
|
|
259
|
+
return `${from} ${relationship} ${to} (${edgeLabel.trim()})`;
|
|
260
|
+
}
|
|
261
|
+
// Alternative label format: A -->|label| B (handle nodes with spaces in labels)
|
|
262
|
+
const flowchartLabelMatch2 = line.match(/(\w+(?:\[[^\]]+\]|\{[^}]+\}|\(\([^)]+\)\)|\([^)]+\))?)\s*(-->|---|-.->|-\.-|->|--)\|([^|]+)\|\s*(.+)/);
|
|
263
|
+
if (flowchartLabelMatch2) {
|
|
264
|
+
const [, fromNode, connector, edgeLabel, toNode] = flowchartLabelMatch2;
|
|
265
|
+
const from = this.extractNodeLabel(fromNode, nodeLabelMap);
|
|
266
|
+
const to = this.extractNodeLabel(toNode.trim(), nodeLabelMap);
|
|
267
|
+
const relationship = this.interpretConnector(connector);
|
|
268
|
+
return `${from} ${relationship} ${to} (${edgeLabel.trim()})`;
|
|
269
|
+
}
|
|
270
|
+
// Flowchart/Graph edges: A --> B, A --- B, A -.-> B, etc. (with optional node styling)
|
|
271
|
+
const flowchartEdgeMatch = line.match(/(\w+(?:\[[^\]]+\]|\{[^}]+\}|\(\([^)]+\)\)|\([^)]+\))?)\s*(-->|---|-.->|-\.-|->|--)\s*(.+)/);
|
|
272
|
+
if (flowchartEdgeMatch) {
|
|
273
|
+
const [, fromNode, connector, toNode] = flowchartEdgeMatch;
|
|
274
|
+
// Skip if this looks like a label format (contains |)
|
|
275
|
+
if (toNode.includes('|')) {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
const from = this.extractNodeLabel(fromNode, nodeLabelMap);
|
|
279
|
+
const to = this.extractNodeLabel(toNode.trim(), nodeLabelMap);
|
|
280
|
+
const relationship = this.interpretConnector(connector);
|
|
281
|
+
return `${from} ${relationship} ${to}`;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Interpret flowchart connector symbols
|
|
288
|
+
*/
|
|
289
|
+
interpretConnector(connector) {
|
|
290
|
+
if (connector.includes('-->'))
|
|
291
|
+
return 'leads to';
|
|
292
|
+
if (connector.includes('-.->'))
|
|
293
|
+
return 'optionally leads to';
|
|
294
|
+
if (connector.includes('---'))
|
|
295
|
+
return 'connects to';
|
|
296
|
+
if (connector.includes('-.-'))
|
|
297
|
+
return 'optionally connects to';
|
|
298
|
+
return 'relates to';
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Interpret class diagram connector symbols
|
|
302
|
+
*/
|
|
303
|
+
interpretClassConnector(connector) {
|
|
304
|
+
switch (connector) {
|
|
305
|
+
case '--|>': return 'inherits from';
|
|
306
|
+
case '<|--': return 'is inherited by';
|
|
307
|
+
case '--||': return 'implements';
|
|
308
|
+
case '<|--|>': return 'has bidirectional inheritance with';
|
|
309
|
+
case '*--': return 'composes';
|
|
310
|
+
case '--*': return 'is composed by';
|
|
311
|
+
case 'o--': return 'aggregates';
|
|
312
|
+
case '--o': return 'is aggregated by';
|
|
313
|
+
default: return 'relates to';
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Interpret ER diagram connector symbols
|
|
318
|
+
*/
|
|
319
|
+
interpretERConnector(connector) {
|
|
320
|
+
switch (connector) {
|
|
321
|
+
case '||--o{': return 'has one-to-many relationship with';
|
|
322
|
+
case '}o--||': return 'has many-to-one relationship with';
|
|
323
|
+
case '||--||': return 'has one-to-one relationship with';
|
|
324
|
+
case 'o{--||': return 'has many-to-one relationship with';
|
|
325
|
+
default: return 'has relationship with';
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=mermaid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merm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"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Preprocessor } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Registry for managing preprocessors and content type detection
|
|
4
|
+
*/
|
|
5
|
+
export declare class PreprocessorRegistry {
|
|
6
|
+
private preprocessors;
|
|
7
|
+
/**
|
|
8
|
+
* Register a preprocessor with a given name
|
|
9
|
+
*/
|
|
10
|
+
register(name: string, preprocessor: Preprocessor): void;
|
|
11
|
+
/**
|
|
12
|
+
* Get a specific preprocessor by name
|
|
13
|
+
*/
|
|
14
|
+
get(name: string): Preprocessor | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Get all preprocessors that apply to the given language/content type
|
|
17
|
+
*/
|
|
18
|
+
getApplicable(language: string): Preprocessor[];
|
|
19
|
+
/**
|
|
20
|
+
* Get all registered preprocessor names
|
|
21
|
+
*/
|
|
22
|
+
getRegisteredNames(): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Validate that all required preprocessors are available
|
|
25
|
+
*/
|
|
26
|
+
validatePreprocessors(requiredNames: string[]): {
|
|
27
|
+
valid: boolean;
|
|
28
|
+
missing: string[];
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Content type detection utilities
|
|
33
|
+
*/
|
|
34
|
+
export declare class ContentTypeDetector {
|
|
35
|
+
/**
|
|
36
|
+
* Detect content type from file extension
|
|
37
|
+
*/
|
|
38
|
+
static detectFromExtension(filePath: string): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Detect content type from code fence language identifier
|
|
41
|
+
*/
|
|
42
|
+
static detectFromCodeFence(language: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Detect JSX content in text
|
|
45
|
+
*/
|
|
46
|
+
static hasJsxContent(content: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Detect Mermaid diagram content
|
|
49
|
+
*/
|
|
50
|
+
static hasMermaidContent(content: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Extract code fence language from a code block
|
|
53
|
+
*/
|
|
54
|
+
static extractCodeFenceLanguage(codeBlock: string): string | null;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/preprocessors/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,aAAa,CAAwC;IAE7D;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;IAIxD;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAI3C;;OAEG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,EAAE;IAU/C;;OAEG;IACH,kBAAkB,IAAI,MAAM,EAAE;IAI9B;;OAEG;IACH,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;CAOtF;AAED;;GAEG;AACH,qBAAa,mBAAmB;IAC9B;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IA+D3D;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAsBpD;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAa9C;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAkBlD;;OAEG;IACH,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAIlE"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry for managing preprocessors and content type detection
|
|
3
|
+
*/
|
|
4
|
+
export class PreprocessorRegistry {
|
|
5
|
+
preprocessors = new Map();
|
|
6
|
+
/**
|
|
7
|
+
* Register a preprocessor with a given name
|
|
8
|
+
*/
|
|
9
|
+
register(name, preprocessor) {
|
|
10
|
+
this.preprocessors.set(name, preprocessor);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get a specific preprocessor by name
|
|
14
|
+
*/
|
|
15
|
+
get(name) {
|
|
16
|
+
return this.preprocessors.get(name);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get all preprocessors that apply to the given language/content type
|
|
20
|
+
*/
|
|
21
|
+
getApplicable(language) {
|
|
22
|
+
const applicable = [];
|
|
23
|
+
for (const preprocessor of this.preprocessors.values()) {
|
|
24
|
+
if (preprocessor.appliesTo(language)) {
|
|
25
|
+
applicable.push(preprocessor);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return applicable;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get all registered preprocessor names
|
|
32
|
+
*/
|
|
33
|
+
getRegisteredNames() {
|
|
34
|
+
return Array.from(this.preprocessors.keys());
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Validate that all required preprocessors are available
|
|
38
|
+
*/
|
|
39
|
+
validatePreprocessors(requiredNames) {
|
|
40
|
+
const missing = requiredNames.filter(name => !this.preprocessors.has(name));
|
|
41
|
+
return {
|
|
42
|
+
valid: missing.length === 0,
|
|
43
|
+
missing
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Content type detection utilities
|
|
49
|
+
*/
|
|
50
|
+
export class ContentTypeDetector {
|
|
51
|
+
/**
|
|
52
|
+
* Detect content type from file extension
|
|
53
|
+
*/
|
|
54
|
+
static detectFromExtension(filePath) {
|
|
55
|
+
const extension = filePath.toLowerCase().split('.').pop();
|
|
56
|
+
switch (extension) {
|
|
57
|
+
case 'mdx':
|
|
58
|
+
return 'mdx';
|
|
59
|
+
case 'md':
|
|
60
|
+
return 'markdown';
|
|
61
|
+
case 'js':
|
|
62
|
+
case 'jsx':
|
|
63
|
+
return 'javascript';
|
|
64
|
+
case 'ts':
|
|
65
|
+
case 'tsx':
|
|
66
|
+
return 'typescript';
|
|
67
|
+
case 'py':
|
|
68
|
+
return 'python';
|
|
69
|
+
case 'java':
|
|
70
|
+
return 'java';
|
|
71
|
+
case 'cpp':
|
|
72
|
+
case 'cc':
|
|
73
|
+
case 'cxx':
|
|
74
|
+
return 'cpp';
|
|
75
|
+
case 'c':
|
|
76
|
+
return 'c';
|
|
77
|
+
case 'cs':
|
|
78
|
+
return 'csharp';
|
|
79
|
+
case 'php':
|
|
80
|
+
return 'php';
|
|
81
|
+
case 'rb':
|
|
82
|
+
return 'ruby';
|
|
83
|
+
case 'go':
|
|
84
|
+
return 'go';
|
|
85
|
+
case 'rs':
|
|
86
|
+
return 'rust';
|
|
87
|
+
case 'swift':
|
|
88
|
+
return 'swift';
|
|
89
|
+
case 'kt':
|
|
90
|
+
return 'kotlin';
|
|
91
|
+
case 'scala':
|
|
92
|
+
return 'scala';
|
|
93
|
+
case 'sh':
|
|
94
|
+
case 'bash':
|
|
95
|
+
return 'bash';
|
|
96
|
+
case 'ps1':
|
|
97
|
+
return 'powershell';
|
|
98
|
+
case 'sql':
|
|
99
|
+
return 'sql';
|
|
100
|
+
case 'html':
|
|
101
|
+
return 'html';
|
|
102
|
+
case 'css':
|
|
103
|
+
return 'css';
|
|
104
|
+
case 'json':
|
|
105
|
+
return 'json';
|
|
106
|
+
case 'xml':
|
|
107
|
+
return 'xml';
|
|
108
|
+
case 'yaml':
|
|
109
|
+
case 'yml':
|
|
110
|
+
return 'yaml';
|
|
111
|
+
default:
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Detect content type from code fence language identifier
|
|
117
|
+
*/
|
|
118
|
+
static detectFromCodeFence(language) {
|
|
119
|
+
// Normalize language identifier
|
|
120
|
+
const normalized = language.toLowerCase().trim();
|
|
121
|
+
// Handle common aliases
|
|
122
|
+
switch (normalized) {
|
|
123
|
+
case 'js':
|
|
124
|
+
return 'javascript';
|
|
125
|
+
case 'ts':
|
|
126
|
+
return 'typescript';
|
|
127
|
+
case 'py':
|
|
128
|
+
return 'python';
|
|
129
|
+
case 'sh':
|
|
130
|
+
case 'shell':
|
|
131
|
+
return 'bash';
|
|
132
|
+
case 'yml':
|
|
133
|
+
return 'yaml';
|
|
134
|
+
default:
|
|
135
|
+
return normalized;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Detect JSX content in text
|
|
140
|
+
*/
|
|
141
|
+
static hasJsxContent(content) {
|
|
142
|
+
// Look for JSX patterns: <Component>, <div className=, etc.
|
|
143
|
+
const jsxPatterns = [
|
|
144
|
+
/<[A-Z][a-zA-Z0-9]*(?:\s[^>]*)?\/?>/, // Component tags
|
|
145
|
+
/<[a-z]+\s+className=/, // className attribute
|
|
146
|
+
/\{[^}]*\}/, // JSX expressions
|
|
147
|
+
/import\s+.*\s+from\s+['"][^'"]*['"]/, // ES6 imports
|
|
148
|
+
/export\s+(default\s+)?/ // ES6 exports
|
|
149
|
+
];
|
|
150
|
+
return jsxPatterns.some(pattern => pattern.test(content));
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Detect Mermaid diagram content
|
|
154
|
+
*/
|
|
155
|
+
static hasMermaidContent(content) {
|
|
156
|
+
// Look for mermaid code blocks or mermaid keywords
|
|
157
|
+
const mermaidPatterns = [
|
|
158
|
+
/```mermaid/i,
|
|
159
|
+
/graph\s+(TD|TB|BT|RL|LR)/i,
|
|
160
|
+
/flowchart\s+(TD|TB|BT|RL|LR)/i,
|
|
161
|
+
/sequenceDiagram/i,
|
|
162
|
+
/classDiagram/i,
|
|
163
|
+
/stateDiagram/i,
|
|
164
|
+
/erDiagram/i,
|
|
165
|
+
/journey/i,
|
|
166
|
+
/gantt/i,
|
|
167
|
+
/pie\s+title/i
|
|
168
|
+
];
|
|
169
|
+
return mermaidPatterns.some(pattern => pattern.test(content));
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Extract code fence language from a code block
|
|
173
|
+
*/
|
|
174
|
+
static extractCodeFenceLanguage(codeBlock) {
|
|
175
|
+
const match = codeBlock.match(/^```(\w+)/);
|
|
176
|
+
return match ? this.detectFromCodeFence(match[1]) : null;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/preprocessors/registry.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,oBAAoB;IACvB,aAAa,GAA8B,IAAI,GAAG,EAAE,CAAC;IAE7D;;OAEG;IACH,QAAQ,CAAC,IAAY,EAAE,YAA0B;QAC/C,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,QAAgB;QAC5B,MAAM,UAAU,GAAmB,EAAE,CAAC;QACtC,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC;YACvD,IAAI,YAAY,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACrC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,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