Skip to content

02. Tech Stack ​

1. Stack table ​

LayerTechBaselineNotes
Desktop shellElectronlatest stable (pin at impl)app shell
UIReact 19 + TypeScriptmodern stableEnglish-first UI
Bundlerelectron-vite / Vitestablemulti-entry build
StylingTailwind CSS 4stableutility-first
StateZustandstableUI state
Host backendRuststable Rust toolchaintools/plugins/permissions/persistence adapters
Rust asynctokiostablehost services
Host RPCstdio JSON-RPC (NDJSON)frozen (D001)Electron main ↔ Rust host
Agent engine@earendil-works/pi-agent-core0.86.1agent loop
Model API@earendil-works/pi-ai0.86.1provider adapters, OAuth, and stream handling
Model cataloghttps://models.dev/api.jsonbundled release snapshot + process-local refreshsole provider/model metadata source

pi-ai is not consulted for model names, capabilities, limits, modalities, thinking levels, or prices. It remains the request transport dependency. ChatGPT Plus/Pro and GitHub Copilot OAuth availability still comes from the pinned pi-ai catalog; 0.86.1 includes the gpt-6-astra catalog entry. The 0.86.1 pi-ai catalog also registers Meta/Muse subscription OAuth; Desktop enumerates it dynamically rather than maintaining a separate vendor list.

| Node runtime | Node.js | >= 22.19 | pi requirement | | DB | SQLite | Rust host-core via rusqlite | sessions/settings | | Packaging | electron-builder | stable | macOS arm64 and Intel x64, Windows x64, and Linux x64 release lanes | | Package manager | pnpm | 11.18.x | JS monorepo | | Lint/test | style-token checker (scripts/check-style-tokens.mjs) + vitest + cargo test; general JS linter still open (biome vs oxlint) | stable | dual stack quality | | Schema (TS) | typebox | frozen (D011) | shared contracts | | i18n | i18next + react-i18next | frozen (D012) | English source locale |

2. Language policy in engineering ​

  • Product strings: English source
  • Specs/ADRs: English primary
  • Code identifiers: English
  • Commits/issues/PRs: English preferred

3. Why Rust host core ​

  • stronger sandboxing foundation
  • better process/fs control
  • long-term native performance and safety
  • cleaner privilege separation from UI and model runtime

4. Why keep pi in Node/TS ​

  • mature multi-provider support
  • existing agent event model
  • skills/extensions ecosystem leverage
  • avoid rewriting agent framework

5. Dependency boundaries ​

Allowed ​

  • official pi packages
  • mainstream Electron/React ecosystem
  • Rust crates for fs/process/sqlite/rpc/serde

Careful ​

  • heavy native node addons
  • multiple competing RPC frameworks
  • large editor stacks too early (Monaco)

Not in MVP ​

  • remote gateway frameworks
  • marketplace backend
  • custom LLM provider SDK replacing pi-ai

Production packaging boundary ​

  • Renderer-only libraries are development/build dependencies because Vite bundles their runtime code and lazy assets into out/renderer.
  • Electron Main bundles pure-JS workspace packages. Packages that require runtime module resolution or a native ABI remain production dependencies; the current external set includes only electron-updater.
  • Resources/agent-runtime/sidecar.js is the only independent pi sidecar bundle. The complete @pi-desktop/agent-runtime package tree must not be copied into ASAR as a second runtime.
  • The desktop package has no interactive PTY dependency. Agent Bash remains a non-interactive runtime capability owned by the agent sidecar.
  • Dependency source maps, tests, examples, and declarations are build inputs, not release assets. License and notice files remain distributable.
  • Lazy renderer capabilities such as Mermaid, KaTeX, and Shiki remain local assets; package-size optimization must not introduce runtime CDN fetches.

6. Build matrix (MVP) ​

  • JS workspace build (pnpm)
  • Rust host build (cargo)
  • integration smoke (pnpm dev boots all layers)

Local-first · Model-agnostic · Plugin-powered. AIUO.NET