docstodev 1.0.0 → 1.0.2
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/ai/analyzer.d.ts.map +1 -1
- package/dist/ai/analyzer.js +2 -1
- package/dist/ai/analyzer.js.map +1 -1
- package/dist/analyzers/languageAnalyzer.d.ts +18 -0
- package/dist/analyzers/languageAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/languageAnalyzer.js +251 -0
- package/dist/analyzers/languageAnalyzer.js.map +1 -0
- package/dist/cache/cacheManager.d.ts +38 -0
- package/dist/cache/cacheManager.d.ts.map +1 -0
- package/dist/cache/cacheManager.js +141 -0
- package/dist/cache/cacheManager.js.map +1 -0
- package/dist/cli/index.js +279 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/run.d.ts +4 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +250 -66
- package/dist/commands/run.js.map +1 -1
- package/dist/exporters/html.d.ts +5 -1
- package/dist/exporters/html.d.ts.map +1 -1
- package/dist/exporters/html.js +477 -108
- package/dist/exporters/html.js.map +1 -1
- package/package.json +2 -2
- package/src/ai/analyzer.ts +3 -1
- package/src/analyzers/languageAnalyzer.ts +288 -0
- package/src/cache/cacheManager.ts +179 -0
- package/src/cli/index.ts +307 -23
- package/src/commands/run.ts +312 -75
- package/src/exporters/html.ts +521 -105
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/docs/docs-to-dev.md +0 -111
- package/docs/report.html +0 -90
- package/docs/report.pdf +0 -0
- package/docs/summary.md +0 -16
- package/src/index.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../src/ai/analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAC;AAEvB,wBAAsB,KAAK,CAAC,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../src/ai/analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAC;AAEvB,wBAAsB,KAAK,CAAC,gBAAgB,EAAE,MAAM,gBA2CnD"}
|
package/dist/ai/analyzer.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Emplacement absolu : M:\workspace\extensions\docstodev\src\ai\analyzer.ts
|
|
2
2
|
import "dotenv/config"; // Pour lire GROQ_API_KEY dans ton .env
|
|
3
3
|
export async function askAI(technicalContext) {
|
|
4
|
-
|
|
4
|
+
// clé par défaut gratuite
|
|
5
|
+
const GROQ_API_KEY = process.env.GROQ_API_KEY || "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";
|
|
5
6
|
if (!GROQ_API_KEY) {
|
|
6
7
|
return "⚠️ Erreur : Clé API Groq manquante dans le fichier .env";
|
|
7
8
|
}
|
package/dist/ai/analyzer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../../src/ai/analyzer.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,eAAe,CAAC,CAAC,uCAAuC;AAE/D,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,gBAAwB;
|
|
1
|
+
{"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../../src/ai/analyzer.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,eAAe,CAAC,CAAC,uCAAuC;AAE/D,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,gBAAwB;IAEhD,0BAA0B;IAC1B,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,0DAA0D,CAAC;IAE5G,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,OAAO,yDAAyD,CAAC;IACrE,CAAC;IAED,MAAM,YAAY,GAAG;;;;;;;;;CASxB,CAAC;IAEE,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,iDAAiD,EAAE;YACxE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACL,aAAa,EAAE,UAAU,YAAY,EAAE;gBACvC,cAAc,EAAE,kBAAkB;aACrC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACjB,KAAK,EAAE,yBAAyB;gBAChC,QAAQ,EAAE;oBACN,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE;oBACzC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,8CAA8C,gBAAgB,EAAE,EAAE;iBAC9F;gBACD,WAAW,EAAE,GAAG;aACnB,CAAC;SACL,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,IAAI,6CAA6C,CAAC;IAChG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACnC,OAAO,4DAA4D,CAAC;IACxE,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface LanguageAnalyzer {
|
|
2
|
+
extensions: string[];
|
|
3
|
+
analyzeFile(content: string): FileAnalysisResult;
|
|
4
|
+
}
|
|
5
|
+
export interface FileAnalysisResult {
|
|
6
|
+
functions: string[];
|
|
7
|
+
classes: string[];
|
|
8
|
+
types: string[];
|
|
9
|
+
imports: Array<{
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
usage?: string | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
exports: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare function getAnalyzer(filePath: string): LanguageAnalyzer | null;
|
|
17
|
+
export declare function getSupportedExtensions(): string[];
|
|
18
|
+
//# sourceMappingURL=languageAnalyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languageAnalyzer.d.ts","sourceRoot":"","sources":["../../src/analyzers/languageAnalyzer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CAAC;CAClD;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IAC3E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AA2QD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAKrE;AAED,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAEjD"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
// Analyseur TypeScript/JavaScript
|
|
2
|
+
class TSJSAnalyzer {
|
|
3
|
+
extensions = [".ts", ".js", ".tsx", ".jsx", ".mjs", ".cjs"];
|
|
4
|
+
analyzeFile(content) {
|
|
5
|
+
const exports = [];
|
|
6
|
+
const exportRegex = /export\s+(?:default\s+)?(?:async\s+)?(?:function|const|let|class|type|interface|enum)\s+([a-zA-Z0-9_]+)/g;
|
|
7
|
+
let match;
|
|
8
|
+
while ((match = exportRegex.exec(content)) !== null) {
|
|
9
|
+
if (match[1])
|
|
10
|
+
exports.push(match[1]);
|
|
11
|
+
}
|
|
12
|
+
const functions = [];
|
|
13
|
+
const funcRegex = /(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z0-9_]+)/g;
|
|
14
|
+
// Resetting regex because of global flag
|
|
15
|
+
funcRegex.lastIndex = 0;
|
|
16
|
+
while ((match = funcRegex.exec(content)) !== null) {
|
|
17
|
+
if (match[1])
|
|
18
|
+
functions.push(match[1]);
|
|
19
|
+
}
|
|
20
|
+
const arrowRegex = /(?:export\s+)?const\s+([a-zA-Z0-9_]+)\s*=\s*(?:async\s*)?\([^)]*\)\s*=>/g;
|
|
21
|
+
while ((match = arrowRegex.exec(content)) !== null) {
|
|
22
|
+
if (match[1])
|
|
23
|
+
functions.push(match[1]);
|
|
24
|
+
}
|
|
25
|
+
const classes = [];
|
|
26
|
+
const classRegex = /(?:export\s+)?(?:abstract\s+)?class\s+([a-zA-Z0-9_]+)/g;
|
|
27
|
+
while ((match = classRegex.exec(content)) !== null) {
|
|
28
|
+
if (match[1])
|
|
29
|
+
classes.push(match[1]);
|
|
30
|
+
}
|
|
31
|
+
const types = [];
|
|
32
|
+
const typeRegex = /(?:export\s+)?(?:type|interface)\s+([a-zA-Z0-9_]+)/g;
|
|
33
|
+
while ((match = typeRegex.exec(content)) !== null) {
|
|
34
|
+
if (match[1])
|
|
35
|
+
types.push(match[1]);
|
|
36
|
+
}
|
|
37
|
+
const imports = [];
|
|
38
|
+
const lines = content.split(/\r?\n/);
|
|
39
|
+
const importLines = lines.filter(l => l.trim().startsWith("import "));
|
|
40
|
+
importLines.forEach(line => {
|
|
41
|
+
const fromMatch = line.match(/from ['"]([^'"]+)['"]/);
|
|
42
|
+
if (fromMatch?.[1]) {
|
|
43
|
+
const name = fromMatch[1];
|
|
44
|
+
const type = name.startsWith('.') ? 'Interne' : (name.startsWith('node:') ? 'Node.js' : 'NPM');
|
|
45
|
+
const importedMatch = line.match(/import\s+(?:\{([^}]+)\}|(\w+))/);
|
|
46
|
+
let usage = undefined;
|
|
47
|
+
if (importedMatch) {
|
|
48
|
+
const items = importedMatch[1] || importedMatch[2];
|
|
49
|
+
usage = items?.trim().split(',').map(s => s.trim()).join(', ');
|
|
50
|
+
}
|
|
51
|
+
imports.push({ name, type, usage });
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return { functions, classes, types, imports, exports };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Analyseur Python
|
|
58
|
+
class PythonAnalyzer {
|
|
59
|
+
extensions = [".py"];
|
|
60
|
+
analyzeFile(content) {
|
|
61
|
+
const functions = [];
|
|
62
|
+
const funcRegex = /def\s+([a-zA-Z0-9_]+)\s*\(/g;
|
|
63
|
+
let match;
|
|
64
|
+
while ((match = funcRegex.exec(content)) !== null) {
|
|
65
|
+
if (match[1] && !match[1].startsWith('__'))
|
|
66
|
+
functions.push(match[1]);
|
|
67
|
+
}
|
|
68
|
+
const classes = [];
|
|
69
|
+
const classRegex = /class\s+([a-zA-Z0-9_]+)(?:\(|:)/g;
|
|
70
|
+
while ((match = classRegex.exec(content)) !== null) {
|
|
71
|
+
if (match[1])
|
|
72
|
+
classes.push(match[1]);
|
|
73
|
+
}
|
|
74
|
+
const imports = [];
|
|
75
|
+
const lines = content.split(/\r?\n/);
|
|
76
|
+
lines.forEach(line => {
|
|
77
|
+
const importMatch = line.match(/^import\s+([a-zA-Z0-9_., ]+)/);
|
|
78
|
+
const fromMatch = line.match(/^from\s+([a-zA-Z0-9_.]+)\s+import\s+(.+)/);
|
|
79
|
+
if (importMatch?.[1]) {
|
|
80
|
+
const modules = importMatch[1].split(',').map(m => m.trim());
|
|
81
|
+
modules.forEach(mod => {
|
|
82
|
+
const type = mod.startsWith('.') ? 'Interne' : 'PyPI';
|
|
83
|
+
imports.push({ name: mod, type });
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
else if (fromMatch?.[1]) {
|
|
87
|
+
const moduleName = fromMatch[1];
|
|
88
|
+
const imported = fromMatch[2]?.trim();
|
|
89
|
+
const type = moduleName.startsWith('.') ? 'Interne' : 'PyPI';
|
|
90
|
+
imports.push({ name: moduleName, type, usage: imported });
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
return { functions, classes, types: [], imports, exports: [] };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// Analyseur Java
|
|
97
|
+
class JavaAnalyzer {
|
|
98
|
+
extensions = [".java"];
|
|
99
|
+
analyzeFile(content) {
|
|
100
|
+
const classes = [];
|
|
101
|
+
const classRegex = /(?:public\s+)?(?:abstract\s+)?class\s+([a-zA-Z0-9_]+)/g;
|
|
102
|
+
let match;
|
|
103
|
+
while ((match = classRegex.exec(content)) !== null) {
|
|
104
|
+
if (match[1])
|
|
105
|
+
classes.push(match[1]);
|
|
106
|
+
}
|
|
107
|
+
const interfaceRegex = /(?:public\s+)?interface\s+([a-zA-Z0-9_]+)/g;
|
|
108
|
+
while ((match = interfaceRegex.exec(content)) !== null) {
|
|
109
|
+
if (match[1])
|
|
110
|
+
classes.push(match[1]);
|
|
111
|
+
}
|
|
112
|
+
const functions = [];
|
|
113
|
+
const methodRegex = /(?:public|private|protected)\s+(?:static\s+)?(?:\w+(?:<[^>]+>)?)\s+([a-zA-Z0-9_]+)\s*\(/g;
|
|
114
|
+
while ((match = methodRegex.exec(content)) !== null) {
|
|
115
|
+
if (match[1])
|
|
116
|
+
functions.push(match[1]);
|
|
117
|
+
}
|
|
118
|
+
const imports = [];
|
|
119
|
+
const lines = content.split(/\r?\n/);
|
|
120
|
+
lines.forEach(line => {
|
|
121
|
+
const importMatch = line.match(/^import\s+([a-zA-Z0-9_.]+);/);
|
|
122
|
+
if (importMatch?.[1]) {
|
|
123
|
+
const name = importMatch[1];
|
|
124
|
+
const type = name.startsWith('java.') || name.startsWith('javax.') ? 'JDK' : 'Maven';
|
|
125
|
+
imports.push({ name, type });
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
return { functions, classes, types: [], imports, exports: [] };
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Analyseur C#
|
|
132
|
+
class CSharpAnalyzer {
|
|
133
|
+
extensions = [".cs"];
|
|
134
|
+
analyzeFile(content) {
|
|
135
|
+
const classes = [];
|
|
136
|
+
const classRegex = /(?:public\s+)?(?:abstract\s+)?(?:partial\s+)?class\s+([a-zA-Z0-9_]+)/g;
|
|
137
|
+
let match;
|
|
138
|
+
while ((match = classRegex.exec(content)) !== null) {
|
|
139
|
+
if (match[1])
|
|
140
|
+
classes.push(match[1]);
|
|
141
|
+
}
|
|
142
|
+
const interfaceRegex = /(?:public\s+)?interface\s+([a-zA-Z0-9_]+)/g;
|
|
143
|
+
while ((match = interfaceRegex.exec(content)) !== null) {
|
|
144
|
+
if (match[1])
|
|
145
|
+
classes.push(match[1]);
|
|
146
|
+
}
|
|
147
|
+
const functions = [];
|
|
148
|
+
const methodRegex = /(?:public|private|protected|internal)\s+(?:static\s+)?(?:async\s+)?(?:\w+(?:<[^>]+>)?)\s+([a-zA-Z0-9_]+)\s*\(/g;
|
|
149
|
+
while ((match = methodRegex.exec(content)) !== null) {
|
|
150
|
+
if (match[1])
|
|
151
|
+
functions.push(match[1]);
|
|
152
|
+
}
|
|
153
|
+
const imports = [];
|
|
154
|
+
const lines = content.split(/\r?\n/);
|
|
155
|
+
lines.forEach(line => {
|
|
156
|
+
const usingMatch = line.match(/^using\s+([a-zA-Z0-9_.]+);/);
|
|
157
|
+
if (usingMatch?.[1]) {
|
|
158
|
+
const name = usingMatch[1];
|
|
159
|
+
const type = name.startsWith('System.') ? '.NET' : 'NuGet';
|
|
160
|
+
imports.push({ name, type });
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
return { functions, classes, types: [], imports, exports: [] };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// Analyseur Go
|
|
167
|
+
class GoAnalyzer {
|
|
168
|
+
extensions = [".go"];
|
|
169
|
+
analyzeFile(content) {
|
|
170
|
+
const functions = [];
|
|
171
|
+
const funcRegex = /func\s+(?:\([^)]+\)\s+)?([a-zA-Z0-9_]+)\s*\(/g;
|
|
172
|
+
let match;
|
|
173
|
+
while ((match = funcRegex.exec(content)) !== null) {
|
|
174
|
+
if (match[1])
|
|
175
|
+
functions.push(match[1]);
|
|
176
|
+
}
|
|
177
|
+
const types = [];
|
|
178
|
+
const typeRegex = /type\s+([a-zA-Z0-9_]+)\s+(?:struct|interface)/g;
|
|
179
|
+
while ((match = typeRegex.exec(content)) !== null) {
|
|
180
|
+
if (match[1])
|
|
181
|
+
types.push(match[1]);
|
|
182
|
+
}
|
|
183
|
+
const imports = [];
|
|
184
|
+
const lines = content.split(/\r?\n/);
|
|
185
|
+
lines.forEach(line => {
|
|
186
|
+
const importMatch = line.match(/^\s*"([^"]+)"/);
|
|
187
|
+
if (importMatch?.[1]) {
|
|
188
|
+
const name = importMatch[1];
|
|
189
|
+
const type = name.includes('.') ? 'External' : 'Standard';
|
|
190
|
+
imports.push({ name, type });
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
return { functions, classes: [], types, imports, exports: [] };
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Analyseur Rust
|
|
197
|
+
class RustAnalyzer {
|
|
198
|
+
extensions = [".rs"];
|
|
199
|
+
analyzeFile(content) {
|
|
200
|
+
const functions = [];
|
|
201
|
+
const funcRegex = /(?:pub\s+)?fn\s+([a-zA-Z0-9_]+)/g;
|
|
202
|
+
let match;
|
|
203
|
+
while ((match = funcRegex.exec(content)) !== null) {
|
|
204
|
+
if (match[1])
|
|
205
|
+
functions.push(match[1]);
|
|
206
|
+
}
|
|
207
|
+
const types = [];
|
|
208
|
+
const structRegex = /(?:pub\s+)?struct\s+([a-zA-Z0-9_]+)/g;
|
|
209
|
+
while ((match = structRegex.exec(content)) !== null) {
|
|
210
|
+
if (match[1])
|
|
211
|
+
types.push(match[1]);
|
|
212
|
+
}
|
|
213
|
+
const enumRegex = /(?:pub\s+)?enum\s+([a-zA-Z0-9_]+)/g;
|
|
214
|
+
while ((match = enumRegex.exec(content)) !== null) {
|
|
215
|
+
if (match[1])
|
|
216
|
+
types.push(match[1]);
|
|
217
|
+
}
|
|
218
|
+
const imports = [];
|
|
219
|
+
const lines = content.split(/\r?\n/);
|
|
220
|
+
lines.forEach(line => {
|
|
221
|
+
const useMatch = line.match(/^use\s+([a-zA-Z0-9_:]+)(?:::\{([^}]+)\})?/);
|
|
222
|
+
if (useMatch?.[1]) {
|
|
223
|
+
const name = useMatch[1];
|
|
224
|
+
const type = name.startsWith('std::') || name.startsWith('core::') ? 'Standard' : 'Crate';
|
|
225
|
+
const usage = useMatch[2];
|
|
226
|
+
imports.push({ name, type, usage });
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
return { functions, classes: [], types, imports, exports: [] };
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// Registry des analyseurs
|
|
233
|
+
const analyzers = [
|
|
234
|
+
new TSJSAnalyzer(),
|
|
235
|
+
new PythonAnalyzer(),
|
|
236
|
+
new JavaAnalyzer(),
|
|
237
|
+
new CSharpAnalyzer(),
|
|
238
|
+
new GoAnalyzer(),
|
|
239
|
+
new RustAnalyzer()
|
|
240
|
+
];
|
|
241
|
+
export function getAnalyzer(filePath) {
|
|
242
|
+
const lastDotIndex = filePath.lastIndexOf('.');
|
|
243
|
+
if (lastDotIndex === -1)
|
|
244
|
+
return null;
|
|
245
|
+
const ext = filePath.substring(lastDotIndex).toLowerCase();
|
|
246
|
+
return analyzers.find(a => a.extensions.includes(ext)) || null;
|
|
247
|
+
}
|
|
248
|
+
export function getSupportedExtensions() {
|
|
249
|
+
return analyzers.flatMap(a => a.extensions);
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=languageAnalyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languageAnalyzer.js","sourceRoot":"","sources":["../../src/analyzers/languageAnalyzer.ts"],"names":[],"mappings":"AAaA,kCAAkC;AAClC,MAAM,YAAY;IAChB,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,C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Manifest {
|
|
11
|
+
version: string;
|
|
12
|
+
files: Map<string, CacheEntry>;
|
|
13
|
+
lastUpdate: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class CacheManager {
|
|
16
|
+
private cacheDir;
|
|
17
|
+
private manifestPath;
|
|
18
|
+
private manifest;
|
|
19
|
+
private readonly CACHE_VERSION;
|
|
20
|
+
constructor(projectRoot: string);
|
|
21
|
+
private loadManifest;
|
|
22
|
+
private createNewManifest;
|
|
23
|
+
private saveManifest;
|
|
24
|
+
private computeHash;
|
|
25
|
+
isCached(filePath: string, content: string): boolean;
|
|
26
|
+
get(filePath: string): CacheEntry | null;
|
|
27
|
+
set(filePath: string, content: string, analysis: any): void;
|
|
28
|
+
invalidate(filePath: string): void;
|
|
29
|
+
invalidateAll(): void;
|
|
30
|
+
getStats(): {
|
|
31
|
+
total: number;
|
|
32
|
+
size: number;
|
|
33
|
+
oldestEntry: number;
|
|
34
|
+
};
|
|
35
|
+
pruneOldEntries(maxAgeMs?: number): number;
|
|
36
|
+
getModifiedFiles(files: string[]): string[];
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=cacheManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheManager.d.ts","sourceRoot":"","sources":["../../src/cache/cacheManager.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAW;gBAE7B,WAAW,EAAE,MAAM;IAW/B,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,WAAW;IAMZ,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO;IAQpD,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAIxC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI;IAmB3D,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKlC,aAAa,IAAI,IAAI;IAKrB,QAAQ,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE;IAShE,eAAe,CAAC,QAAQ,GAAE,MAAgC,GAAG,MAAM;IAkBnE,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;CAmBnD"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// Emplacement : M:\workspace\extensions\docstodev\src\cache\cacheManager.ts
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { readFileSync, writeFileSync, existsSync, statSync, mkdirSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
export class CacheManager {
|
|
6
|
+
cacheDir;
|
|
7
|
+
manifestPath;
|
|
8
|
+
manifest;
|
|
9
|
+
CACHE_VERSION = "1.0.0";
|
|
10
|
+
constructor(projectRoot) {
|
|
11
|
+
this.cacheDir = path.join(projectRoot, ".docstodev", "cache");
|
|
12
|
+
this.manifestPath = path.join(this.cacheDir, "manifest.json");
|
|
13
|
+
if (!existsSync(this.cacheDir)) {
|
|
14
|
+
mkdirSync(this.cacheDir, { recursive: true });
|
|
15
|
+
}
|
|
16
|
+
this.manifest = this.loadManifest();
|
|
17
|
+
}
|
|
18
|
+
loadManifest() {
|
|
19
|
+
if (existsSync(this.manifestPath)) {
|
|
20
|
+
try {
|
|
21
|
+
const data = JSON.parse(readFileSync(this.manifestPath, "utf-8"));
|
|
22
|
+
// Vérifier la version du cache
|
|
23
|
+
if (data.version !== this.CACHE_VERSION) {
|
|
24
|
+
console.log("⚠️ Cache version mismatch, clearing cache...");
|
|
25
|
+
return this.createNewManifest();
|
|
26
|
+
}
|
|
27
|
+
// Reconstituer la Map depuis l'objet
|
|
28
|
+
return {
|
|
29
|
+
version: data.version,
|
|
30
|
+
files: new Map(Object.entries(data.files || {})),
|
|
31
|
+
lastUpdate: data.lastUpdate
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
console.error("⚠️ Failed to load cache manifest:", e);
|
|
36
|
+
return this.createNewManifest();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return this.createNewManifest();
|
|
40
|
+
}
|
|
41
|
+
createNewManifest() {
|
|
42
|
+
return {
|
|
43
|
+
version: this.CACHE_VERSION,
|
|
44
|
+
files: new Map(),
|
|
45
|
+
lastUpdate: Date.now()
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
saveManifest() {
|
|
49
|
+
try {
|
|
50
|
+
const data = {
|
|
51
|
+
version: this.manifest.version,
|
|
52
|
+
files: Object.fromEntries(this.manifest.files),
|
|
53
|
+
lastUpdate: this.manifest.lastUpdate
|
|
54
|
+
};
|
|
55
|
+
writeFileSync(this.manifestPath, JSON.stringify(data, null, 2));
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
console.error("⚠️ Failed to save cache manifest:", e);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
computeHash(filePath, content) {
|
|
62
|
+
const stats = statSync(filePath);
|
|
63
|
+
const hashContent = `${content}|${stats.mtime.getTime()}|${stats.size}`;
|
|
64
|
+
return createHash("sha256").update(hashContent).digest("hex");
|
|
65
|
+
}
|
|
66
|
+
isCached(filePath, content) {
|
|
67
|
+
const entry = this.manifest.files.get(filePath);
|
|
68
|
+
if (!entry)
|
|
69
|
+
return false;
|
|
70
|
+
const currentHash = this.computeHash(filePath, content);
|
|
71
|
+
return entry.hash === currentHash;
|
|
72
|
+
}
|
|
73
|
+
get(filePath) {
|
|
74
|
+
return this.manifest.files.get(filePath) || null;
|
|
75
|
+
}
|
|
76
|
+
set(filePath, content, analysis) {
|
|
77
|
+
const stats = statSync(filePath);
|
|
78
|
+
const hash = this.computeHash(filePath, content);
|
|
79
|
+
const entry = {
|
|
80
|
+
hash,
|
|
81
|
+
timestamp: Date.now(),
|
|
82
|
+
analysis,
|
|
83
|
+
metadata: {
|
|
84
|
+
lines: content.split(/\r?\n/).length,
|
|
85
|
+
size: stats.size
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
this.manifest.files.set(filePath, entry);
|
|
89
|
+
this.manifest.lastUpdate = Date.now();
|
|
90
|
+
this.saveManifest();
|
|
91
|
+
}
|
|
92
|
+
invalidate(filePath) {
|
|
93
|
+
this.manifest.files.delete(filePath);
|
|
94
|
+
this.saveManifest();
|
|
95
|
+
}
|
|
96
|
+
invalidateAll() {
|
|
97
|
+
this.manifest = this.createNewManifest();
|
|
98
|
+
this.saveManifest();
|
|
99
|
+
}
|
|
100
|
+
getStats() {
|
|
101
|
+
const entries = Array.from(this.manifest.files.values());
|
|
102
|
+
return {
|
|
103
|
+
total: entries.length,
|
|
104
|
+
size: entries.reduce((sum, e) => sum + e.metadata.size, 0),
|
|
105
|
+
oldestEntry: Math.min(...entries.map(e => e.timestamp), Date.now())
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
pruneOldEntries(maxAgeMs = 7 * 24 * 60 * 60 * 1000) {
|
|
109
|
+
const now = Date.now();
|
|
110
|
+
let pruned = 0;
|
|
111
|
+
for (const [filePath, entry] of this.manifest.files.entries()) {
|
|
112
|
+
if (now - entry.timestamp > maxAgeMs) {
|
|
113
|
+
this.manifest.files.delete(filePath);
|
|
114
|
+
pruned++;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (pruned > 0) {
|
|
118
|
+
this.saveManifest();
|
|
119
|
+
}
|
|
120
|
+
return pruned;
|
|
121
|
+
}
|
|
122
|
+
getModifiedFiles(files) {
|
|
123
|
+
const modified = [];
|
|
124
|
+
for (const file of files) {
|
|
125
|
+
if (!existsSync(file))
|
|
126
|
+
continue;
|
|
127
|
+
try {
|
|
128
|
+
const content = readFileSync(file, "utf-8");
|
|
129
|
+
if (!this.isCached(file, content)) {
|
|
130
|
+
modified.push(file);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
catch (e) {
|
|
134
|
+
// Si erreur de lecture, considérer comme modifié
|
|
135
|
+
modified.push(file);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return modified;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=cacheManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheManager.js","sourceRoot":"","sources":["../../src/cache/cacheManager.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,IAAI,MAAM,WAAW,CAAC;AAkB7B,MAAM,OAAO,YAAY;IACf,QAAQ,CAAS;IACjB,YAAY,CAAS;IACrB,QAAQ,CAAgB;IACf,aAAa,GAAG,OAAO,CAAC;IAEzC,YAAY,WAAmB;QAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,OAA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