# E2E Spec: Workspace File Operations

## Overview
Test AgentTeam workspace file operations: list, read, scan, delete, reset.
Covers `internal/wire/workspace.go`.

## Test Cases

### Path Traversal Protection (safeJoin)
- Empty sub-path returns base directory
- Path with `..` component returns error
- Absolute path returns error
- Normal sub-path returns joined path

### Directory Listing (listWorkspaceDir)
- Non-existent directory returns empty list
- Directories sorted before files
- Hidden files (dot prefix) excluded from listing
- node_modules excluded from listing
- Items sorted alphabetically within each group (dirs, then files)

### File Reading (readWorkspaceFile)
- Text files detected by extension and returned with content
- Binary files detected by extension and returned with binary=true
- Non-existent file returns error
- Files exceeding 1MB size limit return error

### Machine Scan (scanAllWorkspaces)
- Returns scan_result with directories array
- Each directory includes name, total size, and file count
- Empty agents directory returns empty result

### Machine Delete (deleteWorkspaceDir)
- Valid directory name deletes and returns success
- Name with path separators rejected
- Name with `..` component rejected
- Non-existent directory returns error

### Workspace Reset (resetWorkspace)
- Removes all contents but preserves directory
- Non-existent directory returns error
