@qzoft/check-list 1.0.5 → 1.0.6
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 +5 -12
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -46,21 +46,14 @@ registerAppResource(server, 'Task Checklist', uiResourceUri, { description: 'Int
|
|
|
46
46
|
registerAppTool(server, 'list_tasks', {
|
|
47
47
|
description: 'Discover and display checklists from markdown files in the project. When the user asks to see tasks in a specific file (e.g. "show my tasks in now.md"), pass the filename as the `file` parameter. When no file is specified, all markdown files are scanned.',
|
|
48
48
|
inputSchema: {
|
|
49
|
-
file: z.string().optional().describe('Optional
|
|
49
|
+
file: z.string().optional().describe('Optional path to a specific markdown file. Can be an absolute path (e.g. "C:/Users/me/project/tasks.md") or a relative path resolved against the project directory (e.g. "now.md"). Omit to show tasks from all markdown files.'),
|
|
50
50
|
},
|
|
51
51
|
_meta: { ui: { resourceUri: uiResourceUri } },
|
|
52
52
|
}, async ({ file }) => {
|
|
53
53
|
let mdFiles;
|
|
54
54
|
if (file) {
|
|
55
|
-
// Single-file mode: resolve
|
|
56
|
-
const resolved = path.resolve(projectDir, file);
|
|
57
|
-
const normalizedProject = path.resolve(projectDir);
|
|
58
|
-
if (!resolved.startsWith(normalizedProject + path.sep) && resolved !== normalizedProject) {
|
|
59
|
-
return {
|
|
60
|
-
isError: true,
|
|
61
|
-
content: [{ type: 'text', text: `Invalid file path: ${file}` }],
|
|
62
|
-
};
|
|
63
|
-
}
|
|
55
|
+
// Single-file mode: resolve the path (absolute paths stay as-is, relative resolve against projectDir)
|
|
56
|
+
const resolved = path.isAbsolute(file) ? path.resolve(file) : path.resolve(projectDir, file);
|
|
64
57
|
mdFiles = [resolved];
|
|
65
58
|
}
|
|
66
59
|
else {
|
|
@@ -117,7 +110,7 @@ registerAppTool(server, 'list_tasks', {
|
|
|
117
110
|
registerAppTool(server, 'update_tasks', {
|
|
118
111
|
description: 'Update checkbox states in a project markdown file (auto-saved on toggle)',
|
|
119
112
|
inputSchema: {
|
|
120
|
-
file: z.string().describe('
|
|
113
|
+
file: z.string().describe('Path to the markdown file. Can be absolute or relative to the project directory.'),
|
|
121
114
|
updates: z.array(z.object({
|
|
122
115
|
line: z.number().describe('0-indexed line number in the markdown file'),
|
|
123
116
|
checked: z.boolean().describe('New checked state for the checkbox'),
|
|
@@ -125,7 +118,7 @@ registerAppTool(server, 'update_tasks', {
|
|
|
125
118
|
},
|
|
126
119
|
_meta: { ui: { resourceUri: uiResourceUri, visibility: ['app'] } },
|
|
127
120
|
}, async ({ file, updates }) => {
|
|
128
|
-
const filePath = path.resolve(projectDir, file);
|
|
121
|
+
const filePath = path.isAbsolute(file) ? path.resolve(file) : path.resolve(projectDir, file);
|
|
129
122
|
let content;
|
|
130
123
|
try {
|
|
131
124
|
content = await readTaskFile(filePath);
|