How wangmiaozero/pi-harness works
Pi-Harness is an Electron desktop control plane built around the native Pi coding agent. The main workflow is a user working in a project or chat, invoking Pi through the desktop, then inspecting or managing the resulting session and work through workspace and Harness tools. Documented branches include Git and files, providers and capabilities, run recovery and evaluation, agent orchestration, imported conversation history, and local project architecture analysis. The graph uses README-documented relationships and the shown preload bridge; unsampled implementation details are not inferred.
Main entry points: agent Pi agent runtime · App.vue Application UI · index.ts Typed IPC bridge · orchestrator-service.ts Agent orchestration
Components 23
Desktop experience
- Application UI
src/renderer/src/App.vue - Typed IPC bridge
src/preload/index.ts - Main IPC handlers
src/main/ipc - Application persistence
src/main/services/storage.ts
Pi and capabilities
- Pi agent runtime
src/main/agent - Session management
src/main/sessions/session-service.ts - Providers and models
src/main/services/provider-service.ts - Skills and packages
src/main/capabilities - Runtime environment
src/main/runtime/runtime-manager.ts
Harness control plane
- Runs and traces
src/main/harness/runs/run-registry.ts - Run control and recovery
src/main/harness/harness-runtime.ts - Policy and budgets
src/main/harness/policy/policy-engine.ts - Evaluation and diagnostics
src/main/harness/evaluation/evaluation-service.ts - Agent orchestration
src/main/harness/orchestrator/orchestrator-service.ts - Orchestration state
src/main/harness/orchestrator/orchestration-store.ts
Workspace tools
- Projects and files
src/main/workspace/workspace-service.ts - File access
src/main/files/file-access-service.ts - Git and worktrees
src/main/git/git-service.ts - Universal conversation history
src/main/universal/service.ts
Local analysis
- Project architecture maps
src/main/intelligence/service.ts - Architecture map rendering
resources/archify/renderers/architecture - Layout and diagnostics
resources/archify/renderers/shared
Other components
- Desktop user
Connections 22
- Desktop user → Application UI: uses
README.md - Application UI → Typed IPC bridge: requests capabilities
src/preload/index.ts - Typed IPC bridge → Main IPC handlers: invokes handlers
src/preload/index.ts - Desktop user → Pi agent runtime: runs Pi
README.md - Pi agent runtime → Session management: maintains sessions
README.md - Desktop user → Providers and models: configures models
README.md - Desktop user → Skills and packages: manages capabilities
README.md - Runtime environment → Pi agent runtime: supplies runtime
- Desktop user → Runs and traces: inspects runs
README.md - Desktop user → Run control and recovery: controls recovery
README.md - Desktop user → Policy and budgets: sets policies
README.md - Desktop user → Evaluation and diagnostics: evaluates results
README.md - Desktop user → Agent orchestration: coordinates agents
README.md - Agent orchestration → Orchestration state: stores orchestration state
src/main/harness/orchestrator/orchestrator-service.ts - Desktop user → Projects and files: opens projects
README.md - Projects and files → File access: browses files
- Desktop user → Git and worktrees: manages Git
README.md - Desktop user → Universal conversation history: browses conversations
README.md - Desktop user → Project architecture maps: explores architecture
README.md - Project architecture maps → Architecture map rendering: renders maps
- Architecture map rendering → Layout and diagnostics: uses layout helpers
resources/archify/renderers/architecture/routing.mjs - Desktop user → Application persistence: stores app data