sad-mcp 0.1.17 → 0.1.18
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/tools.js +22 -1
- package/package.json +1 -1
package/dist/tools.js
CHANGED
|
@@ -12,12 +12,33 @@ function isExamFile(file) {
|
|
|
12
12
|
async function getExamList() {
|
|
13
13
|
const allFiles = await listAllFiles();
|
|
14
14
|
const examFiles = allFiles.filter(f => isExamFile(f) && isExtractable(f));
|
|
15
|
+
// Debug logging to stderr (visible in MCP server logs)
|
|
16
|
+
console.error(`[getExamList] allFiles=${allFiles.length}, examFiles=${examFiles.length}`);
|
|
17
|
+
for (const f of examFiles.slice(0, 10)) {
|
|
18
|
+
console.error(`[getExamList] path="${f.path}" name="${f.name}" mime="${f.mimeType}"`);
|
|
19
|
+
}
|
|
20
|
+
if (examFiles.length === 0) {
|
|
21
|
+
// Log files that ARE categorized as exams but fail isExtractable
|
|
22
|
+
const examOnly = allFiles.filter(f => isExamFile(f));
|
|
23
|
+
console.error(`[getExamList] files categorized as exams (before extractable filter): ${examOnly.length}`);
|
|
24
|
+
for (const f of examOnly.slice(0, 10)) {
|
|
25
|
+
console.error(`[getExamList] exam-cat: path="${f.path}" name="${f.name}" mime="${f.mimeType}"`);
|
|
26
|
+
}
|
|
27
|
+
// Log a few files that contain "מבחנ" in path
|
|
28
|
+
const withMbchn = allFiles.filter(f => f.path.includes("מבחנ"));
|
|
29
|
+
console.error(`[getExamList] files with מבחנ in path: ${withMbchn.length}`);
|
|
30
|
+
for (const f of withMbchn.slice(0, 10)) {
|
|
31
|
+
console.error(`[getExamList] מבחנ: path="${f.path}" name="${f.name}"`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
15
34
|
const examsMap = new Map();
|
|
16
35
|
for (const file of examFiles) {
|
|
17
36
|
// Match paths like "מבחנים-לסטודנטים/2024-א-א/מבחן.pdf"
|
|
18
37
|
const match = file.path.match(/(\d{4})-([\u0590-\u05FFa-z]+)-([\u0590-\u05FFa-z]+)\//i);
|
|
19
|
-
if (!match)
|
|
38
|
+
if (!match) {
|
|
39
|
+
console.error(`[getExamList] regex NO MATCH for path: "${file.path}"`);
|
|
20
40
|
continue;
|
|
41
|
+
}
|
|
21
42
|
const [, year, semester, moed] = match;
|
|
22
43
|
const id = `${year}-${semester}-${moed}`;
|
|
23
44
|
if (!examsMap.has(id)) {
|