Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
ADR 0343: The plugin launcher enumerates and opens local applications
- Status: Accepted
- Date: 2026-11-05
- Related: ADR 0072 (global plugin launcher), ADR 0080 (prewarm), ADR 0090 (main-process shell state), ADR 0092 (plugin-owned panel surface), ADR 0214 (trusted extensions), issue #2085
Context
A user pressing Alt+Space is reaching for whatever they want to open now, which is as often an installed application as a plugin panel. Enumerating and starting local applications has a much wider blast radius than opening a panel: it reads platform application entries and starts child processes outside the app's own sandbox and permission gateway, so neither a renderer-side launch API nor a plugin-visible one may exist.
Decision
- Only the launcher window may enumerate and open applications, through one IPC
surface (
pi-desktop/pluginLauncher/catalog,pi-desktop/pluginLauncher/openApp) whose handler comparesevent.sender.idwith the launcher's ownwebContentsand rejects anything else withPERMISSION_DENIED; a missing launcher window means "not the launcher". - The capability is never exposed to plugins. No channel joins
pluginBridgeor the panel bridges and no application-launch member joins the Plugin SDK, so a plugin can receive the user's text through a launcher trigger but cannot learn what applications exist or start one. - The renderer never receives a launchable path. The catalog carries a display
name, executable name, source tag (
start-menu/app-bundle/desktop-entry), a small icon, and an opaqueapp:<slug>id, andopenAppresolves that id against the host's own scan and re-checks that the target still exists instead of falling back. - Discovery is bounded and non-invasive: Main reads only well-known locations,
never spawns a probe, caches the scan, caps the entry count and icon budget,
drops entries whose target is gone, and draws a letter tile for plugin panels
because
manifest.iconis not consumed by the host. - Launcher size and position live in main-process shell state under the app data
directory, following the
window-state.jsonprecedent from ADR 0090: best-effort, debounced, defensively parsed, and re-centred when a remembered position fits no current work area, with no host RPC, schema, or migration.
Consequences
- One shortcut opens both plugin panels and applications in one grid, at the cost of no longer distinguishing them before opening.
- The privilege boundary is a window rather than a permission, and the catalog is display-safe because the renderer only ever holds opaque ids.
- Application entries can go stale between scans, and the launcher becomes platform-sensitive with its own parsers and tests; shell state gains a second file that is deliberately excluded from configuration export.
Alternatives
- Expose application launch to plugins: rejected because no permission in the matrix describes starting arbitrary programs, and install-time review could not make it safe.
- Let the renderer supply the executable path: rejected because a sender check protects other renderers, not a compromised launcher page, and path acceptance would make the IPC a general-purpose process launcher.