@weavetab/skills 1.0.1 → 2.5.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -50
- package/ROUTER.md +43 -0
- package/bin/cli.js +232 -132
- package/browser/dom-strategy.md +119 -0
- package/browser/form-automation.md +87 -0
- package/browser/interaction-pipeline.md +216 -0
- package/browser/tab-and-window.md +136 -0
- package/desktop/desktop-targeting.md +85 -0
- package/desktop/electron-discovery.md +115 -0
- package/developer/github-forensics.md +74 -0
- package/dist/bundled/weavetab-all.md +1905 -0
- package/dist/bundled/weavetab-browser.md +501 -0
- package/dist/bundled/weavetab-desktop.md +176 -0
- package/dist/bundled/weavetab-developer.md +67 -0
- package/dist/bundled/weavetab-documents.md +142 -0
- package/dist/bundled/weavetab-memory.md +359 -0
- package/dist/bundled/weavetab-network-and-perf.md +223 -0
- package/dist/bundled/weavetab-plugins.md +78 -0
- package/dist/bundled/weavetab-resilience.md +216 -0
- package/dist/bundled/weavetab-security.md +87 -0
- package/dist/granular/browser_dom-strategy.md +119 -0
- package/dist/granular/browser_form-automation.md +87 -0
- package/dist/granular/browser_interaction-pipeline.md +216 -0
- package/dist/granular/browser_tab-and-window.md +136 -0
- package/dist/granular/desktop_desktop-targeting.md +85 -0
- package/dist/granular/desktop_electron-discovery.md +115 -0
- package/dist/granular/developer_github-forensics.md +74 -0
- package/dist/granular/documents_canvas-and-visual-capture.md +103 -0
- package/dist/granular/documents_office-document-ingestion.md +63 -0
- package/dist/granular/memory_selector-memory-system.md +127 -0
- package/dist/granular/memory_session-trail.md +95 -0
- package/dist/granular/memory_site-learning.md +180 -0
- package/dist/granular/network-and-perf_device-and-environment.md +87 -0
- package/dist/granular/network-and-perf_network-intercept-and-mock.md +84 -0
- package/dist/granular/network-and-perf_performance-and-vitals.md +84 -0
- package/dist/granular/plugins_hooks-and-overrides.md +36 -0
- package/dist/granular/plugins_plugin-runtime.md +60 -0
- package/dist/granular/resilience_loop-breaker.md +67 -0
- package/dist/granular/resilience_session-time-travel.md +131 -0
- package/dist/granular/resilience_stale-ref-recovery.md +53 -0
- package/dist/granular/security_rbac-and-policies.md +47 -0
- package/dist/granular/security_secret-containment-protocol.md +59 -0
- package/documents/canvas-and-visual-capture.md +103 -0
- package/documents/office-document-ingestion.md +63 -0
- package/evals/evaluator.js +146 -0
- package/evals/scenarios.json +238 -0
- package/memory/selector-memory-system.md +127 -0
- package/memory/session-trail.md +95 -0
- package/memory/site-learning.md +180 -0
- package/network-and-perf/device-and-environment.md +87 -0
- package/network-and-perf/network-intercept-and-mock.md +84 -0
- package/network-and-perf/performance-and-vitals.md +84 -0
- package/package.json +73 -42
- package/plugins/hooks-and-overrides.md +36 -0
- package/plugins/plugin-runtime.md +60 -0
- package/resilience/loop-breaker.md +67 -0
- package/resilience/session-time-travel.md +131 -0
- package/resilience/stale-ref-recovery.md +53 -0
- package/security/rbac-and-policies.md +47 -0
- package/security/secret-containment-protocol.md +59 -0
- package/skills.json +431 -308
- package/src/api.js +239 -128
- package/.github/FUNDING.yml +0 -2
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
- package/.github/ISSUE_TEMPLATE/skill_request.md +0 -24
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -23
- package/CONTRIBUTING.md +0 -34
- package/SECURITY.md +0 -26
- package/advanced/README.md +0 -2
- package/automation/README.md +0 -2
- package/general/captcha-evasion.md +0 -13
- package/general/context-awareness.md +0 -13
- package/general/cookie-consent.md +0 -13
- package/general/data-extraction.md +0 -13
- package/general/dynamic-interaction.md +0 -13
- package/general/error-recovery.md +0 -13
- package/general/file-upload.md +0 -13
- package/general/form-filling.md +0 -16
- package/general/guardrails.md +0 -13
- package/general/iframe-handling.md +0 -13
- package/general/infinite-scroll.md +0 -13
- package/general/login-flow.md +0 -16
- package/general/multi-tab-management.md +0 -13
- package/general/spa-navigation.md +0 -13
- package/general/table-scraping.md +0 -13
- package/scripts/build.js +0 -48
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: electron-discovery
|
|
3
|
+
domain: desktop
|
|
4
|
+
triggers:
|
|
5
|
+
- "discover electron apps"
|
|
6
|
+
- "detect desktop apps"
|
|
7
|
+
- "connect to slack"
|
|
8
|
+
- "connect to discord"
|
|
9
|
+
- "connect to vscode"
|
|
10
|
+
- "electron automation"
|
|
11
|
+
tools:
|
|
12
|
+
- "browser_detect"
|
|
13
|
+
weavetab: ">=2.5.0-beta.4"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Electron Discovery & Environment Handshake
|
|
17
|
+
|
|
18
|
+
Modern desktop applications (Discord, Slack, VS Code, Notion, Obsidian, Figma) are built on Chromium and Electron. Weavetab can inspect and drive these native applications through standard CDP interfaces without third-party drivers or OS-level accessibility hacks.
|
|
19
|
+
|
|
20
|
+
`browser_detect` is the **critical initialization handshake** tool. Every agent should call `browser_detect` before interacting with the user's desktop environment to gain immediate situational awareness.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 1. Running Discovery via `browser_detect`
|
|
25
|
+
|
|
26
|
+
Call `browser_detect` with empty parameters `{}`:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Response Schema:
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"available": [
|
|
36
|
+
{
|
|
37
|
+
"engine": "chromium",
|
|
38
|
+
"name": "Google Chrome",
|
|
39
|
+
"path": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"current": "chromium",
|
|
43
|
+
"configuredApps": [
|
|
44
|
+
{
|
|
45
|
+
"name": "discord",
|
|
46
|
+
"status": "running_no_debug",
|
|
47
|
+
"configuredPath": "C:\\Users\\username\\AppData\\Local\\Discord\\app-1.0.9256\\Discord.exe"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "slack",
|
|
51
|
+
"status": "connected",
|
|
52
|
+
"port": 9222,
|
|
53
|
+
"configuredPath": "C:\\Users\\username\\AppData\\Local\\slack\\app-4.38.125\\slack.exe",
|
|
54
|
+
"activeTabs": [
|
|
55
|
+
{
|
|
56
|
+
"id": "PAGE_1",
|
|
57
|
+
"title": "general - Weavetab Slack",
|
|
58
|
+
"url": "https://app.slack.com/client/..."
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "vscode",
|
|
64
|
+
"status": "offline",
|
|
65
|
+
"configuredPath": "C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"toolCoverage": {
|
|
69
|
+
"chromium": 100,
|
|
70
|
+
"firefox": 78,
|
|
71
|
+
"webkit": 55
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 2. Understanding Application Status
|
|
79
|
+
|
|
80
|
+
Each configured desktop app reports one of three distinct lifecycle statuses:
|
|
81
|
+
|
|
82
|
+
| Status | Meaning | Agent Action |
|
|
83
|
+
| :--- | :--- | :--- |
|
|
84
|
+
| **`connected`** | App is running with CDP remote debugging active. Weavetab has an active session. | Immediately interact using any tool with `"app": "<name>"`. Tabs and port are available. |
|
|
85
|
+
| **`running_no_debug`** | The app process is currently open on the user's OS, but was launched normally by the user without `--remote-debugging-port`. | Do NOT send click/type commands. To attach, inform the user or close and launch via `browser_navigate(app: "<name>")` so Weavetab supplies the debugging port. |
|
|
86
|
+
| **`offline`** | The application is not currently running on the OS. | Launch and attach in one step by calling `browser_navigate(app: "<name>")`. |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 3. Dynamic Squirrel Updates on Windows
|
|
91
|
+
|
|
92
|
+
On Windows, Squirrel-managed applications (Discord, Slack, Teams) update dynamically into versioned sibling directories (e.g. `Discord\app-1.0.9256\Discord.exe`).
|
|
93
|
+
|
|
94
|
+
Weavetab automatically handles this:
|
|
95
|
+
- If a configured path points to an outdated version or the parent folder, Weavetab scans the directory, resolves the highest semantic version folder (`app-1.0.xxxx`), and launches the valid executable.
|
|
96
|
+
- The dynamically resolved path is reported in `browser_detect` under `configuredPath`.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 4. Launching Desktop Apps Manually with Debugging
|
|
101
|
+
|
|
102
|
+
If the user prefers to launch apps manually from a terminal or shortcut with remote debugging enabled:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Discord
|
|
106
|
+
Discord.exe --remote-debugging-port=9222
|
|
107
|
+
|
|
108
|
+
# Slack
|
|
109
|
+
slack.exe --remote-debugging-port=9223
|
|
110
|
+
|
|
111
|
+
# VS Code
|
|
112
|
+
code.exe --remote-debugging-port=9225
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Once launched with `--remote-debugging-port`, `browser_detect` immediately reflects the application as connectable.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: github-forensics
|
|
3
|
+
domain: developer
|
|
4
|
+
triggers:
|
|
5
|
+
- "analyze github"
|
|
6
|
+
- "read repository"
|
|
7
|
+
- "check pull request"
|
|
8
|
+
- "github issues"
|
|
9
|
+
- "inspect repo"
|
|
10
|
+
tools:
|
|
11
|
+
- "browser_github"
|
|
12
|
+
weavetab: ">=2.5.0-beta.4"
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# GitHub Forensics & Repository Architecture Inspection
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 1. High-Level Repository Analysis (action: "analyze")
|
|
22
|
+
|
|
23
|
+
Quickly summarize repo structure, languages, dependency graphs, and recent commit frequency:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"action": "analyze",
|
|
28
|
+
"repo": "Weavetab/MCP"
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Reading Repository Source Files (action: "read")
|
|
35
|
+
|
|
36
|
+
Directly stream files and directories from any public or authenticated GitHub repo without cloning or burning API rate limits:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"action": "read",
|
|
41
|
+
"repo": "Weavetab/MCP",
|
|
42
|
+
"paths": ["src/server.ts"],
|
|
43
|
+
"line_range": [1, 200]
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 3. Pull Request Forensics (action: "pr")
|
|
50
|
+
|
|
51
|
+
Retrieve PR diffs, changed files, review comments, CI checks, and mergeability status:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"action": "pr",
|
|
56
|
+
"repo": "Weavetab/MCP",
|
|
57
|
+
"number": 42
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 4. Issue Triage & Search (action: "issues")
|
|
64
|
+
|
|
65
|
+
Query repository issue trackers with state, label, and keyword filters:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"action": "issues",
|
|
70
|
+
"repo": "Weavetab/MCP",
|
|
71
|
+
"state": "open",
|
|
72
|
+
"labels": ["bug", "priority"]
|
|
73
|
+
}
|
|
74
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: canvas-and-visual-capture
|
|
3
|
+
domain: documents
|
|
4
|
+
triggers:
|
|
5
|
+
- "take screenshot"
|
|
6
|
+
- "capture viewport"
|
|
7
|
+
- "export pdf"
|
|
8
|
+
- "canvas inspection"
|
|
9
|
+
- "extract design tokens"
|
|
10
|
+
tools:
|
|
11
|
+
- "browser_screenshot"
|
|
12
|
+
- "browser_viewport"
|
|
13
|
+
- "browser_canvas"
|
|
14
|
+
- "browser_pdf"
|
|
15
|
+
- "browser_extract_design"
|
|
16
|
+
- "browser_map"
|
|
17
|
+
- "browser_click"
|
|
18
|
+
weavetab: ">=2.5.0-beta.4"
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Visual Capture, Canvas Forensics & Design Extraction
|
|
22
|
+
|
|
23
|
+
Beyond textual DOM manipulation, modern web applications contain dynamic HTML5 canvas renderings (charts, maps, WebGL games), and agents often need high-fidelity visual artifacts.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 1. Targeted Screenshots (`browser_screenshot`)
|
|
28
|
+
|
|
29
|
+
Capture full page layouts, the visible viewport, or specific element bounding boxes:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"fullPage": true,
|
|
34
|
+
"format": "png"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or target a specific element ref:
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"ref": "w:55",
|
|
42
|
+
"format": "jpeg",
|
|
43
|
+
"quality": 80
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 2. PDF Document Generation (`browser_pdf`)
|
|
50
|
+
|
|
51
|
+
Render the current page into a print-ready PDF document with print CSS styles applied:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"landscape": false,
|
|
56
|
+
"printBackground": true,
|
|
57
|
+
"paperWidth": 8.5,
|
|
58
|
+
"paperHeight": 11
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 3. HTML5 Canvas Pixel Inspection & Visual Grounding (`browser_canvas` & `browser_map`)
|
|
65
|
+
|
|
66
|
+
When a chart or graphic is rendered via `<canvas>`, standard DOM reading tools cannot see individual buttons or nodes. You have two strategies:
|
|
67
|
+
|
|
68
|
+
### A. Set-of-Marks Visual Grounding (Recommended for Canvas UIs & WebGL)
|
|
69
|
+
Run `browser_map({ visual: "auto" })`. It detects canvas elements and high-contrast regions, attaches numbered badges `[1]…[N]`, and returns an annotated image:
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"visual": "auto"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
Then interact directly by mark number without guessing pixel coordinates:
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"mark": 3
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### B. Direct Canvas Pixel Export (`browser_canvas`)
|
|
83
|
+
To extract the raw image data or draw programmatic gesture paths:
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"ref": "w:19",
|
|
87
|
+
"action": "toDataURL"
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 4. Design System Extraction (`browser_extract_design`)
|
|
94
|
+
|
|
95
|
+
Reverse-engineer UI stylesheets, active CSS custom properties (variables), typography scales, and color palettes:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"selector": ".antigravity-hud-panel"
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Returns structured JSON representing colors, font families, shadows, and spacing tokens.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: office-document-ingestion
|
|
3
|
+
domain: documents
|
|
4
|
+
triggers:
|
|
5
|
+
- "read excel"
|
|
6
|
+
- "read docx"
|
|
7
|
+
- "parse csv"
|
|
8
|
+
- "spreadsheet"
|
|
9
|
+
- "word document"
|
|
10
|
+
- "parse table"
|
|
11
|
+
tools:
|
|
12
|
+
- "browser_office"
|
|
13
|
+
weavetab: ">=2.5.0-beta.4"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Office Document Ingestion: Word, Excel & CSV Parsing
|
|
17
|
+
|
|
18
|
+
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.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. Parsing Spreadsheets (`.xlsx`, `.csv`)
|
|
23
|
+
|
|
24
|
+
Stream structured sheet data, headers, and cell values:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"filePath": "C:/Users/fy2ne/Downloads/quarterly_revenue.xlsx",
|
|
29
|
+
"sheet": "Q3_Summary",
|
|
30
|
+
"headerRow": 1,
|
|
31
|
+
"maxRows": 100
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Response Example:
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"fileType": "xlsx",
|
|
39
|
+
"sheets": ["Q1", "Q2", "Q3_Summary"],
|
|
40
|
+
"rowCount": 45,
|
|
41
|
+
"data": [
|
|
42
|
+
{ "Department": "Engineering", "Budget": 1250000, "Actual": 1180000 },
|
|
43
|
+
{ "Department": "Marketing", "Budget": 600000, "Actual": 620000 }
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 2. Ingesting Word Documents (`.docx`)
|
|
51
|
+
|
|
52
|
+
Extract semantic paragraphs, document headings, tables, and lists:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"filePath": "C:/Users/fy2ne/Documents/service_agreement.docx",
|
|
57
|
+
"extractTables": true
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Operational Advantages:
|
|
62
|
+
- Eliminates the need for heavy external Python libraries or microservices.
|
|
63
|
+
- Safely sanitizes binary formats before passing content into LLM context.
|
|
@@ -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
|
+
|