@qzoft/check-list 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -18,10 +18,7 @@ Add the following to your project's `.vscode/mcp.json`:
18
18
  "servers": {
19
19
  "check-list": {
20
20
  "command": "npx",
21
- "args": ["-y", "@qzoft/check-list"],
22
- "env": {
23
- "PROJECT_DIR": "${workspaceFolder}"
24
- }
21
+ "args": ["-y", "@qzoft/check-list"]
25
22
  }
26
23
  }
27
24
  }
@@ -84,7 +81,7 @@ The parser recognizes `## Section` headers and checkbox list items in any `.md`
84
81
  - [ ] Update README
85
82
 
86
83
  ## This Week
87
- - [ ] Review PRs
84
+ - [x] Review PRs
88
85
  - [ ] Deploy to staging
89
86
  ```
90
87
 
package/dist/server.js CHANGED
@@ -44,24 +44,42 @@ registerAppResource(server, 'Task Checklist', uiResourceUri, { description: 'Int
44
44
  }],
45
45
  }));
46
46
  registerAppTool(server, 'list_tasks', {
47
- description: 'Discover and display checklists from all markdown files in the project',
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
+ inputSchema: {
49
+ file: z.string().optional().describe('Optional relative path to a specific markdown file to show tasks from (e.g. "now.md"). Omit to show tasks from all markdown files.'),
50
+ },
48
51
  _meta: { ui: { resourceUri: uiResourceUri } },
49
- }, async () => {
52
+ }, async ({ file }) => {
50
53
  let mdFiles;
51
- try {
52
- mdFiles = await discoverMarkdownFiles(projectDir);
54
+ if (file) {
55
+ // Single-file mode: resolve and validate the path
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
+ }
64
+ mdFiles = [resolved];
53
65
  }
54
- catch (err) {
55
- const message = err instanceof Error ? err.message : String(err);
56
- return {
57
- isError: true,
58
- content: [
59
- {
60
- type: 'text',
61
- text: `Error scanning project directory ${projectDir}: ${message}`,
62
- },
63
- ],
64
- };
66
+ else {
67
+ // All-files mode: discover every markdown file in the project
68
+ try {
69
+ mdFiles = await discoverMarkdownFiles(projectDir);
70
+ }
71
+ catch (err) {
72
+ const message = err instanceof Error ? err.message : String(err);
73
+ return {
74
+ isError: true,
75
+ content: [
76
+ {
77
+ type: 'text',
78
+ text: `Error scanning project directory ${projectDir}: ${message}`,
79
+ },
80
+ ],
81
+ };
82
+ }
65
83
  }
66
84
  const fileGroups = [];
67
85
  for (const filePath of mdFiles) {
@@ -70,6 +88,12 @@ registerAppTool(server, 'list_tasks', {
70
88
  content = await readTaskFile(filePath);
71
89
  }
72
90
  catch {
91
+ if (file) {
92
+ return {
93
+ isError: true,
94
+ content: [{ type: 'text', text: `Could not read file: ${file}` }],
95
+ };
96
+ }
73
97
  continue; // skip files we can't read
74
98
  }
75
99
  const sections = parseTasks(content);
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@qzoft/check-list",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "MCP App for interactive task management from markdown files",
5
5
  "type": "module",
6
6
  "main": "dist/server.js",
7
- "bin": "dist/server.js",
7
+ "bin": {
8
+ "check-list": "dist/server.js"
9
+ },
8
10
  "files": [
9
11
  "dist",
10
12
  "ui"