From 3131b076006e63bb26e77b1b558b7043724e712c Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 27 Oct 2025 18:30:41 +0000
Subject: [PATCH 1/4] Initial plan
From 011ad221b17580461d4373556868780ce38036c4 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 27 Oct 2025 18:35:48 +0000
Subject: [PATCH 2/4] Add WebUSB file manager with file browsing and editing
capabilities
Co-authored-by: simonw <9599+simonw@users.noreply.github.com>
---
usb-file-manager.docs.md | 24 ++
usb-file-manager.html | 629 +++++++++++++++++++++++++++++++++++++++
2 files changed, 653 insertions(+)
create mode 100644 usb-file-manager.docs.md
create mode 100644 usb-file-manager.html
diff --git a/usb-file-manager.docs.md b/usb-file-manager.docs.md
new file mode 100644
index 0000000..8e16c2c
--- /dev/null
+++ b/usb-file-manager.docs.md
@@ -0,0 +1,24 @@
+A WebUSB-based file manager that allows you to browse, view, and edit files on USB devices directly from your web browser. Connect a compatible USB device, navigate through directories, edit text files, and manage content without installing any software.
+
+The tool uses the WebUSB API to communicate with USB devices that expose a file system interface. This includes devices with Mass Storage Class (MSC) implementations or custom vendor-specific protocols. You can upload files from your computer to the device, download files from the device, and edit text files in-place with a built-in code editor.
+
+**Browser Requirements:** This tool requires a Chromium-based browser (Chrome, Edge, Opera, or Brave) with WebUSB support enabled.
+
+**Device Compatibility:** The device must support WebUSB and expose a file system interface. The current implementation includes mock data for demonstration purposes. To connect a real device, the USB communication protocol needs to be adapted to match your device's specific protocol (MTP, MSC, or vendor-specific).
+
+**Features:**
+- Browse files and directories on USB devices
+- View and edit text files with syntax highlighting
+- Upload files from your computer to the device
+- Download files from the device to your computer
+- Navigate through directory structures with breadcrumb navigation
+- Drag-and-drop file upload support
+
+**Implementation Note:** The actual USB communication protocol varies by device. Common protocols include:
+- **MTP (Media Transfer Protocol)** - Used by Android devices and many modern storage devices
+- **MSC (Mass Storage Class)** - Standard USB storage protocol
+- **Vendor-specific protocols** - Custom protocols for specialized devices like MicroPython boards
+
+To adapt this tool for a specific device, you'll need to implement the appropriate USB communication protocol in the `readFile()`, `writeFile()`, and `listFiles()` functions.
+
+
\ No newline at end of file
diff --git a/usb-file-manager.html b/usb-file-manager.html
new file mode 100644
index 0000000..a96283b
--- /dev/null
+++ b/usb-file-manager.html
@@ -0,0 +1,629 @@
+
+
+