@qzoft/check-list 1.0.6 → 1.0.7
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/server.js +16 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -53,7 +53,22 @@ registerAppTool(server, 'list_tasks', {
|
|
|
53
53
|
let mdFiles;
|
|
54
54
|
if (file) {
|
|
55
55
|
// Single-file mode: resolve the path (absolute paths stay as-is, relative resolve against projectDir)
|
|
56
|
-
|
|
56
|
+
let resolved = path.isAbsolute(file) ? path.resolve(file) : path.resolve(projectDir, file);
|
|
57
|
+
// If the resolved path doesn't exist, try to find the file by name in the project
|
|
58
|
+
if (!fs.existsSync(resolved)) {
|
|
59
|
+
const basename = path.basename(file);
|
|
60
|
+
try {
|
|
61
|
+
const allMd = await discoverMarkdownFiles(projectDir);
|
|
62
|
+
const match = allMd.find(f => path.basename(f) === basename)
|
|
63
|
+
|| allMd.find(f => f.endsWith(file.replace(/\//g, path.sep)));
|
|
64
|
+
if (match) {
|
|
65
|
+
resolved = match;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// ignore discovery errors, will fail on read below with original path
|
|
70
|
+
}
|
|
71
|
+
}
|
|
57
72
|
mdFiles = [resolved];
|
|
58
73
|
}
|
|
59
74
|
else {
|