@qzoft/check-list 1.0.3 → 1.0.5

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 CHANGED
@@ -91,7 +91,7 @@ registerAppTool(server, 'list_tasks', {
91
91
  if (file) {
92
92
  return {
93
93
  isError: true,
94
- content: [{ type: 'text', text: `Could not read file: ${file}` }],
94
+ content: [{ type: 'text', text: `Could not read file: ${file}\nResolved path: ${filePath}\nProject directory: ${projectDir}` }],
95
95
  };
96
96
  }
97
97
  continue; // skip files we can't read
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qzoft/check-list",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "MCP App for interactive task management from markdown files",
5
5
  "type": "module",
6
6
  "main": "dist/server.js",
@@ -214,8 +214,22 @@
214
214
  }
215
215
  });
216
216
 
217
+ function escapeHtml(str) {
218
+ const div = document.createElement('div');
219
+ div.textContent = str;
220
+ return div.innerHTML;
221
+ }
222
+
217
223
  function handleToolResult(result) {
218
224
  try {
225
+ // Check for error responses first
226
+ if (result.isError) {
227
+ const textContent = result.content?.find(c => c.type === 'text');
228
+ const msg = textContent?.text || 'Unknown error';
229
+ sectionsEl.innerHTML = '<p style="color:var(--save-err)">Error: ' + escapeHtml(msg) + '</p>';
230
+ return;
231
+ }
232
+
219
233
  // Prefer structuredContent, fall back to parsing text content
220
234
  let fileGroups = result.structuredContent?.files;
221
235
  if (!fileGroups) {
@@ -228,7 +242,7 @@
228
242
  renderFileGroups(fileGroups);
229
243
  }
230
244
  } catch (err) {
231
- sectionsEl.innerHTML = '<p>Error loading tasks: ' + (err.message || String(err)) + '</p>';
245
+ sectionsEl.innerHTML = '<p style="color:var(--save-err)">Error loading tasks: ' + escapeHtml(err.message || String(err)) + '</p>';
232
246
  }
233
247
  }
234
248