@weavetab/mcp 2.5.0-beta.2 → 2.5.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/ARCHITECTURE.md +6 -6
- package/LICENSE +216 -631
- package/README.md +153 -1074
- package/SECURITY.md +33 -22
- package/TROUBLESHOOTING.md +2 -2
- package/dist/cdp/bridge.js +2 -1
- package/dist/cdp/connector.d.ts +2 -0
- package/dist/cdp/connector.js +10 -6
- package/dist/cdp/helpers.d.ts +4 -0
- package/dist/cdp/helpers.js +181 -0
- package/dist/cdp/omni_broker.d.ts +1 -1
- package/dist/cdp/omni_broker.js +1 -1
- package/dist/cdp/walker.d.ts +25 -1
- package/dist/cdp/walker.js +304 -7
- package/dist/cli/plugin.d.ts +1 -0
- package/dist/cli/plugin.js +81 -18
- package/dist/cli/updater.d.ts +1 -1
- package/dist/cli/updater.js +27 -7
- package/dist/config/loader.d.ts +9 -1
- package/dist/config/loader.js +42 -3
- package/dist/desktop/discovery.d.ts +44 -0
- package/dist/desktop/discovery.js +364 -0
- package/dist/index.js +137 -21
- package/dist/intelligence/marks.d.ts +36 -0
- package/dist/intelligence/marks.js +30 -0
- package/dist/intelligence/patternCompiler.d.ts +118 -0
- package/dist/intelligence/patternCompiler.js +259 -0
- package/dist/intelligence/sessionMemory.d.ts +2 -0
- package/dist/intelligence/sessionMemory.js +18 -8
- package/dist/overlay/injector.js +2 -2
- package/dist/plugin/interface.d.ts +88 -5
- package/dist/plugin/loader.d.ts +12 -1
- package/dist/plugin/loader.js +280 -70
- package/dist/plugin/pipeline.d.ts +75 -0
- package/dist/plugin/pipeline.js +183 -0
- package/dist/plugin/registry.d.ts +2 -1
- package/dist/plugin/registry.js +24 -14
- package/dist/security/secrets.d.ts +7 -0
- package/dist/security/secrets.js +37 -0
- package/dist/sensors/actionability.js +1 -2
- package/dist/sensors/guard.js +4 -10
- package/dist/sensors/mutations.js +12 -0
- package/dist/sensors/operation_monitor.js +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.js +453 -178
- package/dist/state/agent.d.ts +1 -0
- package/dist/state/agent.js +3 -0
- package/dist/state/delta.d.ts +12 -4
- package/dist/state/delta.js +67 -14
- package/dist/state/session.d.ts +6 -0
- package/dist/state/session.js +27 -0
- package/dist/tools/browser_detect.d.ts +16 -3
- package/dist/tools/browser_detect.js +52 -7
- package/dist/tools/burst.d.ts +17 -8
- package/dist/tools/burst.js +236 -77
- package/dist/tools/captcha.js +1 -1
- package/dist/tools/checkpoint.d.ts +38 -0
- package/dist/tools/checkpoint.js +271 -0
- package/dist/tools/click.d.ts +1 -0
- package/dist/tools/click.js +74 -70
- package/dist/tools/design_extract.js +1 -1
- package/dist/tools/eval.js +1 -1
- package/dist/tools/fill.d.ts +20 -1
- package/dist/tools/fill.js +199 -40
- package/dist/tools/find.d.ts +16 -0
- package/dist/tools/find.js +67 -44
- package/dist/tools/github/index.d.ts +19 -4
- package/dist/tools/github/index.js +40 -4
- package/dist/tools/highlight.d.ts +6 -2
- package/dist/tools/highlight.js +158 -72
- package/dist/tools/inspect.js +1 -1
- package/dist/tools/key.js +65 -56
- package/dist/tools/navigate.d.ts +1 -1
- package/dist/tools/navigate.js +34 -39
- package/dist/tools/pdf.js +21 -13
- package/dist/tools/pointer.d.ts +18 -3
- package/dist/tools/pointer.js +89 -1
- package/dist/tools/read.d.ts +28 -8
- package/dist/tools/read.js +230 -56
- package/dist/tools/scrape.js +67 -13
- package/dist/tools/screenshot.js +21 -16
- package/dist/tools/scroll.js +6 -11
- package/dist/tools/select.js +8 -2
- package/dist/tools/snapshot.js +3 -34
- package/dist/tools/tabs.js +15 -7
- package/dist/tools/thought.d.ts +2 -0
- package/dist/tools/thought.js +13 -14
- package/dist/tools/type.d.ts +2 -0
- package/dist/tools/type.js +107 -58
- package/dist/tools/type_secret.js +42 -76
- package/dist/tools/upload.js +1 -1
- package/dist/tools/video_compiler.d.ts +1 -1
- package/dist/tools/video_compiler.js +11 -12
- package/dist/version.d.ts +5 -0
- package/dist/version.js +5 -0
- package/docs/DOCUMENTATION.md +37 -41
- package/docs/PLUGINS.md +121 -0
- package/docs/TOOLS.md +54 -0
- package/docs/architecture/blind-injection.md +83 -20
- package/docs/architecture/overview.md +49 -49
- package/docs/architecture/security.md +8 -7
- package/docs/architecture/transport.md +2 -2
- package/docs/cli/cli-commands.md +7 -1
- package/docs/cli/cli-flags.md +15 -7
- package/docs/cli/cli-scripting.md +6 -3
- package/docs/configuration/config-locations.md +3 -4
- package/docs/configuration/env-variables.md +4 -4
- package/docs/configuration/folders.md +55 -54
- package/docs/desktop-automation/electron-apps.md +214 -162
- package/docs/get-started/introduction.md +60 -60
- package/docs/get-started/setup-wizard.md +7 -6
- package/docs/intelligence/site-profiles.md +151 -0
- package/docs/tools/tools.md +631 -293
- package/docs/troubleshooting/trouble-browser.md +1 -1
- package/docs/troubleshooting/trouble-loop.md +31 -31
- package/ext-dist/background.js +10 -62
- package/ext-dist/content.js +333 -920
- package/ext-dist/hud/hud.js +9 -9
- package/ext-dist/manifest.json +2 -6
- package/ext-dist/styles.css +6 -1
- package/icon.png +0 -0
- package/mcp.json +87 -71
- package/package.json +118 -119
- package/server.json +5 -5
- package/ext-dist/sidepanel/sidepanel.js +0 -25
- package/ext-dist/sidepanel.html +0 -547
package/docs/cli/cli-commands.md
CHANGED
|
@@ -14,10 +14,14 @@ slug: cli-commands
|
|
|
14
14
|
| Command | Description |
|
|
15
15
|
|---|---|
|
|
16
16
|
| `weavetab` | Start the MCP server (stdio mode — default for MCP clients). When run in a TTY without arguments, launches the interactive UI menu. |
|
|
17
|
-
| `weavetab
|
|
17
|
+
| `weavetab --ws [--port N]` | Start the WebSocket daemon on `127.0.0.1` (default port `3000`). |
|
|
18
|
+
| `weavetab --version` | Print version and exit. |
|
|
19
|
+
| `weavetab config` | Launch the 6-phase interactive configuration wizard. |
|
|
18
20
|
| `weavetab view` | Display the current active configuration report. Press **[R]** to view raw JSON, **[Q]** to quit. |
|
|
19
21
|
| `weavetab reset` | Purge browser profiles, lockfiles, mutexes, session registries, and kill orphan browser processes. Accepts `--yes`/`-y` to skip confirmation prompts. |
|
|
20
22
|
| `weavetab reload-ext` | Send a reload signal to the Weavetab browser extension via CDP `Runtime.evaluate`. |
|
|
23
|
+
| `weavetab plugin <add\|browse\|search\|list\|remove\|verify>` | Manage plugins — see `weavetab plugin --help`. |
|
|
24
|
+
| `weavetab skills [options]` | Install or update AI agent skills (passthrough to `@weavetab/skills`). |
|
|
21
25
|
| `weavetab help` / `--help` | Show full CLI help message with all commands, flags, and environment variables. |
|
|
22
26
|
|
|
23
27
|
## Secrets Management
|
|
@@ -39,6 +43,8 @@ When run without arguments in a TTY terminal, Weavetab opens an interactive keyb
|
|
|
39
43
|
|---|---|
|
|
40
44
|
| `[C]` | Launch the configuration wizard |
|
|
41
45
|
| `[V]` | View current active configuration |
|
|
46
|
+
| `[P]` | List installed Weavetab plugins |
|
|
42
47
|
| `[R]` | Purge browser profiles and lockfiles |
|
|
43
48
|
| `[H]` | Show help information |
|
|
49
|
+
| `[G]` / `[N]` / `[W]` | Open GitHub / npm / website links |
|
|
44
50
|
| `[Q]` | Exit Weavetab |
|
package/docs/cli/cli-flags.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Flags"
|
|
3
|
-
description: "Global flags accepted by the
|
|
3
|
+
description: "Global flags accepted by the CLI."
|
|
4
4
|
product: mcp
|
|
5
5
|
section: cli
|
|
6
6
|
icon: Flag
|
|
@@ -9,12 +9,20 @@ slug: cli-flags
|
|
|
9
9
|
|
|
10
10
|
# Flags
|
|
11
11
|
|
|
12
|
+
Only these flags are parsed by the CLI (`MCP/src/index.ts`). Anything else is ignored.
|
|
13
|
+
|
|
12
14
|
| Flag | Type | Description |
|
|
13
15
|
|---|---|---|
|
|
14
|
-
| `--version` | boolean | Print CLI version and exit |
|
|
15
16
|
| `--help` / `-h` | boolean | Show help message and exit |
|
|
16
|
-
|
|
|
17
|
-
| `--
|
|
18
|
-
| `--
|
|
19
|
-
| `--
|
|
20
|
-
| `--yes` / `-y` | boolean | Skip confirmation prompt when running `weavetab reset` |
|
|
17
|
+
| `help` | command | Show help message and exit |
|
|
18
|
+
| `--version` / `-v` | boolean | Print version and exit |
|
|
19
|
+
| `--ws` | boolean | Start the WebSocket daemon instead of stdio |
|
|
20
|
+
| `--port <port>` / `--port=<port>` | number | Port for the WebSocket daemon (default `3000`) |
|
|
21
|
+
| `--yes` / `-y` | boolean | Skip confirmation prompt when running `weavetab reset` / `reload` |
|
|
22
|
+
| `--official` / `-O` | boolean | Prefer the official `@weavetab/plugin-<name>` candidate (`plugin add`) |
|
|
23
|
+
| `--community` / `-C` | boolean | Prefer the community package candidate (`plugin add`) |
|
|
24
|
+
| `--refresh` | boolean | Invalidate and refresh the verified plugin cache (`plugin`) |
|
|
25
|
+
| `--project` | boolean | Project-scoped secrets file (`secrets init --project`) |
|
|
26
|
+
|
|
27
|
+
Notes:
|
|
28
|
+
- There are no `--headless` / `--role` CLI flags. Browser headless mode and RBAC role come from `~/.weavetab/config.json` (`weavetab config` / `weavetab view`). The wizard offers `admin` / `operator` / `viewer` / `automation`.
|
|
@@ -18,8 +18,11 @@ weavetab reset --yes
|
|
|
18
18
|
# List stored secrets
|
|
19
19
|
weavetab secrets list
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
weavetab
|
|
21
|
+
# List installed plugins
|
|
22
|
+
weavetab plugin list
|
|
23
|
+
|
|
24
|
+
# Start the MCP server in WebSocket daemon mode for custom scripts
|
|
25
|
+
weavetab --ws --port 3000 &
|
|
23
26
|
```
|
|
24
27
|
|
|
25
28
|
## CI/CD Pipeline
|
|
@@ -28,5 +31,5 @@ weavetab --ws --port 3000 --headless &
|
|
|
28
31
|
# In GitHub Actions or Docker CI
|
|
29
32
|
npm install -g @weavetab/mcp
|
|
30
33
|
weavetab reset --yes
|
|
31
|
-
weavetab --ws --port 3000
|
|
34
|
+
weavetab --ws --port 3000 &
|
|
32
35
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Locations & Merge"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Two-tier merge: global config → built-in defaults."
|
|
4
4
|
product: mcp
|
|
5
5
|
section: configuration
|
|
6
6
|
icon: FolderTree
|
|
@@ -11,9 +11,8 @@ slug: config-locations
|
|
|
11
11
|
|
|
12
12
|
## Priority Tiers
|
|
13
13
|
|
|
14
|
-
1. **
|
|
15
|
-
2. **
|
|
16
|
-
3. **Built-in defaults** — defined in `DEFAULT_CONFIG`
|
|
14
|
+
1. **Global** — `~/.weavetab/config.json` (the only config file Weavetab reads)
|
|
15
|
+
2. **Built-in defaults** — defined in `DEFAULT_CONFIG`
|
|
17
16
|
|
|
18
17
|
## Live Reload
|
|
19
18
|
|
|
@@ -9,11 +9,11 @@ slug: env-variables
|
|
|
9
9
|
|
|
10
10
|
# Environment Variables
|
|
11
11
|
|
|
12
|
+
Only these two are read at runtime (`MCP/src/config/loader.ts`). Everything else
|
|
13
|
+
(browser path, role, headless, dev mode) lives in `~/.weavetab/config.json`
|
|
14
|
+
— run `weavetab config` to change it.
|
|
15
|
+
|
|
12
16
|
| Variable | Description |
|
|
13
17
|
|---|---|
|
|
14
|
-
| `CHROME_PATH` | Absolute path to Chromium/Chrome binary |
|
|
15
|
-
| `WEAVETAB_CONFIG` | Path to a custom config file |
|
|
16
|
-
| `WEAVETAB_ROLE` | Override RBAC role at runtime (`admin`, `operator`, `viewer`, `automation`) |
|
|
17
|
-
| `WEAVETAB_DEV` | Set to `1` to enable verbose CDP dev logging |
|
|
18
18
|
| `WT_AGENT_ID` | Override the auto-generated agent UUID |
|
|
19
19
|
| `WT_PROXY_URL` | Set outbound HTTP/SOCKS proxy server URL |
|
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Folder Hierarchy"
|
|
3
|
-
description: ".weavetab, .weavetab-system, and ~/.weavetab directory structure."
|
|
4
|
-
product: mcp
|
|
5
|
-
section: configuration
|
|
6
|
-
icon: FolderOpen
|
|
7
|
-
slug: folders
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Workspace & System Directories
|
|
11
|
-
|
|
12
|
-
Weavetab strictly partitions project-scoped output, global configurations, and system-level intelligence data into dedicated directory structures.
|
|
13
|
-
|
|
14
|
-
## 1. Project-Scoped Directory: `./.weavetab/`
|
|
15
|
-
|
|
16
|
-
Created in your current working directory to store project-scoped settings and mission output:
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
./.weavetab/
|
|
20
|
-
├── config.json # Project-specific config overrides
|
|
21
|
-
├── secrets.json # Project-scoped credentials for Blind Injection
|
|
22
|
-
├── pdfs/ # Exported PDF documents
|
|
23
|
-
├── screenshots/ # Full-page and clipped PNG/JPEG screenshots
|
|
24
|
-
├── downloads/ # Downloaded files during automated sessions
|
|
25
|
-
├── designs/ # Extracted design tokens and Tailwind themes
|
|
26
|
-
└── logs/ # Human-readable logs and JSONL audit trails
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## 2. System Intelligence Directory: `~/.weavetab-system/`
|
|
30
|
-
|
|
31
|
-
Global system directory holding cross-session learning and process locks:
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
~/.weavetab-system/
|
|
35
|
-
├── memory/ # Per-domain frontend framework & strategy profiles
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
├──
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
├──
|
|
51
|
-
├──
|
|
52
|
-
├──
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
---
|
|
2
|
+
title: "Folder Hierarchy"
|
|
3
|
+
description: ".weavetab, .weavetab-system, and ~/.weavetab directory structure."
|
|
4
|
+
product: mcp
|
|
5
|
+
section: configuration
|
|
6
|
+
icon: FolderOpen
|
|
7
|
+
slug: folders
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Workspace & System Directories
|
|
11
|
+
|
|
12
|
+
Weavetab strictly partitions project-scoped output, global configurations, and system-level intelligence data into dedicated directory structures.
|
|
13
|
+
|
|
14
|
+
## 1. Project-Scoped Directory: `./.weavetab/`
|
|
15
|
+
|
|
16
|
+
Created in your current working directory to store project-scoped settings and mission output:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
./.weavetab/
|
|
20
|
+
├── config.json # Project-specific config overrides
|
|
21
|
+
├── secrets.json # Project-scoped credentials for Blind Injection
|
|
22
|
+
├── pdfs/ # Exported PDF documents
|
|
23
|
+
├── screenshots/ # Full-page and clipped PNG/JPEG screenshots
|
|
24
|
+
├── downloads/ # Downloaded files during automated sessions
|
|
25
|
+
├── designs/ # Extracted design tokens and Tailwind themes
|
|
26
|
+
└── logs/ # Human-readable logs and JSONL audit trails
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 2. System Intelligence Directory: `~/.weavetab-system/`
|
|
30
|
+
|
|
31
|
+
Global system directory holding cross-session learning and process locks:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
~/.weavetab-system/
|
|
35
|
+
├── memory/ # Per-domain frontend framework & strategy profiles (selector cache)
|
|
36
|
+
│ └── sites/ # Persistent site profiles: workflows, quirks & reliability scores
|
|
37
|
+
├── sessions/
|
|
38
|
+
│ └── context.json # Rolling 50-action trail for loop detection
|
|
39
|
+
├── apps/ # Dedicated user profiles for Electron apps
|
|
40
|
+
├── locks/ # Process lockfiles (PID + TCP port validation)
|
|
41
|
+
└── knowledge/ # Domain-specific markdown knowledge hints
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 3. Global User Directory: `~/.weavetab/`
|
|
45
|
+
|
|
46
|
+
Global user directory storing default configurations and global secrets:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
~/.weavetab/
|
|
50
|
+
├── config.json # Global default configuration
|
|
51
|
+
├── secrets.json # Global secrets for Blind Injection
|
|
52
|
+
├── policy.json # Domain whitelist / blacklist rules
|
|
53
|
+
├── plugins/ # Isolated storage directories for installed plugins
|
|
54
|
+
└── profile/ # Dedicated default Chromium browser profile
|
|
55
|
+
```
|
|
@@ -1,162 +1,214 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Desktop & Electron Apps"
|
|
3
|
-
description: "Native Layer 0 automation for VS Code, Discord, Figma, Slack, and any Electron app."
|
|
4
|
-
product: mcp
|
|
5
|
-
section: desktop-automation
|
|
6
|
-
badge: new
|
|
7
|
-
icon: AppWindow
|
|
8
|
-
slug: electron-apps
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Desktop & Electron Application Automation
|
|
12
|
-
|
|
13
|
-
Weavetab is a **universal Layer 0 agent runtime**. In addition to standard Chromium web browsing, Weavetab gives AI agents direct, native CDP control over **any desktop Electron application** — including Discord, VS Code, Figma, Slack, Obsidian, Postman, Notion, Spotify, and custom internal tools.
|
|
14
|
-
|
|
15
|
-
## How It Works
|
|
16
|
-
|
|
17
|
-
Because modern desktop applications are built on the Chromium/Electron framework, Weavetab can communicate with them directly over CDP WebSocket without requiring separate drivers or UI automation bridges.
|
|
18
|
-
|
|
19
|
-
```text
|
|
20
|
-
AI Agent (MCP) ──► withSecurity()
|
|
21
|
-
├── (Default) ─────────► CDP:9222 ──► Google Chrome / Chromium
|
|
22
|
-
├── (app: "discord") ──► CDP:9223 ──► Discord Desktop
|
|
23
|
-
├── (app: "figma") ──► CDP:9224 ──► Figma Desktop
|
|
24
|
-
└── (app: "vscode") ──► CDP:9225 ──► VS Code Desktop
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Dual-Port Concurrency & Multi-Target Sessions
|
|
28
|
-
- **Concurrent Execution**: Web browser sessions and Electron desktop app sessions run side-by-side on independent CDP ports (e.g. port `9222` for Chrome, `9223` for Discord, `9224` for Figma).
|
|
29
|
-
- **Zero Session Clobbering**: Switching between a browser tab and a desktop app does not close, disconnect, or reload either target.
|
|
30
|
-
- **Unified Tool Interface**: Pass `"app": "<appName>"` to any Weavetab tool to target that desktop application. Omit `app` to target the active web browser.
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Interactive App Configurator
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Weavetab enforces
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- `
|
|
88
|
-
- `
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
# Launch
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
# Launch
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
1
|
+
---
|
|
2
|
+
title: "Desktop & Electron Apps"
|
|
3
|
+
description: "Native Layer 0 automation for VS Code, Discord, Figma, Slack, and any Electron app."
|
|
4
|
+
product: mcp
|
|
5
|
+
section: desktop-automation
|
|
6
|
+
badge: new
|
|
7
|
+
icon: AppWindow
|
|
8
|
+
slug: electron-apps
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Desktop & Electron Application Automation
|
|
12
|
+
|
|
13
|
+
Weavetab is a **universal Layer 0 agent runtime**. In addition to standard Chromium web browsing, Weavetab gives AI agents direct, native CDP control over **any desktop Electron application** — including Discord, VS Code, Figma, Slack, Obsidian, Postman, Notion, Spotify, and custom internal tools.
|
|
14
|
+
|
|
15
|
+
## How It Works
|
|
16
|
+
|
|
17
|
+
Because modern desktop applications are built on the Chromium/Electron framework, Weavetab can communicate with them directly over CDP WebSocket without requiring separate drivers or UI automation bridges.
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
AI Agent (MCP) ──► withSecurity()
|
|
21
|
+
├── (Default) ─────────► CDP:9222 ──► Google Chrome / Chromium
|
|
22
|
+
├── (app: "discord") ──► CDP:9223 ──► Discord Desktop
|
|
23
|
+
├── (app: "figma") ──► CDP:9224 ──► Figma Desktop
|
|
24
|
+
└── (app: "vscode") ──► CDP:9225 ──► VS Code Desktop
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Dual-Port Concurrency & Multi-Target Sessions
|
|
28
|
+
- **Concurrent Execution**: Web browser sessions and Electron desktop app sessions run side-by-side on independent CDP ports (e.g. port `9222` for Chrome, `9223` for Discord, `9224` for Figma).
|
|
29
|
+
- **Zero Session Clobbering**: Switching between a browser tab and a desktop app does not close, disconnect, or reload either target.
|
|
30
|
+
- **Unified Tool Interface**: Pass `"app": "<appName>"` to any Weavetab tool to target that desktop application. Omit `app` to target the active web browser.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Interactive App Configurator
|
|
35
|
+
|
|
36
|
+
Build your `electron` block in the [Desktop app configurator](/mcp/desktop) — presets for Discord, VS Code, Figma, Slack and more, path / port / advanced formats, plus a copy-ready agent setup prompt. Then paste the block into your global `~/.weavetab/config.json`.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 1. Configuring Desktop Apps in `config.json`
|
|
41
|
+
|
|
42
|
+
Add an `"electron"` object to your global `~/.weavetab/config.json` (the only config file Weavetab reads):
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"electron": {
|
|
47
|
+
"discord": "C:\\Users\\username\\AppData\\Local\\Discord\\app-<version>\\Discord.exe",
|
|
48
|
+
"vscode": 9222,
|
|
49
|
+
"figma": {
|
|
50
|
+
"path": "C:\\Users\\username\\AppData\\Local\\Figma\\Figma.exe",
|
|
51
|
+
"port": 9224,
|
|
52
|
+
"url": "https://www.figma.com",
|
|
53
|
+
"args": ["--enable-features=WebRTCPipeWireCapturer"]
|
|
54
|
+
},
|
|
55
|
+
"slack": "/Applications/Slack.app/Contents/MacOS/Slack",
|
|
56
|
+
"obsidian": "/usr/bin/obsidian"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Configuration Formats Supported
|
|
62
|
+
|
|
63
|
+
| Format | Example | Description |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| **Executable Path String** | `"discord": "C:\\path\\to\\Discord.exe"` | Automatically launches the binary on an isolated port and dedicated profile. |
|
|
66
|
+
| **Port Number** | `"vscode": 9222` | Attaches directly to an already-running instance started with `--remote-debugging-port=9222`. |
|
|
67
|
+
| **Full Configuration Object** | `"figma": { "path": "...", "port": 9224, "url": "..." }` | Custom control over binary path, debug port, initial launch URL, custom profile directory, and startup CLI args. |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 2. Security & Profile Isolation
|
|
72
|
+
|
|
73
|
+
Weavetab enforces enterprise-grade sandbox separation for all desktop applications:
|
|
74
|
+
|
|
75
|
+
1. **Dedicated User Profiles**: Automated sessions are assigned isolated data profiles under `~/.weavetab-system/apps/<appName>/`.
|
|
76
|
+
2. **Real AppData Protection**: Weavetab strictly enforces `assertNotRealElectronProfile` — attempting to target your primary OS user data directories (`%APPDATA%`, `~/Library/Application Support`, or `~/.config`) is blocked to protect your personal logins and local databases from accidental automation corruption.
|
|
77
|
+
3. **Lock & Mutex Isolation**: Dedicated lockfiles (`~/.weavetab-system/locks/<appName>.lock`) ensure concurrent agent operations never conflict.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 3. Supported Desktop Schemes & Protocols
|
|
82
|
+
|
|
83
|
+
Weavetab automatically allows and whitelist-bypasses desktop internal protocols:
|
|
84
|
+
- `app://` (Electron internal resources)
|
|
85
|
+
- `vscode-webview://` / `vscode-file://` (VS Code extensions and webviews)
|
|
86
|
+
- `discord://` / `slack://` (Deep-links)
|
|
87
|
+
- `devtools://` / `chrome://` / `about:`
|
|
88
|
+
- `file:///` (Local files)
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 4. How Agents Interact with Desktop Apps
|
|
93
|
+
|
|
94
|
+
To target an Electron application, simply pass the `app` argument to any Weavetab tool:
|
|
95
|
+
|
|
96
|
+
### A. Inspect Desktop DOM Tree
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"name": "browser_map",
|
|
100
|
+
"arguments": {
|
|
101
|
+
"app": "discord",
|
|
102
|
+
"scope": "main_content"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### B. Click & Type in Desktop Apps
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"name": "browser_click",
|
|
111
|
+
"arguments": {
|
|
112
|
+
"ref": "w:42",
|
|
113
|
+
"app": "discord"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"name": "browser_type",
|
|
121
|
+
"arguments": {
|
|
122
|
+
"ref": "w:45",
|
|
123
|
+
"text": "Automated build passed successfully! 🚀",
|
|
124
|
+
"app": "discord"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### C. Multi-Target Burst Orchestration
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"name": "browser_burst",
|
|
133
|
+
"arguments": {
|
|
134
|
+
"app": "vscode",
|
|
135
|
+
"steps": [
|
|
136
|
+
{ "action": "click_and_wait", "selector": ".monaco-editor" },
|
|
137
|
+
{ "action": "type_and_send", "text": "npm test" }
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 5. Launching Existing Desktop Apps in Debug Mode
|
|
146
|
+
|
|
147
|
+
If you prefer to attach Weavetab to your existing desktop app instance:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Launch VS Code with CDP debugging enabled
|
|
151
|
+
code --remote-debugging-port=9222
|
|
152
|
+
|
|
153
|
+
# Launch Obsidian with CDP debugging enabled
|
|
154
|
+
obsidian --remote-debugging-port=9225
|
|
155
|
+
|
|
156
|
+
# Launch Discord with CDP debugging enabled
|
|
157
|
+
discord --remote-debugging-port=9223
|
|
158
|
+
```
|
|
159
|
+
Then in your `config.json`, simply map `"vscode": 9222` or `"obsidian": 9225`.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 6. Environment Discovery Handshake (`browser_detect`)
|
|
164
|
+
|
|
165
|
+
`browser_detect` is the foundational tool agents invoke upon initial engagement. It inspects local browsers and configured desktop applications, returning their real-time state:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"available": [
|
|
170
|
+
{ "engine": "chromium", "name": "Google Chrome", "path": "C:\\Program Files\\...\\chrome.exe" }
|
|
171
|
+
],
|
|
172
|
+
"current": "chromium",
|
|
173
|
+
"configuredApps": [
|
|
174
|
+
{
|
|
175
|
+
"name": "discord",
|
|
176
|
+
"status": "running_no_debug",
|
|
177
|
+
"configuredPath": "C:\\Users\\username\\AppData\\Local\\Discord\\app-1.0.9256\\Discord.exe"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "slack",
|
|
181
|
+
"status": "connected",
|
|
182
|
+
"port": 9222,
|
|
183
|
+
"configuredPath": "C:\\Users\\username\\AppData\\Local\\slack\\app-4.38.125\\slack.exe",
|
|
184
|
+
"activeTabs": [
|
|
185
|
+
{ "id": "PAGE_1", "title": "general - Slack", "url": "https://app.slack.com/client/..." }
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "vscode",
|
|
190
|
+
"status": "offline",
|
|
191
|
+
"configuredPath": "C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Application Lifecycle States:
|
|
198
|
+
- **`connected`**: The app is running with CDP remote debugging active and Weavetab is attached. Agents can immediately operate tabs/windows using `"app": "<name>"`.
|
|
199
|
+
- **`running_no_debug`**: The app process is currently running on the OS, but was opened by the user without `--remote-debugging-port`. Weavetab alerts the agent that DOM interactions are blocked until the app is launched or restarted with debugging flags.
|
|
200
|
+
- **`offline`**: The process is not running. Calling `browser_navigate(app: "<name>")` launches and connects the app automatically.
|
|
201
|
+
|
|
202
|
+
### Windows Squirrel Auto-Path Resolution:
|
|
203
|
+
On Windows, applications like Discord and Slack install inside versioned folders (e.g. `Discord\app-1.0.9256\Discord.exe`) that change on every background update. Weavetab dynamically resolves the newest `app-1.0.xxxx` version at launch time, eliminating broken path errors after silent background updates.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 7. Smart Domain Routing & Sticky Context
|
|
208
|
+
|
|
209
|
+
To ensure external AI agents do not accidentally trigger a web browser launch when intending to control an Electron application:
|
|
210
|
+
|
|
211
|
+
1. **Automatic Domain Routing**: When `browser_navigate` or `browser_tabs(action: "open")` receives an app domain (e.g. `discord.com`, `slack.com`, `linear.app`, `notion.so`), Weavetab automatically routes the target to the configured desktop application.
|
|
212
|
+
2. **Sticky App Sessions**: When an agent operates inside an Electron app, the target session context remains sticky. Subsequent calls to `browser_tabs` or DOM tools stick to that active desktop app without spawning an unwanted Chrome window.
|
|
213
|
+
3. **Explicit Browser Targeting**: When the agent specifically intends to use the web browser, passing `"app": "browser"` overrides desktop routing and directs operations to the web browser.
|
|
214
|
+
|