Commit 4a02fa4
committed
feat(Handler/workspace_fs_api): Implement core workspace FS API handlers
- Added `workspace_fs_api` handler module to `Mountain` backend for processing `workspace.fs` RPC methods required by VS Code extensions
- Implemented handlers for `stat`, `readFile`, `writeFile`, `readDirectory`, `createDirectory`, `delete`, `rename`, and `copy` operations
- Integrated with `FsReader`/`FsWriter` traits from environment to perform actual filesystem operations while enforcing scheme validation
- Added structured error mapping from `CommonError` to extension-friendly JSON-RPC errors with POSIX-style error codes (ENOENT, EACCES)
- Implemented URI scheme filtering to reject `vscode-webview`/`vscode-remote` URIs not supported by native FS operations
- Added base64 encoding/decoding for file content transfer to maintain binary safety over JSON-RPC
This implementation enables Cocoon extension host to provide filesystem API compatibility for VS Code extensions while maintaining security boundaries and proper error handling as required by the `fs-api-shim.js` layer.1 parent f13bd39 commit 4a02fa4
2 files changed
Lines changed: 152 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
0 commit comments