@weavetab/skills 2.5.0 → 2.5.2
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/LICENSE +1 -1
- package/README.md +108 -108
- package/ROUTER.md +43 -43
- package/bin/cli.js +232 -232
- package/browser/dom-strategy.md +121 -119
- package/browser/form-automation.md +84 -87
- package/browser/interaction-pipeline.md +242 -216
- package/browser/tab-and-window.md +136 -136
- package/desktop/desktop-targeting.md +85 -85
- package/desktop/electron-discovery.md +115 -115
- package/developer/github-forensics.md +89 -74
- package/dist/bundled/weavetab-all.md +1885 -1709
- package/dist/bundled/weavetab-browser.md +526 -501
- package/dist/bundled/weavetab-desktop.md +176 -176
- package/dist/bundled/weavetab-developer.md +84 -67
- package/dist/bundled/weavetab-documents.md +184 -142
- package/dist/bundled/weavetab-memory.md +259 -233
- package/dist/bundled/weavetab-network-and-perf.md +250 -223
- package/dist/bundled/weavetab-plugins.md +88 -83
- package/dist/bundled/weavetab-resilience.md +244 -216
- package/dist/bundled/weavetab-security.md +93 -87
- package/dist/granular/browser_dom-strategy.md +121 -119
- package/dist/granular/browser_form-automation.md +84 -87
- package/dist/granular/browser_interaction-pipeline.md +242 -216
- package/dist/granular/browser_tab-and-window.md +136 -136
- package/dist/granular/desktop_desktop-targeting.md +85 -85
- package/dist/granular/desktop_electron-discovery.md +115 -115
- package/dist/granular/developer_github-forensics.md +89 -74
- package/dist/granular/documents_canvas-and-visual-capture.md +117 -103
- package/dist/granular/documents_office-document-ingestion.md +91 -63
- package/dist/granular/memory_selector-memory-system.md +127 -127
- package/dist/granular/memory_session-trail.md +111 -95
- package/dist/granular/memory_site-learning.md +62 -53
- package/dist/granular/network-and-perf_device-and-environment.md +100 -87
- package/dist/granular/network-and-perf_network-intercept-and-mock.md +97 -84
- package/dist/granular/network-and-perf_performance-and-vitals.md +86 -84
- package/dist/granular/plugins_hooks-and-overrides.md +40 -35
- package/dist/granular/plugins_plugin-runtime.md +63 -63
- package/dist/granular/resilience_loop-breaker.md +72 -67
- package/dist/granular/resilience_session-time-travel.md +146 -131
- package/dist/granular/resilience_stale-ref-recovery.md +61 -53
- package/dist/granular/security_rbac-and-policies.md +50 -47
- package/dist/granular/security_secret-containment-protocol.md +62 -59
- package/documents/canvas-and-visual-capture.md +117 -103
- package/documents/office-document-ingestion.md +91 -63
- package/evals/evaluator.js +146 -146
- package/evals/scenarios.json +239 -239
- package/memory/selector-memory-system.md +127 -127
- package/memory/session-trail.md +111 -95
- package/memory/site-learning.md +61 -52
- package/network-and-perf/device-and-environment.md +100 -87
- package/network-and-perf/network-intercept-and-mock.md +97 -84
- package/network-and-perf/performance-and-vitals.md +86 -84
- package/package.json +74 -73
- package/plugins/hooks-and-overrides.md +40 -35
- package/plugins/plugin-runtime.md +63 -63
- package/resilience/loop-breaker.md +72 -67
- package/resilience/session-time-travel.md +146 -131
- package/resilience/stale-ref-recovery.md +61 -53
- package/security/rbac-and-policies.md +50 -47
- package/security/secret-containment-protocol.md +62 -59
- package/skills.json +425 -426
- package/src/api.js +239 -239
|
@@ -1,84 +1,86 @@
|
|
|
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
|
|
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", "
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Response Example:
|
|
35
|
-
```json
|
|
36
|
-
{
|
|
37
|
-
"vitals": {
|
|
38
|
-
"fcp": 320,
|
|
39
|
-
"lcp": 780,
|
|
40
|
-
"cls": 0.012,
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
},
|
|
44
|
-
"memory": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
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"
|
|
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", "navigation"]
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Response Example:
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"vitals": {
|
|
38
|
+
"fcp": 320,
|
|
39
|
+
"lcp": 780,
|
|
40
|
+
"cls": 0.012,
|
|
41
|
+
"inp": 45,
|
|
42
|
+
"ttfb": 12
|
|
43
|
+
},
|
|
44
|
+
"memory": {
|
|
45
|
+
"usedJSHeapSize": 44154880,
|
|
46
|
+
"totalJSHeapSize": 71729152,
|
|
47
|
+
"jsHeapSizeLimit": 4294705152
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Valid `metrics` sections: `"vitals"`, `"memory"`, `"navigation"`, `"resources"`, `"raw"`. Omit `metrics` to return all sections. Heap sizes are in **bytes**. The `"resources"` section populates `slowest_resources` (top 10 by duration).
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 2. Deterministic Synchronization (`browser_wait`)
|
|
57
|
+
|
|
58
|
+
> [!WARNING]
|
|
59
|
+
> NEVER call arbitrary fixed sleep timers (e.g. `sleep 5000`). Fixed sleeps waste user time and still fail when network latency spikes.
|
|
60
|
+
|
|
61
|
+
Always synchronize with deterministic browser conditions:
|
|
62
|
+
|
|
63
|
+
### Wait for Network Idle:
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"for": "network",
|
|
67
|
+
"timeout": 10000
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Wait for DOM Mutation Stability:
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"for": "stable",
|
|
75
|
+
"timeout": 10000
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Wait for a Specific Element to Appear:
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"for": "element",
|
|
83
|
+
"value": "[data-testid=\"checkout-complete\"]",
|
|
84
|
+
"timeout": 15000
|
|
85
|
+
}
|
|
86
|
+
```
|
|
@@ -1,35 +1,40 @@
|
|
|
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
|
-
weavetab: ">=2.5.0
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
# Plugin Hooks & Lifecycle Overrides
|
|
15
|
-
|
|
16
|
-
Plugins built with `@weavetab/sdk` register lifecycle hooks that run before and after tool executions. Understanding these hooks helps agents interpret
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 1. Supported Plugin Hooks
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
weavetab: ">=2.5.0"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Plugin Hooks & Lifecycle Overrides
|
|
15
|
+
|
|
16
|
+
Plugins built with `@weavetab/sdk` register lifecycle hooks that run before and after tool executions. Understanding these hooks helps agents interpret custom tool behavior and blocked actions.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. Supported Plugin Hooks
|
|
21
|
+
|
|
22
|
+
The `PluginHooks` interface exposes three primary interceptors (with backwards-compatible aliases):
|
|
23
|
+
|
|
24
|
+
1. **`onBeforeAction(handler)`** — *alias:* `beforeToolCall`
|
|
25
|
+
- `handler(tool, args, session)` runs **before** any tool executes.
|
|
26
|
+
- It may return a modified `args` object (replacing the arguments) or `{ __blocked: true, reason }` to abort the call.
|
|
27
|
+
- Typical uses: argument validation, tenant/header injection, proxy routing.
|
|
28
|
+
2. **`onAfterAction(handler)`** — *alias:* `afterToolCall`
|
|
29
|
+
- `handler(tool, result, session, args)` runs **after** a tool completes.
|
|
30
|
+
- Its return value replaces the tool result — used for telemetry, timing, or enriching output.
|
|
31
|
+
3. **`onDOMMutation(handler)`** — *alias:* `onPageNavigate`
|
|
32
|
+
- `handler(delta, session)` observes real-time DOM mutation / action deltas (added, removed, and changed elements, `significantChange`, `stable_count`).
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 2. Agent Operational Awareness
|
|
37
|
+
|
|
38
|
+
- A blocked action surfaces as a normal tool error (the server turns `__blocked` into an error result). If a plugin blocks a tool you expected to succeed, do not retry it blindly — report the block reason and pick another approach.
|
|
39
|
+
- An `onAfterAction` handler can rewrite a tool's result. Treat the returned payload as authoritative, not a fixed schema.
|
|
40
|
+
- Plugins never inject plaintext secrets into results; the Redaction Layer runs on all error output (`SessionSecretTracker.redactAll`).
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: plugin-runtime
|
|
3
|
-
domain: plugins
|
|
4
|
-
triggers:
|
|
5
|
-
- "what plugins are installed"
|
|
6
|
-
- "weavetab plugin"
|
|
7
|
-
- "extend mcp"
|
|
8
|
-
- "plugin tools"
|
|
9
|
-
- "plugin permissions"
|
|
10
|
-
tools: []
|
|
11
|
-
weavetab: ">=2.5.0
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
# Plugin Runtime: Weavetab Plugin Architecture
|
|
15
|
-
|
|
16
|
-
Weavetab features an extensible plugin architecture powered by `@weavetab/sdk`. All installed plugins are loaded automatically at server startup — their tools appear directly in the MCP tool list alongside built-in tools. Agents never need to discover or activate plugins manually.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 1. How Plugin Tools Appear
|
|
21
|
-
|
|
22
|
-
Plugin tools are first-class MCP tools. If `@weavetab/plugin-recaptcha-solver` is installed, `captcha_solve_token` appears in the tool list immediately on startup — no discovery step needed.
|
|
23
|
-
|
|
24
|
-
There
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
# Install a plugin (restart required)
|
|
28
|
-
weavetab plugin add @weavetab/plugin-youtube
|
|
29
|
-
|
|
30
|
-
# Remove a plugin
|
|
31
|
-
weavetab plugin rm @weavetab/plugin-youtube
|
|
32
|
-
|
|
33
|
-
# List installed plugins
|
|
34
|
-
weavetab plugin list
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## 2. Plugin Permission Model
|
|
40
|
-
|
|
41
|
-
Every plugin declares what it can do in `weavetab.json`. The runtime enforces this at load time:
|
|
42
|
-
|
|
43
|
-
| Permission | What it gates |
|
|
44
|
-
|---|---|
|
|
45
|
-
| `tools.add: true` | Plugin can register new MCP tools |
|
|
46
|
-
| `tools.override: ["browser_navigate"]` | Plugin can wrap/replace that built-in tool |
|
|
47
|
-
| `tools.remove: ["browser_pdf"]` | Plugin can disable that built-in tool |
|
|
48
|
-
| `hooks.onBeforeAction: true` | Plugin can intercept all tool calls before execution |
|
|
49
|
-
| `hooks.onAfterAction: true` | Plugin can inspect/transform all tool results |
|
|
50
|
-
|
|
51
|
-
Plugins that attempt to exceed their declared permissions are blocked with a stderr warning — they do not crash.
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## 3. Trust Tiers
|
|
56
|
-
|
|
57
|
-
| Tier | Badge | Condition |
|
|
58
|
-
|---|---|---|
|
|
59
|
-
| Official | `✚ [Official]` | `@weavetab/plugin-*` packages |
|
|
60
|
-
| Verified | `✔ [Verified]` | Listed in the Weavetab verified registry |
|
|
61
|
-
| Unverified | `⚠ [Unverified]` | Unknown community package |
|
|
62
|
-
|
|
63
|
-
Unverified plugins are loaded but their permissions are logged visibly at startup for user review.
|
|
1
|
+
---
|
|
2
|
+
id: plugin-runtime
|
|
3
|
+
domain: plugins
|
|
4
|
+
triggers:
|
|
5
|
+
- "what plugins are installed"
|
|
6
|
+
- "weavetab plugin"
|
|
7
|
+
- "extend mcp"
|
|
8
|
+
- "plugin tools"
|
|
9
|
+
- "plugin permissions"
|
|
10
|
+
tools: []
|
|
11
|
+
weavetab: ">=2.5.0"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Plugin Runtime: Weavetab Plugin Architecture
|
|
15
|
+
|
|
16
|
+
Weavetab features an extensible plugin architecture powered by `@weavetab/sdk`. All installed plugins are loaded automatically at server startup — their tools appear directly in the MCP tool list alongside built-in tools. Agents never need to discover or activate plugins manually.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. How Plugin Tools Appear
|
|
21
|
+
|
|
22
|
+
Plugin tools are first-class MCP tools. If `@weavetab/plugin-recaptcha-solver` is installed, `captcha_solve_token` appears in the tool list immediately on startup — alongside built-ins such as `browser_snapshot` — with no discovery step needed.
|
|
23
|
+
|
|
24
|
+
There is no MCP tool for discovering or activating plugins. Managing plugins is a CLI operation:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Install a plugin (restart required)
|
|
28
|
+
weavetab plugin add @weavetab/plugin-youtube
|
|
29
|
+
|
|
30
|
+
# Remove a plugin
|
|
31
|
+
weavetab plugin rm @weavetab/plugin-youtube
|
|
32
|
+
|
|
33
|
+
# List installed plugins
|
|
34
|
+
weavetab plugin list
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 2. Plugin Permission Model
|
|
40
|
+
|
|
41
|
+
Every plugin declares what it can do in `weavetab.json`. The runtime enforces this at load time:
|
|
42
|
+
|
|
43
|
+
| Permission | What it gates |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `tools.add: true` | Plugin can register new MCP tools |
|
|
46
|
+
| `tools.override: ["browser_navigate"]` | Plugin can wrap/replace that built-in tool |
|
|
47
|
+
| `tools.remove: ["browser_pdf"]` | Plugin can disable that built-in tool |
|
|
48
|
+
| `hooks.onBeforeAction: true` | Plugin can intercept all tool calls before execution |
|
|
49
|
+
| `hooks.onAfterAction: true` | Plugin can inspect/transform all tool results |
|
|
50
|
+
|
|
51
|
+
Plugins that attempt to exceed their declared permissions are blocked with a stderr warning — they do not crash.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 3. Trust Tiers
|
|
56
|
+
|
|
57
|
+
| Tier | Badge | Condition |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| Official | `✚ [Official]` | `@weavetab/plugin-*` packages |
|
|
60
|
+
| Verified | `✔ [Verified]` | Listed in the Weavetab verified registry |
|
|
61
|
+
| Unverified | `⚠ [Unverified]` | Unknown community package |
|
|
62
|
+
|
|
63
|
+
Unverified plugins are loaded but their permissions are logged visibly at startup for user review.
|
|
@@ -1,67 +1,72 @@
|
|
|
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
|
|
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
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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"
|
|
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
|
+
"success": true,
|
|
58
|
+
"action": "detect",
|
|
59
|
+
"captcha_detected": true,
|
|
60
|
+
"captcha_type": "turnstile",
|
|
61
|
+
"interaction_type": "checkbox",
|
|
62
|
+
"difficulty": "easy",
|
|
63
|
+
"confidence": 0.97,
|
|
64
|
+
"human_needed": false,
|
|
65
|
+
"message": "CAPTCHA detected: turnstile (checkbox, 97% confidence)",
|
|
66
|
+
"next_action": "Call browser_captcha({ action: \"solve\" }) to attempt automated solving."
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Action Strategy:
|
|
71
|
+
1. If `human_needed` is `true` (e.g. image classification), inform the user cleanly or request human bypass — do not guess coordinates.
|
|
72
|
+
2. Otherwise pass `"action": "solve"` to attempt an automated solve (slider drag, hold, checkbox, or invisible challenges). Use `"action": "status"` to check progress and `"action": "wait_for_user"` to pause for human input.
|