Skip to content

Commit 115d110

Browse files
jnsdlsclaude
andauthored
feat: extract embedded Electron MCP package (#11)
## Summary - Extract the embedded Electron MCP server into the standalone `@nebula-agents/electron-mcp` package with explicit lifecycle, generic surface keys, bundled renderer automation tools, and public type exports. - Add package infrastructure: pnpm lockfile, tsdown build, TypeScript, Biome, Vitest, Changesets, README, contribution/security docs, repo setup notes, issue templates, CI, and release workflow. - Add unit coverage ported from nebula-desktop plus a Playwright `_electron` smoke fixture for `list_surfaces`, `evaluate`, and `screenshot`. ## Verification - [x] `pnpm check` - [x] `pnpm test:electron` if Electron/CDP behavior changed Notes: `pnpm test:electron` currently skips on macOS because Playwright `_electron` passes `--remote-debugging-port=0`, which Electron 41 rejects on Darwin. The smoke test remains enabled for Linux CI. ## Closes - Closes #2 (unit tests ported from nebula-desktop) - Closes #3 (repo docs scaffolding: README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT, PR/issue templates) - Closes #4 (Changesets wired in single-package mode) - Closes #6 (CI workflow: typecheck + lint + smoke test) - Closes #7 (release workflow via Changesets) - Closes #8 (docs/repo-setup.md) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Initial prerelease of the Electron MCP package with embedded MCP server and user tools (screenshot, click, type, form-fill, accessibility snapshot, DOM queries, show/hide/focus, reload, hover, press-key, etc.) and a smoke-test entrypoint. * **Documentation** * Expanded README, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, and repo-setup docs with quickstart, API, security reporting, and maintenance notes. * **API** * Public config extended with optional path, serverName, serverVersion, and logger; new logger type exported. * **Testing & CI/CD** * Added unit and Electron smoke tests, Playwright/Vitest configs, CI and release workflows, and Changesets. * **Chores** * Packaging and build/tooling updates and lint/formatter config added. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent e4b1b12 commit 115d110

64 files changed

Lines changed: 4196 additions & 281 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/initial-release.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nebula-agents/electron-mcp": minor
3+
---
4+
5+
Initial prerelease of the embedded Electron MCP server.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Bug Report
2+
description: Report a reproducible problem.
3+
title: "bug: "
4+
labels: ["bug"]
5+
body:
6+
- type: textarea
7+
id: summary
8+
attributes:
9+
label: Summary
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: repro
14+
attributes:
15+
label: Reproduction
16+
description: Include a minimal Electron setup or failing test when possible.
17+
validations:
18+
required: true
19+
- type: input
20+
id: version
21+
attributes:
22+
label: Version
23+
validations:
24+
required: true
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Feature Request
2+
description: Propose a focused change.
3+
title: "feat: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: textarea
7+
id: problem
8+
attributes:
9+
label: Problem
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: Proposal
16+
validations:
17+
required: true

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Summary
2+
3+
## Verification
4+
5+
- [ ] `pnpm check`
6+
- [ ] `pnpm test:electron` if Electron/CDP behavior changed

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
13+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
14+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
15+
with:
16+
node-version: 24
17+
cache: pnpm
18+
- run: pnpm install --frozen-lockfile
19+
- run: pnpm check
20+
21+
electron-smoke:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
25+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
26+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
27+
with:
28+
node-version: 24
29+
cache: pnpm
30+
- run: pnpm install --frozen-lockfile
31+
- run: pnpm exec playwright install --with-deps chromium
32+
- run: xvfb-run -a pnpm test:electron

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
18+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
19+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
20+
with:
21+
node-version: 24
22+
cache: pnpm
23+
registry-url: https://registry.npmjs.org
24+
- run: pnpm install --frozen-lockfile
25+
- run: pnpm check
26+
- uses: changesets/action@ce079ea084e08a340947ed4d6ecedb2433c8f293 # v1
27+
with:
28+
publish: pnpm changeset publish
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ pnpm-debug.log*
2929
coverage/
3030
.nyc_output/
3131
test-results/
32-
playwright-report/
3332

3433
# Misc
3534
.cache/

CODE_OF_CONDUCT.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Code of Conduct
2+
3+
This project follows the Contributor Covenant Code of Conduct, version 2.1:
4+
https://www.contributor-covenant.org/version/2/1/code_of_conduct/
5+
6+
Report conduct concerns to `security@agent-labs.dev`.

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing
2+
3+
Thanks for considering a contribution. This package is maintained best-effort;
4+
small, focused PRs are easiest to review.
5+
6+
## Setup
7+
8+
```sh
9+
pnpm install
10+
pnpm check
11+
```
12+
13+
## Development
14+
15+
- Source lives in `src/`.
16+
- Unit tests are colocated as `*.test.ts` and are the only files vitest
17+
picks up (see `vitest.config.ts`).
18+
- The canonical Electron smoke test is `test/electron/smoke.spec.ts`,
19+
driven by `pnpm test:electron`. CI runs this on Linux.
20+
- `tests/smoke.electron.test.ts` is an alternate exploratory fixture
21+
that talks to a CJS Electron main via stdout and is **not** wired
22+
into vitest, playwright, or CI; it's kept for local experimentation
23+
only and may be removed in a follow-up.
24+
- Run `pnpm test` for unit tests.
25+
- Run `pnpm test:electron` for the Electron smoke test.
26+
27+
## Changesets
28+
29+
User-visible changes need a changeset:
30+
31+
```sh
32+
pnpm changeset
33+
```
34+
35+
Pick `patch`, `minor`, or `major` according to semver. For `0.x`, breaking API
36+
changes generally use `minor`.
37+
38+
Releases are handled by the Changesets release workflow. Do not publish from a
39+
local machine unless a maintainer explicitly coordinates it.

0 commit comments

Comments
 (0)