@weavetab/mcp 2.5.0-beta.0

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 (281) hide show
  1. package/AGENTS.md +48 -0
  2. package/ARCHITECTURE.md +590 -0
  3. package/LICENSE +631 -0
  4. package/README.md +909 -0
  5. package/SECURITY.md +196 -0
  6. package/TROUBLESHOOTING.md +365 -0
  7. package/dist/anticaptcha/detector.d.ts +49 -0
  8. package/dist/anticaptcha/detector.js +465 -0
  9. package/dist/anticaptcha/integration.d.ts +36 -0
  10. package/dist/anticaptcha/integration.js +123 -0
  11. package/dist/anticaptcha/solver.d.ts +27 -0
  12. package/dist/anticaptcha/solver.js +552 -0
  13. package/dist/audit/logger.d.ts +13 -0
  14. package/dist/audit/logger.js +177 -0
  15. package/dist/audit/telemetry.d.ts +36 -0
  16. package/dist/audit/telemetry.js +162 -0
  17. package/dist/cdp/bridge.d.ts +16 -0
  18. package/dist/cdp/bridge.js +826 -0
  19. package/dist/cdp/confirm.d.ts +26 -0
  20. package/dist/cdp/confirm.js +79 -0
  21. package/dist/cdp/connector.d.ts +37 -0
  22. package/dist/cdp/connector.js +661 -0
  23. package/dist/cdp/extension.d.ts +36 -0
  24. package/dist/cdp/extension.js +118 -0
  25. package/dist/cdp/finder.d.ts +1 -0
  26. package/dist/cdp/finder.js +2 -0
  27. package/dist/cdp/helpers.d.ts +11 -0
  28. package/dist/cdp/helpers.js +195 -0
  29. package/dist/cdp/label_cache.d.ts +12 -0
  30. package/dist/cdp/label_cache.js +51 -0
  31. package/dist/cdp/lock.d.ts +33 -0
  32. package/dist/cdp/lock.js +206 -0
  33. package/dist/cdp/omni_broker.d.ts +17 -0
  34. package/dist/cdp/omni_broker.js +119 -0
  35. package/dist/cdp/profiles.d.ts +1 -0
  36. package/dist/cdp/profiles.js +87 -0
  37. package/dist/cdp/pruner.d.ts +41 -0
  38. package/dist/cdp/pruner.js +263 -0
  39. package/dist/cdp/ref_cache.d.ts +101 -0
  40. package/dist/cdp/ref_cache.js +234 -0
  41. package/dist/cdp/retry.d.ts +5 -0
  42. package/dist/cdp/retry.js +39 -0
  43. package/dist/cdp/retry_enhanced.d.ts +44 -0
  44. package/dist/cdp/retry_enhanced.js +102 -0
  45. package/dist/cdp/security.d.ts +50 -0
  46. package/dist/cdp/security.js +237 -0
  47. package/dist/cdp/verify.d.ts +39 -0
  48. package/dist/cdp/verify.js +143 -0
  49. package/dist/cdp/walker.d.ts +91 -0
  50. package/dist/cdp/walker.js +896 -0
  51. package/dist/cdp/walker.test.d.ts +2 -0
  52. package/dist/cdp/walker.test.js +172 -0
  53. package/dist/cdp/websocket_transport.d.ts +15 -0
  54. package/dist/cdp/websocket_transport.js +118 -0
  55. package/dist/cli/plugin.d.ts +9 -0
  56. package/dist/cli/plugin.js +1134 -0
  57. package/dist/cli/updater.d.ts +1 -0
  58. package/dist/cli/updater.js +72 -0
  59. package/dist/config/loader.d.ts +120 -0
  60. package/dist/config/loader.js +704 -0
  61. package/dist/index.d.ts +2 -0
  62. package/dist/index.js +1248 -0
  63. package/dist/intelligence/hints.d.ts +11 -0
  64. package/dist/intelligence/hints.js +39 -0
  65. package/dist/intelligence/intent.d.ts +33 -0
  66. package/dist/intelligence/intent.js +171 -0
  67. package/dist/intelligence/sessionMemory.d.ts +66 -0
  68. package/dist/intelligence/sessionMemory.js +284 -0
  69. package/dist/intelligence/sessionMemory.test.d.ts +2 -0
  70. package/dist/intelligence/sessionMemory.test.js +62 -0
  71. package/dist/intelligence/trail.d.ts +64 -0
  72. package/dist/intelligence/trail.js +233 -0
  73. package/dist/intelligence/trail.test.d.ts +2 -0
  74. package/dist/intelligence/trail.test.js +110 -0
  75. package/dist/intelligence/vision.d.ts +24 -0
  76. package/dist/intelligence/vision.js +151 -0
  77. package/dist/lifecycle/mission_manager.d.ts +16 -0
  78. package/dist/lifecycle/mission_manager.js +44 -0
  79. package/dist/overlay/bubble.d.ts +16 -0
  80. package/dist/overlay/bubble.js +37 -0
  81. package/dist/overlay/ghost.d.ts +35 -0
  82. package/dist/overlay/ghost.js +508 -0
  83. package/dist/overlay/injector.d.ts +22 -0
  84. package/dist/overlay/injector.js +198 -0
  85. package/dist/plugin/interface.d.ts +134 -0
  86. package/dist/plugin/interface.js +1 -0
  87. package/dist/plugin/loader.d.ts +18 -0
  88. package/dist/plugin/loader.js +155 -0
  89. package/dist/plugin/registry.d.ts +50 -0
  90. package/dist/plugin/registry.js +234 -0
  91. package/dist/security/blacklist.d.ts +24 -0
  92. package/dist/security/blacklist.js +80 -0
  93. package/dist/security/filter.d.ts +2 -0
  94. package/dist/security/filter.js +20 -0
  95. package/dist/security/guard.d.ts +8 -0
  96. package/dist/security/guard.js +35 -0
  97. package/dist/security/ratelimit.d.ts +11 -0
  98. package/dist/security/ratelimit.js +57 -0
  99. package/dist/security/secrets.d.ts +75 -0
  100. package/dist/security/secrets.js +365 -0
  101. package/dist/sensors/actionability.d.ts +81 -0
  102. package/dist/sensors/actionability.js +303 -0
  103. package/dist/sensors/guard.d.ts +25 -0
  104. package/dist/sensors/guard.js +168 -0
  105. package/dist/sensors/mutations.d.ts +23 -0
  106. package/dist/sensors/mutations.js +93 -0
  107. package/dist/sensors/network.d.ts +67 -0
  108. package/dist/sensors/network.js +193 -0
  109. package/dist/sensors/operation_monitor.d.ts +80 -0
  110. package/dist/sensors/operation_monitor.js +203 -0
  111. package/dist/sensors/pacing.d.ts +44 -0
  112. package/dist/sensors/pacing.js +111 -0
  113. package/dist/sensors/thoughts.d.ts +2 -0
  114. package/dist/sensors/thoughts.js +59 -0
  115. package/dist/sensors/wait.d.ts +12 -0
  116. package/dist/sensors/wait.js +44 -0
  117. package/dist/server.d.ts +7 -0
  118. package/dist/server.js +1687 -0
  119. package/dist/state/agent.d.ts +36 -0
  120. package/dist/state/agent.js +101 -0
  121. package/dist/state/cache.d.ts +16 -0
  122. package/dist/state/cache.js +92 -0
  123. package/dist/state/cache.test.d.ts +2 -0
  124. package/dist/state/cache.test.js +76 -0
  125. package/dist/state/delta.d.ts +71 -0
  126. package/dist/state/delta.js +234 -0
  127. package/dist/state/delta.test.d.ts +2 -0
  128. package/dist/state/delta.test.js +279 -0
  129. package/dist/state/groups.d.ts +15 -0
  130. package/dist/state/groups.js +80 -0
  131. package/dist/state/session.d.ts +30 -0
  132. package/dist/state/session.js +155 -0
  133. package/dist/tools/accessibility.d.ts +14 -0
  134. package/dist/tools/accessibility.js +32 -0
  135. package/dist/tools/ask.d.ts +14 -0
  136. package/dist/tools/ask.js +49 -0
  137. package/dist/tools/automation.d.ts +36 -0
  138. package/dist/tools/automation.js +218 -0
  139. package/dist/tools/browser_detect.d.ts +13 -0
  140. package/dist/tools/browser_detect.js +73 -0
  141. package/dist/tools/burst.d.ts +35 -0
  142. package/dist/tools/burst.js +344 -0
  143. package/dist/tools/canvas.d.ts +25 -0
  144. package/dist/tools/canvas.js +132 -0
  145. package/dist/tools/captcha.d.ts +38 -0
  146. package/dist/tools/captcha.js +209 -0
  147. package/dist/tools/click.d.ts +36 -0
  148. package/dist/tools/click.js +561 -0
  149. package/dist/tools/click_and_wait.d.ts +33 -0
  150. package/dist/tools/click_and_wait.js +149 -0
  151. package/dist/tools/clipboard.d.ts +29 -0
  152. package/dist/tools/clipboard.js +279 -0
  153. package/dist/tools/console.d.ts +21 -0
  154. package/dist/tools/console.js +107 -0
  155. package/dist/tools/cookies.d.ts +67 -0
  156. package/dist/tools/cookies.js +121 -0
  157. package/dist/tools/design_extract.d.ts +109 -0
  158. package/dist/tools/design_extract.js +641 -0
  159. package/dist/tools/dialog.d.ts +24 -0
  160. package/dist/tools/dialog.js +109 -0
  161. package/dist/tools/drag.d.ts +15 -0
  162. package/dist/tools/drag.js +29 -0
  163. package/dist/tools/emulation.d.ts +33 -0
  164. package/dist/tools/emulation.js +69 -0
  165. package/dist/tools/eval.d.ts +20 -0
  166. package/dist/tools/eval.js +92 -0
  167. package/dist/tools/fill.d.ts +41 -0
  168. package/dist/tools/fill.js +667 -0
  169. package/dist/tools/find.d.ts +30 -0
  170. package/dist/tools/find.js +60 -0
  171. package/dist/tools/geo.d.ts +19 -0
  172. package/dist/tools/geo.js +29 -0
  173. package/dist/tools/github/analyze.d.ts +4 -0
  174. package/dist/tools/github/analyze.js +113 -0
  175. package/dist/tools/github/cache.d.ts +21 -0
  176. package/dist/tools/github/cache.js +28 -0
  177. package/dist/tools/github/index.d.ts +4 -0
  178. package/dist/tools/github/index.js +4 -0
  179. package/dist/tools/github/issues.d.ts +9 -0
  180. package/dist/tools/github/issues.js +88 -0
  181. package/dist/tools/github/pr.d.ts +5 -0
  182. package/dist/tools/github/pr.js +88 -0
  183. package/dist/tools/github/rateLimiter.d.ts +4 -0
  184. package/dist/tools/github/rateLimiter.js +46 -0
  185. package/dist/tools/github/read.d.ts +34 -0
  186. package/dist/tools/github/read.js +74 -0
  187. package/dist/tools/github/repoContext.d.ts +20 -0
  188. package/dist/tools/github/repoContext.js +129 -0
  189. package/dist/tools/highlight.d.ts +20 -0
  190. package/dist/tools/highlight.js +140 -0
  191. package/dist/tools/hover.d.ts +19 -0
  192. package/dist/tools/hover.js +57 -0
  193. package/dist/tools/inspect.d.ts +17 -0
  194. package/dist/tools/inspect.js +125 -0
  195. package/dist/tools/integration.test.d.ts +2 -0
  196. package/dist/tools/integration.test.js +96 -0
  197. package/dist/tools/key.d.ts +25 -0
  198. package/dist/tools/key.js +173 -0
  199. package/dist/tools/macro_compiler.d.ts +7 -0
  200. package/dist/tools/macro_compiler.js +82 -0
  201. package/dist/tools/mouse.d.ts +21 -0
  202. package/dist/tools/mouse.js +62 -0
  203. package/dist/tools/navigate.d.ts +16 -0
  204. package/dist/tools/navigate.js +188 -0
  205. package/dist/tools/network_intercept.d.ts +17 -0
  206. package/dist/tools/network_intercept.js +151 -0
  207. package/dist/tools/office/index.d.ts +9 -0
  208. package/dist/tools/office/index.js +7 -0
  209. package/dist/tools/office/list.d.ts +15 -0
  210. package/dist/tools/office/list.js +41 -0
  211. package/dist/tools/office/parse.d.ts +20 -0
  212. package/dist/tools/office/parse.js +172 -0
  213. package/dist/tools/pdf.d.ts +22 -0
  214. package/dist/tools/pdf.js +42 -0
  215. package/dist/tools/performance.d.ts +12 -0
  216. package/dist/tools/performance.js +47 -0
  217. package/dist/tools/performance_test.d.ts +70 -0
  218. package/dist/tools/performance_test.js +128 -0
  219. package/dist/tools/plan.d.ts +39 -0
  220. package/dist/tools/plan.js +161 -0
  221. package/dist/tools/pointer.d.ts +35 -0
  222. package/dist/tools/pointer.js +522 -0
  223. package/dist/tools/read.d.ts +30 -0
  224. package/dist/tools/read.js +488 -0
  225. package/dist/tools/recording.d.ts +45 -0
  226. package/dist/tools/recording.js +124 -0
  227. package/dist/tools/response.d.ts +129 -0
  228. package/dist/tools/response.js +5 -0
  229. package/dist/tools/scrape.d.ts +24 -0
  230. package/dist/tools/scrape.js +140 -0
  231. package/dist/tools/screenshot.d.ts +40 -0
  232. package/dist/tools/screenshot.js +79 -0
  233. package/dist/tools/scroll.d.ts +23 -0
  234. package/dist/tools/scroll.js +196 -0
  235. package/dist/tools/select.d.ts +13 -0
  236. package/dist/tools/select.js +217 -0
  237. package/dist/tools/snapshot.d.ts +27 -0
  238. package/dist/tools/snapshot.js +99 -0
  239. package/dist/tools/storage.d.ts +18 -0
  240. package/dist/tools/storage.js +29 -0
  241. package/dist/tools/tabs.d.ts +77 -0
  242. package/dist/tools/tabs.js +342 -0
  243. package/dist/tools/thought.d.ts +16 -0
  244. package/dist/tools/thought.js +79 -0
  245. package/dist/tools/type.d.ts +65 -0
  246. package/dist/tools/type.js +1061 -0
  247. package/dist/tools/type_secret.d.ts +23 -0
  248. package/dist/tools/type_secret.js +229 -0
  249. package/dist/tools/upload.d.ts +19 -0
  250. package/dist/tools/upload.js +103 -0
  251. package/dist/tools/video_compiler.d.ts +24 -0
  252. package/dist/tools/video_compiler.js +199 -0
  253. package/dist/tools/viewport.d.ts +44 -0
  254. package/dist/tools/viewport.js +230 -0
  255. package/dist/tools/wait.d.ts +19 -0
  256. package/dist/tools/wait.js +202 -0
  257. package/dist/tools/wait_for.d.ts +23 -0
  258. package/dist/tools/wait_for.js +30 -0
  259. package/dist/tools/windows.d.ts +22 -0
  260. package/dist/tools/windows.js +57 -0
  261. package/dist/ui/index.d.ts +1 -0
  262. package/dist/ui/index.js +12 -0
  263. package/docs/DEV_MODE.md +68 -0
  264. package/docs/DOCUMENTATION.md +532 -0
  265. package/docs/PLUGINS.md +538 -0
  266. package/docs/TOOLS.md +104 -0
  267. package/docs/dev_plugin.md +310 -0
  268. package/ext-dist/background.js +467 -0
  269. package/ext-dist/content.js +3089 -0
  270. package/ext-dist/dashboard.html +583 -0
  271. package/ext-dist/hud/hud.js +73 -0
  272. package/ext-dist/hud/index.html +20 -0
  273. package/ext-dist/manifest.json +77 -0
  274. package/ext-dist/sidepanel/sidepanel.js +25 -0
  275. package/ext-dist/sidepanel.html +547 -0
  276. package/ext-dist/styles.css +218 -0
  277. package/icon.png +0 -0
  278. package/mcp.json +796 -0
  279. package/package.json +113 -0
  280. package/server.json +23 -0
  281. package/smithery.yaml +11 -0
@@ -0,0 +1,532 @@
1
+ # Weavetab MCP Documentation
2
+
3
+ > **Package:** `@weavetab/mcp` | **Version:** 2.5.0 | **License:** AGPLv3 | **Author:** fy2ne
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Weavetab is a production-grade, in-process MCP (Model Context Protocol) server that grants AI agents human-like control over Chromium browsers. It communicates directly over the Chrome DevTools Protocol (CDP) at Layer 0 — no WebDriver process, no browser binary download, no Playwright/Puppeteer abstraction layer.
10
+
11
+ ### Core Capabilities
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)
14
+ - **Direct CDP WebSocket** — 3-8ms mean latency, zero process overhead
15
+ - **Semantic Delta Engine** — 5-10x token reduction via per-tab snapshot diffing
16
+ - **Ghost Cursor** — Bézier curve click engine with human acceleration and jitter
17
+ - **Human Typing Engine** — burst-pattern profiling, per-character jitter, natural pauses
18
+ - **Blind Injection** — enterprise-grade credential injection via `secrets.json` with domain scoping, Shadow DOM isolation, and JS property hardening
19
+ - **Self-Learning** — per-domain session memory, knowledge hints, automatic framework detection
20
+ - **Security Stack** — domain blacklist, RBAC (4 roles), rate limiter, loop detection, input filter, root guard
21
+ - **Burst Mode** — chain N actions in 1 MCP call via `browser_burst`
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
24
+
25
+ ### Weavetab Skills
26
+
27
+ **Weavetab Skills** is an optional companion package (`@weavetab/skills`) that provides pre-built workflow patterns and mission templates for AI agents. These skills help agents understand complex Weavetab workflows and execute multi-step missions more effectively.
28
+
29
+ **Installation:**
30
+ ```bash
31
+ npm install -g @weavetab/skills
32
+ ```
33
+
34
+ **Available Skills:**
35
+ - **Multi-step Form Automation** — Complex form filling with validation handling
36
+ - **E-commerce Checkout** — Shopping cart navigation and payment processing
37
+ - **Data Extraction Pipelines** — Structured data scraping and export
38
+ - **Content Management Systems** — WordPress, Drupal, and CMS-specific workflows
39
+ - **API Testing & Validation** — Endpoint testing and response verification
40
+
41
+ Skills are automatically discovered by compatible MCP clients and provide context-aware guidance for mission planning.
42
+
43
+ ---
44
+
45
+ ## Architecture
46
+
47
+ ```
48
+ MCP Client → stdio/WebSocket → WithSecurity Pipeline → CDP WebSocket → Chromium
49
+ (RateLimit → DomainPolicy → RBAC)
50
+ ```
51
+
52
+ ### Five Architectural Layers
53
+
54
+ | Layer | Components | Responsibility |
55
+ |-------|-----------|----------------|
56
+ | **Transport** | stdio (JSON-RPC), WebSocket (port 3000) | MCP client communication |
57
+ | **Security & Governance** | Domain blacklist, Rate limiter, RBAC, Root guard, Storage blocker | Pre-flight checks |
58
+ | **Intelligence** | Session memory, Delta engine, DOM pruner, Trail/loop detection, Knowledge hints, Vision fallback | Token optimization, self-learning |
59
+ | **Sensor Systems** | Network telemetry, DOM mutations, Human pacing, Agent state machine, Thought HUD | Runtime awareness |
60
+ | **CDP Bridge** | DOM walker, Ghost cursor, Keystroke engine, Pruner, Shadow DOM injector, Tab manager, Browser launcher | Browser control |
61
+
62
+ ---
63
+
64
+ ## Tool Reference (44+ Tools)
65
+
66
+ All tools share: Zod schema validation, `withSecurity()` pipeline (rate limiting + domain policy + RBAC), structured audit logging.
67
+
68
+ ### Vision & Reading (7 tools)
69
+
70
+ | Tool | Description |
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 |
74
+ | `browser_scrape` | CSS/XPath structured data extraction in 1 CDP call |
75
+ | `browser_inspect` | Computed CSS styles + inline styles + event listener types |
76
+ | `browser_snapshot` | MHTML capture/restore of DOM state + resources |
77
+ | `browser_screenshot` | PNG/JPEG capture via CDP, full-page + clip region, returns base64 data URL (no file pollution) |
78
+ | `browser_console` | Read/clear buffered console logs and exceptions |
79
+
80
+ ### Navigation (1 tool)
81
+
82
+ | Tool | Description |
83
+ |------|-------------|
84
+ | `browser_navigate` | Navigate to URL with domain blocklist enforcement. Supports `Weavetab://` protocol for persistent local playgrounds |
85
+
86
+ ### Input (9 tools)
87
+
88
+ | Tool | Description |
89
+ |------|-------------|
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 |
92
+ | `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 |
95
+ | `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_upload` | Bypass file dialogs via CDP `DOM.setFileInputFiles` |
98
+ | `browser_scroll` | Directional + element-relative scroll via native wheel events |
99
+
100
+ ### Tabs & Windows (2 tools)
101
+
102
+ | Tool | Description |
103
+ |------|-------------|
104
+ | `browser_tabs` | Open/switch/close/list/consolidate (dedup)/heal (recover crash). Also list/focus windows |
105
+ | `browser_detect` | Detect installed browsers + CDP feature coverage per engine (Chromium, Firefox, WebKit) |
106
+
107
+ ### Mission Execution (3 tools)
108
+
109
+ | Tool | Description |
110
+ |------|-------------|
111
+ | `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
+ | `browser_automation` | Inject persistent self-running scripts — monitoring, polling, background extraction |
114
+
115
+ ### Dialog & User Interaction (3 tools)
116
+
117
+ | Tool | Description |
118
+ |------|-------------|
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) |
121
+ | `browser_clipboard` | System clipboard R/W (text + images) |
122
+
123
+ ### Wait & Timing (2 tools)
124
+
125
+ | Tool | Description |
126
+ |------|-------------|
127
+ | `browser_wait` | Wait for element/text/URL/stable/network/auto — timeout configurable |
128
+ | `browser_reset_loop_counter` | Manual loop detection override |
129
+
130
+ ### Storage & Cookies (2 tools)
131
+
132
+ | Tool | Description |
133
+ |------|-------------|
134
+ | `browser_storage` | localStorage & sessionStorage get/set/clear |
135
+ | `browser_cookies` | Cookies get/set/delete |
136
+
137
+ ### Device & Environment (1 tool)
138
+
139
+ | Tool | Description |
140
+ |------|-------------|
141
+ | `browser_viewport` | Viewport, device emulation, geolocation, timezone override |
142
+
143
+ ### Network (1 tool)
144
+
145
+ | Tool | Description |
146
+ |------|-------------|
147
+ | `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) |
148
+
149
+ ### Canvas & Visual (2 tools)
150
+
151
+ | Tool | Description |
152
+ |------|-------------|
153
+ | `browser_canvas` | Get image data (base64 PNG) or draw points on canvas |
154
+ | `browser_highlight` | Visual CDP overlay highlight — zero token cost |
155
+
156
+ ### Output (2 tools)
157
+
158
+ | Tool | Description |
159
+ |------|-------------|
160
+ | `browser_pdf` | Print page to PDF — landscape, scale, page ranges |
161
+ | `browser_recording` | Compile browser screencast frames into video (.webp, .gif, .mp4, .webm) |
162
+
163
+ ### Evaluation (1 tool)
164
+
165
+ | Tool | Description |
166
+ |------|-------------|
167
+ | `browser_eval` | Run arbitrary JS via CDP Runtime.evaluate. On `Weavetab://` pages, supports building UIs via `wt-dashboard-command` events |
168
+
169
+ ### Performance (1 tool)
170
+
171
+ | Tool | Description |
172
+ |------|-------------|
173
+ | `browser_performance` | FCP, LCP, TTI metrics, resource timings |
174
+
175
+ ### Macro (1 tool)
176
+
177
+ | Tool | Description |
178
+ |------|-------------|
179
+ | `browser_macro_compile` | Compile successful trails into burst macros |
180
+
181
+ ### GitHub (4 tools)
182
+
183
+ | Tool | Description |
184
+ |------|-------------|
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-*`) |
196
+
197
+ ---
198
+
199
+ ## Secrets Management
200
+
201
+ Secrets are stored in structured `secrets.json` files with `chmod 600` enforcement and atomic file writes (temp file + rename).
202
+
203
+ ### Resolution Order
204
+
205
+ 1. `./.Weavetab/secrets.json` (project-scoped, opt-in via `Weavetab secrets init --project`)
206
+ 2. `~/.Weavetab/secrets.json` (global default)
207
+
208
+ > **Note:** The legacy `.env`-based `EnvSecretProvider` is **deprecated and no longer supported**. All secrets must use `secrets.json`.
209
+
210
+ ### CLI Commands
211
+
212
+ ```bash
213
+ Weavetab secrets set MY_KEY # Prompts for value securely
214
+ Weavetab secrets list # Shows keys + domains only (never values)
215
+ Weavetab secrets rm MY_KEY # Remove a secret
216
+ Weavetab secrets init --project # Create project-scoped secrets + config
217
+ ```
218
+
219
+ ### Secrets File Format
220
+
221
+ ```json
222
+ {
223
+ "API_KEY": {
224
+ "value": "sk-...",
225
+ "domains": ["api.example.com"],
226
+ "description": "Production API key"
227
+ }
228
+ }
229
+ ```
230
+
231
+ ### Blind Injection
232
+
233
+ Use `browser_type_secret` to inject credentials without exposing them to the LLM:
234
+
235
+ ```typescript
236
+ browser_type_secret({
237
+ id: "w:1",
238
+ envKey: "API_KEY"
239
+ })
240
+ ```
241
+
242
+ The value is permanently masked as `[REDACTED]` in all subsequent DOM reads and audit logs.
243
+
244
+ ---
245
+
246
+ ## Configuration
247
+
248
+ ### Config File Locations
249
+
250
+ - **Global:** `~/.Weavetab/config.json`
251
+ - **Project:** `./.Weavetab/config.json` (if exists, takes precedence)
252
+
253
+ ### Config Structure
254
+
255
+ ```json
256
+ {
257
+ "browserType": "chromium",
258
+ "headless": false,
259
+ "devMode": true,
260
+ "maxActionsPerMinute": 60,
261
+ "role": "admin",
262
+ "telemetry": false,
263
+ "attachPort": 0,
264
+ "disableExtensions": false,
265
+ "cookies": false,
266
+ "browserFlags": [],
267
+ "policies": []
268
+ }
269
+ ```
270
+
271
+ ### Configuration Options
272
+
273
+ | Option | Type | Default | Description |
274
+ |--------|------|---------|-------------|
275
+ | `browserType` | string | "chromium" | Browser to use (chromium, firefox, webkit) |
276
+ | `headless` | boolean | false | Run browser in headless mode |
277
+ | `devMode` | boolean | true | Enable HUD overlay and verbose logging |
278
+ | `maxActionsPerMinute` | number | 60 | Rate limit for tool executions |
279
+ | `role` | string | "admin" | RBAC role (admin, system, viewer, automation) |
280
+ | `telemetry` | boolean | false | Enable anonymous usage telemetry |
281
+ | `attachPort` | number | 0 | Chrome DevTools Protocol port |
282
+ | `disableExtensions` | boolean | false | Disable Weavetab extension for HUD features |
283
+ | `cookies` | boolean | false | Persist cookies/storage across sessions. When `false`, `document.cookie`, `localStorage`, and `sessionStorage` are all neutered at the browser level (returns empty/null for everything) + a fresh isolated profile is used each session. When `true`, cookies/storage work normally and persist via the profile directory. |
284
+ | `browserFlags` | string[] | `[]` | Extra Chromium command-line flags to append on launch (e.g., `["--disable-web-security"]`). The `--disable-sync` flag is mandatory and cannot be overridden — any conflicting flag is automatically dropped. |
285
+ | `policies` | PolicyEntry[] | `[]` | Domain-level access control policies (see [Domain Policy](#domain-policy) below). Supersedes the legacy `block`/`allow` lists. |
286
+
287
+ ---
288
+
289
+ ## Domain Policy
290
+
291
+ The `policies` config option provides **fine-grained domain-level access control** that supersedes the legacy `block`/`allow` lists. Policies are checked **in array order** before every tool execution — the first matching pattern wins. If no policy matches, the legacy `block`/`allow` lists are checked as fallback, then access is allowed by default.
292
+
293
+ Configure policies directly in your config file (or via `~/.Weavetab/policy.json`):
294
+
295
+ ```json
296
+ {
297
+ "policies": [
298
+ {
299
+ "pattern": "*.banking.com",
300
+ "mode": "deny"
301
+ },
302
+ {
303
+ "pattern": "banking.com",
304
+ "mode": "allow"
305
+ },
306
+ {
307
+ "pattern": "*.internal.com",
308
+ "mode": "read-only"
309
+ },
310
+ {
311
+ "pattern": "*.trusted.com",
312
+ "mode": "allow"
313
+ },
314
+ {
315
+ "pattern": "*.audit-logs.com",
316
+ "mode": "audit-only"
317
+ }
318
+ ]
319
+ }
320
+ ```
321
+
322
+ ### Policy Modes
323
+
324
+ | Mode | Description |
325
+ |------|-------------|
326
+ | `allow` | Full access to all tools. Explicitly whitelists a domain. |
327
+ | `read-only` | Only observation tools allowed: map, find, scrape, console, eval, inspect, snapshot, pdf, cookies. Blocks write tools (click, type, navigate, etc.). |
328
+ | `deny` | Complete block of all interactions on that domain. |
329
+ | `audit-only` | All tools allowed, but every action is logged for audit trails. |
330
+
331
+ ### Key Differences from `block`/`allow` Lists
332
+
333
+ | Feature | Legacy `block`/`allow` | `policies` |
334
+ |---------|----------------------|------------|
335
+ | Modes | Only allow or deny | 4 modes: allow, deny, read-only, audit-only |
336
+ | Wildcards | Supported | Supported (`*` wildcard) |
337
+ | Order | No ordering | **First match wins** — order matters |
338
+ | Granularity | Domain only | Domain + per-tool enforcement (read-only blocks writes) |
339
+ | Check timing | At navigation | Every tool execution |
340
+
341
+ ---
342
+
343
+ ## RBAC Roles
344
+
345
+ ### Role Definitions
346
+
347
+ | Role | Permissions |
348
+ |------|-------------|
349
+ | `admin` | Full access to all tools and system operations |
350
+ | `operator` | Full tool access except system operations (logs, detect, performance) |
351
+ | `viewer` | Read-only access to observation tools only |
352
+ | `automation` | Restricted to burst/plan/wait/map for automated workflows |
353
+
354
+ ### Setting Role
355
+
356
+ ```json
357
+ {
358
+ "role": "viewer"
359
+ }
360
+ ```
361
+
362
+ ---
363
+
364
+ ## Performance Optimization
365
+
366
+ ### Token Efficiency
367
+
368
+ Use `browser_map` with delta and pruning for maximum efficiency:
369
+
370
+ ```typescript
371
+ // First call: full map
372
+ browser_map({ prune: true })
373
+
374
+ // Subsequent calls: only changes
375
+ browser_map({ delta: true, prune: true })
376
+ ```
377
+
378
+ ### Latency Optimization
379
+
380
+ - Use `fast: true` in click operations for faster execution
381
+ - Enable `prune: true` to reduce DOM processing time
382
+ - Use cached ref IDs instead of label-based lookups
383
+ - Avoid unnecessary DOM walks with `browser_find` for text search
384
+
385
+ ### Memory Optimization
386
+
387
+ - Clear cache periodically: `Weavetab reset`
388
+ - Use `limit` parameter in `browser_map` to reduce cache size
389
+ - Enable `prune: true` to reduce memory footprint
390
+ - Restart Weavetab for long-running sessions
391
+
392
+ ---
393
+
394
+ ## Plugin System
395
+
396
+ ### Creating a Plugin
397
+
398
+ Create any npm package with a `weavetab.json` manifest at its root:
399
+
400
+ ```json
401
+ // my-plugin/package.json
402
+ {
403
+ "name": "wt-my-tool",
404
+ "version": "1.0.0",
405
+ "main": "index.js",
406
+ "type": "module"
407
+ }
408
+ ```
409
+
410
+ ```json
411
+ // my-plugin/weavetab.json
412
+ {
413
+ "name": "My Custom Tool",
414
+ "version": "1.0.0",
415
+ "description": "Custom MCP tool for Weavetab",
416
+ "tools": [
417
+ {
418
+ "name": "browser_my_custom_tool",
419
+ "description": "My custom tool description"
420
+ }
421
+ ]
422
+ }
423
+ ```
424
+
425
+ ```typescript
426
+ // my-plugin/index.ts
427
+ import type { WeavetabPlugin } from "@weavetab/mcp";
428
+
429
+ const plugin: WeavetabPlugin = {
430
+ name: "wt-my-tool",
431
+ version: "1.0.0",
432
+ tools: [
433
+ {
434
+ name: "browser_my_custom_tool",
435
+ description: "My custom tool description",
436
+ handler: async (args, session, config) => {
437
+ // Your tool implementation
438
+ return { success: true, data: "result" };
439
+ }
440
+ }
441
+ ]
442
+ };
443
+
444
+ export default plugin;
445
+ ```
446
+
447
+ ### Installing Plugins
448
+
449
+ ```bash
450
+ # Official plugins
451
+ wt plugin add @weavetab/plugin-sample
452
+
453
+ # Community plugins (any npm name)
454
+ wt plugin add wt-my-tool
455
+ # or via npm
456
+ npm install wt-my-tool
457
+ ```
458
+
459
+ Plugins with a valid `weavetab.json` are automatically discovered on Weavetab startup.
460
+
461
+ ---
462
+
463
+ ## Weavetab Skills
464
+
465
+ ### Using Skills
466
+
467
+ Skills provide pre-built workflow patterns that help agents understand complex multi-step operations:
468
+
469
+ ```bash
470
+ npm install -g @weavetab/skills
471
+ ```
472
+
473
+ ### Available Skills
474
+
475
+ - **Form Automation** — Handles complex forms with validation, multi-page flows, and error recovery
476
+ - **E-commerce** — Shopping cart navigation, product selection, checkout processes
477
+ - **Data Extraction** — Structured scraping, pagination handling, data export
478
+ - **CMS Workflows** — WordPress, Drupal, and other CMS-specific operations
479
+ - **API Testing** — Endpoint discovery, request/response validation, test automation
480
+
481
+ ### Skill Integration
482
+
483
+ Skills are automatically discovered by MCP clients and provide:
484
+
485
+ - Context-aware workflow guidance
486
+ - Step-by-step mission templates
487
+ - Error handling patterns
488
+ - Best practice recommendations
489
+
490
+ ---
491
+
492
+ ## Troubleshooting
493
+
494
+ ### Common Issues
495
+
496
+ 1. **CDP connection failed** — Ensure Chrome is running with `--remote-debugging-port=9222`
497
+ 2. **Extension not loading** — Use headed mode or `--headless=new` Chrome flag
498
+ 3. **High memory usage** — Clear cache with `Weavetab reset` or enable pruning
499
+ 4. **Token usage high** — Use `delta: true` and `prune: true` in `browser_map`
500
+ 5. **Clicks failing** — Use ref IDs from `browser_map` instead of labels
501
+
502
+ ### Debug Mode
503
+
504
+ Enable `devMode: true` in config for:
505
+
506
+ - Real-time tool execution timing
507
+ - Token usage estimates
508
+ - Detailed error messages
509
+ - HUD overlay in browser
510
+
511
+ ### Audit Logs
512
+
513
+ Review `~/.Weavetab/logs/audit.log` for:
514
+
515
+ - Tool invocation history
516
+ - Error messages and stack traces
517
+ - Domain policy violations
518
+ - Security events
519
+
520
+ For detailed troubleshooting, see [TROUBLESHOOTING.md](../TROUBLESHOOTING.md).
521
+
522
+ ---
523
+
524
+ ## Additional Resources
525
+
526
+ - [Plugin System Guide](PLUGINS.md)
527
+ - [Architecture Documentation](../ARCHITECTURE.md)
528
+ - [Tool Reference](TOOLS.md)
529
+ - [Security Policy](../SECURITY.md)
530
+ - [Contributing Guidelines](../CONTRIBUTING.md)
531
+ - [Troubleshooting Guide](../TROUBLESHOOTING.md)
532
+ - [Comparison with Other Tools](../.upgrade/compare.md)