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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/AGENTS.md +1 -1
  2. package/ARCHITECTURE.md +6 -6
  3. package/LICENSE +216 -631
  4. package/README.md +153 -1074
  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 +10 -6
  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.d.ts +1 -0
  17. package/dist/cli/plugin.js +81 -18
  18. package/dist/cli/updater.d.ts +1 -1
  19. package/dist/cli/updater.js +27 -7
  20. package/dist/config/loader.d.ts +9 -1
  21. package/dist/config/loader.js +42 -3
  22. package/dist/desktop/discovery.d.ts +44 -0
  23. package/dist/desktop/discovery.js +364 -0
  24. package/dist/index.js +137 -21
  25. package/dist/intelligence/marks.d.ts +36 -0
  26. package/dist/intelligence/marks.js +30 -0
  27. package/dist/intelligence/patternCompiler.d.ts +118 -0
  28. package/dist/intelligence/patternCompiler.js +259 -0
  29. package/dist/intelligence/sessionMemory.d.ts +2 -0
  30. package/dist/intelligence/sessionMemory.js +18 -8
  31. package/dist/overlay/injector.js +2 -2
  32. package/dist/plugin/interface.d.ts +88 -5
  33. package/dist/plugin/loader.d.ts +12 -1
  34. package/dist/plugin/loader.js +280 -70
  35. package/dist/plugin/pipeline.d.ts +75 -0
  36. package/dist/plugin/pipeline.js +183 -0
  37. package/dist/plugin/registry.d.ts +2 -1
  38. package/dist/plugin/registry.js +24 -14
  39. package/dist/security/secrets.d.ts +7 -0
  40. package/dist/security/secrets.js +37 -0
  41. package/dist/sensors/actionability.js +1 -2
  42. package/dist/sensors/guard.js +4 -10
  43. package/dist/sensors/mutations.js +12 -0
  44. package/dist/sensors/operation_monitor.js +1 -0
  45. package/dist/server.d.ts +1 -1
  46. package/dist/server.js +453 -178
  47. package/dist/state/agent.d.ts +1 -0
  48. package/dist/state/agent.js +3 -0
  49. package/dist/state/delta.d.ts +12 -4
  50. package/dist/state/delta.js +67 -14
  51. package/dist/state/session.d.ts +6 -0
  52. package/dist/state/session.js +27 -0
  53. package/dist/tools/browser_detect.d.ts +16 -3
  54. package/dist/tools/browser_detect.js +52 -7
  55. package/dist/tools/burst.d.ts +17 -8
  56. package/dist/tools/burst.js +236 -77
  57. package/dist/tools/captcha.js +1 -1
  58. package/dist/tools/checkpoint.d.ts +38 -0
  59. package/dist/tools/checkpoint.js +271 -0
  60. package/dist/tools/click.d.ts +1 -0
  61. package/dist/tools/click.js +74 -70
  62. package/dist/tools/design_extract.js +1 -1
  63. package/dist/tools/eval.js +1 -1
  64. package/dist/tools/fill.d.ts +20 -1
  65. package/dist/tools/fill.js +199 -40
  66. package/dist/tools/find.d.ts +16 -0
  67. package/dist/tools/find.js +67 -44
  68. package/dist/tools/github/index.d.ts +19 -4
  69. package/dist/tools/github/index.js +40 -4
  70. package/dist/tools/highlight.d.ts +6 -2
  71. package/dist/tools/highlight.js +158 -72
  72. package/dist/tools/inspect.js +1 -1
  73. package/dist/tools/key.js +65 -56
  74. package/dist/tools/navigate.d.ts +1 -1
  75. package/dist/tools/navigate.js +34 -39
  76. package/dist/tools/pdf.js +21 -13
  77. package/dist/tools/pointer.d.ts +18 -3
  78. package/dist/tools/pointer.js +89 -1
  79. package/dist/tools/read.d.ts +28 -8
  80. package/dist/tools/read.js +230 -56
  81. package/dist/tools/scrape.js +67 -13
  82. package/dist/tools/screenshot.js +21 -16
  83. package/dist/tools/scroll.js +6 -11
  84. package/dist/tools/select.js +8 -2
  85. package/dist/tools/snapshot.js +3 -34
  86. package/dist/tools/tabs.js +15 -7
  87. package/dist/tools/thought.d.ts +2 -0
  88. package/dist/tools/thought.js +13 -14
  89. package/dist/tools/type.d.ts +2 -0
  90. package/dist/tools/type.js +107 -58
  91. package/dist/tools/type_secret.js +42 -76
  92. package/dist/tools/upload.js +1 -1
  93. package/dist/tools/video_compiler.d.ts +1 -1
  94. package/dist/tools/video_compiler.js +11 -12
  95. package/dist/version.d.ts +5 -0
  96. package/dist/version.js +5 -0
  97. package/docs/DOCUMENTATION.md +37 -41
  98. package/docs/PLUGINS.md +121 -0
  99. package/docs/TOOLS.md +54 -0
  100. package/docs/architecture/blind-injection.md +83 -20
  101. package/docs/architecture/overview.md +49 -49
  102. package/docs/architecture/security.md +8 -7
  103. package/docs/architecture/transport.md +2 -2
  104. package/docs/cli/cli-commands.md +7 -1
  105. package/docs/cli/cli-flags.md +15 -7
  106. package/docs/cli/cli-scripting.md +6 -3
  107. package/docs/configuration/config-locations.md +3 -4
  108. package/docs/configuration/env-variables.md +4 -4
  109. package/docs/configuration/folders.md +55 -54
  110. package/docs/desktop-automation/electron-apps.md +214 -162
  111. package/docs/get-started/introduction.md +60 -60
  112. package/docs/get-started/setup-wizard.md +7 -6
  113. package/docs/intelligence/site-profiles.md +151 -0
  114. package/docs/tools/tools.md +631 -293
  115. package/docs/troubleshooting/trouble-browser.md +1 -1
  116. package/docs/troubleshooting/trouble-loop.md +31 -31
  117. package/ext-dist/background.js +10 -62
  118. package/ext-dist/content.js +333 -920
  119. package/ext-dist/hud/hud.js +9 -9
  120. package/ext-dist/manifest.json +2 -6
  121. package/ext-dist/styles.css +6 -1
  122. package/icon.png +0 -0
  123. package/mcp.json +87 -71
  124. package/package.json +118 -119
  125. package/server.json +5 -5
  126. package/ext-dist/sidepanel/sidepanel.js +0 -25
  127. package/ext-dist/sidepanel.html +0 -547
@@ -10,7 +10,7 @@ Weavetab is a production-grade, in-process MCP (Model Context Protocol) server p
10
10
 
11
11
  ### Core Capabilities
12
12
 
13
- - **45 Built-in MCP Tools** across 15 functional categories (Vision, Navigation, Input, Tabs, Mission Execution, Dialog, Wait, Storage, Device, Network, Canvas, Output, Evaluation, GitHub, Office Documents)
13
+ - **44 Built-in MCP Tools** across functional categories (Vision, Navigation, Input, Tabs, Mission Execution, Dialog, Wait, Storage, Device, Network, Canvas, Output, Evaluation, GitHub, Office Documents)
14
14
  - **Direct CDP WebSocket** — 3-8ms mean latency, zero process overhead
15
15
  - **Semantic Delta Engine** — 5-10x token reduction via per-tab snapshot diffing
16
16
  - **Ghost Cursor** — Bézier curve click engine with human acceleration and jitter
@@ -20,7 +20,7 @@ Weavetab is a production-grade, in-process MCP (Model Context Protocol) server p
20
20
  - **Security Stack** — domain blacklist, RBAC (4 roles), rate limiter, loop detection, input filter, root guard
21
21
  - **Burst Mode** — chain N actions in 1 MCP call via `browser_burst`
22
22
  - **Plugin System** — Extensible plugin ecosystem supporting tool additions, overrides (with originalHandler wrapping), and tool removals across 3 trust tiers (Official, Verified, Unverified)
23
- - **GitHub Integration** — 4 built-in tools for repo analysis, file reading, issues, and PRs
23
+ - **GitHub Integration** — Unified `browser_github` tool for repo analysis, file reading, issues, and PRs
24
24
 
25
25
  ### Weavetab Skills
26
26
 
@@ -61,41 +61,42 @@ MCP Client → stdio/WebSocket → WithSecurity Pipeline → CDP WebSocket → C
61
61
 
62
62
  ---
63
63
 
64
- ## Tool Reference (44+ Tools)
64
+ ## Tool Reference (44 Tools)
65
65
 
66
66
  All tools share: Zod schema validation, `withSecurity()` pipeline (rate limiting + domain policy + RBAC), structured audit logging.
67
67
 
68
- ### Vision & Reading (7 tools)
68
+ ### Vision & Reading (8 tools)
69
69
 
70
70
  | Tool | Description |
71
71
  |------|-------------|
72
- | `browser_map` | DOM enumeration with stable `w:NN` ref IDs. Supports `delta` (diff mode), `prune` (one-shot compression), `ax_tree` (Shadow DOM fallback), `scope` filtering, `query` filtering |
73
- | `browser_find` | Native CDP text search — ~10x cheaper than map, single CDP call |
72
+ | `browser_map` | DOM enumeration (v3.0) with volatile `w:NN` ref IDs, Set-of-Marks visual grounding (`visual: true` / `"auto"`), entity & card container binding (`┌ Heading`), active modal hoisting (`╔═ ACTIVE DIALOG ═╗`), nav cluster collapsing, delta diffing, and scope filtering (`modal`, `form`, `main`). |
73
+ | `browser_find` | Native CDP text search with single and multi-match (`all: true`, `limit: N`) returning bounding rects and selectors — ~10x cheaper than map |
74
74
  | `browser_scrape` | CSS/XPath structured data extraction in 1 CDP call |
75
75
  | `browser_inspect` | Computed CSS styles + inline styles + event listener types |
76
76
  | `browser_snapshot` | MHTML capture/restore of DOM state + resources |
77
77
  | `browser_screenshot` | PNG/JPEG capture via CDP, full-page + clip region, returns base64 data URL (no file pollution) |
78
78
  | `browser_console` | Read/clear buffered console logs and exceptions |
79
+ | `browser_extract_design` | Extract design tokens, typography, colors, and clean CSS with pixel fidelity |
79
80
 
80
81
  ### Navigation (1 tool)
81
82
 
82
83
  | Tool | Description |
83
84
  |------|-------------|
84
- | `browser_navigate` | Navigate to URL with domain blocklist enforcement. Supports `Weavetab://` protocol for persistent local playgrounds |
85
+ | `browser_navigate` | Ultra-low latency navigation (~150-300ms) with non-blocking readyState polling, parallelized metadata, domain blocklist enforcement, and `weavetab://` protocol |
85
86
 
86
87
  ### Input (9 tools)
87
88
 
88
89
  | Tool | Description |
89
90
  |------|-------------|
90
- | `browser_click` | Ghost Cursor (Bézier) click with intent memory, occlusion detection, stuck-loop detection |
91
- | `browser_type` | Human keystroke engine with jitter, burst patterns, paste mode, stuck detection |
91
+ | `browser_click` | Ghost Cursor (Bézier) click with direct visual mark targeting (`mark: N`), intent memory, occlusion detection, and stuck-loop detection |
92
+ | `browser_type` | Human keystroke engine with zero-target `document.activeElement` typing, anti-unfocus click avoidance, jitter, and burst patterns |
92
93
  | `browser_type_secret` | Blind Injection from `secrets.json` — domain check before value load, Shadow DOM isolation, JS property hardening |
93
- | `browser_key` | Native keyboard dispatch with modifier keys (Ctrl, Shift, Alt, Meta) |
94
- | `browser_pointer` | Hover, double-click, drag-and-drop via native mouse events |
94
+ | `browser_key` | Native keyboard dispatch with combo hotkeys (`"Ctrl+A"`, `"Cmd+K"`, `"Alt+Tab"`) and zero arbitrary delay |
95
+ | `browser_pointer` | Hover, double-click, drag-and-drop, and multi-level flyout menu traversal via `hover_chain: ["File", "Export As", "PNG"]` |
95
96
  | `browser_select` | Native `<select>` dropdown selection — React/Vue safe (prototype setter + events) |
96
- | `browser_fill` | Smart multi-field form fill — auto-detects text, select, checkbox, radio, contenteditable |
97
+ | `browser_fill` | Smart multi-field form batch completion with input discovery scanner (`scan: true`), flexible field selectors, and Google Sheets `grid_data` |
97
98
  | `browser_upload` | Bypass file dialogs via CDP `DOM.setFileInputFiles` |
98
- | `browser_scroll` | Directional + element-relative scroll via native wheel events |
99
+ | `browser_scroll` | Fast non-blocking directional + element-relative scroll without redundant action map rebuilds |
99
100
 
100
101
  ### Tabs & Windows (2 tools)
101
102
 
@@ -104,12 +105,11 @@ All tools share: Zod schema validation, `withSecurity()` pipeline (rate limiting
104
105
  | `browser_tabs` | Open/switch/close/list/consolidate (dedup)/heal (recover crash). Also list/focus windows |
105
106
  | `browser_detect` | Detect installed browsers + CDP feature coverage per engine (Chromium, Firefox, WebKit) |
106
107
 
107
- ### Mission Execution (3 tools)
108
+ ### Mission Execution (2 tools)
108
109
 
109
110
  | Tool | Description |
110
111
  |------|-------------|
111
112
  | `browser_burst` | Chain N actions in 1 MCP call. Supports 4 macro steps: `type_and_send`, `navigate_and_read`, `click_and_wait`, `scroll_and_read` |
112
- | `browser_plan` | Live task dashboard in browser Shadow DOM overlay. User sees progress, can comment |
113
113
  | `browser_automation` | Inject persistent self-running scripts — monitoring, polling, background extraction |
114
114
 
115
115
  ### Dialog & User Interaction (3 tools)
@@ -117,15 +117,15 @@ All tools share: Zod schema validation, `withSecurity()` pipeline (rate limiting
117
117
  | Tool | Description |
118
118
  |------|-------------|
119
119
  | `browser_dialog` | Accept/dismiss JavaScript alert/confirm/prompt dialogs |
120
- | `browser_thought` | Green thought bubbles: feedback (one-way) or question with input (sentence/paragraph modes) |
120
+ | `browser_thoughts` | Green thought bubbles: feedback (one-way) or question with input (sentence/paragraph modes) |
121
121
  | `browser_clipboard` | System clipboard R/W (text + images) |
122
122
 
123
123
  ### Wait & Timing (2 tools)
124
124
 
125
125
  | Tool | Description |
126
126
  |------|-------------|
127
- | `browser_wait` | Wait for element/text/URL/stable/network/auto — timeout configurable |
128
- | `browser_reset_loop_counter` | Manual loop detection override |
127
+ | `browser_wait` | Wait for element/text/URL/stable/network/auto — timeout configurable, optional loop counter reset (`reset_loop: true`) |
128
+ | `browser_captcha` | Autonomous zero-API detection and solving for Cloudflare Turnstile, reCAPTCHA v2/v3, GeeTest, and hCaptcha via CDP mouse physics |
129
129
 
130
130
  ### Storage & Cookies (2 tools)
131
131
 
@@ -134,11 +134,12 @@ All tools share: Zod schema validation, `withSecurity()` pipeline (rate limiting
134
134
  | `browser_storage` | localStorage & sessionStorage get/set/clear |
135
135
  | `browser_cookies` | Cookies get/set/delete |
136
136
 
137
- ### Device & Environment (1 tool)
137
+ ### Device & Environment (2 tools)
138
138
 
139
139
  | Tool | Description |
140
140
  |------|-------------|
141
141
  | `browser_viewport` | Viewport, device emulation, geolocation, timezone override |
142
+ | `browser_emulate` | Network throttling (3G/4G/offline), CPU slowdown, geolocation, timezone, and User-Agent override |
142
143
 
143
144
  ### Network (1 tool)
144
145
 
@@ -172,27 +173,21 @@ All tools share: Zod schema validation, `withSecurity()` pipeline (rate limiting
172
173
  |------|-------------|
173
174
  | `browser_performance` | FCP, LCP, TTI metrics, resource timings |
174
175
 
175
- ### Macro (1 tool)
176
+ ### GitHub (1 tool)
176
177
 
177
178
  | Tool | Description |
178
179
  |------|-------------|
179
- | `browser_macro_compile` | Compile successful trails into burst macros |
180
+ | `browser_github` | Action-based repo metadata analysis, raw source file reading, issue triage, and PR inspection |
180
181
 
181
- ### GitHub (4 tools)
182
+ ### Utility (5 tools)
182
183
 
183
184
  | Tool | Description |
184
185
  |------|-------------|
185
- | `github_analyze` | Repo metadata, file tree, README snippet |
186
- | `github_read` | Read file contents via raw.githubusercontent.com (no API limit cost) |
187
- | `github_issues` | List/search/fetch issues with comments |
188
- | `github_get_pr` | PR details + changed files + comments |
189
-
190
- ### Utility (2 tools)
191
-
192
- | Tool | Description |
193
- |------|-------------|
194
- | `browser_thoughts` | Ask user a question or show a green sticky feedback |
195
- | Plugins | Dynamic loading from any npm package with `weavetab.json` (or `@weavetab/plugin-*`) |
186
+ | `list_plugins` | Inspect installed SDK plugins, loaded tool overrides, and capability manifests |
187
+ | `load_plugin` | Dynamically load a Weavetab plugin by npm package name with isolated sandboxing |
188
+ | `browser_checkpoint` | Snapshot and restore browser state (cookies, storage, scroll/URL) into named checkpoints for time-travel and rollback |
189
+ | `browser_pattern_learn` | Read, register, and update named workflow patterns and site quirks per origin |
190
+ | `browser_office` | Parse Word (`.docx`), Excel (`.xlsx`), PDF, and CSV files into structured data |
196
191
 
197
192
  ---
198
193
 
@@ -266,7 +261,7 @@ The value is permanently masked as `[REDACTED]` in all subsequent DOM reads and
266
261
  "browserFlags": [],
267
262
  "policies": [],
268
263
  "electron": {
269
- "discord": "C:\\Users\\<user>\\AppData\\Local\\Discord\\app-1.0.9183\\Discord.exe",
264
+ "discord": "C:\\Users\\<user>\\AppData\\Local\\Discord\\app-<version>\\Discord.exe",
270
265
  "antigravity": "C:\\Users\\<user>\\AppData\\Local\\Programs\\antigravity\\Antigravity.exe",
271
266
  "vscode": "C:\\Users\\<user>\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
272
267
  }
@@ -352,10 +347,11 @@ Configure policies directly in your config file (or via `~/.Weavetab/policy.json
352
347
 
353
348
  | Role | Permissions |
354
349
  |------|-------------|
355
- | `admin` | Full access to all tools and system operations |
356
- | `operator` | Full tool access except system operations (logs, detect, performance) |
357
- | `viewer` | Read-only access to observation tools only |
358
- | `automation` | Restricted to burst/plan/wait/map for automated workflows |
350
+ | `admin` | Full access to all tools |
351
+ | `operator` | Full access to all tools (standard agent role) |
352
+ | `viewer` | Read-only observation tools only (`browser_map`, `browser_find`, `browser_scrape`, `browser_console`, `browser_eval`, `browser_inspect`, `browser_extract_design`, `browser_snapshot`, `browser_screenshot`, `browser_pdf`, `browser_cookies`, `browser_tabs`, `browser_wait`, `browser_pattern_learn`, `browser_github`) |
353
+ | `automation` | Full access except `browser_thoughts` (non-interactive CI/CD mode) |
354
+ | `system` | Internal tools only (`browser_thoughts`, `browser_detect`, `browser_performance`, `browser_checkpoint`, `browser_pattern_learn`) |
359
355
 
360
356
  ### Setting Role
361
357
 
@@ -500,7 +496,7 @@ Skills are automatically discovered by MCP clients and provide:
500
496
  Weavetab natively supports **generic automation of any Electron or Chromium-based desktop application** (e.g. Discord, Slack, VS Code, Antigravity IDE, Figma, Obsidian, Postman, or local developer applications running from source).
501
497
 
502
498
  ### Why It Works at Layer 0
503
- Electron desktop applications run a bundled Chromium/Blink engine under the hood. When started with Chrome DevTools Protocol debugging enabled (either automatically via Weavetab or via `--remote-debugging-port`), Weavetab connects directly to the desktop app's internal WebSockets and exposes all 45+ MCP tools without requiring external drivers or wrappers.
499
+ Electron desktop applications run a bundled Chromium/Blink engine under the hood. When started with Chrome DevTools Protocol debugging enabled (either automatically via Weavetab or via `--remote-debugging-port`), Weavetab connects directly to the desktop app's internal WebSockets and exposes all 50 MCP tools without requiring external drivers or wrappers.
504
500
 
505
501
  ### Registering Applications
506
502
  In `~/.weavetab/config.json` or project-scoped `.weavetab/config.json`:
@@ -580,10 +576,10 @@ For detailed troubleshooting, see [TROUBLESHOOTING.md](../TROUBLESHOOTING.md).
580
576
 
581
577
  ## Additional Resources
582
578
 
579
+ - [Tool Reference](tools/tools.md)
583
580
  - [Plugin System Guide](PLUGINS.md)
584
581
  - [Architecture Documentation](../ARCHITECTURE.md)
585
- - [Tool Reference](TOOLS.md)
582
+ - [Support & Community](../SUPPORT.md)
586
583
  - [Security Policy](../SECURITY.md)
587
584
  - [Contributing Guidelines](../CONTRIBUTING.md)
588
585
  - [Troubleshooting Guide](../TROUBLESHOOTING.md)
589
- - [Comparison with Other Tools](../.upgrade/compare.md)
@@ -0,0 +1,121 @@
1
+ # Weavetab Plugin System & SDK Specification
2
+
3
+ > **Version:** 2.5.0-beta.5 | **SDK:** @weavetab/sdk (MIT) | **Runtime:** AGPL-3.0-only
4
+
5
+ The **Weavetab Plugin System** allows developers to extend the MCP runtime with custom tools, visual HUD overlays, thought bubbles, lifecycle hooks, and tool overrides.
6
+
7
+ ---
8
+
9
+ ## 1. Quick Start
10
+
11
+ ### Scaffold a New Plugin
12
+ ````bash
13
+ npx @weavetab/sdk init my-custom-plugin
14
+ cd my-custom-plugin
15
+ npm install
16
+ `
17
+
18
+ ### Build & Compile
19
+ ````bash
20
+ npm run build
21
+ `
22
+
23
+ ---
24
+
25
+ ## 2. Plugin Architecture
26
+
27
+ Every Weavetab plugin exports a plugin definition created with definePlugin:
28
+
29
+ ` ypescript
30
+ // src/index.ts
31
+ import { definePlugin, type PluginContext } from @weavetab/sdk;
32
+
33
+ export default definePlugin({
34
+ name: weavetab-plugin-sample,
35
+ version: 1.0.0,
36
+ description: Sample custom tool plugin for Weavetab,
37
+
38
+ defaultConfig: {
39
+ enableHud: true,
40
+ },
41
+
42
+ async onLoad(ctx: PluginContext) {
43
+ // Register a custom MCP tool
44
+ ctx.mcp.registerTool({
45
+ name: custom_analyzer,
46
+ description: Performs custom DOM analysis,
47
+ schema: {
48
+ type: object,
49
+ properties: {
50
+ selector: { type: string, description: Target CSS selector }
51
+ },
52
+ required: [selector]
53
+ },
54
+ handler: async (args: { selector: string }, session: any) => {
55
+ // Show thought bubble on browser tab
56
+ if (ctx.config.enableHud && session) {
57
+ await ctx.extension.showThought(session, Analyzing ...);
58
+ }
59
+
60
+ return {
61
+ content: [
62
+ { type: text, text: Analysis complete for }
63
+ ]
64
+ };
65
+ }
66
+ });
67
+ },
68
+
69
+ async onUnload(ctx: PluginContext) {
70
+ // Cleanup resources
71
+ }
72
+ });
73
+ `
74
+
75
+ ---
76
+
77
+ ## 3. Manifest Specification (weavetab.json)
78
+
79
+ Plugins require a weavetab.json manifest in their package root:
80
+
81
+ `json
82
+ {
83
+ name: weavetab-plugin-sample,
84
+ version: 1.0.0,
85
+ entry: ./dist/index.js,
86
+ permissions: [storage, extension, cdp],
87
+ tools: [custom_analyzer]
88
+ }
89
+ `
90
+
91
+ ---
92
+
93
+ ## 4. Plugin Capabilities
94
+
95
+ | Capability | API | Description |
96
+ | :--- | :--- | :--- |
97
+ | **Sandboxed Storage** | ctx.storage.get(), ctx.storage.set() | Isolated key-value storage in ~/.weavetab/plugins/<name>/. |
98
+ | **Thought Bubbles** | ctx.extension.showThought(session, text) | Floating green thoughts on the live browser tab. |
99
+ | **HUD Badges** | ctx.extension.setHudState(session, state) | Real-time status in the Weavetab overlay. |
100
+ | **Tool Overrides** | ctx.mcp.overrideTool(name, wrapperFn) | Wrap or intercept built-in MCP tools with custom pre/post logic. |
101
+ | **Lifecycle Hooks** | ctx.hooks.beforeToolCall, ctx.hooks.afterToolCall | Global auditing and security filters. |
102
+
103
+ ---
104
+
105
+ ## 5. Installing Plugins
106
+
107
+ ```bash
108
+ # Install an official plugin
109
+ weavetab plugin add @weavetab/plugin-youtube
110
+
111
+ # Install community plugins (any npm package)
112
+ weavetab plugin add my-custom-plugin
113
+
114
+ # List installed plugins
115
+ weavetab plugin list
116
+
117
+ # Remove a plugin
118
+ weavetab plugin rm my-custom-plugin
119
+ `
120
+
121
+ Restart weavetab to load the newly installed plugin tools into the MCP server.
package/docs/TOOLS.md ADDED
@@ -0,0 +1,54 @@
1
+ # Weavetab MCP Tool Reference
2
+
3
+ > **Version:** 2.5.0-beta.5 | **Total Tools:** 42 | **Architecture:** Layer 0 Direct CDP
4
+
5
+ Weavetab provides 42 production-grade MCP tools organized into functional categories.
6
+
7
+ | Tool Name | Category | Description | Key Features |
8
+ | :--- | :--- | :--- | :--- |
9
+ | `browser_map` | `vision` | Snapshot interactive DOM with stable ref IDs (w:NN). For complex SPAs, use scope or query to constrain tokens. Supports delta temporal diffing (up to 97% token reduction), semantic pruning (dropping hidden elements), Set-of-Marks visual grounding (visual: true / "auto" for canvas/WebGL pages), AX tree fallback (Shadow DOM traversal), scope filtering, query filtering, and forced rebuilds with automatic loop strike reset (force: true). | Semantic DOM pruning (up to 97% token reduction with delta), Set-of-Marks visual grounding (visual: true / "auto"), Per-tab snapshot temporal diffing (delta mode) |
10
+ | `browser_navigate` | `navigation` | Navigate to a URL. Enforces domain security policies and rate limits prior to navigation. Waits for network idle and DOM readiness. Supports internal protocol schemes (e.g. weavetab://). | Domain policy engine and blocklist enforcement, Deterministic DOM stability and network idle waiting, weavetab:// internal protocol support |
11
+ | `browser_click` | `input` | Click a DOM element. Physical click engine incorporating Bézier curve trajectory kinematics (Ghost Cursor). Multi-stage targeting fallback: mark number (SoM visual grounding) -> ref ID -> selector -> label -> intent -> coordinates -> backendNodeId. | Direct mark number targeting (mark: N) from visual mode, Bézier curve trajectory kinematics, Humanized acceleration and velocity curves |
12
+ | `browser_type` | `input` | Type text into a single input field. Keystroke dispatch engine with per-character temporal jitter and burst profiling. Real-time DOM-diffing monitors stuck input state. Supports atomic clearFirst and clipboard paste modes. | Per-character temporal jitter simulation, Burst keystroke profiling, Stuck-typing loop detection via DOM diffing |
13
+ | `browser_type_secret` | `input` | Inject a secret from an environment variable / secrets.json. Blind Injection: securely injects credentials without exposing sensitive values to the LLM context. Permanently masked as [REDACTED] in DOM maps and logs. | Zero LLM context exposure for credentials, Domain-scoped authorization checks, Shadow DOM input isolation |
14
+ | `browser_key` | `input` | Press a keyboard key. Dispatches native hardware key events with modifier key support (Ctrl, Shift, Alt, Meta) to focused elements. | Native key code and key identifier mapping, Modifier key combination handling, Per-tab keyboard focus targeting |
15
+ | `browser_scroll` | `input` | Scroll the page or targeted element. Smooth scrolling engine via CDP Input.dispatchMouseEvent wheel events. Supports directional delta scrolling and element-relative scroll centering. | Directional scrolling (up, down, left, right), Configurable pixel scroll distance, Element-relative scroll targeting via ref ID or label |
16
+ | `browser_dialog` | `dialog_and_interaction` | Accept or dismiss JS dialogs (alert, confirm, prompt) via CDP Page.handleJavaScriptDialog. | Handling of alert, confirm, and prompt modal types, Accept and dismiss actions, Prompt response text payload submission |
17
+ | `browser_burst` | `mission_execution` | HIGH-SPEED MULTI-ACTION PIPELINE: Executes 2 or more sequential browser actions in a single round-trip without waiting for LLM turns between steps. PREFER THIS over individual single-action calls to slash latency and token burn. Supports native primitives (browser_click, browser_fill, browser_type, browser_type_secret, browser_navigate, browser_key, browser_scroll, browser_wait, browser_map) plus compound macros (type_and_send, click_and_wait, navigate_and_read, scroll_and_read, fill_form). If compile_from_history: true is passed, automatically compiles and executes recent successful session trail actions into a burst macro. | Single-request multi-action pipeline execution with zero intermediate LLM round-trips, Compound macro abstractions (type_and_send, click_and_wait, navigate_and_read, scroll_and_read, fill_form, drag_and_drop, hover_and_read), Automatic session history compilation into replayable burst macros (compile_from_history: true) |
18
+ | `browser_tabs` | `tabs` | Manage browser and Electron app tabs/windows (open, switch, close, list). Specify 'app' when targeting desktop apps (e.g. app: 'discord') to avoid opening web browser. | Single and batch tab operations, Duplicate tab consolidation, Crash session recovery (heal) |
19
+ | `browser_wait` | `navigation` | Pause until a condition is met ('element', 'text', 'url', 'stable', 'network', 'auto'). Deterministic wait engine for asynchronous web state synchronization. | Element, text, URL, DOM stability, and network idle conditions, Configurable timeout thresholds, Per-tab asynchronous execution target |
20
+ | `browser_captcha` | `safety` | Autonomous zero-API detection and solving of Turnstile, reCAPTCHA, GeeTest, and hCaptcha bot challenges using local CDP behavioral solvers. | Zero-API autonomous solving, Cloudflare Turnstile, reCAPTCHA v2/v3, GeeTest, and hCaptcha support, Human oversight fallback via wait_for_user |
21
+ | `browser_thoughts` | `dialog_and_interaction` | Agent-to-user communication layer rendered in the middle down of the page. Supports question mode (interactive prompt with answer submission) and feedback mode (status, observation, decision, or warning update). Supports contextual element anchoring (anchor: 'w:NN') and visual styles ('observation', 'decision', 'warning', 'question'). | Middle-down floating card HUD with precision dark styling, Contextual element anchoring (anchor: 'w:NN') with auto-highlighting, Feedback mode (observation, decision, warning updates) |
22
+ | `browser_pointer` | `input` | Advanced pointer control (hover, click, double_click, drag_and_drop) with Bézier curve kinematics. Supports waitForChild pattern for dynamic flyout menus. | Hover, click, double_click, and drag_and_drop actions, Bézier curve cursor motion, waitForChild trigger menu resolution |
23
+ | `browser_select` | `input` | Select an option from a native dropdown by visible text or value. Uses native property setters and dispatches input/change events for framework compatibility (React, Vue, Angular). | Option matching by visible text or value, Framework-safe prototype property setter invocation, Synthetic input and change event dispatch |
24
+ | `browser_fill` | `input` | Smart multi-field form-filling. Evaluates field control types (text, select, checkbox, radio, contenteditable) and processes inputs sequentially with atomic verification. | Multi-field batch input execution, Automatic control type classification, Per-field post-input verification |
25
+ | `browser_highlight` | `canvas_and_visual` | Highlight elements on page. Renders temporary visual overlays over target elements without DOM tree mutations. Supports multi-element consideration overlays (refs: ['w:12', 'w:15']), presentation styles ('consideration', 'target', 'danger', 'success', 'shimmer'), floating badges, and configurable durations. | Multi-candidate consideration overlay (refs array), Five visual styles: consideration, target lock, danger, success, shimmer, Floating label badge display above highlighted elements |
26
+ | `browser_upload` | `input` | Upload files to a file input. Bypasses OS native file pickers via CDP DOM.setFileInputFiles directly targeting file input node IDs using absolute file paths. | Direct CDP file payload injection, Multi-file payload support, Zero OS file picker interaction required |
27
+ | `browser_find` | `vision` | Sub-5ms CDP text search. Zero token waste. Best for locating specific keywords/text on page without a full DOM walk. | Native CDP search (zero DOM walk overhead), Sub-5ms execution latency, Exact keyword matching and match indexing |
28
+ | `browser_storage` | `storage_and_cookies` | Manage localStorage and sessionStorage. Reads, writes, and clears key-value pairs for the active origin. | localStorage and sessionStorage scope targeting, Atomic key-value retrieval and mutation, Origin storage purging |
29
+ | `browser_checkpoint` | `storage_and_cookies` | Snapshot and restore browser state (cookies, localStorage, sessionStorage, and scroll/URL) into named checkpoints to time-travel and rollback failed automation branches. | Session state time-travel and rollback, Cookies backup and restoration (HttpOnly and Secure via CDP), LocalStorage and SessionStorage snapshotting |
30
+ | `browser_network_intercept` | `network` | Intercept/stub network responses (mock APIs, block tracking) and capture raw protocol network telemetry (TLS/SSL certificate metadata, microsecond timing breakdown, and OS-level network failure reasons). | URL glob pattern matching and response mocking, TLS/SSL Certificate security metadata (issuer, protocol, validity, cipher), Microsecond Network Timing breakdown (DNS, TCP, SSL, send, TTFB, download) |
31
+ | `browser_console` | `vision` | 1-5ms latency access to buffered browser console messages, JS exceptions, and network errors tracked via CDP Runtime.consoleAPICalled. | Buffered console output stream retrieval, Buffer clearance actions, Runtime exception stack capture |
32
+ | `browser_pdf` | `output` | Print the current page to a PDF file via CDP Page.printToPDF with configurable orientation, scale, and page ranges. | Landscape and portrait orientation options, Print scale factor adjustment, Page range subset printing |
33
+ | `browser_eval` | `evaluation` | Run arbitrary JS via CDP in page context via CDP Runtime.evaluate. Supports asynchronous evaluation and structured JSON serialization. | Page JS context execution, Async/await promise resolution, Structured JSON return serialization |
34
+ | `browser_cookies` | `storage_and_cookies` | Manage browser cookies. Full CRUD management for HTTP and document cookies via CDP Network domain. | Cookie property retrieval, setting, and deletion, Domain and path attribute scoping |
35
+ | `browser_canvas` | `canvas_and_visual` | For ALL canvas content (charts, games, graphs). Use get_image to read pixel data as Base64 PNG, draw to simulate programmatic coordinate gesture paths. | Base64 PNG pixel buffer export, Programmatic gesture path drawing, Canvas node targeting via ref ID or selector |
36
+ | `browser_scrape` | `vision` | Sub-5ms latency, zero waste extraction via CSS or XPath selectors in a single CDP evaluation step. Returns structured text/attribute arrays. | CSS and XPath query evaluation, Targeted attribute extraction, Single-step execution (high throughput) |
37
+ | `browser_snapshot` | `vision` | Capture or restore an MHTML snapshot (DOM + inline assets). Facilitates offline state serialization, replay verification, and compliance auditing. | Full DOM and asset stream serialization, Atomic capture and restore operations, Offline state audit capability |
38
+ | `browser_screenshot` | `vision` | 95-135ms capture latency via CDP Page.captureScreenshot. Supports PNG and JPEG formats, full-page rendering, and clip region bounding boxes. | Full-page and viewport bounding box capture, PNG and JPEG format encoding, Custom clip region bounding box support |
39
+ | `browser_viewport` | `device_and_environment` | Set viewport dimensions and device emulation (width, height, DPR, mobile, geolocation, timezone, locale, color scheme). | Viewport width, height, and DPR emulation, Mobile viewport and touch event emulation, Geolocation coordinate override |
40
+ | `browser_clipboard` | `dialog_and_interaction` | Read or write to the system clipboard (plaintext or Base64 image payload data). | Read and write data operations, Plaintext and Base64 image payload format support |
41
+ | `browser_inspect` | `vision` | 15-35ms latency, zero waste. Deep DOM inspection returning computed styles, inline styles, box model dimensions, and attached event listener types. | Computed CSS style property inspection, Event listener type registration enumeration, Box model geometry verification |
42
+ | `browser_extract_design` | `vision` | Extract design tokens (colors, typography, spacing, shadows, CSS variables), semantic HTML layouts, and clean CSS into structured files and an LLM design blueprint. Ideal for cloning websites, UI components, and design systems with 100% pixel fidelity. | CSS custom properties and design token harvesting, Palette extraction and typography hierarchy mapping, Semantic clean DOM extraction with inline SVGs preserved |
43
+ | `browser_automation` | `mission_execution` | Inject self-running background script for monitoring/polling. Inject persistent scripts into the page context for continuous event tracking. | Background script context injection, Named automation script management, Decoupled event monitoring lifecycle |
44
+ | `browser_recording` | `output` | Record video screencasts of browser sessions. Automatically compiles captured frames into animated video files (.webp, .gif, .webm, .mp4) using native Node processing or system ffmpeg. | Native WebP/GIF animation compilation in pure Node, Configurable FPS and frame limits, FFmpeg fallback for WebM/MP4 encoding |
45
+ | `browser_detect` | `tabs` | CRITICAL INITIALIZATION TOOL. Detect available browsers and configured desktop apps (Discord, Slack, etc.). Call this FIRST before interacting with the environment to know if apps are online/offline and what tabs they have open. | Local browser engine discovery, Engine CDP API coverage analysis, Tool compatibility reporting per browser engine |
46
+ | `browser_performance` | `performance` | Retrieve page performance metrics. Collects Core Web Vitals (FCP, LCP, CLS) and detailed network resource timing distributions. | First Contentful Paint (FCP) and Largest Contentful Paint (LCP) capture, Cumulative Layout Shift (CLS) tracking, Resource loading timing distributions |
47
+ | `browser_pattern_learn` | `memory` | Read (action=get), register (action=learn), update, or record execution outcome for a named workflow pattern on a given origin in ~/.weavetab-system/memory/sites/. Use action=get at session start to inspect site profiles and reliability scores. Use learn after completing a flow to persist it for future fast-path replay. | Site profile inspection via action=get (reads ~/.weavetab-system/memory/sites/), Named pattern creation and update (merge-on-write, no duplicates), Volatile selector stabilization before persistence |
48
+ | `browser_github` | `github` | Interact with GitHub repositories without burning browser turns. Analyze repo trees, read raw source files, search/inspect issues, and examine PR diffs and review comments. | Action-based repo analysis, file reading, issues, and PR review, Zero GitHub API token requirement for raw reads, Automated active tab repository context resolution |
49
+ | `browser_office` | `documents` | Read and extract structured content from office documents (Excel, Word, PDF, CSV) via live browser session cookies or local downloads directory. | In-session authenticated document fetching, Structured tabular extraction (.xlsx, .csv), Document text and metadata extraction (.docx, .pdf) |
50
+ | `browser_emulate` | `environment` | Emulate browser environmental conditions over CDP: network throttling profiles, CPU slowdown multipliers, geolocation overrides, timezone IDs, and custom User-Agent strings. | Network throttling (Offline, Slow 3G, Fast 3G, 4G), CPU throttling multipliers, Geolocation and timezone overrides |
51
+
52
+ ---
53
+
54
+ *Auto-generated via `npm run docs:generate` on 2026-10-17.*
@@ -1,20 +1,83 @@
1
- ---
2
- title: "Blind Injection"
3
- description: "Enterprise-grade credential injection that never exposes secrets to the LLM."
4
- product: mcp
5
- section: architecture
6
- icon: Lock
7
- slug: blind-injection
8
- ---
9
-
10
- # Blind Injection
11
-
12
- The `browser_type_secret` tool resolves passwords, tokens, and 2FA credentials directly from `secrets.json` on the server — **never exposing sensitive values to the AI model's context stream**.
13
-
14
- ## How It Works
15
-
16
- 1. Store a secret via `weavetab secrets set MY_KEY` or by editing `secrets.json`
17
- 2. The agent calls `browser_type_secret({ id: "w:2", envKey: "MY_KEY" })`
18
- 3. Weavetab resolves the secret from `secrets.json` in-process on the local machine
19
- 4. The value is typed directly into the DOM input field over CDP
20
- 5. All subsequent `browser_map` outputs, DOM snapshots, and audit logs permanently display `[REDACTED]` for that element
1
+ ---
2
+ title: "Blind Injection"
3
+ description: "Enterprise-grade credential injection that never exposes secrets to the LLM."
4
+ product: mcp
5
+ section: architecture
6
+ icon: Lock
7
+ slug: blind-injection
8
+ ---
9
+
10
+ # Blind Injection & Secret Containment
11
+
12
+ The `browser_type_secret` tool and automated secret detection engine resolve passwords, tokens, API keys, PINs, and credentials directly from encrypted storage on the local host — **ensuring sensitive values never cross into the AI agent's context stream or tool outputs**.
13
+
14
+ ## Core Architecture
15
+
16
+ ```
17
+ [Encrypted secrets.json]
18
+ │
19
+ ▼ (In-process resolution & domain validation)
20
+ [Weavetab Server]
21
+ │
22
+ ▼ (Atomic CDP Input.insertText / ghostType)
23
+ [Chromium Target Field]
24
+ │
25
+ ├─► DOM Property Hardening (getter override, symbol coercion, toJSON)
26
+ ├─► In-Memory SessionSecretTracker (backendNodeId & text redaction)
27
+ └─► Dynamic Visual Masking (screenshot, snapshot, PDF blanking)
28
+ ```
29
+
30
+ ## Multi-Layer Containment Mechanisms
31
+
32
+ ### 1. Zero-Exposure Injection
33
+ - Secrets are stored encrypted with AES-256-GCM via `weavetab secrets set <KEY>`.
34
+ - The agent passes the key name (`envKey: "MY_KEY"`), never the plaintext value.
35
+ - Domain scoping validates that the active tab's hostname matches the secret's allowed domains before any value is read from disk.
36
+ - Injection bypasses standard paste or readback mechanisms and writes directly via atomic CDP events.
37
+
38
+ ### 2. Universal Element Selector Resolution
39
+ `browser_type_secret` supports:
40
+ - Direct CSS Selectors (e.g. `id: "#password"`, `id: "input[type='password']"`, `id: ".pwd-field"`)
41
+ - Element ActionMap IDs (e.g. `id: "w:5"` or `id: "5"`)
42
+ - Focused Active Element (`target: "focused"`)
43
+
44
+ ### 3. DOM Property & Coercion Hardening
45
+ Upon injection or typing into any sensitive input:
46
+ - `data-wt-secret="true"` is attached to the DOM node.
47
+ - The element's `.value` getter is overridden at the instance level to return `"[REDACTED]"`.
48
+ - `Symbol.iterator`, `Symbol.toPrimitive`, and `toJSON` are overridden to prevent leakages via array spreads, template literals, or JSON serialization.
49
+
50
+ ### 4. Cross-Tool Containment Matrix
51
+
52
+ | Tool | Protection Mechanism |
53
+ |---|---|
54
+ | `browser_type_secret` | In-process secret resolution, domain check, atomic CDP typing. |
55
+ | `browser_type` | Broad secret detection (`type`, `name`, `id`, `autocomplete`, `aria-label`); disables value readbacks and redactions in action logging. |
56
+ | `browser_fill` | Auto-registers secret fields in both single and `blast_mode`; masks values as `[REDACTED]` in return results and scan discovery mode (`scan: true`). |
57
+ | `browser_map` | DOM and Accessibility (AX) tree walkers redact values, placeholders, and labels for all sensitive fields. |
58
+ | `browser_scrape` | Evaluates in-page attribute extraction with automatic `[REDACTED]` substitution; filters live properties. |
59
+ | `browser_screenshot` | Applies dynamic security masking (`webkitTextSecurity: disc` / blanking) during capture and restores safely in `finally`. |
60
+ | `browser_snapshot` | Pre-masks all secret fields before MHTML export. |
61
+ | `browser_pdf` | Masks sensitive inputs during PDF generation. |
62
+
63
+ ## CLI Usage
64
+
65
+ ```powershell
66
+ # Store an encrypted secret with domain scoping
67
+ weavetab secrets set GITHUB_TOKEN
68
+
69
+ # List stored keys (never prints values)
70
+ weavetab secrets list
71
+
72
+ # Remove a stored key
73
+ weavetab secrets rm GITHUB_TOKEN
74
+ ```
75
+
76
+ ## Agent Tool Invocation
77
+
78
+ ```json
79
+ {
80
+ "id": "#password",
81
+ "envKey": "GITHUB_TOKEN"
82
+ }
83
+ ```
@@ -1,49 +1,49 @@
1
- ---
2
- title: "Overview"
3
- description: "Five layers, deterministic pipeline, zero cloud."
4
- product: mcp
5
- section: architecture
6
- icon: Layers
7
- slug: overview
8
- ---
9
-
10
- # Architecture Overview
11
-
12
- Weavetab is decomposed into **five functional layers**, all running in-process without external daemon dependencies.
13
-
14
- ## Layer Map
15
-
16
- | # | Layer | Responsibility |
17
- |---|---|---|
18
- | 1 | **Transport** | JSON-RPC 2.0 over stdio or WebSocket (`--ws --port 3000`) |
19
- | 2 | **Security & Governance** | Domain blacklist, rate limiter (mutex), RBAC roles, policy engine, root guard |
20
- | 3 | **Intelligence Engine** | Session memory, semantic delta diffing, DOM pruner, loop detection, intent intercept |
21
- | 4 | **Sensor Systems** | Network telemetry, DOM mutation observer, human pacing, agent state machine |
22
- | 5 | **CDP Bridge** | DOM walker, Ghost Cursor (Bézier trajectories), keystroke engine, shadow-DOM injector |
23
-
24
- ## Tool Execution Pipeline
25
-
26
- ```text
27
- Agent → withSecurity()
28
- ├── Rate limiter (mutex)
29
- ├── Domain policy check (allow/deny/audit/read-only)
30
- ├── RBAC role verification
31
- ├── User-stop polling
32
- ├── Chat queue draining
33
- ├── Agent state transition (idle → weaving → reading)
34
- └── Tool handler → CDP Bridge → Browser / Desktop App
35
- ```
36
-
37
- Any validation or security failure short-circuits the pipeline immediately and returns a structured `WeaveError` — no partial side-effects are left on the browser.
38
-
39
- ## Why Direct CDP
40
-
41
- | Feature | Weavetab | Playwright | Puppeteer | Selenium |
42
- |---|---|---|---|---|
43
- | **Architecture** | Direct CDP Layer 0 | Node bridge abstraction | CDP wrapper | WebDriver |
44
- | **Mean latency** | **3–8 ms** | 15–40 ms | 10–25 ms | 50–150 ms |
45
- | **Token efficiency** | **Semantic Deltas (97% reduction)** | Full DOM dumps | Full DOM dumps | Full DOM dumps |
46
- | **Desktop Electron Apps** | **Native (any Electron app)** | Experimental | Limited | Third-party driver |
47
- | **CAPTCHA Solver** | **Autonomous Zero-API** | None | None | None |
48
- | **MCP native** | **Yes (45 tools)** | No | No | No |
49
- | **Cloud dependency** | **Zero** | Optional | Optional | Grid required |
1
+ ---
2
+ title: "Overview"
3
+ description: "Five layers, deterministic pipeline, zero cloud."
4
+ product: mcp
5
+ section: architecture
6
+ icon: Layers
7
+ slug: overview
8
+ ---
9
+
10
+ # Architecture Overview
11
+
12
+ Weavetab is decomposed into **five functional layers**, all running in-process without external daemon dependencies.
13
+
14
+ ## Layer Map
15
+
16
+ | # | Layer | Responsibility |
17
+ |---|---|---|
18
+ | 1 | **Transport** | JSON-RPC 2.0 over stdio (default) or WebSocket (`--ws --port 3000`) |
19
+ | 2 | **Security & Governance** | Domain blacklist, rate limiter (mutex), RBAC roles, policy engine, root guard |
20
+ | 3 | **Intelligence Engine** | Session memory, semantic delta diffing, DOM pruner, loop detection, intent intercept |
21
+ | 4 | **Sensor Systems** | Network telemetry, DOM mutation observer, human pacing, agent state machine |
22
+ | 5 | **CDP Bridge** | DOM walker, Ghost Cursor (Bézier trajectories), keystroke engine, shadow-DOM injector |
23
+
24
+ ## Tool Execution Pipeline
25
+
26
+ ```text
27
+ Agent → withSecurity()
28
+ ├── Rate limiter (mutex)
29
+ ├── Domain policy check (allow/deny/audit/read-only)
30
+ ├── RBAC role verification
31
+ ├── User-stop polling
32
+ ├── Chat queue draining
33
+ ├── Agent state transition (idle → weaving → reading)
34
+ └── Tool handler → CDP Bridge → Browser / Desktop App
35
+ ```
36
+
37
+ Any validation or security failure short-circuits the pipeline immediately and returns a structured `WeaveError` — no partial side-effects are left on the browser.
38
+
39
+ ## Why Direct CDP
40
+
41
+ | Feature | Weavetab | Playwright | Puppeteer | Selenium |
42
+ |---|---|---|---|---|
43
+ | **Architecture** | Direct CDP Layer 0 | Node bridge abstraction | CDP wrapper | WebDriver |
44
+ | **Mean latency** | **3–8 ms** | 15–40 ms | 10–25 ms | 50–150 ms |
45
+ | **Token efficiency** | **Semantic Deltas (97% reduction)** | Full DOM dumps | Full DOM dumps | Full DOM dumps |
46
+ | **Desktop Electron Apps** | **Native (any Electron app)** | Experimental | Limited | Third-party driver |
47
+ | **CAPTCHA Solver** | **Autonomous Zero-API** | None | None | None |
48
+ | **MCP native** | **Yes (44 tools)** | No | No | No |
49
+ | **Cloud dependency** | **Zero** | Optional | Optional | Grid required |
@@ -19,7 +19,7 @@ Weavetab executes direct Layer 0 CDP commands — security is layered and **deny
19
19
  | **Domain Policy Engine** | Per-domain enforcement modes: `allow`, `read-only`, `deny`, `audit`. |
20
20
  | **Localhost Binding** | WebSocket server and CDP endpoints strictly bound to `127.0.0.1`. |
21
21
  | **Rate Limiting** | Mutex-enforced actions-per-minute rate limiter. |
22
- | **RBAC Roles** | 4 strict roles gating tool access (`admin`, `operator`, `viewer`, `automation`). |
22
+ | **RBAC Roles** | 5 roles gating tool access (`admin`, `operator`, `viewer`, `automation`, `system`). |
23
23
  | **Root Guard** | Prevents execution as root/superuser on Unix systems. |
24
24
  | **Blind Injection** | Credential injection from `secrets.json` without exposing raw text to LLM context. |
25
25
  | **Shadow DOM Isolation** | All injected HUD and modal overlays run in isolated Shadow DOM trees. |
@@ -27,9 +27,10 @@ Weavetab executes direct Layer 0 CDP commands — security is layered and **deny
27
27
 
28
28
  ## RBAC Role Matrix
29
29
 
30
- | Tool Category | admin | operator | viewer | automation |
31
- |---|:---:|:---:|:---:|:---:|
32
- | Mutation tools (`click`, `type`, `fill`, etc.) | yes | yes | no | yes |
33
- | Read-only tools (`map`, `find`, `scrape`, `screenshot`) | yes | yes | yes | yes |
34
- | High-level orchestration (`burst`, `plan`, `wait`) | yes | yes | no | yes |
35
- | System management (`detect`, `reset_loop_counter`) | yes | no | no | no |
30
+ | Tool Category | admin | operator | viewer | automation | system |
31
+ |---|:---:|:---:|:---:|:---:|:---:|
32
+ | Mutation tools (`click`, `type`, `fill`, etc.) | yes | yes | no | yes | no |
33
+ | Read-only tools (`map`, `find`, `scrape`, `screenshot`) | yes | yes | yes | yes | no |
34
+ | High-level orchestration (`burst`, `automation`, `wait`) | yes | yes | no | yes | no |
35
+ | Interactive HUD (`thoughts`) | yes | yes | no | no | yes |
36
+ | System introspection (`detect`, `performance`, `checkpoint`) | yes | yes | no | yes | yes |
@@ -12,7 +12,7 @@ slug: transport
12
12
  | Mode | Flag | Protocol | Use Case |
13
13
  |---|---|---|---|
14
14
  | **stdio** | *(default)* | JSON-RPC 2.0 / stdio | Claude Desktop, Cursor, VS Code Copilot, Antigravity |
15
- | **WebSocket** | `--ws` | JSON-RPC 2.0 / WebSocket | Custom agents, Python/Go backends, remote daemons, n8n |
15
+ | **WebSocket** | `--ws [--port N]` | JSON-RPC 2.0 / WebSocket | Custom agents, Python/Go backends, remote daemons, n8n |
16
16
 
17
17
  ## stdio (Default)
18
18
 
@@ -34,4 +34,4 @@ The MCP client spawns Weavetab as a child process and pipes messages over stdin/
34
34
  weavetab --ws --port 3000
35
35
  ```
36
36
 
37
- WebSocket mode binds strictly to `127.0.0.1` for local security. Front it with your own TLS/auth layer if exposing across a private network.
37
+ Starts the daemon on `127.0.0.1:3000` (override with `--port <n>` / `--port=<n>`). The daemon binds strictly to loopback for local security — front it with your own TLS/auth layer if exposing across a private network.