@weavetab/mcp 2.5.0-beta.2 → 2.5.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/ARCHITECTURE.md +6 -6
- package/LICENSE +216 -631
- package/README.md +153 -1074
- package/SECURITY.md +33 -22
- package/TROUBLESHOOTING.md +2 -2
- package/dist/cdp/bridge.js +2 -1
- package/dist/cdp/connector.d.ts +2 -0
- package/dist/cdp/connector.js +10 -6
- package/dist/cdp/helpers.d.ts +4 -0
- package/dist/cdp/helpers.js +181 -0
- package/dist/cdp/omni_broker.d.ts +1 -1
- package/dist/cdp/omni_broker.js +1 -1
- package/dist/cdp/walker.d.ts +25 -1
- package/dist/cdp/walker.js +304 -7
- package/dist/cli/plugin.d.ts +1 -0
- package/dist/cli/plugin.js +81 -18
- package/dist/cli/updater.d.ts +1 -1
- package/dist/cli/updater.js +27 -7
- package/dist/config/loader.d.ts +9 -1
- package/dist/config/loader.js +42 -3
- package/dist/desktop/discovery.d.ts +44 -0
- package/dist/desktop/discovery.js +364 -0
- package/dist/index.js +137 -21
- package/dist/intelligence/marks.d.ts +36 -0
- package/dist/intelligence/marks.js +30 -0
- package/dist/intelligence/patternCompiler.d.ts +118 -0
- package/dist/intelligence/patternCompiler.js +259 -0
- package/dist/intelligence/sessionMemory.d.ts +2 -0
- package/dist/intelligence/sessionMemory.js +18 -8
- package/dist/overlay/injector.js +2 -2
- package/dist/plugin/interface.d.ts +88 -5
- package/dist/plugin/loader.d.ts +12 -1
- package/dist/plugin/loader.js +280 -70
- package/dist/plugin/pipeline.d.ts +75 -0
- package/dist/plugin/pipeline.js +183 -0
- package/dist/plugin/registry.d.ts +2 -1
- package/dist/plugin/registry.js +24 -14
- package/dist/security/secrets.d.ts +7 -0
- package/dist/security/secrets.js +37 -0
- package/dist/sensors/actionability.js +1 -2
- package/dist/sensors/guard.js +4 -10
- package/dist/sensors/mutations.js +12 -0
- package/dist/sensors/operation_monitor.js +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.js +453 -178
- package/dist/state/agent.d.ts +1 -0
- package/dist/state/agent.js +3 -0
- package/dist/state/delta.d.ts +12 -4
- package/dist/state/delta.js +67 -14
- package/dist/state/session.d.ts +6 -0
- package/dist/state/session.js +27 -0
- package/dist/tools/browser_detect.d.ts +16 -3
- package/dist/tools/browser_detect.js +52 -7
- package/dist/tools/burst.d.ts +17 -8
- package/dist/tools/burst.js +236 -77
- package/dist/tools/captcha.js +1 -1
- package/dist/tools/checkpoint.d.ts +38 -0
- package/dist/tools/checkpoint.js +271 -0
- package/dist/tools/click.d.ts +1 -0
- package/dist/tools/click.js +74 -70
- package/dist/tools/design_extract.js +1 -1
- package/dist/tools/eval.js +1 -1
- package/dist/tools/fill.d.ts +20 -1
- package/dist/tools/fill.js +199 -40
- package/dist/tools/find.d.ts +16 -0
- package/dist/tools/find.js +67 -44
- package/dist/tools/github/index.d.ts +19 -4
- package/dist/tools/github/index.js +40 -4
- package/dist/tools/highlight.d.ts +6 -2
- package/dist/tools/highlight.js +158 -72
- package/dist/tools/inspect.js +1 -1
- package/dist/tools/key.js +65 -56
- package/dist/tools/navigate.d.ts +1 -1
- package/dist/tools/navigate.js +34 -39
- package/dist/tools/pdf.js +21 -13
- package/dist/tools/pointer.d.ts +18 -3
- package/dist/tools/pointer.js +89 -1
- package/dist/tools/read.d.ts +28 -8
- package/dist/tools/read.js +230 -56
- package/dist/tools/scrape.js +67 -13
- package/dist/tools/screenshot.js +21 -16
- package/dist/tools/scroll.js +6 -11
- package/dist/tools/select.js +8 -2
- package/dist/tools/snapshot.js +3 -34
- package/dist/tools/tabs.js +15 -7
- package/dist/tools/thought.d.ts +2 -0
- package/dist/tools/thought.js +13 -14
- package/dist/tools/type.d.ts +2 -0
- package/dist/tools/type.js +107 -58
- package/dist/tools/type_secret.js +42 -76
- package/dist/tools/upload.js +1 -1
- package/dist/tools/video_compiler.d.ts +1 -1
- package/dist/tools/video_compiler.js +11 -12
- package/dist/version.d.ts +5 -0
- package/dist/version.js +5 -0
- package/docs/DOCUMENTATION.md +37 -41
- package/docs/PLUGINS.md +121 -0
- package/docs/TOOLS.md +54 -0
- package/docs/architecture/blind-injection.md +83 -20
- package/docs/architecture/overview.md +49 -49
- package/docs/architecture/security.md +8 -7
- package/docs/architecture/transport.md +2 -2
- package/docs/cli/cli-commands.md +7 -1
- package/docs/cli/cli-flags.md +15 -7
- package/docs/cli/cli-scripting.md +6 -3
- package/docs/configuration/config-locations.md +3 -4
- package/docs/configuration/env-variables.md +4 -4
- package/docs/configuration/folders.md +55 -54
- package/docs/desktop-automation/electron-apps.md +214 -162
- package/docs/get-started/introduction.md +60 -60
- package/docs/get-started/setup-wizard.md +7 -6
- package/docs/intelligence/site-profiles.md +151 -0
- package/docs/tools/tools.md +631 -293
- package/docs/troubleshooting/trouble-browser.md +1 -1
- package/docs/troubleshooting/trouble-loop.md +31 -31
- package/ext-dist/background.js +10 -62
- package/ext-dist/content.js +333 -920
- package/ext-dist/hud/hud.js +9 -9
- package/ext-dist/manifest.json +2 -6
- package/ext-dist/styles.css +6 -1
- package/icon.png +0 -0
- package/mcp.json +87 -71
- package/package.json +118 -119
- package/server.json +5 -5
- package/ext-dist/sidepanel/sidepanel.js +0 -25
- package/ext-dist/sidepanel.html +0 -547
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Introduction"
|
|
3
|
-
description: "What Weavetab is, Layer 0 CDP architecture, and design tenets."
|
|
4
|
-
product: mcp
|
|
5
|
-
section: get-started
|
|
6
|
-
icon: BookOpen
|
|
7
|
-
slug: introduction
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Introduction
|
|
11
|
-
|
|
12
|
-
Weavetab is a production-grade, local **Model Context Protocol (MCP) server** that grants AI agents human-like control over Chromium browsers and native **Electron desktop applications** (VS Code, Discord, Slack, Figma, Obsidian, Postman, Antigravity IDE, etc.) — communicating directly over the **Chrome DevTools Protocol (CDP)** at Layer 0.
|
|
13
|
-
|
|
14
|
-
No WebDriver. No browser binary downloads. No Playwright or Puppeteer abstraction layer. No cloud dependency. Tool invocations resolve in **3–8 ms** of mean latency.
|
|
15
|
-
|
|
16
|
-
## Synchronized Ecosystem Releases
|
|
17
|
-
|
|
18
|
-
Both **`@weavetab/mcp`** and the **`@weavetab/sdk`** share synchronized release lines. Every capability introduced in the core runtime is immediately available in the developer SDK with 100% type safety and zero version mismatch.
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
# Install core Weavetab MCP server globally
|
|
22
|
-
npm install -g @weavetab/mcp@latest
|
|
23
|
-
|
|
24
|
-
# Or run directly via npx
|
|
25
|
-
npx -y @weavetab/mcp@latest
|
|
26
|
-
|
|
27
|
-
# Install Weavetab Developer SDK as a dev dependency
|
|
28
|
-
npm install -D @weavetab/sdk@latest
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Design Tenets
|
|
32
|
-
|
|
33
|
-
| Tenet | Implementation |
|
|
34
|
-
|---|---|
|
|
35
|
-
| **Ultra-Low Latency** | Sub-10 ms tool execution via direct CDP WebSocket connections |
|
|
36
|
-
| **Universal Control** | Native orchestration across Chromium web tabs and any Electron desktop app |
|
|
37
|
-
| **Autonomous CAPTCHA** | Zero-API solving (Cloudflare Turnstile, GeeTest, reCAPTCHA) via human Bézier mouse physics |
|
|
38
|
-
| **Security & RBAC** | 4-tier RBAC + domain policies + Blind Credential Injection + profile isolation |
|
|
39
|
-
| **Token Efficiency** | Semantic Delta diffing (up to 97% reduction) + intelligent DOM pruning |
|
|
40
|
-
| **Stealth & Physics** | Ghost Cursor (Bézier curves), human typing jitter, and CDP early-script fingerprint spoofing |
|
|
41
|
-
| **Self-Learning** | Per-domain session memory, framework detection, and automated loop recovery |
|
|
42
|
-
| **Zero Cloud** | Pure local computation. No external telemetry or cloud tracking unless explicitly opted in |
|
|
43
|
-
|
|
44
|
-
## What You Get
|
|
45
|
-
|
|
46
|
-
- **
|
|
47
|
-
- **Universal Desktop App Runtime** —
|
|
48
|
-
- **Autonomous Zero-API CAPTCHA Solver** — solve Cloudflare Turnstile, GeeTest, and reCAPTCHA locally via CDP mouse physics with $0 API costs
|
|
49
|
-
- **Two transport modes** — stdio (Claude Desktop, Cursor, VS Code, Windsurf, Antigravity) and WebSocket (
|
|
50
|
-
- **
|
|
51
|
-
- **Per-domain policies** — ring-fences sensitive banking, internal, and production surfaces
|
|
52
|
-
- **Blind Injection** — credentials resolved server-side from `secrets.json` and never exposed to the LLM
|
|
53
|
-
- **Extensible Plugin System** — auto-discovers and mounts custom MCP tools from `node_modules`
|
|
54
|
-
|
|
55
|
-
## Next Steps
|
|
56
|
-
|
|
57
|
-
- **[Quickstart](
|
|
58
|
-
- **[Desktop & Electron Apps](/
|
|
59
|
-
- **[Autonomous CAPTCHA Solver](/
|
|
60
|
-
- **[MCP Tools Reference](/
|
|
1
|
+
---
|
|
2
|
+
title: "Introduction"
|
|
3
|
+
description: "What Weavetab is, Layer 0 CDP architecture, and design tenets."
|
|
4
|
+
product: mcp
|
|
5
|
+
section: get-started
|
|
6
|
+
icon: BookOpen
|
|
7
|
+
slug: introduction
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Introduction
|
|
11
|
+
|
|
12
|
+
Weavetab is a production-grade, local **Model Context Protocol (MCP) server** that grants AI agents human-like control over Chromium browsers and native **Electron desktop applications** (VS Code, Discord, Slack, Figma, Obsidian, Postman, Antigravity IDE, etc.) — communicating directly over the **Chrome DevTools Protocol (CDP)** at Layer 0.
|
|
13
|
+
|
|
14
|
+
No WebDriver. No browser binary downloads. No Playwright or Puppeteer abstraction layer. No cloud dependency. Tool invocations resolve in **3–8 ms** of mean latency.
|
|
15
|
+
|
|
16
|
+
## Synchronized Ecosystem Releases
|
|
17
|
+
|
|
18
|
+
Both **`@weavetab/mcp`** and the **`@weavetab/sdk`** share synchronized release lines. Every capability introduced in the core runtime is immediately available in the developer SDK with 100% type safety and zero version mismatch.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Install core Weavetab MCP server globally
|
|
22
|
+
npm install -g @weavetab/mcp@latest
|
|
23
|
+
|
|
24
|
+
# Or run directly via npx
|
|
25
|
+
npx -y @weavetab/mcp@latest
|
|
26
|
+
|
|
27
|
+
# Install Weavetab Developer SDK as a dev dependency
|
|
28
|
+
npm install -D @weavetab/sdk@latest
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Design Tenets
|
|
32
|
+
|
|
33
|
+
| Tenet | Implementation |
|
|
34
|
+
|---|---|
|
|
35
|
+
| **Ultra-Low Latency** | Sub-10 ms tool execution via direct CDP WebSocket connections |
|
|
36
|
+
| **Universal Control** | Native orchestration across Chromium web tabs and any Electron desktop app |
|
|
37
|
+
| **Autonomous CAPTCHA** | Zero-API solving (Cloudflare Turnstile, GeeTest, reCAPTCHA) via human Bézier mouse physics |
|
|
38
|
+
| **Security & RBAC** | 4-tier RBAC + domain policies + Blind Credential Injection + profile isolation |
|
|
39
|
+
| **Token Efficiency** | Semantic Delta diffing (up to 97% reduction) + intelligent DOM pruning |
|
|
40
|
+
| **Stealth & Physics** | Ghost Cursor (Bézier curves), human typing jitter, and CDP early-script fingerprint spoofing |
|
|
41
|
+
| **Self-Learning** | Per-domain session memory, framework detection, and automated loop recovery |
|
|
42
|
+
| **Zero Cloud** | Pure local computation. No external telemetry or cloud tracking unless explicitly opted in |
|
|
43
|
+
|
|
44
|
+
## What You Get
|
|
45
|
+
|
|
46
|
+
- **44 built-in MCP tools** covering DOM vision, input synthesis, desktop apps, tabs, network interception, office files, design extraction, and plugin lifecycle
|
|
47
|
+
- **Universal Desktop App Runtime** — control Chrome and native Electron apps (Discord, Figma, VS Code) side-by-side without port conflicts
|
|
48
|
+
- **Autonomous Zero-API CAPTCHA Solver** — solve Cloudflare Turnstile, GeeTest, and reCAPTCHA locally via CDP mouse physics with $0 API costs
|
|
49
|
+
- **Two transport modes** — stdio (Claude Desktop, Cursor, VS Code, Windsurf, Antigravity) and WebSocket (`weavetab --ws --port 3000`)
|
|
50
|
+
- **Five RBAC roles** — `admin`, `operator`, `viewer`, `automation`, and `system`
|
|
51
|
+
- **Per-domain policies** — ring-fences sensitive banking, internal, and production surfaces
|
|
52
|
+
- **Blind Injection** — credentials resolved server-side from `secrets.json` and never exposed to the LLM
|
|
53
|
+
- **Extensible Plugin System** — auto-discovers and mounts custom MCP tools from `node_modules`
|
|
54
|
+
|
|
55
|
+
## Next Steps
|
|
56
|
+
|
|
57
|
+
- **[Quickstart](quickstart.md)** — install and run a first mission in 60 seconds
|
|
58
|
+
- **[Desktop & Electron Apps](../desktop-automation/electron-apps.md)** — configure and control desktop apps
|
|
59
|
+
- **[Autonomous CAPTCHA Solver](../captcha-stealth/captcha-solver.md)** — zero-API anti-bot solving
|
|
60
|
+
- **[MCP Tools Reference](../tools/tools.md)** — full reference for all 44 built-in automation tools
|
|
@@ -15,12 +15,13 @@ Run the interactive CLI configuration wizard:
|
|
|
15
15
|
weavetab config
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
The wizard walks through every option across
|
|
18
|
+
The wizard walks through every option across 6 interactive phases. Re-run it at any time to update your saved config.
|
|
19
19
|
|
|
20
20
|
## Wizard Phases
|
|
21
21
|
|
|
22
|
-
1. **Phase 1 — Essentials:** Browser path, RBAC role (`admin`, `
|
|
23
|
-
2. **Phase 2 — Advanced:** Browser engine selection,
|
|
24
|
-
3. **Phase 3 — Save Location:** Global (`~/.weavetab/config.json`)
|
|
25
|
-
4. **Phase 4 — MCP Auto-Config:** Auto-detects installed IDEs (Claude Desktop, Cursor, Windsurf
|
|
26
|
-
5. **Phase 5 —
|
|
22
|
+
1. **Phase 1 — Essentials:** Browser path, RBAC role (`admin`, `viewer`, `automation`), headless mode, dev mode, max tabs, actionability timeout, domain block/allow lists.
|
|
23
|
+
2. **Phase 2 — Advanced (optional):** Browser engine selection, timeouts and rate limits, telemetry opt-in, download/proxy directories, domain policy entries.
|
|
24
|
+
3. **Phase 3 — Save Location:** Global (`~/.weavetab/config.json`).
|
|
25
|
+
4. **Phase 4 — MCP Auto-Config:** Auto-detects installed IDEs (Claude Desktop, Cursor, Windsurf) and merges Weavetab into their MCP configuration.
|
|
26
|
+
5. **Phase 5 — Agent Skills:** Optionally installs `@weavetab/skills` for your agent framework.
|
|
27
|
+
6. **Phase 6 — Summary:** Displays full configuration validation report.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Site Profiles and Intelligent Memory"
|
|
3
|
+
description: "Persistent cross-session workflow memory, pattern compilation, and quirk bypass in ~/.weavetab-system/memory/sites/."
|
|
4
|
+
product: mcp
|
|
5
|
+
section: intelligence
|
|
6
|
+
icon: Brain
|
|
7
|
+
slug: site-profiles
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Site Profiles and Intelligent Memory Engine
|
|
11
|
+
|
|
12
|
+
Every browser automation session normally starts from zero context. The agent re-inspects DOM trees, re-triggers cookie banners, and re-discovers login fields.
|
|
13
|
+
|
|
14
|
+
Weavetab solves this with a **Two-Tier Persistent Memory System** that accumulates knowledge about domains and workflows across sessions.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Directory Hierarchy: System vs. User Space
|
|
19
|
+
|
|
20
|
+
| Directory | Purpose | Managed By |
|
|
21
|
+
| :--- | :--- | :--- |
|
|
22
|
+
| `~/.weavetab-system/memory/sites/` | **Persistent Site Profiles**: named workflow patterns, quirks, reliability scores | Weavetab Engine (autonomous) |
|
|
23
|
+
| `~/.weavetab-system/memory/` | **Selector Confidence Cache**: per-domain element selectors and strike counters | Weavetab Engine (autonomous) |
|
|
24
|
+
| `~/.weavetab-system/sessions/` | **Rolling Action Trails**: 50-step window for loop detection | Weavetab Engine (autonomous) |
|
|
25
|
+
| `~/.weavetab/` | **User Configuration**: `config.json`, `secrets.json`, `policy.json`, plugins | User / Developer (manual) |
|
|
26
|
+
|
|
27
|
+
> **Directory Law**: Machine-compiled memory profiles are strictly located in `~/.weavetab-system/memory/sites/`. User configuration in `~/.weavetab/` is never polluted by machine learning trails or dynamic decay counters.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Site Profile Schema
|
|
32
|
+
|
|
33
|
+
Profiles are stored as `<sanitized-hostname>.json` under `~/.weavetab-system/memory/sites/`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"origin": "https://github.com",
|
|
38
|
+
"framework": "react",
|
|
39
|
+
"shadowDom": false,
|
|
40
|
+
"captcha_frequency": "rare",
|
|
41
|
+
"quirks": {
|
|
42
|
+
"cookie_banner": {
|
|
43
|
+
"selector": "#cookie-consent",
|
|
44
|
+
"action": "click .accept-all",
|
|
45
|
+
"appears": "first_visit"
|
|
46
|
+
},
|
|
47
|
+
"rate_limit": {
|
|
48
|
+
"threshold": "60req/min",
|
|
49
|
+
"recovery": "wait 30s"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"patterns": {
|
|
53
|
+
"login_flow": {
|
|
54
|
+
"name": "login_flow",
|
|
55
|
+
"steps": [
|
|
56
|
+
{ "tool": "browser_navigate", "target": "https://github.com/login" },
|
|
57
|
+
{ "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
|
|
58
|
+
{ "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
|
|
59
|
+
{ "tool": "browser_click", "target": "[type=submit]" }
|
|
60
|
+
],
|
|
61
|
+
"success_indicator": "a[aria-label='Homepage']",
|
|
62
|
+
"entry": "/login",
|
|
63
|
+
"avg_duration_ms": 3200,
|
|
64
|
+
"reliability": 0.96,
|
|
65
|
+
"strikes": 0,
|
|
66
|
+
"last_verified": "2026-09-16T08:00:00.000Z",
|
|
67
|
+
"total_executions": 12,
|
|
68
|
+
"successful_executions": 12
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"visitCount": 15,
|
|
72
|
+
"updatedAt": "2026-09-16T08:00:00.000Z"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## The Pattern Compiler
|
|
79
|
+
|
|
80
|
+
When an agent executes an automation flow:
|
|
81
|
+
1. **Trail Capture**: Steps are tracked via the lightweight action trail.
|
|
82
|
+
2. **Selector Stabilization**: Volatile CSS hash classes (`[class*="hash-"]`), positional pseudos (`:nth-child`), and deep anonymous structural chains are filtered out. Only semantic selectors (`id`, `data-testid`, semantic attributes, roles) are persisted.
|
|
83
|
+
3. **Merge-on-Write**: Calling `browser_pattern_learn` updates existing patterns in place. Duplicate calls never create duplicate files or duplicate entries.
|
|
84
|
+
4. **Anti-Spam Guard**: If an incoming pattern is identical to stored disk state, the disk write is skipped entirely.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Reliability Scoring and 3-Strike Degradation
|
|
89
|
+
|
|
90
|
+
Each pattern tracks a reliability score (`0.0` to `1.0`) computed via Exponentially Weighted Moving Average (EWMA with $\alpha = 0.15$):
|
|
91
|
+
|
|
92
|
+
$$\text{Reliability}_{t} = 0.85 \times \text{Reliability}_{t-1} + 0.15 \times (\text{Success} ? 1 : 0)$$
|
|
93
|
+
|
|
94
|
+
### Decision Thresholds
|
|
95
|
+
|
|
96
|
+
- **Fast-Path ($\ge 0.80$)**: Replay stored steps directly via `browser_burst` — skips exploratory DOM navigation entirely.
|
|
97
|
+
- **Cautious Replay ($0.50 - 0.79$)**: Replay steps, but verify `success_indicator` after critical steps.
|
|
98
|
+
- **Re-Learn ($< 0.50$ or $\ge 3$ consecutive strikes)**: Pattern is flagged `[RE-LEARN NEEDED]`. The agent falls back to fresh DOM exploration, then calls `browser_pattern_learn` to teach the updated steps.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## MCP Tools
|
|
103
|
+
|
|
104
|
+
### `browser_pattern_learn`
|
|
105
|
+
All site memory operations use a single tool. Use `action: "get"` to read a site profile, `action: "learn"` to register a workflow, `action: "record_execution"` to update reliability scores, and `action: "record_quirk"` to store site quirks:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{ "action": "get", "origin": "https://github.com" }
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"origin": "https://github.com",
|
|
114
|
+
"action": "learn",
|
|
115
|
+
"name": "login_flow",
|
|
116
|
+
"steps": [
|
|
117
|
+
{ "tool": "browser_click", "target": ".btn-login" },
|
|
118
|
+
{ "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" }
|
|
119
|
+
],
|
|
120
|
+
"success_indicator": "a[aria-label='Homepage']"
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## SDK Plugin Integration (`ctx.memory`)
|
|
127
|
+
|
|
128
|
+
Plugin authors can interact with persistent site memory directly via the SDK:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { definePlugin } from "@weavetab/sdk";
|
|
132
|
+
|
|
133
|
+
export default definePlugin({
|
|
134
|
+
name: "custom-site-automator",
|
|
135
|
+
async onLoad(ctx) {
|
|
136
|
+
// Read current profile
|
|
137
|
+
const profile = await ctx.memory?.getSiteProfile("https://github.com");
|
|
138
|
+
|
|
139
|
+
// Check reliability
|
|
140
|
+
const reliability = await ctx.memory?.getReliability("https://github.com", "login_flow");
|
|
141
|
+
if (reliability && reliability >= 0.8) {
|
|
142
|
+
ctx.logger.info("Fast-path ready for login_flow");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Teach a new pattern
|
|
146
|
+
await ctx.memory?.learnPattern("https://github.com", "quick_search", {
|
|
147
|
+
steps: [{ tool: "browser_fill", target: "input.header-search-input", value: "test" }]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
```
|