@weavetab/mcp 2.5.0-beta.2 → 2.5.0-beta.4

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.
Files changed (113) hide show
  1. package/AGENTS.md +1 -1
  2. package/ARCHITECTURE.md +6 -6
  3. package/LICENSE +1 -1
  4. package/README.md +158 -961
  5. package/SECURITY.md +33 -22
  6. package/TROUBLESHOOTING.md +2 -2
  7. package/dist/cdp/bridge.js +2 -1
  8. package/dist/cdp/connector.d.ts +2 -0
  9. package/dist/cdp/connector.js +8 -4
  10. package/dist/cdp/helpers.d.ts +4 -0
  11. package/dist/cdp/helpers.js +181 -0
  12. package/dist/cdp/omni_broker.d.ts +1 -1
  13. package/dist/cdp/omni_broker.js +1 -1
  14. package/dist/cdp/walker.d.ts +25 -1
  15. package/dist/cdp/walker.js +304 -7
  16. package/dist/cli/plugin.js +24 -17
  17. package/dist/cli/updater.d.ts +1 -1
  18. package/dist/cli/updater.js +27 -7
  19. package/dist/config/loader.d.ts +8 -0
  20. package/dist/config/loader.js +41 -2
  21. package/dist/desktop/discovery.d.ts +44 -0
  22. package/dist/desktop/discovery.js +364 -0
  23. package/dist/index.js +95 -15
  24. package/dist/intelligence/marks.d.ts +36 -0
  25. package/dist/intelligence/marks.js +30 -0
  26. package/dist/intelligence/patternCompiler.d.ts +118 -0
  27. package/dist/intelligence/patternCompiler.js +259 -0
  28. package/dist/intelligence/sessionMemory.d.ts +2 -0
  29. package/dist/intelligence/sessionMemory.js +18 -8
  30. package/dist/overlay/injector.js +2 -2
  31. package/dist/plugin/interface.d.ts +76 -2
  32. package/dist/plugin/loader.d.ts +15 -1
  33. package/dist/plugin/loader.js +217 -70
  34. package/dist/plugin/pipeline.d.ts +75 -0
  35. package/dist/plugin/pipeline.js +183 -0
  36. package/dist/plugin/registry.js +3 -2
  37. package/dist/security/secrets.d.ts +1 -0
  38. package/dist/security/secrets.js +13 -0
  39. package/dist/sensors/actionability.js +1 -2
  40. package/dist/sensors/guard.js +4 -10
  41. package/dist/sensors/mutations.js +12 -0
  42. package/dist/sensors/operation_monitor.js +1 -0
  43. package/dist/server.d.ts +1 -1
  44. package/dist/server.js +428 -156
  45. package/dist/state/agent.d.ts +1 -0
  46. package/dist/state/agent.js +3 -0
  47. package/dist/state/delta.d.ts +12 -4
  48. package/dist/state/delta.js +67 -14
  49. package/dist/state/session.d.ts +6 -0
  50. package/dist/state/session.js +27 -0
  51. package/dist/tools/browser_detect.d.ts +16 -3
  52. package/dist/tools/browser_detect.js +50 -5
  53. package/dist/tools/burst.d.ts +17 -8
  54. package/dist/tools/burst.js +236 -77
  55. package/dist/tools/checkpoint.d.ts +38 -0
  56. package/dist/tools/checkpoint.js +271 -0
  57. package/dist/tools/click.d.ts +1 -0
  58. package/dist/tools/click.js +74 -70
  59. package/dist/tools/design_extract.js +1 -1
  60. package/dist/tools/eval.js +1 -1
  61. package/dist/tools/fill.d.ts +20 -1
  62. package/dist/tools/fill.js +199 -40
  63. package/dist/tools/find.d.ts +16 -0
  64. package/dist/tools/find.js +67 -44
  65. package/dist/tools/github/index.d.ts +19 -4
  66. package/dist/tools/github/index.js +40 -4
  67. package/dist/tools/highlight.d.ts +6 -2
  68. package/dist/tools/highlight.js +158 -72
  69. package/dist/tools/inspect.js +1 -1
  70. package/dist/tools/key.js +65 -56
  71. package/dist/tools/navigate.js +29 -34
  72. package/dist/tools/pdf.js +21 -13
  73. package/dist/tools/pointer.d.ts +18 -3
  74. package/dist/tools/pointer.js +89 -1
  75. package/dist/tools/read.d.ts +28 -8
  76. package/dist/tools/read.js +230 -56
  77. package/dist/tools/scrape.js +67 -13
  78. package/dist/tools/screenshot.js +21 -16
  79. package/dist/tools/scroll.js +6 -11
  80. package/dist/tools/select.js +8 -2
  81. package/dist/tools/snapshot.js +3 -34
  82. package/dist/tools/tabs.js +14 -6
  83. package/dist/tools/thought.d.ts +2 -0
  84. package/dist/tools/thought.js +13 -14
  85. package/dist/tools/type.d.ts +2 -0
  86. package/dist/tools/type.js +107 -58
  87. package/dist/tools/type_secret.js +42 -76
  88. package/dist/tools/upload.js +1 -1
  89. package/dist/tools/video_compiler.d.ts +1 -1
  90. package/dist/tools/video_compiler.js +11 -12
  91. package/dist/version.d.ts +5 -0
  92. package/dist/version.js +5 -0
  93. package/docs/DOCUMENTATION.md +21 -32
  94. package/docs/PLUGINS.md +121 -0
  95. package/docs/TOOLS.md +56 -0
  96. package/docs/architecture/blind-injection.md +83 -20
  97. package/docs/architecture/overview.md +49 -49
  98. package/docs/configuration/folders.md +55 -54
  99. package/docs/desktop-automation/electron-apps.md +217 -162
  100. package/docs/get-started/introduction.md +60 -60
  101. package/docs/intelligence/site-profiles.md +151 -0
  102. package/docs/tools/tools.md +631 -293
  103. package/docs/troubleshooting/trouble-loop.md +31 -31
  104. package/ext-dist/background.js +10 -62
  105. package/ext-dist/content.js +333 -920
  106. package/ext-dist/hud/hud.js +9 -9
  107. package/ext-dist/manifest.json +2 -6
  108. package/ext-dist/styles.css +6 -1
  109. package/mcp.json +101 -67
  110. package/package.json +5 -6
  111. package/server.json +3 -3
  112. package/ext-dist/sidepanel/sidepanel.js +0 -25
  113. package/ext-dist/sidepanel.html +0 -547
package/README.md CHANGED
@@ -1,89 +1,97 @@
1
1
  <div align="center">
2
-
3
- ![WeaveTab MCP Logo](icon.png)
4
-
5
- <h1>WeaveTab MCP</h1>
6
- <p><strong>Direct Layer 0 interface for AI agents across web and desktop applications.</strong></p>
7
- <p><em>No WebDriver. No Cloud. Pure Control.</em></p>
8
-
9
- <p>
10
- <img src="https://img.shields.io/badge/version-2.5.0-3b82f6?style=flat-square" alt="Version" />
11
- <img src="https://img.shields.io/badge/status-beta-f59e0b?style=flat-square" alt="Beta" />
12
- <img src="https://img.shields.io/badge/license-AGPL--3.0-8b5cf6?style=flat-square" alt="License" />
13
- <img src="https://img.shields.io/badge/protocol-MCP-10b981?style=flat-square" alt="MCP" />
14
- <img src="https://img.shields.io/badge/node-%3E%3D18-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node" />
15
- <img src="https://img.shields.io/badge/tools-45-ec4899?style=flat-square" alt="Tools" />
16
- </p>
17
-
18
- <p>
19
- <a href="https://github.com/weavetab/mcp">GitHub</a> ·
20
- <a href="docs/tools/overview.md">Tool Reference</a> ·
21
- <a href="docs/DOCUMENTATION.md">Documentation</a> ·
22
- <a href="SECURITY.md">Security Policy</a> ·
23
- <a href="CONTRIBUTING.md">Contributing</a>
24
- </p>
25
- </div>
26
2
 
27
- ---
3
+ <img src="icon.png" width="96" alt="Weavetab" /><br /><br />
4
+
5
+ <h1>Weavetab MCP</h1>
28
6
 
29
- **Weavetab** is a local, high-performance [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server providing AI agents with direct, physical control across Chromium browsers and Electron desktop applications (Discord, VS Code, Antigravity, Figma, Slack, and local projects). Communicating directly over the **Chrome DevTools Protocol (CDP) WebSocket at Layer 0**, Weavetab eliminates WebDriver binaries, browser wrappers, and cloud middleware for deterministic **3–8ms tool execution latency**.
7
+ <p>A local <a href="https://modelcontextprotocol.io">Model Context Protocol</a> server that gives AI agents<br />direct, physical control over browsers and desktop applications via the Chrome DevTools Protocol.</p>
30
8
 
31
- Built by **fy2ne**, Weavetab is engineered for autonomous AI agents operating in production environments where latency, security, and token efficiency are non-negotiable.
9
+ <p>
10
+ <a href="https://github.com/weavetab/mcp/releases"><img src="https://img.shields.io/github/v/release/weavetab/mcp?label=version&style=flat-square&color=3b82f6" alt="version" /></a>
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0-8b5cf6?style=flat-square" alt="license" /></a>
12
+ <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-compatible-10b981?style=flat-square" alt="MCP" /></a>
13
+ <img src="https://img.shields.io/badge/Node.js-%3E%3D18-green?style=flat-square" alt="Node" />
14
+ <a href="docs/tools/tools.md"><img src="https://img.shields.io/badge/tools-44-ec4899?style=flat-square" alt="tools" /></a>
15
+ <a href="https://github.com/sponsors/fy2ne"><img src="https://img.shields.io/badge/sponsor-fy2ne-ea4aaa?style=flat-square&logo=github-sponsors" alt="sponsor" /></a>
16
+ </p>
17
+
18
+ <p>
19
+ <a href="docs/tools/tools.md">Tool Reference</a> &nbsp;&middot;&nbsp;
20
+ <a href="docs/DOCUMENTATION.md">Documentation</a> &nbsp;&middot;&nbsp;
21
+ <a href="ARCHITECTURE.md">Architecture</a> &nbsp;&middot;&nbsp;
22
+ <a href="SUPPORT.md">Support</a> &nbsp;&middot;&nbsp;
23
+ <a href="SECURITY.md">Security</a>
24
+ </p>
25
+
26
+ </div>
32
27
 
33
28
  ---
34
29
 
35
- ## Table of Contents
36
-
37
- - [Quick Start](#quick-start)
38
- - [Architecture](#architecture)
39
- - [Core Features](#core-features)
40
- - [Electron & Desktop App Automation](#electron--desktop-app-automation)
41
- - [Tool Categories](#tool-categories)
42
- - [CLI Reference](#cli-reference)
43
- - [Configuration](#configuration)
44
- - [Secrets Management](#secrets-management)
45
- - [MCP Client Integration](#mcp-client-integration)
46
- - [Development Environment](#development-environment)
47
- - [Plugin System](#plugin-system)
48
- - [Weavetab Skills Ecosystem](#weavetab-skills-ecosystem)
49
- - [Security Model](#security-model)
50
- - [Feature Comparison](#feature-comparison)
51
- - [Contributing](#contributing)
30
+ Weavetab is a local, production-grade MCP server that connects AI agents directly to Chromium browsers and Electron desktop applications through the **Chrome DevTools Protocol (CDP) WebSocket at Layer 0** — no WebDriver binaries, no Playwright processes, no cloud relay.
31
+
32
+ Tool invocations resolve in **3–8 ms of mean latency**. DOM state is compressed into agent-readable semantic maps and diffed across turns, cutting prompt token usage by **up to 95%**. Security is enforced locally via per-domain policies, 4-tier RBAC, and cryptographic blind credential injection.
33
+
34
+ Built by [fy2ne](https://github.com/fy2ne).
52
35
 
53
36
  ---
54
37
 
55
- ## Quick Start
38
+ ## Why not Playwright or Puppeteer?
56
39
 
57
- ### Quick Run with npx (Recommended)
40
+ > The standard approach — Playwright over MCP — works. But it carries fundamental architectural costs that compound at scale.
58
41
 
59
- ```bash
60
- # Run directly with npx
61
- npx -y @weavetab/mcp
62
- ```
42
+ | | Playwright / Puppeteer | **Weavetab** |
43
+ |---|---|---|
44
+ | **Protocol layer** | WebDriver BiDi or CDP via browser binary | Raw CDP WebSocket, Layer 0 |
45
+ | **Tool execution latency** | 50–300 ms (binary + IPC overhead) | **3–8 ms** |
46
+ | **Desktop app control** | Browser only | Chrome + any Electron app (Discord, VS Code, Figma…) |
47
+ | **DOM representation** | Full HTML dump to LLM | Semantic Map 3.0 with delta diffing |
48
+ | **Token cost per map** | ~2,000–8,000 tokens | **~80–400 tokens** (95% reduction via delta) |
49
+ | **CAPTCHA** | API service required | **Zero-API** via CDP mouse physics |
50
+ | **Credential safety** | Secrets passed in plaintext | **Blind Injection** — never in LLM context |
51
+ | **Extension access** | Limited | Full Chrome Extension API surface |
63
52
 
64
- ### Or Install Globally via npm
53
+ ---
65
54
 
66
- ```bash
67
- # Install globally
68
- npm install -g @weavetab/mcp
55
+ ## Architecture
69
56
 
70
- # Launch the MCP server
71
- weavetab
72
57
  ```
58
+ MCP Client (Claude / Cursor / Antigravity / Copilot / Windsurf)
59
+ |
60
+ | JSON-RPC 2.0 (stdio or WebSocket :3000)
61
+ v
62
+ +-------------------------------------------------------------+
63
+ | Weavetab MCP Server |
64
+ | |
65
+ | +-----------------+ +---------------------------------+ |
66
+ | | Security Layer |-->| Intelligence Engine | |
67
+ | | Rate · RBAC | | Map 3.0 · Delta · Memory | |
68
+ | | Policy · Audit | | Pruner · Framework Detector | |
69
+ | +-----------------+ +----------------+----------------+ |
70
+ | | |
71
+ | +----------v----------------+ |
72
+ | | CDP Bridge | |
73
+ | | Ghost Cursor · Typing | |
74
+ | | App Router · Loop Guard | |
75
+ | +----------+----------------+ |
76
+ +-------------------------------------------------------------+
77
+ | CDP WebSocket (127.0.0.1)
78
+ +---------------------------+-----------------------------+
79
+ v v v
80
+ Chrome / Edge VS Code / Discord Your Electron App
81
+ (any tab) (Electron apps) (local dev)
82
+ ```
83
+
84
+ No cloud. No external process. The CDP WebSocket connection is strictly bound to `127.0.0.1`.
85
+
86
+ ---
73
87
 
74
- ### Verify Installation
88
+ ## Quick Start
75
89
 
76
90
  ```bash
77
- weavetab --version
78
- # → @weavetab/mcp 2.5.0
79
-
80
- weavetab help
81
- # → Full CLI usage
91
+ npx -y @weavetab/mcp
82
92
  ```
83
93
 
84
- ### Connect to an MCP Client
85
-
86
- Add to your MCP client configuration (e.g., `claude_desktop_config.json`):
94
+ Add to your MCP client config:
87
95
 
88
96
  ```json
89
97
  {
@@ -96,979 +104,168 @@ Add to your MCP client configuration (e.g., `claude_desktop_config.json`):
96
104
  }
97
105
  ```
98
106
 
99
- ---
100
-
101
- ## Architecture
102
-
103
- Weavetab operates as the execution layer between an MCP client and a live Chromium browser. Every tool invocation travels through a security-hardened, multi-stage pipeline before a single byte touches the browser.
104
-
105
- ```mermaid
106
- flowchart LR
107
- Client["**MCP Client**<br/>(Claude / Cursor / Copilot)"]
108
-
109
- subgraph Server ["WeaveTab MCP Server"]
110
- direction LR
111
-
112
- subgraph Security ["Security Pipeline"]
113
- direction LR
114
- Rate["Rate Limiter"] --> Domain["Domain Policy"]
115
- Domain --> RBAC["RBAC Check"]
116
- end
117
-
118
- subgraph Intel ["Intelligence Engine"]
119
- direction TB
120
- I1["Delta Engine · Session Memory"]
121
- I2["DOM Pruner · Trail/Loop Detect"]
122
- I3["Knowledge Hints · Vision Fallback"]
123
- end
124
-
125
- subgraph Bridge ["CDP Bridge Layer"]
126
- direction LR
127
- B1["Ghost Cursor · Keystroke Engine"]
128
- B2["DOM Walker · Shadow DOM Injector"]
129
- end
130
-
131
- Security --> Intel
132
- Intel --> Bridge
133
- end
134
-
135
- Browser["**Chromium Browser**<br/>(Chrome / Edge / Brave)"]
136
-
137
- Client -- "JSON-RPC<br/>(stdio OR WebSocket :3000)" --> Server
138
- Bridge -- "CDP WebSocket<br/>(127.0.0.1 — localhost only)" --> Browser
139
- ```
140
-
141
- ### Five Architectural Layers
142
-
143
- | Layer | Components | Responsibility |
144
- |-------|-----------|----------------|
145
- | **Transport** | stdio (JSON-RPC), WebSocket (port 3000) | MCP client communication |
146
- | **Security & Governance** | Domain blacklist, Rate limiter, RBAC (4 roles), Root guard, Storage blocker | Pre-flight security checks |
147
- | **Intelligence** | Session memory, Semantic Delta engine, DOM pruner, Trail/loop detection, Knowledge hints, Vision fallback | Token optimization, self-learning |
148
- | **Sensor Systems** | Network telemetry, DOM mutations, Human pacing, Agent state machine, Thought HUD | Runtime awareness |
149
- | **CDP Bridge** | DOM walker, Ghost cursor, Keystroke engine, Pruner, Shadow DOM injector, Tab manager, Browser launcher | Raw browser control |
150
-
151
- ### Transport Modes
152
-
153
- | Mode | Protocol | Use Case |
154
- |------|----------|----------|
155
- | **stdio** (default) | JSON-RPC over stdin/stdout | Claude Desktop, Cursor, Copilot, all standard MCP clients |
156
- | **WebSocket** (`--ws`) | JSON-RPC over WebSocket, port 3000 | Custom integrations, remote agent pipelines |
107
+ | Client | Config path |
108
+ |---|---|
109
+ | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` |
110
+ | Claude Code | `claude mcp add weavetab -- npx -y @weavetab/mcp` |
111
+ | Cursor | `.cursor/mcp.json` |
112
+ | Antigravity | `~/.gemini/antigravity/mcp/weavetab/` |
113
+ | VS Code Copilot | `.vscode/mcp.json` |
114
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
157
115
 
158
116
  ---
159
117
 
160
- ## Core Features
161
-
162
- ### Semantic Delta Engine
163
- Instead of dumping the full DOM on every `browser_map` call, the Delta Engine stores a per-tab snapshot and returns **only what changed**. This reduces token consumption by **5–10× on repeated reads**. Combined with the Semantic DOM Pruner (which drops hidden non-interactive elements and collapses SVG icons to `[SVG Icon: label]` tokens), agents receive minimal, actionable context.
118
+ ## Core Technology
164
119
 
165
- ```
166
- browser_map({ prune: true, delta: true }) → Maximum token efficiency
167
- ```
168
-
169
- ### Ghost Cursor
170
- Every click dispatches a physics-realistic **Bézier curve trajectory** — not a raw coordinate warp. Acceleration, jitter, and hold-duration are sampled from a human motion profile, making automation indistinguishable from human input at the DOM event level.
171
-
172
- ### Human Typing Engine
173
- Keystrokes are dispatched with **per-character jitter**, **burst-pattern profiling** (humans type fast in bursts, slow at boundaries), and natural inter-word pauses. The engine includes real-time DOM-diffing to detect and break stuck-typing loops.
120
+ ### Semantic Map 3.0
174
121
 
175
- ### Blind Injection (`browser_type_secret`)
176
- > [!IMPORTANT]
177
- > Enterprise-grade credential injection that **never exposes secret values to the LLM context**. Secrets are resolved from `~/.weavetab/secrets.json` (or a project-scoped `.weavetab/secrets.json`) with per-domain scoping. The injected value is permanently masked as `[REDACTED]` in all subsequent DOM snapshots, delta maps, and audit logs.
122
+ The primary bottleneck in browser-based agents is DOM representation. Full HTML dumps are noisy, large, and structurally meaningless to language models. Weavetab's `browser_map` runs an in-browser CDP walker that produces a compact semantic map:
178
123
 
179
- ### Session Memory
180
- Each domain visited builds a persistent profile on disk at `~/.weavetab-system/memory/`. The system auto-detects frontend frameworks (React, Vue, Angular, Lit, Svelte, Next, Nuxt, Gatsby) via `Runtime.evaluate`. Strategies and known inputs accumulate across sessions, enabling progressive improvement.
181
-
182
- ```json
183
- {
184
- "framework": "react",
185
- "shadowDom": true,
186
- "strategies": ["click_nav_menu", "type_search"],
187
- "knownInputs": [{ "label": "Search", "selector": "#search" }],
188
- "visitCount": 12,
189
- "updatedAt": "2026-07-20T..."
190
- }
191
124
  ```
125
+ ╔═ ACTIVE DIALOG: "Confirm Payment" ═╗
126
+ [w:3] button "Confirm" [w:4] button "Cancel"
192
127
 
193
- ### Loop Detection & Trail System
194
- > [!WARNING]
195
- > A rolling window of the last 50 tool actions is maintained in `~/.weavetab-system/sessions/context.json`. A strike-based algorithm detects stuck loops:
196
-
197
- | Strikes | Severity | Behavior |
198
- |---------|----------|----------|
199
- | < 5 | None | Normal operation |
200
- | 5–9 | Warning | HUD reports potential loop |
201
- | 10+ | Critical | Agent state → "stuck"; auto-recovery attempted |
128
+ ┌ "Pro Plan — $49/mo"
129
+ [w:12] button "Upgrade" [w:13] button "View Details"
130
+ [w:14] input val:"john@example.com" ph:"Email address" FOCUSED
202
131
 
203
- Use `browser_reset_loop_counter` to manually clear the counter.
204
-
205
- ### Vision Fallback System
206
- When the CDP Accessibility Tree returns zero elements (canvas-heavy pages, fully custom UIs), Weavetab falls back to local pixel analysis via the `sharp` library — **zero external API calls, zero ML dependencies**:
207
-
208
- ```
209
- CDP AX Tree Empty → Capture Screenshot → Grayscale Conversion
210
- → 4×4 Grid Heatmap → Text Density Calculation → Clickable Zone Detection
211
- → Page State Classification
132
+ [w:20...w:38] 18 nav links: "Dashboard" ... "Sign out"
212
133
  ```
213
134
 
214
- ### ⚡ Burst Mode
215
- Chain N actions in a single MCP round-trip with `browser_burst`. Supports macro steps: `type_and_send`, `navigate_and_read`, `click_and_wait`, `scroll_and_read`. Eliminates the per-tool JSON-RPC overhead for high-throughput workflows.
216
-
217
- ---
218
-
219
- ## Electron & Desktop App Automation
135
+ Key properties:
220
136
 
221
- Weavetab extends its Layer 0 CDP engine beyond web browsers to **any Electron-based desktop application or locally hosted webview app** (e.g. **Discord**, **Slack**, **VS Code**, **Antigravity IDE**, **Figma**, **Obsidian**, **Postman**, or your own custom Electron projects running from source).
137
+ - **Ref IDs** (`w:N`) are stable within a session and used by all interaction tools
138
+ - **Container binding** — buttons and inputs are grouped under their parent card, row, or section header
139
+ - **Modal hoisting** — open dialogs are isolated at the top so agents cannot miss them
140
+ - **Link collapsing** — repeated nav/footer runs of 4+ links compress into a single token line
141
+ - **Semantic delta** — on re-reads, only changed nodes are transmitted (`~` modified, `+` added, `−` removed), cutting re-read cost by up to 95%
222
142
 
223
- Because Electron is built on Chromium and Blink, Weavetab controls desktop apps using the exact same low-latency CDP primitives (`browser_map`, `browser_click`, `browser_type`, `browser_tabs`, etc.) with zero app-specific hacks or overhead.
143
+ ### Ghost Cursor
224
144
 
225
- ### 1. Configuring Installed Desktop Apps
145
+ Clicks are not dispatched as synthetic DOM events. They are delivered as a physical sequence of `Input.dispatchMouseEvent` CDP calls along a Bezier curve trajectory with randomized acceleration, natural jitter, and hold durations. Anti-bot fingerprinting that flags event-based automation does not trigger.
226
146
 
227
- Add your application executable paths to `~/.weavetab/config.json` (or `./.weavetab/config.json`) under the `"electron"` dictionary:
147
+ `browser_pointer` supports `hover_chain` for multi-level menu traversal in a single tool call:
228
148
 
229
149
  ```json
230
150
  {
231
- "browserType": "chromium",
232
- "electron": {
233
- "discord": "C:\\Users\\<user>\\AppData\\Local\\Discord\\app-1.0.9183\\Discord.exe",
234
- "antigravity": "C:\\Users\\<user>\\AppData\\Local\\Programs\\antigravity\\Antigravity.exe",
235
- "vscode": "C:\\Users\\<user>\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",
236
- "figma": "C:\\Users\\<user>\\AppData\\Local\\Figma\\Figma.exe",
237
- "obsidian": "C:\\Users\\<user>\\AppData\\Local\\Obsidian\\Obsidian.exe",
238
- "slack": "/Applications/Slack.app/Contents/MacOS/Slack"
239
- }
151
+ "hover_chain": ["File", "Export As", "PNG"],
152
+ "click_final": true
240
153
  }
241
154
  ```
242
155
 
243
- ### 2. Automating Local / Source-Hosted Electron Projects
156
+ ### Blind Credential Injection
244
157
 
245
- If you are developing a local Electron app from source code or running it via Vite / Webpack / Next.js on `localhost`, you can automate it in two ways:
246
-
247
- #### Option A: Launch with Remote Debugging Flag
248
- Start your development process passing the Chrome DevTools Protocol remote debugging port:
158
+ `browser_type_secret` resolves secrets server-side from `~/.weavetab/secrets.json`. The resolved value is never included in the MCP response, never appears in DOM snapshots, and is permanently masked as `[REDACTED]` in all audit logs. The LLM context never sees the credential.
249
159
 
250
160
  ```bash
251
- # Standard Electron CLI / npm script
252
- npx electron . --remote-debugging-port=9222
253
-
254
- # Or within your package.json scripts:
255
- # "dev:debug": "electron . --remote-debugging-port=9222"
256
- npm run dev:debug
257
- ```
258
-
259
- Then configure `"attachPort": 9222` in `.weavetab/config.json` or register it in `"electron"`:
260
- ```json
261
- {
262
- "electron": {
263
- "my-dev-app": "npm run dev:debug"
264
- }
265
- }
266
- ```
267
-
268
- #### Option B: Register Local App Executable / Wrapper Script
269
- Specify your local build binary or launch script in `"electron"`:
270
- ```json
271
- {
272
- "electron": {
273
- "my-local-app": "C:\\Users\\<user>\\projects\\my-app\\node_modules\\electron\\dist\\electron.exe"
274
- }
275
- }
161
+ weavetab secrets set GITHUB_TOKEN
162
+ # Stored. Never echoed, never logged, never surfaced to the agent.
276
163
  ```
277
164
 
278
- ### 3. Controlling Desktop Apps via MCP Tools
165
+ ### Electron & Desktop App Automation
279
166
 
280
- All Weavetab tools accept an optional `app` parameter specifying which application to target. When specified, Weavetab automatically connects to that app's dedicated CDP session without launching or interfering with your default browser.
167
+ Any tool accepts an optional `app` parameter that routes the command to a registered Electron process instead of a browser tab:
281
168
 
282
- #### Launch / Focus Desktop App
283
169
  ```json
284
- {
285
- "name": "browser_navigate",
286
- "arguments": {
287
- "app": "antigravity"
288
- }
289
- }
170
+ { "app": "discord", "ref": "w:24", "text": "Hey, deploying now" }
290
171
  ```
291
172
 
292
- #### List & Switch Windows / Workbenches
293
- Desktop apps often run multiple browser windows or background webviews. Inspect and switch active contexts using `browser_tabs`:
294
- ```json
295
- {
296
- "name": "browser_tabs",
297
- "arguments": {
298
- "action": "list",
299
- "app": "antigravity"
300
- }
301
- }
302
- ```
173
+ Register apps in `~/.weavetab/config.json`:
303
174
 
304
- Switch to a specific window/tab:
305
175
  ```json
306
176
  {
307
- "name": "browser_tabs",
308
- "arguments": {
309
- "action": "switch",
310
- "tabId": "D8832CBF1FEF413B6E09E96EF8C82DFF",
311
- "app": "antigravity"
177
+ "electron": {
178
+ "discord": "C:\\Users\\<user>\\AppData\\Local\\Discord\\Discord.exe",
179
+ "vscode": "C:\\Users\\<user>\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",
180
+ "figma": "C:\\Users\\<user>\\AppData\\Local\\Figma\\Figma.exe"
312
181
  }
313
182
  }
314
183
  ```
315
184
 
316
- #### Inspect DOM & Interact with UI Elements
317
- Generate actionable Ref IDs (`w:NN`) and interact directly with native desktop UI components:
318
- ```json
319
- // 1. Snapshot the Desktop App UI
320
- {
321
- "name": "browser_map",
322
- "arguments": {
323
- "app": "antigravity"
324
- }
325
- }
326
-
327
- // 2. Click Settings or Menus
328
- {
329
- "name": "browser_click",
330
- "arguments": {
331
- "ref": "w:14",
332
- "app": "antigravity"
333
- }
334
- }
185
+ Weavetab auto-attaches via CDP to the registered process. No code changes required in the target application.
335
186
 
336
- // 3. Type text into Desktop inputs
337
- {
338
- "name": "browser_type",
339
- "arguments": {
340
- "ref": "w:28",
341
- "text": "Hello from WeaveTab automation!",
342
- "app": "discord"
343
- }
344
- }
345
- ```
346
-
347
- ---
187
+ ### Zero-API CAPTCHA Solving
348
188
 
349
- ## Tool Categories
350
-
351
- Weavetab exposes **44+ MCP tools** organized into functional categories. See the complete reference in [`docs/TOOLS.md`](docs/TOOLS.md).
352
-
353
- ### Vision & Reading (7 tools)
354
- | Tool | Description |
355
- |------|-------------|
356
- | `browser_map` | DOM enumeration with volatile `w:NN` ref IDs that invalidate after DOM mutations. Supports delta mode, semantic pruning, AX tree fallback, scope & query filtering |
357
- | `browser_find` | Native CDP text search — ~10× cheaper than map |
358
- | `browser_scrape` | CSS/XPath (Note: XPath lacks shadow-DOM support) structured data extraction |
359
- | `browser_inspect` | Computed CSS styles + event listener types |
360
- | `browser_snapshot` | MHTML capture/restore of full DOM state |
361
- | `browser_screenshot` | PNG/JPEG capture, full-page + clip region, returns base64 (no file pollution) |
362
- | `browser_console` | Read/clear buffered console logs & exceptions |
363
-
364
- ### Navigation (1 tool)
365
- | Tool | Description |
366
- |------|-------------|
367
- | `browser_navigate` | Navigate to URL with domain blocklist enforcement & `weavetab://` protocol support |
368
-
369
- ### Input (9 tools)
370
- | Tool | Description |
371
- |------|-------------|
372
- | `browser_click` | Ghost Cursor (Bézier) click with multi-strategy fallback and intent memory |
373
- | `browser_type` | Human keystroke engine with jitter, burst patterns, and stuck-loop detection |
374
- | `browser_type_secret` | **Blind Injection** — resolves credentials from `secrets.json`, never exposes to LLM |
375
- | `browser_key` | Native keyboard dispatch with modifier keys (Ctrl, Shift, Alt, Meta) |
376
- | `browser_pointer` | Hover, double-click, drag-and-drop with Ghost Cursor trajectory |
377
- | `browser_select` | Native `<select>` dropdown selection (React/Vue safe via prototype setter) |
378
- | `browser_fill` | Smart multi-field form fill with per-field type detection |
379
- | `browser_upload` | Bypass file dialogs via CDP `DOM.setFileInputFiles` |
380
- | `browser_scroll` | Directional + element-relative scroll via CDP wheel events |
381
-
382
- ### Tabs & Windows (2 tools)
383
- | Tool | Description |
384
- |------|-------------|
385
- | `browser_tabs` | Open/switch/close/list/consolidate/heal tabs and windows |
386
- | `browser_detect` | Detect installed browsers + CDP feature coverage per engine |
387
-
388
- ### Mission Execution (3 tools)
389
- | Tool | Description |
390
- |------|-------------|
391
- | `browser_burst` | Chain N actions in 1 MCP call — highest throughput mode |
392
- | `browser_plan` | Live task dashboard in browser Shadow DOM overlay |
393
- | `browser_automation` | Inject persistent self-running background scripts |
394
-
395
- ### Dialog & User Interaction (3 tools)
396
- | Tool | Description |
397
- |------|-------------|
398
- | `browser_dialog` | Accept/dismiss JavaScript alert/confirm/prompt dialogs |
399
- | `browser_thought` | Green thought-bubble HUD: `feedback` (one-way) or `question` (with input) |
400
- | `browser_clipboard` | System clipboard R/W (text + images) |
401
-
402
- ### Wait & Timing (2 tools)
403
- | Tool | Description |
404
- |------|-------------|
405
- | `browser_wait` | Wait for element/text/URL/stable/network/auto |
406
- | `browser_reset_loop_counter` | Manual loop detection override |
407
-
408
- ### Storage & Cookies (2 tools)
409
- | Tool | Description |
410
- |------|-------------|
411
- | `browser_storage` | `localStorage` & `sessionStorage` get/set/clear |
412
- | `browser_cookies` | Cookies get/set/delete/get_all |
413
-
414
- ### Device & Environment (1 tool)
415
- | Tool | Description |
416
- |------|-------------|
417
- | `browser_viewport` | Viewport resize, mobile emulation, geolocation, timezone, locale, color scheme |
418
-
419
- ### Network (1 tool)
420
- | Tool | Description |
421
- |------|-------------|
422
- | `browser_network_intercept` | Mock API responses, block tracking, and retrieve raw protocol network telemetry (TLS/SSL certificate metadata, microsecond timing breakdown, OS-level failure reasons) |
423
-
424
- ### Canvas & Visual (2 tools)
425
- | Tool | Description |
426
- |------|-------------|
427
- | `browser_canvas` | Get image data or draw points on `<canvas>` elements |
428
- | `browser_highlight` | Visual CDP overlay highlight — zero token cost |
429
-
430
- ### Output (2 tools)
431
- | Tool | Description |
432
- |------|-------------|
433
- | `browser_pdf` | Print page to PDF (landscape, scale, page ranges) |
434
- | `browser_recording` | Compile browser screencast frames into video (.webp, .gif, .mp4, .webm) |
435
-
436
- ### Evaluation (1 tool)
437
- | Tool | Description |
438
- |------|-------------|
439
- | `browser_eval` | Run arbitrary JS via `CDP Runtime.evaluate` |
440
-
441
- ### Performance (1 tool)
442
- | Tool | Description |
443
- |------|-------------|
444
- | `browser_performance` | FCP, LCP, TTI metrics and resource timings |
445
-
446
- ### Macro (1 tool)
447
- | Tool | Description |
448
- |------|-------------|
449
- | `browser_macro_compile` | Compile successful trails into reusable burst macros |
450
-
451
- ### GitHub (4 tools)
452
- | Tool | Description |
453
- |------|-------------|
454
- | `github_analyze` | Repo metadata, file tree, README snippet |
455
- | `github_read` | Read file contents via raw.githubusercontent.com (no API rate limit) |
456
- | `github_issues` | List/search/fetch issues with comments |
457
- | `github_get_pr` | PR details + changed files + comments |
458
-
459
- ### Utility (1 tool + Plugin System)
460
- | Tool | Description |
461
- |------|-------------|
462
- | `Weavetab_logs` | Append agent feedback to mission log |
463
- | Plugins | Dynamic tool loading from any npm package with `weavetab.json` (or `@weavetab/plugin-*`) |
189
+ `browser_captcha` solves Cloudflare Turnstile, reCAPTCHA v2/v3, GeeTest, and hCaptcha by orchestrating CDP mouse events that replicate human behavioral signatures — velocity curves, micro-pauses, scroll inertia — with no third-party API, no external service, and no API key required.
464
190
 
465
191
  ---
466
192
 
467
- ## CLI Reference
193
+ ## Tool Suite
468
194
 
469
- The `weavetab` CLI provides server management, secrets handling, and diagnostics.
195
+ 44 tools across 9 categories. Full parameter reference: [`docs/tools/tools.md`](docs/tools/tools.md)
470
196
 
471
- ### Server Commands
197
+ | Category | Tools |
198
+ |---|---|
199
+ | **Vision & DOM** | `browser_map` `browser_find` `browser_scrape` `browser_inspect` `browser_snapshot` `browser_screenshot` `browser_console` `browser_extract_design` |
200
+ | **Input & Interaction** | `browser_click` `browser_type` `browser_type_secret` `browser_key` `browser_pointer` `browser_select` `browser_fill` `browser_upload` `browser_scroll` |
201
+ | **Navigation & Environment** | `browser_navigate` `browser_tabs` `browser_detect` `browser_viewport` `browser_emulate` |
202
+ | **Mission & Automation** | `browser_burst` `browser_automation` `browser_recording` `browser_pattern_learn` |
203
+ | **Safety & Human Oversight** | `browser_dialog` `browser_thoughts` `browser_clipboard` `browser_wait` |
204
+ | **Autonomous CAPTCHA** | `browser_captcha` |
205
+ | **Network & Storage** | `browser_network_intercept` `browser_storage` `browser_cookies` `browser_checkpoint` `browser_performance` |
206
+ | **GitHub & Documents** | `browser_github` `browser_office` |
207
+ | **Canvas, Eval & Plugins** | `browser_eval` `browser_pdf` `browser_canvas` `browser_highlight` `list_plugins` `load_plugin` |
472
208
 
473
- ```bash
474
- # Start the MCP server (stdio mode — default for MCP clients)
475
- # Start the MCP server
476
- Weavetab
477
-
478
- # Interactive configuration wizard
479
- Weavetab config
480
-
481
- # View current state
482
- Weavetab view
483
-
484
- # Reset session cache
485
- Weavetab reset
486
- ```
487
-
488
- ### Secrets Management
489
-
490
- Credentials are stored in `~/.weavetab/secrets.json` (global) or `.weavetab/secrets.json` (project-scoped). The CLI provides safe management without ever echoing values to the terminal.
209
+ ---
491
210
 
492
- ```bash
493
- # Initialize project-scoped secrets store
494
- Weavetab secrets init --project
211
+ ## Security
495
212
 
496
- # Add or update a secret (prompts securely, value never echoed)
497
- Weavetab secrets set MY_API_KEY
213
+ - **Transport**: CDP WebSocket strictly bound to `127.0.0.1`. No listener on external interfaces.
214
+ - **Policy Engine**: Per-domain `allow` / `read-only` / `deny` / `audit` rules in `~/.weavetab/policy.json`
215
+ - **RBAC**: Four roles — `admin`, `operator`, `viewer`, `automation` — enforce tool-level permission gates
216
+ - **Blind Injection**: Credentials resolved server-side, masked in all outputs and audit logs
217
+ - **Loop Breaker**: Strike-based stuck-loop detector halts runaway autonomous sequences
218
+ - **Audit Log**: All tool invocations, policy decisions, and errors written to `~/.weavetab/logs/audit.log`
498
219
 
499
- # List all secrets (names only, values hidden)
500
- Weavetab secrets list
220
+ Security vulnerabilities: `security@fy2ne.me` (do not use public issues).
501
221
 
502
- # Remove a secret
503
- Weavetab secrets rm MY_API_KEY
504
- ```
222
+ ---
505
223
 
506
- ### Reset & Diagnostics
224
+ ## CLI Reference
507
225
 
508
226
  ```bash
509
- # Clear all session state (loop counter, memory snapshots)
510
- Weavetab reset
227
+ weavetab # Start in stdio mode (default)
228
+ weavetab --ws --port 3000 # WebSocket daemon mode
229
+ weavetab config # Interactive configuration wizard
230
+ weavetab secrets set KEY_NAME # Store a secret (never echoed)
231
+ weavetab secrets list # List stored secret keys (not values)
232
+ weavetab plugin add <name> # Install a plugin from npm
233
+ weavetab plugin list # List installed plugins
511
234
  ```
512
235
 
513
- ---
514
-
515
- ## Configuration
516
-
517
- Weavetab auto-generates a config file at `~/.weavetab/config.json` on first run. All values can be overridden with a project-scoped `.weavetab/config.json`.
236
+ Configuration file: `~/.weavetab/config.json`
518
237
 
519
238
  ```json
520
239
  {
521
240
  "browserType": "chromium",
522
241
  "headless": false,
523
242
  "extension": true,
524
- "devMode": false,
525
243
  "maxActionsPerMinute": 60,
526
244
  "role": "admin",
527
- "telemetry": false,
528
- "downloadDir": "~/Downloads",
529
- "profileDir": "~/.weavetab/profile",
530
245
  "electron": {
531
- "discord": "C:\\Users\\<user>\\AppData\\Local\\Discord\\app-1.0.9183\\Discord.exe",
532
- "antigravity": "C:\\Users\\<user>\\AppData\\Local\\Programs\\antigravity\\Antigravity.exe"
533
- }
534
- }
535
- ```
536
-
537
- | Key | Type | Default | Description |
538
- |-----|------|---------|-------------|
539
- | `browserType` | `"chromium"` \| `"firefox"` \| `"webkit"` | `"chromium"` | Which browser to launch/attach |
540
- | `headless` | boolean | `false` | Run browser without a window |
541
- | `extension` | boolean | `true` | Enable Weavetab Chrome extension integration |
542
- | `devMode` | boolean | `false` | Verbose CDP logging |
543
- | `maxActionsPerMinute` | number | `60` | Rate limit threshold |
544
- | `role` | `"admin"` \| `"system"` \| `"viewer"` \| `"automation"` | `"admin"` | RBAC role |
545
- | `telemetry` | boolean | `false` | Opt-in telemetry |
546
- | `electron` | `Record<string, string>` | `{}` | Named map of Electron desktop apps to executable paths or startup scripts |
547
-
548
- ### Domain Policy
549
-
550
- Configure per-domain policies in `~/.weavetab/policy.json`:
551
-
552
- ```json
553
- {
554
- "policies": [
555
- { "pattern": "*.banking.com", "mode": "deny" },
556
- { "pattern": "*.internal.corp", "mode": "read-only" },
557
- { "pattern": "staging.myapp.com", "mode": "audit" }
558
- ]
559
- }
560
- ```
561
-
562
- Available modes: `allow`, `read-only`, `deny`, `audit`.
563
-
564
- ---
565
-
566
- ## Secrets Management
567
-
568
- Weavetab's **Blind Injection** system keeps credentials permanently out of the LLM context.
569
-
570
- ### How It Works
571
-
572
- 1. You store a secret via `Weavetab secrets set MY_KEY` or by editing `secrets.json` directly
573
- 2. The agent calls `browser_type_secret({ id: "w:2", envKey: "MY_KEY" })`
574
- 3. Weavetab resolves the value from `secrets.json` **server-side** — the LLM never sees it
575
- 4. The value is injected directly into the DOM input field
576
- 5. All subsequent `browser_map`, delta, and AX tree outputs show `[REDACTED]` for that node
577
-
578
- ### Secrets File Format
579
-
580
- ```json
581
- {
582
- "MY_API_KEY": {
583
- "value": "sk-prod-...",
584
- "domains": ["api.example.com", "app.example.com"],
585
- "description": "Production API key"
586
- },
587
- "ADMIN_PASSWORD": {
588
- "value": "hunter2",
589
- "domains": ["admin.example.com"],
590
- "description": "Admin panel password"
591
- }
592
- }
593
- ```
594
-
595
- ### Resolution Priority
596
-
597
- | Priority | Location | Purpose |
598
- |----------|----------|---------|
599
- | 1st | `./.weavetab/secrets.json` | Project-scoped (opt-in via `Weavetab secrets init --project`) |
600
- | 2nd | `~/.weavetab/secrets.json` | Global default |
601
-
602
- > [!NOTE]
603
- > The legacy `.env`-based `EnvSecretProvider` is deprecated and no longer supported. All secrets must be stored in `secrets.json`.
604
-
605
- ---
606
-
607
- ## MCP Client Integration
608
-
609
- Weavetab connects out-of-the-box via stdio JSON-RPC 2.0 with all major AI coding assistants and IDEs.
610
-
611
- | Environment | Setup Method | Guided Web Installer |
612
- | :--- | :--- | :--- |
613
- | **Cursor** | `.cursor/mcp.json` | [weavetab.pages.dev/mcp/install/cursor](https://github.com/weavetab/mcp/mcp/install/cursor) |
614
- | **Antigravity** | `~/.gemini/antigravity/mcp/` | [weavetab.pages.dev/mcp/install/antigravity](https://github.com/weavetab/mcp/mcp/install/antigravity) |
615
- | **Claude Desktop** | `claude_desktop_config.json` | [weavetab.pages.dev/mcp/install/claude-desktop](https://github.com/weavetab/mcp/mcp/install/claude-desktop) |
616
- | **Claude Code** | `claude mcp add` | [weavetab.pages.dev/mcp/install/claude-code](https://github.com/weavetab/mcp/mcp/install/claude-code) |
617
- | **VS Code / Copilot** | 1-Click Protocol / `settings.json` | [weavetab.pages.dev/mcp/install/vscode](https://github.com/weavetab/mcp/mcp/install/vscode) |
618
- | **Windsurf** | `mcp_config.json` | [weavetab.pages.dev/mcp/install/windsurf](https://github.com/weavetab/mcp/mcp/install/windsurf) |
619
-
620
- ---
621
-
622
- ### Cursor
623
-
624
- Add to `.cursor/mcp.json` in your project root or in **Cursor Settings > MCP**:
625
-
626
- ```json
627
- {
628
- "mcpServers": {
629
- "weavetab": {
630
- "command": "npx",
631
- "args": ["-y", "@weavetab/mcp"]
632
- }
633
- }
634
- }
635
- ```
636
-
637
- ---
638
-
639
- ### Antigravity
640
-
641
- Register Weavetab in your Antigravity configuration or workspace `.gemini/settings.json`:
642
-
643
- ```json
644
- {
645
- "mcpServers": {
646
- "weavetab": {
647
- "command": "npx",
648
- "args": ["-y", "@weavetab/mcp"]
649
- }
246
+ "discord": "...",
247
+ "vscode": "...",
248
+ "antigravity": "..."
650
249
  }
651
250
  }
652
251
  ```
653
252
 
654
253
  ---
655
254
 
656
- ### Claude Desktop
657
-
658
- Add to your platform's configuration file:
659
- - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
660
- - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
661
- - **Linux:** `~/.config/Claude/claude_desktop_config.json`
662
-
663
- ```json
664
- {
665
- "mcpServers": {
666
- "weavetab": {
667
- "command": "npx",
668
- "args": ["-y", "@weavetab/mcp"]
669
- }
670
- }
671
- }
672
- ```
673
-
674
- ---
675
-
676
- ### Claude Code
677
-
678
- Run the terminal command to register Weavetab globally:
679
-
680
- ```bash
681
- claude mcp add weavetab -- npx -y @weavetab/mcp
682
- ```
683
-
684
- Or for project-scoped activation:
685
-
686
- ```bash
687
- claude mcp add --scope project weavetab -- npx -y @weavetab/mcp
688
- ```
689
-
690
- ---
691
-
692
- ### Visual Studio Code & Copilot
693
-
694
- Add to `.vscode/settings.json` or User Settings:
695
-
696
- ```json
697
- {
698
- "mcpServers": {
699
- "weavetab": {
700
- "command": "npx",
701
- "args": ["-y", "@weavetab/mcp"]
702
- }
703
- }
704
- }
705
- ```
706
-
707
- ---
708
-
709
- ### Windsurf
710
-
711
- Add to `~/.codeium/windsurf/mcp_config.json`:
712
-
713
- ```json
714
- {
715
- "mcpServers": {
716
- "weavetab": {
717
- "command": "npx",
718
- "args": ["-y", "@weavetab/mcp"]
719
- }
720
- }
721
- }
722
- ```
723
-
724
- ---
725
-
726
- ### WebSocket Mode (Custom Agent Pipelines & SDKs)
727
-
728
- Launch a standalone WebSocket daemon:
729
-
730
- ```bash
731
- weavetab --ws --port 3000
732
- ```
733
-
734
- ```javascript
735
- // Connect from any custom client or script
736
- const ws = new WebSocket("ws://localhost:3000");
737
- ws.send(JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/list" }));
738
- ```
739
-
740
- ---
741
-
742
- ## Development Environment
743
-
744
- ### Prerequisites
745
-
746
- - **Node.js 18+** (LTS recommended)
747
- - **npm 8+**
748
- - A **Chromium-based browser** (Chrome, Edge, Brave)
749
- - **Git**
750
-
751
- ### Source Code Setup
752
-
753
- ```bash
754
- # Clone the repository
755
- git clone https://github.com/weavetab/mcp.git
756
- cd mcp
757
-
758
- # Install dependencies
759
- npm install
760
-
761
- # Start in development mode (tsx watcher — auto-reloads on file changes)
762
- npm run dev
763
-
764
- # Build the project
765
- npm run build # Builds extension + HUD + TypeScript
766
- npm run build:ext # Extension only
767
- npm run build:hud # Shadow DOM HUD only
768
-
769
- # Run the MCP server from source
770
- node dist/index.js
771
- ```
772
-
773
- ### Project Structure
774
-
775
- ```
776
- src/
777
- ├── cdp/ # Chrome DevTools Protocol bridge (walker, connector, lock, pruner, ghost)
778
- ├── intelligence/ # Session memory, delta engine, trail, hints, vision fallback, intent
779
- ├── sensors/ # Network telemetry, DOM mutations, human pacing, wait guards, thoughts HUD
780
- ├── security/ # Domain blacklist, rate limiter, RBAC, Blind Injection secrets
781
- ├── state/ # Delta engine, agent state machine, session registry, mutation cache
782
- ├── tools/ # 44+ individual tool implementations
783
- │ └── github/ # GitHub API integration tools
784
- ├── overlay/ # Shadow DOM UI injector, Ghost cursor, thought bubble HUD
785
- ├── audit/ # Structured logging & telemetry
786
- ├── plugin/ # Plugin interface and dynamic loader
787
- ├── config/ # Multi-source config merge & live reload
788
- ├── cli/ # CLI utilities and update notifier
789
- ├── anticaptcha/ # CAPTCHA detection and solving strategies
790
- ├── server.ts # MCP server entry point — all tool registrations
791
- └── index.ts # CLI entry point (wizard, reset, main interactive UI)
792
- ```
793
-
794
- ### Testing
795
-
796
- ```bash
797
- # All tests
798
- npm test
799
-
800
- # Unit tests only (fast, no browser required)
801
- npm run test:unit
802
-
803
- # End-to-end smoke test (requires Chrome)
804
- npm run test:e2e
805
- ```
806
-
807
- ### Docker (Headless Production)
808
-
809
- Run Weavetab in a Docker container with a headless Chromium instance for CI/CD pipelines:
810
-
811
- ```dockerfile
812
- FROM node:20-slim
813
-
814
- # Install Chromium and dependencies
815
- RUN apt-get update && apt-get install -y \
816
- chromium \
817
- --no-install-recommends && rm -rf /var/lib/apt/lists/*
818
-
819
- # Install Weavetab MCP
820
- RUN npm install -g @weavetab/mcp
821
-
822
- # Set Chrome path for headless mode
823
- ENV CHROME_PATH=/usr/bin/chromium
824
-
825
- EXPOSE 3000
826
-
827
- CMD ["Weavetab", "--ws", "--headless"]
828
- ```
829
-
830
- ```bash
831
- docker build -t weavetab-server .
832
- docker run -p 3000:3000 weavetab-server
833
- ```
834
-
835
- ### Environment Variables
836
-
837
- | Variable | Description |
838
- |----------|-------------|
839
- | `CHROME_PATH` | Override Chromium binary path |
840
- | `WEAVETAB_CONFIG` | Path to a custom config file |
841
- | `WEAVETAB_ROLE` | Override RBAC role at runtime |
842
- | `WEAVETAB_DEV` | `1` to enable verbose dev logging & developer mode |
843
-
844
- ### Developer Mode (`devMode`)
845
-
846
- Setting `"devMode": true` in configuration or `WEAVETAB_DEV=1` activates diagnostic features:
847
- * **Payload Extensions**: Adds `execution_ms` (precise latency breakdown) and `toolcalls` traces to MCP tool outputs.
848
- * **Visual Overlays**: Renders real-time HUD execution badges, target hitboxes, and Bézier cursor trajectory curves in the browser.
849
- * **Audit Mission Logs**: Automatically generates structured CDP event logs in `~/.weavetab/logs/` for every completed mission.
850
-
851
- > 📖 See [docs/DEV_MODE.md](docs/DEV_MODE.md) for complete details.
852
-
853
- ---
854
-
855
- ## Plugin System
856
-
857
- > [!NOTE]
858
- > **PLUGIN ENGINE (v2.5.0-beta.2)**
859
- >
860
- > The Weavetab Plugin System and SDK are in **v2.5.0-beta.2**.
861
- > Use the official **[`@weavetab/sdk`](https://www.npmjs.com/package/@weavetab/sdk)** to build, scaffold, and publish plugins.
862
-
863
- Weavetab supports dynamic tool extension via the **Plugin System**. Any npm package containing a valid `weavetab.json` manifest found in `node_modules` (or official `@weavetab/plugin-*` packages) is automatically discovered and loaded into the MCP server.
864
-
865
- ### Key Capabilities in v2.5.0-beta.2:
866
- 1. **Isolated Configuration Sandbox**: Each plugin maintains its own settings in `~/.weavetab/plugins/<name>/config.json` without modifying core Weavetab config.
867
- 2. **Sandboxed Key-Value & File Storage**: Secure storage inside `~/.weavetab/plugins/<name>/` via `ctx.storage` with path traversal protection.
868
- 3. **Real-time Extension & HUD Visuals**: Floating thought bubbles (`ctx.extension.showThought`), status badges (`setHudState`), and custom CSS injection (`injectStyles`).
869
- 4. **Tool Overrides & Wrapping**: Wrap or modify built-in MCP tools (e.g. `browser_eval`, `browser_click`) via `ctx.mcp.overrideTool`.
870
- 5. **Lifecycle Hooks**: Intercept actions before and after tool calls with `ctx.hooks.beforeToolCall` and `ctx.hooks.afterToolCall`.
255
+ ## Extensibility
871
256
 
872
- > 📖 See [Developer Plugin Guide](docs/dev_plugin.md) for a step-by-step tutorial, and [docs/PLUGINS.md](docs/PLUGINS.md) for the complete architecture and manifest specification.
873
-
874
- ### Quick Scaffold & Build
875
-
876
- ```bash
877
- # 1. Scaffold a new plugin
878
- npx @weavetab/sdk init my-custom-plugin
879
- cd my-custom-plugin
880
- npm install
881
-
882
- # 2. Build and compile
883
- npm run build
884
- ```
885
-
886
- ### Installing a Plugin
257
+ Weavetab exposes a typed Plugin SDK for authoring custom MCP tools, HUD overlays, and tool lifecycle hooks:
887
258
 
888
259
  ```bash
889
- # Official plugin
890
- weavetab plugin add @weavetab/plugin-youtube
891
-
892
- # Community plugin (any npm package name)
893
- weavetab plugin add seo-auditor
894
- ```
895
-
896
- Restart `weavetab` — the plugin's tools are automatically registered into the MCP runtime.
897
-
898
- ### Authoring a Plugin
899
-
900
- ```typescript
901
- // src/index.ts
902
- import { definePlugin, type PluginContext } from "@weavetab/sdk";
903
-
904
- export default definePlugin({
905
- name: "weavetab-plugin-sample",
906
-
907
- defaultConfig: {
908
- showVisualHud: true,
909
- },
910
-
911
- async onLoad(ctx: PluginContext) {
912
- ctx.mcp.registerTool({
913
- name: "my_custom_tool",
914
- description: "Custom tool registered into Weavetab runtime",
915
- schema: {
916
- type: "object",
917
- properties: {
918
- param: { type: "string", description: "Input parameter" }
919
- }
920
- },
921
- handler: async (args: { param?: string }, session: any) => {
922
- // Show thought bubble on active tab
923
- if (ctx.config.showVisualHud && session) {
924
- await ctx.extension.showThought(session, `✨ Running tool with ${args.param || "default"}`);
925
- }
926
-
927
- return {
928
- content: [
929
- { type: "text", text: `Executed with: ${args.param || "default"}` }
930
- ]
931
- };
932
- }
933
- });
934
- }
935
- });
260
+ npx @weavetab/sdk init my-plugin
936
261
  ```
937
262
 
938
- Plugin tools follow the standard MCP contract: structured Zod input, deterministic JSON output, audit logging, and `WeaveError` protocol on failure.
263
+ See [`docs/PLUGINS.md`](docs/PLUGINS.md) for architecture, manifest spec, and SDK API reference.
939
264
 
940
265
  ---
941
266
 
942
- ## Weavetab Skills Ecosystem
267
+ ## License
943
268
 
944
- The **Weavetab Skills** package (`@weavetab/skills`) is an optional companion that provides pre-built workflow patterns and mission templates for AI agents. Skills are automatically discovered by compatible MCP clients and inject context-aware guidance for mission planning.
945
-
946
- > 🔗 **Repository:** [github.com/weavetab/skills](https://github.com/weavetab/skills)
947
-
948
- ### Installation
949
-
950
- ```bash
951
- npm install -g @weavetab/skills
952
- ```
953
-
954
- ### Available Skills
955
-
956
- | Skill | Description |
957
- |-------|-------------|
958
- | **Multi-step Form Automation** | Complex form filling with validation handling and error recovery |
959
- | **E-commerce Checkout** | Shopping cart navigation and payment processing workflows |
960
- | **Data Extraction Pipelines** | Structured data scraping, transformation, and export |
961
- | **Content Management Systems** | WordPress, Drupal, and CMS-specific interaction patterns |
962
- | **API Testing & Validation** | Endpoint testing, response verification, and contract checking |
963
-
964
- Skills are loaded as an MCP resource layer and provide declarative mission templates that agents can reference during task planning.
965
-
966
- ---
967
-
968
- ## Security Model
969
-
970
- Weavetab implements a defense-in-depth security architecture designed for production deployments.
971
-
972
- ### Security Mechanisms
973
-
974
- | Mechanism | Description |
975
- |-----------|-------------|
976
- | **Domain Blacklist** | Hard-blocked high-risk domains (banking portals, IAM providers, cloud consoles) |
977
- | **Domain Policy Engine** | Per-domain modes: `allow`, `read-only`, `deny`, `audit` — via `~/.weavetab/policy.json` |
978
- | **Localhost Binding** | CDP WebSocket strictly bound to `127.0.0.1` — no external exposure |
979
- | **Zero Cloud Dependency** | Executes entirely on local machine (no telemetry unless opted in) |
980
- | **Rate Limiting** | Configurable actions-per-minute with mutex-based enforcement |
981
- | **Role-Based Access Control** | 4 roles: `admin`, `operator`, `viewer`, `automation` |
982
- | **Root Guard** | Prevents execution as root/superuser at startup (Unix) |
983
- | **Blind Injection** | Credentials from `secrets.json` — never exposed to LLM or audit logs |
984
- | **Input Filter** | Strips prompt injection patterns, invisible Unicode, oversized labels |
985
- | **Shadow DOM Isolation** | All injected UIs run in isolated Shadow DOM context |
986
- | **Storage Blocker** | Optional nullification of `localStorage`, `sessionStorage`, `document.cookie` |
987
- | **Atomic Config Writes** | Config files written to temp then atomically renamed |
988
- | **Path Traversal Protection** | `downloadDir` and `profileDir` validated to reject `..` traversal |
989
- | **Two-Factor Lock Validation** | Browser lock validated by PID liveness + TCP port connectivity |
990
-
991
- ### RBAC Role Matrix
992
-
993
- | Tool Category | admin | operator | viewer | automation |
994
- |---------------|:-----:|:--------:|:------:|:----------:|
995
- | All mutation tools | ✅ | ✅ | ❌ | ❌ |
996
- | Read-only tools (map, find, scrape, screenshot, inspect, github_*, etc.) | ✅ | ✅ | ✅ | ❌ |
997
- | burst, plan, wait, map | ✅ | ✅ | ❌ | ✅ |
998
- | System tools (logs, detect, performance, reset_loop_counter) | ✅ | ❌ | ❌ | ❌ |
999
-
1000
- ---
1001
-
1002
- ## Feature Comparison
1003
-
1004
- | Metric | **Weavetab** | Playwright MCP | Puppeteer | Selenium |
1005
- |--------|:------------:|:--------------:|:---------:|:--------:|
1006
- | **Architecture** | Direct CDP WebSocket (Layer 0) | CDP + Node.js bridge | CDP (heavy wrapper) | WebDriver protocol |
1007
- | **Mean Latency** | **3–8ms** | 15–40ms | 10–25ms | 50–150ms |
1008
- | **Token Efficiency** | **Semantic Deltas (5–10×) + Pruning** | Full DOM dumps | Full DOM dumps | Full DOM dumps |
1009
- | **Input Simulation** | Ghost Cursor + Human Typing | Instant coordinates | Instant coordinates | Instant coordinates |
1010
- | **Cloud Dependency** | **Zero** (localhost only) | Optional | Optional | Grid required |
1011
- | **Security Model** | Blacklist + RBAC + Rate limit + Blind Injection | None | None | None |
1012
- | **Session Memory** | Persistent per-domain profiles | None | None | None |
1013
- | **MCP Native** | ✅ | ✅ | ❌ | ❌ |
1014
- | **Plugin System** | Dynamic `weavetab.json` & `@weavetab/plugin-*` loading | Yes (custom) | Yes (custom) | Yes (custom) |
1015
- | **Tool Count** | **44+ built-in + plugins** | ~25–35 | N/A | N/A |
1016
- | **Loop Detection** | Strike-based + auto-recovery | None | None | None |
1017
- | **Browser Engine** | Chromium (+ detection for Firefox/WebKit) | Chromium + Firefox + WebKit | Chromium only | All major |
1018
-
1019
- ---
1020
-
1021
- ## Contributing
1022
-
1023
- Weavetab is currently in **Beta** and actively welcomes community contributions.
1024
-
1025
- - 🐛 **Bug Reports:** [GitHub Issues](https://github.com/weavetab/mcp/issues)
1026
- - 💡 **Feature Requests:** [GitHub Issues](https://github.com/weavetab/mcp/issues)
1027
- - 🔧 **Pull Requests:** See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines
1028
- - 🔒 **Security:** See [SECURITY.md](SECURITY.md) — do **not** open public issues for vulnerabilities
1029
-
1030
- ### Quick Contribution Guide
1031
-
1032
- ```bash
1033
- git clone https://github.com/weavetab/mcp.git
1034
- cd mcp
1035
- npm install
1036
- npm run dev # Start dev watcher
1037
- npm test # Run all tests before submitting a PR
1038
- ```
1039
-
1040
- Commit format: `feat:`, `fix:`, `docs:`, `chore:`, `refactor:`, `test:`
1041
-
1042
- ---
1043
-
1044
- ## License & Enterprise Clarification
1045
-
1046
- **AGPL-3.0-only** — See [LICENSE](LICENSE) for full details.
1047
-
1048
- ### MCP Transport Clarification
1049
- Running Weavetab MCP as an independent process and communicating with it over standard Model Context Protocol transports (`stdio` or WebSocket JSON-RPC) does **not** cause AGPL copyleft obligations to extend to your client application, IDE, or host AI models.
1050
-
1051
- ### Commercial Licensing
1052
- For commercial, proprietary, or embedded distribution without AGPL copyleft requirements, dual-licensing options are available. Inquire at `license@weavetab.pages.dev`.
1053
-
1054
- ---
1055
-
1056
- ## Support
1057
-
1058
- | Channel | Purpose |
1059
- |---------|---------|
1060
- | [GitHub Issues](https://github.com/weavetab/mcp/issues) | Bug reports, feature requests |
1061
- | [TROUBLESHOOTING.md](TROUBLESHOOTING.md) | Common issues and fixes |
1062
- | [docs/](docs/) | Full documentation |
1063
- | security@weavetab.pages.dev | Security vulnerabilities (private) |
1064
-
1065
- ---
1066
-
1067
- ## Acknowledgments
1068
-
1069
- Built by **fy2ne** with gratitude to the [Model Context Protocol](https://modelcontextprotocol.io) community and the Chrome DevTools Protocol team for making browser automation at Layer 0 possible.
1070
-
1071
- ---
269
+ AGPL-3.0-only. Client connections over stdio or WebSocket do not extend copyleft obligations to your client application or models.
1072
270
 
1073
- > [!NOTE]
1074
- > **Beta Release Notice:** This is v2.5.0 Beta. APIs and features may evolve as we approach stable release. Report issues on [GitHub](https://github.com/weavetab/mcp/issues).
271
+ [Sponsor development](https://github.com/sponsors/fy2ne) &nbsp;&middot;&nbsp; [Discussions](https://github.com/weavetab/mcp/discussions) &nbsp;&middot;&nbsp; [SUPPORT.md](SUPPORT.md)