opendevbrowser 0.0.11 → 0.0.15

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 (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +289 -28
  3. package/dist/chunk-JVBMT2O5.js +7173 -0
  4. package/dist/chunk-JVBMT2O5.js.map +1 -0
  5. package/dist/cli/index.js +3690 -275
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/index.js +1080 -2857
  8. package/dist/index.js.map +1 -1
  9. package/dist/opendevbrowser.js +1080 -2857
  10. package/dist/opendevbrowser.js.map +1 -1
  11. package/extension/dist/annotate-content.css +237 -0
  12. package/extension/dist/annotate-content.js +934 -0
  13. package/extension/dist/background.js +1291 -8
  14. package/extension/dist/logging.js +50 -0
  15. package/extension/dist/ops/dom-bridge.js +355 -0
  16. package/extension/dist/ops/ops-runtime.js +1249 -0
  17. package/extension/dist/ops/ops-session-store.js +189 -0
  18. package/extension/dist/ops/redaction.js +52 -0
  19. package/extension/dist/ops/snapshot-builder.js +4 -0
  20. package/extension/dist/ops/snapshot-shared.js +220 -0
  21. package/extension/dist/popup.js +398 -21
  22. package/extension/dist/relay-settings.js +3 -1
  23. package/extension/dist/services/CDPRouter.js +501 -103
  24. package/extension/dist/services/ConnectionManager.js +464 -57
  25. package/extension/dist/services/NativePortManager.js +182 -0
  26. package/extension/dist/services/RelayClient.js +227 -26
  27. package/extension/dist/services/TabManager.js +81 -0
  28. package/extension/dist/services/TargetSessionMap.js +146 -0
  29. package/extension/dist/services/cdp-router-commands.js +203 -0
  30. package/extension/dist/services/url-restrictions.js +41 -0
  31. package/extension/dist/types.js +3 -1
  32. package/extension/icons/icon128.png +0 -0
  33. package/extension/icons/icon16.png +0 -0
  34. package/extension/icons/icon32.png +0 -0
  35. package/extension/icons/icon48.png +0 -0
  36. package/extension/manifest.json +17 -3
  37. package/extension/popup.html +469 -65
  38. package/package.json +2 -2
  39. package/skills/AGENTS.md +34 -61
  40. package/skills/data-extraction/SKILL.md +95 -103
  41. package/skills/form-testing/SKILL.md +75 -82
  42. package/skills/login-automation/SKILL.md +76 -66
  43. package/skills/opendevbrowser-best-practices/SKILL.md +90 -49
  44. package/skills/opendevbrowser-continuity-ledger/SKILL.md +57 -23
  45. package/dist/chunk-R5VUZEUU.js +0 -128
  46. package/dist/chunk-R5VUZEUU.js.map +0 -1
  47. package/extension/dist/popup.jsx +0 -150
package/skills/AGENTS.md CHANGED
@@ -1,35 +1,25 @@
1
- # Local AGENTS.md (skills/)
1
+ # skills/ Agent Guidelines
2
2
 
3
- Applies to `skills/` and subdirectories. Extends root `AGENTS.md`.
3
+ Bundled skill packs. Extends root `AGENTS.md`.
4
4
 
5
- ## Skill Pack Architecture
6
- - Each skill pack lives in its own folder with `SKILL.md` as the entry point.
7
- - `opendevbrowser-best-practices` is the canonical prompting guide source.
8
- - OpenCode-native discovery is primary:
9
- - Project-local: `.opencode/skill/*/SKILL.md`
10
- - Global: `~/.config/opencode/skill/*/SKILL.md`
11
- - Compatibility-only paths: `.claude/skills/*/SKILL.md`, `~/.claude/skills/*/SKILL.md`
12
- - `opendevbrowser_skill_list/load` are compatibility wrappers; OpenCode `skill` is primary.
5
+ ## Structure
13
6
 
14
- ## Skill Pack Rules
15
- - `skills/opendevbrowser-best-practices/SKILL.md` is the source for prompting guide output.
16
- - Keep guidance short, script-first, and snapshot-first.
17
- - Keep examples aligned with `opendevbrowser_*` tool names.
18
- - Do not include secrets or captured page data in skill content.
19
-
20
- ## Skill Format Specification
7
+ ```
8
+ skills/
9
+ ├── opendevbrowser-best-practices/SKILL.md # Core prompting guide
10
+ ├── opendevbrowser-continuity-ledger/SKILL.md
11
+ ├── login-automation/SKILL.md
12
+ ├── form-testing/SKILL.md
13
+ └── data-extraction/SKILL.md
14
+ ```
21
15
 
22
- ### Naming Conventions (OpenCode alignment)
23
- - Skill names: lowercase, hyphens only, 1-64 characters
24
- - Directory name must match skill name in frontmatter
25
- - Examples: `login-automation`, `form-testing`, `data-extraction`
16
+ ## SKILL.md Format
26
17
 
27
- ### SKILL.md Structure
28
18
  ```markdown
29
19
  ---
30
- name: skill-name
31
- description: Brief description (1-1024 chars)
32
- version: 1.0.0
20
+ name: skill-name # lowercase, hyphens, 1-64 chars
21
+ description: Brief desc # 1-1024 chars
22
+ version: 1.0.0 # optional, defaults to 1.0.0
33
23
  ---
34
24
 
35
25
  # Skill Title
@@ -38,43 +28,26 @@ version: 1.0.0
38
28
  Content organized by topic for filtering.
39
29
  ```
40
30
 
41
- ### Required Frontmatter
42
- | Field | Required | Description |
43
- |-------|----------|-------------|
44
- | `name` | Yes | Skill identifier (lowercase, hyphens) |
45
- | `description` | Yes | Brief description for listing |
46
- | `version` | No | Semantic version (defaults to 1.0.0) |
31
+ ## Discovery Priority
47
32
 
48
- ## Available Skills
33
+ 1. `.opencode/skill/` (project-local)
34
+ 2. `~/.config/opencode/skill/` (global)
35
+ 3. `.claude/skills/` (compatibility)
36
+ 4. `~/.claude/skills/` (compatibility)
37
+ 5. `skillPaths` config (custom)
49
38
 
50
- | Skill | Purpose |
51
- |-------|---------|
52
- | `opendevbrowser-best-practices` | Core prompting guide for browser automation |
53
- | `opendevbrowser-continuity-ledger` | Continuity ledger guidance for long-running tasks |
54
- | `login-automation` | Authentication and credential handling |
55
- | `form-testing` | Form validation and submission testing |
56
- | `data-extraction` | Table extraction and pagination handling |
39
+ ## Constraints
57
40
 
58
- ## Custom Skill Paths
59
- Advanced: users can add custom search paths via `skillPaths` in `opendevbrowser.jsonc`:
60
- ```jsonc
61
- {
62
- "skillPaths": ["~/.config/opencode/opendevbrowser-skills"]
63
- }
64
- ```
41
+ - Directory name must match `name` in frontmatter
42
+ - Keep guidance short, script-first, snapshot-first
43
+ - Examples must use `opendevbrowser_*` tool names
44
+ - Never include secrets or page data in content
45
+ - Match the snapshot → refs → actions flow in `docs/ARCHITECTURE.md` and tool list in `docs/CLI.md`.
46
+ - Note that extension relay requires Chrome 125+ and uses hub-only relay ownership when enabled.
47
+ - Refer to root `AGENTS.md` for connection flag/status semantics (extensionConnected, handshake, cdpConnected, pairingRequired).
65
48
 
66
- ## Folder Structure
67
- ```
68
- skills/
69
- |-- opendevbrowser-best-practices/
70
- | `-- SKILL.md
71
- |-- opendevbrowser-continuity-ledger/
72
- | `-- SKILL.md
73
- |-- login-automation/
74
- | `-- SKILL.md
75
- |-- form-testing/
76
- | `-- SKILL.md
77
- |-- data-extraction/
78
- | `-- SKILL.md
79
- `-- AGENTS.md
80
- ```
49
+ ## Adding Skills
50
+
51
+ 1. Create `skills/<skill-name>/SKILL.md`
52
+ 2. Follow frontmatter format above
53
+ 3. Update `docs/CLI.md` if adding CLI-related guidance
@@ -1,136 +1,128 @@
1
1
  ---
2
2
  name: data-extraction
3
- description: Patterns for extracting structured data from web pages including tables, lists, and paginated content with OpenDevBrowser.
4
- version: 1.0.0
3
+ description: This skill should be used when the user asks to "extract data from a page", "scrape tables", "collect paginated results", "parse list/card content", or "export structured web data" with OpenDevBrowser.
4
+ version: 1.1.0
5
5
  ---
6
6
 
7
7
  # Data Extraction Skill
8
8
 
9
- ## Table Extraction
9
+ Use this guide to collect structured data from dynamic pages with predictable output quality.
10
+
11
+ ## Extraction Planning
12
+
13
+ Define the schema before interacting:
10
14
 
11
- 1. Navigate to page with data table:
12
- ```
13
- opendevbrowser_goto url="https://example.com/data"
14
- ```
15
+ 1. Define output fields and required keys.
16
+ 2. Identify page regions that contain those fields.
17
+ 3. Capture a fresh snapshot and map refs to schema fields.
15
18
 
16
- 2. Wait for table to load:
17
- ```
18
- opendevbrowser_wait state="networkidle"
19
- ```
19
+ ```text
20
+ opendevbrowser_snapshot sessionId="<session-id>" format="actionables"
21
+ ```
20
22
 
21
- 3. Get table HTML structure:
22
- ```
23
- opendevbrowser_dom_get_html ref="[table-ref]"
24
- ```
23
+ ## Table Extraction
25
24
 
26
- 4. Parse the HTML to extract rows and cells.
25
+ For semantic HTML tables:
27
26
 
28
- ### Common Table Patterns
27
+ 1. Wait for table visibility.
28
+ 2. Snapshot and identify table/container refs.
29
+ 3. Extract targeted table HTML.
30
+ 4. Parse rows/cells in the host script.
29
31
 
30
- Standard HTML tables:
31
- ```html
32
- <table>
33
- <thead><tr><th>Header</th></tr></thead>
34
- <tbody><tr><td>Data</td></tr></tbody>
35
- </table>
32
+ ```text
33
+ opendevbrowser_wait sessionId="<session-id>" until="networkidle"
34
+ opendevbrowser_dom_get_html sessionId="<session-id>" ref="<table-ref>"
36
35
  ```
37
36
 
38
- CSS-based grids:
39
- ```html
40
- <div class="grid">
41
- <div class="row">
42
- <div class="cell">Data</div>
43
- </div>
44
- </div>
37
+ For virtualized or grid UIs, extract per-row/card refs and normalize in post-processing.
38
+
39
+ ## List and Card Extraction
40
+
41
+ For repeated list/card content:
42
+
43
+ 1. Snapshot and identify repeating item refs.
44
+ 2. Extract only needed nodes per item (`title`, `price`, `meta`, `url`).
45
+ 3. Normalize records to a stable schema.
46
+
47
+ ```text
48
+ opendevbrowser_dom_get_text sessionId="<session-id>" ref="<item-title-ref>"
49
+ opendevbrowser_get_attr sessionId="<session-id>" ref="<item-link-ref>" name="href"
45
50
  ```
46
51
 
47
- ## List Extraction
48
-
49
- For unordered/ordered lists:
50
- 1. Identify list container ref
51
- 2. Extract text content:
52
- ```
53
- opendevbrowser_dom_get_text ref="[list-ref]"
54
- ```
55
-
56
- For card-based layouts:
57
- 1. Identify repeating pattern
58
- 2. Extract each card's content individually
59
-
60
- ## Pagination Handling
61
-
62
- ### Numbered Pagination
63
-
64
- 1. Extract current page data
65
- 2. Find "Next" or page number button:
66
- ```
67
- opendevbrowser_snapshot
68
- ```
69
- 3. Click next page:
70
- ```
71
- opendevbrowser_click ref="[next-button-ref]"
72
- ```
73
- 4. Wait for new content:
74
- ```
75
- opendevbrowser_wait state="networkidle"
76
- ```
77
- 5. Repeat until no more pages
52
+ ## Pagination Patterns
53
+
54
+ ### Numbered or Next/Previous Pagination
55
+
56
+ 1. Extract current page records.
57
+ 2. Click next/page ref.
58
+ 3. Wait for load.
59
+ 4. Re-snapshot and continue until terminal state.
60
+
61
+ ```text
62
+ opendevbrowser_click sessionId="<session-id>" ref="<next-ref>"
63
+ opendevbrowser_wait sessionId="<session-id>" until="networkidle"
64
+ opendevbrowser_snapshot sessionId="<session-id>" format="actionables"
65
+ ```
78
66
 
79
67
  ### Infinite Scroll
80
68
 
81
- 1. Extract visible data
82
- 2. Scroll to load more:
83
- ```
84
- opendevbrowser_scroll direction="down" amount=1000
85
- ```
86
- 3. Wait for new content
87
- 4. Repeat until no new items appear
69
+ 1. Extract visible records.
70
+ 2. Scroll incrementally.
71
+ 3. Wait for newly loaded items.
72
+ 4. Stop when no new unique records appear.
73
+
74
+ ```text
75
+ opendevbrowser_scroll sessionId="<session-id>" dy=1000
76
+ opendevbrowser_wait sessionId="<session-id>" until="networkidle"
77
+ ```
88
78
 
89
79
  ### Load More Button
90
80
 
91
- 1. Extract visible data
92
- 2. Click "Load More":
93
- ```
94
- opendevbrowser_click ref="[load-more-ref]"
95
- ```
96
- 3. Wait for new content
97
- 4. Repeat until button disappears
81
+ 1. Extract visible records.
82
+ 2. Click load-more ref.
83
+ 3. Wait and re-snapshot.
84
+ 4. Repeat until button disappears or no new data arrives.
98
85
 
99
- ## Data Export Workflow
86
+ ## Structured Data Shortcuts
100
87
 
101
- 1. Collect all extracted data in structured format
102
- 2. Use `opendevbrowser_run` to serialize data:
103
- ```javascript
104
- return JSON.stringify(collectedData, null, 2);
105
- ```
88
+ When available, prefer embedded structured data:
106
89
 
107
- ## Handling Dynamic Content
90
+ - JSON-LD scripts
91
+ - Microdata attributes (`itemscope`, `itemprop`)
108
92
 
109
- For JavaScript-rendered content:
93
+ ```text
94
+ opendevbrowser_dom_get_text sessionId="<session-id>" ref="<json-ld-script-ref>"
95
+ ```
110
96
 
111
- 1. Wait for specific element to appear
112
- 2. Use network polling to detect data loading:
113
- ```
114
- opendevbrowser_network_poll
115
- ```
116
- 3. Take snapshot after XHR/Fetch completes
97
+ Parse JSON-LD in the host script and merge with extracted UI records if needed.
117
98
 
118
- ## Structured Data Detection
99
+ ## Quality Controls
119
100
 
120
- Look for embedded structured data:
121
- - JSON-LD scripts: `<script type="application/ld+json">`
122
- - Microdata attributes: `itemscope`, `itemprop`
123
- - RDFa attributes: `typeof`, `property`
101
+ Apply quality checks during extraction:
124
102
 
125
- Extract via:
126
- ```
127
- opendevbrowser_run script="return document.querySelector('script[type=\"application/ld+json\"]')?.textContent"
103
+ - Deduplicate by stable key (URL, ID, composite key).
104
+ - Track page number and source URL per record.
105
+ - Record null/missing fields explicitly.
106
+ - Validate record counts per page before continuing.
107
+
108
+ Use `opendevbrowser_network_poll` when extraction depends on API completion.
109
+
110
+ ```text
111
+ opendevbrowser_network_poll sessionId="<session-id>" max=50
128
112
  ```
129
113
 
130
- ## Rate Limiting Considerations
114
+ ## Export Pattern
115
+
116
+ Perform export in the host environment (outside tool calls):
117
+
118
+ - Normalize to JSON for structured pipelines.
119
+ - Convert to CSV only after schema normalization.
120
+ - Keep raw extraction artifacts when auditability is required.
121
+
122
+ ## Compliance and Rate Limits
123
+
124
+ Follow site constraints:
131
125
 
132
- When extracting large datasets:
133
- - Add delays between page requests
134
- - Monitor for rate limit responses (429 status)
135
- - Respect robots.txt and terms of service
136
- - Consider using persistent profile to maintain session
126
+ - Respect robots, terms, and legal boundaries.
127
+ - Add pacing between page transitions when needed.
128
+ - Stop on repeated 429/403 responses and apply cooldown/retry policy.
@@ -1,113 +1,106 @@
1
1
  ---
2
2
  name: form-testing
3
- description: Comprehensive form testing patterns including validation, submission, and error handling with OpenDevBrowser.
4
- version: 1.0.0
3
+ description: This skill should be used when the user asks to "test a form", "verify validation", "check submission behavior", "test multi-step forms", or "debug form errors" with OpenDevBrowser.
4
+ version: 1.1.0
5
5
  ---
6
6
 
7
7
  # Form Testing Skill
8
8
 
9
- ## Form Field Discovery
9
+ Use this guide for comprehensive validation, submission, and error-state testing.
10
10
 
11
- 1. Take a snapshot to map all form elements:
12
- ```
13
- opendevbrowser_snapshot
14
- ```
11
+ ## Form Discovery Pass
15
12
 
16
- 2. Identify field types:
17
- - Text inputs: `<input type="text">`
18
- - Email fields: `<input type="email">`
19
- - Number fields: `<input type="number">`
20
- - Select dropdowns: `<select>`
21
- - Checkboxes: `<input type="checkbox">`
22
- - Radio buttons: `<input type="radio">`
23
- - Textareas: `<textarea>`
24
- - File uploads: `<input type="file">`
13
+ Start every form suite with structural discovery:
25
14
 
26
- 3. Note required fields (often marked with `required` attribute or asterisk).
15
+ 1. Capture `actionables` snapshot.
16
+ 2. Map refs for each input, control, and submit button.
17
+ 3. Record required and optional fields.
18
+ 4. Record dependent/conditional fields.
27
19
 
28
- ## Validation Testing
20
+ ```text
21
+ opendevbrowser_snapshot sessionId="<session-id>" format="actionables"
22
+ ```
29
23
 
30
- Test each field's validation rules:
24
+ ## Validation Matrix
31
25
 
32
- ### Required Fields
33
- 1. Leave field empty
34
- 2. Submit form
35
- 3. Verify error message appears
26
+ Build a deterministic matrix per field type:
36
27
 
37
- ### Email Validation
38
- Test with:
39
- - Valid email: `user@example.com`
40
- - Missing @: `userexample.com`
41
- - Missing domain: `user@`
42
- - Invalid TLD: `user@example`
28
+ | Category | Cases |
29
+ |---|---|
30
+ | Required | empty value, whitespace-only, valid value |
31
+ | Email | valid format, missing `@`, missing domain |
32
+ | Numeric | below min, above max, boundary values |
33
+ | Length | below min length, exact bounds, above max length |
34
+ | Pattern | valid regex match, invalid charset, malformed input |
35
+ | Select/Radio | no selection, valid selection, invalid dependent state |
43
36
 
44
- ### Length Constraints
45
- - Minimum length: Enter fewer characters than required
46
- - Maximum length: Enter more characters than allowed
47
- - Boundary values: Test exact min/max limits
37
+ Re-snapshot after each invalid submit to capture updated error refs.
48
38
 
49
- ### Pattern Matching
50
- For fields with regex patterns:
51
- - Valid pattern match
52
- - Invalid characters
53
- - Edge cases
39
+ ## Submission Workflow
54
40
 
55
- ## Form Submission Workflow
41
+ Run positive-path submission only after field validation is complete:
56
42
 
57
- 1. Fill all required fields:
58
- ```
59
- opendevbrowser_type ref="[field-ref]" text="value"
60
- ```
43
+ 1. Fill required fields.
44
+ 2. Set select/radio/checkbox controls.
45
+ 3. Verify submit button is enabled.
46
+ 4. Submit and wait for network/UI completion.
61
47
 
62
- 2. For select dropdowns:
63
- ```
64
- opendevbrowser_select ref="[select-ref]" value="option-value"
65
- ```
48
+ ```text
49
+ opendevbrowser_type sessionId="<session-id>" ref="<text-ref>" text="valid value"
50
+ opendevbrowser_select sessionId="<session-id>" ref="<select-ref>" values=["expected-option"]
51
+ opendevbrowser_check sessionId="<session-id>" ref="<terms-ref>"
52
+ opendevbrowser_is_enabled sessionId="<session-id>" ref="<submit-ref>"
53
+ opendevbrowser_click sessionId="<session-id>" ref="<submit-ref>"
54
+ opendevbrowser_wait sessionId="<session-id>" until="networkidle"
55
+ ```
66
56
 
67
- 3. For checkboxes:
68
- ```
69
- opendevbrowser_click ref="[checkbox-ref]"
70
- ```
57
+ ## Error-State Assertions
71
58
 
72
- 4. Submit the form:
73
- ```
74
- opendevbrowser_click ref="[submit-ref]"
75
- ```
59
+ For invalid submissions, assert three dimensions:
76
60
 
77
- 5. Wait for response:
78
- ```
79
- opendevbrowser_wait state="networkidle"
80
- ```
61
+ 1. Error text is present and specific.
62
+ 2. Accessibility attributes are set correctly (for example `aria-invalid="true"`).
63
+ 3. Focus behavior moves to first invalid field when applicable.
81
64
 
82
- ## Error Message Verification
65
+ ```text
66
+ opendevbrowser_get_attr sessionId="<session-id>" ref="<field-ref>" name="aria-invalid"
67
+ opendevbrowser_dom_get_text sessionId="<session-id>" ref="<error-ref>"
68
+ ```
83
69
 
84
- After invalid submission:
70
+ ## Multi-Step Form Pattern
85
71
 
86
- 1. Take new snapshot to capture error state
87
- 2. Look for error messages near each field
88
- 3. Verify error text matches expected message
89
- 4. Check ARIA attributes for accessibility
72
+ For wizard-style forms:
90
73
 
91
- ## Multi-Step Forms
74
+ 1. Validate and submit current step.
75
+ 2. Wait for next-step container ref.
76
+ 3. Continue step-by-step until final submit.
77
+ 4. Verify completion state and any generated confirmation ID.
92
78
 
93
- For wizard-style forms:
79
+ Use `opendevbrowser_wait` with `ref` checks between steps.
80
+
81
+ ## Network Verification
82
+
83
+ Correlate UI behavior with network activity:
84
+
85
+ - Poll network events after submit.
86
+ - Confirm expected endpoint, method, and status.
87
+ - Flag silent frontend failures where UI does not surface server errors.
88
+
89
+ ```text
90
+ opendevbrowser_network_poll sessionId="<session-id>" max=50
91
+ ```
92
+
93
+ ## File Upload Limitation
94
94
 
95
- 1. Complete current step
96
- 2. Click next/continue button
97
- 3. Wait for next step to load
98
- 4. Repeat until completion
99
- 5. Verify final submission
95
+ Current tool surface does not provide direct file input attachment.
100
96
 
101
- ## File Upload Testing
97
+ - Handle upload steps manually, or
98
+ - Extend tooling with a dedicated upload capability before automating file-input paths.
102
99
 
103
- 1. Use `opendevbrowser_run` to execute file input script
104
- 2. Verify file preview appears
105
- 3. Test file type restrictions
106
- 4. Test file size limits
100
+ ## Regression-Friendly Batch Pattern
107
101
 
108
- ## Form Reset Testing
102
+ Use `opendevbrowser_run` to keep suites deterministic and compact:
109
103
 
110
- 1. Fill form with data
111
- 2. Click reset button
112
- 3. Verify all fields cleared
113
- 4. Verify any default values restored
104
+ ```text
105
+ opendevbrowser_run sessionId="<session-id>" steps=[{"action":"snapshot","args":{"format":"actionables"}},{"action":"type","args":{"ref":"<field-ref>","text":""}},{"action":"click","args":{"ref":"<submit-ref>"}},{"action":"snapshot","args":{"format":"outline"}}]
106
+ ```