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