01 Same-origin device endpoints you can fetch()

These need no wrapper. They are on the same origin as the page.

- GET /api/status: {version, firmwareFamily, pluginApi, pluginCapabilities, ip, mode, rssi, freeHeap, uptime, device}
- GET /api/status?plugin=<name>: adds deviceId: a stable 64-hex id, unique per device and per plugin. Useful for "register this reader" flows.
- GET /api/plugins: the installed plugins list
- GET /api/files?path=/Books: [{name, size, isDirectory, isEpub}] (dotfiles hidden unless that setting is on)
- GET /download?path=...: read a file
- POST /upload?path=/dir: multipart upload (file field)
- POST /mkdir: form: name, path (parent)
- POST /rename: form: path, name (files only)
- POST /move: form: path, dest (existing folder; files only)
- POST /delete: form: path, or paths (JSON array). Folders must be empty.
- GET /api/settings?keys=a,b: read specific reader settings (value of an enum is an index into options)
- POST /api/settings: JSON {"key": value} partial update
- POST /api/book-key: store a content key for a protected book (DRM plugins)

Form endpoints take application/x-www-form-urlencoded:

  const form = (o) => new URLSearchParams(o);
  await fetch('/mkdir', { method: 'POST', body: form({ name: 'Articles', path: '/Books' }) });
  await fetch('/move',  { method: 'POST', body: form({ path: '/a.epub', dest: '/Books/Articles' }) });
Reader file (.txt)