# turing-complete-manager **Repository Path**: jialanhu/turing-complete-manager ## Basic Information - **Project Name**: turing-complete-manager - **Description**: Desktop save manager for Turing Complete — backup, auto-backup, level editor (Tauri 2 + vanilla TS) - **Primary Language**: Rust - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-07 - **Last Updated**: 2026-08-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Turing Complete Manager A lightweight desktop app for the game *Turing Complete*. Backup and restore your save directory, toggle level completion flags, swap the in-game dialogue portraits, and read/write `circuit.data` files — all from a Tauri 2 shell. Auto-backups catch your progress. > Not affiliated with, endorsed by, or sponsored by the makers of *Turing Complete*. All game-related content (level IDs, names, translations) is read from the user's local game installation and belongs to its respective owners. ## Features - **Whole-directory backup / restore** — snapshots your entire save directory into a single zip, with timestamps. - **Auto-backup** — configurable interval (1–1440 min) and retention count (1–999). Hot-backup supported; runs while the game is open. - **Level editor** — flip the completion flag on any level via `levels.txt`. Other fields stay byte-perfect; originals are auto-backed up to `/levels_backups/`. - **Level names in your language** — names are pulled directly from the game's own `translations/` files (English + Simplified Chinese); no separate translation table to maintain. - **Bilingual UI** — Simplified Chinese and English, switchable at runtime. - **Character / portrait replacement** — swap the mentor's `neutral` / `smile` PNGs in `/asset/dialogue/`. Ships with two built-in characters (`robot`, `steve`); users can create / duplicate / delete / upload their own. Originals are snapshotted on first apply and can be restored at any time. - **Circuit codec round-trip** — list schematics per level, read / write `circuit.data` (v15) via the bundled `tc-mod-sdk`. The on-disk format matches what the game writes; other fields stay byte-perfect. - **First-run wizard** — detects the default save directory (`%APPDATA%\Turing Complete`) and suggests the install-dir `backups` subfolder. ## Tech stack - [Tauri 2](https://tauri.app/) — native shell, Rust backend - Vanilla TypeScript + Vite — no UI framework - Rust crates: `zip`, `walkdir`, `chrono`, `serde`, `serde_json`, `base64`, `uuid` - **[`tc-mod-sdk`](tc-mod-sdk/)** (path dep) — circuit.data codec + bindings into the game's `compile.dll` - MSI installer via WiX 3.14 (vendored at `src-tauri/WixTools314/`) ## Prerequisites - Node.js 18+ - Rust stable (`rustup default stable`) - Windows 10/11 (uses `tasklist.exe` to detect the running game; `reg.exe` to find Steam install) - *Turing Complete* installed via Steam (for level-name translation; the rest of the app works without it) ## Development ```bash npm install npm run tauri dev ``` Runs the app in dev mode with hot-reload. ## Build the installer ```bash npm run tauri build ``` If you're behind a proxy (e.g., mainland China), set the proxy so the Tauri CLI can fetch from GitHub on first build: ```bash HTTPS_PROXY=http://127.0.0.1:7897 HTTP_PROXY=http://127.0.0.1:7897 npm run tauri build ``` The output is in `src-tauri/target/release/bundle/msi/`: - `Turing Complete Manager_0.3.0_x64_zh-CN.msi` - `Turing Complete Manager_0.3.0_x64_en-US.msi` ## Tests ```bash cd src-tauri && cargo test --lib # 18 unit tests npx tsc --noEmit # type check ``` ## Configuration Stored at `%APPDATA%\turing-complete-manager\config.json`. Editable via the UI's **配置** / **Configuration** panel; **重置配置** / **Reset** re-opens the wizard. | Key | Default | Notes | |---|---|---| | `save_dir` | `%APPDATA%\Turing Complete` | Where *Turing Complete* stores saves | | `backup_dir` | `%APPDATA%\turing-complete-manager\backups` | Where the app writes `.zip` snapshots | | `language` | `zh-CN` | `zh-CN` or `en-US` | | `auto_backup_enabled` | `false` | Toggle the background scheduler | | `auto_backup_interval_min` | `30` | 1–1440 | | `auto_backup_keep` | `20` | Oldest are pruned when exceeded | | `game_dir` | `null` (auto-detected on startup) | Game install path, cached after first detection | | `game_dir_source` | `auto` | `auto` (Steam detection) or `manual` (user-specified, not overwritten by re-detect) | A separate cached file, `level_names.json`, lives next to `config.json`. It is rebuilt automatically when the source `translations/` directory changes (mtime check). ## Project structure ``` . ├── index.html # single-page UI ├── src/ # frontend (TS + CSS) │ ├── main.ts # app shell, view switching (backup / character / levels / config) │ ├── i18n.ts # translation tables + t() / tErr() │ ├── character.ts # character list / canvas matting / upload flow │ └── styles.css ├── src-tauri/ │ ├── src/ │ │ ├── lib.rs # Tauri commands, auto-backup loop, warm-up of game_dir cache │ │ ├── backup.rs # zip / unzip / list / delete │ │ ├── levels.rs # levels.txt parser & editor │ │ ├── translations.rs # Steam path + translation file parser │ │ ├── config.rs # AppConfig load / save, game-dir detection │ │ └── character.rs # built-in / custom character registry, snapshot/restore │ ├── default_characters/ # bundled characters (steve, robot) — ships in the MSI │ ├── WixTools314/ # vendored WiX (for offline MSI builds) │ └── tauri.conf.json ├── tc-mod-sdk/ # sibling crate: circuit.data codec + compile.dll bindings ├── tc-mod-hook/ # sibling crate: x64 inline-hook SDK for mod DLLs (see its README) ├── sim-shim/ # Nim C-ABI shim DLL wrapping compile.dll::compile ├── docs/ # research wiki (Chinese; see docs/00-overview.md) ├── todo/ # work tracking (completed / in_progress / planning) ├── reference/ # vendored upstream repos (Stuffe/save_monger, Stuffe/isa_spec; gitignored) └── package.json ``` ### Sub-projects The top-level app is the consumer. These siblings are independent and have their own READMEs: - **[`tc-mod-sdk/`](tc-mod-sdk/)** — Rust SDK: `circuit.data` v15 read/write (v7/v13/v14 read-only), and the bindings that drive the game's own `compile.dll`. Consumed by the main app via path dep; also usable standalone (`cargo run --bin test --`). - **[`tc-mod-hook/`](tc-mod-hook/)** — x64 inline-hook SDK. Injects a hook DLL into the running game process and exposes a `Mod` trait + `CompileCtx` so external mod DLLs can observe / mutate every `compile()` call. End-to-end working with the real game (Turing Complete v2.1.305, verified 2026-08-19). - **[`sim-shim/`](sim-shim/)** — Nim C-ABI shim around `compile.dll::compile`. Lets the SDK (and the Tauri app) call the game's JIT compiler through a stable C ABI without depending on Nim types. - **[`reference/`](reference/)** — vendored copies of [`Stuffe/save_monger`](https://github.com/Stuffe/save_monger) (CC0) and [`Stuffe/isa_spec`](https://github.com/Stuffe/isa_spec) (MIT). These are the authoritative sources for the on-disk formats; `tc-mod-sdk` is ported from them. - **[`docs/`](docs/)** — research wiki in Chinese. Investigation notes on the game's DLL structure, replay format, component catalog, level data, circuit.data format, hint system, and the simplex language. Design docs live under `docs/20-design/`. - **[`todo/`](todo/)** — dated task notes (completed / in_progress / planning). Currently in progress: addressing the issues from the 2026-08-23 code review of `tc-mod-hook` + `tc-mod-sdk`. ## License [MIT](LICENSE) © 2026 jialanhu0915