Skip to content

feat(listener): add create_dir / delete_path / rename_path / copy_pat…#2025

Open
4shub wants to merge 2 commits intomainfrom
feat/filesystem-context-menu
Open

feat(listener): add create_dir / delete_path / rename_path / copy_pat…#2025
4shub wants to merge 2 commits intomainfrom
feat/filesystem-context-menu

Conversation

@4shub
Copy link
Copy Markdown
Collaborator

@4shub 4shub commented Apr 29, 2026

…h commands

Adds four new device commands so the cloud sidebar can drive filesystem mutations directly:

  • create_dirmkdir({ recursive: true }), idempotent
  • delete_path — file or recursive directory delete
  • rename_path — atomic rename/move, refuses to overwrite an existing destination (callers must resolve collisions)
  • copy_pathfs.cp({ recursive: true, errorOnExist: true })

Each handler refreshes the file index on success so the merkle tree stays current. Rename/copy share a "destination must not exist" contract — this lets the web side own collision resolution (append " copy", " copy 2", etc.) and keeps the device side a thin filesystem primitive.

These primitives are designed to back both the upcoming sidebar context-menu (rename / cut+paste / copy+paste / delete) and a future drag-and-drop flow without further protocol changes.

👾 Generated with Letta Code

…h commands

Adds four new device commands so the cloud sidebar can drive
filesystem mutations directly:

- `create_dir` — `mkdir({ recursive: true })`, idempotent
- `delete_path` — file or recursive directory delete
- `rename_path` — atomic rename/move, refuses to overwrite an
  existing destination (callers must resolve collisions)
- `copy_path` — `fs.cp({ recursive: true, errorOnExist: true })`

Each handler refreshes the file index on success so the merkle tree
stays current. Rename/copy share a "destination must not exist"
contract — this lets the web side own collision resolution (append
" copy", " copy 2", etc.) and keeps the device side a thin
filesystem primitive.

These primitives are designed to back both the upcoming sidebar
context-menu (rename / cut+paste / copy+paste / delete) and a
future drag-and-drop flow without further protocol changes.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
@4shub 4shub requested a review from cpacker as a code owner April 29, 2026 23:25
👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant