@weavetab/mcp 2.5.0-beta.5 → 2.5.1
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 +49 -49
- package/ARCHITECTURE.md +590 -590
- package/README.md +216 -100
- package/SECURITY.md +207 -207
- package/TROUBLESHOOTING.md +373 -365
- package/dist/anticaptcha/detector.js +395 -395
- package/dist/anticaptcha/solver.js +130 -130
- package/dist/cdp/bridge.js +73 -73
- package/dist/cdp/connector.js +46 -22
- package/dist/cdp/extension.js +34 -34
- package/dist/cdp/helpers.js +174 -174
- package/dist/cdp/pruner.js +195 -195
- package/dist/cdp/ref_cache.js +66 -66
- package/dist/cdp/security.js +10 -10
- package/dist/cdp/verify.js +57 -57
- package/dist/cdp/walker.js +563 -525
- package/dist/cli/plugin.js +26 -3
- package/dist/config/loader.d.ts +0 -3
- package/dist/config/loader.js +0 -9
- package/dist/index.js +0 -4
- package/dist/intelligence/intent.js +81 -81
- package/dist/intelligence/sessionMemory.js +2 -2
- package/dist/overlay/ghost.js +22 -22
- package/dist/overlay/injector.js +89 -89
- package/dist/plugin/extension_bridge.js +54 -54
- package/dist/plugin/interface.d.ts +7 -0
- package/dist/plugin/loader.js +3 -4
- package/dist/plugin/schema.d.ts +11 -0
- package/dist/plugin/schema.js +59 -0
- package/dist/security/guard.js +18 -18
- package/dist/sensors/actionability.js +167 -167
- package/dist/sensors/guard.js +29 -29
- package/dist/sensors/network.js +15 -17
- package/dist/server.d.ts +1 -1
- package/dist/server.js +173 -144
- package/dist/state/delta.js +6 -7
- package/dist/tools/automation.js +85 -85
- package/dist/tools/canvas.js +48 -25
- package/dist/tools/checkpoint.js +94 -35
- package/dist/tools/click.js +52 -41
- package/dist/tools/clipboard.js +80 -74
- package/dist/tools/design_extract.js +441 -441
- package/dist/tools/dialog.js +13 -13
- package/dist/tools/emulation.d.ts +2 -0
- package/dist/tools/emulation.js +7 -0
- package/dist/tools/fill.js +344 -347
- package/dist/tools/find.js +78 -52
- package/dist/tools/highlight.js +67 -67
- package/dist/tools/inspect.js +54 -25
- package/dist/tools/key.js +42 -35
- package/dist/tools/navigate.d.ts +1 -1
- package/dist/tools/navigate.js +35 -35
- package/dist/tools/office/parse.js +62 -18
- package/dist/tools/pdf.d.ts +9 -0
- package/dist/tools/pdf.js +7 -4
- package/dist/tools/performance.d.ts +11 -4
- package/dist/tools/performance.js +94 -42
- package/dist/tools/performance_test.d.ts +2 -2
- package/dist/tools/performance_test.js +69 -69
- package/dist/tools/pointer.js +116 -116
- package/dist/tools/read.js +99 -67
- package/dist/tools/recording.js +9 -0
- package/dist/tools/scrape.js +146 -146
- package/dist/tools/screenshot.d.ts +2 -0
- package/dist/tools/screenshot.js +46 -4
- package/dist/tools/scroll.d.ts +3 -1
- package/dist/tools/scroll.js +13 -15
- package/dist/tools/select.d.ts +3 -0
- package/dist/tools/select.js +131 -124
- package/dist/tools/snapshot.js +8 -6
- package/dist/tools/storage.d.ts +5 -1
- package/dist/tools/storage.js +16 -0
- package/dist/tools/tabs.d.ts +7 -5
- package/dist/tools/tabs.js +79 -26
- package/dist/tools/thought.js +8 -8
- package/dist/tools/type.js +274 -274
- package/dist/tools/type_secret.js +23 -23
- package/dist/tools/upload.js +3 -3
- package/dist/tools/video_compiler.js +9 -0
- package/dist/tools/wait.js +35 -35
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/DOCUMENTATION.md +583 -585
- package/docs/PLUGINS.md +139 -121
- package/docs/TOOLS.md +3 -4
- package/docs/architecture/blind-injection.md +83 -83
- package/docs/architecture/overview.md +49 -49
- package/docs/configuration/configuration.md +39 -27
- package/docs/configuration/folders.md +62 -55
- package/docs/desktop-automation/electron-apps.md +225 -214
- package/docs/get-started/installation.md +1 -1
- package/docs/get-started/introduction.md +60 -60
- package/docs/get-started/quickstart.md +2 -2
- package/docs/get-started/setup-wizard.md +1 -1
- package/docs/intelligence/site-profiles.md +151 -151
- package/docs/tools/tools.md +582 -631
- package/docs/troubleshooting/trouble-loop.md +31 -31
- package/ext-dist/background.js +415 -415
- package/ext-dist/content.js +2527 -2527
- package/ext-dist/dashboard.html +583 -583
- package/ext-dist/hud/hud.js +3 -3
- package/ext-dist/hud/index.html +20 -20
- package/ext-dist/manifest.json +73 -73
- package/ext-dist/styles.css +223 -223
- package/mcp.json +796 -805
- package/package.json +8 -8
- package/server.json +23 -23
- package/smithery.yaml +7 -11
- package/dist/cdp/walker.test.d.ts +0 -2
- package/dist/cdp/walker.test.js +0 -172
- package/dist/intelligence/sessionMemory.test.d.ts +0 -2
- package/dist/intelligence/sessionMemory.test.js +0 -62
- package/dist/intelligence/trail.test.d.ts +0 -2
- package/dist/intelligence/trail.test.js +0 -110
- package/dist/state/cache.test.d.ts +0 -2
- package/dist/state/cache.test.js +0 -76
- package/dist/state/delta.test.d.ts +0 -2
- package/dist/state/delta.test.js +0 -279
- package/dist/state/groups.d.ts +0 -15
- package/dist/state/groups.js +0 -80
- package/dist/tools/accessibility.d.ts +0 -14
- package/dist/tools/accessibility.js +0 -32
- package/dist/tools/ask.d.ts +0 -14
- package/dist/tools/ask.js +0 -49
- package/dist/tools/click_and_wait.d.ts +0 -33
- package/dist/tools/click_and_wait.js +0 -149
- package/dist/tools/drag.d.ts +0 -15
- package/dist/tools/drag.js +0 -29
- package/dist/tools/geo.d.ts +0 -19
- package/dist/tools/geo.js +0 -29
- package/dist/tools/github/analyze.d.ts +0 -4
- package/dist/tools/github/analyze.js +0 -113
- package/dist/tools/github/cache.d.ts +0 -21
- package/dist/tools/github/cache.js +0 -28
- package/dist/tools/github/index.d.ts +0 -19
- package/dist/tools/github/index.js +0 -40
- package/dist/tools/github/issues.d.ts +0 -9
- package/dist/tools/github/issues.js +0 -88
- package/dist/tools/github/pr.d.ts +0 -5
- package/dist/tools/github/pr.js +0 -88
- package/dist/tools/github/rateLimiter.d.ts +0 -4
- package/dist/tools/github/rateLimiter.js +0 -46
- package/dist/tools/github/read.d.ts +0 -34
- package/dist/tools/github/read.js +0 -74
- package/dist/tools/github/repoContext.d.ts +0 -20
- package/dist/tools/github/repoContext.js +0 -129
- package/dist/tools/hover.d.ts +0 -19
- package/dist/tools/hover.js +0 -57
- package/dist/tools/integration.test.d.ts +0 -2
- package/dist/tools/integration.test.js +0 -96
- package/dist/tools/macro_compiler.d.ts +0 -7
- package/dist/tools/macro_compiler.js +0 -82
- package/dist/tools/mouse.d.ts +0 -21
- package/dist/tools/mouse.js +0 -62
- package/dist/tools/response.d.ts +0 -129
- package/dist/tools/response.js +0 -5
- package/dist/tools/wait_for.d.ts +0 -23
- package/dist/tools/wait_for.js +0 -30
- package/dist/tools/windows.d.ts +0 -22
- package/dist/tools/windows.js +0 -57
|
@@ -1,55 +1,62 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Folder Hierarchy"
|
|
3
|
-
description: ".weavetab
|
|
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
|
|
13
|
-
|
|
14
|
-
## 1. Project-Scoped Directory: `./.weavetab/`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
./.weavetab/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
├──
|
|
36
|
-
|
|
37
|
-
├──
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## 3.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
~/.weavetab/
|
|
50
|
-
├──
|
|
51
|
-
|
|
52
|
-
├──
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
---
|
|
2
|
+
title: "Folder Hierarchy"
|
|
3
|
+
description: ".weavetab and .weavetab-system 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 credentials, global user configuration, and machine-managed system intelligence into dedicated directory structures.
|
|
13
|
+
|
|
14
|
+
## 1. Project-Scoped Directory: `./.weavetab/`
|
|
15
|
+
|
|
16
|
+
Optional, created in your current working directory to carry project-scoped credentials alongside a checkout:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
./.weavetab/
|
|
20
|
+
└── secrets.json # Project-scoped credentials for Blind Injection (override the global file)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Keys in a project `secrets.json` take precedence over `~/.weavetab/secrets.json` when Weavetab runs from that directory. All other configuration and output paths are global (see below) unless overridden via config fields.
|
|
24
|
+
|
|
25
|
+
## 2. Global User Directory: `~/.weavetab/`
|
|
26
|
+
|
|
27
|
+
Global, user-authored configuration and default output directories:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
~/.weavetab/
|
|
31
|
+
├── config.json # Global configuration (domain policies, roles, output paths)
|
|
32
|
+
├── secrets.json # Global secrets for Blind Injection
|
|
33
|
+
├── knowledge/ # Domain-specific markdown knowledge hints
|
|
34
|
+
├── plugins/ # Isolated storage directories for installed plugins
|
|
35
|
+
├── downloads/ # Downloaded files (default output dir)
|
|
36
|
+
├── pdfs/ # Exported PDF documents
|
|
37
|
+
├── snapshots/ # Screenshots and MHTML snapshots
|
|
38
|
+
├── recordings/ # Screen recordings (webp / gif / webm / mp4)
|
|
39
|
+
└── designs/ # Extracted design tokens and Tailwind themes
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Each output directory (`downloads`, `pdfs`, `snapshots`, `recordings`, `designs`) is overridable via its matching config path field.
|
|
43
|
+
|
|
44
|
+
## 3. System Intelligence Directory: `~/.weavetab-system/`
|
|
45
|
+
|
|
46
|
+
Machine-managed, cross-session state. Strictly separate from user configuration:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
~/.weavetab-system/
|
|
50
|
+
├── memory/ # Per-domain selector confidence cache
|
|
51
|
+
│ └── sites/ # Persistent site profiles: workflows, quirks & reliability scores
|
|
52
|
+
├── sessions/
|
|
53
|
+
│ └── context.json # Rolling action trail for loop detection
|
|
54
|
+
├── checkpoints/ # Named browser-state checkpoints
|
|
55
|
+
├── missions/ # Mission state files
|
|
56
|
+
├── apps/ # Dedicated isolated profiles for Electron apps
|
|
57
|
+
├── extension/ # Installed browser extension build
|
|
58
|
+
├── logs/ # Mission logs: mission_<timestamp>.log / .jsonl (devMode only)
|
|
59
|
+
├── locks/ # Process lockfiles (PID + TCP port validation)
|
|
60
|
+
├── secrets-key # Local key used to encrypt stored secrets
|
|
61
|
+
└── session-profile*/ # Isolated Chromium browser profiles (never your real profile)
|
|
62
|
+
```
|
|
@@ -1,214 +1,225 @@
|
|
|
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
|
-
{ "
|
|
137
|
-
{ "
|
|
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
|
|
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
|
-
|
|
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
|
+
{ "tool": "click_and_wait", "selector": ".monaco-editor" },
|
|
137
|
+
{ "tool": "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 DOM calls stick to that active desktop app without spawning an unwanted Chrome window. The sticky Electron app is only used while **no web-browser session is active**; once a web-browser session is running, a plain `browser_tabs(action: "open")` (no `app`) targets the browser.
|
|
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
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 8. Opening Tabs Inside Electron Apps
|
|
218
|
+
|
|
219
|
+
Electron apps do **not** implement the CDP `Target.createTarget` command, so a brand-new tab or window cannot be created inside a desktop app from the outside. `browser_tabs(action: "open")` therefore:
|
|
220
|
+
|
|
221
|
+
- **Reuses** the existing tab/window when the requested URL is already loaded (focuses it) — the default `reuse: true` behavior.
|
|
222
|
+
- **Fails fast with an actionable error** when a genuinely new tab is required in an Electron app, e.g. `[!] Electron app "slack" does not support opening new tabs or windows via CDP ... Use browser_navigate with { app: "slack", url: "..." } ...` — instead of surfacing a raw `Not supported` CDP message.
|
|
223
|
+
|
|
224
|
+
To load a URL inside an Electron app, navigate its existing window with `browser_navigate({ app: "<name>", url: "..." })`.
|
|
225
|
+
|