Find a file
C.J. Wu cf7fce2e4e
Merge pull request #98 from Darkatse/dev
Bump version to 2.1.1
2026-06-19 11:51:15 -04:00
.agents Refactor the architecture; synchronize with upstream Sillytavern version 1.15.0. 2026-02-10 17:04:12 -05:00
.github/workflows fix(ci): use pnpm 10 for prerelease builds 2026-06-05 01:49:17 +08:00
.vscode Initial backend refactor to Rust with Clean Architecture 2025-05-09 18:00:59 +08:00
default Merge branch 'sync/upstream-1.18.0' into next/2.0.0 2026-05-20 19:13:09 +08:00
docs fix(agent): refresh model target LLM connections before runs 2026-06-19 22:07:41 +08:00
example/agents/instruct_prompt example: add recommend agent instruction of deepseek-v4-series example/agents/instruct-prompt_EN 2026-05-07 15:48:48 +08:00
fastools fix(fastools): use standard arm64-v8a APK artifact ABI #89 2026-06-10 11:19:12 +08:00
scripts build: migrate frontend bundling from webpack to Rspack 2026-06-12 02:21:37 +08:00
src fix(agent): refresh model target LLM connections before runs 2026-06-19 22:07:41 +08:00
src-tauri chore (version): bump version to 2.1.1 2026-06-19 22:10:41 +08:00
tests fix(agent): refresh model target LLM connections before runs 2026-06-19 22:07:41 +08:00
.gitattributes git: add .gitattributes 2026-03-11 01:09:44 -04:00
.gitignore chore: ignore local .cursor/ skill workspace 2026-05-18 20:02:50 +08:00
.taurignore perf: package size optimization 2026-02-24 10:42:10 +08:00
ExtensionDEV.md feat (api): Add mobile layout API 2026-04-05 23:20:02 -04:00
LICENSE Initial commit 2025-04-17 21:13:08 +08:00
package.json chore (version): bump version to 2.1.1 2026-06-19 22:10:41 +08:00
pnpm-lock.yaml build: migrate frontend bundling from webpack to Rspack 2026-06-12 02:21:37 +08:00
pnpm-workspace.yaml feat(frontend): sync SillyTavern 1.18 baseline 2026-05-13 23:49:06 +08:00
README.md build: migrate frontend bundling from webpack to Rspack 2026-06-12 02:21:37 +08:00
README_EN.md build: migrate frontend bundling from webpack to Rspack 2026-06-12 02:21:37 +08:00
rspack.config.js feat(agent): add run history UI and refactor timeline/runtime adapters 2026-06-14 11:44:08 +08:00
tsconfig.host.json Refactoring (Frontend): Standardized frontend refactoring, incorporating code contracts. 2026-03-11 19:51:17 -04:00

TauriTavern

One-stop download link

TauriTavern ports SillyTavern into a native desktop app with Tauri v2 + Rust backend while keeping the upstream frontend experience. The frontend is now synced to SillyTavern 1.16.0 and integrated through a modular Tauri injection layer.

TauriTavern hero

Highlights

  • Native desktop runtime on Windows, macOS, Linux (Tauri v2)
  • Rust backend with clean architecture layering
  • Frontend compatibility with SillyTavern 1.16.0
  • Chat Completion providers: OpenAI, Claude, Gemini(MakerSuite), and Custom OpenAI-compatible endpoint
  • Modular request injection pipeline (src/tauri/main/*), organized as a maintainable Host Kernel layering (context/kernel/services/adapters/routes)
  • Stable platform ABI: window.__TAURITAVERN__ + request tracing header: x-tauritavern-trace-id
  • Engineering guardrails: strict type checks (tsc -p tsconfig.host.json) + dependency/line-budget rules (routes must not reference window)
  • Unified frontend bootstrap pipeline without runtime loader indirection

Architecture

Backend (src-tauri)

  • presentation: Tauri commands and API boundary
  • application: use cases/services and DTO orchestration
  • domain: core models, contracts, errors
  • infrastructure: file persistence, repositories, logging

Frontend (src)

  • Upstream SillyTavern frontend code (HTML/CSS/JS)
  • Tauri bridge and interception layer for replacing HTTP endpoints with local Tauri command calls

Frontend startup flow:

  1. src/init.js loads lib.js -> tauri-main.js -> script.js
  2. src/lib.js statically imports src/dist/lib.core.bundle.js and re-exports a stable ESM library surface (heavy/optional libs are loaded on demand via getHljs()/getReadability() from src/dist/lib.optional.bundle.js)
  3. src/tauri-main.js delegates to bootstrapTauriMain()
  4. src/tauri/main/bootstrap.js creates context/router/interceptors, installs the window.__TAURITAVERN__ platform ABI, and injects a trace header for host-handled routes

Frontend Integration Layout

src/
├── tauri-bridge.js              # low-level Tauri bridge (invoke/listen/convertFileSrc)
├── tauri-main.js                # thin bootstrap entry
├── init.js                      # startup orchestrator
├── lib.js                       # library facade (ESM exports)
├── dist/lib.core.bundle.js      # Rspack-built core vendor bundle (startup-critical)
├── dist/lib.optional.bundle.js  # Rspack-built optional vendor bundle (on-demand)
└── tauri/main/
    ├── bootstrap.js             # composition root
    ├── context.js               # compatibility shim (re-export `context/index`)
    ├── context/                 # host kernel facade + types (stable contract)
    ├── kernel/                  # pure logic (policies/tracing/hash/...)
    ├── services/                # stateful capabilities (assets/thumbnails/characters/android…)
    ├── adapters/                # adapters touching window/DOM/upstream ST
    ├── http-utils.js            # request/response parsing helpers
    ├── interceptors.js          # fetch/jQuery ajax patching
    ├── router.js                # lightweight route registry
    └── routes/
        ├── system-routes.js
        ├── settings-routes.js
        ├── extensions-routes.js
        ├── resource-routes.js
        ├── character-routes.js
        ├── chat-routes.js
        └── ai-routes.js

Development

Prerequisites:

  • Rust stable
  • Node.js 22.12+
  • pnpm
  • Tauri CLI

Setup:

git clone https://github.com/Darkatse/tauritavern.git
cd tauritavern
pnpm install

Common commands:

pnpm run check             # guardrails + host-kernel type checks (recommended)
pnpm run web:build         # build frontend bundles (Rspack)
pnpm run dev           # desktop dev mode (alias of tauri:dev)
pnpm run tauri:dev     # desktop dev mode
pnpm run tauri:build   # build desktop installers
pnpm run android:dev   # Android dev mode
pnpm run ios:dev       # iOS dev mode

Portable build notes:

  • pnpm run tauri:build:portable outputs to release/ by default
  • You can force portable runtime mode via TAURITAVERN_RUNTIME_MODE=portable or portable.flag
  • On Windows, portable users must ensure WebView2 runtime is available

FasTools (Debug Utility)

fastools is an useful toolkit that facilitates debugging during development and desktop deployment.

Build:

pnpm run fastools:build

Run:

  • pnpm run fastools:run

If you prefer cargo directly, run from repository root:

cargo build --release --manifest-path fastools/Cargo.toml
cargo run --manifest-path fastools/Cargo.toml

Documentation

  • docs/FrontendGuide.md: frontend architecture and extension guide
  • docs/FrontendHostContract.md: public host-kernel contract (keep stable during refactors)
  • docs/BackendStructure.md: backend architecture details
  • docs/TechStack.md: stack and integration choices
  • docs/ImplementationPlan.md: roadmap and milestones

License

AGPL-3.0 (same license family as SillyTavern).

Acknowledgements