graphone Svelte Themes

Graphone

Native desktop coding agent for Windows & Linux. Chat interface for local & remote LLMs. Built with Tauri 2.0 and Svelte 5.

Graphone - Pi-Tauri Cross-Platform Agent

A unified cross-platform interface for the pi-mono coding agent, built with Tauri 2.0. This project provides native applications for Desktop (Windows, macOS, Linux) using a sidecar pattern with the pi-mono agent.


Overview

Graphone provides a desktop interface for the pi-mono coding agent using Tauri's sidecar pattern:

Platform Pattern Mechanism
Desktop Sidecar Rust backend spawns Graphone host sidecar (pi-agent) as managed subprocess

Key Features

  • šŸ¤– Unified Interface - Consistent chat UI for desktop platforms
  • šŸ–„ļø Desktop Apps - Native Windows, macOS, and Linux applications
  • ⚔ Streaming Responses - Real-time agent output
  • šŸ”’ Local-First - Works with local and remote LLM providers
  • šŸ“¦ Auto-Bundled Agent - pi-mono binary is built automatically during Tauri build

Contributor notes:

  • See CONTRIBUTING.md for repository workflow and staging guidance.

Architecture

pi-mono Sidecar (Node.js/TypeScript)

Important: pi-mono is a Node.js/TypeScript project, not a Rust project. It's built into a standalone binary using bun:

Frontend (Svelte) ←→ Tauri Commands ←→ Rust Backend ←→ Graphone host sidecar (bun-compiled)
                                                                   ↓
                                                         stdin/stdout JSON protocol

The host sidecar is built automatically during Tauri builds via src-tauri/build.rs.

Graphone compiles services/agent-host/dist/cli.js to a standalone binary with bun. Runtime SDK assets are copied from the pinned npm dependency (node_modules/@mariozechner/pi-coding-agent).

Build Process:

  1. Build host sidecar source (services/agent-host)
  2. Compile dist/cli.js using bun build --compile
  3. Copy binary + runtime assets to src-tauri/binaries/
  4. Tauri bundles the binary as a sidecar for distribution

Prerequisites

System Requirements

  • OS: Linux (development), Windows 11 + WSL2, macOS
  • Node.js: 20+ (LTS recommended)
  • bun: 1.0+ (Required for sidecar compilation)
  • Rust: Latest stable (1.84+)

Platform-Specific

Target Requirements
Linux Desktop libgtk-3-dev, libwebkit2gtk-4.1-dev, libappindicator3-dev, clang, lld
Windows cargo-xwin, nsis, lld, llvm for cross-compilation (from WSL2)

Build Configuration

The project uses lld (LLVM linker) for faster linking on Linux and Android targets. Cross-compilation for Windows uses cargo-xwin which automatically handles the Windows SDK libraries and linker configuration.

Configured in src-tauri/.cargo/config.toml:

# Linux x86_64: Use lld for faster linking
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

# Windows x86_64: Use cargo-xwin (no linker config needed)
# cargo-xwin is invoked via --runner flag
# This is handled automatically by npm run build:windows

# Android targets: Use lld
[target.aarch64-linux-android]
linker = "lld"

Windows Cross-Compilation:

# Install NSIS (required for creating Windows installers on Linux)
sudo apt install nsis lld llvm

# Install cargo-xwin (downloads Windows SDK automatically)
cargo install cargo-xwin

# Build for Windows (creates NSIS installer, not MSI)
npm run build:windows

Important: MSI installers can only be created on Windows. Cross-compilation from Linux creates NSIS installers (-setup.exe).

Required Tools

# Install bun (required for sidecar compilation)
curl -fsSL https://bun.sh/install | bash

# Verify bun installation
bun --version  # Should show 1.0+

Quick Start

1. Clone and Setup

Repository Structure:

projects/
└── graphone/         # This repository
# Navigate to project
cd graphone

# Install dependencies
npm install

2. Build Sidecar (Automatic)

The sidecar is built automatically when you run Tauri commands. The build script (src-tauri/build.rs) handles:

  • Building Graphone host sidecar source (services/agent-host)
  • Compiling dist/cli.js with bun build --compile
  • Copying binary + runtime assets to the Tauri binaries directory

3. Run Development Server

# Desktop (Linux) - recommended shorthand
npm run dev:linux

# Desktop (Windows cross-compile from WSL2)
npm run dev:windows

# Legacy command
npm run tauri dev

4. Build for Production

Quick Build Commands:

# Linux only
npm run build:linux

# Windows only (cross-compile from WSL2)
npm run build:windows

# Both platforms
npm run build:all

Legacy commands (equivalent):

# Linux
npm run tauri build

# Windows (from WSL2)
npm run tauri build -- --target x86_64-pc-windows-msvc

Project Structure

graphone/
ā”œā”€ā”€ apps/
│   └── desktop/
│       └── web/                      # Svelte frontend application
│           ā”œā”€ā”€ src/                  # Routes, components, stores, handlers
│           └── static/               # Static frontend assets
ā”œā”€ā”€ src-tauri/                        # Rust/Tauri desktop shell
│   ā”œā”€ā”€ src/                          # Commands, sidecar bridge, state
│   ā”œā”€ā”€ binaries/                     # Sidecar binaries + runtime assets (auto-populated)
│   ā”œā”€ā”€ capabilities/                 # Tauri permissions (desktop/mobile)
│   ā”œā”€ā”€ build.rs                      # Builds bundled sidecar binary via bun
│   ā”œā”€ā”€ Cargo.toml
│   └── tauri.conf.json
ā”œā”€ā”€ services/
│   └── agent-host/                   # Graphone host sidecar source (TypeScript)
│       ā”œā”€ā”€ src/
│       └── dist/
ā”œā”€ā”€ tooling/
│   └── scripts/                      # Build/run/verification helpers
ā”œā”€ā”€ reports/                          # Benchmark and measurement output
└── package.json

Frontend canonical paths:

  • apps/desktop/web/src
  • apps/desktop/web/static

Canonical repo map (quick):

  • apps/desktop/web → Svelte frontend workspace
  • src-tauri → Rust/Tauri desktop shell
  • services/agent-host → bun-compiled host sidecar source
  • tooling/scripts → build/run/verification helpers

Development

WSL2 Development

This project is developed in WSL2 on Windows 11.

Critical: Keep the project in the Linux filesystem (e.g., /home/username/projects/), NOT in /mnt/c/ (Windows filesystem) - performance difference is 10-100x.

Sidecar Build Process

The sidecar binary is built automatically via src-tauri/build.rs:

  1. Dependency Check: Verifies bun is installed
  2. Host Build: Builds Graphone host source (services/agent-host)
  3. Compile: Runs bun build --compile ./dist/cli.js
    • Uses an explicit bun target when cross-compiling Windows from Linux
  4. Copy: Places the binary in src-tauri/binaries/ with Tauri sidecar naming
  5. Assets: Copies runtime assets (package.json, docs/examples, theme, export-html, photon_rs_bg.wasm) from @mariozechner/pi-coding-agent

Environment Variables:

  • CARGO_MANIFEST_DIR: Used to locate the project root
  • TARGET: Target triple for cross-compilation
  • CARGO_CFG_TARGET_OS: Used to detect mobile builds (skipped)

Key Technologies

  • Frontend: Svelte 5, TypeScript, Vite
  • Backend: Rust, Tauri 2.0
  • Agent: pi-mono SDK (@mariozechner/pi-coding-agent)
  • Sidecar Build: bun (compiles TypeScript to standalone binary)

Build Scripts

Convenience npm scripts for cross-platform builds:

Script Platform Description
npm run dev:linux Linux Run dev server (native)
npm run dev:windows Windows Run dev server (cross-compile)
npm run build:linux Linux Build AppImage/Deb packages
npm run build:windows Windows Build NSIS installer (requires NSIS)
npm run build:windows:exe Windows Build only .exe (no installer)
npm run build:windows:portable Windows Build .exe + stage portable runtime folder (src-tauri/target/x86_64-pc-windows-msvc/release/portable)
npm run build:all Both Build Linux + Windows packages
npm run run:windows Windows Build (if needed), stage portable runtime, & launch Windows app from WSL2

Examples:

# Quick development - Linux
npm run dev:linux

# Build for both platforms from WSL2
npm run build:all

# Build and run Windows app directly from WSL2
npm run run:windows

# Build only the Windows executable (fastest, no NSIS needed)
npm run build:windows:exe

# Build and stage a portable Windows runtime folder (copy this folder to Windows)
npm run build:windows:portable

Build Configuration

Cargo Configuration

The project uses a custom .cargo/config.toml for optimized builds and cross-compilation:

[build]
# Linker settings are configured per-target below

[profile.dev]
# Faster debug builds with incremental compilation
incremental = true
codegen-units = 16

[profile.release]
# Optimized release builds with thin LTO
lto = "thin"
codegen-units = 1
opt-level = 3

# Linux: Use lld for faster linking
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

# Windows: Use cargo-xwin (configured via CARGO env var)
# No linker config needed - cargo-xwin handles SDK libs and linking
# [target.x86_64-pc-windows-msvc]
# linker = "lld-link"  # Don't set - use CARGO=cargo-xwin instead

# Android: Use lld (included in NDK)
[target.aarch64-linux-android]
linker = "lld"

Benefits:

  • lld linker: 2-10x faster linking compared to default system linker
  • Incremental compilation: Faster rebuilds during development
  • Thin LTO: Better optimized release builds without full LTO overhead
  • Cross-compilation ready: Configured for Linux, Windows, and Android targets

tauri.conf.json

Key configuration for sidecar support:

{
  "bundle": {
    "externalBin": ["binaries/pi-agent"]
  },
  "plugins": {
    "shell": {
      "open": true
    }
  }
}

Capabilities

  • desktop.json: Shell plugin permissions for spawning sidecar
  • mobile.json: HTTP plugin for SDK-only mode (future use)

Troubleshooting

See TROUBLESHOOTING.md for common issues and solutions.


External References


Contributing

Graphone builds and ships a local host sidecar from services/agent-host.

To develop sidecar behavior:

  1. Edit services/agent-host/src/*
  2. Test with bun tooling/scripts/verify-path-b-host.mjs
  3. Build with npm run build:linux (or cargo build --manifest-path src-tauri/Cargo.toml)

License

MIT License - See LICENSE for details.


Acknowledgments

  • pi-mono by Mario Zechner - The underlying coding agent (Node.js/TypeScript)
  • Tauri - Cross-platform application framework
  • bun - JavaScript runtime and bundler used for sidecar compilation

Status: Active development | Last Updated: February 19, 2026

Top categories

Loading Svelte Themes