Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎭 Mate Framework

Turn a VRM avatar into a desktop companion.

A framework for building desktop-mate / AI-agent applications that live on your Linux desktop β€” a transparent character that follows your mouse, dances to your music, and chats with you through a local AI backend. No Unity experience required.

License: MIT OR Apache-2.0 Rust Unity


What is Mate Framework?

Mate Framework gives developers a CLI (mf) and a config file (mate.toml) to create desktop companion applications, without touching Unity internals or platform-specific desktop APIs. The heavy lifting β€” window rendering, VRM model loading, animation, audio reactivity, and AI chat β€” is handled by the framework's Unity runtime.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    mf CLI (Rust)                         β”‚
β”‚  new Β· dev Β· build Β· package Β· doctor Β· runtime Β· capa   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                  Mate Runtime (Unity)                    β”‚
β”‚  MateBootstrap (composition root) Β· MateContext           β”‚
β”‚  IEventBus Β· IConfiguration Β· services Β· HotReload        β”‚
β”‚  Character Β· Audio Β· System Β· AI Β· Mods                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                Mate.Core (.NET)                          β”‚
β”‚  Result pattern Β· event bus Β· service container          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Status

⚠️ Early development (v0.1.0). The CLI, core, all four feature modules, and the Unity bootstrap (composition root + entry scene) are implemented and tested. A v1.0.0 GitHub release carries the Unity runtime player, so mf runtime install 1.0.0 downloads it and mf dev runs end-to-end: the character renders on a transparent window, always-on-top, animated, and named after your project. Native window backends are implemented for X11.

Area Status
CLI (mf new/doctor/dev/build/package/runtime/capabilities) βœ… Implemented & tested
Unity feature modules (Character, Audio, System, AI, Mods) βœ… Implemented & tested
Unity bootstrap (composition root + entry scene) βœ… Implemented & tested
Hot reload (config/assets) βœ… Implemented
Error messages & mf doctor diagnostics βœ… Implemented
Security validators (validate_path, validate_url) βœ… Implemented
CI/CD (GitHub Actions) βœ… Configured
Runtime download from GitHub Releases βœ… Implemented (mf runtime install)
End-to-end mf dev (player + model load) βœ… Verified
Native X11 window backend βœ… Implemented (transparent window, always-on-top, borderless, click-through, project name title, idle animation)
Mouse tracking (character follows cursor) βœ… Wired & working
Audio-reactive dancing βœ… Wired & working
System tray & notifications βœ… Wired & working (AppIndicator + notify-send)
Mods (mods/<name>/mod.toml discovery) βœ… Wired & working
AI chat (Ollama) ⚠️ Service-layer only β€” no chat GUI yet (planned next)
Hyprland / KWin (Wayland) backends ⏳ Deferred
Windows / macOS support ⏳ Planned (v2.0+)

"Wired & working" means the feature actually runs in the player (mf dev). "Service-layer only" means the service is implemented and unit-tested but has no interactive path in the player yet.


✨ Features

  • πŸ–₯️ Desktop companion β€” transparent, always-on-top, borderless character window (X11 backend); the window is named after your project
  • 🚢 Idle animation β€” loaded characters break out of their T-pose and play a humanoid idle loop
  • πŸ‘€ Mouse tracking β€” the character's head and spine turn toward your cursor (sensitivity and max angles configurable in mate.toml)
  • πŸ’ƒ Audio-reactive dancing β€” dances when an allowed app plays music (PulseAudio). The dance clip is configurable via [animation] dance_animation β€” supply your own clip or use the built-in default
  • πŸ’¬ AI chat β€” service layer (Ollama) implemented & tested; an interactive chat GUI is planned next (not yet wired into the player)
  • πŸͺŸ System tray & notifications β€” tray icon (AppIndicator) and desktop notifications (notify-send), config-driven via [system]
  • 🧩 Mod support β€” drop-in mods with mod.toml manifests; v1 mods are config/asset overrides (no code execution)
  • ♻️ Hot reload β€” config/assets reload on change; code changes are never hot-reloaded by design (ADR-013)
  • πŸ” mf doctor β€” diagnoses manifest, assets, runtime, display server, and permissions with actionable guidance
  • πŸ“¦ Reproducible builds β€” mf build writes build-manifest.json; mf package creates a self-describing tar.gz

πŸ“¦ Install

Prerequisites

  • Linux (X11 or Wayland)
  • Rust toolchain β€” rustup.rs
  • Unity 6000.2.6f2 β€” only needed to develop the runtime, not to run projects

Build the CLI

git clone https://github.com/12errh/MF.git
cd MF
cargo build --release -p mf
# binary at target/release/mf

Or install directly:

cargo install --path crates/mf-cli

Verify:

mf --help

πŸš€ Quick Start

# 1. Create a project
mf new my-mate
cd my-mate

# 2. Drop in a VRM model
cp ~/Downloads/avatar.vrm assets/

# 3. Configure mate.toml
#    [character] model = "assets/avatar.vrm"

# 4. Install the runtime (downloads the player release)
mf runtime install 1.0.0

# 5. Diagnose your setup
mf doctor

# 6. Run
mf dev

Full walkthrough: docs/getting-started.md

mf runtime install <version> downloads the player binary from the GitHub release into ~/.mate-framework/runtimes/<version>/. mf dev launches it from that cache with --projectPath <dir>.


🧭 CLI Reference

Command Description
mf new <name> Scaffold a new project (manifest + assets/mods/config dirs)
mf doctor Check manifest, assets, runtime, display server, permissions
mf dev Run the project with file watching + auto-restart
mf build Copy assets + manifest into build/, write build-manifest.json
mf package Create <name>.tar.gz with the build manifest inside
mf runtime list List installed runtime versions
mf runtime status Show cache location and installed versions
mf runtime install <v> Download & install a runtime version from GitHub Releases
mf capabilities Report what your desktop session supports

Every command supports --json for machine-readable output.


πŸ—‚οΈ Repository Layout

β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ mf-core/            # Library: manifest, build, runtime, errors, security, watcher
β”‚   └── mf-cli/             # The `mf` binary (clap CLI)
β”œβ”€β”€ runtime/
β”‚   └── Mate.Core/          # .NET core: event bus, MateContext, Result pattern
β”‚                          #   (canonical source; copied into the Unity project)
β”œβ”€β”€ unity/
β”‚   └── Assets/
β”‚       β”œβ”€β”€ MateFramework/  # Unity runtime: services, interfaces, tests
β”‚       β”‚   β”œβ”€β”€ Bootstrap/  # Composition root: MateBootstrap, BootstrapComposer
β”‚       β”‚   β”œβ”€β”€ Character/  # CharacterService, MouseTracker, CharacterAnimator
β”‚       β”‚   β”œβ”€β”€ Audio/      # PulseAudioService, AudioReactiveBridge
β”‚       β”‚   β”œβ”€β”€ System/     # SystemTrayService
β”‚       β”‚   β”œβ”€β”€ AI/         # OllamaProvider, PersonalityService
β”‚       β”‚   β”œβ”€β”€ Mods/       # ModService
β”‚       β”‚   β”œβ”€β”€ Core/       # Copied Mate.Core + HotReloadHandler
β”‚       β”‚   β”œβ”€β”€ Editor/     # Scene builder tool
β”‚       β”‚   └── Scenes/     # Entry scene (Camera + MateBootstrap)
β”‚       └── Grabbed/        # Vendored reference scripts + UniVRM packages
β”œβ”€β”€ docs/                   # PRD, TRD, ADRs, plans, specs, getting-started
β”œβ”€β”€ scripts/                # build-player.sh (reproducible Unity player build)
β”œβ”€β”€ .github/workflows/      # CI + release pipelines
└── refrence/               # (gitignored) original reference engine

πŸ§ͺ Testing

# Rust CLI + core (79 tests)
cargo test --workspace

# Formatting + lint
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings

# Performance benchmarks (criterion)
cargo bench -p mf --bench cli_benchmarks

# .NET core (33 tests)
cd runtime && dotnet test Mate.Core.sln

# Unity EditMode tests (146 Mate.* tests pass; 340 total in suite)
#   via Unity Test Runner, or headless:
#   <Unity 6000.2.6f2> -batchmode -nographics -projectPath unity \
#     -runTests -testPlatform EditMode -testResults results.xml

The vendored UniGLTF/VRM/VRM10 packages ship their own test assemblies; ~34 of their tests do not run headless. These failures are pre-existing in the vendored packages, not in Mate Framework code.


πŸ“š Documentation

Document Description
Getting Started Step-by-step first project
PRD Product requirements & vision
TRD Technical requirements & system architecture
Architecture Index Codebase analysis, ADRs, module boundaries
Implementation Plan 10-phase roadmap
Risk Register Risks & mitigations
Security Security audit checklist
Changelog Release history

🀝 Contributing

See CONTRIBUTING.md for guidelines. This project is in early development β€” bug reports, feature ideas, and pull requests are welcome.


πŸ“„ License

Dual-licensed under MIT OR Apache-2.0 β€” see LICENSE-MIT and LICENSE-APACHE for details.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages