@weavetab/mcp 2.5.0-beta.5 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/AGENTS.md +49 -49
  2. package/ARCHITECTURE.md +590 -590
  3. package/README.md +216 -100
  4. package/SECURITY.md +207 -207
  5. package/TROUBLESHOOTING.md +373 -365
  6. package/dist/anticaptcha/detector.js +395 -395
  7. package/dist/anticaptcha/solver.js +130 -130
  8. package/dist/cdp/bridge.js +73 -73
  9. package/dist/cdp/connector.js +46 -22
  10. package/dist/cdp/extension.js +34 -34
  11. package/dist/cdp/helpers.js +174 -174
  12. package/dist/cdp/pruner.js +195 -195
  13. package/dist/cdp/ref_cache.js +66 -66
  14. package/dist/cdp/security.js +10 -10
  15. package/dist/cdp/verify.js +57 -57
  16. package/dist/cdp/walker.js +563 -525
  17. package/dist/cli/plugin.js +26 -3
  18. package/dist/config/loader.d.ts +0 -3
  19. package/dist/config/loader.js +0 -9
  20. package/dist/index.js +0 -4
  21. package/dist/intelligence/intent.js +81 -81
  22. package/dist/intelligence/sessionMemory.js +2 -2
  23. package/dist/overlay/ghost.js +22 -22
  24. package/dist/overlay/injector.js +89 -89
  25. package/dist/plugin/extension_bridge.js +54 -54
  26. package/dist/plugin/interface.d.ts +7 -0
  27. package/dist/plugin/loader.js +3 -4
  28. package/dist/plugin/schema.d.ts +11 -0
  29. package/dist/plugin/schema.js +59 -0
  30. package/dist/security/guard.js +18 -18
  31. package/dist/sensors/actionability.js +167 -167
  32. package/dist/sensors/guard.js +29 -29
  33. package/dist/sensors/network.js +15 -17
  34. package/dist/server.d.ts +1 -1
  35. package/dist/server.js +173 -144
  36. package/dist/state/delta.js +6 -7
  37. package/dist/tools/automation.js +85 -85
  38. package/dist/tools/canvas.js +48 -25
  39. package/dist/tools/checkpoint.js +94 -35
  40. package/dist/tools/click.js +52 -41
  41. package/dist/tools/clipboard.js +80 -74
  42. package/dist/tools/design_extract.js +441 -441
  43. package/dist/tools/dialog.js +13 -13
  44. package/dist/tools/emulation.d.ts +2 -0
  45. package/dist/tools/emulation.js +7 -0
  46. package/dist/tools/fill.js +344 -347
  47. package/dist/tools/find.js +78 -52
  48. package/dist/tools/highlight.js +67 -67
  49. package/dist/tools/inspect.js +54 -25
  50. package/dist/tools/key.js +42 -35
  51. package/dist/tools/navigate.d.ts +1 -1
  52. package/dist/tools/navigate.js +35 -35
  53. package/dist/tools/office/parse.js +62 -18
  54. package/dist/tools/pdf.d.ts +9 -0
  55. package/dist/tools/pdf.js +7 -4
  56. package/dist/tools/performance.d.ts +11 -4
  57. package/dist/tools/performance.js +94 -42
  58. package/dist/tools/performance_test.d.ts +2 -2
  59. package/dist/tools/performance_test.js +69 -69
  60. package/dist/tools/pointer.js +116 -116
  61. package/dist/tools/read.js +99 -67
  62. package/dist/tools/recording.js +9 -0
  63. package/dist/tools/scrape.js +146 -146
  64. package/dist/tools/screenshot.d.ts +2 -0
  65. package/dist/tools/screenshot.js +46 -4
  66. package/dist/tools/scroll.d.ts +3 -1
  67. package/dist/tools/scroll.js +13 -15
  68. package/dist/tools/select.d.ts +3 -0
  69. package/dist/tools/select.js +131 -124
  70. package/dist/tools/snapshot.js +8 -6
  71. package/dist/tools/storage.d.ts +5 -1
  72. package/dist/tools/storage.js +16 -0
  73. package/dist/tools/tabs.d.ts +7 -5
  74. package/dist/tools/tabs.js +79 -26
  75. package/dist/tools/thought.js +8 -8
  76. package/dist/tools/type.js +274 -274
  77. package/dist/tools/type_secret.js +23 -23
  78. package/dist/tools/upload.js +3 -3
  79. package/dist/tools/video_compiler.js +9 -0
  80. package/dist/tools/wait.js +35 -35
  81. package/dist/version.d.ts +1 -1
  82. package/dist/version.js +1 -1
  83. package/docs/DOCUMENTATION.md +583 -585
  84. package/docs/PLUGINS.md +139 -121
  85. package/docs/TOOLS.md +3 -4
  86. package/docs/architecture/blind-injection.md +83 -83
  87. package/docs/architecture/overview.md +49 -49
  88. package/docs/configuration/configuration.md +39 -27
  89. package/docs/configuration/folders.md +62 -55
  90. package/docs/desktop-automation/electron-apps.md +225 -214
  91. package/docs/get-started/installation.md +1 -1
  92. package/docs/get-started/introduction.md +60 -60
  93. package/docs/get-started/quickstart.md +2 -2
  94. package/docs/get-started/setup-wizard.md +1 -1
  95. package/docs/intelligence/site-profiles.md +151 -151
  96. package/docs/tools/tools.md +582 -631
  97. package/docs/troubleshooting/trouble-loop.md +31 -31
  98. package/ext-dist/background.js +415 -415
  99. package/ext-dist/content.js +2527 -2527
  100. package/ext-dist/dashboard.html +583 -583
  101. package/ext-dist/hud/hud.js +3 -3
  102. package/ext-dist/hud/index.html +20 -20
  103. package/ext-dist/manifest.json +73 -73
  104. package/ext-dist/styles.css +223 -223
  105. package/mcp.json +796 -805
  106. package/package.json +8 -8
  107. package/server.json +23 -23
  108. package/smithery.yaml +7 -11
  109. package/dist/cdp/walker.test.d.ts +0 -2
  110. package/dist/cdp/walker.test.js +0 -172
  111. package/dist/intelligence/sessionMemory.test.d.ts +0 -2
  112. package/dist/intelligence/sessionMemory.test.js +0 -62
  113. package/dist/intelligence/trail.test.d.ts +0 -2
  114. package/dist/intelligence/trail.test.js +0 -110
  115. package/dist/state/cache.test.d.ts +0 -2
  116. package/dist/state/cache.test.js +0 -76
  117. package/dist/state/delta.test.d.ts +0 -2
  118. package/dist/state/delta.test.js +0 -279
  119. package/dist/state/groups.d.ts +0 -15
  120. package/dist/state/groups.js +0 -80
  121. package/dist/tools/accessibility.d.ts +0 -14
  122. package/dist/tools/accessibility.js +0 -32
  123. package/dist/tools/ask.d.ts +0 -14
  124. package/dist/tools/ask.js +0 -49
  125. package/dist/tools/click_and_wait.d.ts +0 -33
  126. package/dist/tools/click_and_wait.js +0 -149
  127. package/dist/tools/drag.d.ts +0 -15
  128. package/dist/tools/drag.js +0 -29
  129. package/dist/tools/geo.d.ts +0 -19
  130. package/dist/tools/geo.js +0 -29
  131. package/dist/tools/github/analyze.d.ts +0 -4
  132. package/dist/tools/github/analyze.js +0 -113
  133. package/dist/tools/github/cache.d.ts +0 -21
  134. package/dist/tools/github/cache.js +0 -28
  135. package/dist/tools/github/index.d.ts +0 -19
  136. package/dist/tools/github/index.js +0 -40
  137. package/dist/tools/github/issues.d.ts +0 -9
  138. package/dist/tools/github/issues.js +0 -88
  139. package/dist/tools/github/pr.d.ts +0 -5
  140. package/dist/tools/github/pr.js +0 -88
  141. package/dist/tools/github/rateLimiter.d.ts +0 -4
  142. package/dist/tools/github/rateLimiter.js +0 -46
  143. package/dist/tools/github/read.d.ts +0 -34
  144. package/dist/tools/github/read.js +0 -74
  145. package/dist/tools/github/repoContext.d.ts +0 -20
  146. package/dist/tools/github/repoContext.js +0 -129
  147. package/dist/tools/hover.d.ts +0 -19
  148. package/dist/tools/hover.js +0 -57
  149. package/dist/tools/integration.test.d.ts +0 -2
  150. package/dist/tools/integration.test.js +0 -96
  151. package/dist/tools/macro_compiler.d.ts +0 -7
  152. package/dist/tools/macro_compiler.js +0 -82
  153. package/dist/tools/mouse.d.ts +0 -21
  154. package/dist/tools/mouse.js +0 -62
  155. package/dist/tools/response.d.ts +0 -129
  156. package/dist/tools/response.js +0 -5
  157. package/dist/tools/wait_for.d.ts +0 -23
  158. package/dist/tools/wait_for.js +0 -30
  159. package/dist/tools/windows.d.ts +0 -22
  160. package/dist/tools/windows.js +0 -57
package/docs/PLUGINS.md CHANGED
@@ -1,121 +1,139 @@
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.
1
+ # Weavetab Plugin System & SDK Specification
2
+
3
+ > **Version:** 2.5.1 | **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
+
13
+ ```bash
14
+ npx @weavetab/sdk init my-custom-plugin
15
+ cd my-custom-plugin
16
+ npm install
17
+ ```
18
+
19
+ ### Build & Compile
20
+
21
+ ```bash
22
+ npm run build
23
+ ```
24
+
25
+ ---
26
+
27
+ ## 2. Plugin Architecture
28
+
29
+ Every Weavetab plugin exports a plugin definition created with `definePlugin`:
30
+
31
+ ```typescript
32
+ // src/index.ts
33
+ import { definePlugin, type PluginContext } from "@weavetab/sdk";
34
+
35
+ export default definePlugin({
36
+ name: "weavetab-plugin-sample",
37
+ version: "1.0.0",
38
+ description: "Sample custom tool plugin for Weavetab",
39
+
40
+ defaultConfig: {
41
+ enableHud: true,
42
+ },
43
+
44
+ async onLoad(ctx: PluginContext) {
45
+ // Register a custom MCP tool
46
+ ctx.mcp.registerTool({
47
+ name: "custom_analyzer",
48
+ description: "Performs custom DOM analysis",
49
+ schema: {
50
+ type: "object",
51
+ properties: {
52
+ selector: { type: "string", description: "Target CSS selector" }
53
+ },
54
+ required: ["selector"]
55
+ },
56
+ handler: async (args: { selector: string }, session: any) => {
57
+ // Show thought bubble on the browser tab
58
+ if (ctx.config.enableHud && session) {
59
+ await ctx.extension.showThought(session, `Analyzing ${args.selector}`);
60
+ }
61
+
62
+ return {
63
+ content: [
64
+ { type: "text", text: `Analysis complete for ${args.selector}` }
65
+ ]
66
+ };
67
+ }
68
+ });
69
+ },
70
+
71
+ async onUnload(ctx: PluginContext) {
72
+ // Cleanup resources
73
+ }
74
+ });
75
+ ```
76
+
77
+ ---
78
+
79
+ ## 3. Manifest Specification (weavetab.json)
80
+
81
+ Plugins require a `weavetab.json` manifest in their package root:
82
+
83
+ ```json
84
+ {
85
+ "$schema": "https://weavetab.dev/schema/plugin.json",
86
+ "name": "weavetab-plugin-sample",
87
+ "version": "1.0.0",
88
+ "entry": "dist/index.js",
89
+ "engines": {
90
+ "weavetab": "^2.5.1",
91
+ "node": ">=18.0.0"
92
+ },
93
+ "permissions": {
94
+ "extension": { "hud": true, "reason": "Displays HUD thoughts" },
95
+ "cdp": { "evaluate": true, "reason": "Runs DOM analysis" },
96
+ "tools": { "add": true, "reason": "Registers the custom_analyzer tool" }
97
+ },
98
+ "tools": [
99
+ {
100
+ "name": "custom_analyzer",
101
+ "description": "Performs custom DOM analysis"
102
+ }
103
+ ]
104
+ }
105
+ ```
106
+
107
+ > Registering tools at runtime via `ctx.mcp.registerTool()` requires the `permissions.tools.add` permission.
108
+
109
+ ---
110
+
111
+ ## 4. Plugin Capabilities
112
+
113
+ | Capability | API | Description |
114
+ | :--- | :--- | :--- |
115
+ | **Sandboxed Storage** | `ctx.storage.get()`, `ctx.storage.set()` | Isolated key-value storage in `~/.weavetab/plugins/<name>/`. |
116
+ | **Thought Bubbles** | `ctx.extension.showThought(session, text)` | Floating green thoughts on the live browser tab. |
117
+ | **HUD Badges** | `ctx.extension.setHudState(session, state)` | Real-time status in the Weavetab overlay. |
118
+ | **Tool Overrides** | `ctx.mcp.overrideTool(name, wrapperFn)` | Wrap or intercept built-in MCP tools with custom pre/post logic. |
119
+ | **Lifecycle Hooks** | `ctx.hooks.beforeToolCall`, `ctx.hooks.afterToolCall` | Global auditing and security filters. |
120
+
121
+ ---
122
+
123
+ ## 5. Installing Plugins
124
+
125
+ ```bash
126
+ # Install a plugin by npm package name
127
+ weavetab plugin add my-custom-plugin
128
+
129
+ # Install from a local path
130
+ weavetab plugin add ./my-plugin
131
+
132
+ # List installed plugins
133
+ weavetab plugin list
134
+
135
+ # Remove a plugin
136
+ weavetab plugin rm my-custom-plugin
137
+ ```
138
+
139
+ Restart Weavetab to load the newly installed plugin tools into the MCP server.
package/docs/TOOLS.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Weavetab MCP Tool Reference
2
2
 
3
- > **Version:** 2.5.0-beta.5 | **Total Tools:** 42 | **Architecture:** Layer 0 Direct CDP
3
+ > **Version:** 2.5.1 | **Total Tools:** 41 | **Architecture:** Layer 0 Direct CDP
4
4
 
5
- Weavetab provides 42 production-grade MCP tools organized into functional categories.
5
+ Weavetab provides 41 production-grade MCP tools organized into functional categories.
6
6
 
7
7
  | Tool Name | Category | Description | Key Features |
8
8
  | :--- | :--- | :--- | :--- |
@@ -45,10 +45,9 @@ Weavetab provides 42 production-grade MCP tools organized into functional catego
45
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
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
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
48
  | `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
49
  | `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
50
 
52
51
  ---
53
52
 
54
- *Auto-generated via `npm run docs:generate` on 2026-10-17.*
53
+ *Auto-generated via `npm run docs:generate` on 2026-10-18.*
@@ -1,83 +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 & 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
+ ---
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 (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 |
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 (41 Tools)** | No | No | No |
49
+ | **Cloud dependency** | **Zero** | Optional | Optional | Grid required |
@@ -12,9 +12,15 @@ slug: configuration
12
12
  The full `Config` interface lives in `src/config/loader.ts`.
13
13
 
14
14
  ```typescript
15
- export type PolicyMode = "allow" | "deny" | "audit-only" | "read-only";
16
- export type Role = "admin" | "operator" | "viewer" | "automation";
17
- export type BrowserEngine = "chromium" | "firefox" | "webkit";
15
+ export type DevModeConfig = boolean;
16
+ export type PolicyMode = "allow" | "deny" | "audit-only" | "read-only";
17
+ export type Role = "admin" | "operator" | "viewer" | "automation" | "system";
18
+ export type BrowserEngine = "chromium" | "firefox" | "webkit";
19
+
20
+ export interface PolicyEntry {
21
+ pattern: string;
22
+ mode: PolicyMode;
23
+ }
18
24
 
19
25
  export interface ElectronAppConfig {
20
26
  path?: string; // Absolute path to Electron app executable
@@ -25,49 +31,55 @@ export interface ElectronAppConfig {
25
31
  }
26
32
 
27
33
  export interface Config {
28
- // Mode & Port
34
+ // Identity & Transport
29
35
  mode: "session" | "attach";
30
36
  session: string;
31
- attachPort: number;
37
+ attachPort: number; // 0-65535, 0 = dynamic
38
+ agentId: string; // Auto-generated UUID (WT_AGENT_ID to override)
39
+ telemetry: boolean;
32
40
 
33
41
  // Browser Settings
34
- browser: string; // Executable path or "auto"
42
+ browserPath: string; // Executable path or "auto"
35
43
  browserType: BrowserEngine;
36
- profileDir: string;
37
44
  headless: boolean;
38
45
  extension: boolean; // Enable Weavetab Chrome extension
39
46
  browserFlags: string[];
47
+ profileDir: string;
48
+ cookies: boolean;
49
+ syncDataAcrossBrowsers: boolean;
40
50
 
41
51
  // Desktop & Electron Applications
42
- electron?: Record<string, string | number | ElectronAppConfig>;
52
+ apps?: Record<string, ElectronAppConfig>;
53
+ electron?: Record<string, ElectronAppConfig>;
43
54
 
44
55
  // Security & Policy
45
- block: string[]; // Domain blocklist
56
+ role: Role; // RBAC role
57
+ block: string[]; // Domain blocklist (default: ["*.bank.*", "paypal.com"])
46
58
  allow: string[]; // Domain allowlist
47
59
  policies: PolicyEntry[]; // Per-domain policy modes
48
- role: Role; // RBAC role
49
- cookies: boolean; // Allow storage & cookies
50
- proxy?: string; // Outbound proxy URL
60
+ proxy?: string; // Outbound proxy URL (WT_PROXY_URL to override)
51
61
 
52
62
  // Rate Limiting & Resource Caps
53
- maxActionsPerMinute: number; // 1-600 (default 60)
63
+ sessionTimeout: number; // Seconds, 60-86400 (default 3600)
64
+ navigationTimeout: number; // Milliseconds, 1000-120000 (default 30000)
65
+ idleTimeout: number; // Milliseconds, >= 5000 (default 60000)
66
+ actionabilityTimeoutMs: number; // Milliseconds, 50-15000 (default 300)
54
67
  maxTabs: number; // 1-100 (default 10)
68
+ maxActionsPerMinute: number; // 1-600 (default 60)
69
+ githubCacheTtlMs: number; // Milliseconds (default 1800000)
70
+ refCacheTtlMs: number; // Milliseconds (default 30000)
55
71
 
56
- // Timing & Thresholds
57
- sessionTimeout: number; // Seconds (default 3600)
58
- navigationTimeout: number; // Milliseconds (default 30000)
59
- idleTimeout: number; // Milliseconds (default 15000)
60
- actionabilityTimeoutMs: number; // Milliseconds (default 500)
72
+ // Output Directories
73
+ downloadDir: string;
74
+ pdfDir: string;
75
+ snapshotDir: string;
76
+ recordingDir: string;
77
+ designDir: string;
61
78
 
62
79
  // UI & Overlay
63
- devMode: boolean | DevModeConfig;
64
- persona: "concise" | "friendly";
65
-
66
- // Telemetry & GitHub
67
- telemetry: boolean;
68
- githubCacheTtlMs: number;
69
-
70
- // Agent Identity
71
- agentId: string; // Auto-generated UUID
80
+ devMode: DevModeConfig;
72
81
  }
73
82
  ```
83
+
84
+ The on-disk `config.json` may also use the legacy sectioned shape (`general`, `browser`,
85
+ `security`, `performance`); the loader migrates it to this flat interface automatically.