@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,67 @@
|
|
|
1
|
+
# Weavetab Domain Profile: DEVELOPER
|
|
2
|
+
|
|
3
|
+
Generated for @weavetab/skills v2.5.0-beta.4
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## github-forensics
|
|
7
|
+
|
|
8
|
+
# GitHub Forensics & Repository Architecture Inspection
|
|
9
|
+
|
|
10
|
+
Navigating GitHub repositories via web browsing burns massive token budgets loading HTML chrome, comment threads, and diff trees. Weavetab includes a dedicated `browser_github` tool that interacts directly with git metadata and raw endpoints.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. High-Level Repository Analysis (action: "analyze")
|
|
15
|
+
|
|
16
|
+
Quickly summarize repo structure, languages, dependency graphs, and recent commit frequency:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"action": "analyze",
|
|
21
|
+
"repo": "Weavetab/MCP"
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. Reading Repository Source Files (action: "read")
|
|
28
|
+
|
|
29
|
+
Directly stream files and directories from any public or authenticated GitHub repo without cloning or burning API rate limits:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"action": "read",
|
|
34
|
+
"repo": "Weavetab/MCP",
|
|
35
|
+
"paths": ["src/server.ts"],
|
|
36
|
+
"line_range": [1, 200]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 3. Pull Request Forensics (action: "pr")
|
|
43
|
+
|
|
44
|
+
Retrieve PR diffs, changed files, review comments, CI checks, and mergeability status:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"action": "pr",
|
|
49
|
+
"repo": "Weavetab/MCP",
|
|
50
|
+
"number": 42
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 4. Issue Triage & Search (action: "issues")
|
|
57
|
+
|
|
58
|
+
Query repository issue trackers with state, label, and keyword filters:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"action": "issues",
|
|
63
|
+
"repo": "Weavetab/MCP",
|
|
64
|
+
"state": "open",
|
|
65
|
+
"labels": ["bug", "priority"]
|
|
66
|
+
}
|
|
67
|
+
```
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Weavetab Domain Profile: DOCUMENTS
|
|
2
|
+
|
|
3
|
+
Generated for @weavetab/skills v2.5.0-beta.4
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## canvas-and-visual-capture
|
|
7
|
+
|
|
8
|
+
# Visual Capture, Canvas Forensics & Design Extraction
|
|
9
|
+
|
|
10
|
+
Beyond textual DOM manipulation, modern web applications contain dynamic HTML5 canvas renderings (charts, maps, WebGL games), and agents often need high-fidelity visual artifacts.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. Targeted Screenshots (`browser_screenshot`)
|
|
15
|
+
|
|
16
|
+
Capture full page layouts, the visible viewport, or specific element bounding boxes:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"fullPage": true,
|
|
21
|
+
"format": "png"
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or target a specific element ref:
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"ref": "w:55",
|
|
29
|
+
"format": "jpeg",
|
|
30
|
+
"quality": 80
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 2. PDF Document Generation (`browser_pdf`)
|
|
37
|
+
|
|
38
|
+
Render the current page into a print-ready PDF document with print CSS styles applied:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"landscape": false,
|
|
43
|
+
"printBackground": true,
|
|
44
|
+
"paperWidth": 8.5,
|
|
45
|
+
"paperHeight": 11
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 3. HTML5 Canvas Pixel Inspection & Visual Grounding (`browser_canvas` & `browser_map`)
|
|
52
|
+
|
|
53
|
+
When a chart or graphic is rendered via `<canvas>`, standard DOM reading tools cannot see individual buttons or nodes. You have two strategies:
|
|
54
|
+
|
|
55
|
+
### A. Set-of-Marks Visual Grounding (Recommended for Canvas UIs & WebGL)
|
|
56
|
+
Run `browser_map({ visual: "auto" })`. It detects canvas elements and high-contrast regions, attaches numbered badges `[1]…[N]`, and returns an annotated image:
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"visual": "auto"
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
Then interact directly by mark number without guessing pixel coordinates:
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mark": 3
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### B. Direct Canvas Pixel Export (`browser_canvas`)
|
|
70
|
+
To extract the raw image data or draw programmatic gesture paths:
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"ref": "w:19",
|
|
74
|
+
"action": "toDataURL"
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 4. Design System Extraction (`browser_extract_design`)
|
|
81
|
+
|
|
82
|
+
Reverse-engineer UI stylesheets, active CSS custom properties (variables), typography scales, and color palettes:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"selector": ".antigravity-hud-panel"
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Returns structured JSON representing colors, font families, shadows, and spacing tokens.
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
## office-document-ingestion
|
|
94
|
+
|
|
95
|
+
# Office Document Ingestion: Word, Excel & CSV Parsing
|
|
96
|
+
|
|
97
|
+
Agents frequently need to parse structured spreadsheets or corporate documents downloaded during automation runs. `browser_office` parses `.docx`, `.xlsx`, `.xls`, and `.csv` files directly into clean JSON structures.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 1. Parsing Spreadsheets (`.xlsx`, `.csv`)
|
|
102
|
+
|
|
103
|
+
Stream structured sheet data, headers, and cell values:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"filePath": "C:/Users/fy2ne/Downloads/quarterly_revenue.xlsx",
|
|
108
|
+
"sheet": "Q3_Summary",
|
|
109
|
+
"headerRow": 1,
|
|
110
|
+
"maxRows": 100
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Response Example:
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"fileType": "xlsx",
|
|
118
|
+
"sheets": ["Q1", "Q2", "Q3_Summary"],
|
|
119
|
+
"rowCount": 45,
|
|
120
|
+
"data": [
|
|
121
|
+
{ "Department": "Engineering", "Budget": 1250000, "Actual": 1180000 },
|
|
122
|
+
{ "Department": "Marketing", "Budget": 600000, "Actual": 620000 }
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 2. Ingesting Word Documents (`.docx`)
|
|
130
|
+
|
|
131
|
+
Extract semantic paragraphs, document headings, tables, and lists:
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"filePath": "C:/Users/fy2ne/Documents/service_agreement.docx",
|
|
136
|
+
"extractTables": true
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Operational Advantages:
|
|
141
|
+
- Eliminates the need for heavy external Python libraries or microservices.
|
|
142
|
+
- Safely sanitizes binary formats before passing content into LLM context.
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# Weavetab Domain Profile: MEMORY
|
|
2
|
+
|
|
3
|
+
Generated for @weavetab/skills v2.5.0-beta.4
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## selector-memory-system
|
|
7
|
+
|
|
8
|
+
# Two-Tier Memory System
|
|
9
|
+
|
|
10
|
+
Weavetab operates a two-tier persistent memory system. Understanding both layers prevents wasted DOM traversals and makes agents dramatically faster across sessions.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Tier 1 — Selector Confidence Cache (`~/.weavetab-system/memory/`)
|
|
15
|
+
|
|
16
|
+
Per-domain JSON files (one per hostname) track individual element selectors and their interaction history.
|
|
17
|
+
|
|
18
|
+
Every time an element is located and interacted with, Weavetab calculates a confidence score based on:
|
|
19
|
+
1. **Attribute Stability**: Prefers `data-testid`, `id`, `aria-label`, and semantic roles over dynamic Tailwind/CSS-module class strings.
|
|
20
|
+
2. **Success Count**: Selectors that successfully trigger navigation or state changes gain reinforcement.
|
|
21
|
+
3. **Origin Isolation**: Learned selectors are strictly namespaced to the origin to prevent cross-site contamination.
|
|
22
|
+
|
|
23
|
+
### Strike Degradation
|
|
24
|
+
- **Strike 1**: Marked as degraded — falls back to secondary candidates or fuzzy label match.
|
|
25
|
+
- **Strike 2**: Deprecated — immediate fallback to full DOM inspection via `browser_find` or `browser_map`.
|
|
26
|
+
- **Strike 3**: Purged from memory cache to prevent stale lookups.
|
|
27
|
+
|
|
28
|
+
### Agent Discipline for Tier 1
|
|
29
|
+
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.
|
|
30
|
+
2. **Don't Hardcode Fragile Selectors**: Never pass brittle absolute CSS paths like `div:nth-child(3) > ul > li:nth-child(2) > button`.
|
|
31
|
+
3. **Trust Heuristic Recovery**: If a button moves slightly on the page, the underlying engine re-anchors before reporting failure.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Tier 2 — Site Profiles & Workflow Patterns (`~/.weavetab-system/memory/sites/`)
|
|
36
|
+
|
|
37
|
+
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.
|
|
38
|
+
|
|
39
|
+
### Checking a Site Profile at Session Start
|
|
40
|
+
Always call `browser_pattern_learn` with `action: "get"` when starting an automation session on a site you may have visited before:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{ "origin": "https://github.com" }
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Response tells you:
|
|
47
|
+
- `known_patterns`: named flows with reliability scores and step counts
|
|
48
|
+
- `quirks`: known cookie banners, rate limits, modal popups to handle automatically
|
|
49
|
+
- `framework`: detected frontend stack
|
|
50
|
+
- `_hint`: compact hint string summarizing everything
|
|
51
|
+
|
|
52
|
+
### Fast-Path Decision Rule
|
|
53
|
+
| Reliability | Action |
|
|
54
|
+
|---|---|
|
|
55
|
+
| **≥ 0.8** | Use pattern steps directly via `browser_burst` — skip exploratory navigation |
|
|
56
|
+
| **0.5 – 0.79** | Attempt pattern but verify success indicator before moving on |
|
|
57
|
+
| **< 0.5 or strikes ≥ 3** | Ignore pattern, re-explore from scratch, then teach via `browser_pattern_learn` |
|
|
58
|
+
|
|
59
|
+
### Teaching a New Pattern After Completing a Workflow
|
|
60
|
+
After successfully completing a multi-step flow:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"origin": "https://github.com",
|
|
65
|
+
"action": "learn",
|
|
66
|
+
"name": "login_flow",
|
|
67
|
+
"steps": [
|
|
68
|
+
{ "tool": "browser_click", "target": ".btn-login" },
|
|
69
|
+
{ "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
|
|
70
|
+
{ "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
|
|
71
|
+
{ "tool": "browser_click", "target": "[type=submit]" }
|
|
72
|
+
],
|
|
73
|
+
"success_indicator": "a[aria-label='Homepage']"
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Recording Execution Outcomes (Reliability Upkeep)
|
|
78
|
+
After replaying a pattern, always report the outcome:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"origin": "https://github.com",
|
|
83
|
+
"action": "record_execution",
|
|
84
|
+
"name": "login_flow",
|
|
85
|
+
"success": true,
|
|
86
|
+
"duration_ms": 3200
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Recording Site Quirks
|
|
91
|
+
When you discover a cookie banner or rate limit:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"origin": "https://github.com",
|
|
96
|
+
"action": "record_quirk",
|
|
97
|
+
"quirk_key": "cookie_banner",
|
|
98
|
+
"quirk_data": { "selector": "#cookie-consent", "action": "click .accept-all", "appears": "first_visit" }
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
On future visits, the quirk is present in the profile so you can dismiss banners before starting your main workflow — zero wasted agent turns.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## File Locations (Never Write to ~/.weavetab/)
|
|
107
|
+
|
|
108
|
+
| Tier | Path | Owner |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| Tier 1 selectors | `~/.weavetab-system/memory/<hostname>.json` | Engine (auto) |
|
|
111
|
+
| Tier 2 site profiles | `~/.weavetab-system/memory/sites/<origin>.json` | Engine via `browser_pattern_learn` |
|
|
112
|
+
| Knowledge hints | `~/.weavetab-system/knowledge/<hostname>.md` | Engine (auto, 20-token notes) |
|
|
113
|
+
| User config | `~/.weavetab/config.json` | Human — never written by agents |
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## session-trail
|
|
117
|
+
|
|
118
|
+
# Session Trails & Deterministic Macro Compilation
|
|
119
|
+
|
|
120
|
+
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.
|
|
121
|
+
|
|
122
|
+
`browser_burst` with `compile_from_history: true` automatically converts recent successful session actions into a high-performance, deterministic execution script.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 1. Compiling and Replaying Recent Actions (`browser_burst`)
|
|
127
|
+
|
|
128
|
+
Replay recent successful actions directly in a single turn:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"compile_from_history": true
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Or pass `dry_run: true` to inspect the compiled macro steps before running them:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"compile_from_history": true,
|
|
141
|
+
"dry_run": true,
|
|
142
|
+
"history_limit": 15
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Response Example:
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"success": true,
|
|
150
|
+
"steps_completed": 0,
|
|
151
|
+
"compiled_steps": [
|
|
152
|
+
{ "tool": "browser_go", "args": { "url": "https://analytics.example.com" } },
|
|
153
|
+
{ "tool": "browser_fill", "args": { "ref": "w:12", "value": "metrics" } },
|
|
154
|
+
{ "tool": "click_and_wait", "args": { "ref": "w:15" } }
|
|
155
|
+
],
|
|
156
|
+
"message": "compiled 3 macro steps from history"
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 2. Parameterizing Variable Inputs
|
|
163
|
+
|
|
164
|
+
When `"parameterizeInputs": true` is passed:
|
|
165
|
+
- Text inputs and dates entered during the exploratory session are replaced with named parameters.
|
|
166
|
+
- Secrets entered via `browser_type_secret` are never hardcoded; they are replaced with environment variable or secret lookups.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 3. Replaying Compiled Automations
|
|
171
|
+
|
|
172
|
+
Compiled macros can be executed in sub-second time without LLM inference overhead using `browser_automation`:
|
|
173
|
+
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"macroId": "macro_8f7b2c",
|
|
177
|
+
"parameters": {
|
|
178
|
+
"startDate": "2026-09-01",
|
|
179
|
+
"endDate": "2026-09-03"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 4. Emitting Operational Thoughts (`browser_thoughts`)
|
|
187
|
+
|
|
188
|
+
Log agent rationale and internal reasoning directly to the Weavetab HUD and telemetry stream without bloating user chat responses:
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"thought": "Detected dynamic React hydration delay. Holding interaction until DOM mutation settles."
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
## site-learning
|
|
198
|
+
|
|
199
|
+
# Site Learning — Autonomous Workflow Memory
|
|
200
|
+
|
|
201
|
+
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.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 1. Session Start Protocol
|
|
206
|
+
|
|
207
|
+
On every session visiting a known or potentially-known site, run:
|
|
208
|
+
|
|
209
|
+
`json
|
|
210
|
+
{ "tool": "browser_pattern_learn", "action": "get", "origin": "https://github.com" }
|
|
211
|
+
`
|
|
212
|
+
|
|
213
|
+
Parse the response:
|
|
214
|
+
- known: false → site is new, proceed exploratorily, teach after completion
|
|
215
|
+
- known_patterns → list of named workflows with reliability scores
|
|
216
|
+
- quirks → auto-handle any listed quirks (cookie banners, rate limits) before main task
|
|
217
|
+
- ramework → adjust interaction strategy accordingly (React, Vue, etc.)
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 2. Fast-Path vs. Exploratory Decision
|
|
222
|
+
|
|
223
|
+
Use the _hint field or individual
|
|
224
|
+
|
|
225
|
+
| Reliability | Strikes | Strategy |
|
|
226
|
+
|---|---|---|
|
|
227
|
+
| ≥ 0.8, strikes = 0 | ✓ | **Fast path**: replay steps via rowser_burst directly |
|
|
228
|
+
| 0.5–0.79 | 0–1 | **Cautious path**: replay steps, verify success_indicator after each critical step |
|
|
229
|
+
| < 0.5 | any | **Re-explore**: navigate manually, collect correct steps, then teach |
|
|
230
|
+
| any | ≥ 3 | **Re-learn**: ignore cached pattern, re-explore, then call rowser_pattern_learn with updated steps |
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 3. Quirk Auto-Handling
|
|
235
|
+
|
|
236
|
+
If a profile has known quirks, resolve them immediately after navigation before executing your main task:
|
|
237
|
+
|
|
238
|
+
`
|
|
239
|
+
Profile quirks: { cookie_banner: { selector: "#cookie-consent", action: "click .accept-all", appears: "first_visit" } }
|
|
240
|
+
`
|
|
241
|
+
|
|
242
|
+
Execute the action before doing anything else. Never spend reasoning turns on a known dismissible popup.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## 4. Teaching a Workflow Pattern
|
|
247
|
+
|
|
248
|
+
After successfully completing a multi-step flow for the first time (or after re-learning):
|
|
249
|
+
|
|
250
|
+
`json
|
|
251
|
+
{
|
|
252
|
+
"tool": "browser_pattern_learn",
|
|
253
|
+
"origin": "https://github.com",
|
|
254
|
+
"action": "learn",
|
|
255
|
+
"name": "login_flow",
|
|
256
|
+
"steps": [
|
|
257
|
+
{ "tool": "browser_navigate", "target": "https://github.com/login" },
|
|
258
|
+
{ "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
|
|
259
|
+
{ "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
|
|
260
|
+
{ "tool": "browser_click", "target": "[type=submit]" }
|
|
261
|
+
],
|
|
262
|
+
"success_indicator": "a[aria-label='Homepage']",
|
|
263
|
+
"entry": "/login"
|
|
264
|
+
}
|
|
265
|
+
`
|
|
266
|
+
|
|
267
|
+
**Pattern Naming Rules**:
|
|
268
|
+
- Use snake_case
|
|
269
|
+
- Be descriptive: login_flow, pr_review, csv_export, checkout_flow
|
|
270
|
+
- Duplicate name on same origin = **update** (merge), never creates a second pattern
|
|
271
|
+
|
|
272
|
+
**Step Quality Rules**:
|
|
273
|
+
- Use semantic selectors: data-testid, id, ria-label, readable text-based selectors
|
|
274
|
+
- Avoid: .hash_abc123, div:nth-child(4), deep anonymous chains like div > div > div > span
|
|
275
|
+
(the engine automatically drops volatile selectors during compilation)
|
|
276
|
+
- For sensitive inputs, record the step with a placeholder like {{username}} — never hardcode credentials
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 5. Reliability Upkeep After Replay
|
|
281
|
+
|
|
282
|
+
Every time you replay a pattern, report the outcome:
|
|
283
|
+
|
|
284
|
+
`json
|
|
285
|
+
{
|
|
286
|
+
"tool": "browser_pattern_learn",
|
|
287
|
+
"origin": "https://github.com",
|
|
288
|
+
"action": "record_execution",
|
|
289
|
+
"name": "login_flow",
|
|
290
|
+
"success": true,
|
|
291
|
+
"duration_ms": 3100
|
|
292
|
+
}
|
|
293
|
+
`
|
|
294
|
+
|
|
295
|
+
The engine uses EWMA (α=0.15) to update the reliability score:
|
|
296
|
+
- Success run → reliability climbs toward 1.0 slowly
|
|
297
|
+
- Failure run → reliability drops; 3 consecutive failures trigger [RE-LEARN NEEDED] flag
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## 6. Recording a New Quirk
|
|
302
|
+
|
|
303
|
+
When you encounter a cookie consent modal, popup, or rate limit for the first time:
|
|
304
|
+
|
|
305
|
+
`json
|
|
306
|
+
{
|
|
307
|
+
"tool": "browser_pattern_learn",
|
|
308
|
+
"origin": "https://example.com",
|
|
309
|
+
"action": "record_quirk",
|
|
310
|
+
"quirk_key": "cookie_banner",
|
|
311
|
+
"quirk_data": {
|
|
312
|
+
"selector": "#cookie-consent",
|
|
313
|
+
"action": "click .accept-all",
|
|
314
|
+
"appears": "first_visit"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
`
|
|
318
|
+
|
|
319
|
+
Supported quirk_key values: cookie_banner,
|
|
320
|
+
|
|
321
|
+
For rate limits:
|
|
322
|
+
`json
|
|
323
|
+
{
|
|
324
|
+
"quirk_key": "rate_limit",
|
|
325
|
+
"quirk_data": { "threshold": "60req/min", "recovery": "wait 30s" }
|
|
326
|
+
}
|
|
327
|
+
`
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## 7. Anti-Patterns to Avoid
|
|
332
|
+
|
|
333
|
+
- **Never create per-session pattern names** like login_2026_09_16 — one name per workflow per origin, forever updated in place.
|
|
334
|
+
- **Never call rowser_pattern_learn in a loop** — one call per workflow completion. The write is idempotent (skips disk write if nothing changed).
|
|
335
|
+
- **Never store credentials in steps** — use placeholders or rowser_type_secret in actual execution.
|
|
336
|
+
- **Never write to ~/.weavetab/** — all memory belongs in ~/.weavetab-system/memory/sites/.
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## 8. Full Session Example: GitHub PR Review
|
|
341
|
+
|
|
342
|
+
`
|
|
343
|
+
1. browser_pattern_learn { action: "get", origin: "https://github.com" }
|
|
344
|
+
→ patterns: { pr_review: { reliability: 0.95, steps: 3 } }
|
|
345
|
+
→ quirks: {} (none)
|
|
346
|
+
|
|
347
|
+
2. Since reliability=0.95 (≥ 0.8): use fast path
|
|
348
|
+
browser_burst with the 3 stored steps
|
|
349
|
+
|
|
350
|
+
3. After completion:
|
|
351
|
+
browser_pattern_learn {
|
|
352
|
+
action: "record_execution",
|
|
353
|
+
name: "pr_review",
|
|
354
|
+
success: true,
|
|
355
|
+
duration_ms: 2800
|
|
356
|
+
}
|
|
357
|
+
`
|
|
358
|
+
|
|
359
|
+
Total agent turns for a known site: **3 tool calls** vs. potentially 12+ with full exploration.
|