@weavetab/skills 1.0.1 → 2.5.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +108 -50
  2. package/ROUTER.md +43 -0
  3. package/bin/cli.js +232 -132
  4. package/browser/dom-strategy.md +119 -0
  5. package/browser/form-automation.md +87 -0
  6. package/browser/interaction-pipeline.md +216 -0
  7. package/browser/tab-and-window.md +136 -0
  8. package/desktop/desktop-targeting.md +85 -0
  9. package/desktop/electron-discovery.md +115 -0
  10. package/developer/github-forensics.md +74 -0
  11. package/dist/bundled/weavetab-all.md +1905 -0
  12. package/dist/bundled/weavetab-browser.md +501 -0
  13. package/dist/bundled/weavetab-desktop.md +176 -0
  14. package/dist/bundled/weavetab-developer.md +67 -0
  15. package/dist/bundled/weavetab-documents.md +142 -0
  16. package/dist/bundled/weavetab-memory.md +359 -0
  17. package/dist/bundled/weavetab-network-and-perf.md +223 -0
  18. package/dist/bundled/weavetab-plugins.md +78 -0
  19. package/dist/bundled/weavetab-resilience.md +216 -0
  20. package/dist/bundled/weavetab-security.md +87 -0
  21. package/dist/granular/browser_dom-strategy.md +119 -0
  22. package/dist/granular/browser_form-automation.md +87 -0
  23. package/dist/granular/browser_interaction-pipeline.md +216 -0
  24. package/dist/granular/browser_tab-and-window.md +136 -0
  25. package/dist/granular/desktop_desktop-targeting.md +85 -0
  26. package/dist/granular/desktop_electron-discovery.md +115 -0
  27. package/dist/granular/developer_github-forensics.md +74 -0
  28. package/dist/granular/documents_canvas-and-visual-capture.md +103 -0
  29. package/dist/granular/documents_office-document-ingestion.md +63 -0
  30. package/dist/granular/memory_selector-memory-system.md +127 -0
  31. package/dist/granular/memory_session-trail.md +95 -0
  32. package/dist/granular/memory_site-learning.md +180 -0
  33. package/dist/granular/network-and-perf_device-and-environment.md +87 -0
  34. package/dist/granular/network-and-perf_network-intercept-and-mock.md +84 -0
  35. package/dist/granular/network-and-perf_performance-and-vitals.md +84 -0
  36. package/dist/granular/plugins_hooks-and-overrides.md +36 -0
  37. package/dist/granular/plugins_plugin-runtime.md +60 -0
  38. package/dist/granular/resilience_loop-breaker.md +67 -0
  39. package/dist/granular/resilience_session-time-travel.md +131 -0
  40. package/dist/granular/resilience_stale-ref-recovery.md +53 -0
  41. package/dist/granular/security_rbac-and-policies.md +47 -0
  42. package/dist/granular/security_secret-containment-protocol.md +59 -0
  43. package/documents/canvas-and-visual-capture.md +103 -0
  44. package/documents/office-document-ingestion.md +63 -0
  45. package/evals/evaluator.js +146 -0
  46. package/evals/scenarios.json +238 -0
  47. package/memory/selector-memory-system.md +127 -0
  48. package/memory/session-trail.md +95 -0
  49. package/memory/site-learning.md +180 -0
  50. package/network-and-perf/device-and-environment.md +87 -0
  51. package/network-and-perf/network-intercept-and-mock.md +84 -0
  52. package/network-and-perf/performance-and-vitals.md +84 -0
  53. package/package.json +73 -42
  54. package/plugins/hooks-and-overrides.md +36 -0
  55. package/plugins/plugin-runtime.md +60 -0
  56. package/resilience/loop-breaker.md +67 -0
  57. package/resilience/session-time-travel.md +131 -0
  58. package/resilience/stale-ref-recovery.md +53 -0
  59. package/security/rbac-and-policies.md +47 -0
  60. package/security/secret-containment-protocol.md +59 -0
  61. package/skills.json +431 -308
  62. package/src/api.js +239 -128
  63. package/.github/FUNDING.yml +0 -2
  64. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
  65. package/.github/ISSUE_TEMPLATE/skill_request.md +0 -24
  66. package/.github/PULL_REQUEST_TEMPLATE.md +0 -23
  67. package/CONTRIBUTING.md +0 -34
  68. package/SECURITY.md +0 -26
  69. package/advanced/README.md +0 -2
  70. package/automation/README.md +0 -2
  71. package/general/captcha-evasion.md +0 -13
  72. package/general/context-awareness.md +0 -13
  73. package/general/cookie-consent.md +0 -13
  74. package/general/data-extraction.md +0 -13
  75. package/general/dynamic-interaction.md +0 -13
  76. package/general/error-recovery.md +0 -13
  77. package/general/file-upload.md +0 -13
  78. package/general/form-filling.md +0 -16
  79. package/general/guardrails.md +0 -13
  80. package/general/iframe-handling.md +0 -13
  81. package/general/infinite-scroll.md +0 -13
  82. package/general/login-flow.md +0 -16
  83. package/general/multi-tab-management.md +0 -13
  84. package/general/spa-navigation.md +0 -13
  85. package/general/table-scraping.md +0 -13
  86. package/scripts/build.js +0 -48
@@ -0,0 +1,501 @@
1
+ # Weavetab Domain Profile: BROWSER
2
+
3
+ Generated for @weavetab/skills v2.5.0-beta.4
4
+
5
+
6
+ ## dom-strategy
7
+
8
+ # DOM Strategy & Token Conservation Engine
9
+
10
+ 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.
11
+
12
+ ---
13
+
14
+ ## 1. The 4-Tier Reading Filter
15
+
16
+ Always select the narrowest tool that satisfies your immediate objective:
17
+
18
+ ```
19
+ ┌───────────────────────────────┐
20
+ │ Do you need full structural │
21
+ │ context or just a target? │
22
+ └──────────────┬────────────────┘
23
+ │
24
+ ┌───────────────┴───────────────┐
25
+ ▼ ▼
26
+ [Specific Target] [Whole Document]
27
+ │ │
28
+ ┌────────┴────────┐ ┌───────┴────────┐
29
+ ▼ ▼ ▼ ▼
30
+ Target by text Target by role Read articles Interactive
31
+ or keywords or hierarchy or prose data UI layout
32
+ │ │ │ │
33
+ ▼ ▼ ▼ ▼
34
+ `browser_find` `browser_map` `browser_scrape` `browser_map`
35
+ (lite: true) (lite: true)
36
+ │
37
+ [Sparse / Canvas / WebGL / <5 elements?]
38
+ │
39
+ ▼
40
+ `browser_map`
41
+ (visual: "auto")
42
+ ```
43
+
44
+ ### Tier 1: Targeted Keyword Jump (`browser_find`)
45
+ Use `browser_find` when you already know the label, text snippet, placeholder, or aria-label of the target element.
46
+ - **Latency**: Sub-5ms CDP search.
47
+ - **Token Cost**: ~50–100 tokens (returns only matching candidate nodes).
48
+
49
+ ```json
50
+ {
51
+ "query": "Sign In",
52
+ "matchType": "contains",
53
+ "visibleOnly": true
54
+ }
55
+ ```
56
+
57
+ ### Tier 2: Token-Optimized DOM Walk (`browser_map` with `lite: true`)
58
+ Use `browser_map` when you must understand the interactive structure of the page.
59
+ - **Rule**: ALWAYS pass `"lite": true` unless you strictly need deeply nested non-interactive DOM trees.
60
+ - **Efficiency**: Strips decorative wrappers, SVG paths, hidden containers, and scripts. Reduces payload by **85% to 95%**.
61
+ - **Viewport Filtering**: Set `"includeOffscreen": false` to only inspect elements currently visible in the active viewport.
62
+
63
+ ```json
64
+ {
65
+ "lite": true,
66
+ "includeOffscreen": false,
67
+ "maxDepth": 6
68
+ }
69
+ ```
70
+
71
+ ### Tier 3: Markdown Prose & Data Ingestion (`browser_scrape`)
72
+ Use `browser_scrape` when your objective is reading articles, blog posts, documentation, or legal terms rather than clicking buttons.
73
+ - Converts HTML to clean, semantically structured Markdown.
74
+ - Automatically handles readability filtering and removes advertising/cookie banners.
75
+
76
+ ### Tier 4: Set-of-Marks Visual Grounding (`browser_map` with `visual: "auto"`)
77
+ Use when target pages are canvas-heavy, WebGL, Figma, Google Sheets, or when standard `browser_map` returns < 5 interactive elements.
78
+ - Injects temporary numbered badges `[1]…[N]` over interactive elements & canvas regions.
79
+ - Captures an annotated screenshot + returns a structured mark list.
80
+ - **Zero Page Pollution**: Strips badges immediately after capture.
81
+ - **Action**: Pass `"mark": N` to `browser_click` to click the exact element without re-scanning the DOM.
82
+
83
+ ```json
84
+ {
85
+ "visual": "auto"
86
+ }
87
+ ```
88
+
89
+ ### Tier 5: Runtime State & JavaScript Evaluation (`browser_eval`)
90
+ 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:
91
+ ```json
92
+ {
93
+ "expression": "window.__INITIAL_STATE__ || document.title"
94
+ }
95
+ ```
96
+
97
+ ---
98
+
99
+ ## 2. Volatile Ref ID & Visual Mark Navigation
100
+
101
+ Weavetab maps elements to ephemeral handles (`w:NN`) and visual marks (`[1]…[N]`):
102
+
103
+ ### Operational Rules:
104
+ 1. **Never Construct Speculative CSS Selectors**: If an element has ref `w:14`, pass `"ref": "w:14"` to `browser_click`, `browser_fill`, `browser_type`.
105
+ 2. **Visual Mark Targeting**: On canvas or unlabelled elements from `visual: "auto"`, pass `"mark": N` directly to `browser_click({ mark: N })`.
106
+ 3. **Lifespan of Handles**: Ref IDs and marks invalidate on page navigation (`browser_navigate`) or heavy SPA re-renders.
107
+ 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.
108
+
109
+
110
+ ## form-automation
111
+
112
+ # Form Automation: Atomic Multi-Field Execution
113
+
114
+ 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.
115
+
116
+ ---
117
+
118
+ ## 1. Atomic Multi-Field Filling (`browser_fill`)
119
+
120
+ `browser_fill` populates multiple inputs, textareas, checkboxes, and radio buttons in a single CDP roundtrip.
121
+
122
+ ```json
123
+ {
124
+ "fields": [
125
+ {
126
+ "ref": "w:12",
127
+ "value": "Anas"
128
+ },
129
+ {
130
+ "ref": "w:14",
131
+ "value": "Khezaz"
132
+ },
133
+ {
134
+ "ref": "w:16",
135
+ "value": "contact@weavetab.com"
136
+ },
137
+ {
138
+ "ref": "w:19",
139
+ "value": true
140
+ }
141
+ ]
142
+ }
143
+ ```
144
+
145
+ ### Supported Field Value Types:
146
+ - **Text / Search / Email / Tel**: Provide a `string`.
147
+ - **Checkbox**: Provide a `boolean` (`true` to check, `false` to uncheck).
148
+ - **Radio Buttons**: Provide `true` on the matching option ref.
149
+ - **ContentEditable**: Provide a `string` (automatically handles inner text formatting).
150
+
151
+ ---
152
+
153
+ ## 2. Dropdown & Select Automation (`browser_select`)
154
+
155
+ Standard `<select>` elements and custom dropdowns often fail under simple click-and-type automation. `browser_select` dispatches native CDP change events.
156
+
157
+ ```json
158
+ {
159
+ "ref": "w:31",
160
+ "values": ["enterprise_tier"]
161
+ }
162
+ ```
163
+
164
+ ### Multi-Select Support:
165
+ For `<select multiple>` elements, pass an array of option values:
166
+
167
+ ```json
168
+ {
169
+ "ref": "w:35",
170
+ "values": ["us-east-1", "eu-central-1"]
171
+ }
172
+ ```
173
+
174
+ ---
175
+
176
+ ## 3. Form Submission Best Practices
177
+
178
+ 1. **Pre-Validate State**: Before clicking Submit, confirm that required fields have passed HTML5/client-side validation (no active red borders or validation popups).
179
+ 2. **Submit via Enter Key vs Click**:
180
+ - If the submit button has a dynamic ref or changes during typing, send `"key": "Enter"` via `browser_key` inside the last filled text field.
181
+ - Otherwise, locate the submit button via `browser_find` and click via `browser_click`.
182
+ 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.
183
+
184
+
185
+ ## interaction-pipeline
186
+
187
+ # Interaction Pipeline: Physical & Synthetic Input Engine
188
+
189
+ Weavetab executes browser interactions via direct Chrome DevTools Protocol (CDP) dispatch, bypassing synthetic JavaScript event limitations and anti-automation tripwires.
190
+
191
+ ---
192
+
193
+ ## 1. Clicking Elements (`browser_click`)
194
+
195
+ Execute deterministic clicks on DOM elements using volatile handles (`ref`), CSS selectors, or exact coordinates.
196
+
197
+ ```json
198
+ {
199
+ "ref": "w:23",
200
+ "clickCount": 1,
201
+ "button": "left"
202
+ }
203
+ ```
204
+
205
+ ### Advanced Modifiers:
206
+ - **Double Click**: Set `"clickCount": 2` for inline editing or selecting text blocks.
207
+ - **Context Menu**: Set `"button": "right"` to trigger native context menus.
208
+ - **Modifier Keys**: Pass `"modifiers": ["Control"]` or `["Meta"]` for multi-selection or opening links in background tabs.
209
+
210
+ ---
211
+
212
+ ## 2. Text Input (`browser_type`)
213
+
214
+ Simulate natural keystrokes into input fields, textareas, and `contenteditable` elements.
215
+
216
+ ```json
217
+ {
218
+ "ref": "w:18",
219
+ "text": "Enterprise Search Query",
220
+ "clear": true,
221
+ "delay": 20
222
+ }
223
+ ```
224
+
225
+ > [!CAUTION]
226
+ > **Secret Boundary Enforcement**:
227
+ > 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`.
228
+
229
+ ---
230
+
231
+ ## 3. Physical Pointer Trajectories (`browser_pointer`)
232
+
233
+ Handle complex drag-and-drop interactions, canvas sketching, hover-activated navigation flyouts, and custom sliders.
234
+
235
+ ### Hover / Mouse Move:
236
+ ```json
237
+ {
238
+ "action": "move",
239
+ "x": 450,
240
+ "y": 180
241
+ }
242
+ ```
243
+
244
+ ### Drag & Drop Pipeline:
245
+ ```json
246
+ // Step 1: Move to origin & press mouse
247
+ { "action": "move", "x": 200, "y": 300 }
248
+ { "action": "down", "button": "left" }
249
+
250
+ // Step 2: Smooth trajectory to destination
251
+ { "action": "move", "x": 600, "y": 300 }
252
+
253
+ // Step 3: Release
254
+ { "action": "up", "button": "left" }
255
+ ```
256
+
257
+ ---
258
+
259
+ ## 4. Keystrokes & Shortcuts (`browser_key`)
260
+
261
+ Trigger keyboard shortcuts, navigation keys, and dialog dismissals.
262
+
263
+ ```json
264
+ {
265
+ "key": "Enter"
266
+ }
267
+ ```
268
+
269
+ ### High-Frequency Key Combos:
270
+ - **Select All & Delete**: Send `"key": "a"`, `"modifiers": ["Control"]` (or `["Meta"]` on macOS), followed by `"key": "Backspace"`.
271
+ - **Dismiss Overlays**: Send `"key": "Escape"`.
272
+ - **Form Tab Navigation**: Send `"key": "Tab"`.
273
+
274
+ ---
275
+
276
+ ## 5. OS File Upload Bypass (`browser_upload`)
277
+
278
+ 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`.
279
+
280
+ ```json
281
+ {
282
+ "ref": "w:41",
283
+ "files": [
284
+ "C:/Users/fy2ne/Documents/contract.pdf",
285
+ "C:/Users/fy2ne/Documents/financial_report.xlsx"
286
+ ]
287
+ }
288
+ ```
289
+
290
+ - **Targeting**: Supply the volatile handle `ref` or CSS selector for the `<input type="file">`.
291
+ - **Hidden Inputs**: `browser_upload` automatically handles `display: none` file inputs commonly used in custom drag-and-drop upload widgets.
292
+
293
+ ---
294
+
295
+ ## 6. Viewport & Element Scrolling (`browser_scroll`)
296
+
297
+ Scroll the entire page viewport or scroll specific scrollable containers:
298
+
299
+ ```json
300
+ {
301
+ "direction": "down",
302
+ "amount": 500
303
+ }
304
+ ```
305
+
306
+ Or scroll a specific element container:
307
+ ```json
308
+ {
309
+ "ref": "w:12",
310
+ "direction": "down",
311
+ "amount": 300
312
+ }
313
+ ```
314
+
315
+ ---
316
+
317
+ ## 7. Native Dialog Handling (`browser_dialog`)
318
+
319
+ Handle native JavaScript `alert`, `confirm`, `prompt`, or `beforeunload` dialogs that block page execution:
320
+
321
+ ```json
322
+ {
323
+ "action": "accept",
324
+ "promptText": "Confirmed"
325
+ }
326
+ ```
327
+
328
+ ---
329
+
330
+ ## 8. High-Speed Action Batches (`browser_burst`)
331
+
332
+ Execute multiple sequential micro-actions in a single CDP roundtrip without waiting for intermediate LLM turns:
333
+
334
+ ```json
335
+ {
336
+ "steps": [
337
+ { "tool": "browser_fill", "ref": "w:10", "value": "search query" },
338
+ { "tool": "click_and_wait", "ref": "w:15" }
339
+ ]
340
+ }
341
+ ```
342
+ *(Accepts both `steps` and `actions`, with arguments either nested under `args` or specified flat on the step object).*
343
+
344
+ ---
345
+
346
+ ## 9. Visual Element Highlighting & Consideration (`browser_highlight`)
347
+
348
+ Draw visual consideration, target lock, danger/success, or shimmer overlays without mutating the DOM. Supports multi-element candidate evaluation:
349
+
350
+ ```json
351
+ {
352
+ "refs": ["w:12", "w:15", "w:23"],
353
+ "style": "consideration",
354
+ "label": "Evaluating form options",
355
+ "duration": 2000
356
+ }
357
+ ```
358
+
359
+ ### Presentation Styles:
360
+ - `"consideration"`: Soft pulsing cyan/blue outline (`#38bdf8`) with ambient glow — ideal when weighing multiple interactive candidates.
361
+ - `"target"`: High-contrast amber lock-on ring (`#f59e0b`) before executing high-impact clicks.
362
+ - `"danger"`: Red warning border (`#ef4444`) for destructive buttons (Delete, Reset, Purge).
363
+ - `"success"`: Emerald glow (`#10b981`) confirming completed actions.
364
+ - `"shimmer"`: Rapid purple accent wave (default for quick inspection).
365
+
366
+ ---
367
+
368
+ ## 10. System Clipboard Bridging (`browser_clipboard`)
369
+
370
+ Read or write system clipboard text during automation:
371
+
372
+ ```json
373
+ {
374
+ "action": "write",
375
+ "text": "AuthToken_xyz987"
376
+ }
377
+ ```
378
+
379
+
380
+ ## tab-and-window
381
+
382
+ # Tab & Window Lifecycle Management
383
+
384
+ 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.
385
+
386
+ ---
387
+
388
+ ## 1. Tab Discovery & Target Enumeration
389
+
390
+ Inspect all active targets, open URLs, and page titles:
391
+
392
+ ```json
393
+ {
394
+ "action": "list"
395
+ }
396
+ ```
397
+
398
+ To list targets inside a specific desktop app (e.g. Discord, Slack):
399
+ ```json
400
+ {
401
+ "action": "list",
402
+ "app": "discord"
403
+ }
404
+ ```
405
+
406
+ > [!TIP]
407
+ > Always pass `"app": "<name>"` when inspecting desktop applications. This guarantees that Weavetab does not launch or query the web browser.
408
+
409
+ ---
410
+
411
+ ## 2. Opening Tabs & Smart Reuse
412
+
413
+ Open a target URL. By default, `reuse: true` will focus an existing tab if the URL is already loaded:
414
+
415
+ ```json
416
+ {
417
+ "action": "open",
418
+ "url": "https://github.com"
419
+ }
420
+ ```
421
+
422
+ To force opening a brand-new duplicate tab instead of reusing:
423
+ ```json
424
+ {
425
+ "action": "open",
426
+ "url": "https://github.com",
427
+ "reuse": false
428
+ }
429
+ ```
430
+
431
+ ---
432
+
433
+ ## 3. Context Switching
434
+
435
+ Switch active agent focus between open tabs:
436
+
437
+ ```json
438
+ {
439
+ "action": "switch",
440
+ "tabId": "TARGET_PAGE_ID"
441
+ }
442
+ ```
443
+
444
+ ---
445
+
446
+ ## 4. Closing Tabs & Batch Cleanup
447
+
448
+ Close a single tab:
449
+ ```json
450
+ {
451
+ "action": "close",
452
+ "tabId": "TARGET_PAGE_ID"
453
+ }
454
+ ```
455
+
456
+ Close multiple tabs simultaneously in a single round-trip:
457
+ ```json
458
+ {
459
+ "action": "close",
460
+ "tabIds": ["TARGET_1", "TARGET_2", "TARGET_3"]
461
+ }
462
+ ```
463
+
464
+ ---
465
+
466
+ ## 5. Native Window Management
467
+
468
+ List native OS windows:
469
+ ```json
470
+ {
471
+ "action": "list_windows"
472
+ }
473
+ ```
474
+
475
+ Bring a specific native window to the foreground:
476
+ ```json
477
+ {
478
+ "action": "focus_window",
479
+ "windowId": 1
480
+ }
481
+ ```
482
+
483
+ ---
484
+
485
+ ## 6. Duplicate Consolidation & Auto-Heal
486
+
487
+ Deduplicate redundant tabs across the session:
488
+ ```json
489
+ {
490
+ "action": "consolidate"
491
+ }
492
+ ```
493
+
494
+ If a target page crashes or detaches due to memory limits:
495
+ ```json
496
+ {
497
+ "action": "heal"
498
+ }
499
+ ```
500
+
501
+ The auto-heal routine re-establishes CDP protocol sessions, reconnects event listeners, and synchronizes the active page target.
@@ -0,0 +1,176 @@
1
+ # Weavetab Domain Profile: DESKTOP
2
+
3
+ Generated for @weavetab/skills v2.5.0-beta.4
4
+
5
+
6
+ ## desktop-targeting
7
+
8
+ # Desktop App Targeting & Multi-Window Routing
9
+
10
+ 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.
11
+
12
+ ---
13
+
14
+ ## 1. Direct App Parameter Routing
15
+
16
+ Pass `"app": "<application_name>"` to target the Electron application.
17
+
18
+ ### Example: Reading Discord Channels
19
+ ```json
20
+ // Tool: browser_map
21
+ {
22
+ "app": "discord",
23
+ "scope": "main_content"
24
+ }
25
+ ```
26
+
27
+ ### Example: Sending a Message in Discord
28
+ ```json
29
+ // Tool: browser_type
30
+ {
31
+ "app": "discord",
32
+ "ref": "w:88",
33
+ "text": "Deployment v2.5.0-beta.3 completed successfully."
34
+ }
35
+ ```
36
+
37
+ ### Example: Listing Discord Tabs/Windows
38
+ ```json
39
+ // Tool: browser_tabs
40
+ {
41
+ "action": "list",
42
+ "app": "discord"
43
+ }
44
+ ```
45
+
46
+ > [!IMPORTANT]
47
+ > 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.
48
+
49
+ ---
50
+
51
+ ## 2. Smart Domain Auto-Routing & Sticky Context
52
+
53
+ Weavetab features automatic target resolution to eliminate accidental browser popups:
54
+
55
+ ### A. Automatic Domain Matching
56
+ 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.
57
+
58
+ ### B. Sticky App Sessions
59
+ 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.
60
+
61
+ ### C. Explicit Browser Override
62
+ If you specifically want to open a URL in the web browser instead of a desktop application, pass `"app": "browser"`.
63
+
64
+ ---
65
+
66
+ ## 3. Multi-Window Focus Management
67
+
68
+ Some Electron apps open secondary windows (e.g. popout editors, settings panels, or call windows).
69
+
70
+ 1. Use `browser_tabs(action: "list", app: "discord")` to view all open windows and page targets for that specific app.
71
+ 2. Switch focus between windows using `browser_tabs(action: "switch", tabId: "<id>", app: "discord")`.
72
+ 3. To bring a specific native window to the foreground, use `browser_tabs(action: "focus_window", windowId: <id>, app: "discord")`.
73
+
74
+
75
+ ## electron-discovery
76
+
77
+ # Electron Discovery & Environment Handshake
78
+
79
+ 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.
80
+
81
+ `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.
82
+
83
+ ---
84
+
85
+ ## 1. Running Discovery via `browser_detect`
86
+
87
+ Call `browser_detect` with empty parameters `{}`:
88
+
89
+ ```json
90
+ {}
91
+ ```
92
+
93
+ ### Response Schema:
94
+ ```json
95
+ {
96
+ "available": [
97
+ {
98
+ "engine": "chromium",
99
+ "name": "Google Chrome",
100
+ "path": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
101
+ }
102
+ ],
103
+ "current": "chromium",
104
+ "configuredApps": [
105
+ {
106
+ "name": "discord",
107
+ "status": "running_no_debug",
108
+ "configuredPath": "C:\\Users\\username\\AppData\\Local\\Discord\\app-1.0.9256\\Discord.exe"
109
+ },
110
+ {
111
+ "name": "slack",
112
+ "status": "connected",
113
+ "port": 9222,
114
+ "configuredPath": "C:\\Users\\username\\AppData\\Local\\slack\\app-4.38.125\\slack.exe",
115
+ "activeTabs": [
116
+ {
117
+ "id": "PAGE_1",
118
+ "title": "general - Weavetab Slack",
119
+ "url": "https://app.slack.com/client/..."
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "name": "vscode",
125
+ "status": "offline",
126
+ "configuredPath": "C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
127
+ }
128
+ ],
129
+ "toolCoverage": {
130
+ "chromium": 100,
131
+ "firefox": 78,
132
+ "webkit": 55
133
+ }
134
+ }
135
+ ```
136
+
137
+ ---
138
+
139
+ ## 2. Understanding Application Status
140
+
141
+ Each configured desktop app reports one of three distinct lifecycle statuses:
142
+
143
+ | Status | Meaning | Agent Action |
144
+ | :--- | :--- | :--- |
145
+ | **`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. |
146
+ | **`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. |
147
+ | **`offline`** | The application is not currently running on the OS. | Launch and attach in one step by calling `browser_navigate(app: "<name>")`. |
148
+
149
+ ---
150
+
151
+ ## 3. Dynamic Squirrel Updates on Windows
152
+
153
+ On Windows, Squirrel-managed applications (Discord, Slack, Teams) update dynamically into versioned sibling directories (e.g. `Discord\app-1.0.9256\Discord.exe`).
154
+
155
+ Weavetab automatically handles this:
156
+ - 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.
157
+ - The dynamically resolved path is reported in `browser_detect` under `configuredPath`.
158
+
159
+ ---
160
+
161
+ ## 4. Launching Desktop Apps Manually with Debugging
162
+
163
+ If the user prefers to launch apps manually from a terminal or shortcut with remote debugging enabled:
164
+
165
+ ```bash
166
+ # Discord
167
+ Discord.exe --remote-debugging-port=9222
168
+
169
+ # Slack
170
+ slack.exe --remote-debugging-port=9223
171
+
172
+ # VS Code
173
+ code.exe --remote-debugging-port=9225
174
+ ```
175
+
176
+ Once launched with `--remote-debugging-port`, `browser_detect` immediately reflects the application as connectable.