@weavetab/skills 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.
- 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 +504 -479
- package/dist/bundled/weavetab-desktop.md +164 -164
- package/dist/bundled/weavetab-developer.md +77 -60
- package/dist/bundled/weavetab-documents.md +173 -131
- package/dist/bundled/weavetab-memory.md +259 -233
- package/dist/bundled/weavetab-network-and-perf.md +233 -206
- package/dist/bundled/weavetab-plugins.md +30 -25
- package/dist/bundled/weavetab-resilience.md +229 -201
- package/dist/bundled/weavetab-security.md +81 -75
- 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 +3 -3
- 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 +62 -53
- 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 +4 -3
- package/plugins/hooks-and-overrides.md +40 -35
- package/plugins/plugin-runtime.md +3 -3
- 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 +26 -27
- package/src/api.js +239 -239
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: selector-memory-system
|
|
3
|
-
domain: memory
|
|
4
|
-
triggers:
|
|
5
|
-
- "adaptive selector"
|
|
6
|
-
- "selector memory"
|
|
7
|
-
- "cached selector"
|
|
8
|
-
- "selector decay"
|
|
9
|
-
- "cross session learning"
|
|
10
|
-
- "site profile"
|
|
11
|
-
- "known workflow"
|
|
12
|
-
- "fast path"
|
|
13
|
-
tools:
|
|
14
|
-
- "browser_find"
|
|
15
|
-
- "browser_click"
|
|
16
|
-
- "browser_fill"
|
|
17
|
-
- "browser_pattern_learn"
|
|
18
|
-
weavetab: ">=2.5.0
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
# Two-Tier Memory System
|
|
22
|
-
|
|
23
|
-
Weavetab operates a two-tier persistent memory system. Understanding both layers prevents wasted DOM traversals and makes agents dramatically faster across sessions.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Tier 1 — Selector Confidence Cache (`~/.weavetab-system/memory/`)
|
|
28
|
-
|
|
29
|
-
Per-domain JSON files (one per hostname) track individual element selectors and their interaction history.
|
|
30
|
-
|
|
31
|
-
Every time an element is located and interacted with, Weavetab calculates a confidence score based on:
|
|
32
|
-
1. **Attribute Stability**: Prefers `data-testid`, `id`, `aria-label`, and semantic roles over dynamic Tailwind/CSS-module class strings.
|
|
33
|
-
2. **Success Count**: Selectors that successfully trigger navigation or state changes gain reinforcement.
|
|
34
|
-
3. **Origin Isolation**: Learned selectors are strictly namespaced to the origin to prevent cross-site contamination.
|
|
35
|
-
|
|
36
|
-
### Strike Degradation
|
|
37
|
-
- **Strike 1**: Marked as degraded — falls back to secondary candidates or fuzzy label match.
|
|
38
|
-
- **Strike 2**: Deprecated — immediate fallback to full DOM inspection via `browser_find` or `browser_map`.
|
|
39
|
-
- **Strike 3**: Purged from memory cache to prevent stale lookups.
|
|
40
|
-
|
|
41
|
-
### Agent Discipline for Tier 1
|
|
42
|
-
1. **Rely on Native Tool Resolution**: When you pass a `ref`, Weavetab queries both the active volatile registry and the Tier 1 memory cache automatically.
|
|
43
|
-
2. **Don't Hardcode Fragile Selectors**: Never pass brittle absolute CSS paths like `div:nth-child(3) > ul > li:nth-child(2) > button`.
|
|
44
|
-
3. **Trust Heuristic Recovery**: If a button moves slightly on the page, the underlying engine re-anchors before reporting failure.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Tier 2 — Site Profiles & Workflow Patterns (`~/.weavetab-system/memory/sites/`)
|
|
49
|
-
|
|
50
|
-
One JSON file per origin stores named multi-step workflow patterns, site quirks, and reliability scores. This is the **Intelligent Memory** layer — agents learn entire flows, not just individual selectors.
|
|
51
|
-
|
|
52
|
-
### Checking a Site Profile at Session Start
|
|
53
|
-
Always call `browser_pattern_learn` with `action: "get"` when starting an automation session on a site you may have visited before:
|
|
54
|
-
|
|
55
|
-
```json
|
|
56
|
-
{ "origin": "https://github.com" }
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Response tells you:
|
|
60
|
-
- `known_patterns`: named flows with reliability scores and step counts
|
|
61
|
-
- `quirks`: known cookie banners, rate limits, modal popups to handle automatically
|
|
62
|
-
- `framework`: detected frontend stack
|
|
63
|
-
- `_hint`: compact hint string summarizing everything
|
|
64
|
-
|
|
65
|
-
### Fast-Path Decision Rule
|
|
66
|
-
| Reliability | Action |
|
|
67
|
-
|---|---|
|
|
68
|
-
| **≥ 0.8** | Use pattern steps directly via `browser_burst` — skip exploratory navigation |
|
|
69
|
-
| **0.5 – 0.79** | Attempt pattern but verify success indicator before moving on |
|
|
70
|
-
| **< 0.5 or strikes ≥ 3** | Ignore pattern, re-explore from scratch, then teach via `browser_pattern_learn` |
|
|
71
|
-
|
|
72
|
-
### Teaching a New Pattern After Completing a Workflow
|
|
73
|
-
After successfully completing a multi-step flow:
|
|
74
|
-
|
|
75
|
-
```json
|
|
76
|
-
{
|
|
77
|
-
"origin": "https://github.com",
|
|
78
|
-
"action": "learn",
|
|
79
|
-
"name": "login_flow",
|
|
80
|
-
"steps": [
|
|
81
|
-
{ "tool": "browser_click", "target": ".btn-login" },
|
|
82
|
-
{ "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
|
|
83
|
-
{ "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
|
|
84
|
-
{ "tool": "browser_click", "target": "[type=submit]" }
|
|
85
|
-
],
|
|
86
|
-
"success_indicator": "a[aria-label='Homepage']"
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Recording Execution Outcomes (Reliability Upkeep)
|
|
91
|
-
After replaying a pattern, always report the outcome:
|
|
92
|
-
|
|
93
|
-
```json
|
|
94
|
-
{
|
|
95
|
-
"origin": "https://github.com",
|
|
96
|
-
"action": "record_execution",
|
|
97
|
-
"name": "login_flow",
|
|
98
|
-
"success": true,
|
|
99
|
-
"duration_ms": 3200
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Recording Site Quirks
|
|
104
|
-
When you discover a cookie banner or rate limit:
|
|
105
|
-
|
|
106
|
-
```json
|
|
107
|
-
{
|
|
108
|
-
"origin": "https://github.com",
|
|
109
|
-
"action": "record_quirk",
|
|
110
|
-
"quirk_key": "cookie_banner",
|
|
111
|
-
"quirk_data": { "selector": "#cookie-consent", "action": "click .accept-all", "appears": "first_visit" }
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
On future visits, the quirk is present in the profile so you can dismiss banners before starting your main workflow — zero wasted agent turns.
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## File Locations (Never Write to ~/.weavetab/)
|
|
120
|
-
|
|
121
|
-
| Tier | Path | Owner |
|
|
122
|
-
|---|---|---|
|
|
123
|
-
| Tier 1 selectors | `~/.weavetab-system/memory/<hostname>.json` | Engine (auto) |
|
|
124
|
-
| Tier 2 site profiles | `~/.weavetab-system/memory/sites/<origin>.json` | Engine via `browser_pattern_learn` |
|
|
125
|
-
| Knowledge hints | `~/.weavetab
|
|
126
|
-
| User config | `~/.weavetab/config.json` | Human — never written by agents |
|
|
127
|
-
|
|
1
|
+
---
|
|
2
|
+
id: selector-memory-system
|
|
3
|
+
domain: memory
|
|
4
|
+
triggers:
|
|
5
|
+
- "adaptive selector"
|
|
6
|
+
- "selector memory"
|
|
7
|
+
- "cached selector"
|
|
8
|
+
- "selector decay"
|
|
9
|
+
- "cross session learning"
|
|
10
|
+
- "site profile"
|
|
11
|
+
- "known workflow"
|
|
12
|
+
- "fast path"
|
|
13
|
+
tools:
|
|
14
|
+
- "browser_find"
|
|
15
|
+
- "browser_click"
|
|
16
|
+
- "browser_fill"
|
|
17
|
+
- "browser_pattern_learn"
|
|
18
|
+
weavetab: ">=2.5.0"
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Two-Tier Memory System
|
|
22
|
+
|
|
23
|
+
Weavetab operates a two-tier persistent memory system. Understanding both layers prevents wasted DOM traversals and makes agents dramatically faster across sessions.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Tier 1 — Selector Confidence Cache (`~/.weavetab-system/memory/`)
|
|
28
|
+
|
|
29
|
+
Per-domain JSON files (one per hostname) track individual element selectors and their interaction history.
|
|
30
|
+
|
|
31
|
+
Every time an element is located and interacted with, Weavetab calculates a confidence score based on:
|
|
32
|
+
1. **Attribute Stability**: Prefers `data-testid`, `id`, `aria-label`, and semantic roles over dynamic Tailwind/CSS-module class strings.
|
|
33
|
+
2. **Success Count**: Selectors that successfully trigger navigation or state changes gain reinforcement.
|
|
34
|
+
3. **Origin Isolation**: Learned selectors are strictly namespaced to the origin to prevent cross-site contamination.
|
|
35
|
+
|
|
36
|
+
### Strike Degradation
|
|
37
|
+
- **Strike 1**: Marked as degraded — falls back to secondary candidates or fuzzy label match.
|
|
38
|
+
- **Strike 2**: Deprecated — immediate fallback to full DOM inspection via `browser_find` or `browser_map`.
|
|
39
|
+
- **Strike 3**: Purged from memory cache to prevent stale lookups.
|
|
40
|
+
|
|
41
|
+
### Agent Discipline for Tier 1
|
|
42
|
+
1. **Rely on Native Tool Resolution**: When you pass a `ref`, Weavetab queries both the active volatile registry and the Tier 1 memory cache automatically.
|
|
43
|
+
2. **Don't Hardcode Fragile Selectors**: Never pass brittle absolute CSS paths like `div:nth-child(3) > ul > li:nth-child(2) > button`.
|
|
44
|
+
3. **Trust Heuristic Recovery**: If a button moves slightly on the page, the underlying engine re-anchors before reporting failure.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Tier 2 — Site Profiles & Workflow Patterns (`~/.weavetab-system/memory/sites/`)
|
|
49
|
+
|
|
50
|
+
One JSON file per origin stores named multi-step workflow patterns, site quirks, and reliability scores. This is the **Intelligent Memory** layer — agents learn entire flows, not just individual selectors.
|
|
51
|
+
|
|
52
|
+
### Checking a Site Profile at Session Start
|
|
53
|
+
Always call `browser_pattern_learn` with `action: "get"` when starting an automation session on a site you may have visited before:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{ "origin": "https://github.com" }
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Response tells you:
|
|
60
|
+
- `known_patterns`: named flows with reliability scores and step counts
|
|
61
|
+
- `quirks`: known cookie banners, rate limits, modal popups to handle automatically
|
|
62
|
+
- `framework`: detected frontend stack
|
|
63
|
+
- `_hint`: compact hint string summarizing everything
|
|
64
|
+
|
|
65
|
+
### Fast-Path Decision Rule
|
|
66
|
+
| Reliability | Action |
|
|
67
|
+
|---|---|
|
|
68
|
+
| **≥ 0.8** | Use pattern steps directly via `browser_burst` — skip exploratory navigation |
|
|
69
|
+
| **0.5 – 0.79** | Attempt pattern but verify success indicator before moving on |
|
|
70
|
+
| **< 0.5 or strikes ≥ 3** | Ignore pattern, re-explore from scratch, then teach via `browser_pattern_learn` |
|
|
71
|
+
|
|
72
|
+
### Teaching a New Pattern After Completing a Workflow
|
|
73
|
+
After successfully completing a multi-step flow:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"origin": "https://github.com",
|
|
78
|
+
"action": "learn",
|
|
79
|
+
"name": "login_flow",
|
|
80
|
+
"steps": [
|
|
81
|
+
{ "tool": "browser_click", "target": ".btn-login" },
|
|
82
|
+
{ "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
|
|
83
|
+
{ "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
|
|
84
|
+
{ "tool": "browser_click", "target": "[type=submit]" }
|
|
85
|
+
],
|
|
86
|
+
"success_indicator": "a[aria-label='Homepage']"
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Recording Execution Outcomes (Reliability Upkeep)
|
|
91
|
+
After replaying a pattern, always report the outcome:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"origin": "https://github.com",
|
|
96
|
+
"action": "record_execution",
|
|
97
|
+
"name": "login_flow",
|
|
98
|
+
"success": true,
|
|
99
|
+
"duration_ms": 3200
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Recording Site Quirks
|
|
104
|
+
When you discover a cookie banner or rate limit:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"origin": "https://github.com",
|
|
109
|
+
"action": "record_quirk",
|
|
110
|
+
"quirk_key": "cookie_banner",
|
|
111
|
+
"quirk_data": { "selector": "#cookie-consent", "action": "click .accept-all", "appears": "first_visit" }
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
On future visits, the quirk is present in the profile so you can dismiss banners before starting your main workflow — zero wasted agent turns.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## File Locations (Never Write to ~/.weavetab/)
|
|
120
|
+
|
|
121
|
+
| Tier | Path | Owner |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| Tier 1 selectors | `~/.weavetab-system/memory/<hostname>.json` | Engine (auto) |
|
|
124
|
+
| Tier 2 site profiles | `~/.weavetab-system/memory/sites/<origin>.json` | Engine via `browser_pattern_learn` |
|
|
125
|
+
| Knowledge hints | `~/.weavetab/knowledge/<hostname>.md` | Engine (auto, 20-token notes) |
|
|
126
|
+
| User config | `~/.weavetab/config.json` | Human — never written by agents |
|
|
127
|
+
|
|
@@ -1,95 +1,111 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: session-trail
|
|
3
|
-
domain: memory
|
|
4
|
-
triggers:
|
|
5
|
-
- "compile macro"
|
|
6
|
-
- "export automation"
|
|
7
|
-
- "replay actions"
|
|
8
|
-
- "session trail"
|
|
9
|
-
- "record workflow"
|
|
10
|
-
tools:
|
|
11
|
-
- "browser_burst"
|
|
12
|
-
- "browser_recording"
|
|
13
|
-
- "browser_automation"
|
|
14
|
-
- "browser_thoughts"
|
|
15
|
-
weavetab: ">=2.5.0
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
# Session Trails & Deterministic Macro Compilation
|
|
19
|
-
|
|
20
|
-
When an agent executes an exploratory workflow (e.g. logging into a dashboard, navigating to analytics, setting date filters, and downloading a CSV), re-running that flow autonomously in the future should not require 15 reasoning steps.
|
|
21
|
-
|
|
22
|
-
`browser_burst` with `compile_from_history: true`
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## 1. Compiling and Replaying Recent Actions (`browser_burst`)
|
|
27
|
-
|
|
28
|
-
Replay recent successful actions directly in a single turn:
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
{
|
|
32
|
-
"compile_from_history": true
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Or pass `dry_run: true` to inspect the compiled macro steps before running them:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"compile_from_history": true,
|
|
41
|
-
"dry_run": true,
|
|
42
|
-
"history_limit": 15
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Response Example:
|
|
47
|
-
```json
|
|
48
|
-
{
|
|
49
|
-
"success": true,
|
|
50
|
-
"steps_completed": 0,
|
|
51
|
-
"compiled_steps": [
|
|
52
|
-
{ "tool": "browser_navigate", "args": { "url": "https://analytics.example.com" } },
|
|
53
|
-
{ "tool": "
|
|
54
|
-
{ "tool": "click_and_wait", "args": { "ref": "w:15" } }
|
|
55
|
-
],
|
|
56
|
-
"message": "compiled 3 macro steps from history"
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
1
|
+
---
|
|
2
|
+
id: session-trail
|
|
3
|
+
domain: memory
|
|
4
|
+
triggers:
|
|
5
|
+
- "compile macro"
|
|
6
|
+
- "export automation"
|
|
7
|
+
- "replay actions"
|
|
8
|
+
- "session trail"
|
|
9
|
+
- "record workflow"
|
|
10
|
+
tools:
|
|
11
|
+
- "browser_burst"
|
|
12
|
+
- "browser_recording"
|
|
13
|
+
- "browser_automation"
|
|
14
|
+
- "browser_thoughts"
|
|
15
|
+
weavetab: ">=2.5.0"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Session Trails & Deterministic Macro Compilation
|
|
19
|
+
|
|
20
|
+
When an agent executes an exploratory workflow (e.g. logging into a dashboard, navigating to analytics, setting date filters, and downloading a CSV), re-running that flow autonomously in the future should not require 15 reasoning steps.
|
|
21
|
+
|
|
22
|
+
`browser_burst` with `compile_from_history: true` converts recent successful session actions into a deterministic, replayable macro.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 1. Compiling and Replaying Recent Actions (`browser_burst`)
|
|
27
|
+
|
|
28
|
+
Replay recent successful actions directly in a single turn:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"compile_from_history": true
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or pass `dry_run: true` to inspect the compiled macro steps before running them:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"compile_from_history": true,
|
|
41
|
+
"dry_run": true,
|
|
42
|
+
"history_limit": 15
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Response Example:
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"success": true,
|
|
50
|
+
"steps_completed": 0,
|
|
51
|
+
"compiled_steps": [
|
|
52
|
+
{ "tool": "browser_navigate", "args": { "url": "https://analytics.example.com" } },
|
|
53
|
+
{ "tool": "browser_type", "args": { "ref": "w:12", "text": "metrics" } },
|
|
54
|
+
{ "tool": "click_and_wait", "args": { "ref": "w:15" } }
|
|
55
|
+
],
|
|
56
|
+
"message": "compiled 3 macro steps from history"
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Compiled steps reuse the exact arguments the original tool calls carried (for example a `browser_fill` step keeps its `fields` array). `history_limit` caps how many recent trail entries are considered (default 20).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 2. What Gets Compiled
|
|
65
|
+
|
|
66
|
+
The compiler walks the session trail and keeps only successful steps whose tool is replayable (clicks, typing, navigation, keys, scroll, select, wait, fill, and similar). It:
|
|
67
|
+
- Drops failed steps.
|
|
68
|
+
- De-duplicates consecutive identical calls.
|
|
69
|
+
- Exposes the result as `compiled_steps` with `args` nested under each step.
|
|
70
|
+
|
|
71
|
+
Because secrets entered via `browser_type_secret` are referenced by environment-variable key (`envKey`) rather than plaintext, compiled macros never contain credentials.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 3. Background Scripts (`browser_automation`)
|
|
76
|
+
|
|
77
|
+
For recurring monitoring or polling that should run without an LLM turn, `browser_automation` injects a self-running script into the page:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"action": "start",
|
|
82
|
+
"id": "price_watch",
|
|
83
|
+
"script": "setInterval(() => document.querySelector('#price')?.textContent, 5000)",
|
|
84
|
+
"persistent": true,
|
|
85
|
+
"onResult": "store"
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- **`action`**: `start`, `stop`, `list`, or `poll`.
|
|
90
|
+
- **`id`**: unique script identifier (required for `start`/`stop`).
|
|
91
|
+
- **`script`**: the JavaScript to inject (required for `start`).
|
|
92
|
+
- **`persistent`**: re-run in a loop when `true`.
|
|
93
|
+
- **`onResult`**: `notify_agent`, `store` (default), or `ignore`.
|
|
94
|
+
|
|
95
|
+
Scripts are cleared on tab close — do not rely on them for expensive, long-running work.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 4. Emitting Operational Thoughts (`browser_thoughts`)
|
|
100
|
+
|
|
101
|
+
Log agent rationale and internal reasoning directly to the Weavetab HUD and telemetry stream without bloating user chat responses:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"action": "feedback",
|
|
106
|
+
"message": "Detected dynamic React hydration delay. Holding interaction until DOM mutation settles.",
|
|
107
|
+
"style": "observation"
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Use `"action": "question"` to surface a free-text question to the user (with `input` set to `sentence` or `paragraph`, and an optional `timeout`).
|