Edgemode Device Bridge
======================

Lets Edgemode Code Studio (web) work on a project folder on THIS PC and run commands there
(a real terminal, builds, tests). Without it, Code Studio can still edit a folder you open in
Chrome or Edge, but it can't run commands.

1. Start it (needs Python 3.10+, no packages) in one of these ways:
   - in Terminal / PowerShell:   py "<folder>\edgemode_bridge.py"
   - double-click edgemode_bridge.py
   - double-click "Device Bridge.bat". Windows Smart App Control blocks downloaded .bat files: use one of
     the ways above, or right-click the zip > Properties > tick "Unblock" BEFORE extracting it.
   No Python yet?  winget install Python.Python.3.12
2. Choose the project folder to share.
3. In Code Studio: Settings > Project access > Device Bridge, type the 6-digit code shown in the
   bridge window and press Pair. Then Chat > Project > Device Bridge.

Safety
- Only this PC can reach it (127.0.0.1), and only the exact Code Studio web addresses it accepts
  (https://code-studio.edgemode.ai, and http://127.0.0.1:7864 / localhost:7864 for a Code Studio on
  this PC). Add another address (one exact address, no wildcards) with:
      "Device Bridge.bat" --allow-origin https://your-studio-address
- Pairing: the code is good for 10 minutes and 5 tries, then a new one is shown. After 10 wrong
  codes pairing is off until you restart the bridge. A pairing works only for the address that made it.
- Nothing outside the shared folder can be read, changed or run.
- Every change and command is approved by you in Code Studio first (Allow once / Allow all / Deny).
  Dangerous commands are refused here too. Deletes go to .edgemode-trash in the project.
  Commands YOU type in the Terminal tab skip most of those blocks (not the credential/disk ones).
- Every operation is shown in the bridge window. Close the window to stop sharing.
- Start with --forget-pairings to remove all pairings.
