How vladik9/pi-desktop works
PI-Desktop is a local-first desktop workspace for projects, AI-agent sessions, and extensible workflows. The main workflow is to submit a task in the workspace, have an agent execute it with permission controls, then inspect its transcript and work products. The architecture also supports model/provider configuration, plugins, delegation, remote hosts, voice, and configuration sync. The README documents these product capabilities; sampled source confirms selected runtime internals, but does not expose every UI-to-host dispatch, so undocumented connections are omitted.
Main entry points: main.rs Host core · runtime-service.ts Agent runtime · agent-host.ts Agent host · AppShell.tsx Workspace UI
Components 20
Desktop workspace
- Workspace UI
apps/desktop/src/features/app/AppShell.tsx - Chat and composer
apps/desktop/src/components/ChatSurface.tsx - Transcript and review
apps/desktop/src/features/chat/transcript/ChatTranscript.tsx - Desktop API
apps/desktop/src/lib/api.ts - Main IPC
apps/desktop/electron/main/ipc/register.ts
Agent execution
- Host core
crates/host-core/src/main.rs - Agent runtime
packages/host-runtime/src/runtime-service.ts - Agent host
packages/agent-host/src/agent-host.ts - PI host app
apps/pi-host/src/app.ts - Plans and approvals
crates/host-core/src/plans/repository.rs - Worker sessions
apps/desktop/electron/main/services/session-collaboration.ts
Extensions and integrations
- Plugin runtime
apps/desktop/electron/main/plugin-runtime.ts - Plugin workspace UI
apps/desktop/src/features/plugins/MarketplacePanel.tsx
Platform services
- Model providers
crates/host-core/src/providers/repository.rs - Voice runtime
packages/voice-runtime/src/voice-controller.ts - Remote hosts
apps/desktop/electron/main/remote/remote-host-connection.ts - Configuration sync
crates/host-core/src/config_sync/engine.rs - Scheduled runs
apps/desktop/electron/main/runtime/scheduled-runner.ts - Local workspace state
crates/host-core/src/state.rs
Other components
- User
Connections 20
- User → Workspace UI: uses
README.md - Workspace UI → Chat and composer: opens chat
README.md - Chat and composer → Desktop API: submits task
- Desktop API → Main IPC: invokes IPC
- Main IPC → Host core: dispatches request
- Host core → Agent runtime: coordinates agent
- Agent runtime → Agent host: emits events
- Agent host → PI host app: ingests events
apps/pi-host/src/app.ts - Host core → Local workspace state: opens state
crates/host-core/src/main.rs - Agent runtime → Transcript and review: returns results
- Host core → Plans and approvals: supports planning
README.md - Host core → Worker sessions: coordinates workers
README.md - User → Plugin workspace UI: browses plugins
README.md - Plugin workspace UI → Plugin runtime: installs extensions
- Plugin runtime → Agent host: extends agent
README.md - User → Model providers: configures models
README.md - User → Voice runtime: speaks to agent
README.md - User → Remote hosts: connects host
README.md - User → Configuration sync: syncs settings
README.md - User → Scheduled runs: schedules work
README.md