Portal OS · Rust Workspace
Codebase
Explorer
AR glasses spatial computing platform — Wayland compositor with streaming to INMO AIR3 glasses, running on Snapdragon X Elite (HP Spaceboard). Rust workspace with 36 crates spanning spatial protocols, streaming, voice/NPU, input, and the Portal Capability Protocol (PCP).
Crate Index
34 crates across 7 layers
Every crate in the Portal OS workspace, organized by architectural layer. Click any crate to view its full documentation.
Core
6 crates · 12.6K LOCDefines WHERE things appear in AR space
- portal-spatialPortal Spatial — Spatial Computing Core
The spatial protocol that defines where windows appear in AR space. Manages zones (center, left/right peripheral, overlay), dimensions (Desktop, VR, AR, Tablet), and the assignment engine that maps windows to zones based on position and policy.
- portal-spatial-pluginPortal Spatial Plugin — Wayfire Integration
Thin Rust cdylib that bridges portal-spatial's zone management into Wayfire via C++ FFI shim. Loaded as a Wayfire plugin to manage spatial zones in the compositor.
- portal-warpPortal Warp — Perspective Correction (DEAD CODE)
Homography-based GLSL shaders for mapping compositor output onto AR glasses with head-tracking correction. Currently dead code — Wayfire's built-in perspective-warp is used instead.
- portal-wmPortal WM — Window Manager Daemon
Daemon that monitors Wayland toplevel windows and assigns them to spatial zones. Uses ext_foreign_toplevel_list_v1 to track windows and IPC to send zone assignments to portal-spatial.
- portal-commonPortal Common — Shared Utilities
Shared utilities used across all Portal crates — error types, test infrastructure, common traits.
- portal-spatial-fuzzportal-spatial-fuzz
Input
2 crates · 34.5K LOCDefines HOW the user interacts with Portal
- portal-inputPortal Input — Touch, Keyboard & Fusion Engine
Complete input pipeline for the Spaceboard: touch event normalization, multi-touch fusion engine (tracking → intent classification → action generation), QWERTY keyboard layout, and virtual keyboard/pointer via /dev/uinput. Includes portal-keyboardd, a standalone DRM/KMS binary that owns the eDP-1 display.
- portal-input-fuzzportal-input-fuzz
Voice/AI
5 crates · 29.8K LOCProvides VOICE and INTELLIGENCE
- portal-voicePortal Voice — Speech Interaction Pipeline
Complete voice interaction layer: wake word detection, VAD (Silero on QNN DSP), STT (Sherpa-onnx Zipformer on CPU), NLU (MiniLM sentence similarity), TTS (Elara VITS on QNN DSP), and voice state machine. Hosts portal-voiced daemon.
- rnnoise-sysRNNoise FFI — Noise Suppression
FFI bindings to the RNNoise C library for real-time noise suppression in the Portal voice pipeline.
- qnn-sysQNN FFI — Qualcomm NPU Bindings
FFI bindings to the Qualcomm QNN HTP API for loading .so model graphs and running inference on the Hexagon DSP.
- portal-llmPortal LLM — On-Device Language Model
On-device LLM daemon running Qwen3-0.6B on the Hexagon DSP via GenieX/llama.cpp. Serves generation requests via Unix socket IPC at /run/portal/llm.sock.
- portal-npu-runtimePortal NPU Runtime — Hexagon DSP FastRPC
Safe Rust wrappers around the Qualcomm Hexagon CDSP FastRPC kernel interface. Provides DMA-BUF allocation and remote DSP invocation for voice, LLM, and other NPU consumers.
Streaming
1 crates · 727 LOCDELIVERS the compositor output to AR glasses
PCP
17 crates · 57.7K LOCCONNECTS apps to Portal's spatial desktop
- pcp-corePCP Core — Capability Protocol Foundation
Core types, traits, and error definitions for the Portal Capability Protocol (PCP). Defines PcpServer trait, CapabilityManifest, Element model, and cross-cutting services (audit, permission, signing, rate limiting).
- pcp-registryPCP Registry — Capability Registry
Capability registry with DashMap backend — tracks all registered apps, their capabilities, and serves capability lookups for the PCP daemon.
- pcp-atspi2PCP AT-SPI2 — Accessibility Adapter
AT-SPI2 adapter for Tier 2 app detection — bridges non-Portal-native apps into the PCP via the Linux accessibility protocol.
- pcp-nativePCP Native — Tier 1 App Detection
Native Tier 1 adapter with .desktop file parsing — detects Portal-native apps via X-Portal-PCP-Manifest keys.
- pcp-pushPCP Push — Event Bus
V4.1 push event bus with coalescing, backpressure handling, and persistent journal for capability state change events.
- pcp-streamPCP Stream — Wire Protocol
Binary framing protocol and Unix socket transport for PCP communication between apps and the daemon.
- pcp-platformPCP Platform — Hardware API Implementations
Hardware API implementations for PCP — audio playback, network status, compositor queries, display control.
- pcp-winePCP Wine — Windows App Bridge
Wine/MSAA bridge for PCP — types and traits for detecting Windows apps running under Wine via MSAA accessibility.
- pcp-simulatorPCP Simulator — Input Simulation Fallback
Input simulation fallback adapter (Tier 3) for apps that don't support native PCP or AT-SPI2 — simulates keyboard/mouse input.
- pcp-cliPCP CLI — Testing & Debugging Tool
Command-line tool for PCP testing and debugging — inspect capabilities, invoke actions, monitor events, manage app trust.
- pcp-ipcPCP IPC — App Server Runner
Provides PcpServerRunner for Tier 1 apps to expose their PcpServer over Unix socket, and the daemon-side client for invoking capabilities.
- portal-pcpdPortal PCP Daemon — Capability Detection & Event Pipeline
The PCP daemon that runs persistently, detects apps, verifies manifests, and routes capability invocations between Portal and apps.
- pcp-learningPCP Learning — Usage History & Onboarding
PCP v4.2 Learning Runtime — tracks capability invocation history, suggests onboarding actions, and adapts to user behavior.
- pcp-recoveryPCP Recovery — Health Monitoring & Auto-Degradation
PCP v4.2 Recovery Runtime — per-app health monitoring, crash recovery, and automatic Tier degradation (Tier 1 → Tier 2 → Tier 3).
- pcp-coordinationPCP Coordination — Multi-App Composition
PCP v4.2 Multi-App Coordination — enables cross-app capability composition and workflow automation.
- pcp-inspectionPCP Inspection — Runtime Introspection
PCP v4.2 Deep Inspection — runtime capability introspection for debugging and monitoring.
- pcp-stream-fuzzpcp-stream-fuzz
Platform
5 crates · 44.8K LOCProvides the DESKTOP EXPERIENCE
- portal-launcherPortal Launcher — Universal Action Entry Point
Application launcher with action registry, fuzzy/acronym search engine, execution pipeline, plugin system, and voice bridge. Provides the central interface for launching apps and executing system actions.
- portal-launcherdportal-launcherd
Portal Launcher Daemon — universal action entry point for Portal OS
- portal-shellPortal Shell — Status Bar & Notifications
Shell layer providing the status bar, notification display, and window switcher for the Portal desktop environment.
- portal-stylePortal Style — Design Token System
Complete design token system for Portal UI: colors (with WCAG contrast), typography, spacing, shadows, border radius, transitions, theme management with hot-reload.
- portal-contextPortal Context — Proactive Intelligence Layer
Event ingestion, workspace modeling, context extraction, template synthesis, and notification management. Builds a real-time model of what the user is doing and proactively surfaces relevant information.
Other
2 crates · 404 LOCQuality assurance infrastructure