Skip to content

files: add a safe project and worktree explorer, search, and editor #32

Description

@guicybercode

Context

Users need to inspect specifications and agent changes without leaving CLI Master, and canvas File Tree nodes require a safe backend. A generic arbitrary-filesystem API would be too broad.

Goal

Add project/worktree-scoped file browsing, text search, reading, and editing through typed daemon operations.

Scope

  • Browse registered project roots and managed worktrees.
  • Search filenames and text with bounded results and cancellation.
  • Read UTF-8 text and report binary/unsupported encodings safely.
  • Write files atomically with revision or content-hash conflict checks.
  • Watch scoped filesystem changes and refresh affected views.
  • Integrate file selection with the prompt composer and Git status.
  • Provide accessible tree/list and editor interactions.

Acceptance criteria

  • Requests identify a registered project/worktree plus a validated relative path, never an arbitrary absolute target.
  • Path traversal, symlink escape, NUL bytes, and option-like path confusion fail closed.
  • Large files and result sets have explicit limits and truncation metadata.
  • A stale editor cannot silently overwrite newer disk content.
  • Atomic save preserves the original file when a write fails.
  • Binary files are never decoded lossily into the editor.
  • Search is cancellable and cannot block PTY/event delivery.
  • File changes immediately feed the task's Git status view.
  • Tests use real trees with Unicode, symlinks, binary files, races, and permission failures.

Out of scope

A full language server, remote filesystem, and arbitrary home-directory browsing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions