diff --git a/CHANGELOG.md b/CHANGELOG.md index ed7df4d3..c4d2e1c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ # Changelog +## [1.0.22] - 2025-10-02 + +### Fixed + +- Decode URL-encoded `file://` roots on Windows when resolving `DATA_DIR`, preventing paths like `e%3A` from being used and ensuring files are written to the correct drive. + ## [1.0.21] - 2025-01-13 ### Added @@ -32,6 +38,7 @@ - **Node.js HTTP Server**: RESTful API endpoints for task and profile management - **HTML5 Drag & Drop**: Native browser API for intuitive tab reordering - **CSS Grid & Flexbox**: Responsive layout system with mobile-first approach + ### Changed - Updated documentation to reflect new configuration options (99baa0f, 8771a5b) diff --git a/package.json b/package.json index da429e26..7cd3f8da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mcp-shrimp-task-manager", - "version": "1.0.21", + "version": "1.0.22", "description": "Shrimp Task Manager is a task tool built for AI Agents, emphasizing chain-of-thought, reflection, and style consistency. It converts natural language into structured dev tasks with dependency tracking and iterative refinement, enabling agent-like developer behavior in reasoning AI systems", "main": "dist/index.js", "type": "module", @@ -48,4 +48,4 @@ "typescript": "^5.2.2", "vitest": "^1.0.0" } -} +} \ No newline at end of file diff --git a/src/utils/paths.ts b/src/utils/paths.ts index 03224eef..a8e8c245 100644 --- a/src/utils/paths.ts +++ b/src/utils/paths.ts @@ -52,14 +52,25 @@ export async function getDataDir(): Promise { root.uri.startsWith("file://") ); if (firstFileRoot) { - // 從 file:// URI 中提取實際路徑 - // Extract actual path from file:// URI + // 從 file:// URI 中提取實際路徑並進行 URL 解碼 + // Extract actual path from file:// URI and URL decode // Windows: file:///C:/path -> C:/path // Unix: file:///path -> /path - if (process.platform === 'win32') { - rootPath = firstFileRoot.uri.replace("file:///", "").replace(/\//g, "\\"); + let rawPath: string; + if (process.platform === "win32") { + rawPath = firstFileRoot.uri + .replace("file:///", "") + .replace(/\//g, "\\"); } else { - rootPath = firstFileRoot.uri.replace("file://", ""); + rawPath = firstFileRoot.uri.replace("file://", ""); + } + + try { + // URL decode the path to handle %3A -> : conversion and other encoded characters + rootPath = decodeURIComponent(rawPath); + } catch (error) { + // If URL decoding fails, use the raw path as fallback + rootPath = rawPath; } } }