docs/adrs/0001-host-capability-interface.md
plans/desktop-mobile-web-unification.mdDyad currently routes privileged actions through Electron IPC (src/preload.ts, src/ipc/types/*, src/ipc/handlers/*). This tightly couples product logic to desktop-only primitives:
Web and mobile clients cannot reuse this runtime model directly. We need one product core that can run against multiple execution hosts:
Adopt a host capability interface as the canonical execution boundary for privileged operations.
The shared product core will depend on a HostProvider contract, not directly on Electron IPC channels or HTTP endpoints.
HostProvider exposes capability groups:
project: read/write/rename/delete/list/search file operationsexec: run/stop commands, stream logs/outputgit: branch/commit/status/sync operationspreview: start/stop/status/getPreviewUrlintegration: provider-specific operations (supabase/vercel/neon/mcp)system: optional host/system functions (open external URL, show in folder, clipboard/screenshot)session: session cache/state controlsEach operation must include a standard envelope:
workspaceIdprojectIdrequestIdidempotencyKeyactor (user/system/assistant)timestampEach operation returns:
correlationId for tracingStreaming operations must follow a uniform event contract:
startchunkenderrorDesktop provider maps this to IPC streams; cloud provider maps this to WebSocket/SSE streams.
Hosts must declare supported capabilities at runtime (for example supportsProcess, supportsNativeDialogs, supportsShowItemInFolder), and UI/features must gate behavior accordingly.
Rejected because it preserves desktop coupling and creates brittle emulation layers.
Rejected because it duplicates business logic and causes long-term behavior drift.
Rejected for now because it breaks existing local-first desktop workflows.
ElectronLocalHostProvider.CloudHostProvider for desktop cloud mode, then web/mobile.integration.* or split into first-class capability groups?