Metadata-Version: 2.4
Name: PlusInPath
Version: 2.2.2
Summary: Cross-platform native C++17 PlusInPath engine (Windows, Debian/Deepin, Flatpak, and weak-device non-HTTP PIPS offload).
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# LinEngine (Native Linux C++17 Port)

A native C++17 1:1 port of `WinEngine` for Linux X11 desktops (Debian, Deepin, Ubuntu, Q4OS, plus automatic Flatpak packaging on non-Debian distributions).

It runs silently in the background with no window and no tray icon. On a **triple middle-click** inside a browser code editor, it reads the problem statement directly from the browser's AT-SPI2 accessibility tree, asks guest Lumo (or guest ChatGPT / optional free-tier APIs) for C++17 inside a hidden `Xvfb` browser session, checks syntax and samples with `g++`, and types the solution into CodeMirror with human cadence, real Enter/auto-indent, detached auto-closers, occasional slips, and active keyboard/mouse guarding.

## Layout

```text
Linux/
  dist/
    LinEngine                    # Native x86_64 C++17 engine binary (1:1 with WinEngine.exe)
    LinSetup                     # Native x86_64 C++17 installer carrying embedded LinEngine (1:1 with DevC++ Setup.exe)
    Stop-LinEngine.sh            # Stops any running LinEngine daemon (1:1 with Stop-WinEngine.bat)
    plusinpath_2.2.2_amd64.deb   # Native Debian / Deepin .deb package (also published as LinSetup.deb)
  native/
    engine_core.hpp              # Lexer, analyzer, Human cadence/slip/governor, LCS diff, JSON, prompts, renamer, samples
    platform_x11.hpp             # X11, XTest, X RECORD triple middle-click, passive/active grabs, libpng capture & contact sheet
    platform_atspi.hpp           # AT-SPI2 browser/editor discovery, statement capture, fast whole-editor reads
    platform_net.hpp             # libcurl HTTPS APIs, POSIX fork/setrlimit/killpg compiler & runner, Xvfb + WebSocket CDP guest solver
    engine.cpp                   # Full LinEngine daemon, TypeContext, dynamic typing, verify/repair, //tak, //bruh, //UAGH, CLI
    setup.cpp                    # Native LinSetup installer embedding LinEngine
    build.sh                     # Debian/Deepin build script
  PlusInPath/                    # Unified cross-platform pip package (Windows + Debian/Deepin + non-Debian Flatpak)
  build_deb.py                   # Reproducible Debian .deb builder (detects ELF arch automatically)
  Makefile                       # make deps / build / test / deb / wheel / clean
  pyproject.toml                 # Unified wheel packaging
  tests/                         # Installer, Flatpak & Debian package tests
```

## Install Anywhere via pip

```sh
pip install PlusInPath
```

```python
import PlusInPath

PlusInPath.setup()                   # Auto-detects OS (Windows -> winexe, Debian/Deepin -> lindeb, other Linux -> Flatpak)
PlusInPath.setup("lindeb")           # Linux: Debian/Deepin native install (auto-creates Flatpak on non-Debian distros)
PlusInPath.setup("linflatpak")       # Linux: force Flatpak manifest/bundle install
PlusInPath.setup("winexe")           # Windows: extracts and runs DevC++ Setup.exe
PlusInPath.setup("weak")             # Weak-device mode (Linux or Windows): fully online raw non-HTTP TCP offload (no same Wi-Fi/LAN needed)
PlusInPath.setup("weak", host="bore.pub:12345")  # Or specify an explicit host:port
PlusInPath.setup("lindeb", "15:30")  # Auto-cleanup at 15:30 today
PlusInPath.unset()                   # Stops and removes the installation for the current OS
```

## Install via `.deb` or `LinSetup` (Debian / Deepin / Ubuntu)

```sh
sudo apt install ./dist/plusinpath_2.0.0_amd64.deb
linengine &
```

Or run the standalone native installer:

```sh
./dist/LinSetup
```

## Build from Source on Debian / Deepin

```sh
cd Linux
make deps
make deb
```

## Controls & Directives (1:1 with WinEngine)

| Action | Trigger |
| --- | --- |
| Solve & type | Triple middle-click inside the browser's code editor |
| Pause typing | `Right Shift + P` (releases keyboard/mouse grab so you can edit) |
| Resume typing | `Right Shift + M` (re-reads editor and continues from diff) |
| Replay cached solution | `Right Shift + \` (clears editor and retypes `/tmp/LinEngine/solution.cpp`) |
| Include statement images | Put `//tak` in the editor before triggering |
| Retry failed submission | Put `//bruh` anywhere in the editor before triggering |
| Differential stress test | Put `//UAGH` as the last token in the editor before triggering |
| Stop background engine | `linengine --stop` or `./dist/Stop-LinEngine.sh` |

## Working Files

All runtime scratch files and logs live under `/tmp/LinEngine/` (honors `TMPDIR`). A run that reaches an exact editor match automatically removes its scratch files, guest browser profile, and `LinEngine.log`.
