# Electron Driver

Bundled, first-party verify-proof driver for Electron-based desktop
applications. This driver is the one Aperant itself uses internally
(this monorepo is an Electron app).

## When Aperant picks this driver

`/apt:verify-proof` auto-selects `electron` when:

- The project's `package.json` declares `electron` (or `@electron/*`) as
  a dependency.
- The required IDL capabilities are a subset of: `click`, `type`, `key`,
  `navigate`, `screenshot`, `assert_visible`, `assert_text`,
  `wait_for_idle`, `execute_js`, `dump_state`.

## Capabilities

| IDL verb | Maps to Electron MCP tool |
|----------|---------------------------|
| `click` | `mcp__electron__send_command_to_electron` (button_click) |
| `type` | `mcp__electron__send_command_to_electron` (fill_input) |
| `key` | `mcp__electron__send_command_to_electron` (send_keyboard_shortcut) |
| `navigate` | `mcp__electron__send_command_to_electron` (navigate) |
| `screenshot` | `mcp__electron__take_screenshot` |
| `assert_visible` | `mcp__electron__send_command_to_electron` (selector check) |
| `assert_text` | `mcp__electron__send_command_to_electron` (textContent match) |
| `wait_for_idle` | `mcp__electron__send_command_to_electron` (renderer-idle) |
| `execute_js` | `mcp__electron__send_command_to_electron` (evaluate) |
| `dump_state` | `mcp__electron__get_electron_window_info` |

## Manifest

- **Priority:** 90 (second-highest among bundled drivers — Electron is
  rarer than browser but covers the desktop-app case).
- **Stability:** `ga`.
- **Trust:** `first_party_signed` (default-allow).
- **Network posture:** `deny` (Electron apps shouldn't be hitting the
  network during proof verification).
- **Transport:** `{ mcp_server_id: "electron" }`.

## Why hardcoded MCP tool names live here

Per [ID-01](../../docs/frameworks/spec-gaps.md): the verify-proof workflow
prose refers ONLY to IDL verbs (`driver.click(target)`,
`driver.screenshot(path)`). The mapping from a verb to a concrete
`mcp__electron__*` tool name exists in exactly one place — this driver
file. The grep guard in
`packages/framework/src/__tests__/verify-proof-workflow-grep-guard.test.ts`
asserts zero `mcp__electron__*` matches in
`workflows/verify-proof.md`. Adding a Tauri driver requires zero edits
to the workflow.

## V1 scope — adapter is thin

This driver's `driver.mjs` is a manifest-conformant **adapter shim** in
v1: each verb validates its args against `IDL_VERB_ARGS` and returns a
VerbResult stub. The actual `mcp__electron__*` tool invocations happen
at the workflow-runner layer (the model holds the MCP tool surface,
NOT the driver process). The verb→tool mapping table above is the
contract the workflow runner consults; the driver itself is the
validator + manifest + resolver-anchor in v1. See
`verify-proof-driver-transport-wiring-v2` (follow-up) for direct-
dispatch evolution.
