@qzoft/check-list 1.0.4 → 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.
Files changed (2) hide show
  1. package/dist/server.js +6 -13
  2. 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 relative path to a specific markdown file to show tasks from (e.g. "now.md"). Omit to show tasks from all markdown files.'),
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 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
- }
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 {
@@ -91,7 +84,7 @@ registerAppTool(server, 'list_tasks', {
91
84
  if (file) {
92
85
  return {
93
86
  isError: true,
94
- content: [{ type: 'text', text: `Could not read file: ${file}` }],
87
+ content: [{ type: 'text', text: `Could not read file: ${file}\nResolved path: ${filePath}\nProject directory: ${projectDir}` }],
95
88
  };
96
89
  }
97
90
  continue; // skip files we can't read
@@ -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('Relative path to the markdown file within the project'),
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qzoft/check-list",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "MCP App for interactive task management from markdown files",
5
5
  "type": "module",
6
6
  "main": "dist/server.js",