@weavetab/skills 2.5.0 → 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.
Files changed (62) hide show
  1. package/README.md +108 -108
  2. package/ROUTER.md +43 -43
  3. package/bin/cli.js +232 -232
  4. package/browser/dom-strategy.md +121 -119
  5. package/browser/form-automation.md +84 -87
  6. package/browser/interaction-pipeline.md +242 -216
  7. package/browser/tab-and-window.md +136 -136
  8. package/desktop/desktop-targeting.md +85 -85
  9. package/desktop/electron-discovery.md +115 -115
  10. package/developer/github-forensics.md +89 -74
  11. package/dist/bundled/weavetab-all.md +1885 -1709
  12. package/dist/bundled/weavetab-browser.md +526 -501
  13. package/dist/bundled/weavetab-desktop.md +176 -176
  14. package/dist/bundled/weavetab-developer.md +84 -67
  15. package/dist/bundled/weavetab-documents.md +184 -142
  16. package/dist/bundled/weavetab-memory.md +259 -233
  17. package/dist/bundled/weavetab-network-and-perf.md +250 -223
  18. package/dist/bundled/weavetab-plugins.md +88 -83
  19. package/dist/bundled/weavetab-resilience.md +244 -216
  20. package/dist/bundled/weavetab-security.md +93 -87
  21. package/dist/granular/browser_dom-strategy.md +121 -119
  22. package/dist/granular/browser_form-automation.md +84 -87
  23. package/dist/granular/browser_interaction-pipeline.md +242 -216
  24. package/dist/granular/browser_tab-and-window.md +136 -136
  25. package/dist/granular/desktop_desktop-targeting.md +85 -85
  26. package/dist/granular/desktop_electron-discovery.md +115 -115
  27. package/dist/granular/developer_github-forensics.md +89 -74
  28. package/dist/granular/documents_canvas-and-visual-capture.md +117 -103
  29. package/dist/granular/documents_office-document-ingestion.md +91 -63
  30. package/dist/granular/memory_selector-memory-system.md +127 -127
  31. package/dist/granular/memory_session-trail.md +111 -95
  32. package/dist/granular/memory_site-learning.md +62 -53
  33. package/dist/granular/network-and-perf_device-and-environment.md +100 -87
  34. package/dist/granular/network-and-perf_network-intercept-and-mock.md +97 -84
  35. package/dist/granular/network-and-perf_performance-and-vitals.md +86 -84
  36. package/dist/granular/plugins_hooks-and-overrides.md +40 -35
  37. package/dist/granular/plugins_plugin-runtime.md +63 -63
  38. package/dist/granular/resilience_loop-breaker.md +72 -67
  39. package/dist/granular/resilience_session-time-travel.md +146 -131
  40. package/dist/granular/resilience_stale-ref-recovery.md +61 -53
  41. package/dist/granular/security_rbac-and-policies.md +50 -47
  42. package/dist/granular/security_secret-containment-protocol.md +62 -59
  43. package/documents/canvas-and-visual-capture.md +117 -103
  44. package/documents/office-document-ingestion.md +91 -63
  45. package/evals/evaluator.js +146 -146
  46. package/evals/scenarios.json +239 -239
  47. package/memory/selector-memory-system.md +127 -127
  48. package/memory/session-trail.md +111 -95
  49. package/memory/site-learning.md +61 -52
  50. package/network-and-perf/device-and-environment.md +100 -87
  51. package/network-and-perf/network-intercept-and-mock.md +97 -84
  52. package/network-and-perf/performance-and-vitals.md +86 -84
  53. package/package.json +74 -73
  54. package/plugins/hooks-and-overrides.md +40 -35
  55. package/plugins/plugin-runtime.md +63 -63
  56. package/resilience/loop-breaker.md +72 -67
  57. package/resilience/session-time-travel.md +146 -131
  58. package/resilience/stale-ref-recovery.md +61 -53
  59. package/security/rbac-and-policies.md +50 -47
  60. package/security/secret-containment-protocol.md +62 -59
  61. package/skills.json +425 -426
  62. package/src/api.js +239 -239
@@ -1,4 +1,4 @@
1
- # Weavetab Complete Enterprise Agent Suite (v2.5.0-beta.5)
1
+ # Weavetab Complete Enterprise Agent Suite (v2.5.1)
2
2
 
3
3
 
4
4
 
@@ -8,504 +8,529 @@
8
8
 
9
9
  # Weavetab Domain Profile: BROWSER
10
10
 
11
- Generated for @weavetab/skills v2.5.0-beta.5
11
+ Generated for @weavetab/skills v2.5.1
12
12
 
13
13
 
14
14
  ## dom-strategy
15
15
 
16
- # DOM Strategy & Token Conservation Engine
17
-
18
- When parsing modern web applications, naive DOM dumps can consume 50,000+ tokens and cause agent degradation. Weavetab provides a high-efficiency 4-tier reading architecture.
19
-
20
- ---
21
-
22
- ## 1. The 4-Tier Reading Filter
23
-
24
- Always select the narrowest tool that satisfies your immediate objective:
25
-
26
- ```
27
- ┌───────────────────────────────┐
28
- │ Do you need full structural │
29
- │ context or just a target? │
30
- └──────────────┬────────────────┘
31
- │
32
- ┌───────────────┴───────────────┐
33
- ▼ ▼
34
- [Specific Target] [Whole Document]
35
- │ │
36
- ┌────────┴────────┐ ┌───────┴────────┐
37
- ▼ ▼ ▼ ▼
38
- Target by text Target by role Read articles Interactive
39
- or keywords or hierarchy or prose data UI layout
40
- │ │ │ │
41
- ▼ ▼ ▼ ▼
42
- `browser_find` `browser_map` `browser_scrape` `browser_map`
43
- (lite: true) (lite: true)
44
- │
45
- [Sparse / Canvas / WebGL / <5 elements?]
46
- │
47
- ▼
48
- `browser_map`
49
- (visual: "auto")
50
- ```
51
-
52
- ### Tier 1: Targeted Keyword Jump (`browser_find`)
53
- Use `browser_find` when you already know the label, text snippet, placeholder, or aria-label of the target element.
54
- - **Latency**: Sub-5ms CDP search.
55
- - **Token Cost**: ~50–100 tokens (returns only matching candidate nodes).
56
-
57
- ```json
58
- {
59
- "query": "Sign In",
60
- "matchType": "contains",
61
- "visibleOnly": true
62
- }
63
- ```
64
-
65
- ### Tier 2: Token-Optimized DOM Walk (`browser_map` with `lite: true`)
66
- Use `browser_map` when you must understand the interactive structure of the page.
67
- - **Rule**: ALWAYS pass `"lite": true` unless you strictly need deeply nested non-interactive DOM trees.
68
- - **Efficiency**: Strips decorative wrappers, SVG paths, hidden containers, and scripts. Reduces payload by **85% to 95%**.
69
- - **Viewport Filtering**: Set `"includeOffscreen": false` to only inspect elements currently visible in the active viewport.
70
-
71
- ```json
72
- {
73
- "lite": true,
74
- "includeOffscreen": false,
75
- "maxDepth": 6
76
- }
77
- ```
78
-
79
- ### Tier 3: Markdown Prose & Data Ingestion (`browser_scrape`)
80
- Use `browser_scrape` when your objective is reading articles, blog posts, documentation, or legal terms rather than clicking buttons.
81
- - Converts HTML to clean, semantically structured Markdown.
82
- - Automatically handles readability filtering and removes advertising/cookie banners.
83
-
84
- ### Tier 4: Set-of-Marks Visual Grounding (`browser_map` with `visual: "auto"`)
85
- Use when target pages are canvas-heavy, WebGL, Figma, Google Sheets, or when standard `browser_map` returns < 5 interactive elements.
86
- - Injects temporary numbered badges `[1]…[N]` over interactive elements & canvas regions.
87
- - Captures an annotated screenshot + returns a structured mark list.
88
- - **Zero Page Pollution**: Strips badges immediately after capture.
89
- - **Action**: Pass `"mark": N` to `browser_click` to click the exact element without re-scanning the DOM.
90
-
91
- ```json
92
- {
93
- "visual": "auto"
94
- }
95
- ```
96
-
97
- ### Tier 5: Runtime State & JavaScript Evaluation (`browser_eval`)
98
- When DOM nodes are occluded or you need direct access to in-memory window state (e.g. Redux store, localStorage keys, or complex canvas dimensions), use `browser_eval` as an escape hatch:
99
- ```json
100
- {
101
- "expression": "window.__INITIAL_STATE__ || document.title"
102
- }
103
- ```
104
-
105
- ---
106
-
107
- ## 2. Volatile Ref ID & Visual Mark Navigation
108
-
109
- Weavetab maps elements to ephemeral handles (`w:NN`) and visual marks (`[1]…[N]`):
110
-
111
- ### Operational Rules:
112
- 1. **Never Construct Speculative CSS Selectors**: If an element has ref `w:14`, pass `"ref": "w:14"` to `browser_click`, `browser_fill`, `browser_type`.
113
- 2. **Visual Mark Targeting**: On canvas or unlabelled elements from `visual: "auto"`, pass `"mark": N` directly to `browser_click({ mark: N })`.
114
- 3. **Lifespan of Handles**: Ref IDs and marks invalidate on page navigation (`browser_navigate`) or heavy SPA re-renders.
16
+ # DOM Strategy & Token Conservation Engine
17
+
18
+ When parsing modern web applications, naive DOM dumps can consume 50,000+ tokens and cause agent degradation. Weavetab provides a high-efficiency 4-tier reading architecture.
19
+
20
+ ---
21
+
22
+ ## 1. The 4-Tier Reading Filter
23
+
24
+ Always select the narrowest tool that satisfies your immediate objective:
25
+
26
+ ```
27
+ ┌───────────────────────────────┐
28
+ │ Do you need full structural │
29
+ │ context or just a target? │
30
+ └──────────────┬────────────────┘
31
+ │
32
+ ┌───────────────┴───────────────┐
33
+ ▼ ▼
34
+ [Specific Target] [Whole Document]
35
+ │ │
36
+ ┌────────┴────────┐ ┌───────┴────────┐
37
+ ▼ ▼ ▼ ▼
38
+ Target by text Target by role Read articles Interactive
39
+ or keywords or hierarchy or prose data UI layout
40
+ │ │ │ │
41
+ ▼ ▼ ▼ ▼
42
+ `browser_find` `browser_map` `browser_scrape` `browser_map`
43
+ (lite: true) (lite: true)
44
+ │
45
+ [Sparse / Canvas / WebGL / <5 elements?]
46
+ │
47
+ ▼
48
+ `browser_map`
49
+ (visual: "auto")
50
+ ```
51
+
52
+ ### Tier 1: Targeted Keyword Jump (`browser_find`)
53
+ Use `browser_find` when you already know the label, text snippet, placeholder, or aria-label of the target element.
54
+ - **Latency**: Sub-5ms CDP search.
55
+ - **Token Cost**: ~50–100 tokens (returns only matching candidate nodes).
56
+
57
+ ```json
58
+ {
59
+ "query": "Sign In"
60
+ }
61
+ ```
62
+
63
+ Set `"all": true` to return every match (with `"limit"` capping the count, default 10) instead of only the first.
64
+
65
+ ### Tier 2: Token-Optimized DOM Walk (`browser_map` with `lite: true`)
66
+ Use `browser_map` when you must understand the interactive structure of the page.
67
+ - **Rule**: ALWAYS pass `"lite": true` unless you strictly need deeply nested non-interactive DOM trees.
68
+ - **Efficiency**: Strips decorative wrappers, SVG paths, hidden containers, and scripts. Reduces payload by **85% to 95%**.
69
+ - **Scope & filter**: Narrow a dense page with `"scope": "main"` (or `navigation`, `sidebar`, `form`, `modal`, `utility`) and `"query": "<substring>"` to filter by label/role.
70
+ - **Delta mode**: Set `"delta": true` on repeated maps to receive only what changed since the last call (up to 97% token savings).
71
+ - **Pruning**: Set `"prune": true` to drop hidden, non-interactive subtrees and collapse SVG icons in this snapshot.
72
+
73
+ ```json
74
+ {
75
+ "lite": true,
76
+ "scope": "main",
77
+ "delta": true
78
+ }
79
+ ```
80
+
81
+ ### Tier 3: Markdown Prose & Data Ingestion (`browser_scrape`)
82
+ Use `browser_scrape` when your objective is reading articles, blog posts, documentation, or legal terms rather than clicking buttons.
83
+ - Converts HTML to clean, semantically structured Markdown.
84
+ - Automatically handles readability filtering and removes advertising/cookie banners.
85
+
86
+ ### Tier 4: Set-of-Marks Visual Grounding (`browser_map` with `visual: "auto"`)
87
+ Use when target pages are canvas-heavy, WebGL, Figma, Google Sheets, or when standard `browser_map` returns < 5 interactive elements.
88
+ - Injects temporary numbered badges `[1]…[N]` over interactive elements & canvas regions.
89
+ - Captures an annotated screenshot + returns a structured mark list.
90
+ - **Zero Page Pollution**: Strips badges immediately after capture.
91
+ - **Action**: Pass `"mark": N` to `browser_click` to click the exact element without re-scanning the DOM.
92
+
93
+ ```json
94
+ {
95
+ "visual": "auto"
96
+ }
97
+ ```
98
+
99
+ ### Tier 5: Runtime State & JavaScript Evaluation (`browser_eval`)
100
+ When DOM nodes are occluded or you need direct access to in-memory window state (e.g. Redux store, localStorage keys, or complex canvas dimensions), use `browser_eval` as an escape hatch:
101
+ ```json
102
+ {
103
+ "expression": "window.__INITIAL_STATE__ || document.title"
104
+ }
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 2. Volatile Ref ID & Visual Mark Navigation
110
+
111
+ Weavetab maps elements to ephemeral handles (`w:NN`) and visual marks (`[1]…[N]`):
112
+
113
+ ### Operational Rules:
114
+ 1. **Never Construct Speculative CSS Selectors**: If an element has ref `w:14`, pass `"ref": "w:14"` to `browser_click`, `browser_fill`, `browser_type`.
115
+ 2. **Visual Mark Targeting**: On canvas or unlabelled elements from `visual: "auto"`, pass `"mark": N` directly to `browser_click({ mark: N })`.
116
+ 3. **Lifespan of Handles**: Ref IDs and marks invalidate on page navigation (`browser_navigate`) or heavy SPA re-renders.
115
117
  4. **Recovery on Invalidation**: If an action fails with `ELEMENT_NOT_FOUND` or `MARK_NOT_FOUND`, re-run `browser_map({ visual: "auto" })` to refresh active handles.
116
118
 
117
119
 
118
120
  ## form-automation
119
121
 
120
- # Form Automation: Atomic Multi-Field Execution
121
-
122
- Submitting complex web forms one field at a time wastes agent turns and increases the probability of layout shifts. Weavetab provides atomic multi-field batching and native dropdown selectors.
123
-
124
- ---
125
-
126
- ## 1. Atomic Multi-Field Filling (`browser_fill`)
127
-
128
- `browser_fill` populates multiple inputs, textareas, checkboxes, and radio buttons in a single CDP roundtrip.
129
-
130
- ```json
131
- {
132
- "fields": [
133
- {
134
- "ref": "w:12",
135
- "value": "Anas"
136
- },
137
- {
138
- "ref": "w:14",
139
- "value": "Khezaz"
140
- },
141
- {
142
- "ref": "w:16",
143
- "value": "contact@weavetab.com"
144
- },
145
- {
146
- "ref": "w:19",
147
- "value": true
148
- }
149
- ]
150
- }
151
- ```
152
-
153
- ### Supported Field Value Types:
154
- - **Text / Search / Email / Tel**: Provide a `string`.
155
- - **Checkbox**: Provide a `boolean` (`true` to check, `false` to uncheck).
156
- - **Radio Buttons**: Provide `true` on the matching option ref.
157
- - **ContentEditable**: Provide a `string` (automatically handles inner text formatting).
158
-
159
- ---
160
-
161
- ## 2. Dropdown & Select Automation (`browser_select`)
162
-
163
- Standard `<select>` elements and custom dropdowns often fail under simple click-and-type automation. `browser_select` dispatches native CDP change events.
164
-
165
- ```json
166
- {
167
- "ref": "w:31",
168
- "values": ["enterprise_tier"]
169
- }
170
- ```
171
-
172
- ### Multi-Select Support:
173
- For `<select multiple>` elements, pass an array of option values:
174
-
175
- ```json
176
- {
177
- "ref": "w:35",
178
- "values": ["us-east-1", "eu-central-1"]
179
- }
180
- ```
181
-
182
- ---
183
-
184
- ## 3. Form Submission Best Practices
185
-
186
- 1. **Pre-Validate State**: Before clicking Submit, confirm that required fields have passed HTML5/client-side validation (no active red borders or validation popups).
187
- 2. **Submit via Enter Key vs Click**:
188
- - If the submit button has a dynamic ref or changes during typing, send `"key": "Enter"` via `browser_key` inside the last filled text field.
189
- - Otherwise, locate the submit button via `browser_find` and click via `browser_click`.
122
+ # Form Automation: Atomic Multi-Field Execution
123
+
124
+ Submitting complex web forms one field at a time wastes agent turns and increases the probability of layout shifts. Weavetab provides atomic multi-field batching and native dropdown selectors.
125
+
126
+ ---
127
+
128
+ ## 1. Atomic Multi-Field Filling (`browser_fill`)
129
+
130
+ `browser_fill` populates multiple inputs, textareas, checkboxes, and radio buttons in a single CDP roundtrip.
131
+
132
+ ```json
133
+ {
134
+ "fields": [
135
+ {
136
+ "ref": "w:12",
137
+ "value": "Anas"
138
+ },
139
+ {
140
+ "ref": "w:14",
141
+ "value": "Khezaz"
142
+ },
143
+ {
144
+ "ref": "w:16",
145
+ "value": "contact@weavetab.com"
146
+ },
147
+ {
148
+ "ref": "w:19",
149
+ "value": "true"
150
+ }
151
+ ]
152
+ }
153
+ ```
154
+
155
+ ### Supported Field Value Types:
156
+ Every `value` is a **string**.
157
+ - **Text / Search / Email / Tel**: The literal text to type.
158
+ - **Checkbox / ARIA switch**: A truthy string (`"true"`, `"yes"`, `"checked"`, `"1"`, or `"on"`) checks it; anything else unchecks it.
159
+ - **Radio Buttons**: Set the matching option's ref to a truthy string to select it.
160
+ - **Select**: The option `value` or visible text to choose.
161
+ - **ContentEditable**: The text content to set (inner text formatting handled automatically).
162
+
163
+ ---
164
+
165
+ ## 2. Dropdown & Select Automation (`browser_select`)
166
+
167
+ Standard `<select>` elements and custom dropdowns often fail under simple click-and-type automation. `browser_select` dispatches native CDP change events.
168
+
169
+ ```json
170
+ {
171
+ "ref": "w:31",
172
+ "value": "enterprise_tier"
173
+ }
174
+ ```
175
+
176
+ `value` is a **single string** (required) and matches either the option's `value` or its visible text, trimmed. For a custom ARIA/React dropdown it opens the popover, scans `[role="option"]`/`[role="menuitem"]` candidates, and clicks the best match.
177
+
178
+ ### Multi-Select Support:
179
+ `browser_select` selects one option per call. For a `<select multiple>` element, call it once per option you want selected.
180
+
181
+ ---
182
+
183
+ ## 3. Form Submission Best Practices
184
+
185
+ 1. **Pre-Validate State**: Before clicking Submit, confirm that required fields have passed HTML5/client-side validation (no active red borders or validation popups).
186
+ 2. **Submit via Enter Key vs Click**:
187
+ - If the submit button has a dynamic ref or changes during typing, send `"key": "Enter"` via `browser_key` inside the last filled text field.
188
+ - Otherwise, locate the submit button via `browser_find` and click via `browser_click`.
190
189
  3. **Wait for Post-Submission Route**: Always follow form submission with `browser_wait` for URL changes or target DOM confirmation rather than immediately firing subsequent actions.
191
190
 
192
191
 
193
192
  ## interaction-pipeline
194
193
 
195
- # Interaction Pipeline: Physical & Synthetic Input Engine
196
-
197
- Weavetab executes browser interactions via direct Chrome DevTools Protocol (CDP) dispatch, bypassing synthetic JavaScript event limitations and anti-automation tripwires.
198
-
199
- ---
200
-
201
- ## 1. Clicking Elements (`browser_click`)
202
-
203
- Execute deterministic clicks on DOM elements using volatile handles (`ref`), CSS selectors, or exact coordinates.
204
-
205
- ```json
206
- {
207
- "ref": "w:23",
208
- "clickCount": 1,
209
- "button": "left"
210
- }
211
- ```
212
-
213
- ### Advanced Modifiers:
214
- - **Double Click**: Set `"clickCount": 2` for inline editing or selecting text blocks.
215
- - **Context Menu**: Set `"button": "right"` to trigger native context menus.
216
- - **Modifier Keys**: Pass `"modifiers": ["Control"]` or `["Meta"]` for multi-selection or opening links in background tabs.
217
-
218
- ---
219
-
220
- ## 2. Text Input (`browser_type`)
221
-
222
- Simulate natural keystrokes into input fields, textareas, and `contenteditable` elements.
223
-
224
- ```json
225
- {
226
- "ref": "w:18",
227
- "text": "Enterprise Search Query",
228
- "clear": true,
229
- "delay": 20
230
- }
231
- ```
232
-
233
- > [!CAUTION]
234
- > **Secret Boundary Enforcement**:
235
- > NEVER use `browser_type` for passwords, API tokens, or payment card data. Always route sensitive credentials through [`security/secret-containment-protocol.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/security/secret-containment-protocol.md) via `browser_type_secret`.
236
-
237
- ---
238
-
239
- ## 3. Physical Pointer Trajectories (`browser_pointer`)
240
-
241
- Handle complex drag-and-drop interactions, canvas sketching, hover-activated navigation flyouts, and custom sliders.
242
-
243
- ### Hover / Mouse Move:
244
- ```json
245
- {
246
- "action": "move",
247
- "x": 450,
248
- "y": 180
249
- }
250
- ```
251
-
252
- ### Drag & Drop Pipeline:
253
- ```json
254
- // Step 1: Move to origin & press mouse
255
- { "action": "move", "x": 200, "y": 300 }
256
- { "action": "down", "button": "left" }
257
-
258
- // Step 2: Smooth trajectory to destination
259
- { "action": "move", "x": 600, "y": 300 }
260
-
261
- // Step 3: Release
262
- { "action": "up", "button": "left" }
263
- ```
264
-
265
- ---
266
-
267
- ## 4. Keystrokes & Shortcuts (`browser_key`)
268
-
269
- Trigger keyboard shortcuts, navigation keys, and dialog dismissals.
270
-
271
- ```json
272
- {
273
- "key": "Enter"
274
- }
275
- ```
276
-
277
- ### High-Frequency Key Combos:
278
- - **Select All & Delete**: Send `"key": "a"`, `"modifiers": ["Control"]` (or `["Meta"]` on macOS), followed by `"key": "Backspace"`.
279
- - **Dismiss Overlays**: Send `"key": "Escape"`.
280
- - **Form Tab Navigation**: Send `"key": "Tab"`.
281
-
282
- ---
283
-
284
- ## 5. OS File Upload Bypass (`browser_upload`)
285
-
286
- Native operating system file picker dialogs block autonomous agent execution because they operate outside the browser DOM. Weavetab bypasses this entirely using CDP's `DOM.setFileInputFiles`.
287
-
288
- ```json
289
- {
290
- "ref": "w:41",
291
- "files": [
292
- "C:/Users/fy2ne/Documents/contract.pdf",
293
- "C:/Users/fy2ne/Documents/financial_report.xlsx"
294
- ]
295
- }
296
- ```
297
-
298
- - **Targeting**: Supply the volatile handle `ref` or CSS selector for the `<input type="file">`.
299
- - **Hidden Inputs**: `browser_upload` automatically handles `display: none` file inputs commonly used in custom drag-and-drop upload widgets.
300
-
301
- ---
302
-
303
- ## 6. Viewport & Element Scrolling (`browser_scroll`)
304
-
305
- Scroll the entire page viewport or scroll specific scrollable containers:
306
-
307
- ```json
308
- {
309
- "direction": "down",
310
- "amount": 500
311
- }
312
- ```
313
-
314
- Or scroll a specific element container:
315
- ```json
316
- {
317
- "ref": "w:12",
318
- "direction": "down",
319
- "amount": 300
320
- }
321
- ```
322
-
323
- ---
324
-
325
- ## 7. Native Dialog Handling (`browser_dialog`)
326
-
327
- Handle native JavaScript `alert`, `confirm`, `prompt`, or `beforeunload` dialogs that block page execution:
328
-
329
- ```json
330
- {
331
- "action": "accept",
332
- "promptText": "Confirmed"
333
- }
334
- ```
335
-
336
- ---
337
-
338
- ## 8. High-Speed Action Batches (`browser_burst`)
339
-
340
- Execute multiple sequential micro-actions in a single CDP roundtrip without waiting for intermediate LLM turns:
341
-
342
- ```json
343
- {
344
- "steps": [
345
- { "tool": "browser_fill", "ref": "w:10", "value": "search query" },
346
- { "tool": "click_and_wait", "ref": "w:15" }
347
- ]
348
- }
349
- ```
350
- *(Accepts both `steps` and `actions`, with arguments either nested under `args` or specified flat on the step object).*
351
-
352
- ---
353
-
354
- ## 9. Visual Element Highlighting & Consideration (`browser_highlight`)
355
-
356
- Draw visual consideration, target lock, danger/success, or shimmer overlays without mutating the DOM. Supports multi-element candidate evaluation:
357
-
358
- ```json
359
- {
360
- "refs": ["w:12", "w:15", "w:23"],
361
- "style": "consideration",
362
- "label": "Evaluating form options",
363
- "duration": 2000
364
- }
365
- ```
366
-
367
- ### Presentation Styles:
368
- - `"consideration"`: Soft pulsing cyan/blue outline (`#38bdf8`) with ambient glow — ideal when weighing multiple interactive candidates.
369
- - `"target"`: High-contrast amber lock-on ring (`#f59e0b`) before executing high-impact clicks.
370
- - `"danger"`: Red warning border (`#ef4444`) for destructive buttons (Delete, Reset, Purge).
371
- - `"success"`: Emerald glow (`#10b981`) confirming completed actions.
372
- - `"shimmer"`: Rapid purple accent wave (default for quick inspection).
373
-
374
- ---
375
-
376
- ## 10. System Clipboard Bridging (`browser_clipboard`)
377
-
378
- Read or write system clipboard text during automation:
379
-
380
- ```json
381
- {
382
- "action": "write",
383
- "text": "AuthToken_xyz987"
384
- }
194
+ # Interaction Pipeline: Physical & Synthetic Input Engine
195
+
196
+ Weavetab executes browser interactions via direct Chrome DevTools Protocol (CDP) dispatch, bypassing synthetic JavaScript event limitations and anti-automation tripwires.
197
+
198
+ ---
199
+
200
+ ## 1. Clicking Elements (`browser_click`)
201
+
202
+ Execute deterministic clicks on DOM elements using volatile handles (`ref`/`id`), CSS selectors, labels, marks, or coordinates.
203
+
204
+ ```json
205
+ {
206
+ "ref": "w:23"
207
+ }
208
+ ```
209
+
210
+ ### Targeting & Options:
211
+ - **By ref**: pass `id` (or its alias `ref`) from `browser_map`.
212
+ - **By selector / label**: pass `selector` (alias `target`) or `label` (visible text or aria-label).
213
+ - **By visual mark**: pass `mark: N` from `browser_map({ visual: "auto" })` for canvas/WebGL pages.
214
+ - **By coordinates**: pass `x`/`y`, or a raw `backendNodeId`.
215
+ - **`intent`**: an optional semantic description (e.g. `"submit login form"`) — Weavetab checks learned memory first and clicks a high-confidence selector without DOM resolution.
216
+ - **`include_map`**: set `true` to return a refreshed page map with the result.
217
+
218
+ > `browser_click` always dispatches a left-button single click. To double-click or right-click, use `browser_pointer` (`double_click`) or open the native context menu another way.
219
+
220
+ ---
221
+
222
+ ## 2. Text Input (`browser_type`)
223
+
224
+ Simulate natural keystrokes into input fields, textareas, and `contenteditable` elements.
225
+
226
+ ```json
227
+ {
228
+ "ref": "w:18",
229
+ "text": "Enterprise Search Query",
230
+ "clearFirst": true
231
+ }
232
+ ```
233
+
234
+ Useful options:
235
+ - **`clearFirst`**: wipe existing field content before typing.
236
+ - **`paste`**: instant paste mode via clipboard, auto-enabled for text longer than 8 chars.
237
+ - If `id`/`selector`/`label` is omitted, text is typed into the currently focused element.
238
+
239
+ > [!CAUTION]
240
+ > **Secret Boundary Enforcement**:
241
+ > NEVER use `browser_type` for passwords, API tokens, or payment card data. Always route sensitive credentials through [`security/secret-containment-protocol.md`](../security/secret-containment-protocol.md) via `browser_type_secret`.
242
+
243
+ ---
244
+
245
+ ## 3. Physical Pointer Trajectories (`browser_pointer`)
246
+
247
+ Handle complex drag-and-drop interactions, canvas sketching, hover-activated navigation flyouts, and custom sliders.
248
+
249
+ Actions: `hover`, `click`, `double_click`, `drag_and_drop`, `hover_chain`.
250
+
251
+ ### Hover:
252
+ ```json
253
+ {
254
+ "action": "hover",
255
+ "ref": "w:12",
256
+ "waitForChild": ".submenu",
257
+ "holdMs": 200
258
+ }
259
+ ```
260
+
261
+ ### Double Click:
262
+ ```json
263
+ {
264
+ "action": "double_click",
265
+ "ref": "w:30"
266
+ }
267
+ ```
268
+
269
+ ### Drag & Drop Pipeline:
270
+ A single `drag_and_drop` action drives the whole drag — supply the source (`ref`/`selector`/`x`/`y`) and destination (`end_ref`/`end_selector`/`end_x`/`end_y`):
271
+ ```json
272
+ {
273
+ "action": "drag_and_drop",
274
+ "ref": "w:20",
275
+ "end_ref": "w:35"
276
+ }
277
+ ```
278
+
279
+ ### Multi-Level Flyout Menus (`hover_chain`):
280
+ Hover each element in order and click the last one (e.g. Photoshop/Figma-style menus):
281
+ ```json
282
+ {
283
+ "hover_chain": ["File", "Export As", "PNG"]
284
+ }
285
+ ```
286
+
287
+ ---
288
+
289
+ ## 4. Keystrokes & Shortcuts (`browser_key`)
290
+
291
+ Trigger keyboard shortcuts, navigation keys, and dialog dismissals.
292
+
293
+ ```json
294
+ {
295
+ "key": "Enter"
296
+ }
297
+ ```
298
+
299
+ ### High-Frequency Key Combos:
300
+ - **Select All & Delete**: Send `"key": "a"` with `"modifiers": ["Ctrl"]` (or `["Meta"]` on macOS), followed by `"key": "Backspace"`.
301
+ - **Dismiss Overlays**: Send `"key": "Escape"`.
302
+ - **Form Tab Navigation**: Send `"key": "Tab"`.
303
+
304
+ Valid modifiers are `Alt`, `Ctrl`, `Meta`, and `Shift`.
305
+
306
+ ---
307
+
308
+ ## 5. OS File Upload Bypass (`browser_upload`)
309
+
310
+ Native operating system file picker dialogs block autonomous agent execution because they operate outside the browser DOM. Weavetab bypasses this entirely using CDP's `DOM.setFileInputFiles`.
311
+
312
+ ```json
313
+ {
314
+ "nodeId": 4821,
315
+ "filePaths": [
316
+ "C:/Users/me/Documents/contract.pdf",
317
+ "C:/Users/me/Documents/financial_report.xlsx"
318
+ ]
319
+ }
320
+ ```
321
+
322
+ - **Targeting**: Supply the CDP `nodeId` (backendNodeId) of the `<input type="file">` element — obtain it from `browser_map`, `browser_inspect`, or `browser_find` output.
323
+ - **Hidden Inputs**: `browser_upload` automatically handles `display: none` file inputs commonly used in custom drag-and-drop upload widgets.
324
+
325
+ ---
326
+
327
+ ## 6. Viewport & Element Scrolling (`browser_scroll`)
328
+
329
+ Scroll the entire page viewport or scroll specific scrollable containers:
330
+
331
+ ```json
332
+ {
333
+ "direction": "down",
334
+ "distance": 500
335
+ }
336
+ ```
337
+
338
+ Or scroll a specific element container:
339
+ ```json
340
+ {
341
+ "ref": "w:12",
342
+ "direction": "down",
343
+ "distance": 300
344
+ }
345
+ ```
346
+
347
+ ---
348
+
349
+ ## 7. Native Dialog Handling (`browser_dialog`)
350
+
351
+ Handle native JavaScript `alert`, `confirm`, `prompt`, or `beforeunload` dialogs that block page execution:
352
+
353
+ ```json
354
+ {
355
+ "action": "accept",
356
+ "promptText": "Confirmed"
357
+ }
358
+ ```
359
+
360
+ ---
361
+
362
+ ## 8. High-Speed Action Batches (`browser_burst`)
363
+
364
+ Execute multiple sequential micro-actions in a single CDP roundtrip without waiting for intermediate LLM turns:
365
+
366
+ ```json
367
+ {
368
+ "steps": [
369
+ { "tool": "browser_type", "ref": "w:10", "text": "search query" },
370
+ { "tool": "click_and_wait", "ref": "w:15" }
371
+ ]
372
+ }
373
+ ```
374
+
375
+ Macro steps (`type_and_send`, `click_and_wait`, `navigate_and_read`, `scroll_and_read`, `fill_form`) collapse common two-step patterns into one entry. *(Accepts both `steps` and `actions`, with arguments either nested under `args` or specified flat on the step object.)*
376
+
377
+ ---
378
+
379
+ ## 9. Visual Element Highlighting & Consideration (`browser_highlight`)
380
+
381
+ Draw visual consideration, target lock, danger/success, or shimmer overlays without mutating the DOM. Supports multi-element candidate evaluation:
382
+
383
+ ```json
384
+ {
385
+ "refs": ["w:12", "w:15", "w:23"],
386
+ "style": "consideration",
387
+ "label": "Evaluating form options",
388
+ "duration": 2000
389
+ }
390
+ ```
391
+
392
+ ### Presentation Styles:
393
+ - `"consideration"`: Soft pulsing cyan/blue outline (`#38bdf8`) with ambient glow — ideal when weighing multiple interactive candidates.
394
+ - `"target"`: High-contrast amber lock-on ring (`#f59e0b`) before executing high-impact clicks.
395
+ - `"danger"`: Red warning border (`#ef4444`) for destructive buttons (Delete, Reset, Purge).
396
+ - `"success"`: Emerald glow (`#10b981`) confirming completed actions.
397
+ - `"shimmer"`: Rapid purple accent wave (default for quick inspection).
398
+
399
+ ---
400
+
401
+ ## 10. System Clipboard Bridging (`browser_clipboard`)
402
+
403
+ Read or write system clipboard text during automation:
404
+
405
+ ```json
406
+ {
407
+ "action": "write",
408
+ "text": "AuthToken_xyz987"
409
+ }
385
410
  ```
386
411
 
387
412
 
388
413
  ## tab-and-window
389
414
 
390
- # Tab & Window Lifecycle Management
391
-
392
- Multi-tab workflows (OAuth popups, payment gateways, documentation references, desktop application windows) require deterministic tab switching, window focusing, and failure recovery. `browser_tabs` controls all CDP page and window targets.
393
-
394
- ---
395
-
396
- ## 1. Tab Discovery & Target Enumeration
397
-
398
- Inspect all active targets, open URLs, and page titles:
399
-
400
- ```json
401
- {
402
- "action": "list"
403
- }
404
- ```
405
-
406
- To list targets inside a specific desktop app (e.g. Discord, Slack):
407
- ```json
408
- {
409
- "action": "list",
410
- "app": "discord"
411
- }
412
- ```
413
-
414
- > [!TIP]
415
- > Always pass `"app": "<name>"` when inspecting desktop applications. This guarantees that Weavetab does not launch or query the web browser.
416
-
417
- ---
418
-
419
- ## 2. Opening Tabs & Smart Reuse
420
-
421
- Open a target URL. By default, `reuse: true` will focus an existing tab if the URL is already loaded:
422
-
423
- ```json
424
- {
425
- "action": "open",
426
- "url": "https://github.com"
427
- }
428
- ```
429
-
430
- To force opening a brand-new duplicate tab instead of reusing:
431
- ```json
432
- {
433
- "action": "open",
434
- "url": "https://github.com",
435
- "reuse": false
436
- }
437
- ```
438
-
439
- ---
440
-
441
- ## 3. Context Switching
442
-
443
- Switch active agent focus between open tabs:
444
-
445
- ```json
446
- {
447
- "action": "switch",
448
- "tabId": "TARGET_PAGE_ID"
449
- }
450
- ```
451
-
452
- ---
453
-
454
- ## 4. Closing Tabs & Batch Cleanup
455
-
456
- Close a single tab:
457
- ```json
458
- {
459
- "action": "close",
460
- "tabId": "TARGET_PAGE_ID"
461
- }
462
- ```
463
-
464
- Close multiple tabs simultaneously in a single round-trip:
465
- ```json
466
- {
467
- "action": "close",
468
- "tabIds": ["TARGET_1", "TARGET_2", "TARGET_3"]
469
- }
470
- ```
471
-
472
- ---
473
-
474
- ## 5. Native Window Management
475
-
476
- List native OS windows:
477
- ```json
478
- {
479
- "action": "list_windows"
480
- }
481
- ```
482
-
483
- Bring a specific native window to the foreground:
484
- ```json
485
- {
486
- "action": "focus_window",
487
- "windowId": 1
488
- }
489
- ```
490
-
491
- ---
492
-
493
- ## 6. Duplicate Consolidation & Auto-Heal
494
-
495
- Deduplicate redundant tabs across the session:
496
- ```json
497
- {
498
- "action": "consolidate"
499
- }
500
- ```
501
-
502
- If a target page crashes or detaches due to memory limits:
503
- ```json
504
- {
505
- "action": "heal"
506
- }
507
- ```
508
-
415
+ # Tab & Window Lifecycle Management
416
+
417
+ Multi-tab workflows (OAuth popups, payment gateways, documentation references, desktop application windows) require deterministic tab switching, window focusing, and failure recovery. `browser_tabs` controls all CDP page and window targets.
418
+
419
+ ---
420
+
421
+ ## 1. Tab Discovery & Target Enumeration
422
+
423
+ Inspect all active targets, open URLs, and page titles:
424
+
425
+ ```json
426
+ {
427
+ "action": "list"
428
+ }
429
+ ```
430
+
431
+ To list targets inside a specific desktop app (e.g. Discord, Slack):
432
+ ```json
433
+ {
434
+ "action": "list",
435
+ "app": "discord"
436
+ }
437
+ ```
438
+
439
+ > [!TIP]
440
+ > Always pass `"app": "<name>"` when inspecting desktop applications. This guarantees that Weavetab does not launch or query the web browser.
441
+
442
+ ---
443
+
444
+ ## 2. Opening Tabs & Smart Reuse
445
+
446
+ Open a target URL. By default, `reuse: true` will focus an existing tab if the URL is already loaded:
447
+
448
+ ```json
449
+ {
450
+ "action": "open",
451
+ "url": "https://github.com"
452
+ }
453
+ ```
454
+
455
+ To force opening a brand-new duplicate tab instead of reusing:
456
+ ```json
457
+ {
458
+ "action": "open",
459
+ "url": "https://github.com",
460
+ "reuse": false
461
+ }
462
+ ```
463
+
464
+ ---
465
+
466
+ ## 3. Context Switching
467
+
468
+ Switch active agent focus between open tabs:
469
+
470
+ ```json
471
+ {
472
+ "action": "switch",
473
+ "tabId": "TARGET_PAGE_ID"
474
+ }
475
+ ```
476
+
477
+ ---
478
+
479
+ ## 4. Closing Tabs & Batch Cleanup
480
+
481
+ Close a single tab:
482
+ ```json
483
+ {
484
+ "action": "close",
485
+ "tabId": "TARGET_PAGE_ID"
486
+ }
487
+ ```
488
+
489
+ Close multiple tabs simultaneously in a single round-trip:
490
+ ```json
491
+ {
492
+ "action": "close",
493
+ "tabIds": ["TARGET_1", "TARGET_2", "TARGET_3"]
494
+ }
495
+ ```
496
+
497
+ ---
498
+
499
+ ## 5. Native Window Management
500
+
501
+ List native OS windows:
502
+ ```json
503
+ {
504
+ "action": "list_windows"
505
+ }
506
+ ```
507
+
508
+ Bring a specific native window to the foreground:
509
+ ```json
510
+ {
511
+ "action": "focus_window",
512
+ "windowId": 1
513
+ }
514
+ ```
515
+
516
+ ---
517
+
518
+ ## 6. Duplicate Consolidation & Auto-Heal
519
+
520
+ Deduplicate redundant tabs across the session:
521
+ ```json
522
+ {
523
+ "action": "consolidate"
524
+ }
525
+ ```
526
+
527
+ If a target page crashes or detaches due to memory limits:
528
+ ```json
529
+ {
530
+ "action": "heal"
531
+ }
532
+ ```
533
+
509
534
  The auto-heal routine re-establishes CDP protocol sessions, reconnects event listeners, and synchronizes the active page target.
510
535
 
511
536
 
@@ -515,1396 +540,1547 @@ The auto-heal routine re-establishes CDP protocol sessions, reconnects event lis
515
540
 
516
541
  # Weavetab Domain Profile: DESKTOP
517
542
 
518
- Generated for @weavetab/skills v2.5.0-beta.5
543
+ Generated for @weavetab/skills v2.5.1
519
544
 
520
545
 
521
546
  ## desktop-targeting
522
547
 
523
- # Desktop App Targeting & Multi-Window Routing
524
-
525
- Once a desktop application is detected via `browser_detect`, every standard Weavetab tool can be scoped directly to that desktop application without opening or disturbing the user's web browser.
526
-
527
- ---
528
-
529
- ## 1. Direct App Parameter Routing
530
-
531
- Pass `"app": "<application_name>"` to target the Electron application.
532
-
533
- ### Example: Reading Discord Channels
534
- ```json
535
- // Tool: browser_map
536
- {
537
- "app": "discord",
538
- "scope": "main_content"
539
- }
540
- ```
541
-
542
- ### Example: Sending a Message in Discord
543
- ```json
544
- // Tool: browser_type
545
- {
546
- "app": "discord",
547
- "ref": "w:88",
548
- "text": "Deployment v2.5.0-beta.3 completed successfully."
549
- }
550
- ```
551
-
552
- ### Example: Listing Discord Tabs/Windows
553
- ```json
554
- // Tool: browser_tabs
555
- {
556
- "action": "list",
557
- "app": "discord"
558
- }
559
- ```
560
-
561
- > [!IMPORTANT]
562
- > Always pass `"app": "discord"` (or the target app name) to `browser_tabs` when working with desktop apps. This prevents Weavetab from accidentally launching or switching to the web browser.
563
-
564
- ---
565
-
566
- ## 2. Smart Domain Auto-Routing & Sticky Context
567
-
568
- Weavetab features automatic target resolution to eliminate accidental browser popups:
569
-
570
- ### A. Automatic Domain Matching
571
- If you call `browser_navigate` or `browser_tabs(action: "open")` with a known domain (e.g. `discord.com`, `slack.com`, `linear.app`, `notion.so`), Weavetab automatically routes the command to the configured Electron desktop application.
572
-
573
- ### B. Sticky App Sessions
574
- When you interact with an Electron application (e.g., clicking or typing in Discord), Weavetab remembers the active application context. If a subsequent tool call omits `app` and no web browser instance is active, Weavetab stays attached to the active desktop app rather than spawning an unwanted Chrome window.
575
-
576
- ### C. Explicit Browser Override
577
- If you specifically want to open a URL in the web browser instead of a desktop application, pass `"app": "browser"`.
578
-
579
- ---
580
-
581
- ## 3. Multi-Window Focus Management
582
-
583
- Some Electron apps open secondary windows (e.g. popout editors, settings panels, or call windows).
584
-
585
- 1. Use `browser_tabs(action: "list", app: "discord")` to view all open windows and page targets for that specific app.
586
- 2. Switch focus between windows using `browser_tabs(action: "switch", tabId: "<id>", app: "discord")`.
587
- 3. To bring a specific native window to the foreground, use `browser_tabs(action: "focus_window", windowId: <id>, app: "discord")`.
548
+ # Desktop App Targeting & Multi-Window Routing
588
549
 
550
+ Once a desktop application is detected via `browser_detect`, every standard Weavetab tool can be scoped directly to that desktop application without opening or disturbing the user's web browser.
589
551
 
590
- ## electron-discovery
552
+ ---
591
553
 
592
- # Electron Discovery & Environment Handshake
593
-
594
- 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.
595
-
596
- `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.
597
-
598
- ---
599
-
600
- ## 1. Running Discovery via `browser_detect`
601
-
602
- Call `browser_detect` with empty parameters `{}`:
603
-
604
- ```json
605
- {}
606
- ```
607
-
608
- ### Response Schema:
609
- ```json
610
- {
611
- "available": [
612
- {
613
- "engine": "chromium",
614
- "name": "Google Chrome",
615
- "path": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
616
- }
617
- ],
618
- "current": "chromium",
619
- "configuredApps": [
620
- {
621
- "name": "discord",
622
- "status": "running_no_debug",
623
- "configuredPath": "C:\\Users\\username\\AppData\\Local\\Discord\\app-1.0.9256\\Discord.exe"
624
- },
625
- {
626
- "name": "slack",
627
- "status": "connected",
628
- "port": 9222,
629
- "configuredPath": "C:\\Users\\username\\AppData\\Local\\slack\\app-4.38.125\\slack.exe",
630
- "activeTabs": [
631
- {
632
- "id": "PAGE_1",
633
- "title": "general - Weavetab Slack",
634
- "url": "https://app.slack.com/client/..."
635
- }
636
- ]
637
- },
638
- {
639
- "name": "vscode",
640
- "status": "offline",
641
- "configuredPath": "C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
642
- }
643
- ],
644
- "toolCoverage": {
645
- "chromium": 100,
646
- "firefox": 78,
647
- "webkit": 55
648
- }
649
- }
650
- ```
651
-
652
- ---
653
-
654
- ## 2. Understanding Application Status
655
-
656
- Each configured desktop app reports one of three distinct lifecycle statuses:
657
-
658
- | Status | Meaning | Agent Action |
659
- | :--- | :--- | :--- |
660
- | **`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. |
661
- | **`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. |
662
- | **`offline`** | The application is not currently running on the OS. | Launch and attach in one step by calling `browser_navigate(app: "<name>")`. |
663
-
664
- ---
665
-
666
- ## 3. Dynamic Squirrel Updates on Windows
667
-
668
- On Windows, Squirrel-managed applications (Discord, Slack, Teams) update dynamically into versioned sibling directories (e.g. `Discord\app-1.0.9256\Discord.exe`).
669
-
670
- Weavetab automatically handles this:
671
- - 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.
672
- - The dynamically resolved path is reported in `browser_detect` under `configuredPath`.
673
-
674
- ---
675
-
676
- ## 4. Launching Desktop Apps Manually with Debugging
677
-
678
- If the user prefers to launch apps manually from a terminal or shortcut with remote debugging enabled:
679
-
680
- ```bash
681
- # Discord
682
- Discord.exe --remote-debugging-port=9222
683
-
684
- # Slack
685
- slack.exe --remote-debugging-port=9223
686
-
687
- # VS Code
688
- code.exe --remote-debugging-port=9225
689
- ```
690
-
691
- Once launched with `--remote-debugging-port`, `browser_detect` immediately reflects the application as connectable.
554
+ ## 1. Direct App Parameter Routing
692
555
 
556
+ Pass `"app": "<application_name>"` to target the Electron application.
693
557
 
694
- # ====================================================
695
- # DOMAIN: MEMORY
696
- # ====================================================
558
+ ### Example: Reading Discord Channels
559
+ ```json
560
+ // Tool: browser_map
561
+ {
562
+ "app": "discord",
563
+ "scope": "main_content"
564
+ }
565
+ ```
697
566
 
698
- # Weavetab Domain Profile: MEMORY
567
+ ### Example: Sending a Message in Discord
568
+ ```json
569
+ // Tool: browser_type
570
+ {
571
+ "app": "discord",
572
+ "ref": "w:88",
573
+ "text": "Deployment v2.5.1 completed successfully."
574
+ }
575
+ ```
576
+
577
+ ### Example: Listing Discord Tabs/Windows
578
+ ```json
579
+ // Tool: browser_tabs
580
+ {
581
+ "action": "list",
582
+ "app": "discord"
583
+ }
584
+ ```
585
+
586
+ > [!IMPORTANT]
587
+ > Always pass `"app": "discord"` (or the target app name) to `browser_tabs` when working with desktop apps. This prevents Weavetab from accidentally launching or switching to the web browser.
588
+
589
+ ---
590
+
591
+ ## 2. Smart Domain Auto-Routing & Sticky Context
592
+
593
+ Weavetab features automatic target resolution to eliminate accidental browser popups:
594
+
595
+ ### A. Automatic Domain Matching
596
+ If you call `browser_navigate` or `browser_tabs(action: "open")` with a known domain (e.g. `discord.com`, `slack.com`, `linear.app`, `notion.so`), Weavetab automatically routes the command to the configured Electron desktop application.
597
+
598
+ ### B. Sticky App Sessions
599
+ When you interact with an Electron application (e.g., clicking or typing in Discord), Weavetab remembers the active application context. If a subsequent tool call omits `app` and no web browser instance is active, Weavetab stays attached to the active desktop app rather than spawning an unwanted Chrome window.
600
+
601
+ ### C. Explicit Browser Override
602
+ If you specifically want to open a URL in the web browser instead of a desktop application, pass `"app": "browser"`.
603
+
604
+ ---
605
+
606
+ ## 3. Multi-Window Focus Management
607
+
608
+ Some Electron apps open secondary windows (e.g. popout editors, settings panels, or call windows).
609
+
610
+ 1. Use `browser_tabs(action: "list", app: "discord")` to view all open windows and page targets for that specific app.
611
+ 2. Switch focus between windows using `browser_tabs(action: "switch", tabId: "<id>", app: "discord")`.
612
+ 3. To bring a specific native window to the foreground, use `browser_tabs(action: "focus_window", windowId: <id>, app: "discord")`.
613
+
614
+
615
+ ## electron-discovery
616
+
617
+ # Electron Discovery & Environment Handshake
618
+
619
+ 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.
620
+
621
+ `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.
622
+
623
+ ---
624
+
625
+ ## 1. Running Discovery via `browser_detect`
626
+
627
+ Call `browser_detect` with empty parameters `{}`:
628
+
629
+ ```json
630
+ {}
631
+ ```
632
+
633
+ ### Response Schema:
634
+ ```json
635
+ {
636
+ "available": [
637
+ {
638
+ "engine": "chromium",
639
+ "name": "Google Chrome",
640
+ "path": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
641
+ }
642
+ ],
643
+ "current": "chromium",
644
+ "configuredApps": [
645
+ {
646
+ "name": "discord",
647
+ "status": "running_no_debug",
648
+ "configuredPath": "C:\\Users\\username\\AppData\\Local\\Discord\\app-1.0.9256\\Discord.exe"
649
+ },
650
+ {
651
+ "name": "slack",
652
+ "status": "connected",
653
+ "port": 9222,
654
+ "configuredPath": "C:\\Users\\username\\AppData\\Local\\slack\\app-4.38.125\\slack.exe",
655
+ "activeTabs": [
656
+ {
657
+ "id": "PAGE_1",
658
+ "title": "general - Weavetab Slack",
659
+ "url": "https://app.slack.com/client/..."
660
+ }
661
+ ]
662
+ },
663
+ {
664
+ "name": "vscode",
665
+ "status": "offline",
666
+ "configuredPath": "C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
667
+ }
668
+ ],
669
+ "toolCoverage": {
670
+ "chromium": 100,
671
+ "firefox": 78,
672
+ "webkit": 55
673
+ }
674
+ }
675
+ ```
676
+
677
+ ---
678
+
679
+ ## 2. Understanding Application Status
680
+
681
+ Each configured desktop app reports one of three distinct lifecycle statuses:
682
+
683
+ | Status | Meaning | Agent Action |
684
+ | :--- | :--- | :--- |
685
+ | **`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. |
686
+ | **`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. |
687
+ | **`offline`** | The application is not currently running on the OS. | Launch and attach in one step by calling `browser_navigate(app: "<name>")`. |
688
+
689
+ ---
690
+
691
+ ## 3. Dynamic Squirrel Updates on Windows
692
+
693
+ On Windows, Squirrel-managed applications (Discord, Slack, Teams) update dynamically into versioned sibling directories (e.g. `Discord\app-1.0.9256\Discord.exe`).
694
+
695
+ Weavetab automatically handles this:
696
+ - 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.
697
+ - The dynamically resolved path is reported in `browser_detect` under `configuredPath`.
698
+
699
+ ---
700
+
701
+ ## 4. Launching Desktop Apps Manually with Debugging
702
+
703
+ If the user prefers to launch apps manually from a terminal or shortcut with remote debugging enabled:
704
+
705
+ ```bash
706
+ # Discord
707
+ Discord.exe --remote-debugging-port=9222
708
+
709
+ # Slack
710
+ slack.exe --remote-debugging-port=9223
711
+
712
+ # VS Code
713
+ code.exe --remote-debugging-port=9225
714
+ ```
715
+
716
+ Once launched with `--remote-debugging-port`, `browser_detect` immediately reflects the application as connectable.
717
+
718
+
719
+ # ====================================================
720
+ # DOMAIN: MEMORY
721
+ # ====================================================
722
+
723
+ # Weavetab Domain Profile: MEMORY
724
+
725
+ Generated for @weavetab/skills v2.5.1
726
+
727
+
728
+ ## selector-memory-system
729
+
730
+ # Two-Tier Memory System
731
+
732
+ Weavetab operates a two-tier persistent memory system. Understanding both layers prevents wasted DOM traversals and makes agents dramatically faster across sessions.
733
+
734
+ ---
735
+
736
+ ## Tier 1 — Selector Confidence Cache (`~/.weavetab-system/memory/`)
737
+
738
+ Per-domain JSON files (one per hostname) track individual element selectors and their interaction history.
739
+
740
+ Every time an element is located and interacted with, Weavetab calculates a confidence score based on:
741
+ 1. **Attribute Stability**: Prefers `data-testid`, `id`, `aria-label`, and semantic roles over dynamic Tailwind/CSS-module class strings.
742
+ 2. **Success Count**: Selectors that successfully trigger navigation or state changes gain reinforcement.
743
+ 3. **Origin Isolation**: Learned selectors are strictly namespaced to the origin to prevent cross-site contamination.
744
+
745
+ ### Strike Degradation
746
+ - **Strike 1**: Marked as degraded — falls back to secondary candidates or fuzzy label match.
747
+ - **Strike 2**: Deprecated — immediate fallback to full DOM inspection via `browser_find` or `browser_map`.
748
+ - **Strike 3**: Purged from memory cache to prevent stale lookups.
749
+
750
+ ### Agent Discipline for Tier 1
751
+ 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.
752
+ 2. **Don't Hardcode Fragile Selectors**: Never pass brittle absolute CSS paths like `div:nth-child(3) > ul > li:nth-child(2) > button`.
753
+ 3. **Trust Heuristic Recovery**: If a button moves slightly on the page, the underlying engine re-anchors before reporting failure.
754
+
755
+ ---
756
+
757
+ ## Tier 2 — Site Profiles & Workflow Patterns (`~/.weavetab-system/memory/sites/`)
758
+
759
+ 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.
760
+
761
+ ### Checking a Site Profile at Session Start
762
+ Always call `browser_pattern_learn` with `action: "get"` when starting an automation session on a site you may have visited before:
763
+
764
+ ```json
765
+ { "origin": "https://github.com" }
766
+ ```
767
+
768
+ Response tells you:
769
+ - `known_patterns`: named flows with reliability scores and step counts
770
+ - `quirks`: known cookie banners, rate limits, modal popups to handle automatically
771
+ - `framework`: detected frontend stack
772
+ - `_hint`: compact hint string summarizing everything
773
+
774
+ ### Fast-Path Decision Rule
775
+ | Reliability | Action |
776
+ |---|---|
777
+ | **≥ 0.8** | Use pattern steps directly via `browser_burst` — skip exploratory navigation |
778
+ | **0.5 – 0.79** | Attempt pattern but verify success indicator before moving on |
779
+ | **< 0.5 or strikes ≥ 3** | Ignore pattern, re-explore from scratch, then teach via `browser_pattern_learn` |
780
+
781
+ ### Teaching a New Pattern After Completing a Workflow
782
+ After successfully completing a multi-step flow:
783
+
784
+ ```json
785
+ {
786
+ "origin": "https://github.com",
787
+ "action": "learn",
788
+ "name": "login_flow",
789
+ "steps": [
790
+ { "tool": "browser_click", "target": ".btn-login" },
791
+ { "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
792
+ { "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
793
+ { "tool": "browser_click", "target": "[type=submit]" }
794
+ ],
795
+ "success_indicator": "a[aria-label='Homepage']"
796
+ }
797
+ ```
798
+
799
+ ### Recording Execution Outcomes (Reliability Upkeep)
800
+ After replaying a pattern, always report the outcome:
801
+
802
+ ```json
803
+ {
804
+ "origin": "https://github.com",
805
+ "action": "record_execution",
806
+ "name": "login_flow",
807
+ "success": true,
808
+ "duration_ms": 3200
809
+ }
810
+ ```
811
+
812
+ ### Recording Site Quirks
813
+ When you discover a cookie banner or rate limit:
814
+
815
+ ```json
816
+ {
817
+ "origin": "https://github.com",
818
+ "action": "record_quirk",
819
+ "quirk_key": "cookie_banner",
820
+ "quirk_data": { "selector": "#cookie-consent", "action": "click .accept-all", "appears": "first_visit" }
821
+ }
822
+ ```
823
+
824
+ On future visits, the quirk is present in the profile so you can dismiss banners before starting your main workflow — zero wasted agent turns.
825
+
826
+ ---
827
+
828
+ ## File Locations (Never Write to ~/.weavetab/)
829
+
830
+ | Tier | Path | Owner |
831
+ |---|---|---|
832
+ | Tier 1 selectors | `~/.weavetab-system/memory/<hostname>.json` | Engine (auto) |
833
+ | Tier 2 site profiles | `~/.weavetab-system/memory/sites/<origin>.json` | Engine via `browser_pattern_learn` |
834
+ | Knowledge hints | `~/.weavetab/knowledge/<hostname>.md` | Engine (auto, 20-token notes) |
835
+ | User config | `~/.weavetab/config.json` | Human — never written by agents |
836
+
837
+
838
+ ## session-trail
839
+
840
+ # Session Trails & Deterministic Macro Compilation
841
+
842
+ 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.
843
+
844
+ `browser_burst` with `compile_from_history: true` converts recent successful session actions into a deterministic, replayable macro.
845
+
846
+ ---
847
+
848
+ ## 1. Compiling and Replaying Recent Actions (`browser_burst`)
849
+
850
+ Replay recent successful actions directly in a single turn:
851
+
852
+ ```json
853
+ {
854
+ "compile_from_history": true
855
+ }
856
+ ```
857
+
858
+ Or pass `dry_run: true` to inspect the compiled macro steps before running them:
859
+
860
+ ```json
861
+ {
862
+ "compile_from_history": true,
863
+ "dry_run": true,
864
+ "history_limit": 15
865
+ }
866
+ ```
867
+
868
+ ### Response Example:
869
+ ```json
870
+ {
871
+ "success": true,
872
+ "steps_completed": 0,
873
+ "compiled_steps": [
874
+ { "tool": "browser_navigate", "args": { "url": "https://analytics.example.com" } },
875
+ { "tool": "browser_type", "args": { "ref": "w:12", "text": "metrics" } },
876
+ { "tool": "click_and_wait", "args": { "ref": "w:15" } }
877
+ ],
878
+ "message": "compiled 3 macro steps from history"
879
+ }
880
+ ```
881
+
882
+ 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).
883
+
884
+ ---
885
+
886
+ ## 2. What Gets Compiled
887
+
888
+ 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:
889
+ - Drops failed steps.
890
+ - De-duplicates consecutive identical calls.
891
+ - Exposes the result as `compiled_steps` with `args` nested under each step.
892
+
893
+ Because secrets entered via `browser_type_secret` are referenced by environment-variable key (`envKey`) rather than plaintext, compiled macros never contain credentials.
894
+
895
+ ---
896
+
897
+ ## 3. Background Scripts (`browser_automation`)
898
+
899
+ For recurring monitoring or polling that should run without an LLM turn, `browser_automation` injects a self-running script into the page:
900
+
901
+ ```json
902
+ {
903
+ "action": "start",
904
+ "id": "price_watch",
905
+ "script": "setInterval(() => document.querySelector('#price')?.textContent, 5000)",
906
+ "persistent": true,
907
+ "onResult": "store"
908
+ }
909
+ ```
910
+
911
+ - **`action`**: `start`, `stop`, `list`, or `poll`.
912
+ - **`id`**: unique script identifier (required for `start`/`stop`).
913
+ - **`script`**: the JavaScript to inject (required for `start`).
914
+ - **`persistent`**: re-run in a loop when `true`.
915
+ - **`onResult`**: `notify_agent`, `store` (default), or `ignore`.
916
+
917
+ Scripts are cleared on tab close — do not rely on them for expensive, long-running work.
918
+
919
+ ---
920
+
921
+ ## 4. Emitting Operational Thoughts (`browser_thoughts`)
922
+
923
+ Log agent rationale and internal reasoning directly to the Weavetab HUD and telemetry stream without bloating user chat responses:
924
+
925
+ ```json
926
+ {
927
+ "action": "feedback",
928
+ "message": "Detected dynamic React hydration delay. Holding interaction until DOM mutation settles.",
929
+ "style": "observation"
930
+ }
931
+ ```
932
+
933
+ Use `"action": "question"` to surface a free-text question to the user (with `input` set to `sentence` or `paragraph`, and an optional `timeout`).
934
+
935
+
936
+ ## site-learning
937
+
938
+ # Site Learning — Autonomous Workflow Memory
939
+
940
+ 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.
941
+
942
+ A profile holds `framework`, `captcha_frequency`, `quirks`, and named `patterns` (each with `steps`, `reliability`, `strikes`, and execution counters).
943
+
944
+ ---
945
+
946
+ ## 1. Session Start Protocol
947
+
948
+ On every session visiting a known or potentially-known site, run:
949
+
950
+ ```json
951
+ { "action": "get", "origin": "https://github.com" }
952
+ ```
953
+
954
+ `action` defaults to `"learn"`, so `get` must be stated explicitly. If `origin` is omitted, `get` reads the active tab's origin.
955
+
956
+ Parse the response:
957
+ - `known: false` → the site is new; proceed exploratorily and teach it after completion.
958
+ - `_hint` → a compact text summary listing `framework`, `captcha_frequency`, `known_patterns` (with reliability and step counts), and `quirks`.
959
+ - `quirks` → auto-handle any listed quirks (cookie banners, rate limits) before the main task.
960
+
961
+ ---
962
+
963
+ ## 2. Fast-Path vs. Exploratory Decision
964
+
965
+ Use the per-pattern `reliability` (and `strikes`) values to choose your strategy:
966
+
967
+ | Reliability | Strikes | Strategy |
968
+ |---|---|---|
969
+ | ≥ 0.8, strikes = 0 | — | **Fast path**: replay the stored steps via `browser_burst` directly |
970
+ | 0.5–0.79 | 0–1 | **Cautious path**: replay steps, verify `success_indicator` after each critical step |
971
+ | < 0.5 | any | **Re-explore**: navigate manually, collect correct steps, then teach |
972
+ | any | ≥ 3 | **Re-learn**: ignore the cached pattern, re-explore, then `learn` again with updated steps |
973
+
974
+ The `_hint` string flags eligible patterns with `[fast-path eligible]` and stale ones with `[RE-LEARN NEEDED]`.
975
+
976
+ ---
977
+
978
+ ## 3. Quirk Auto-Handling
979
+
980
+ If a profile lists quirks, resolve them immediately after navigation before executing your main task. Example stored quirk data:
981
+
982
+ ```
983
+ { "cookie_banner": { "selector": "#cookie-consent", "action": "click .accept-all", "appears": "first_visit" } }
984
+ ```
985
+
986
+ Execute the action before doing anything else. Never spend reasoning turns on a known dismissible popup.
987
+
988
+ ---
989
+
990
+ ## 4. Teaching a Workflow Pattern
991
+
992
+ After successfully completing a multi-step flow for the first time (or after re-learning):
993
+
994
+ ```json
995
+ {
996
+ "action": "learn",
997
+ "origin": "https://github.com",
998
+ "name": "login_flow",
999
+ "steps": [
1000
+ { "tool": "browser_navigate", "target": "https://github.com/login" },
1001
+ { "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
1002
+ { "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
1003
+ { "tool": "browser_click", "target": "[type=submit]" }
1004
+ ],
1005
+ "success_indicator": "a[aria-label='Homepage']",
1006
+ "entry": "/login"
1007
+ }
1008
+ ```
1009
+
1010
+ Each step accepts `tool`, an optional `target` (selector or URL), an optional `value`, and an optional `extra` object forwarded verbatim to `browser_burst` replay.
1011
+
1012
+ **Pattern Naming Rules**:
1013
+ - Use snake_case.
1014
+ - Be descriptive: `login_flow`, `pr_review`, `csv_export`, `checkout_flow`.
1015
+ - A duplicate name on the same origin is an **update** (merge) — it never creates a second pattern.
1016
+
1017
+ **Step Quality Rules**:
1018
+ - Prefer semantic selectors: `data-testid`, `id`, `aria-label`, readable text-based selectors.
1019
+ - Avoid hashed classes (`.hash_abc123`), positional selectors (`div:nth-child(4)`), and deep anonymous chains (`div > div > div > span`) — the engine drops volatile selectors during compilation.
1020
+ - For sensitive inputs, record a placeholder like `{{username}}` — never hardcode credentials.
1021
+
1022
+ ---
1023
+
1024
+ ## 5. Reliability Upkeep After Replay
1025
+
1026
+ Every time you replay a pattern, report the outcome:
1027
+
1028
+ ```json
1029
+ {
1030
+ "action": "record_execution",
1031
+ "origin": "https://github.com",
1032
+ "name": "login_flow",
1033
+ "success": true,
1034
+ "duration_ms": 3100
1035
+ }
1036
+ ```
1037
+
1038
+ `success` is required. The engine updates reliability via EWMA (α=0.15):
1039
+ - A success nudges reliability toward 1.0 (and resets `strikes` to 0).
1040
+ - A failure lowers reliability and increments `strikes`; 3 consecutive failures trigger a re-learn flag.
1041
+
1042
+ If no pattern with that name exists for the origin, the call returns `error_code: "PATTERN_NOT_FOUND"`.
1043
+
1044
+ ---
1045
+
1046
+ ## 6. Recording a New Quirk
1047
+
1048
+ When you encounter a cookie consent modal, popup, or rate limit for the first time:
1049
+
1050
+ ```json
1051
+ {
1052
+ "action": "record_quirk",
1053
+ "origin": "https://example.com",
1054
+ "quirk_key": "cookie_banner",
1055
+ "quirk_data": {
1056
+ "selector": "#cookie-consent",
1057
+ "action": "click .accept-all",
1058
+ "appears": "first_visit"
1059
+ }
1060
+ }
1061
+ ```
1062
+
1063
+ Supported `quirk_key` values: `cookie_banner`, `rate_limit`, `modal_popups`.
1064
+
1065
+ For rate limits:
1066
+
1067
+ ```json
1068
+ {
1069
+ "action": "record_quirk",
1070
+ "origin": "https://example.com",
1071
+ "quirk_key": "rate_limit",
1072
+ "quirk_data": { "threshold": "60req/min", "recovery": "wait 30s" }
1073
+ }
1074
+ ```
1075
+
1076
+ ---
1077
+
1078
+ ## 7. Anti-Patterns to Avoid
1079
+
1080
+ - **Never create per-session pattern names** like `login_2026_09_16` — one name per workflow per origin, forever updated in place.
1081
+ - **Never call `browser_pattern_learn` in a loop** — one call per workflow completion. The write is idempotent (skips the disk write if nothing changed).
1082
+ - **Never store credentials in steps** — use placeholders or `browser_type_secret` during actual execution.
1083
+ - **Never write to `~/.weavetab/`** — all memory belongs in `~/.weavetab-system/memory/sites/`.
1084
+
1085
+ ---
1086
+
1087
+ ## 8. Full Session Example: GitHub PR Review
1088
+
1089
+ ```
1090
+ 1. browser_pattern_learn { action: "get", origin: "https://github.com" }
1091
+ → known_patterns: pr_review (reliability 0.95, 3 steps) [fast-path eligible]
1092
+ → quirks: none
1093
+
1094
+ 2. Since reliability = 0.95 (≥ 0.8): use the fast path.
1095
+ browser_burst with the 3 stored steps.
1096
+
1097
+ 3. After completion:
1098
+ browser_pattern_learn {
1099
+ action: "record_execution",
1100
+ name: "pr_review",
1101
+ origin: "https://github.com",
1102
+ success: true,
1103
+ duration_ms: 2800
1104
+ }
1105
+ ```
1106
+
1107
+ Total agent turns for a known site: **3 tool calls** vs. potentially 12+ with full exploration.
1108
+
1109
+
1110
+ # ====================================================
1111
+ # DOMAIN: RESILIENCE
1112
+ # ====================================================
1113
+
1114
+ # Weavetab Domain Profile: RESILIENCE
1115
+
1116
+ Generated for @weavetab/skills v2.5.1
1117
+
1118
+
1119
+ ## loop-breaker
1120
+
1121
+ # Loop Breaker & CAPTCHA Escalation Protocol
1122
+
1123
+ Agents can get trapped in repetitive click loops when a button does not advance the state (e.g. failing silent validation, unhandled reCAPTCHA challenges, or modals swallowing events). Weavetab actively monitors repetitive patterns and provides circuit breakers.
1124
+
1125
+ ---
1126
+
1127
+ ## 1. Loop Detection & Strike Reset (`browser_map`)
1128
+
1129
+ Weavetab tracks the sequence of identical or near-identical tool invocations. If an agent calls `browser_click` or `browser_type` on the same selector or ref repeatedly without URL or major DOM mutations, the server raises a `STUCK_LOOP_WARNING`.
1130
+
1131
+ ### How to Break the Loop:
1132
+ 1. **Analyze Why the Action Failed**: Check `browser_console` for JavaScript errors:
1133
+ ```json
1134
+ { "action": "read" }
1135
+ ```
1136
+ Or use `browser_map` to see if a validation banner or unhandled modal appeared.
1137
+ 2. **Reset the Circuit Breaker**:
1138
+ - Re-map with `force: true` to bypass the map skip guard, refresh the DOM view, and automatically clear loop strikes:
1139
+ ```json
1140
+ { "force": true }
1141
+ ```
1142
+
1143
+ ---
1144
+
1145
+ ## 2. CAPTCHA Handling Protocol (`browser_captcha`)
1146
+
1147
+ When an automated flow is blocked by Cloudflare Turnstile, Google reCAPTCHA, or hCaptcha, do NOT repeatedly click random coordinates.
1148
+
1149
+ Invoke `browser_captcha` to analyze and manage the challenge:
1150
+
1151
+ ```json
1152
+ {
1153
+ "action": "detect"
1154
+ }
1155
+ ```
1156
+
1157
+ ### Response Example:
1158
+ ```json
1159
+ {
1160
+ "success": true,
1161
+ "action": "detect",
1162
+ "captcha_detected": true,
1163
+ "captcha_type": "turnstile",
1164
+ "interaction_type": "checkbox",
1165
+ "difficulty": "easy",
1166
+ "confidence": 0.97,
1167
+ "human_needed": false,
1168
+ "message": "CAPTCHA detected: turnstile (checkbox, 97% confidence)",
1169
+ "next_action": "Call browser_captcha({ action: \"solve\" }) to attempt automated solving."
1170
+ }
1171
+ ```
1172
+
1173
+ ### Action Strategy:
1174
+ 1. If `human_needed` is `true` (e.g. image classification), inform the user cleanly or request human bypass — do not guess coordinates.
1175
+ 2. Otherwise pass `"action": "solve"` to attempt an automated solve (slider drag, hold, checkbox, or invisible challenges). Use `"action": "status"` to check progress and `"action": "wait_for_user"` to pause for human input.
1176
+
1177
+
1178
+ ## session-time-travel
1179
+
1180
+ # Session Time-Travel & Instant State Rollback
1181
+
1182
+ In complex multi-step workflows (e.g. checkout funnels, multi-page configuration wizards, onboarding questionnaires), an error at Step 7 traditionally forces an agent to reload the root URL, re-authenticate, and waste 10+ turns repeating steps.
1183
+
1184
+ `browser_checkpoint` enables instantaneous time-travel by snapshotting and restoring complete browser session state.
1185
+
1186
+ ---
1187
+
1188
+ ## 1. What a Checkpoint Captures
1189
+
1190
+ A single named checkpoint atomically preserves:
1191
+ - **Cookies**: Full domain cookies including `HttpOnly`, `Secure`, and `SameSite` flags.
1192
+ - **Web Storage**: Entire `localStorage` and `sessionStorage` key-value maps.
1193
+ - **Navigation State**: Exact page URL, scroll positions (`x`, `y`), and page title.
1194
+
1195
+ ---
1196
+
1197
+ ## 2. Checkpoint Operations
1198
+
1199
+ ### A. Saving a Checkpoint (`save`)
1200
+ Create a checkpoint right before undertaking risky, branching, or destructive actions:
1201
+
1202
+ ```json
1203
+ {
1204
+ "action": "save",
1205
+ "name": "pre_checkout_authenticated"
1206
+ }
1207
+ ```
1208
+
1209
+ ### B. Restoring a Checkpoint (`restore`)
1210
+ If a downstream step errors out, times out, or hits an invalid state, roll back immediately:
1211
+
1212
+ ```json
1213
+ {
1214
+ "action": "restore",
1215
+ "name": "pre_checkout_authenticated"
1216
+ }
1217
+ ```
1218
+ *Latency: ~15ms*. The page navigates back to the checkpoint URL with cookies and storage atomically injected.
1219
+
1220
+ ### C. Listing Checkpoints (`list`)
1221
+ Inspect all active checkpoints for the current page target:
1222
+
1223
+ ```json
1224
+ {
1225
+ "action": "list"
1226
+ }
1227
+ ```
1228
+
1229
+ ### D. Cleaning Up (`delete`)
1230
+ Free memory once a workflow has concluded:
1231
+
1232
+ ```json
1233
+ {
1234
+ "action": "delete",
1235
+ "name": "pre_checkout_authenticated"
1236
+ }
1237
+ ```
1238
+
1239
+ ---
1240
+
1241
+ ## 3. High-Leverage Agent Pattern
1242
+
1243
+ ```
1244
+ 1. Authenticate to Target Portal
1245
+ 2. browser_checkpoint({ action: "save", name: "auth_ready" })
1246
+ 3. Attempt automated action sequence (e.g. form filling or testing)
1247
+ 4. IF error occurs:
1248
+ browser_checkpoint({ action: "restore", name: "auth_ready" })
1249
+ -> Agent is immediately back at authenticated state without re-login!
1250
+ ```
1251
+
1252
+ ---
1253
+
1254
+ ## 4. Fine-Grained Cookie Management (`browser_cookies`)
1255
+
1256
+ Inspect, set, or delete individual browser session cookies without restoring an entire checkpoint:
1257
+
1258
+ ```json
1259
+ {
1260
+ "action": "get",
1261
+ "url": "https://example.com"
1262
+ }
1263
+ ```
1264
+
1265
+ Or inject an authentication cookie (one cookie per call):
1266
+
1267
+ ```json
1268
+ {
1269
+ "action": "set",
1270
+ "name": "session_token",
1271
+ "value": "xyz123",
1272
+ "domain": "example.com",
1273
+ "path": "/",
1274
+ "httpOnly": true,
1275
+ "secure": true,
1276
+ "sameSite": "Lax"
1277
+ }
1278
+ ```
1279
+
1280
+ Delete a cookie by name (and optionally domain/path):
1281
+
1282
+ ```json
1283
+ {
1284
+ "action": "delete",
1285
+ "name": "session_token",
1286
+ "domain": "example.com"
1287
+ }
1288
+ ```
1289
+
1290
+ Accepted fields: `name`, `value`, `domain`, `path`, `expires` (Unix seconds), `httpOnly`, `secure`, `sameSite` (`Strict`/`Lax`/`None`), and `url` (for `get`).
1291
+
1292
+ ---
1293
+
1294
+ ## 5. Web Storage Inspection & Injection (`browser_storage`)
1295
+
1296
+ Query or clear `localStorage` and `sessionStorage` keys. Choose the store with `scope`:
1297
+
1298
+ ```json
1299
+ {
1300
+ "scope": "local",
1301
+ "action": "get",
1302
+ "key": "authToken"
1303
+ }
1304
+ ```
1305
+
1306
+ - **`scope`**: `"local"` or `"session"`.
1307
+ - **`action`**: `get`, `set`, `remove`, `list` (all keys + values), or `clear` (the whole scope).
1308
+ - **`key`** is required for `get`, `set`, and `remove`; **`value`** is required for `set`.
1309
+
1310
+
1311
+ ## stale-ref-recovery
1312
+
1313
+ # Stale Ref Recovery & SPA Hydration Resilience
1314
+
1315
+ In modern Single Page Applications (built with React, Next.js, Vue, Nuxt, Svelte), DOM nodes are frequently destroyed and recreated during client-side hydration or reactive state updates. This can invalidate a volatile `w:NN` handle between reads and actions.
1316
+
1317
+ ---
1318
+
1319
+ ## 1. The Multi-Tier Auto-Recovery Heuristic
1320
+
1321
+ When a tool receives a detached or invalidated `ref`, Weavetab attempts to re-resolve it instead of failing immediately. The recovery runs a sub-5ms heuristic over these strategies (in order) and re-stamps `data-wt-id="NN"` onto the live node:
1322
+
1323
+ ```
1324
+ [Action on w:14 fails / handle detached]
1325
+ │
1326
+ ▼
1327
+ [1. Connected node + fingerprint check]
1328
+ │ (if not found)
1329
+ ▼
1330
+ [2. Stored CSS selector] (data-testid, id, class)
1331
+ │ (if not found)
1332
+ ▼
1333
+ [3. Exact label / aria-label match]
1334
+ │ (if not found)
1335
+ ▼
1336
+ [4. Placeholder / name attribute match]
1337
+ │ (if not found)
1338
+ ▼
1339
+ [5. Fuzzy substring match] (when label length >= 3)
1340
+ ```
1341
+
1342
+ The successful strategy is reported back to the agent (`stored_selector`, `exact_label`, `placeholder_or_name`, `fuzzy_label`). If every strategy misses, the tool returns a hard failure.
1343
+
1344
+ ---
1345
+
1346
+ ## 2. Agent Reactive Behavior
1347
+
1348
+ If an action fails because all recovery strategies were exhausted, the tool returns one of:
1349
+
1350
+ - `error_code: "ELEMENT_NOT_FOUND"` — the ref was in the cached map but no longer exists in the DOM.
1351
+ - `error_code: "FINGERPRINT_MISMATCH"` — an element exists but its tag/role fingerprint no longer matches; the DOM was likely rebuilt.
1352
+
1353
+ Either way:
1354
+
1355
+ 1. **Do NOT Repeat the Identical Call**: retrying the exact same stale `ref` (`w:14`) will fail again.
1356
+ 2. **Execute a Fast Targeted Lookup**: run `browser_find` with the text of the button or input, or refresh handles with `browser_map`.
1357
+ 3. **Execute the Action on the New Handle**: use the updated ref returned by `browser_find`/`browser_map`.
1358
+
1359
+
1360
+ # ====================================================
1361
+ # DOMAIN: SECURITY
1362
+ # ====================================================
1363
+
1364
+ # Weavetab Domain Profile: SECURITY
1365
+
1366
+ Generated for @weavetab/skills v2.5.1
1367
+
1368
+
1369
+ ## rbac-and-policies
1370
+
1371
+ # Role-Based Access Control (RBAC) & Agent Guardrails
1372
+
1373
+ Weavetab allows developers to run untrusted or lower-privilege subagents within strict security boundaries to prevent accidental destructive operations or data leaks.
1374
+
1375
+ Roles are configured per agent (in `config.json`). The server checks the role **before** launching a browser or resolving the target.
1376
+
1377
+ ---
1378
+
1379
+ ## 1. The 5 Security Roles
1380
+
1381
+ | Role | Tool Access | Intended Use |
1382
+ | :--- | :--- | :--- |
1383
+ | `admin` | Full access (`*`). | Primary operator / lead agent. |
1384
+ | `operator` | Full access (`*`). | Standard automation agent. |
1385
+ | `automation` | Every tool except `browser_thoughts` — automation agents must be non-interactive. | Background cron / worker. |
1386
+ | `viewer` | Read-only set only: `browser_map`, `browser_find`, `browser_scrape`, `browser_console`, `browser_eval`, `browser_inspect`, `browser_extract_design`, `browser_snapshot`, `browser_screenshot`, `browser_pdf`, `browser_cookies`, `browser_tabs`, `browser_wait`, `browser_pattern_learn`. | Research subagents / scrapers. |
1387
+ | `system` | `browser_thoughts`, `browser_detect`, `browser_performance`, `browser_checkpoint`, `browser_pattern_learn`. | Internal/system operations. |
1388
+
1389
+ Any other role value is treated as fully allowed.
1390
+
1391
+ ---
1392
+
1393
+ ## 2. Handling Permission Denials
1394
+
1395
+ There is no JSON `error_code` for RBAC. A denied call fails with `isError: true` and a plain-text message prefixed with `[!]`:
1396
+
1397
+ ```
1398
+ [!] Role 'viewer' does not have permission to use 'browser_click'. Viewer role only permits read-only tools (map/find/scrape/console/eval/inspect/snapshot/pdf/cookies).
1399
+ ```
1400
+
1401
+ ### Protocol:
1402
+ 1. Do not retry the denied tool — the role will not change mid-session.
1403
+ 2. Delegate the interactive action to the parent agent or a higher-privilege operator.
1404
+ 3. Limit your output to findings gathered via read-only tools (`browser_scrape`, `browser_map`, `browser_inspect`).
1405
+
1406
+
1407
+ ## secret-containment-protocol
1408
+
1409
+ # Secret Containment Protocol & Zero-Bleed Execution
1410
+
1411
+ AI agent transcripts, LLM providers, and tool logs represent massive attack surfaces for credential leaks. Weavetab enforces a hardware-grade **Zero-Bleed Security Guarantee** for sensitive inputs.
1412
+
1413
+ ---
1414
+
1415
+ ## 1. Entering Credentials with `browser_type_secret`
1416
+
1417
+ Whenever an agent inputs passwords, two-factor backup codes, credit card numbers, or proprietary API keys, you MUST use `browser_type_secret`.
1418
+
1419
+ `browser_type_secret` never accepts a plaintext secret. It reads the value from an **environment variable** on the host running the MCP server, so the secret never reaches the agent transcript. Set the variable first (e.g. `export PORTAL_PASSWORD="…"`), then reference it by key:
1420
+
1421
+ ```json
1422
+ {
1423
+ "ref": "w:12",
1424
+ "envKey": "PORTAL_PASSWORD"
1425
+ }
1426
+ ```
1427
+
1428
+ Accepted targeting parameters: `id` (alias `ref`) or `target` (CSS selector). `envKey` is **required**.
1429
+
1430
+ ---
1431
+
1432
+ ## 2. The Zero-Bleed Guarantee Architecture
1433
+
1434
+ When `browser_type_secret` is invoked:
1435
+ 1. **CDP Interception**: The secret is typed via masked CDP synthetic key events.
1436
+ 2. **HUD Redaction**: The browser Heads-Up Display (HUD) and visual overlay strictly renders bullets (`••••••••`).
1437
+ 3. **Log Sanitization**: Console logs, MCP server logs, and JSON return values strip the secret string and return:
1438
+ ```json
1439
+ {
1440
+ "success": true,
1441
+ "message": "Secret typed successfully into ref 'w:12' (length: 26). Value redacted."
1442
+ }
1443
+ ```
1444
+ 4. **No Re-Emission**: Never print or echo raw credentials into subsequent model thoughts or conversation messages.
1445
+
1446
+ ---
1447
+
1448
+ ## 3. Strict Operating Prohibition
1449
+
1450
+ > [!CAUTION]
1451
+ > Under NO circumstances should an agent pass passwords or credentials to:
1452
+ > - `browser_type`
1453
+ > - `browser_fill`
1454
+ > - `browser_eval`
1455
+ >
1456
+ > Doing so causes plaintext secrets to enter unmasked transcripts and tool logs.
1457
+
1458
+
1459
+ # ====================================================
1460
+ # DOMAIN: PLUGINS
1461
+ # ====================================================
1462
+
1463
+ # Weavetab Domain Profile: PLUGINS
1464
+
1465
+ Generated for @weavetab/skills v2.5.1
1466
+
1467
+
1468
+ ## hooks-and-overrides
1469
+
1470
+ # Plugin Hooks & Lifecycle Overrides
1471
+
1472
+ Plugins built with `@weavetab/sdk` register lifecycle hooks that run before and after tool executions. Understanding these hooks helps agents interpret custom tool behavior and blocked actions.
1473
+
1474
+ ---
1475
+
1476
+ ## 1. Supported Plugin Hooks
1477
+
1478
+ The `PluginHooks` interface exposes three primary interceptors (with backwards-compatible aliases):
1479
+
1480
+ 1. **`onBeforeAction(handler)`** — *alias:* `beforeToolCall`
1481
+ - `handler(tool, args, session)` runs **before** any tool executes.
1482
+ - It may return a modified `args` object (replacing the arguments) or `{ __blocked: true, reason }` to abort the call.
1483
+ - Typical uses: argument validation, tenant/header injection, proxy routing.
1484
+ 2. **`onAfterAction(handler)`** — *alias:* `afterToolCall`
1485
+ - `handler(tool, result, session, args)` runs **after** a tool completes.
1486
+ - Its return value replaces the tool result — used for telemetry, timing, or enriching output.
1487
+ 3. **`onDOMMutation(handler)`** — *alias:* `onPageNavigate`
1488
+ - `handler(delta, session)` observes real-time DOM mutation / action deltas (added, removed, and changed elements, `significantChange`, `stable_count`).
1489
+
1490
+ ---
1491
+
1492
+ ## 2. Agent Operational Awareness
1493
+
1494
+ - A blocked action surfaces as a normal tool error (the server turns `__blocked` into an error result). If a plugin blocks a tool you expected to succeed, do not retry it blindly — report the block reason and pick another approach.
1495
+ - An `onAfterAction` handler can rewrite a tool's result. Treat the returned payload as authoritative, not a fixed schema.
1496
+ - Plugins never inject plaintext secrets into results; the Redaction Layer runs on all error output (`SessionSecretTracker.redactAll`).
1497
+
1498
+
1499
+ ## plugin-runtime
1500
+
1501
+ # Plugin Runtime: Weavetab Plugin Architecture
1502
+
1503
+ Weavetab features an extensible plugin architecture powered by `@weavetab/sdk`. All installed plugins are loaded automatically at server startup — their tools appear directly in the MCP tool list alongside built-in tools. Agents never need to discover or activate plugins manually.
1504
+
1505
+ ---
1506
+
1507
+ ## 1. How Plugin Tools Appear
1508
+
1509
+ Plugin tools are first-class MCP tools. If `@weavetab/plugin-recaptcha-solver` is installed, `captcha_solve_token` appears in the tool list immediately on startup — alongside built-ins such as `browser_snapshot` — with no discovery step needed.
1510
+
1511
+ There is no MCP tool for discovering or activating plugins. Managing plugins is a CLI operation:
1512
+
1513
+ ```bash
1514
+ # Install a plugin (restart required)
1515
+ weavetab plugin add @weavetab/plugin-youtube
1516
+
1517
+ # Remove a plugin
1518
+ weavetab plugin rm @weavetab/plugin-youtube
1519
+
1520
+ # List installed plugins
1521
+ weavetab plugin list
1522
+ ```
1523
+
1524
+ ---
1525
+
1526
+ ## 2. Plugin Permission Model
1527
+
1528
+ Every plugin declares what it can do in `weavetab.json`. The runtime enforces this at load time:
1529
+
1530
+ | Permission | What it gates |
1531
+ |---|---|
1532
+ | `tools.add: true` | Plugin can register new MCP tools |
1533
+ | `tools.override: ["browser_navigate"]` | Plugin can wrap/replace that built-in tool |
1534
+ | `tools.remove: ["browser_pdf"]` | Plugin can disable that built-in tool |
1535
+ | `hooks.onBeforeAction: true` | Plugin can intercept all tool calls before execution |
1536
+ | `hooks.onAfterAction: true` | Plugin can inspect/transform all tool results |
1537
+
1538
+ Plugins that attempt to exceed their declared permissions are blocked with a stderr warning — they do not crash.
1539
+
1540
+ ---
1541
+
1542
+ ## 3. Trust Tiers
1543
+
1544
+ | Tier | Badge | Condition |
1545
+ |---|---|---|
1546
+ | Official | `✚ [Official]` | `@weavetab/plugin-*` packages |
1547
+ | Verified | `✔ [Verified]` | Listed in the Weavetab verified registry |
1548
+ | Unverified | `⚠ [Unverified]` | Unknown community package |
1549
+
1550
+ Unverified plugins are loaded but their permissions are logged visibly at startup for user review.
1551
+
1552
+
1553
+ # ====================================================
1554
+ # DOMAIN: NETWORK-AND-PERF
1555
+ # ====================================================
1556
+
1557
+ # Weavetab Domain Profile: NETWORK-AND-PERF
1558
+
1559
+ Generated for @weavetab/skills v2.5.1
1560
+
1561
+
1562
+ ## device-and-environment
699
1563
 
700
- Generated for @weavetab/skills v2.5.0-beta.5
1564
+ # Device Emulation & Environment Simulation
701
1565
 
1566
+ Auditing mobile responsive layouts, testing geographic restrictions, and simulating degraded network conditions are split across two tools: `browser_viewport` owns device geometry, locale, timezone, and color-scheme emulation; `browser_emulate` owns network throttling and CPU slowdown.
702
1567
 
703
- ## selector-memory-system
1568
+ ---
704
1569
 
705
- # Two-Tier Memory System
706
-
707
- Weavetab operates a two-tier persistent memory system. Understanding both layers prevents wasted DOM traversals and makes agents dramatically faster across sessions.
708
-
709
- ---
710
-
711
- ## Tier 1 — Selector Confidence Cache (`~/.weavetab-system/memory/`)
712
-
713
- Per-domain JSON files (one per hostname) track individual element selectors and their interaction history.
714
-
715
- Every time an element is located and interacted with, Weavetab calculates a confidence score based on:
716
- 1. **Attribute Stability**: Prefers `data-testid`, `id`, `aria-label`, and semantic roles over dynamic Tailwind/CSS-module class strings.
717
- 2. **Success Count**: Selectors that successfully trigger navigation or state changes gain reinforcement.
718
- 3. **Origin Isolation**: Learned selectors are strictly namespaced to the origin to prevent cross-site contamination.
719
-
720
- ### Strike Degradation
721
- - **Strike 1**: Marked as degraded — falls back to secondary candidates or fuzzy label match.
722
- - **Strike 2**: Deprecated — immediate fallback to full DOM inspection via `browser_find` or `browser_map`.
723
- - **Strike 3**: Purged from memory cache to prevent stale lookups.
724
-
725
- ### Agent Discipline for Tier 1
726
- 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.
727
- 2. **Don't Hardcode Fragile Selectors**: Never pass brittle absolute CSS paths like `div:nth-child(3) > ul > li:nth-child(2) > button`.
728
- 3. **Trust Heuristic Recovery**: If a button moves slightly on the page, the underlying engine re-anchors before reporting failure.
729
-
730
- ---
731
-
732
- ## Tier 2 — Site Profiles & Workflow Patterns (`~/.weavetab-system/memory/sites/`)
733
-
734
- 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.
735
-
736
- ### Checking a Site Profile at Session Start
737
- Always call `browser_pattern_learn` with `action: "get"` when starting an automation session on a site you may have visited before:
738
-
739
- ```json
740
- { "origin": "https://github.com" }
741
- ```
742
-
743
- Response tells you:
744
- - `known_patterns`: named flows with reliability scores and step counts
745
- - `quirks`: known cookie banners, rate limits, modal popups to handle automatically
746
- - `framework`: detected frontend stack
747
- - `_hint`: compact hint string summarizing everything
748
-
749
- ### Fast-Path Decision Rule
750
- | Reliability | Action |
751
- |---|---|
752
- | **≥ 0.8** | Use pattern steps directly via `browser_burst` — skip exploratory navigation |
753
- | **0.5 – 0.79** | Attempt pattern but verify success indicator before moving on |
754
- | **< 0.5 or strikes ≥ 3** | Ignore pattern, re-explore from scratch, then teach via `browser_pattern_learn` |
755
-
756
- ### Teaching a New Pattern After Completing a Workflow
757
- After successfully completing a multi-step flow:
758
-
759
- ```json
760
- {
761
- "origin": "https://github.com",
762
- "action": "learn",
763
- "name": "login_flow",
764
- "steps": [
765
- { "tool": "browser_click", "target": ".btn-login" },
766
- { "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
767
- { "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
768
- { "tool": "browser_click", "target": "[type=submit]" }
769
- ],
770
- "success_indicator": "a[aria-label='Homepage']"
771
- }
772
- ```
773
-
774
- ### Recording Execution Outcomes (Reliability Upkeep)
775
- After replaying a pattern, always report the outcome:
776
-
777
- ```json
778
- {
779
- "origin": "https://github.com",
780
- "action": "record_execution",
781
- "name": "login_flow",
782
- "success": true,
783
- "duration_ms": 3200
784
- }
785
- ```
786
-
787
- ### Recording Site Quirks
788
- When you discover a cookie banner or rate limit:
789
-
790
- ```json
791
- {
792
- "origin": "https://github.com",
793
- "action": "record_quirk",
794
- "quirk_key": "cookie_banner",
795
- "quirk_data": { "selector": "#cookie-consent", "action": "click .accept-all", "appears": "first_visit" }
796
- }
797
- ```
798
-
799
- On future visits, the quirk is present in the profile so you can dismiss banners before starting your main workflow — zero wasted agent turns.
800
-
801
- ---
802
-
803
- ## File Locations (Never Write to ~/.weavetab/)
804
-
805
- | Tier | Path | Owner |
806
- |---|---|---|
807
- | Tier 1 selectors | `~/.weavetab-system/memory/<hostname>.json` | Engine (auto) |
808
- | Tier 2 site profiles | `~/.weavetab-system/memory/sites/<origin>.json` | Engine via `browser_pattern_learn` |
809
- | Knowledge hints | `~/.weavetab-system/knowledge/<hostname>.md` | Engine (auto, 20-token notes) |
810
- | User config | `~/.weavetab/config.json` | Human — never written by agents |
1570
+ ## 1. Device Presets & Viewport Simulation (`browser_viewport`)
811
1571
 
1572
+ List the available hardware presets, then apply one:
812
1573
 
813
- ## session-trail
1574
+ ```json
1575
+ { "action": "list" }
1576
+ ```
814
1577
 
815
- # Session Trails & Deterministic Macro Compilation
816
-
817
- 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.
818
-
819
- `browser_burst` with `compile_from_history: true` automatically converts recent successful session actions into a high-performance, deterministic execution script.
820
-
821
- ---
822
-
823
- ## 1. Compiling and Replaying Recent Actions (`browser_burst`)
824
-
825
- Replay recent successful actions directly in a single turn:
826
-
827
- ```json
828
- {
829
- "compile_from_history": true
830
- }
831
- ```
832
-
833
- Or pass `dry_run: true` to inspect the compiled macro steps before running them:
834
-
835
- ```json
836
- {
837
- "compile_from_history": true,
838
- "dry_run": true,
839
- "history_limit": 15
840
- }
841
- ```
842
-
843
- ### Response Example:
844
- ```json
845
- {
846
- "success": true,
847
- "steps_completed": 0,
848
- "compiled_steps": [
849
- { "tool": "browser_navigate", "args": { "url": "https://analytics.example.com" } },
850
- { "tool": "browser_fill", "args": { "ref": "w:12", "value": "metrics" } },
851
- { "tool": "click_and_wait", "args": { "ref": "w:15" } }
852
- ],
853
- "message": "compiled 3 macro steps from history"
854
- }
855
- ```
856
-
857
- ---
858
-
859
- ## 2. Parameterizing Variable Inputs
860
-
861
- When `"parameterizeInputs": true` is passed:
862
- - Text inputs and dates entered during the exploratory session are replaced with named parameters.
863
- - Secrets entered via `browser_type_secret` are never hardcoded; they are replaced with environment variable or secret lookups.
864
-
865
- ---
866
-
867
- ## 3. Replaying Compiled Automations
868
-
869
- Compiled macros can be executed in sub-second time without LLM inference overhead using `browser_automation`:
870
-
871
- ```json
872
- {
873
- "macroId": "macro_8f7b2c",
874
- "parameters": {
875
- "startDate": "2026-09-01",
876
- "endDate": "2026-09-03"
877
- }
878
- }
879
- ```
880
-
881
- ---
882
-
883
- ## 4. Emitting Operational Thoughts (`browser_thoughts`)
884
-
885
- Log agent rationale and internal reasoning directly to the Weavetab HUD and telemetry stream without bloating user chat responses:
886
-
887
- ```json
888
- {
889
- "thought": "Detected dynamic React hydration delay. Holding interaction until DOM mutation settles."
890
- }
1578
+ ```json
1579
+ {
1580
+ "action": "preset",
1581
+ "devicePreset": "iPhone 15 Pro"
1582
+ }
891
1583
  ```
892
1584
 
1585
+ Or configure custom screen geometry directly with `action: "set"`:
893
1586
 
894
- ## site-learning
1587
+ ```json
1588
+ {
1589
+ "action": "set",
1590
+ "width": 393,
1591
+ "height": 852,
1592
+ "deviceScaleFactor": 3,
1593
+ "mobile": true,
1594
+ "hasTouch": true,
1595
+ "screenOrientation": "portrait"
1596
+ }
1597
+ ```
895
1598
 
896
- # Site Learning — Autonomous Workflow Memory
1599
+ Clear all viewport and emulation overrides back to the host defaults:
897
1600
 
898
- 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.
1601
+ ```json
1602
+ { "action": "clear" }
1603
+ ```
899
1604
 
900
1605
  ---
901
1606
 
902
- ## 1. Session Start Protocol
1607
+ ## 2. Network & CPU Throttling (`browser_emulate`)
903
1608
 
904
- On every session visiting a known or potentially-known site, run:
1609
+ Verify how web applications degrade under poor connectivity:
905
1610
 
906
- `json
907
- { "tool": "browser_pattern_learn", "action": "get", "origin": "https://github.com" }
908
- `
1611
+ ```json
1612
+ {
1613
+ "network": {
1614
+ "offline": false,
1615
+ "downloadThroughput": 512000,
1616
+ "uploadThroughput": 256000,
1617
+ "latency": 400
1618
+ },
1619
+ "cpuThrottlingRate": 4
1620
+ }
1621
+ ```
909
1622
 
910
- Parse the response:
911
- - known: false → site is new, proceed exploratorily, teach after completion
912
- - known_patterns → list of named workflows with reliability scores
913
- - quirks → auto-handle any listed quirks (cookie banners, rate limits) before main task
914
- - ramework → adjust interaction strategy accordingly (React, Vue, etc.)
1623
+ Use a named profile for common cases (`"slow3g"`, `"fast3g"`, `"4g"`, `"offline"`, `"online"`):
1624
+
1625
+ ```json
1626
+ { "network": "slow3g" }
1627
+ ```
915
1628
 
916
1629
  ---
917
1630
 
918
- ## 2. Fast-Path vs. Exploratory Decision
1631
+ ## 3. Geolocation, Timezone, Locale & Color Scheme (`browser_viewport`)
919
1632
 
920
- Use the _hint field or individual
1633
+ Bypass localized IP redirects or verify localized content rendering:
921
1634
 
922
- | Reliability | Strikes | Strategy |
923
- |---|---|---|
924
- | ≥ 0.8, strikes = 0 | ✓ | **Fast path**: replay steps via rowser_burst directly |
925
- | 0.5–0.79 | 0–1 | **Cautious path**: replay steps, verify success_indicator after each critical step |
926
- | < 0.5 | any | **Re-explore**: navigate manually, collect correct steps, then teach |
927
- | any | ≥ 3 | **Re-learn**: ignore cached pattern, re-explore, then call rowser_pattern_learn with updated steps |
1635
+ ```json
1636
+ {
1637
+ "action": "set",
1638
+ "geolocation": {
1639
+ "latitude": 37.7749,
1640
+ "longitude": -122.4194,
1641
+ "accuracy": 100
1642
+ },
1643
+ "timezoneId": "America/Los_Angeles",
1644
+ "locale": "en-US",
1645
+ "colorScheme": "dark"
1646
+ }
1647
+ ```
928
1648
 
929
- ---
930
1649
 
931
- ## 3. Quirk Auto-Handling
1650
+ ## network-intercept-and-mock
932
1651
 
933
- If a profile has known quirks, resolve them immediately after navigation before executing your main task:
1652
+ # Network Interception, Mocking & Telemetry
934
1653
 
935
- `
936
- Profile quirks: { cookie_banner: { selector: "#cookie-consent", action: "click .accept-all", appears: "first_visit" } }
937
- `
1654
+ Autonomous testing and debugging often require simulating backend error states (e.g. 500 Internal Server Error, 429 Rate Limit), stubbing third-party analytics, or inspecting real request timing and TLS metadata.
938
1655
 
939
- Execute the action before doing anything else. Never spend reasoning turns on a known dismissible popup.
1656
+ `browser_network_intercept` exposes four actions: `enable`, `disable`, `get_telemetry`, and `clear_telemetry`.
940
1657
 
941
1658
  ---
942
1659
 
943
- ## 4. Teaching a Workflow Pattern
1660
+ ## 1. Mocking API Responses (`enable`)
944
1661
 
945
- After successfully completing a multi-step flow for the first time (or after re-learning):
1662
+ `enable` requires a `pattern` (URL glob). Every matching response is fulfilled with your mock:
946
1663
 
947
- `json
1664
+ ```json
948
1665
  {
949
- "tool": "browser_pattern_learn",
950
- "origin": "https://github.com",
951
- "action": "learn",
952
- "name": "login_flow",
953
- "steps": [
954
- { "tool": "browser_navigate", "target": "https://github.com/login" },
955
- { "tool": "browser_fill", "target": "#login_field", "value": "{{username}}" },
956
- { "tool": "browser_fill", "target": "#password", "value": "{{password}}" },
957
- { "tool": "browser_click", "target": "[type=submit]" }
958
- ],
959
- "success_indicator": "a[aria-label='Homepage']",
960
- "entry": "/login"
1666
+ "action": "enable",
1667
+ "pattern": "*/api/v1/user/profile",
1668
+ "mockStatus": 200,
1669
+ "mockBody": "{\"id\": \"usr_test\", \"role\": \"admin\", \"credits\": 9999}"
961
1670
  }
962
- `
1671
+ ```
963
1672
 
964
- **Pattern Naming Rules**:
965
- - Use snake_case
966
- - Be descriptive: login_flow, pr_review, csv_export, checkout_flow
967
- - Duplicate name on same origin = **update** (merge), never creates a second pattern
1673
+ - **`pattern`** — URL glob, e.g. `*api/users*`. `*` and `?` are treated as wildcards.
1674
+ - **`mockStatus`** — HTTP status to return (default `200`). Use `500`/`429`/`404` to simulate failures.
1675
+ - **`mockBody`** — response body string (default `{}`). Pass JSON as a string.
968
1676
 
969
- **Step Quality Rules**:
970
- - Use semantic selectors: data-testid, id, ria-label, readable text-based selectors
971
- - Avoid: .hash_abc123, div:nth-child(4), deep anonymous chains like div > div > div > span
972
- (the engine automatically drops volatile selectors during compilation)
973
- - For sensitive inputs, record the step with a placeholder like {{username}} — never hardcode credentials
1677
+ Mocks are served from the extension when present, otherwise via CDP's Fetch domain (fallback mode).
974
1678
 
975
1679
  ---
976
1680
 
977
- ## 5. Reliability Upkeep After Replay
1681
+ ## 2. Stopping Interception (`disable`)
978
1682
 
979
- Every time you replay a pattern, report the outcome:
1683
+ Return the browser to live traffic when a test completes:
980
1684
 
981
- `json
1685
+ ```json
982
1686
  {
983
- "tool": "browser_pattern_learn",
984
- "origin": "https://github.com",
985
- "action": "record_execution",
986
- "name": "login_flow",
987
- "success": true,
988
- "duration_ms": 3100
1687
+ "action": "disable"
989
1688
  }
990
- `
991
-
992
- The engine uses EWMA (α=0.15) to update the reliability score:
993
- - Success run → reliability climbs toward 1.0 slowly
994
- - Failure run → reliability drops; 3 consecutive failures trigger [RE-LEARN NEEDED] flag
1689
+ ```
995
1690
 
996
1691
  ---
997
1692
 
998
- ## 6. Recording a New Quirk
1693
+ ## 3. Network Telemetry (`get_telemetry`)
999
1694
 
1000
- When you encounter a cookie consent modal, popup, or rate limit for the first time:
1695
+ `get_telemetry` starts a background capture (if not already running) and returns the recorded requests — including per-request protocol timing phases, TLS/SSL certificate details when the connection exposes them, and failure reasons:
1001
1696
 
1002
- `json
1697
+ ```json
1003
1698
  {
1004
- "tool": "browser_pattern_learn",
1005
- "origin": "https://example.com",
1006
- "action": "record_quirk",
1007
- "quirk_key": "cookie_banner",
1008
- "quirk_data": {
1009
- "selector": "#cookie-consent",
1010
- "action": "click .accept-all",
1011
- "appears": "first_visit"
1012
- }
1699
+ "action": "get_telemetry",
1700
+ "pattern": "*api/*"
1013
1701
  }
1014
- `
1702
+ ```
1015
1703
 
1016
- Supported quirk_key values: cookie_banner,
1704
+ An optional `pattern` filters the returned requests by URL. The response includes:
1017
1705
 
1018
- For rate limits:
1019
- `json
1706
+ ```json
1020
1707
  {
1021
- "quirk_key": "rate_limit",
1022
- "quirk_data": { "threshold": "60req/min", "recovery": "wait 30s" }
1708
+ "success": true,
1709
+ "count": 12,
1710
+ "requests": [
1711
+ {
1712
+ "url": "https://weavetab.dev/api/v1/session",
1713
+ "timing": { "dnsMs": 1.4, "tcpMs": 3.2, "sslMs": 4.1, "ttfbMs": 12.8 }
1714
+ }
1715
+ ],
1716
+ "navigationOccurred": false,
1717
+ "errors": []
1023
1718
  }
1024
- `
1719
+ ```
1720
+
1721
+ > Certificates and timing fields are surfaced only when the underlying connection exposes them; treat missing fields as "not reported", not "absent".
1025
1722
 
1026
1723
  ---
1027
1724
 
1028
- ## 7. Anti-Patterns to Avoid
1725
+ ## 4. Clearing the Buffer (`clear_telemetry`)
1029
1726
 
1030
- - **Never create per-session pattern names** like login_2026_09_16 — one name per workflow per origin, forever updated in place.
1031
- - **Never call rowser_pattern_learn in a loop** — one call per workflow completion. The write is idempotent (skips disk write if nothing changed).
1032
- - **Never store credentials in steps** — use placeholders or rowser_type_secret in actual execution.
1033
- - **Never write to ~/.weavetab/** — all memory belongs in ~/.weavetab-system/memory/sites/.
1727
+ Reset the capture buffer between scenarios without tearing down the session:
1034
1728
 
1035
- ---
1729
+ ```json
1730
+ {
1731
+ "action": "clear_telemetry"
1732
+ }
1733
+ ```
1036
1734
 
1037
- ## 8. Full Session Example: GitHub PR Review
1038
1735
 
1039
- `
1040
- 1. browser_pattern_learn { action: "get", origin: "https://github.com" }
1041
- → patterns: { pr_review: { reliability: 0.95, steps: 3 } }
1042
- → quirks: {} (none)
1736
+ ## performance-and-vitals
1043
1737
 
1044
- 2. Since reliability=0.95 (≥ 0.8): use fast path
1045
- browser_burst with the 3 stored steps
1738
+ # Performance Forensics & Core Web Vitals
1046
1739
 
1047
- 3. After completion:
1048
- browser_pattern_learn {
1049
- action: "record_execution",
1050
- name: "pr_review",
1051
- success: true,
1052
- duration_ms: 2800
1053
- }
1054
- `
1740
+ Optimizing agent execution and auditing client performance requires objective metrics rather than arbitrary sleep timers.
1055
1741
 
1056
- Total agent turns for a known site: **3 tool calls** vs. potentially 12+ with full exploration.
1742
+ ---
1057
1743
 
1744
+ ## 1. Core Web Vitals Auditing (`browser_performance`)
1058
1745
 
1059
- # ====================================================
1060
- # DOMAIN: RESILIENCE
1061
- # ====================================================
1746
+ Retrieve Google Core Web Vitals, memory consumption, and frame rendering bottlenecks directly from the Chromium engine:
1062
1747
 
1063
- # Weavetab Domain Profile: RESILIENCE
1748
+ ```json
1749
+ {
1750
+ "metrics": ["vitals", "memory", "navigation"]
1751
+ }
1752
+ ```
1064
1753
 
1065
- Generated for @weavetab/skills v2.5.0-beta.5
1754
+ ### Response Example:
1755
+ ```json
1756
+ {
1757
+ "vitals": {
1758
+ "fcp": 320,
1759
+ "lcp": 780,
1760
+ "cls": 0.012,
1761
+ "inp": 45,
1762
+ "ttfb": 12
1763
+ },
1764
+ "memory": {
1765
+ "usedJSHeapSize": 44154880,
1766
+ "totalJSHeapSize": 71729152,
1767
+ "jsHeapSizeLimit": 4294705152
1768
+ }
1769
+ }
1770
+ ```
1066
1771
 
1772
+ Valid `metrics` sections: `"vitals"`, `"memory"`, `"navigation"`, `"resources"`, `"raw"`. Omit `metrics` to return all sections. Heap sizes are in **bytes**. The `"resources"` section populates `slowest_resources` (top 10 by duration).
1067
1773
 
1068
- ## loop-breaker
1774
+ ---
1069
1775
 
1070
- # Loop Breaker & CAPTCHA Escalation Protocol
1071
-
1072
- Agents can get trapped in repetitive click loops when a button does not advance the state (e.g. failing silent validation, unhandled reCAPTCHA challenges, or modals swallowing events). Weavetab actively monitors repetitive patterns and provides circuit breakers.
1073
-
1074
- ---
1075
-
1076
- ## 1. Loop Detection & Strike Reset (`browser_map`)
1077
-
1078
- Weavetab tracks the sequence of identical or near-identical tool invocations. If an agent calls `browser_click` or `browser_type` on the same selector or ref repeatedly without URL or major DOM mutations, the server raises a `STUCK_LOOP_WARNING`.
1079
-
1080
- ### How to Break the Loop:
1081
- 1. **Analyze Why the Action Failed**: Check `browser_console` for JavaScript errors:
1082
- ```json
1083
- { "action": "read" }
1084
- ```
1085
- Or use `browser_map` to see if a validation banner or unhandled modal appeared.
1086
- 2. **Reset the Circuit Breaker**:
1087
- - Re-map with `force: true` to bypass the map skip guard, refresh the DOM view, and automatically clear loop strikes:
1088
- ```json
1089
- { "force": true }
1090
- ```
1091
-
1092
- ---
1093
-
1094
- ## 2. CAPTCHA Handling Protocol (`browser_captcha`)
1095
-
1096
- When an automated flow is blocked by Cloudflare Turnstile, Google reCAPTCHA, or hCaptcha, do NOT repeatedly click random coordinates.
1097
-
1098
- Invoke `browser_captcha` to analyze and manage the challenge:
1099
-
1100
- ```json
1101
- {
1102
- "action": "detect"
1103
- }
1104
- ```
1105
-
1106
- ### Response Example:
1107
- ```json
1108
- {
1109
- "detected": true,
1110
- "type": "turnstile",
1111
- "provider": "cloudflare",
1112
- "interactive": true,
1113
- "ref": "w:99"
1114
- }
1115
- ```
1116
-
1117
- ### Action Strategy:
1118
- 1. If the challenge is interactive and requires human intervention (e.g. image classification), inform the user cleanly or request human bypass.
1119
- 2. If the challenge is a simple checkbox Turnstile widget, pass `"action": "solve"` or click the detected widget ref with `browser_click`.
1776
+ ## 2. Deterministic Synchronization (`browser_wait`)
1120
1777
 
1778
+ > [!WARNING]
1779
+ > NEVER call arbitrary fixed sleep timers (e.g. `sleep 5000`). Fixed sleeps waste user time and still fail when network latency spikes.
1121
1780
 
1122
- ## session-time-travel
1781
+ Always synchronize with deterministic browser conditions:
1123
1782
 
1124
- # Session Time-Travel & Instant State Rollback
1125
-
1126
- In complex multi-step workflows (e.g. checkout funnels, multi-page configuration wizards, onboarding questionnaires), an error at Step 7 traditionally forces an agent to reload the root URL, re-authenticate, and waste 10+ turns repeating steps.
1127
-
1128
- `browser_checkpoint` enables instantaneous time-travel by snapshotting and restoring complete browser session state.
1129
-
1130
- ---
1131
-
1132
- ## 1. What a Checkpoint Captures
1133
-
1134
- A single named checkpoint atomically preserves:
1135
- - **Cookies**: Full domain cookies including `HttpOnly`, `Secure`, and `SameSite` flags.
1136
- - **Web Storage**: Entire `localStorage` and `sessionStorage` key-value maps.
1137
- - **Navigation State**: Exact page URL, scroll positions (`x`, `y`), and page title.
1138
-
1139
- ---
1140
-
1141
- ## 2. Checkpoint Operations
1142
-
1143
- ### A. Saving a Checkpoint (`save`)
1144
- Create a checkpoint right before undertaking risky, branching, or destructive actions:
1145
-
1146
- ```json
1147
- {
1148
- "action": "save",
1149
- "name": "pre_checkout_authenticated"
1150
- }
1151
- ```
1152
-
1153
- ### B. Restoring a Checkpoint (`restore`)
1154
- If a downstream step errors out, times out, or hits an invalid state, roll back immediately:
1155
-
1156
- ```json
1157
- {
1158
- "action": "restore",
1159
- "name": "pre_checkout_authenticated"
1160
- }
1161
- ```
1162
- *Latency: ~15ms*. The page navigates back to the checkpoint URL with cookies and storage atomically injected.
1163
-
1164
- ### C. Listing Checkpoints (`list`)
1165
- Inspect all active checkpoints for the current page target:
1166
-
1167
- ```json
1168
- {
1169
- "action": "list"
1170
- }
1171
- ```
1172
-
1173
- ### D. Cleaning Up (`delete`)
1174
- Free memory once a workflow has concluded:
1175
-
1176
- ```json
1177
- {
1178
- "action": "delete",
1179
- "name": "pre_checkout_authenticated"
1180
- }
1181
- ```
1182
-
1183
- ---
1184
-
1185
- ## 3. High-Leverage Agent Pattern
1186
-
1187
- ```
1188
- 1. Authenticate to Target Portal
1189
- 2. browser_checkpoint({ action: "save", name: "auth_ready" })
1190
- 3. Attempt automated action sequence (e.g. form filling or testing)
1191
- 4. IF error occurs:
1192
- browser_checkpoint({ action: "restore", name: "auth_ready" })
1193
- -> Agent is immediately back at authenticated state without re-login!
1194
- ```
1195
-
1196
- ---
1197
-
1198
- ## 4. Fine-Grained Cookie Management (`browser_cookies`)
1199
-
1200
- Inspect, set, or delete individual browser session cookies without restoring an entire checkpoint:
1201
-
1202
- ```json
1203
- {
1204
- "action": "get",
1205
- "urls": ["https://example.com"]
1206
- }
1207
- ```
1208
-
1209
- Or inject an authentication cookie:
1210
- ```json
1211
- {
1212
- "action": "set",
1213
- "cookies": [
1214
- {
1215
- "name": "session_token",
1216
- "value": "xyz123",
1217
- "domain": "example.com",
1218
- "httpOnly": true,
1219
- "secure": true
1220
- }
1221
- ]
1222
- }
1223
- ```
1224
-
1225
- ---
1226
-
1227
- ## 5. Web Storage Inspection & Injection (`browser_storage`)
1228
-
1229
- Query or clear `localStorage` and `sessionStorage` keys:
1230
-
1231
- ```json
1232
- {
1233
- "storageType": "localStorage",
1234
- "action": "get",
1235
- "key": "authToken"
1236
- }
1783
+ ### Wait for Network Idle:
1784
+ ```json
1785
+ {
1786
+ "for": "network",
1787
+ "timeout": 10000
1788
+ }
1237
1789
  ```
1238
1790
 
1791
+ ### Wait for DOM Mutation Stability:
1792
+ ```json
1793
+ {
1794
+ "for": "stable",
1795
+ "timeout": 10000
1796
+ }
1797
+ ```
1239
1798
 
1240
- ## stale-ref-recovery
1241
-
1242
- # Stale Ref Recovery & SPA Hydration Resilience
1243
-
1244
- In modern Single Page Applications (built with React, Next.js, Vue, Nuxt, Svelte), DOM nodes are frequently destroyed and recreated during client-side hydration or reactive state updates. This often causes `STALE_ELEMENT_REFERENCE` or `NODE_DETACHED` errors when an agent attempts an action.
1245
-
1246
- ---
1247
-
1248
- ## 1. The 4-Tier Auto-Recovery Chain
1249
-
1250
- When a tool receives a stale or missing `ref`, Weavetab does not immediately fail. It activates an internal 4-tier recovery chain:
1251
-
1252
- ```
1253
- [Action on w:14 Fails / Stale]
1254
- │
1255
- ▼
1256
- [Tier 1: Stored Selector] ──▶ Re-queries cached stable selector (data-testid, id)
1257
- │ (if not found)
1258
- ▼
1259
- [Tier 2: Exact Label Match] ──▶ Queries element with identical visible text & tag
1260
- │ (if not found)
1261
- ▼
1262
- [Tier 3: Semantic Role Match] ──▶ Queries nearest sibling with matching ARIA role
1263
- │ (if not found)
1264
- ▼
1265
- [Tier 4: Fuzzy Match] ──▶ Re-anchors to highest-confidence visual candidate
1266
- ```
1267
-
1268
- If the recovery chain succeeds, the action executes seamlessly and the return payload notifies the agent that the handle was refreshed.
1269
-
1270
- ---
1271
-
1272
- ## 2. Agent Reactive Behavior
1273
-
1274
- If an action returns `ERROR: STALE_ELEMENT_REFERENCE` because all 4 recovery tiers were exhausted:
1275
-
1276
- 1. **Do NOT Repeat the Identical Call**: Retrying the exact same stale `ref` (`w:14`) will fail again.
1277
- 2. **Execute a Fast Targeted Lookup**: Run `browser_find` with the text of the button or input field.
1278
- 3. **Execute the Action on the New Handle**: Use the updated handle returned by `browser_find`.
1799
+ ### Wait for a Specific Element to Appear:
1800
+ ```json
1801
+ {
1802
+ "for": "element",
1803
+ "value": "[data-testid=\"checkout-complete\"]",
1804
+ "timeout": 15000
1805
+ }
1806
+ ```
1279
1807
 
1280
1808
 
1281
1809
  # ====================================================
1282
- # DOMAIN: SECURITY
1810
+ # DOMAIN: DOCUMENTS
1283
1811
  # ====================================================
1284
1812
 
1285
- # Weavetab Domain Profile: SECURITY
1813
+ # Weavetab Domain Profile: DOCUMENTS
1286
1814
 
1287
- Generated for @weavetab/skills v2.5.0-beta.5
1815
+ Generated for @weavetab/skills v2.5.1
1288
1816
 
1289
1817
 
1290
- ## rbac-and-policies
1818
+ ## canvas-and-visual-capture
1291
1819
 
1292
- # Role-Based Access Control (RBAC) & Agent Guardrails
1293
-
1294
- Weavetab allows developers to run untrusted or lower-privilege subagents within strict security boundaries to prevent accidental destructive operations or data leaks.
1295
-
1296
- ---
1297
-
1298
- ## 1. The 4 Security Tiers
1299
-
1300
- | Tier | Name | Allowed Tools & Capabilities | Intended Role |
1301
- | :--- | :--- | :--- | :--- |
1302
- | **0** | `admin` | Full tool access (all 48 tools), plugin loading, arbitrary script eval, cookies/storage write. | Primary Operator / Lead Agent. |
1303
- | **1** | `operator` | Interactive tools (`browser_click`, `browser_fill`, `browser_upload`), but blocked from loading untrusted plugins. | Standard Automation Agent. |
1304
- | **2** | `automation` | Pre-approved deterministic macros (`browser_automation`), scoped form filling, no arbitrary script execution. | Background Cron / Worker. |
1305
- | **3** | `viewer` | Read-only inspection tools (`browser_map`, `browser_find`, `browser_scrape`, `browser_inspect`). All click, type, and storage tools are rejected with `PERMISSION_DENIED`. | Research Subagents / Scrapers. |
1306
-
1307
- ---
1308
-
1309
- ## 2. Handling `PERMISSION_DENIED` Errors
1310
-
1311
- If an agent attempts an action outside its allocated role tier:
1312
- ```json
1313
- {
1314
- "error_code": "PERMISSION_DENIED",
1315
- "message": "Tool 'browser_click' is disabled under role 'viewer'. Only read operations are permitted."
1316
- }
1317
- ```
1318
-
1319
- ### Protocol:
1320
- 1. Do not retry the denied tool.
1321
- 2. Delegate the interactive action to the parent agent or primary operator.
1322
- 3. Limit your output to findings gathered via read-only tools (`browser_scrape`, `browser_map`, `browser_inspect`).
1820
+ # Visual Capture, Canvas Forensics & Design Extraction
1323
1821
 
1822
+ Beyond textual DOM manipulation, modern web applications contain dynamic HTML5 canvas renderings (charts, maps, WebGL games), and agents often need high-fidelity visual artifacts.
1324
1823
 
1325
- ## secret-containment-protocol
1824
+ ---
1326
1825
 
1327
- # Secret Containment Protocol & Zero-Bleed Execution
1328
-
1329
- AI agent transcripts, LLM providers, and tool logs represent massive attack surfaces for credential leaks. Weavetab enforces a hardware-grade **Zero-Bleed Security Guarantee** for sensitive inputs.
1330
-
1331
- ---
1332
-
1333
- ## 1. Entering Credentials with `browser_type_secret`
1334
-
1335
- Whenever an agent inputs passwords, two-factor backup codes, credit card numbers, or proprietary API keys, you MUST use `browser_type_secret`:
1336
-
1337
- ```json
1338
- {
1339
- "ref": "w:12",
1340
- "secret": "MySuperSecretPassword!2026",
1341
- "clear": true
1342
- }
1343
- ```
1344
-
1345
- ---
1346
-
1347
- ## 2. The Zero-Bleed Guarantee Architecture
1348
-
1349
- When `browser_type_secret` is invoked:
1350
- 1. **CDP Interception**: The secret is typed via masked CDP synthetic key events.
1351
- 2. **HUD Redaction**: The browser Heads-Up Display (HUD) and visual overlay strictly renders bullets (`••••••••`).
1352
- 3. **Log Sanitization**: Console logs, MCP server logs, and JSON return values strip the secret string and return:
1353
- ```json
1354
- {
1355
- "success": true,
1356
- "message": "Secret typed successfully into ref 'w:12' (length: 26). Value redacted."
1357
- }
1358
- ```
1359
- 4. **No Re-Emission**: Never print or echo raw credentials into subsequent model thoughts or conversation messages.
1360
-
1361
- ---
1362
-
1363
- ## 3. Strict Operating Prohibition
1364
-
1365
- > [!CAUTION]
1366
- > Under NO circumstances should an agent pass passwords or credentials to:
1367
- > - `browser_type`
1368
- > - `browser_fill`
1369
- > - `browser_eval`
1370
- >
1371
- > Doing so causes plaintext secrets to enter unmasked transcripts and tool logs.
1826
+ ## 1. Targeted Screenshots (`browser_screenshot`)
1372
1827
 
1828
+ Capture full page layouts, the visible viewport, or specific element bounding boxes:
1373
1829
 
1374
- # ====================================================
1375
- # DOMAIN: PLUGINS
1376
- # ====================================================
1830
+ ```json
1831
+ {
1832
+ "fullPage": true,
1833
+ "format": "png"
1834
+ }
1835
+ ```
1377
1836
 
1378
- # Weavetab Domain Profile: PLUGINS
1837
+ Or crop to a specific element by CSS selector, or to a pixel rectangle with `clip`:
1838
+ ```json
1839
+ {
1840
+ "selector": "#pricing-table",
1841
+ "format": "jpeg",
1842
+ "quality": 80
1843
+ }
1844
+ ```
1379
1845
 
1380
- Generated for @weavetab/skills v2.5.0-beta.5
1846
+ Options: `format` (`png` default, or `jpeg`), `quality` (JPEG only), `fullPage`, `selector`, and `clip` (`{x, y, width, height}`).
1381
1847
 
1848
+ ---
1382
1849
 
1383
- ## hooks-and-overrides
1850
+ ## 2. PDF Document Generation (`browser_pdf`)
1384
1851
 
1385
- # Plugin Hooks & Lifecycle Overrides
1386
-
1387
- Plugins built with `@weavetab/sdk` register lifecycle hooks that run before and after tool executions. Understanding these hooks helps agents interpret metadata and custom tool responses.
1388
-
1389
- ---
1390
-
1391
- ## 1. Supported Plugin Hooks
1392
-
1393
- 1. **`beforeToolCall(toolName, args)`**:
1394
- - Validates arguments against custom enterprise schemas.
1395
- - Injects tenant IDs, authentication headers, or proxy routing.
1396
- 2. **`afterToolCall(toolName, result, durationMs)`**:
1397
- - Emits OpenTelemetry metrics and timing waterfalls to external APM platforms.
1398
- - Enriches return objects with contextual metadata.
1399
- 3. **`onNavigate(url, targetId)`**:
1400
- - Triggers automated cookie injection or session setup upon page navigation.
1401
-
1402
- ---
1403
-
1404
- ## 2. Agent Operational Awareness
1405
-
1406
- When plugins are active, tool return payloads may include an optional `_pluginMetadata` object containing trace IDs, custom metrics, or security audit timestamps. Agents should treat this object as informational telemetry.
1852
+ Render the current page into a print-ready PDF file:
1407
1853
 
1854
+ ```json
1855
+ {
1856
+ "filename": "report.pdf",
1857
+ "landscape": false,
1858
+ "scale": 1.0,
1859
+ "pageRanges": "1-5",
1860
+ "margin": { "top": 0.4, "bottom": 0.4, "left": 0.4, "right": 0.4 }
1861
+ }
1862
+ ```
1408
1863
 
1409
- ## plugin-runtime
1864
+ Options: `filename` (defaults to `capture_<timestamp>.pdf`), `landscape`, `scale` (default 1.0), `pageRanges` (e.g. `"1-5"`, empty for all), and `margin` — either a single number in inches or a `{top,bottom,left,right}` object (default 0.4).
1410
1865
 
1411
- # Plugin Runtime: Weavetab Plugin Architecture
1866
+ ---
1412
1867
 
1413
- Weavetab features an extensible plugin architecture powered by `@weavetab/sdk`. All installed plugins are loaded automatically at server startup — their tools appear directly in the MCP tool list alongside built-in tools. Agents never need to discover or activate plugins manually.
1868
+ ## 3. HTML5 Canvas Pixel Inspection & Visual Grounding (`browser_canvas` & `browser_map`)
1414
1869
 
1415
- ---
1870
+ When a chart or graphic is rendered via `<canvas>`, standard DOM reading tools cannot see individual buttons or nodes. You have two strategies:
1416
1871
 
1417
- ## 1. How Plugin Tools Appear
1872
+ ### A. Set-of-Marks Visual Grounding (Recommended for Canvas UIs & WebGL)
1873
+ Run `browser_map({ visual: "auto" })`. It detects canvas elements and high-contrast regions, attaches numbered badges `[1]…[N]`, and returns an annotated image:
1874
+ ```json
1875
+ {
1876
+ "visual": "auto"
1877
+ }
1878
+ ```
1879
+ Then interact directly by mark number without guessing pixel coordinates:
1880
+ ```json
1881
+ {
1882
+ "mark": 3
1883
+ }
1884
+ ```
1885
+
1886
+ ### B. Direct Canvas Pixel Export (`browser_canvas`)
1887
+ To export the raw canvas as an image, or simulate a drag/gesture path across it:
1888
+ ```json
1889
+ {
1890
+ "ref": "w:19",
1891
+ "action": "get_image"
1892
+ }
1893
+ ```
1418
1894
 
1419
- Plugin tools are first-class MCP tools. If `@weavetab/plugin-recaptcha-solver` is installed, `captcha_solve_token` appears in the tool list immediately on startup — no discovery step needed.
1895
+ For drawing or selecting a region, pass `"action": "draw"` with a `points` array of `{x, y}` positions (relative to the canvas):
1896
+ ```json
1897
+ {
1898
+ "action": "draw",
1899
+ "selector": "canvas#chart",
1900
+ "points": [ { "x": 40, "y": 10 }, { "x": 200, "y": 120 } ]
1901
+ }
1902
+ ```
1420
1903
 
1421
- There are **no** `list_plugins` or `load_plugin` tools. Managing plugins is a CLI operation:
1904
+ ---
1422
1905
 
1423
- ```bash
1424
- # Install a plugin (restart required)
1425
- weavetab plugin add @weavetab/plugin-youtube
1906
+ ## 4. Design System Extraction (`browser_extract_design`)
1426
1907
 
1427
- # Remove a plugin
1428
- weavetab plugin rm @weavetab/plugin-youtube
1908
+ Reverse-engineer UI stylesheets, active CSS custom properties (variables), typography scales, and color palettes:
1429
1909
 
1430
- # List installed plugins
1431
- weavetab plugin list
1910
+ ```json
1911
+ {
1912
+ "selector": ".antigravity-hud-panel"
1913
+ }
1432
1914
  ```
1433
1915
 
1434
- ---
1916
+ Returns structured JSON representing colors, font families, shadows, and spacing tokens.
1435
1917
 
1436
- ## 2. Plugin Permission Model
1437
1918
 
1438
- Every plugin declares what it can do in `weavetab.json`. The runtime enforces this at load time:
1919
+ ## office-document-ingestion
1439
1920
 
1440
- | Permission | What it gates |
1441
- |---|---|
1442
- | `tools.add: true` | Plugin can register new MCP tools |
1443
- | `tools.override: ["browser_navigate"]` | Plugin can wrap/replace that built-in tool |
1444
- | `tools.remove: ["browser_pdf"]` | Plugin can disable that built-in tool |
1445
- | `hooks.onBeforeAction: true` | Plugin can intercept all tool calls before execution |
1446
- | `hooks.onAfterAction: true` | Plugin can inspect/transform all tool results |
1921
+ # Office Document Ingestion: Word, Excel, PDF & CSV Parsing
1447
1922
 
1448
- Plugins that attempt to exceed their declared permissions are blocked with a stderr warning — they do not crash.
1923
+ Agents frequently need to parse structured spreadsheets or corporate documents downloaded during automation runs. `browser_office` reads `.xlsx`, `.xls`, `.docx`, `.pdf`, and `.csv` content directly into JSON.
1449
1924
 
1450
1925
  ---
1451
1926
 
1452
- ## 3. Trust Tiers
1927
+ ## 1. Two Modes: `url` and `file`
1453
1928
 
1454
- | Tier | Badge | Condition |
1455
- |---|---|---|
1456
- | Official | `✚ [Official]` | `@weavetab/plugin-*` packages |
1457
- | Verified | `✔ [Verified]` | Listed in the Weavetab verified registry |
1458
- | Unverified | `⚠ [Unverified]` | Unknown community package |
1929
+ `browser_office({ action: "read" })` accepts exactly one source:
1459
1930
 
1460
- Unverified plugins are loaded but their permissions are logged visibly at startup for user review.
1931
+ - **`url`** — fetch a document URL in-browser using the active session cookies. Ideal for authenticated downloads, SharePoint links, and Google Drive exports. The format is auto-detected from the URL path or MIME type (and magic bytes as a fallback).
1932
+ - **`file`** — parse a file already present in the local downloads directory. Pass a **bare filename** only (e.g. `"report.xlsx"`); path separators are rejected.
1461
1933
 
1934
+ `max_rows` (default 500) caps Excel/CSV rows; `max_chars` (default 50000) caps PDF/Word text.
1462
1935
 
1463
- # ====================================================
1464
- # DOMAIN: NETWORK-AND-PERF
1465
- # ====================================================
1936
+ Use `action: "list"` first if you don't know what files are in the downloads directory.
1466
1937
 
1467
- # Weavetab Domain Profile: NETWORK-AND-PERF
1938
+ ---
1468
1939
 
1469
- Generated for @weavetab/skills v2.5.0-beta.5
1940
+ ## 2. Parsing Spreadsheets (`.xlsx`, `.xls`, `.csv`)
1470
1941
 
1942
+ ```json
1943
+ {
1944
+ "action": "read",
1945
+ "file": "quarterly_revenue.xlsx",
1946
+ "max_rows": 100
1947
+ }
1948
+ ```
1471
1949
 
1472
- ## device-and-environment
1950
+ Excel returns per-sheet tables (rows as objects keyed by header):
1473
1951
 
1474
- # Device Emulation & Environment Simulation
1475
-
1476
- Auditing mobile responsive layouts, testing geographic restrictions, and simulating degraded network conditions can all be accomplished with `browser_emulate`.
1477
-
1478
- ---
1479
-
1480
- ## 1. Device Presets & Viewport Simulation
1481
-
1482
- Switch from desktop to realistic mobile hardware profiles:
1483
-
1484
- ```json
1485
- {
1486
- "device": "iPhone 15 Pro",
1487
- "orientation": "portrait"
1488
- }
1489
- ```
1490
-
1491
- Or configure custom screen geometries:
1492
-
1493
- ```json
1494
- {
1495
- "viewport": {
1496
- "width": 393,
1497
- "height": 852,
1498
- "deviceScaleFactor": 3,
1499
- "isMobile": true,
1500
- "hasTouch": true
1501
- }
1502
- }
1503
- ```
1504
-
1505
- ---
1506
-
1507
- ## 2. Network Throttling Simulation
1508
-
1509
- Verify how web applications degrade under poor connectivity:
1510
-
1511
- ```json
1512
- {
1513
- "network": {
1514
- "offline": false,
1515
- "downloadThroughput": 1024 * 500, // 500 kb/s (Slow 3G)
1516
- "uploadThroughput": 1024 * 250,
1517
- "latency": 400 // ms
1518
- }
1519
- }
1520
- ```
1521
-
1522
- ---
1523
-
1524
- ## 3. Geolocation & Timezone Overrides
1525
-
1526
- Bypass localized IP redirects or verify localized content rendering:
1527
-
1528
- ```json
1529
- {
1530
- "geolocation": {
1531
- "latitude": 37.7749,
1532
- "longitude": -122.4194,
1533
- "accuracy": 100
1534
- },
1535
- "timezoneId": "America/Los_Angeles",
1536
- "locale": "en-US"
1537
- }
1538
- ```
1539
-
1540
- To reset all overrides back to default host system parameters:
1541
- ```json
1542
- {
1543
- "reset": true
1544
- }
1952
+ ```json
1953
+ {
1954
+ "success": true,
1955
+ "source": "quarterly_revenue.xlsx",
1956
+ "type": "excel",
1957
+ "data": {
1958
+ "Q3_Summary": [
1959
+ { "Department": "Engineering", "Budget": 1250000, "Actual": 1180000 },
1960
+ { "Department": "Marketing", "Budget": 600000, "Actual": 620000 }
1961
+ ]
1962
+ },
1963
+ "truncated": false
1964
+ }
1545
1965
  ```
1546
1966
 
1967
+ CSV returns `type: "csv"` with a flat `data` array of row objects.
1547
1968
 
1548
- ## network-intercept-and-mock
1969
+ ---
1549
1970
 
1550
- # Network Interception, Mocking & TLS Forensics
1551
-
1552
- Autonomous testing and debugging often require simulating backend error states (e.g. 500 Internal Server Error, 429 Rate Limit), stubbing third-party analytics, or verifying TLS/SSL certificates.
1553
-
1554
- `browser_network_intercept` provides fine-grained CDP request and response modification.
1555
-
1556
- ---
1557
-
1558
- ## 1. Mocking API Responses
1559
-
1560
- Intercept outgoing HTTP requests matching a URL pattern and return custom mock data:
1561
-
1562
- ```json
1563
- {
1564
- "pattern": "*/api/v1/user/profile",
1565
- "response": {
1566
- "status": 200,
1567
- "headers": {
1568
- "Content-Type": "application/json"
1569
- },
1570
- "body": "{\"id\": \"usr_test\", \"role\": \"admin\", \"credits\": 9999}"
1571
- }
1572
- }
1573
- ```
1574
-
1575
- ---
1576
-
1577
- ## 2. Blocking Unnecessary Traffic & Trackers
1578
-
1579
- Accelerate page loads and eliminate token bloat by aborting non-essential requests:
1580
-
1581
- ```json
1582
- {
1583
- "pattern": "*google-analytics.com*",
1584
- "action": "abort",
1585
- "errorReason": "BlockedByClient"
1586
- }
1587
- ```
1588
-
1589
- ---
1590
-
1591
- ## 3. TLS / SSL Forensics & Timing Waterfalls
1592
-
1593
- Extract cryptographic handshake metadata, cipher suites, expiration dates, and microsecond network waterfalls (DNS lookup, TCP connect, SSL handshake, TTFB):
1594
-
1595
- ```json
1596
- {
1597
- "action": "auditTls",
1598
- "url": "https://weavetab.dev"
1599
- }
1600
- ```
1601
-
1602
- ### Response Example:
1603
- ```json
1604
- {
1605
- "security": {
1606
- "protocol": "TLS 1.3",
1607
- "cipher": "AES_128_GCM",
1608
- "issuer": "Let's Encrypt",
1609
- "validTo": "2026-11-15T00:00:00.000Z"
1610
- },
1611
- "waterfall": {
1612
- "dnsMs": 1.4,
1613
- "tcpMs": 3.2,
1614
- "sslMs": 4.1,
1615
- "ttfbMs": 12.8
1616
- }
1617
- }
1618
- ```
1971
+ ## 3. Ingesting Word & PDF Documents (`.docx`, `.pdf`)
1619
1972
 
1973
+ Word and PDF extraction return text in `content` (truncated by `max_chars`). PDF additionally reports page metadata under `data`:
1620
1974
 
1621
- ## performance-and-vitals
1975
+ ```json
1976
+ {
1977
+ "action": "read",
1978
+ "url": "https://intranet.example.com/docs/service_agreement.pdf"
1979
+ }
1980
+ ```
1622
1981
 
1623
- # Performance Forensics & Core Web Vitals
1624
-
1625
- Optimizing agent execution and auditing client performance requires objective metrics rather than arbitrary sleep timers.
1626
-
1627
- ---
1628
-
1629
- ## 1. Core Web Vitals Auditing (`browser_performance`)
1630
-
1631
- Retrieve Google Core Web Vitals, memory consumption, and frame rendering bottlenecks directly from the Chromium engine:
1632
-
1633
- ```json
1634
- {
1635
- "metrics": ["vitals", "memory", "navigationTiming"]
1636
- }
1637
- ```
1638
-
1639
- ### Response Example:
1640
- ```json
1641
- {
1642
- "vitals": {
1643
- "fcp": 320,
1644
- "lcp": 780,
1645
- "cls": 0.012,
1646
- "fid": 8,
1647
- "inp": 45
1648
- },
1649
- "memory": {
1650
- "jsHeapUsedSizeMb": 42.1,
1651
- "jsHeapTotalSizeMb": 68.4
1652
- }
1653
- }
1654
- ```
1655
-
1656
- ---
1657
-
1658
- ## 2. Deterministic Synchronization (`browser_wait`)
1659
-
1660
- > [!WARNING]
1661
- > NEVER call arbitrary fixed sleep timers (e.g. `sleep 5000`). Fixed sleeps waste user time and still fail when network latency spikes.
1662
-
1663
- Always synchronize with deterministic browser conditions:
1664
-
1665
- ### Wait for Network Idle:
1666
- ```json
1667
- {
1668
- "condition": "network_idle",
1669
- "timeout": 10000
1670
- }
1671
- ```
1672
-
1673
- ### Wait for DOM Mutation Stability:
1674
- ```json
1675
- {
1676
- "condition": "dom_stable",
1677
- "duration": 500,
1678
- "timeout": 10000
1679
- }
1680
- ```
1681
-
1682
- ### Wait for a Specific Element to Appear:
1683
- ```json
1684
- {
1685
- "condition": "element_visible",
1686
- "selector": "[data-testid=\"checkout-complete\"]",
1687
- "timeout": 15000
1688
- }
1982
+ ```json
1983
+ {
1984
+ "success": true,
1985
+ "source": "https://intranet.example.com/docs/service_agreement.pdf",
1986
+ "type": "pdf",
1987
+ "content": "SERVICE AGREEMENT ...",
1988
+ "truncated": true,
1989
+ "data": { "numpages": 12, "info": { "Title": "Service Agreement" } }
1990
+ }
1689
1991
  ```
1690
1992
 
1993
+ ### Operational Notes:
1994
+ - PDF/Word parsing relies on local binary dependencies (e.g. poppler); if unavailable the call returns `success: false` with an explanatory `error`.
1995
+ - If the URL resolves to an HTML login page rather than a document, `type` is `"html"` and `success` is `false` — the link is likely gated.
1996
+ - Never point `browser_scrape` or `browser_map` at binary documents; they cannot read inside Excel, Word, or PDF files.
1997
+
1691
1998
 
1692
1999
  # ====================================================
1693
- # DOMAIN: DOCUMENTS
2000
+ # DOMAIN: DEVELOPER
1694
2001
  # ====================================================
1695
2002
 
1696
- # Weavetab Domain Profile: DOCUMENTS
2003
+ # Weavetab Domain Profile: DEVELOPER
1697
2004
 
1698
- Generated for @weavetab/skills v2.5.0-beta.5
2005
+ Generated for @weavetab/skills v2.5.1
1699
2006
 
1700
2007
 
1701
- ## canvas-and-visual-capture
2008
+ ## github-forensics
1702
2009
 
1703
- # Visual Capture, Canvas Forensics & Design Extraction
1704
-
1705
- Beyond textual DOM manipulation, modern web applications contain dynamic HTML5 canvas renderings (charts, maps, WebGL games), and agents often need high-fidelity visual artifacts.
1706
-
1707
- ---
1708
-
1709
- ## 1. Targeted Screenshots (`browser_screenshot`)
1710
-
1711
- Capture full page layouts, the visible viewport, or specific element bounding boxes:
1712
-
1713
- ```json
1714
- {
1715
- "fullPage": true,
1716
- "format": "png"
1717
- }
1718
- ```
1719
-
1720
- Or target a specific element ref:
1721
- ```json
1722
- {
1723
- "ref": "w:55",
1724
- "format": "jpeg",
1725
- "quality": 80
1726
- }
1727
- ```
1728
-
1729
- ---
1730
-
1731
- ## 2. PDF Document Generation (`browser_pdf`)
1732
-
1733
- Render the current page into a print-ready PDF document with print CSS styles applied:
1734
-
1735
- ```json
1736
- {
1737
- "landscape": false,
1738
- "printBackground": true,
1739
- "paperWidth": 8.5,
1740
- "paperHeight": 11
1741
- }
1742
- ```
1743
-
1744
- ---
1745
-
1746
- ## 3. HTML5 Canvas Pixel Inspection & Visual Grounding (`browser_canvas` & `browser_map`)
1747
-
1748
- When a chart or graphic is rendered via `<canvas>`, standard DOM reading tools cannot see individual buttons or nodes. You have two strategies:
1749
-
1750
- ### A. Set-of-Marks Visual Grounding (Recommended for Canvas UIs & WebGL)
1751
- Run `browser_map({ visual: "auto" })`. It detects canvas elements and high-contrast regions, attaches numbered badges `[1]…[N]`, and returns an annotated image:
1752
- ```json
1753
- {
1754
- "visual": "auto"
1755
- }
1756
- ```
1757
- Then interact directly by mark number without guessing pixel coordinates:
1758
- ```json
1759
- {
1760
- "mark": 3
1761
- }
1762
- ```
1763
-
1764
- ### B. Direct Canvas Pixel Export (`browser_canvas`)
1765
- To extract the raw image data or draw programmatic gesture paths:
1766
- ```json
1767
- {
1768
- "ref": "w:19",
1769
- "action": "toDataURL"
1770
- }
1771
- ```
1772
-
1773
- ---
1774
-
1775
- ## 4. Design System Extraction (`browser_extract_design`)
1776
-
1777
- Reverse-engineer UI stylesheets, active CSS custom properties (variables), typography scales, and color palettes:
1778
-
1779
- ```json
1780
- {
1781
- "selector": ".antigravity-hud-panel"
1782
- }
1783
- ```
1784
-
1785
- Returns structured JSON representing colors, font families, shadows, and spacing tokens.
2010
+ # GitHub Forensics & Repository Architecture Inspection
1786
2011
 
2012
+ Navigating GitHub repositories via web browsing burns massive token budgets loading HTML chrome, comment threads, and diff trees. The official `@weavetab/plugin-github` plugin provides a dedicated `github` tool that talks to the GitHub REST API and raw content endpoints directly — no browser DOM, no cloning.
1787
2013
 
1788
- ## office-document-ingestion
2014
+ Responses are cached on disk (`~/.weavetab-system/github_cache`) and subject to GitHub's API rate limits.
1789
2015
 
1790
- # Office Document Ingestion: Word, Excel & CSV Parsing
1791
-
1792
- 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.
1793
-
1794
- ---
1795
-
1796
- ## 1. Parsing Spreadsheets (`.xlsx`, `.csv`)
1797
-
1798
- Stream structured sheet data, headers, and cell values:
1799
-
1800
- ```json
1801
- {
1802
- "filePath": "C:/Users/fy2ne/Downloads/quarterly_revenue.xlsx",
1803
- "sheet": "Q3_Summary",
1804
- "headerRow": 1,
1805
- "maxRows": 100
1806
- }
1807
- ```
1808
-
1809
- ### Response Example:
1810
- ```json
1811
- {
1812
- "fileType": "xlsx",
1813
- "sheets": ["Q1", "Q2", "Q3_Summary"],
1814
- "rowCount": 45,
1815
- "data": [
1816
- { "Department": "Engineering", "Budget": 1250000, "Actual": 1180000 },
1817
- { "Department": "Marketing", "Budget": 600000, "Actual": 620000 }
1818
- ]
1819
- }
1820
- ```
1821
-
1822
- ---
1823
-
1824
- ## 2. Ingesting Word Documents (`.docx`)
1825
-
1826
- Extract semantic paragraphs, document headings, tables, and lists:
1827
-
1828
- ```json
1829
- {
1830
- "filePath": "C:/Users/fy2ne/Documents/service_agreement.docx",
1831
- "extractTables": true
1832
- }
1833
- ```
1834
-
1835
- ### Operational Advantages:
1836
- - Eliminates the need for heavy external Python libraries or microservices.
1837
- - Safely sanitizes binary formats before passing content into LLM context.
2016
+ ---
1838
2017
 
2018
+ ## 1. High-Level Repository Analysis (action: "analyze")
1839
2019
 
1840
- # ====================================================
1841
- # DOMAIN: DEVELOPER
1842
- # ====================================================
2020
+ Fetches repo metadata, the default branch, a flat recursive file tree, and a README snippet (first 100 lines). Results are cached and reused by `read`:
1843
2021
 
1844
- # Weavetab Domain Profile: DEVELOPER
2022
+ ```json
2023
+ {
2024
+ "action": "analyze",
2025
+ "repo": "Weavetab/MCP"
2026
+ }
2027
+ ```
1845
2028
 
1846
- Generated for @weavetab/skills v2.5.0-beta.5
2029
+ Returns fields such as `owner`, `repo`, `default_branch`, `description`, `language`, `file_tree` (array of `{path, type, size, sha}`), and `readme_snippet`.
1847
2030
 
2031
+ If `repo` is omitted, the active tab's repository is used.
1848
2032
 
1849
- ## github-forensics
2033
+ ---
2034
+
2035
+ ## 2. Reading Repository Source Files (action: "read")
2036
+
2037
+ Stream specific files from a public or authenticated repo via `raw.githubusercontent.com`. Requires a prior `analyze` (to cache the default branch and tree), or it will run one automatically:
2038
+
2039
+ ```json
2040
+ {
2041
+ "action": "read",
2042
+ "repo": "Weavetab/MCP",
2043
+ "paths": ["src/server.ts"],
2044
+ "line_range": [1, 200]
2045
+ }
2046
+ ```
2047
+
2048
+ `paths` is relative to the repo root; `line_range` is an optional `[start, end]` (1-indexed).
2049
+
2050
+ ---
2051
+
2052
+ ## 3. Pull Request Forensics (action: "pr")
2053
+
2054
+ Retrieve PR details, changed files, and review comments:
2055
+
2056
+ ```json
2057
+ {
2058
+ "action": "pr",
2059
+ "repo": "Weavetab/MCP",
2060
+ "number": 42
2061
+ }
2062
+ ```
2063
+
2064
+ Passing `number` fetches that PR; omitting it lists recent PRs.
1850
2065
 
1851
- # GitHub Forensics & Repository Architecture Inspection
1852
-
1853
- 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.
1854
-
1855
- ---
1856
-
1857
- ## 1. High-Level Repository Analysis (action: "analyze")
1858
-
1859
- Quickly summarize repo structure, languages, dependency graphs, and recent commit frequency:
1860
-
1861
- ```json
1862
- {
1863
- "action": "analyze",
1864
- "repo": "Weavetab/MCP"
1865
- }
1866
- ```
1867
-
1868
- ---
1869
-
1870
- ## 2. Reading Repository Source Files (action: "read")
1871
-
1872
- Directly stream files and directories from any public or authenticated GitHub repo without cloning or burning API rate limits:
1873
-
1874
- ```json
1875
- {
1876
- "action": "read",
1877
- "repo": "Weavetab/MCP",
1878
- "paths": ["src/server.ts"],
1879
- "line_range": [1, 200]
1880
- }
1881
- ```
1882
-
1883
- ---
1884
-
1885
- ## 3. Pull Request Forensics (action: "pr")
1886
-
1887
- Retrieve PR diffs, changed files, review comments, CI checks, and mergeability status:
1888
-
1889
- ```json
1890
- {
1891
- "action": "pr",
1892
- "repo": "Weavetab/MCP",
1893
- "number": 42
1894
- }
1895
- ```
1896
-
1897
- ---
1898
-
1899
- ## 4. Issue Triage & Search (action: "issues")
1900
-
1901
- Query repository issue trackers with state, label, and keyword filters:
1902
-
1903
- ```json
1904
- {
1905
- "action": "issues",
1906
- "repo": "Weavetab/MCP",
1907
- "state": "open",
1908
- "labels": ["bug", "priority"]
1909
- }
2066
+ ---
2067
+
2068
+ ## 4. Issue Triage & Search (action: "issues")
2069
+
2070
+ Query the issue tracker with state, label, keyword, and limit filters:
2071
+
2072
+ ```json
2073
+ {
2074
+ "action": "issues",
2075
+ "repo": "Weavetab/MCP",
2076
+ "state": "open",
2077
+ "labels": ["bug"],
2078
+ "limit": 5
2079
+ }
1910
2080
  ```
2081
+
2082
+ - **`number`** fetches a single issue plus its comments.
2083
+ - **`search`** runs a keyword search across issues.
2084
+ - **`state`** (`open`/`closed`/`all`) and **`labels`** filter the listing; `limit` caps results (default 5).
2085
+
2086
+ > The GitHub **search** API is rate-limited more aggressively than raw/GET reads. `read` and `analyze` file fetches do not consume search-quota calls. If a call fails with a rate-limit message, wait until the reported reset time before retrying.