cj-tauri: A 10MB AI Desktop Client Built on Cangjie + System WebViews Instead of Electron
Desktop AI clients don't have to ship 100MB of Chromium. cj-tauri shows a working alternative that stays under 10MB, uses system WebViews, and adds a permission model stricter than Tauri's—events are whitelisted too, and any outbound host not in the manifest requires explicit runtime approval. For teams shipping cross-platform desktop tools on Windows, Linux, or HarmonyOS PC, this is a concrete benchmark for size, security, and multi-platform single-codebase delivery.
cj-tauri reimplements Tauri's architecture in Huawei's Cangjie language, swapping Rust for a static-compiled backend and keeping the same system-WebView strategy (WebView2, WebKitGTK, or ArkWeb). The result is single-file desktop executables that stay under 11 MB for real applications, with no Chromium bundled. And it treats HarmonyOS PC as a first-class target, so the same business code builds for Windows, Linux, and HarmonyOS PC.
The security model is stricter than Tauri 2's in several places: events also require whitelisting, path scopes are deny-before-allow, outbound network hosts are whitelisted with "not specified = all denied," and runtime allowlisting rejects wildcards. Every claim is backed by re-runnable test cases.
The ai-chat example is a template-level application: it combines direct OpenAI-compatible streaming chat, a local agent (cjh) over WebSocket, and nine web AI services as in-window embedded WebView tabs (not iframes, because third-party cookies and X-Frame-Options break login). It also demonstrates one-click cjh deployment with local SHA256 verification, model pass-through with per-round API keys, dangerous-operation approval cards, and a single-file Windows distribution.
The security model deliberately goes beyond Tauri 2: event ACLs, path deny-before-allow, and runtime allowlisting that rejects wildcards close holes that typical Tauri apps leave open.
The decision to embed external web AI services as native WebViews rather than iframes is an honest acknowledgment of third-party cookie and X-Frame-Options behavior, and it preserves login state without a workaround.
Passing the API key per turn instead of persisting it on the agent side is a practical fix for multi-vendor setup: with multiple providers, a single global key would silently send the wrong credentials to the wrong endpoint.
The 'deny before allow' filesystem scope in ai-chat shows a product-level choice: the file panel is for preview only, so even a user's own home directory is off-limits for SSH keys and credentials.
Treating the web tab as a native control that must be manually rectangle-reported (with 80ms throttling) is an honest trade-off for embedding multiple WebViews in one window, making the layout complexity visible.