@weavetab/skills 1.0.1 → 2.5.0-beta.4
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/README.md +108 -50
- package/ROUTER.md +43 -0
- package/bin/cli.js +232 -132
- package/browser/dom-strategy.md +119 -0
- package/browser/form-automation.md +87 -0
- package/browser/interaction-pipeline.md +216 -0
- package/browser/tab-and-window.md +136 -0
- package/desktop/desktop-targeting.md +85 -0
- package/desktop/electron-discovery.md +115 -0
- package/developer/github-forensics.md +74 -0
- package/dist/bundled/weavetab-all.md +1905 -0
- package/dist/bundled/weavetab-browser.md +501 -0
- package/dist/bundled/weavetab-desktop.md +176 -0
- package/dist/bundled/weavetab-developer.md +67 -0
- package/dist/bundled/weavetab-documents.md +142 -0
- package/dist/bundled/weavetab-memory.md +359 -0
- package/dist/bundled/weavetab-network-and-perf.md +223 -0
- package/dist/bundled/weavetab-plugins.md +78 -0
- package/dist/bundled/weavetab-resilience.md +216 -0
- package/dist/bundled/weavetab-security.md +87 -0
- package/dist/granular/browser_dom-strategy.md +119 -0
- package/dist/granular/browser_form-automation.md +87 -0
- package/dist/granular/browser_interaction-pipeline.md +216 -0
- package/dist/granular/browser_tab-and-window.md +136 -0
- package/dist/granular/desktop_desktop-targeting.md +85 -0
- package/dist/granular/desktop_electron-discovery.md +115 -0
- package/dist/granular/developer_github-forensics.md +74 -0
- package/dist/granular/documents_canvas-and-visual-capture.md +103 -0
- package/dist/granular/documents_office-document-ingestion.md +63 -0
- package/dist/granular/memory_selector-memory-system.md +127 -0
- package/dist/granular/memory_session-trail.md +95 -0
- package/dist/granular/memory_site-learning.md +180 -0
- package/dist/granular/network-and-perf_device-and-environment.md +87 -0
- package/dist/granular/network-and-perf_network-intercept-and-mock.md +84 -0
- package/dist/granular/network-and-perf_performance-and-vitals.md +84 -0
- package/dist/granular/plugins_hooks-and-overrides.md +36 -0
- package/dist/granular/plugins_plugin-runtime.md +60 -0
- package/dist/granular/resilience_loop-breaker.md +67 -0
- package/dist/granular/resilience_session-time-travel.md +131 -0
- package/dist/granular/resilience_stale-ref-recovery.md +53 -0
- package/dist/granular/security_rbac-and-policies.md +47 -0
- package/dist/granular/security_secret-containment-protocol.md +59 -0
- package/documents/canvas-and-visual-capture.md +103 -0
- package/documents/office-document-ingestion.md +63 -0
- package/evals/evaluator.js +146 -0
- package/evals/scenarios.json +238 -0
- package/memory/selector-memory-system.md +127 -0
- package/memory/session-trail.md +95 -0
- package/memory/site-learning.md +180 -0
- package/network-and-perf/device-and-environment.md +87 -0
- package/network-and-perf/network-intercept-and-mock.md +84 -0
- package/network-and-perf/performance-and-vitals.md +84 -0
- package/package.json +73 -42
- package/plugins/hooks-and-overrides.md +36 -0
- package/plugins/plugin-runtime.md +60 -0
- package/resilience/loop-breaker.md +67 -0
- package/resilience/session-time-travel.md +131 -0
- package/resilience/stale-ref-recovery.md +53 -0
- package/security/rbac-and-policies.md +47 -0
- package/security/secret-containment-protocol.md +59 -0
- package/skills.json +431 -308
- package/src/api.js +239 -128
- package/.github/FUNDING.yml +0 -2
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
- package/.github/ISSUE_TEMPLATE/skill_request.md +0 -24
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -23
- package/CONTRIBUTING.md +0 -34
- package/SECURITY.md +0 -26
- package/advanced/README.md +0 -2
- package/automation/README.md +0 -2
- package/general/captcha-evasion.md +0 -13
- package/general/context-awareness.md +0 -13
- package/general/cookie-consent.md +0 -13
- package/general/data-extraction.md +0 -13
- package/general/dynamic-interaction.md +0 -13
- package/general/error-recovery.md +0 -13
- package/general/file-upload.md +0 -13
- package/general/form-filling.md +0 -16
- package/general/guardrails.md +0 -13
- package/general/iframe-handling.md +0 -13
- package/general/infinite-scroll.md +0 -13
- package/general/login-flow.md +0 -16
- package/general/multi-tab-management.md +0 -13
- package/general/spa-navigation.md +0 -13
- package/general/table-scraping.md +0 -13
- package/scripts/build.js +0 -48
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: site-learning
|
|
3
|
+
domain: memory
|
|
4
|
+
triggers:
|
|
5
|
+
- "site learning"
|
|
6
|
+
- "workflow pattern"
|
|
7
|
+
- "learn site"
|
|
8
|
+
- "remember workflow"
|
|
9
|
+
- "site memory"
|
|
10
|
+
- "cookie banner quirk"
|
|
11
|
+
- "fast path replay"
|
|
12
|
+
- "pattern reliability"
|
|
13
|
+
- "pattern compiler"
|
|
14
|
+
tools:
|
|
15
|
+
- "browser_pattern_learn"
|
|
16
|
+
- "browser_burst"
|
|
17
|
+
weavetab: ">=2.5.0-beta.4"
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Site Learning — Autonomous Workflow Memory
|
|
21
|
+
|
|
22
|
+
Weavetab's Site Learning engine accumulates cross-session knowledge about websites and multi-step automation flows. Each site gets one profile file at ~/.weavetab-system/memory/sites/<origin>.json — never duplicated, always merged on write.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 1. Session Start Protocol
|
|
27
|
+
|
|
28
|
+
On every session visiting a known or potentially-known site, run:
|
|
29
|
+
|
|
30
|
+
`json
|
|
31
|
+
{ "tool": "browser_pattern_learn", "action": "get", "origin": "https://github.com" }
|
|
32
|
+
`
|
|
33
|
+
|
|
34
|
+
Parse the response:
|
|
35
|
+
- known: false → site is new, proceed exploratorily, teach after completion
|
|
36
|
+
- known_patterns → list of named workflows with reliability scores
|
|
37
|
+
- quirks → auto-handle any listed quirks (cookie banners, rate limits) before main task
|
|
38
|
+
- ramework → adjust interaction strategy accordingly (React, Vue, etc.)
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 2. Fast-Path vs. Exploratory Decision
|
|
43
|
+
|
|
44
|
+
Use the _hint field or individual
|
|
45
|
+
|
|
46
|
+
| Reliability | Strikes | Strategy |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| ≥ 0.8, strikes = 0 | ✓ | **Fast path**: replay steps via rowser_burst directly |
|
|
49
|
+
| 0.5–0.79 | 0–1 | **Cautious path**: replay steps, verify success_indicator after each critical step |
|
|
50
|
+
| < 0.5 | any | **Re-explore**: navigate manually, collect correct steps, then teach |
|
|
51
|
+
| any | ≥ 3 | **Re-learn**: ignore cached pattern, re-explore, then call rowser_pattern_learn with updated steps |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 3. Quirk Auto-Handling
|
|
56
|
+
|
|
57
|
+
If a profile has known quirks, resolve them immediately after navigation before executing your main task:
|
|
58
|
+
|
|
59
|
+
`
|
|
60
|
+
Profile quirks: { cookie_banner: { selector: "#cookie-consent", action: "click .accept-all", appears: "first_visit" } }
|
|
61
|
+
`
|
|
62
|
+
|
|
63
|
+
Execute the action before doing anything else. Never spend reasoning turns on a known dismissible popup.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 4. Teaching a Workflow Pattern
|
|
68
|
+
|
|
69
|
+
After successfully completing a multi-step flow for the first time (or after re-learning):
|
|
70
|
+
|
|
71
|
+
`json
|
|
72
|
+
{
|
|
73
|
+
"tool": "browser_pattern_learn",
|
|
74
|
+
"origin": "https://github.com",
|
|
75
|
+
"action": "learn",
|
|
76
|
+
"name": "login_flow",
|
|
77
|
+
"steps": [
|
|
78
|
+
{ "tool": "browser_navigate", "target": "https://github.com/login" },
|
|
79
|
+
{ "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
|
|
80
|
+
{ "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
|
|
81
|
+
{ "tool": "browser_click", "target": "[type=submit]" }
|
|
82
|
+
],
|
|
83
|
+
"success_indicator": "a[aria-label='Homepage']",
|
|
84
|
+
"entry": "/login"
|
|
85
|
+
}
|
|
86
|
+
`
|
|
87
|
+
|
|
88
|
+
**Pattern Naming Rules**:
|
|
89
|
+
- Use snake_case
|
|
90
|
+
- Be descriptive: login_flow, pr_review, csv_export, checkout_flow
|
|
91
|
+
- Duplicate name on same origin = **update** (merge), never creates a second pattern
|
|
92
|
+
|
|
93
|
+
**Step Quality Rules**:
|
|
94
|
+
- Use semantic selectors: data-testid, id, ria-label, readable text-based selectors
|
|
95
|
+
- Avoid: .hash_abc123, div:nth-child(4), deep anonymous chains like div > div > div > span
|
|
96
|
+
(the engine automatically drops volatile selectors during compilation)
|
|
97
|
+
- For sensitive inputs, record the step with a placeholder like {{username}} — never hardcode credentials
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 5. Reliability Upkeep After Replay
|
|
102
|
+
|
|
103
|
+
Every time you replay a pattern, report the outcome:
|
|
104
|
+
|
|
105
|
+
`json
|
|
106
|
+
{
|
|
107
|
+
"tool": "browser_pattern_learn",
|
|
108
|
+
"origin": "https://github.com",
|
|
109
|
+
"action": "record_execution",
|
|
110
|
+
"name": "login_flow",
|
|
111
|
+
"success": true,
|
|
112
|
+
"duration_ms": 3100
|
|
113
|
+
}
|
|
114
|
+
`
|
|
115
|
+
|
|
116
|
+
The engine uses EWMA (α=0.15) to update the reliability score:
|
|
117
|
+
- Success run → reliability climbs toward 1.0 slowly
|
|
118
|
+
- Failure run → reliability drops; 3 consecutive failures trigger [RE-LEARN NEEDED] flag
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 6. Recording a New Quirk
|
|
123
|
+
|
|
124
|
+
When you encounter a cookie consent modal, popup, or rate limit for the first time:
|
|
125
|
+
|
|
126
|
+
`json
|
|
127
|
+
{
|
|
128
|
+
"tool": "browser_pattern_learn",
|
|
129
|
+
"origin": "https://example.com",
|
|
130
|
+
"action": "record_quirk",
|
|
131
|
+
"quirk_key": "cookie_banner",
|
|
132
|
+
"quirk_data": {
|
|
133
|
+
"selector": "#cookie-consent",
|
|
134
|
+
"action": "click .accept-all",
|
|
135
|
+
"appears": "first_visit"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
`
|
|
139
|
+
|
|
140
|
+
Supported quirk_key values: cookie_banner,
|
|
141
|
+
|
|
142
|
+
For rate limits:
|
|
143
|
+
`json
|
|
144
|
+
{
|
|
145
|
+
"quirk_key": "rate_limit",
|
|
146
|
+
"quirk_data": { "threshold": "60req/min", "recovery": "wait 30s" }
|
|
147
|
+
}
|
|
148
|
+
`
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 7. Anti-Patterns to Avoid
|
|
153
|
+
|
|
154
|
+
- **Never create per-session pattern names** like login_2026_09_16 — one name per workflow per origin, forever updated in place.
|
|
155
|
+
- **Never call rowser_pattern_learn in a loop** — one call per workflow completion. The write is idempotent (skips disk write if nothing changed).
|
|
156
|
+
- **Never store credentials in steps** — use placeholders or rowser_type_secret in actual execution.
|
|
157
|
+
- **Never write to ~/.weavetab/** — all memory belongs in ~/.weavetab-system/memory/sites/.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 8. Full Session Example: GitHub PR Review
|
|
162
|
+
|
|
163
|
+
`
|
|
164
|
+
1. browser_pattern_learn { action: "get", origin: "https://github.com" }
|
|
165
|
+
→ patterns: { pr_review: { reliability: 0.95, steps: 3 } }
|
|
166
|
+
→ quirks: {} (none)
|
|
167
|
+
|
|
168
|
+
2. Since reliability=0.95 (≥ 0.8): use fast path
|
|
169
|
+
browser_burst with the 3 stored steps
|
|
170
|
+
|
|
171
|
+
3. After completion:
|
|
172
|
+
browser_pattern_learn {
|
|
173
|
+
action: "record_execution",
|
|
174
|
+
name: "pr_review",
|
|
175
|
+
success: true,
|
|
176
|
+
duration_ms: 2800
|
|
177
|
+
}
|
|
178
|
+
`
|
|
179
|
+
|
|
180
|
+
Total agent turns for a known site: **3 tool calls** vs. potentially 12+ with full exploration.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: device-and-environment
|
|
3
|
+
domain: network-and-perf
|
|
4
|
+
triggers:
|
|
5
|
+
- "emulate device"
|
|
6
|
+
- "mobile view"
|
|
7
|
+
- "throttle network"
|
|
8
|
+
- "geolocation override"
|
|
9
|
+
- "user agent"
|
|
10
|
+
- "responsive testing"
|
|
11
|
+
tools:
|
|
12
|
+
- "browser_emulate"
|
|
13
|
+
weavetab: ">=2.5.0-beta.4"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Device Emulation & Environment Simulation
|
|
17
|
+
|
|
18
|
+
Auditing mobile responsive layouts, testing geographic restrictions, and simulating degraded network conditions can all be accomplished with `browser_emulate`.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. Device Presets & Viewport Simulation
|
|
23
|
+
|
|
24
|
+
Switch from desktop to realistic mobile hardware profiles:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"device": "iPhone 15 Pro",
|
|
29
|
+
"orientation": "portrait"
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or configure custom screen geometries:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"viewport": {
|
|
38
|
+
"width": 393,
|
|
39
|
+
"height": 852,
|
|
40
|
+
"deviceScaleFactor": 3,
|
|
41
|
+
"isMobile": true,
|
|
42
|
+
"hasTouch": true
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 2. Network Throttling Simulation
|
|
50
|
+
|
|
51
|
+
Verify how web applications degrade under poor connectivity:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"network": {
|
|
56
|
+
"offline": false,
|
|
57
|
+
"downloadThroughput": 1024 * 500, // 500 kb/s (Slow 3G)
|
|
58
|
+
"uploadThroughput": 1024 * 250,
|
|
59
|
+
"latency": 400 // ms
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 3. Geolocation & Timezone Overrides
|
|
67
|
+
|
|
68
|
+
Bypass localized IP redirects or verify localized content rendering:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"geolocation": {
|
|
73
|
+
"latitude": 37.7749,
|
|
74
|
+
"longitude": -122.4194,
|
|
75
|
+
"accuracy": 100
|
|
76
|
+
},
|
|
77
|
+
"timezoneId": "America/Los_Angeles",
|
|
78
|
+
"locale": "en-US"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
To reset all overrides back to default host system parameters:
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"reset": true
|
|
86
|
+
}
|
|
87
|
+
```
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: network-intercept-and-mock
|
|
3
|
+
domain: network-and-perf
|
|
4
|
+
triggers:
|
|
5
|
+
- "mock api"
|
|
6
|
+
- "intercept network"
|
|
7
|
+
- "stub request"
|
|
8
|
+
- "inspect tls"
|
|
9
|
+
- "ssl certificate"
|
|
10
|
+
- "network waterfall"
|
|
11
|
+
tools:
|
|
12
|
+
- "browser_network_intercept"
|
|
13
|
+
weavetab: ">=2.5.0-beta.4"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Network Interception, Mocking & TLS Forensics
|
|
17
|
+
|
|
18
|
+
Autonomous testing and debugging often require simulating backend error states (e.g. 500 Internal Server Error, 429 Rate Limit), stubbing third-party analytics, or verifying TLS/SSL certificates.
|
|
19
|
+
|
|
20
|
+
`browser_network_intercept` provides fine-grained CDP request and response modification.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 1. Mocking API Responses
|
|
25
|
+
|
|
26
|
+
Intercept outgoing HTTP requests matching a URL pattern and return custom mock data:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"pattern": "*/api/v1/user/profile",
|
|
31
|
+
"response": {
|
|
32
|
+
"status": 200,
|
|
33
|
+
"headers": {
|
|
34
|
+
"Content-Type": "application/json"
|
|
35
|
+
},
|
|
36
|
+
"body": "{\"id\": \"usr_test\", \"role\": \"admin\", \"credits\": 9999}"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 2. Blocking Unnecessary Traffic & Trackers
|
|
44
|
+
|
|
45
|
+
Accelerate page loads and eliminate token bloat by aborting non-essential requests:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"pattern": "*google-analytics.com*",
|
|
50
|
+
"action": "abort",
|
|
51
|
+
"errorReason": "BlockedByClient"
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 3. TLS / SSL Forensics & Timing Waterfalls
|
|
58
|
+
|
|
59
|
+
Extract cryptographic handshake metadata, cipher suites, expiration dates, and microsecond network waterfalls (DNS lookup, TCP connect, SSL handshake, TTFB):
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"action": "auditTls",
|
|
64
|
+
"url": "https://weavetab.pages.dev"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Response Example:
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"security": {
|
|
72
|
+
"protocol": "TLS 1.3",
|
|
73
|
+
"cipher": "AES_128_GCM",
|
|
74
|
+
"issuer": "Let's Encrypt",
|
|
75
|
+
"validTo": "2026-11-15T00:00:00.000Z"
|
|
76
|
+
},
|
|
77
|
+
"waterfall": {
|
|
78
|
+
"dnsMs": 1.4,
|
|
79
|
+
"tcpMs": 3.2,
|
|
80
|
+
"sslMs": 4.1,
|
|
81
|
+
"ttfbMs": 12.8
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: performance-and-vitals
|
|
3
|
+
domain: network-and-perf
|
|
4
|
+
triggers:
|
|
5
|
+
- "measure performance"
|
|
6
|
+
- "core web vitals"
|
|
7
|
+
- "lcp"
|
|
8
|
+
- "cls"
|
|
9
|
+
- "fcp"
|
|
10
|
+
- "wait condition"
|
|
11
|
+
- "page slow"
|
|
12
|
+
tools:
|
|
13
|
+
- "browser_performance"
|
|
14
|
+
- "browser_wait"
|
|
15
|
+
weavetab: ">=2.5.0-beta.4"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Performance Forensics & Core Web Vitals
|
|
19
|
+
|
|
20
|
+
Optimizing agent execution and auditing client performance requires objective metrics rather than arbitrary sleep timers.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 1. Core Web Vitals Auditing (`browser_performance`)
|
|
25
|
+
|
|
26
|
+
Retrieve Google Core Web Vitals, memory consumption, and frame rendering bottlenecks directly from the Chromium engine:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"metrics": ["vitals", "memory", "navigationTiming"]
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Response Example:
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"vitals": {
|
|
38
|
+
"fcp": 320,
|
|
39
|
+
"lcp": 780,
|
|
40
|
+
"cls": 0.012,
|
|
41
|
+
"fid": 8,
|
|
42
|
+
"inp": 45
|
|
43
|
+
},
|
|
44
|
+
"memory": {
|
|
45
|
+
"jsHeapUsedSizeMb": 42.1,
|
|
46
|
+
"jsHeapTotalSizeMb": 68.4
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 2. Deterministic Synchronization (`browser_wait`)
|
|
54
|
+
|
|
55
|
+
> [!WARNING]
|
|
56
|
+
> NEVER call arbitrary fixed sleep timers (e.g. `sleep 5000`). Fixed sleeps waste user time and still fail when network latency spikes.
|
|
57
|
+
|
|
58
|
+
Always synchronize with deterministic browser conditions:
|
|
59
|
+
|
|
60
|
+
### Wait for Network Idle:
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"condition": "network_idle",
|
|
64
|
+
"timeout": 10000
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Wait for DOM Mutation Stability:
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"condition": "dom_stable",
|
|
72
|
+
"duration": 500,
|
|
73
|
+
"timeout": 10000
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Wait for a Specific Element to Appear:
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"condition": "element_visible",
|
|
81
|
+
"selector": "[data-testid=\"checkout-complete\"]",
|
|
82
|
+
"timeout": 15000
|
|
83
|
+
}
|
|
84
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hooks-and-overrides
|
|
3
|
+
domain: plugins
|
|
4
|
+
triggers:
|
|
5
|
+
- "plugin hooks"
|
|
6
|
+
- "before tool call"
|
|
7
|
+
- "after tool call"
|
|
8
|
+
- "telemetry interception"
|
|
9
|
+
- "sdk hooks"
|
|
10
|
+
tools:
|
|
11
|
+
- "list_plugins"
|
|
12
|
+
weavetab: ">=2.5.0-beta.4"
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Plugin Hooks & Lifecycle Overrides
|
|
16
|
+
|
|
17
|
+
Plugins built with `@weavetab/sdk` register lifecycle hooks that run before and after tool executions. Understanding these hooks helps agents interpret metadata and custom tool responses.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 1. Supported Plugin Hooks
|
|
22
|
+
|
|
23
|
+
1. **`beforeToolCall(toolName, args)`**:
|
|
24
|
+
- Validates arguments against custom enterprise schemas.
|
|
25
|
+
- Injects tenant IDs, authentication headers, or proxy routing.
|
|
26
|
+
2. **`afterToolCall(toolName, result, durationMs)`**:
|
|
27
|
+
- Emits OpenTelemetry metrics and timing waterfalls to external APM platforms.
|
|
28
|
+
- Enriches return objects with contextual metadata.
|
|
29
|
+
3. **`onNavigate(url, targetId)`**:
|
|
30
|
+
- Triggers automated cookie injection or session setup upon page navigation.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Agent Operational Awareness
|
|
35
|
+
|
|
36
|
+
When plugins are active, tool return payloads may include an optional `_pluginMetadata` object containing trace IDs, custom metrics, or security audit timestamps. Agents should treat this object as informational telemetry.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: plugin-runtime
|
|
3
|
+
domain: plugins
|
|
4
|
+
triggers:
|
|
5
|
+
- "list plugins"
|
|
6
|
+
- "load plugin"
|
|
7
|
+
- "install plugin"
|
|
8
|
+
- "weavetab plugin"
|
|
9
|
+
- "extend mcp"
|
|
10
|
+
tools:
|
|
11
|
+
- "list_plugins"
|
|
12
|
+
- "load_plugin"
|
|
13
|
+
weavetab: ">=2.5.0-beta.4"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Plugin Runtime: Dynamic Extension Loading
|
|
17
|
+
|
|
18
|
+
Weavetab features an extensible plugin architecture powered by `@weavetab/sdk`. Agents can query loaded extensions and dynamically load community or official plugins into the live MCP runtime without restarting the server.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. Inspecting Active Plugins (`list_plugins`)
|
|
23
|
+
|
|
24
|
+
Discover all installed plugins, their versions, and the tools or hooks they expose:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Response Example:
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"plugins": [
|
|
34
|
+
{
|
|
35
|
+
"name": "@weavetab/plugin-recaptcha-solver",
|
|
36
|
+
"version": "1.2.0",
|
|
37
|
+
"status": "active",
|
|
38
|
+
"toolsProvided": ["captcha_solve_token"],
|
|
39
|
+
"hooks": ["beforeToolCall"]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 2. Dynamic Runtime Loading (`load_plugin`)
|
|
48
|
+
|
|
49
|
+
Load a verified plugin package into the active runtime session:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"name": "@weavetab/plugin-datadog-tracer"
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Plugin Verification Guarantees:
|
|
58
|
+
- Plugins must implement the `@weavetab/sdk` standard interface.
|
|
59
|
+
- Loaded tools become immediately callable by the agent in subsequent turns.
|
|
60
|
+
- If an agent is in the `viewer` RBAC tier, `load_plugin` is rejected with `PERMISSION_DENIED`.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: loop-breaker
|
|
3
|
+
domain: resilience
|
|
4
|
+
triggers:
|
|
5
|
+
- "loop detected"
|
|
6
|
+
- "stuck in loop"
|
|
7
|
+
- "reset loop counter"
|
|
8
|
+
- "captcha detected"
|
|
9
|
+
- "hcaptcha"
|
|
10
|
+
- "recaptcha"
|
|
11
|
+
tools:
|
|
12
|
+
- "browser_map"
|
|
13
|
+
- "browser_console"
|
|
14
|
+
- "browser_captcha"
|
|
15
|
+
weavetab: ">=2.5.0-beta.4"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Loop Breaker & CAPTCHA Escalation Protocol
|
|
19
|
+
|
|
20
|
+
Agents can get trapped in repetitive click loops when a button does not advance the state (e.g. failing silent validation, unhandled reCAPTCHA challenges, or modals swallowing events). Weavetab actively monitors repetitive patterns and provides circuit breakers.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 1. Loop Detection & Strike Reset (`browser_map`)
|
|
25
|
+
|
|
26
|
+
Weavetab tracks the sequence of identical or near-identical tool invocations. If an agent calls `browser_click` or `browser_type` on the same selector or ref repeatedly without URL or major DOM mutations, the server raises a `STUCK_LOOP_WARNING`.
|
|
27
|
+
|
|
28
|
+
### How to Break the Loop:
|
|
29
|
+
1. **Analyze Why the Action Failed**: Check `browser_console` for JavaScript errors:
|
|
30
|
+
```json
|
|
31
|
+
{ "action": "read" }
|
|
32
|
+
```
|
|
33
|
+
Or use `browser_map` to see if a validation banner or unhandled modal appeared.
|
|
34
|
+
2. **Reset the Circuit Breaker**:
|
|
35
|
+
- Re-map with `force: true` to bypass the map skip guard, refresh the DOM view, and automatically clear loop strikes:
|
|
36
|
+
```json
|
|
37
|
+
{ "force": true }
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 2. CAPTCHA Handling Protocol (`browser_captcha`)
|
|
43
|
+
|
|
44
|
+
When an automated flow is blocked by Cloudflare Turnstile, Google reCAPTCHA, or hCaptcha, do NOT repeatedly click random coordinates.
|
|
45
|
+
|
|
46
|
+
Invoke `browser_captcha` to analyze and manage the challenge:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"action": "detect"
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Response Example:
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"detected": true,
|
|
58
|
+
"type": "turnstile",
|
|
59
|
+
"provider": "cloudflare",
|
|
60
|
+
"interactive": true,
|
|
61
|
+
"ref": "w:99"
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Action Strategy:
|
|
66
|
+
1. If the challenge is interactive and requires human intervention (e.g. image classification), inform the user cleanly or request human bypass.
|
|
67
|
+
2. If the challenge is a simple checkbox Turnstile widget, pass `"action": "solve"` or click the detected widget ref with `browser_click`.
|