file-organizer-mcp 3.1.2 โ†’ 3.1.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.
Files changed (96) hide show
  1. package/CHANGELOG.md +183 -155
  2. package/README.md +808 -773
  3. package/dist/constants.d.ts +1 -1
  4. package/dist/constants.js +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +16 -16
  7. package/dist/index.js.map +1 -1
  8. package/dist/schemas/common.schemas.d.ts +1 -1
  9. package/dist/schemas/common.schemas.js +1 -1
  10. package/dist/schemas/index.d.ts +1 -1
  11. package/dist/schemas/index.js +1 -1
  12. package/dist/schemas/organize.schemas.d.ts +1 -1
  13. package/dist/schemas/organize.schemas.js +1 -1
  14. package/dist/schemas/scan.schemas.d.ts +1 -1
  15. package/dist/schemas/scan.schemas.js +1 -1
  16. package/dist/schemas/security.schemas.d.ts +1 -1
  17. package/dist/schemas/security.schemas.js +1 -1
  18. package/dist/server.d.ts +1 -1
  19. package/dist/server.js +1 -1
  20. package/dist/services/auto-organize.service.d.ts +1 -1
  21. package/dist/services/auto-organize.service.d.ts.map +1 -1
  22. package/dist/services/auto-organize.service.js +14 -6
  23. package/dist/services/auto-organize.service.js.map +1 -1
  24. package/dist/services/categorizer.service.d.ts +1 -1
  25. package/dist/services/categorizer.service.js +2 -2
  26. package/dist/services/categorizer.service.js.map +1 -1
  27. package/dist/services/duplicate-finder.service.d.ts +1 -1
  28. package/dist/services/duplicate-finder.service.js +1 -1
  29. package/dist/services/file-scanner.service.d.ts +1 -1
  30. package/dist/services/file-scanner.service.d.ts.map +1 -1
  31. package/dist/services/file-scanner.service.js +42 -29
  32. package/dist/services/file-scanner.service.js.map +1 -1
  33. package/dist/services/hash-calculator.service.d.ts +1 -1
  34. package/dist/services/hash-calculator.service.js +1 -1
  35. package/dist/services/index.d.ts +1 -1
  36. package/dist/services/index.js +1 -1
  37. package/dist/services/organizer.service.d.ts +1 -1
  38. package/dist/services/organizer.service.js +2 -2
  39. package/dist/services/organizer.service.js.map +1 -1
  40. package/dist/services/path-validator.service.d.ts +1 -1
  41. package/dist/services/path-validator.service.js +1 -1
  42. package/dist/services/renaming.service.d.ts +1 -1
  43. package/dist/services/renaming.service.js +1 -1
  44. package/dist/services/rollback.service.d.ts +1 -1
  45. package/dist/services/rollback.service.js +1 -1
  46. package/dist/services/security/rate-limiter.service.d.ts +1 -1
  47. package/dist/services/security/rate-limiter.service.js +1 -1
  48. package/dist/services/streaming-scanner.service.d.ts +1 -1
  49. package/dist/services/streaming-scanner.service.js +1 -1
  50. package/dist/tests/test-edge-cases.js +3 -1
  51. package/dist/tests/test-edge-cases.js.map +1 -1
  52. package/dist/tools/duplicate-management.d.ts +1 -1
  53. package/dist/tools/duplicate-management.js +18 -18
  54. package/dist/tools/file-analysis.d.ts +1 -1
  55. package/dist/tools/file-analysis.js +3 -3
  56. package/dist/tools/file-categorization.d.ts +1 -1
  57. package/dist/tools/file-categorization.js +3 -3
  58. package/dist/tools/file-duplicates.d.ts +1 -1
  59. package/dist/tools/file-duplicates.js +8 -8
  60. package/dist/tools/file-listing.d.ts +1 -1
  61. package/dist/tools/file-listing.js +7 -7
  62. package/dist/tools/file-management.d.ts +1 -1
  63. package/dist/tools/file-management.js +3 -3
  64. package/dist/tools/file-organization.d.ts +1 -1
  65. package/dist/tools/file-organization.js +14 -14
  66. package/dist/tools/file-renaming.d.ts +1 -1
  67. package/dist/tools/file-renaming.js +1 -1
  68. package/dist/tools/file-scanning.d.ts +1 -1
  69. package/dist/tools/file-scanning.js +8 -8
  70. package/dist/tools/index.d.ts +1 -1
  71. package/dist/tools/index.js +1 -1
  72. package/dist/tools/metadata-inspection.d.ts +1 -1
  73. package/dist/tools/metadata-inspection.js +1 -1
  74. package/dist/tools/organization-preview.d.ts +1 -1
  75. package/dist/tools/organization-preview.js +16 -16
  76. package/dist/tools/rollback.d.ts +1 -1
  77. package/dist/tools/rollback.js +7 -7
  78. package/dist/tools/watch.tool.d.ts +1 -1
  79. package/dist/tools/watch.tool.js +14 -14
  80. package/dist/types.d.ts +1 -1
  81. package/dist/types.js +1 -1
  82. package/dist/utils/error-handler.d.ts +5 -1
  83. package/dist/utils/error-handler.d.ts.map +1 -1
  84. package/dist/utils/error-handler.js +20 -11
  85. package/dist/utils/error-handler.js.map +1 -1
  86. package/dist/utils/file-utils.d.ts +1 -1
  87. package/dist/utils/file-utils.js +1 -1
  88. package/dist/utils/formatters.d.ts +1 -1
  89. package/dist/utils/formatters.js +1 -1
  90. package/dist/utils/index.d.ts +1 -1
  91. package/dist/utils/index.js +1 -1
  92. package/dist/utils/logger.d.ts +1 -1
  93. package/dist/utils/logger.js +1 -1
  94. package/dist/utils/path-security.d.ts +1 -1
  95. package/dist/utils/path-security.js +1 -1
  96. package/package.json +95 -95
package/CHANGELOG.md CHANGED
@@ -1,155 +1,183 @@
1
- # Changelog
2
-
3
- ## [3.1.2] - 2026-02-06
4
-
5
- ### ๐Ÿ› Fixed
6
- - **Bin Entry**: Fixed `file-organizer-setup` bin path (`tui-index.js` โ†’ `index.js`)
7
- - **Postinstall**: Added postinstall welcome message after npm install
8
-
9
- ## [3.1.1] - 2026-02-06
10
-
11
- ### โœจ New Features
12
- - **Interactive Setup Wizard**: New TUI-based setup (`npx file-organizer-mcp --setup`) for easy configuration of folders, conflict strategies, and Claude Desktop integration.
13
- - **Smart Metadata Organization**:
14
- - Organization by Year/Month for images and videos.
15
- - Organization by Artist/Album for audio files.
16
- - New tool `file_organizer_inspect_metadata` for safe metadata extraction.
17
- - **Smart Scheduling & Watch Mode**:
18
- - New tools: `file_organizer_watch_directory`, `file_organizer_unwatch_directory`, `file_organizer_list_watches`.
19
- - Cron-based scheduling for automatic organization (e.g., `"0 10 * * *"` for daily at 10am).
20
- - Per-directory configuration with independent schedules.
21
- - `min_file_age_minutes` - Skip files newer than X minutes (prevents organizing in-progress downloads).
22
- - `max_files_per_run` - Limit files processed per scheduled run.
23
- - Hot-reload configuration without server restart.
24
- - **Batch Renaming**: New powerful `file_organizer_batch_rename` tool.
25
-
26
- ### ๐Ÿ›ก๏ธ Improvements
27
- - **Conflict Strategy**: Configurable default conflict resolution (`rename`/`skip`/`overwrite`) via config.
28
- - **Security Check**: Enforced stricter validation for symlink security with explicit `lstat` checks.
29
- - **Config Management**: Deep merge updates preserve existing settings when adding new configuration.
30
- - **Free Models**: Updated default configuration to prioritize free models.
31
-
32
- ### ๐Ÿ› Fixed
33
- - Resolved JSON configuration errors.
34
- - Fixed Cloud Authentication issues.
35
- - Fixed server disconnection stability issues.
36
-
37
- ---
38
-
39
- ## [3.0.0] - 2026-02-02
40
-
41
- ### ๐Ÿš€ Major: Full TypeScript Migration
42
-
43
- Complete rewrite from monolithic JavaScript to modular TypeScript architecture.
44
-
45
- ### โœจ Added
46
-
47
- #### Architecture
48
- - New `src/` directory structure with layered architecture
49
- - TypeScript strict mode with full type safety
50
- - ESLint + Prettier configuration for code quality
51
-
52
- **Services Layer** (`src/services/`)
53
- - `PathValidatorService` - 8-layer path validation with Zod schemas
54
- - `FileScannerService` - Recursive file scanning with depth/count limits
55
- - `HashCalculatorService` - SHA-256 hashing for duplicate detection
56
- - `CategorizerService` - File type categorization by extension
57
- - `OrganizerService` - File organization with dry-run support
58
- - `RollbackService` - Undo file operations with manifest tracking
59
-
60
- **Tools Layer** (`src/tools/`)
61
- - Each tool in its own file with Zod input validation
62
- - Comprehensive JSDoc documentation with examples
63
- - Exported TypeScript types inferred from Zod schemas
64
-
65
- **Utilities** (`src/utils/`)
66
- - `formatters.ts` - Byte/date/duration formatting
67
- - `file-utils.ts` - Path normalization, expansion, validation
68
- - `error-handler.ts` - Centralized error handling with sanitization
69
- - `logger.ts` - Structured JSON logging with configurable log levels (debug/info/warn/error)
70
-
71
- **Configuration** (`src/config.ts`)
72
- - Platform-aware default directory detection (Windows/macOS/Linux)
73
- - User configuration loading from platform-specific locations
74
- - Whitelist/blacklist system for directory access control
75
- - Auto-initialization of user config file
76
-
77
- **Schemas** (`src/schemas/`)
78
- - Zod schemas for all tool inputs
79
- - Runtime validation with descriptive error messages
80
- - Type inference from schemas
81
-
82
- #### Testing
83
- - Comprehensive unit tests for all services
84
- - Integration tests for complete workflows
85
- - Performance benchmarks
86
- - 100+ tests passing across unit, integration, and performance suites
87
- - `TESTS.md` - Complete test documentation
88
-
89
- ### ๐Ÿ”ง Changed
90
- - Entry point: `dist/index.js` (compiled from TypeScript)
91
- - Build: `npm run build` compiles TypeScript
92
- - Tests: `npm test` runs complete test suite
93
- - Improved error messages with sanitized paths
94
- - Enhanced security with TOCTOU mitigation using file descriptors
95
-
96
- ### ๐Ÿ› Fixed
97
- - Path traversal vulnerability (8-layer validation pipeline)
98
- - Race conditions in file operations (atomic copy with `COPYFILE_EXCL`)
99
- - Data loss during overwrites (automatic backups to `.file-organizer-backups/`)
100
- - Windows path case-sensitivity issues
101
- - Multiple test failures in duplicate management, organization flow, and file inspection
102
-
103
- ### ๐Ÿ—‘๏ธ Removed
104
- - `server.js` (672-line monolith) โ†’ replaced by `src/` modules
105
- - `lib/` folder โ†’ migrated to `src/services/`
106
- - JavaScript test files โ†’ migrated to TypeScript
107
-
108
- ### ๐Ÿ“ฆ Dependencies Added
109
- - `typescript` ^5.3.2
110
- - `zod` ^3.22.4
111
- - `@types/node` ^20.10.0
112
- - `eslint`, `prettier`, `rimraf`
113
- - `jest` for testing
114
-
115
- ---
116
-
117
- ## [3.0.0-beta.1] - 2026-02-02
118
-
119
- ### ๐Ÿ”’ Security (CRITICAL)
120
- - **FIXED**: Path traversal vulnerability (CVE-pending)
121
- - Previous versions allowed `../` to access parent directories
122
- - Now implements 8-layer validation pipeline
123
- - All paths restricted to current working directory in strict mode
124
- - **FIXED**: Windows Path Case-Sensitivity
125
- - Resolves access denial for paths like `c:\Users` vs `C:\Users`
126
- - Ensures robust whitelist matching on Windows platforms
127
-
128
- ### โœจ Added
129
- - New 8-layer path validation system
130
- - Custom error classes (AccessDeniedError, ValidationError)
131
- - Comprehensive security test suite (5/5 passing)
132
- - Forward compatibility for Phase 2 (config system)
133
-
134
- ### ๐Ÿ”ง Changed
135
- - Updated to v3.0.0 architecture
136
- - Path validation now uses base-validator.js
137
- - Improved error messages with sanitized paths
138
-
139
- ### โš ๏ธ Breaking Changes
140
- - **NONE** - Fully backward compatible with v2.x for valid use cases
141
- - Only breaking for invalid use cases (accessing parent directories)
142
-
143
- ### ๐Ÿ“ฆ Migration from v2.x
144
- No changes needed! All existing workflows continue to work.
145
- If you were using `../` paths (which was a security bug), those now correctly fail.
146
-
147
- ### ๐Ÿงช Testing
148
- - 5/5 critical security tests passing
149
- - All 6 original MCP tools tested and working
150
- - Cross-platform tested (Windows, macOS, Linux)
151
-
152
- ---
153
-
154
- ## [2.1.0] - 2026-02-01
155
- (Previous version with path traversal vulnerability - UPGRADE IMMEDIATELY)
1
+ # Changelog
2
+
3
+ ## [3.1.3] - 2026-02-06
4
+
5
+ ### ๐Ÿ“ Documentation
6
+
7
+ - **Version Bump**: Updated all documentation and source files to v3.1.3
8
+
9
+ ## [3.1.2] - 2026-02-06
10
+
11
+ ### ๐Ÿ› Fixed
12
+
13
+ - **Bin Entry**: Fixed `file-organizer-setup` bin path (`tui-index.js` โ†’ `index.js`)
14
+ - **Postinstall**: Added postinstall welcome message after npm install
15
+
16
+ ## [3.1.1] - 2026-02-06
17
+
18
+ ### โœจ New Features
19
+
20
+ - **Interactive Setup Wizard**: New TUI-based setup (`npx file-organizer-mcp --setup`) for easy configuration of folders, conflict strategies, and Claude Desktop integration.
21
+ - **Smart Metadata Organization**:
22
+ - Organization by Year/Month for images and videos.
23
+ - Organization by Artist/Album for audio files.
24
+ - New tool `file_organizer_inspect_metadata` for safe metadata extraction.
25
+ - **Smart Scheduling & Watch Mode**:
26
+ - New tools: `file_organizer_watch_directory`, `file_organizer_unwatch_directory`, `file_organizer_list_watches`.
27
+ - Cron-based scheduling for automatic organization (e.g., `"0 10 * * *"` for daily at 10am).
28
+ - Per-directory configuration with independent schedules.
29
+ - `min_file_age_minutes` - Skip files newer than X minutes (prevents organizing in-progress downloads).
30
+ - `max_files_per_run` - Limit files processed per scheduled run.
31
+ - Hot-reload configuration without server restart.
32
+ - **Batch Renaming**: New powerful `file_organizer_batch_rename` tool.
33
+
34
+ ### ๐Ÿ›ก๏ธ Improvements
35
+
36
+ - **Conflict Strategy**: Configurable default conflict resolution (`rename`/`skip`/`overwrite`) via config.
37
+ - **Security Check**: Enforced stricter validation for symlink security with explicit `lstat` checks.
38
+ - **Config Management**: Deep merge updates preserve existing settings when adding new configuration.
39
+ - **Free Models**: Updated default configuration to prioritize free models.
40
+
41
+ ### ๐Ÿ› Fixed
42
+
43
+ - Resolved JSON configuration errors.
44
+ - Fixed Cloud Authentication issues.
45
+ - Fixed server disconnection stability issues.
46
+
47
+ ---
48
+
49
+ ## [3.0.0] - 2026-02-02
50
+
51
+ ### ๐Ÿš€ Major: Full TypeScript Migration
52
+
53
+ Complete rewrite from monolithic JavaScript to modular TypeScript architecture.
54
+
55
+ ### โœจ Added
56
+
57
+ #### Architecture
58
+
59
+ - New `src/` directory structure with layered architecture
60
+ - TypeScript strict mode with full type safety
61
+ - ESLint + Prettier configuration for code quality
62
+
63
+ **Services Layer** (`src/services/`)
64
+
65
+ - `PathValidatorService` - 8-layer path validation with Zod schemas
66
+ - `FileScannerService` - Recursive file scanning with depth/count limits
67
+ - `HashCalculatorService` - SHA-256 hashing for duplicate detection
68
+ - `CategorizerService` - File type categorization by extension
69
+ - `OrganizerService` - File organization with dry-run support
70
+ - `RollbackService` - Undo file operations with manifest tracking
71
+
72
+ **Tools Layer** (`src/tools/`)
73
+
74
+ - Each tool in its own file with Zod input validation
75
+ - Comprehensive JSDoc documentation with examples
76
+ - Exported TypeScript types inferred from Zod schemas
77
+
78
+ **Utilities** (`src/utils/`)
79
+
80
+ - `formatters.ts` - Byte/date/duration formatting
81
+ - `file-utils.ts` - Path normalization, expansion, validation
82
+ - `error-handler.ts` - Centralized error handling with sanitization
83
+ - `logger.ts` - Structured JSON logging with configurable log levels (debug/info/warn/error)
84
+
85
+ **Configuration** (`src/config.ts`)
86
+
87
+ - Platform-aware default directory detection (Windows/macOS/Linux)
88
+ - User configuration loading from platform-specific locations
89
+ - Whitelist/blacklist system for directory access control
90
+ - Auto-initialization of user config file
91
+
92
+ **Schemas** (`src/schemas/`)
93
+
94
+ - Zod schemas for all tool inputs
95
+ - Runtime validation with descriptive error messages
96
+ - Type inference from schemas
97
+
98
+ #### Testing
99
+
100
+ - Comprehensive unit tests for all services
101
+ - Integration tests for complete workflows
102
+ - Performance benchmarks
103
+ - 100+ tests passing across unit, integration, and performance suites
104
+ - `TESTS.md` - Complete test documentation
105
+
106
+ ### ๐Ÿ”ง Changed
107
+
108
+ - Entry point: `dist/index.js` (compiled from TypeScript)
109
+ - Build: `npm run build` compiles TypeScript
110
+ - Tests: `npm test` runs complete test suite
111
+ - Improved error messages with sanitized paths
112
+ - Enhanced security with TOCTOU mitigation using file descriptors
113
+
114
+ ### ๐Ÿ› Fixed
115
+
116
+ - Path traversal vulnerability (8-layer validation pipeline)
117
+ - Race conditions in file operations (atomic copy with `COPYFILE_EXCL`)
118
+ - Data loss during overwrites (automatic backups to `.file-organizer-backups/`)
119
+ - Windows path case-sensitivity issues
120
+ - Multiple test failures in duplicate management, organization flow, and file inspection
121
+
122
+ ### ๐Ÿ—‘๏ธ Removed
123
+
124
+ - `server.js` (672-line monolith) โ†’ replaced by `src/` modules
125
+ - `lib/` folder โ†’ migrated to `src/services/`
126
+ - JavaScript test files โ†’ migrated to TypeScript
127
+
128
+ ### ๐Ÿ“ฆ Dependencies Added
129
+
130
+ - `typescript` ^5.3.2
131
+ - `zod` ^3.22.4
132
+ - `@types/node` ^20.10.0
133
+ - `eslint`, `prettier`, `rimraf`
134
+ - `jest` for testing
135
+
136
+ ---
137
+
138
+ ## [3.0.0-beta.1] - 2026-02-02
139
+
140
+ ### ๐Ÿ”’ Security (CRITICAL)
141
+
142
+ - **FIXED**: Path traversal vulnerability (CVE-pending)
143
+ - Previous versions allowed `../` to access parent directories
144
+ - Now implements 8-layer validation pipeline
145
+ - All paths restricted to current working directory in strict mode
146
+ - **FIXED**: Windows Path Case-Sensitivity
147
+ - Resolves access denial for paths like `c:\Users` vs `C:\Users`
148
+ - Ensures robust whitelist matching on Windows platforms
149
+
150
+ ### โœจ Added
151
+
152
+ - New 8-layer path validation system
153
+ - Custom error classes (AccessDeniedError, ValidationError)
154
+ - Comprehensive security test suite (5/5 passing)
155
+ - Forward compatibility for Phase 2 (config system)
156
+
157
+ ### ๐Ÿ”ง Changed
158
+
159
+ - Updated to v3.0.0 architecture
160
+ - Path validation now uses base-validator.js
161
+ - Improved error messages with sanitized paths
162
+
163
+ ### โš ๏ธ Breaking Changes
164
+
165
+ - **NONE** - Fully backward compatible with v2.x for valid use cases
166
+ - Only breaking for invalid use cases (accessing parent directories)
167
+
168
+ ### ๐Ÿ“ฆ Migration from v2.x
169
+
170
+ No changes needed! All existing workflows continue to work.
171
+ If you were using `../` paths (which was a security bug), those now correctly fail.
172
+
173
+ ### ๐Ÿงช Testing
174
+
175
+ - 5/5 critical security tests passing
176
+ - All 6 original MCP tools tested and working
177
+ - Cross-platform tested (Windows, macOS, Linux)
178
+
179
+ ---
180
+
181
+ ## [2.1.0] - 2026-02-01
182
+
183
+ (Previous version with path traversal vulnerability - UPGRADE IMMEDIATELY)