@weavetab/skills 1.0.3 → 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 -60
- 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 -51
- 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/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
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.5.0-beta.4",
|
|
3
|
+
"scenarios": [
|
|
4
|
+
{
|
|
5
|
+
"id": "spa_stale_ref_recovery",
|
|
6
|
+
"description": "Agent encounters detached DOM node during Next.js hydration",
|
|
7
|
+
"intent": "Button ref w:14 became detached after client-side state update",
|
|
8
|
+
"expectedDomain": "resilience",
|
|
9
|
+
"expectedGuide": "stale-ref-recovery.md",
|
|
10
|
+
"expectedTools": [
|
|
11
|
+
"browser_find",
|
|
12
|
+
"browser_map"
|
|
13
|
+
],
|
|
14
|
+
"bannedTools": [
|
|
15
|
+
"scrape_page",
|
|
16
|
+
"browser_evaluate"
|
|
17
|
+
],
|
|
18
|
+
"assertion": "Must rely on 4-tier auto-recovery or targeted browser_find rather than repeating identical stale ref"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "secret_containment_verification",
|
|
22
|
+
"description": "Agent enters user master password or OAuth secret",
|
|
23
|
+
"intent": "Enter user account password and security pin on auth page",
|
|
24
|
+
"expectedDomain": "security",
|
|
25
|
+
"expectedGuide": "secret-containment-protocol.md",
|
|
26
|
+
"expectedTools": [
|
|
27
|
+
"browser_type_secret"
|
|
28
|
+
],
|
|
29
|
+
"bannedTools": [
|
|
30
|
+
"scrape_page",
|
|
31
|
+
"browser_evaluate",
|
|
32
|
+
"browser_ask"
|
|
33
|
+
],
|
|
34
|
+
"assertion": "Must strictly use browser_type_secret to guarantee zero-bleed in logs and transcripts"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "electron_app_switch",
|
|
38
|
+
"description": "Agent detects and sends message inside Slack desktop client",
|
|
39
|
+
"intent": "Find running Slack desktop app and post deployment confirmation",
|
|
40
|
+
"expectedDomain": "desktop",
|
|
41
|
+
"expectedGuide": "desktop-targeting.md",
|
|
42
|
+
"expectedTools": [
|
|
43
|
+
"browser_detect",
|
|
44
|
+
"browser_type"
|
|
45
|
+
],
|
|
46
|
+
"bannedTools": [
|
|
47
|
+
"click_element"
|
|
48
|
+
],
|
|
49
|
+
"assertion": "Must discover running Electron app and pass app: 'slack' parameter"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "checkpoint_rollback_on_error",
|
|
53
|
+
"description": "Agent snapshots session before checkout and rolls back after card decline",
|
|
54
|
+
"intent": "Save browser checkpoint before payment submit; restore on failure",
|
|
55
|
+
"expectedDomain": "resilience",
|
|
56
|
+
"expectedGuide": "session-time-travel.md",
|
|
57
|
+
"expectedTools": [
|
|
58
|
+
"browser_checkpoint"
|
|
59
|
+
],
|
|
60
|
+
"bannedTools": [
|
|
61
|
+
"browser_evaluate"
|
|
62
|
+
],
|
|
63
|
+
"assertion": "Must execute browser_checkpoint with action save and restore to preserve cookies and storage"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "token_conservation_dom_map",
|
|
67
|
+
"description": "Agent needs to inspect interactive buttons without burning 50k tokens",
|
|
68
|
+
"intent": "Inspect interactive controls on large documentation portal",
|
|
69
|
+
"expectedDomain": "browser",
|
|
70
|
+
"expectedGuide": "dom-strategy.md",
|
|
71
|
+
"expectedTools": [
|
|
72
|
+
"browser_map",
|
|
73
|
+
"browser_find"
|
|
74
|
+
],
|
|
75
|
+
"bannedTools": [
|
|
76
|
+
"browser_ask"
|
|
77
|
+
],
|
|
78
|
+
"assertion": "Must pass lite: true or use targeted browser_find for keyword jumps"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "office_document_parsing",
|
|
82
|
+
"description": "Agent downloads and parses quarterly revenue spreadsheet",
|
|
83
|
+
"intent": "Read quarterly_revenue.xlsx sheets and extract department budgets",
|
|
84
|
+
"expectedDomain": "documents",
|
|
85
|
+
"expectedGuide": "office-document-ingestion.md",
|
|
86
|
+
"expectedTools": [
|
|
87
|
+
"browser_office"
|
|
88
|
+
],
|
|
89
|
+
"bannedTools": [
|
|
90
|
+
"browser_evaluate"
|
|
91
|
+
],
|
|
92
|
+
"assertion": "Must use browser_office to ingest Excel spreadsheet data into structured JSON"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "network_mock_and_intercept",
|
|
96
|
+
"description": "Agent mocks a failing billing endpoint to verify error state UI",
|
|
97
|
+
"intent": "Intercept /api/v1/billing and return HTTP 500 error",
|
|
98
|
+
"expectedDomain": "network-and-perf",
|
|
99
|
+
"expectedGuide": "network-intercept-and-mock.md",
|
|
100
|
+
"expectedTools": [
|
|
101
|
+
"browser_network_intercept"
|
|
102
|
+
],
|
|
103
|
+
"bannedTools": [
|
|
104
|
+
"scrape_page"
|
|
105
|
+
],
|
|
106
|
+
"assertion": "Must route request stubbing through browser_network_intercept"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "macro_compilation_workflow",
|
|
110
|
+
"description": "Agent compiles multi-step report generation into deterministic pipeline",
|
|
111
|
+
"intent": "Compile recent search and export actions into parameterized macro",
|
|
112
|
+
"expectedDomain": "memory",
|
|
113
|
+
"expectedGuide": "session-trail.md",
|
|
114
|
+
"expectedTools": [
|
|
115
|
+
"browser_burst"
|
|
116
|
+
],
|
|
117
|
+
"bannedTools": [
|
|
118
|
+
"browser_evaluate"
|
|
119
|
+
],
|
|
120
|
+
"assertion": "Must compile trail using browser_burst with compile_from_history: true"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "form_atomic_batch_fill",
|
|
124
|
+
"description": "Agent fills out 5-field customer registration form in one turn",
|
|
125
|
+
"intent": "Fill first name, last name, email, and agree to terms checkbox",
|
|
126
|
+
"expectedDomain": "browser",
|
|
127
|
+
"expectedGuide": "form-automation.md",
|
|
128
|
+
"expectedTools": [
|
|
129
|
+
"browser_fill"
|
|
130
|
+
],
|
|
131
|
+
"bannedTools": [
|
|
132
|
+
"fill_field"
|
|
133
|
+
],
|
|
134
|
+
"assertion": "Must pass array of fields to browser_fill rather than executing individual typing turns"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "pointer_trajectory_drag_and_drop",
|
|
138
|
+
"description": "Agent drags kanban card from In Progress to Done",
|
|
139
|
+
"intent": "Move Kanban card element from coordinates (200,300) to (600,300)",
|
|
140
|
+
"expectedDomain": "browser",
|
|
141
|
+
"expectedGuide": "interaction-pipeline.md",
|
|
142
|
+
"expectedTools": [
|
|
143
|
+
"browser_pointer"
|
|
144
|
+
],
|
|
145
|
+
"bannedTools": [
|
|
146
|
+
"click_element"
|
|
147
|
+
],
|
|
148
|
+
"assertion": "Must dispatch down, move, and up actions via browser_pointer"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "tab_switch_and_close",
|
|
152
|
+
"description": "Agent opens OAuth popup, completes flow, and switches back to main tab",
|
|
153
|
+
"intent": "Enumerate active page targets, switch focus to popup, and close on finish",
|
|
154
|
+
"expectedDomain": "browser",
|
|
155
|
+
"expectedGuide": "tab-and-window.md",
|
|
156
|
+
"expectedTools": [
|
|
157
|
+
"browser_tabs"
|
|
158
|
+
],
|
|
159
|
+
"bannedTools": [
|
|
160
|
+
"browser_evaluate"
|
|
161
|
+
],
|
|
162
|
+
"assertion": "Must use browser_tabs actions (list, switch, close)"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "core_web_vitals_audit",
|
|
166
|
+
"description": "Agent measures LCP and CLS metrics on landing page",
|
|
167
|
+
"intent": "Measure Core Web Vitals and verify page render performance",
|
|
168
|
+
"expectedDomain": "network-and-perf",
|
|
169
|
+
"expectedGuide": "performance-and-vitals.md",
|
|
170
|
+
"expectedTools": [
|
|
171
|
+
"browser_performance",
|
|
172
|
+
"browser_wait"
|
|
173
|
+
],
|
|
174
|
+
"bannedTools": [
|
|
175
|
+
"browser_evaluate"
|
|
176
|
+
],
|
|
177
|
+
"assertion": "Must query browser_performance for vitals metrics"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"id": "device_mobile_emulation",
|
|
181
|
+
"description": "Agent emulates iPhone 15 viewport and throttled 3G connectivity",
|
|
182
|
+
"intent": "Audit mobile layout on iPhone 15 with slow network profile",
|
|
183
|
+
"expectedDomain": "network-and-perf",
|
|
184
|
+
"expectedGuide": "device-and-environment.md",
|
|
185
|
+
"expectedTools": [
|
|
186
|
+
"browser_emulate"
|
|
187
|
+
],
|
|
188
|
+
"bannedTools": [
|
|
189
|
+
"scrape_page"
|
|
190
|
+
],
|
|
191
|
+
"assertion": "Must configure viewport and network throttling via browser_emulate"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "plugin_dynamic_load",
|
|
195
|
+
"description": "Agent loads an external community plugin for specialized OCR",
|
|
196
|
+
"intent": "Check active plugins and dynamically load @weavetab/plugin-ocr",
|
|
197
|
+
"expectedDomain": "plugins",
|
|
198
|
+
"expectedGuide": "plugin-runtime.md",
|
|
199
|
+
"expectedTools": [
|
|
200
|
+
"list_plugins",
|
|
201
|
+
"load_plugin"
|
|
202
|
+
],
|
|
203
|
+
"bannedTools": [
|
|
204
|
+
"browser_ask"
|
|
205
|
+
],
|
|
206
|
+
"assertion": "Must query list_plugins and load verified plugin with load_plugin"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "github_repository_triage",
|
|
210
|
+
"description": "Agent inspects open pull requests on Weavetab/MCP repository",
|
|
211
|
+
"intent": "Examine PR diff and review comments without loading web browser UI",
|
|
212
|
+
"expectedDomain": "developer",
|
|
213
|
+
"expectedGuide": "github-forensics.md",
|
|
214
|
+
"expectedTools": [
|
|
215
|
+
"browser_github"
|
|
216
|
+
],
|
|
217
|
+
"bannedTools": [
|
|
218
|
+
"browser_navigate",
|
|
219
|
+
"browser_map"
|
|
220
|
+
],
|
|
221
|
+
"assertion": "Must use native browser_github tool to save browser turns"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"id": "loop_breaker_reset",
|
|
225
|
+
"description": "Agent breaks out of repetitive click strike trap",
|
|
226
|
+
"intent": "Diagnose silent validation error and reset server loop strike counter",
|
|
227
|
+
"expectedDomain": "resilience",
|
|
228
|
+
"expectedGuide": "loop-breaker.md",
|
|
229
|
+
"expectedTools": [
|
|
230
|
+
"browser_map"
|
|
231
|
+
],
|
|
232
|
+
"bannedTools": [
|
|
233
|
+
"browser_ask"
|
|
234
|
+
],
|
|
235
|
+
"assertion": "Must reset loop strikes via browser_map({ force: true }) after diagnosing issue"
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
}
|
|
@@ -0,0 +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-beta.4"
|
|
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-system/knowledge/<hostname>.md` | Engine (auto, 20-token notes) |
|
|
126
|
+
| User config | `~/.weavetab/config.json` | Human — never written by agents |
|
|
127
|
+
|
|
@@ -0,0 +1,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-beta.4"
|
|
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` automatically converts recent successful session actions into a high-performance, deterministic execution script.
|
|
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_go", "args": { "url": "https://analytics.example.com" } },
|
|
53
|
+
{ "tool": "browser_fill", "args": { "ref": "w:12", "value": "metrics" } },
|
|
54
|
+
{ "tool": "click_and_wait", "args": { "ref": "w:15" } }
|
|
55
|
+
],
|
|
56
|
+
"message": "compiled 3 macro steps from history"
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 2. Parameterizing Variable Inputs
|
|
63
|
+
|
|
64
|
+
When `"parameterizeInputs": true` is passed:
|
|
65
|
+
- Text inputs and dates entered during the exploratory session are replaced with named parameters.
|
|
66
|
+
- Secrets entered via `browser_type_secret` are never hardcoded; they are replaced with environment variable or secret lookups.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 3. Replaying Compiled Automations
|
|
71
|
+
|
|
72
|
+
Compiled macros can be executed in sub-second time without LLM inference overhead using `browser_automation`:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"macroId": "macro_8f7b2c",
|
|
77
|
+
"parameters": {
|
|
78
|
+
"startDate": "2026-09-01",
|
|
79
|
+
"endDate": "2026-09-03"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 4. Emitting Operational Thoughts (`browser_thoughts`)
|
|
87
|
+
|
|
88
|
+
Log agent rationale and internal reasoning directly to the Weavetab HUD and telemetry stream without bloating user chat responses:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"thought": "Detected dynamic React hydration delay. Holding interaction until DOM mutation settles."
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
@@ -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.
|