opendevbrowser 0.0.12 → 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 (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +216 -28
  3. package/dist/chunk-JVBMT2O5.js +7173 -0
  4. package/dist/chunk-JVBMT2O5.js.map +1 -0
  5. package/dist/cli/index.js +2486 -589
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/index.js +1057 -194
  8. package/dist/index.js.map +1 -1
  9. package/dist/opendevbrowser.js +1057 -194
  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 +1194 -32
  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 +370 -25
  22. package/extension/dist/relay-settings.js +1 -0
  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/manifest.json +17 -3
  33. package/extension/popup.html +144 -0
  34. package/package.json +2 -2
  35. package/skills/AGENTS.md +34 -62
  36. package/skills/data-extraction/SKILL.md +95 -103
  37. package/skills/form-testing/SKILL.md +75 -82
  38. package/skills/login-automation/SKILL.md +76 -66
  39. package/skills/opendevbrowser-best-practices/SKILL.md +90 -49
  40. package/skills/opendevbrowser-continuity-ledger/SKILL.md +57 -23
  41. package/dist/chunk-WTFSMBVH.js +0 -2815
  42. package/dist/chunk-WTFSMBVH.js.map +0 -1
  43. package/extension/dist/popup.jsx +0 -150
@@ -1,98 +1,108 @@
1
1
  ---
2
2
  name: login-automation
3
- description: Best practices for automating login flows and authentication testing with OpenDevBrowser.
4
- version: 1.0.0
3
+ description: This skill should be used when the user asks to "automate login", "test authentication", "sign in programmatically", "validate login errors", or "verify session persistence" with OpenDevBrowser.
4
+ version: 1.1.0
5
5
  ---
6
6
 
7
7
  # Login Automation Skill
8
8
 
9
- ## Credential Handling
9
+ Use this guide for deterministic login flows and authentication checks.
10
10
 
11
- Store credentials securely using environment variables or config files outside the repository.
11
+ ## Secure Credential Handling
12
12
 
13
- Never hardcode credentials in test scripts or skill files.
13
+ Handle credentials outside skill files and source code:
14
14
 
15
- Use `opendevbrowser_type` with `sensitive: true` (if available) for password fields.
15
+ - Resolve credentials from environment variables or a secret manager in the orchestration layer.
16
+ - Pass resolved values at runtime only.
17
+ - Avoid logging secrets in transcripts, fixtures, or screenshots.
16
18
 
17
- ## Form Detection Workflow
19
+ ## Preflight Checklist
18
20
 
19
- 1. Take a snapshot to identify login form elements:
20
- ```
21
- opendevbrowser_snapshot
22
- ```
21
+ Before typing credentials:
23
22
 
24
- 2. Look for common patterns:
25
- - Input fields with `type="email"`, `type="text"`, `name="username"`
26
- - Input fields with `type="password"`
27
- - Submit buttons with text containing "Sign in", "Log in", "Submit"
23
+ 1. Launch or connect to the intended session mode.
24
+ 2. Navigate to the login URL.
25
+ 3. Wait for page readiness.
26
+ 4. Capture a fresh snapshot and identify refs.
28
27
 
29
- 3. Use refs to target form elements reliably.
28
+ ```text
29
+ opendevbrowser_goto sessionId="<session-id>" url="https://example.com/login"
30
+ opendevbrowser_wait sessionId="<session-id>" until="networkidle"
31
+ opendevbrowser_snapshot sessionId="<session-id>" format="actionables"
32
+ ```
30
33
 
31
- ## Authentication Flow
34
+ ## Canonical Login Flow
32
35
 
33
- 1. Navigate to login page:
34
- ```
35
- opendevbrowser_goto url="https://example.com/login"
36
- ```
36
+ Execute login in a strict order:
37
37
 
38
- 2. Wait for form to load:
39
- ```
40
- opendevbrowser_wait state="networkidle"
41
- ```
38
+ 1. Type identifier into email/username ref.
39
+ 2. Type password into password ref.
40
+ 3. Click submit.
41
+ 4. Wait for navigation or authenticated UI state.
42
+ 5. Re-snapshot for post-login verification.
42
43
 
43
- 3. Take snapshot to get refs:
44
- ```
45
- opendevbrowser_snapshot
46
- ```
44
+ ```text
45
+ opendevbrowser_type sessionId="<session-id>" ref="<identifier-ref>" text="<resolved-identifier>"
46
+ opendevbrowser_type sessionId="<session-id>" ref="<password-ref>" text="<resolved-password>"
47
+ opendevbrowser_click sessionId="<session-id>" ref="<submit-ref>"
48
+ opendevbrowser_wait sessionId="<session-id>" until="networkidle"
49
+ opendevbrowser_snapshot sessionId="<session-id>" format="outline"
50
+ ```
47
51
 
48
- 4. Enter username/email:
49
- ```
50
- opendevbrowser_type ref="[email-input-ref]" text="user@example.com"
51
- ```
52
+ ## Success Validation
52
53
 
53
- 5. Enter password:
54
- ```
55
- opendevbrowser_type ref="[password-input-ref]" text="password123"
56
- ```
54
+ Validate more than one signal:
57
55
 
58
- 6. Click submit:
59
- ```
60
- opendevbrowser_click ref="[submit-button-ref]"
61
- ```
56
+ - URL or route changed to expected authenticated location.
57
+ - Authenticated-only UI ref becomes visible.
58
+ - Login request in `opendevbrowser_network_poll` returns expected status.
62
59
 
63
- 7. Wait for navigation:
64
- ```
65
- opendevbrowser_wait state="networkidle"
66
- ```
60
+ ```text
61
+ opendevbrowser_network_poll sessionId="<session-id>" max=50
62
+ ```
67
63
 
68
- ## Error Handling
64
+ Use `opendevbrowser_is_visible` or `opendevbrowser_get_attr` for deterministic assertions.
69
65
 
70
- After login attempt, verify success:
66
+ ## Error and Recovery Handling
71
67
 
72
- 1. Check URL changed to expected destination
73
- 2. Look for error messages in snapshot
74
- 3. Verify session cookies are set via network poll
68
+ Handle common blockers explicitly:
75
69
 
76
- Common failure patterns:
77
- - "Invalid credentials" messages
78
- - CAPTCHA challenges
79
- - Multi-factor authentication prompts
80
- - Rate limiting or lockout
70
+ - Invalid credentials: assert error banner text near form.
71
+ - CAPTCHA/challenge: classify as manual checkpoint.
72
+ - MFA prompt: continue with second-factor workflow if test account supports it.
73
+ - Lockout/rate limit: stop retries and rotate test account or cooldown window.
81
74
 
82
- ## MFA Handling
75
+ After any failure, re-snapshot before retrying to avoid stale refs.
83
76
 
84
- For TOTP-based MFA:
85
- 1. Generate code using appropriate library
86
- 2. Wait for MFA input field to appear
87
- 3. Enter the code
88
- 4. Submit
77
+ ## MFA Flow Pattern
89
78
 
90
- For SMS/Email MFA:
91
- - Requires manual intervention or test account bypass
79
+ For MFA-capable test flows:
92
80
 
93
- ## Session Persistence
81
+ 1. Submit primary credentials.
82
+ 2. Wait for MFA input ref.
83
+ 3. Enter OTP/ref-based code.
84
+ 4. Submit and validate authenticated state.
94
85
 
95
- Use persistent browser profiles to maintain sessions across runs:
86
+ ```text
87
+ opendevbrowser_wait sessionId="<session-id>" ref="<mfa-input-ref>" state="visible"
88
+ opendevbrowser_type sessionId="<session-id>" ref="<mfa-input-ref>" text="<resolved-otp>"
89
+ opendevbrowser_click sessionId="<session-id>" ref="<mfa-submit-ref>"
96
90
  ```
97
- opendevbrowser_launch profile="test-user" persistProfile=true
91
+
92
+ ## Session Persistence Checks
93
+
94
+ Use persistent profiles when verifying remembered sessions:
95
+
96
+ ```text
97
+ opendevbrowser_launch profile="auth-test" persistProfile=true noExtension=true
98
+ ```
99
+
100
+ Then reopen and verify whether re-authentication is required.
101
+
102
+ ## Batch Script Pattern
103
+
104
+ Use `opendevbrowser_run` for compact, repeatable flows:
105
+
106
+ ```text
107
+ opendevbrowser_run sessionId="<session-id>" steps=[{"action":"goto","args":{"url":"https://example.com/login"}},{"action":"wait","args":{"until":"networkidle"}},{"action":"snapshot","args":{"format":"actionables"}},{"action":"type","args":{"ref":"<identifier-ref>","text":"<resolved-identifier>"}},{"action":"type","args":{"ref":"<password-ref>","text":"<resolved-password>"}},{"action":"click","args":{"ref":"<submit-ref>"}},{"action":"wait","args":{"until":"networkidle"}},{"action":"snapshot","args":{"format":"outline"}}]
98
108
  ```
@@ -1,81 +1,122 @@
1
1
  ---
2
2
  name: opendevbrowser-best-practices
3
- description: Use when the user asks to write browser scripts, automate navigation, use snapshot refs, or extract DOM elements. Provides script-first, snapshot/ref guidance.
4
- version: 0.1.0
3
+ description: This skill should be used when the user asks to "automate a browser flow", "write an OpenDevBrowser script", "use snapshot refs", "extract page content", or "debug browser automation".
4
+ version: 1.1.0
5
5
  ---
6
6
 
7
7
  # OpenDevBrowser Best Practices
8
8
 
9
- Use this guide to generate fast, reliable, script-first workflows without bloating tools or output.
9
+ Use this guide to produce reliable, script-first automation with minimal retries and predictable output.
10
10
 
11
- ## Core Workflow (Snapshot -> Refs -> Actions)
11
+ ## Core Operating Model
12
12
 
13
- Prefer the snapshot/ref loop as the primary interaction model:
13
+ Follow the loop strictly:
14
14
 
15
- 1. Navigate or focus the target page.
16
- 2. Capture a snapshot to obtain stable refs.
17
- 3. Act on refs (click, type, select, scroll).
18
- 4. Re-snapshot after navigation or large DOM changes.
15
+ 1. Establish or attach a session.
16
+ 2. Capture `opendevbrowser_snapshot`.
17
+ 3. Select refs from that snapshot.
18
+ 4. Execute one or more actions using refs.
19
+ 5. Re-snapshot after navigation or major DOM change.
19
20
 
20
- Use refs instead of raw selectors whenever possible.
21
+ Prefer refs over raw selectors. Refs are more stable across dynamic UI changes.
21
22
 
22
- ## Script-First Execution
23
+ ## Session Strategy
23
24
 
24
- Batch related actions in a single run to reduce round-trips:
25
+ Choose mode deliberately:
25
26
 
26
- - Use `opendevbrowser_run` for multi-step actions.
27
- - Keep steps small and deterministic.
28
- - End each run with a state check (snapshot or targeted extraction).
27
+ - Use managed mode for deterministic, isolated runs.
28
+ - Use extension mode when existing logged-in tabs or profile state are required.
29
+ - Use CDP connect mode only when attaching to a pre-launched browser is required.
29
30
 
30
- Match the arguments used in the single-action tools.
31
+ Example launch patterns:
31
32
 
32
- ## Waiting and Stability
33
+ ```text
34
+ opendevbrowser_launch noExtension=true
35
+ opendevbrowser_launch waitForExtension=true
36
+ opendevbrowser_connect wsEndpoint="ws://127.0.0.1:9222/devtools/browser/<id>"
37
+ ```
33
38
 
34
- Stabilize the page before acting:
39
+ ## Snapshot Discipline
35
40
 
36
- - Use `opendevbrowser_wait` after navigation and before interacting with newly rendered UI.
37
- - Prefer `networkidle` or `load` when the UI is fully dynamic.
38
- - Wait for a ref state when targeting specific elements.
41
+ Capture snapshots in the format needed by the current task:
39
42
 
40
- ## Token-Efficient Extraction
43
+ - Use `format="outline"` for broad page state.
44
+ - Use `format="actionables"` for interaction planning.
45
+ - Use `maxChars` and `cursor` to page large pages instead of requesting oversized snapshots.
41
46
 
42
- Keep outputs small and scoped:
47
+ ```text
48
+ opendevbrowser_snapshot sessionId="<session-id>" format="actionables"
49
+ ```
43
50
 
44
- - Use `opendevbrowser_dom_get_text` or `opendevbrowser_dom_get_html` only on specific refs.
45
- - Avoid dumping full page HTML.
46
- - Use snapshot cursor paging when content is large.
51
+ ## Action Sequencing
47
52
 
48
- ## Debug Signals (Lightweight)
53
+ Stabilize before interacting:
49
54
 
50
- Use polling tools only when needed:
55
+ - After `goto` or click-driven navigation, run `opendevbrowser_wait`.
56
+ - Wait on `until="networkidle"` for API-heavy pages.
57
+ - Wait on `ref` + `state` for specific element readiness.
51
58
 
52
- - Use `opendevbrowser_console_poll` to check for runtime errors.
53
- - Use `opendevbrowser_network_poll` to confirm API calls and statuses.
59
+ ```text
60
+ opendevbrowser_wait sessionId="<session-id>" until="networkidle"
61
+ opendevbrowser_wait sessionId="<session-id>" ref="<target-ref>" state="visible"
62
+ ```
54
63
 
55
- ## Example Patterns
64
+ For multi-step interactions, batch deterministic steps with `opendevbrowser_run`.
56
65
 
57
- ### Login Flow (Batch)
66
+ ```text
67
+ opendevbrowser_run sessionId="<session-id>" steps=[{"action":"goto","args":{"url":"https://example.com"}},{"action":"wait","args":{"until":"networkidle"}},{"action":"snapshot","args":{"format":"actionables"}}]
68
+ ```
58
69
 
59
- 1. `goto` login URL.
60
- 2. `wait` for page load.
61
- 3. `snapshot` to get refs.
62
- 4. `type` email/password refs.
63
- 5. `click` submit ref.
64
- 6. `wait` for navigation.
65
- 7. `snapshot` to confirm state.
70
+ ## Extraction and Output Control
66
71
 
67
- ### Targeted Extraction
72
+ Keep output scoped and cheap:
68
73
 
69
- 1. `snapshot` to get ref for the desired element.
70
- 2. `dom_get_text` on that ref.
74
+ - Extract only the needed node text with `opendevbrowser_dom_get_text`.
75
+ - Use `opendevbrowser_dom_get_html` only for small targeted fragments.
76
+ - Use `opendevbrowser_get_attr` and `opendevbrowser_get_value` for structured field data.
71
77
 
72
- ## Mode Guidance
78
+ ```text
79
+ opendevbrowser_dom_get_text sessionId="<session-id>" ref="<content-ref>"
80
+ opendevbrowser_get_attr sessionId="<session-id>" ref="<input-ref>" name="aria-invalid"
81
+ ```
73
82
 
74
- - Use Mode A (managed) by default for zero-config operation.
75
- - Use Mode C (extension) only when existing logged-in tabs are required.
83
+ ## Lightweight Diagnostics
76
84
 
77
- ## Safe Defaults
85
+ Inspect runtime behavior only when required:
78
86
 
79
- - Keep CDP local-only by default.
80
- - Redact secrets in snapshot output.
81
- - Avoid raw CDP unless explicitly enabled.
87
+ - Use `opendevbrowser_console_poll` to detect script/runtime errors.
88
+ - Use `opendevbrowser_network_poll` to verify request outcomes.
89
+ - Use `opendevbrowser_screenshot` for visual debugging artifacts.
90
+
91
+ ```text
92
+ opendevbrowser_console_poll sessionId="<session-id>"
93
+ opendevbrowser_network_poll sessionId="<session-id>" max=50
94
+ ```
95
+
96
+ ## Failure Recovery Order
97
+
98
+ When a step fails, recover in this order:
99
+
100
+ 1. Re-snapshot to refresh refs.
101
+ 2. Re-wait for load or element state.
102
+ 3. Retry action once with fresh refs.
103
+ 4. Change mode (managed vs extension) only if failure is mode-specific.
104
+
105
+ Avoid blind repeated retries against stale refs.
106
+
107
+ ## Security and Safety Defaults
108
+
109
+ - Keep CDP and relay endpoints local-only by default.
110
+ - Do not place secrets in scripts, skill files, or logs.
111
+ - Prefer minimal extraction over full-page dumps when handling sensitive pages.
112
+
113
+ ## Ready-to-Use Flow Template
114
+
115
+ ```text
116
+ opendevbrowser_launch noExtension=true
117
+ opendevbrowser_goto sessionId="<session-id>" url="https://example.com"
118
+ opendevbrowser_wait sessionId="<session-id>" until="networkidle"
119
+ opendevbrowser_snapshot sessionId="<session-id>" format="actionables"
120
+ # interact with refs
121
+ opendevbrowser_snapshot sessionId="<session-id>" format="outline"
122
+ ```
@@ -1,45 +1,79 @@
1
1
  ---
2
2
  name: opendevbrowser-continuity-ledger
3
- description: Maintain an OpenDevBrowser continuity ledger in opendevbrowser_continuity.md for long-running tasks and resumable work.
4
- version: 1.0.0
3
+ description: This skill should be used when the user asks to "track continuity", "resume a long task", "maintain CONTINUITY.md", or run multi-step work that may span context compaction.
4
+ version: 1.1.0
5
5
  ---
6
6
 
7
7
  # OpenDevBrowser Continuity Ledger
8
8
 
9
- Use a lightweight ledger to keep long-running tasks on track across sessions or context compaction.
9
+ Use this guide to maintain compaction-safe project state in `CONTINUITY.md`.
10
10
 
11
- ## When to use
12
- - Multi-step work that spans several actions
13
- - Refactors, migrations, or release work
14
- - Investigations with multiple findings
15
- - Any task likely to resume later
11
+ ## Ownership Rules
16
12
 
17
- ## Ledger file
18
- - Always use `opendevbrowser_continuity.md` at the repo root.
19
- - Create it if it does not exist.
20
- - Keep it short and factual.
13
+ Apply these rules exactly:
21
14
 
22
- ## Exact template (copy as-is)
15
+ - Allow only the main orchestrator agent to edit `CONTINUITY.md`.
16
+ - Instruct sub-agents to never edit `CONTINUITY.md`.
17
+ - Require sub-agents to append their outcomes to `sub_continuity.md`.
18
+ - If `CONTINUITY.md` is modified incorrectly by another agent, restore it immediately and continue.
23
19
 
24
- ```markdown
25
- # OpenDevBrowser Continuity Ledger
20
+ ## Start-of-Turn Protocol
21
+
22
+ Run this sequence at the beginning of each turn:
23
+
24
+ 1. Read `CONTINUITY.md`.
25
+ 2. Read `sub_continuity.md`.
26
+ 3. Update `CONTINUITY.md` to reflect the current goal, constraints, decisions, and execution state.
27
+ 4. Proceed with implementation.
28
+
29
+ If recall is incomplete, rebuild from visible context, mark gaps `UNCONFIRMED`, then continue.
26
30
 
31
+ ## Required Ledger Template
32
+
33
+ Maintain these headings and sections:
34
+
35
+ ```markdown
27
36
  Goal (incl. success criteria):
28
37
  - Constraints/Assumptions:
29
38
  - Key decisions:
30
39
  - State:
31
40
  - Done:
32
41
  - Now:
33
- - Next:
42
+ - Next: at least 4 next tasks/subtasks each with a brief description. must be detailed with a clear action item and expected outcome and files to be impacted
34
43
  - Open questions (UNCONFIRMED if needed):
44
+ - When you have open questions, do your research in the codebase (and on the internet for best practices) to understand the existing patterns and constraints. Choose answers that are consistent with the existing patterns and constraints and best-practice and research all synchronized into logical recommendations. You must research codebase + external sources first, state the recommended option with brief rationale, and explicitly list any items that still require user input.
35
45
  - Working set (files/ids/commands):
46
+ - Key learnings: what worked; what didn't work, best approach identified for next time
36
47
  ```
37
48
 
38
- ## Update rules
39
- 1. At the start of a long task, read the ledger and refresh Goal/Now/Next.
40
- 2. Update the ledger when goals, decisions, or progress state change.
41
- 3. Record important tool outcomes briefly.
42
- 4. If context is lost, rebuild the ledger from visible state and mark gaps as `UNCONFIRMED`.
49
+ ## Update Triggers
50
+
51
+ Update `CONTINUITY.md` whenever one of these changes:
52
+
53
+ - Goal or success criteria
54
+ - Constraints or assumptions
55
+ - Key decisions
56
+ - Progress state (`Done`, `Now`, `Next`)
57
+ - Important command/tool outcomes
58
+
59
+ Keep entries factual and concise. Avoid transcript-style logging.
60
+
61
+ ## Handling Open Questions
62
+
63
+ When uncertainty exists:
64
+
65
+ 1. Research codebase patterns first.
66
+ 2. Research external best practices where relevant.
67
+ 3. Recommend a preferred option with rationale.
68
+ 4. List only unresolved user-input decisions.
69
+ 5. Mark unknown facts as `UNCONFIRMED`.
70
+
71
+ ## Reply Pattern
72
+
73
+ Start response messages with a short ledger snapshot:
74
+
75
+ - Goal
76
+ - Now/Next
77
+ - Open questions + recommended option
43
78
 
44
- ## Reply pattern
45
- Start replies with a short "Ledger Snapshot" (Goal + Now/Next + Open questions) when the ledger is in use.
79
+ Print the full ledger only when it materially changes or when requested.