@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
package/SECURITY.md ADDED
@@ -0,0 +1,196 @@
1
+ # Weavetab MCP Security Policy
2
+
3
+ > **Version:** 2.5.0 (Beta) | **Package:** `@weavetab/mcp` | **Last Updated:** August 2026
4
+
5
+ ---
6
+
7
+ ## Supported Versions
8
+
9
+ Only the latest major release of Weavetab receives security updates. Users are strongly advised to keep their installation current.
10
+
11
+ | Version | Supported | Security Updates |
12
+ |---------|-----------|------------------|
13
+ | 2.x.x | Yes | Yes |
14
+ | < 2.0 | No | No |
15
+
16
+ ---
17
+
18
+ ## Architecture Context
19
+
20
+ Weavetab interacts directly with the local Chromium browser instance via the Chrome DevTools Protocol (CDP). Because it can control the browser at the operating system level, Weavetab operates at a highly privileged layer (Layer 0).
21
+
22
+ ### Security Mechanisms
23
+
24
+ | Mechanism | Description | Implementation |
25
+ |-----------|-------------|----------------|
26
+ | **Domain Blacklist** | High-risk domains (banking portals, IAM providers, cloud infrastructure consoles) are hard-blocked from navigation and interaction | Hardcoded entries + user-configurable `block`/`allow` lists in `~/.Weavetab/policy.json` |
27
+ | **Domain Policy Engine** | Per-domain modes: `allow`, `read-only`, `deny`, `audit` | Policies defined as `{ pattern, mode }` entries; read-only mode blocks mutation tools |
28
+ | **Localhost Binding** | The CDP WebSocket endpoint is strictly bound to `127.0.0.1` | No external network interfaces are exposed |
29
+ | **Zero Cloud Dependency** | Weavetab executes entirely on the local machine | No telemetry, analytics, or user data transmitted unless `telemetry: true` is configured |
30
+ | **Rate Limiting** | Configurable actions-per-minute threshold | Mutex-based enforcement prevents runaway agent behavior |
31
+ | **Role-Based Access Control** | Four roles restrict tool access | `admin`, `operator`, `viewer`, `automation` with permission matrices |
32
+ | **Root Guard** | Prevents execution as root or superuser at startup | `assertNotRoot()` check on Unix systems |
33
+ | **Shadow DOM UI Isolation** | All injected interfaces run in isolated contexts | Prevents host page script tampering |
34
+ | **Blind Injection** | Secrets injected via `browser_type_secret` are masked to `[REDACTED]` in all subsequent DOM reads and audit logs | Domain scoping, Shadow DOM isolation, JS property hardening |
35
+ | **Secrets Management** | Resolves secrets from project-scoped or global `secrets.json` | `JsonSecretStore` with atomic file writes and `chmod 600` enforcement |
36
+ | **Storage Blocker** | Optional nullification of `localStorage`, `sessionStorage`, and `document.cookie` | Prevents tracking and fingerprinting |
37
+ | **Input Filter** | Strips elements with suspicious labels from DOM snapshots | Removes excessive length, invisible Unicode characters, prompt injection patterns |
38
+ | **Two-Factor Lock Validation** | Browser process lock validated by PID liveness + TCP port connectivity | Prevents stale lock false-positives after crashes |
39
+ | **Atomic Config Writes** | Config files written to temp file then renamed atomically | Prevents partial reads from concurrent processes |
40
+ | **Path Traversal Protection** | `downloadDir` and `profileDir` paths validated to reject `..` traversal | Prevents directory escape attacks |
41
+ | **Proxy Credential Detection** | Proxy URLs with embedded credentials rejected with warning | Users must use environment variables instead |
42
+
43
+ ---
44
+
45
+ ## Blind Injection Threat Model
46
+
47
+ The **Blind Injection** architecture specifically ensures that credentials do not leak back into the LLM context or Weavetab logs.
48
+
49
+ ### Threats Mitigated
50
+
51
+ - **Accidental context inclusion** — LLM reading the DOM and echoing passwords
52
+ - **Log scraping** — Passwords appearing in plaintext audit logs
53
+ - **DOM snapshot leakage** — Secret values masked as `[REDACTED]` in all subsequent maps, deltas, and AX tree dumps
54
+ - **Prompt injection domain theft** — Domain check runs before the secret value is ever resolved
55
+
56
+ ### Threats NOT Mitigated
57
+
58
+ - This does **not** protect against a compromised host or a malicious process reading the secrets file directly
59
+ - It is not "zero-knowledge"; Weavetab must read the secret from `secrets.json` to inject it
60
+
61
+ ### Secrets Resolution Order
62
+
63
+ When `browser_type_secret({ envKey: 'MY_SECRET' })` is called, the `JsonSecretStore` resolves from:
64
+
65
+ 1. `./.Weavetab/secrets.json` (project-scoped, opt-in via `Weavetab secrets init --project`)
66
+ 2. `~/.Weavetab/secrets.json` (global default)
67
+
68
+ The old `EnvSecretProvider` (`.env`-based) is **deprecated and no longer supported**. All secrets must be stored in `secrets.json`. See the [README Secrets Management section](README.md#-secrets-management) for the full CLI workflow.
69
+
70
+ ### Secrets File Format
71
+
72
+ ```json
73
+ {
74
+ "ACME_CORP_PASSWORD": {
75
+ "value": "hunter2",
76
+ "domains": ["login.example.com"],
77
+ "description": "Account password"
78
+ },
79
+ "GITHUB_2FA": {
80
+ "value": "123456",
81
+ "domains": ["github.com"],
82
+ "description": "2FA Code"
83
+ }
84
+ }
85
+ ```
86
+
87
+ ---
88
+
89
+ ## RBAC Role Matrix
90
+
91
+ | Tool Category | admin | viewer | system |
92
+ |---------------|-------|--------|--------|
93
+ | All mutation tools | ✅ | ❌ | ❌ |
94
+ | Read-only (map, find, scrape, console, eval, inspect, snapshot, screenshot, pdf, cookies, tabs, wait, github_*) | ✅ | ✅ | ❌ |
95
+ | burst, plan, wait, map | ✅ | ❌ | ✅ |
96
+ | System (logs, detect, performance, reset_loop_counter) | ✅ | ❌ | ❌ |
97
+
98
+ ### Role Definitions
99
+
100
+ - **admin** — Full access to all tools and system operations
101
+ - **viewer** — Read-only access to observation tools only
102
+ - **system** — Restricted to burst/plan/wait/map for automated workflows
103
+
104
+ ---
105
+
106
+ ## Security Architecture Flow
107
+
108
+ ```mermaid
109
+ flowchart TD
110
+ Inv[Tool Invocation] --> Rate[Rate Limiter]
111
+ Rate --> Dom[Domain Policy Check]
112
+ Dom --> RBAC[RBAC Role Check]
113
+ RBAC --> Custom[Custom Black List?]
114
+ Custom -- Match --> Block1[Block: SecurityError]
115
+ Custom -- No Match --> Hard[Hardcoded Blacklist]
116
+ Hard -- Match --> Block2[Block: SecurityError]
117
+ Hard -- No Match --> Stop[User Stop Check]
118
+ Stop --> CDP[CDP Execution]
119
+ CDP --> Audit[Audit Log]
120
+ Audit --> Secret[Secret Tool?]
121
+ Secret -- Yes --> Tracker[SessionSecret Tracker<br/>Marks node as secret]
122
+ Tracker --> Ret[Return Result]
123
+ Secret -- No --> Ret
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Reporting a Vulnerability
129
+
130
+ If you discover a security vulnerability in Weavetab, please **do not** open a public GitHub issue.
131
+
132
+ Instead, report via one of the following channels:
133
+
134
+ - **Email**: security@Weavetab.dev
135
+ - **GitHub**: Use the private vulnerability reporting feature on the repository
136
+
137
+ ### Disclosure Timeline
138
+
139
+ 1. **48 hours** — Acknowledgment of receipt
140
+ 2. **7 days** — Initial assessment and severity classification
141
+ 3. **30 days** — Fix deployed (critical) or mitigation plan communicated (moderate)
142
+
143
+ We strive to provide regular updates on progress throughout the process. If a fix is required, an emergency patch will be published to the NPM registry.
144
+
145
+ ### Severity Classification
146
+
147
+ | Severity | Definition | Response Time |
148
+ |----------|------------|---------------|
149
+ | **Critical** | Allows unauthorized system access or credential theft | 48 hours |
150
+ | **High** | Allows data exfiltration or privilege escalation | 7 days |
151
+ | **Medium** | Limited impact, requires user interaction | 30 days |
152
+ | **Low** | Minor security issue with minimal impact | Next release |
153
+
154
+ ---
155
+
156
+
157
+
158
+ ## Security Best Practices
159
+
160
+ ### For Users
161
+
162
+ 1. **Keep Weavetab Updated** — Always use the latest version to ensure security patches
163
+ 2. **Use RBAC** — Restrict tool access using appropriate roles (`admin`, `viewer`, `system`)
164
+ 3. **Configure Domain Policies** — Block high-risk domains
165
+ 4. **Use Blind Injection** — Never pass passwords or 2FA codes directly to `browser_type`; use `browser_type_secret`
166
+
167
+ ### For Developers
168
+
169
+ 1. **Test Security Features** — Verify domain policies, RBAC, and rate limiting in tests
170
+ 2. **Use Least Privilege** - Tools should request only the permissions they need
171
+
172
+ ---
173
+
174
+ ## Security Notifications
175
+
176
+ To receive security notifications:
177
+
178
+ - **Watch the GitHub Repository** — Enable releases and security alerts
179
+ - **Subscribe to Security Advisories** — Monitor GitHub Security Advisories for the repository
180
+ - **Review CHANGELOG.md** — Check security updates in release notes
181
+
182
+ ---
183
+
184
+ ## Contact Information
185
+
186
+ For security-related inquiries:
187
+
188
+ - **Security Vulnerabilities**: security@Weavetab.dev
189
+ - **Security Questions**: conduct@Weavetab.dev
190
+ - **GitHub Security**: https://github.com/weavetab/mcp/security
191
+
192
+ ---
193
+
194
+ ## License
195
+
196
+ Weavetab is licensed under AGPL-3.0. Security vulnerabilities should be reported responsibly as outlined in this document. Public disclosure of vulnerabilities before coordination with the maintainers is not permitted.
@@ -0,0 +1,365 @@
1
+ # Weavetab MCP Troubleshooting Guide
2
+
3
+ > **Version:** 2.5.0 (Beta) | **Package:** `@weavetab/mcp` | **Last Updated:** August 2026
4
+
5
+ This guide covers common issues and their solutions when working with Weavetab's MCP tools.
6
+
7
+ ---
8
+
9
+ ## Table of Contents
10
+
11
+ - [Common Issues](#common-issues)
12
+ - [Configuration Issues](#configuration-issues)
13
+ - [Browser Connection Issues](#browser-connection-issues)
14
+ - [Performance Issues](#performance-issues)
15
+ - [Security Issues](#security-issues)
16
+ - [Debugging Tips](#debugging-tips)
17
+
18
+ ---
19
+
20
+ ## Common Issues
21
+
22
+ ### 1. `browser_map` returns "skipped: true" permanently
23
+
24
+ **Symptom:** `browser_map` consistently returns a JSON object with `skipped: true` and refuses to map the page, citing a `w:NN` ref that doesn't exist on the current page.
25
+
26
+ **Cause:** Weavetab's "smart skip" logic prevents wasting tokens on duplicate maps if the DOM hasn't changed. However, cross-session stale state on disk can poison this detection.
27
+
28
+ **Solutions:**
29
+ - Pass `force: true` to `browser_map` to force a rebuild
30
+ - Navigate to a new page (which clears the URL-specific skip lock)
31
+ - Clear the cache: `Weavetab reset` to clear all session state
32
+
33
+ **Example:**
34
+ ```typescript
35
+ browser_map({ force: true })
36
+ ```
37
+
38
+ ---
39
+
40
+ ### 2. `browser_fill` reports "0 succeeded" but the fields actually changed
41
+
42
+ **Symptom:** The tool fills the form perfectly, but the MCP tool response says the fields failed to apply.
43
+
44
+ **Cause:** (Fixed in v2.5.0+) Previously, verification was backwards. If you see this in older versions, upgrade to the latest version.
45
+
46
+ **Solution:** None needed on v2.5.0+. The verification logic correctly compares pre-mutation and post-mutation state.
47
+
48
+ ---
49
+
50
+ ### 3. `browser_type` appends text instead of replacing it
51
+
52
+ **Symptom:** When trying to type "NEW VALUE" into a field containing "Jane", the field becomes "JaneNEW VALUE".
53
+
54
+ **Cause:** The auto-clear logic relies on keyboard shortcuts (Ctrl+A, Delete) which can fail if the element loses focus during the split-second execution.
55
+
56
+ **Solution:** (Fixed in v2.5.0+) Auto-clear now uses atomic JavaScript evaluation to clear fields securely before typing. For older versions, use `clearFirst: true` parameter.
57
+
58
+ **Example:**
59
+ ```typescript
60
+ browser_type({ id: "w:1", text: "NEW VALUE", clearFirst: true })
61
+ ```
62
+
63
+ ---
64
+
65
+ ### 4. `browser_select` reports success but the value immediately reverts
66
+
67
+ **Symptom:** The dropdown changes, but immediately snaps back to the old value, yet the tool reports `success: true`.
68
+
69
+ **Cause:** Frameworks like React and Vue control form state asynchronously. If Weavetab checks too quickly, it sees the changed DOM before React overrides it.
70
+
71
+ **Solution:** The tool now implements a 400ms multi-pass verification window for dropdowns to detect asynchronous reversion. If the issue persists, try using `browser_fill` with a small delay.
72
+
73
+ ---
74
+
75
+ ### 5. `browser_click` by label takes 50+ seconds
76
+
77
+ **Symptom:** `browser_click({ label: "Submit" })` works, but the command hangs for nearly a minute before returning.
78
+
79
+ **Cause:** Clicking by label requires a full DOM scan. If the click triggers a navigation, older versions would synchronously rebuild the heavy DOM map of the *new* page before returning.
80
+
81
+ **Solutions:**
82
+ - **Best Practice:** Always use `ref` IDs (`w:42`) from `browser_map` rather than text labels
83
+ - **Fixed in v2.5.0+:** Label clicks now use an LRU cache, and post-navigation DOM mapping is deferred
84
+
85
+ **Example:**
86
+ ```typescript
87
+ // Get fresh refs
88
+ const map = await browser_map()
89
+ // Use ref instead of label
90
+ browser_click({ id: "w:42" })
91
+ ```
92
+
93
+ ---
94
+
95
+ ### 6. `browser_inspect` returns `null` for boxModel or styles
96
+
97
+ **Symptom:** Inspecting an element returns `null` for its box model, preventing layout debugging.
98
+
99
+ **Cause:** The CDP query fired before the browser finished painting the layout.
100
+
101
+ **Solution:** The tool now automatically waits 100ms for layout settling and retries up to 3 times. If the issue persists, manually add a small delay before inspection.
102
+
103
+ ---
104
+
105
+ ### 7. `stuck_warning` fires but the page clearly changed
106
+
107
+ **Symptom:** The tool reports `stuck_warning: true`, but the visual page or text labels visibly changed.
108
+
109
+ **Cause:** The warning previously relied on strict text matching.
110
+
111
+ **Solution:** `stuck_warning` now respects the underlying `delta` computation. If the DOM changed, the warning will not fire. If you still see false positives, use `browser_reset_loop_counter` to manually reset.
112
+
113
+ ---
114
+
115
+ ### 8. Extension not loading in headless mode
116
+
117
+ **Symptom:** The Weavetab extension features (HUD, Voice UI, etc.) don't appear in headless mode.
118
+
119
+ **Cause:** Chrome extensions don't load in headless mode by default.
120
+
121
+ **Solution:** Use headed mode (`headless: false` in config) or use the `--headless=new` Chrome flag which supports some extension features.
122
+
123
+ ---
124
+
125
+ ## Configuration Issues
126
+
127
+ ### 1. Domain blacklist not working
128
+
129
+ **Symptom:** Weavetab allows navigation to blacklisted domains.
130
+
131
+ **Cause:** Domain blacklist configuration may not be loaded correctly.
132
+
133
+ **Solution:**
134
+ - Verify `~/.Weavetab/policy.json` exists and is valid JSON
135
+ - Check that the domain pattern matches (wildcards use `*` not regex)
136
+ - Restart Weavetab after modifying policy.json
137
+
138
+ **Example policy.json:**
139
+ ```json
140
+ {
141
+ "policies": [
142
+ {
143
+ "pattern": "*.banking.com",
144
+ "mode": "deny"
145
+ }
146
+ ]
147
+ }
148
+ ```
149
+
150
+ ---
151
+
152
+ ### 2. RBAC permissions not enforced
153
+
154
+ **Symptom:** Restricted roles can access tools they shouldn't.
155
+
156
+ **Cause:** Role configuration may not be set correctly.
157
+
158
+ **Solution:**
159
+ - Verify `role` is set in `~/.Weavetab/config.json`
160
+ - Check that the role is one of: `admin`, `system`, `viewer`, `automation`
161
+ - Restart Weavetab after changing roles
162
+
163
+ ---
164
+
165
+ ### 3. Secrets not being injected
166
+
167
+ **Symptom:** `browser_type_secret` fails to find the secret.
168
+
169
+ **Cause:** Secrets file may not exist or key may be misconfigured.
170
+
171
+ **Solution:**
172
+ - Verify `~/.Weavetab/secrets.json` exists
173
+ - Check that the key matches exactly (case-sensitive)
174
+ - For project-scoped secrets, verify `./.Weavetab/secrets.json` exists
175
+ - Use `Weavetab secrets list` to verify keys are registered
176
+
177
+ ---
178
+
179
+ ## Browser Connection Issues
180
+
181
+ ### 1. "CDP connection failed" error
182
+
183
+ **Symptom:** Weavetab cannot connect to Chrome.
184
+
185
+ **Cause:** Chrome may not be running with remote debugging enabled, or another process is using the CDP port.
186
+
187
+ **Solution:**
188
+ - Start Chrome with remote debugging: Check if Chrome is running and listening on the expected port
189
+ - Check if another Weavetab instance is running and bound to the port
190
+ - Check Weavetab logs for port conflicts and restart
191
+ - Verify port 9222 is not in use: `netstat -an | grep 9222` (Linux/macOS) or `netstat -an | findstr 9222` (Windows)
192
+
193
+ ---
194
+
195
+ ### 2. Browser crashes on startup
196
+
197
+ **Symptom:** Chrome crashes immediately when Weavetab tries to connect.
198
+
199
+ **Cause:** Extension incompatibility or corrupted Chrome profile.
200
+
201
+ **Solution:**
202
+ - Try running without extension: Set `loadExtension: false` in config
203
+ - Use a fresh Chrome profile: Set `profileDir` to a new directory
204
+ - Check Chrome version compatibility (requires Chrome 90+)
205
+ - Disable hardware acceleration in Chrome settings
206
+
207
+ ---
208
+
209
+ ### 3. Multiple browser instances conflict
210
+
211
+ **Symptom:** Weavetab connects to wrong Chrome instance or fails to connect.
212
+
213
+ **Cause:** Multiple Chrome instances with remote debugging enabled.
214
+
215
+ **Solution:**
216
+ - Use different CDP ports for each instance
217
+ - Specify port in Weavetab config: `cdpPort: 9223`
218
+ - Close other Chrome instances before starting Weavetab
219
+
220
+ ---
221
+
222
+ ## Performance Issues
223
+
224
+ ### 1. High memory usage
225
+
226
+ **Symptom:** Weavetab process consuming excessive memory (>500MB).
227
+
228
+ **Cause:** Large DOM caches or memory leaks in long-running sessions.
229
+
230
+ **Solution:**
231
+ - Clear cache: `Weavetab reset`
232
+ - Reduce `maxActionsPerMinute` to slow down execution
233
+ - Enable `prune: true` in `browser_map` to reduce cache size
234
+ - Restart Weavetab periodically for long-running sessions
235
+
236
+ ---
237
+
238
+ ### 2. Slow tool execution
239
+
240
+ **Symptom:** Tools taking longer than expected (>100ms).
241
+
242
+ **Cause:** Network latency, large DOM trees, or slow CDP responses.
243
+
244
+ **Solution:**
245
+ - Use `delta: true` in `browser_map` to avoid full DOM walks
246
+ - Enable `prune: true` to reduce DOM size
247
+ - Use `fast: true` in click operations for faster execution
248
+ - Check network connection and Chrome performance
249
+
250
+ ---
251
+
252
+ ### 3. Token usage too high
253
+
254
+ **Symptom:** LLM context filling up quickly with DOM data.
255
+
256
+ **Cause:** Full DOM maps on every read.
257
+
258
+ **Solution:**
259
+ - Use `browser_map({ delta: true, prune: true })` for maximum efficiency
260
+ - Use `browser_find` instead of `browser_map` for text searches
261
+ - Use `browser_scrape` for targeted data extraction
262
+ - Reduce `limit` parameter in `browser_map` for smaller results
263
+
264
+ ---
265
+
266
+ ## Security Issues
267
+
268
+ ### 1. Secrets appearing in logs
269
+
270
+ **Symptom:** Sensitive data visible in audit logs.
271
+
272
+ **Cause:** Using `browser_type` instead of `browser_type_secret`.
273
+
274
+ **Solution:**
275
+ - Always use `browser_type_secret` for credentials
276
+ - Verify secrets are properly masked in logs as `[REDACTED]`
277
+ - Check that `secrets.json` has correct permissions (`chmod 600`)
278
+
279
+ ---
280
+
281
+ ### 2. Domain policy not blocking sensitive sites
282
+
283
+ **Symptom:** Can navigate to domains that should be blocked.
284
+
285
+ **Cause:** Policy not configured or pattern doesn't match.
286
+
287
+ **Solution:**
288
+ - Verify policy.json syntax and patterns
289
+ - Use `*.domain.com` pattern for subdomain matching
290
+ - Restart Weavetab after policy changes
291
+ - Check audit logs to see if policy is being evaluated
292
+
293
+ ---
294
+
295
+ ## Debugging Tips
296
+
297
+ ### Enable DevMode
298
+
299
+ Set `devMode: true` in `~/.Weavetab/config.json` to see:
300
+
301
+ - Real-time tool execution timing
302
+ - Token usage estimates
303
+ - Detailed error messages
304
+ - HUD overlay in browser
305
+
306
+ ### Check Audit Logs
307
+
308
+ Review `~/.Weavetab/logs/audit.log` for:
309
+
310
+ - Tool invocation history
311
+ - Error messages and stack traces
312
+ - Domain policy violations
313
+ - Security events
314
+
315
+ ### Use Verbose Logging
316
+
317
+ Set environment variable for verbose output:
318
+
319
+ ```bash
320
+ DEBUG=weavetab:* Weavetab
321
+ ```
322
+
323
+ ### Manual Browser Inspection
324
+
325
+ Connect to Chrome DevTools directly:
326
+
327
+ 1. Start Chrome with remote debugging
328
+ 2. Navigate to `chrome://inspect`
329
+ 3. Click "inspect" on the target page
330
+ 4. Use DevTools to manually inspect DOM and network
331
+
332
+
333
+
334
+ ## General Fallbacks
335
+
336
+ If a tool fails:
337
+
338
+ 1. **Always use `browser_map`** to get fresh `ref` IDs (`w:NN`) after navigation or dynamic changes
339
+ 2. If `browser_click` by `ref` fails because the element is occluded or unstable, fall back to `browser_click` with raw `x/y` coordinates
340
+ 3. If an element is hidden inside a shadow DOM, pass `ax_tree: true` to `browser_map` to bypass the standard DOM walker and read the raw accessibility tree
341
+ 4. If typing fails, try `paste: true` mode or use `browser_eval` to set the value directly
342
+ 5. If navigation hangs, try `force: true` or check for blocking dialogs with `browser_dialog`
343
+
344
+ ---
345
+
346
+ ## Getting Help
347
+
348
+ If you continue to experience issues:
349
+
350
+ 1. **Check the logs** — Review `~/.Weavetab/logs/` for detailed error information
351
+ 2. **Search GitHub Issues** — Check if your issue has already been reported
352
+ 3. **Create a minimal reproduction** — Provide steps to reproduce the issue
353
+ 4. **Include environment details** — OS, Node version, Chrome version, Weavetab version
354
+ 5. **Report via GitHub** — Open an issue with all relevant information
355
+
356
+ **For security issues**, please follow the reporting process in [SECURITY.md](SECURITY.md).
357
+
358
+ ---
359
+
360
+ ## Additional Resources
361
+
362
+ - [Architecture Documentation](ARCHITECTURE.md)
363
+ - [Tool Reference](docs/TOOLS.md)
364
+ - [Security Policy](SECURITY.md)
365
+ - [Contributing Guidelines](CONTRIBUTING.md)
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Weavetab — anticaptcha/detector.ts
3
+ * Comprehensive CAPTCHA detection covering all major real-world CAPTCHA types.
4
+ * Detects: reCAPTCHA v2/v3, hCaptcha, Turnstile, GeeTest, FunCaptcha,
5
+ * slider/drag, press-and-hold, DataDome, PerimeterX, and custom CAPTCHAs.
6
+ * No external API keys. All detection via DOM inspection + CDP.
7
+ * Weavetab by fy2ne
8
+ */
9
+ import CDP from "chrome-remote-interface";
10
+ export type CaptchaType = "recaptcha_v2" | "recaptcha_v3" | "hcaptcha" | "turnstile" | "geetest" | "geetest_v4" | "funcaptcha" | "slider" | "press_and_hold" | "datadome" | "perimeter_x" | "custom" | "unknown";
11
+ export type InteractionType = "checkbox" | "image_select" | "drag" | "hold" | "text" | "math" | "rotate" | "none" | "unknown";
12
+ export interface CaptchaDetection {
13
+ detected: boolean;
14
+ type: CaptchaType;
15
+ interactionType: InteractionType;
16
+ difficulty: "easy" | "medium" | "hard" | "extreme";
17
+ selector: string;
18
+ iframe?: string;
19
+ widgetId?: string;
20
+ confidence: number;
21
+ /** Approximate drag distance in pixels for slider CAPTCHAs (0 if unknown) */
22
+ sliderTrackWidth?: number;
23
+ /** Estimated hold duration in ms for press-and-hold CAPTCHAs */
24
+ holdDurationMs?: number;
25
+ metadata: {
26
+ siteKey?: string;
27
+ version?: string;
28
+ hasAudio?: boolean;
29
+ hasChallenge?: boolean;
30
+ requiresUserInteraction?: boolean;
31
+ geetestVersion?: number;
32
+ frameOrigin?: string;
33
+ };
34
+ }
35
+ /**
36
+ * Comprehensive CAPTCHA detection using multiple heuristics.
37
+ * Returns the highest-confidence detection found on the page.
38
+ */
39
+ export declare function detectCaptcha(session: CDP.Client): Promise<CaptchaDetection>;
40
+ /**
41
+ * Check if a CAPTCHA is currently blocking the workflow.
42
+ * Uses both detection and a visibility/blocking check.
43
+ */
44
+ export declare function isCaptchaBlocking(session: CDP.Client): Promise<boolean>;
45
+ /**
46
+ * Quickly check if the current page shows a CAPTCHA without the full detection.
47
+ * Cheaper than detectCaptcha — use for polling.
48
+ */
49
+ export declare function quickCaptchaCheck(session: CDP.Client): Promise<boolean>;