# AGENTS.md Conventions for working in this repository. ## Version control - Use `jj`, never `git`. - Run `jj util snapshot --quiet` after every series of edits, and **always before running any `nix` command** — nix may not see unsnapshotted changes. ## Environment - All tooling lives in the Nix devshell: `nix develop` (Go 1.27, gomobile pinned in `flake.nix`, JDK 21, Gradle 8.14, Android SDK platform 26+35, NDK). `ANDROID_HOME`, `ANDROID_NDK_HOME`, `JAVA_HOME` are set by the shell hook, which also installs the pinned gomobile into `.tools/bin`. - Verify the toolchain before building on it: `nix develop -c go version`, `nix develop -c gradle --version`. ## Language constraints - Android (non-Go) code is **Kotlin + Jetpack Compose only**. - Go is allowed only in `tsbridge/` (server + tsnet + gomobile surface). - The webapp is vanilla ESM JavaScript; no npm, no bundler, no build step. It lives in the top-level `webapp/` directory (independent of tsbridge, which serves any directory it is pointed at); `buttplug.mjs` is vendored under `webapp/vendor/`. - No other languages (no Node, no Rust). ## Gotchas - The gomobile-bound surface (`tsbridge` package exports) must only use bindable types (strings, ints, errors). Anything else must stay unexported. - `compileSdk`/`targetSdk` (35) must match the platform versions in `flake.nix`; AGP/Gradle compatibility notes live in `gradle/libs.versions.toml` and `tsbridge/README.md`.