browserpaw 0.0.0-stage → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +681 -0
- package/README.md +4 -2
- package/dist/v5/cli-files.cjs +147 -0
- package/dist/v5/cli.cjs +4028 -0
- package/dist/v5/extension/assets/popup-Djl4pI1R.css +359 -0
- package/dist/v5/extension/background.js +37712 -0
- package/dist/v5/extension/browserpaw-build.json +184 -0
- package/dist/v5/extension/chunks/popup-DjxqduQH.js +6542 -0
- package/dist/v5/extension/content-scripts/agent-cursor.js +1459 -0
- package/dist/v5/extension/icon/128.png +0 -0
- package/dist/v5/extension/icon/16.png +0 -0
- package/dist/v5/extension/icon/32.png +0 -0
- package/dist/v5/extension/icon/48.png +0 -0
- package/dist/v5/extension/icon/96.png +0 -0
- package/dist/v5/extension/images/cursor-chat.png +0 -0
- package/dist/v5/extension/inject-scripts/accessibility-tree-helper.js +1883 -0
- package/dist/v5/extension/inject-scripts/keyboard-helper.js +402 -0
- package/dist/v5/extension/inject-scripts/network-helper.js +213 -0
- package/dist/v5/extension/inject-scripts/screenshot-helper.js +408 -0
- package/dist/v5/extension/inpage-engine.js +9300 -0
- package/dist/v5/extension/manifest.json +1 -0
- package/dist/v5/extension/popup.html +14 -0
- package/dist/v5/host.cjs +19441 -0
- package/dist/v5/recipes/developer.mozilla.org.md +15 -0
- package/dist/v5/recipes/github-releases.json +177 -0
- package/dist/v5/recipes/mdn-search.json +174 -0
- package/dist/v5/recipes/npm-compare.json +456 -0
- package/dist/v5/recipes/x-search-thread.json +321 -0
- package/dist/v5/recipes/x-visible-thread.json +303 -0
- package/dist/v5/run_host.bat +7 -0
- package/dist/v5/run_host.sh +6 -0
- package/dist/v5/skill/browserpaw/SKILL.md +48 -0
- package/dist/v5/skill/browserpaw/assets/recipes/developer.mozilla.org.md +15 -0
- package/dist/v5/skill/browserpaw/assets/recipes/github-releases.json +177 -0
- package/dist/v5/skill/browserpaw/assets/recipes/mdn-search.json +174 -0
- package/dist/v5/skill/browserpaw/assets/recipes/npm-compare.json +456 -0
- package/dist/v5/skill/browserpaw/assets/recipes/x-search-thread.json +321 -0
- package/dist/v5/skill/browserpaw/assets/recipes/x-visible-thread.json +303 -0
- package/dist/v5/skill/browserpaw/references/TROUBLESHOOTING.md +7 -0
- package/dist/v5/skill/browserpaw/references/TROUBLESHOOTING.zh-CN.md +5 -0
- package/dist/v5/skill/browserpaw/references/browser-data.md +33 -0
- package/dist/v5/skill/browserpaw/references/commands.md +103 -0
- package/dist/v5/skill/browserpaw/references/debugging.md +32 -0
- package/dist/v5/skill/browserpaw/references/recipe-contract.md +46 -0
- package/package.json +67 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Site Recipe: MDN Web Docs
|
|
2
|
+
|
|
3
|
+
- **Target Hostname**: developer.mozilla.org
|
|
4
|
+
- **Author**: BrowserPaw Team
|
|
5
|
+
- **Last Verified**: 2026-10-22
|
|
6
|
+
|
|
7
|
+
> **Notice**: The hints below are observational guidance based on verified behaviors. Always confirm current layout and live accessibility trees in-session.
|
|
8
|
+
|
|
9
|
+
## 1. Key Layout & Tree Traversal Hints
|
|
10
|
+
|
|
11
|
+
- **Main Content Container**: The `<main id="content">` element typically applies `display: contents` in modern MDN stylesheets. Do not prune or clip the subtree based solely on bounding box or zero-dimension checks on the `<main>` root, or child content will be lost.
|
|
12
|
+
- **Dynamic Examples & Repeated Hrefs**: Interactive code example blocks and reference lists often include multiple links sharing identical `href` targets. Distinguish interactive anchors via live node references (`ref` / numeric DOM indexes) rather than guessing by URL alone.
|
|
13
|
+
- **Stale Ref Invalidation**: A new document or a replaced DOM node invalidates its previous reference. Ordinary updates retain references while the same node survives; refresh the snapshot when a reference expires.
|
|
14
|
+
- **Interactive Embeds (OOPIF)**: Interactive editor demos and live running snippets are embedded inside cross-origin/OOPIF `<iframe>` sandboxes (`iframe.interactive`). Interacting with buttons or inputs within the preview requires switching or targeting the specific child frame context.
|
|
15
|
+
- **No Hardcoded Indexes or IDs**: Never hardcode runtime element indexes, internal frame IDs, or targetIDs; inspect the live accessibility map before executing action pipelines.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "github-releases",
|
|
3
|
+
"name": "GitHub releases reader",
|
|
4
|
+
"description": "Read a repository's public release Atom feed and return source-linked release entries.",
|
|
5
|
+
"source": {
|
|
6
|
+
"type": "builtin",
|
|
7
|
+
"urls": [
|
|
8
|
+
"https://github.com/react/react/releases",
|
|
9
|
+
"https://github.com/react/react/releases.atom",
|
|
10
|
+
"https://docs.github.com/en/repositories/releasing-projects-on-github/viewing-your-repositorys-releases-and-tags"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"domains": ["github.com"],
|
|
14
|
+
"keywords": ["github", "releases", "changelog", "versions"],
|
|
15
|
+
"startUrl": "https://github.com/{{owner}}/{{repo}}/releases",
|
|
16
|
+
"inputSchema": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"properties": {
|
|
19
|
+
"owner": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$"
|
|
22
|
+
},
|
|
23
|
+
"repo": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"pattern": "^[A-Za-z0-9._-]{1,100}$"
|
|
26
|
+
},
|
|
27
|
+
"limit": {
|
|
28
|
+
"type": "integer",
|
|
29
|
+
"minimum": 1,
|
|
30
|
+
"maximum": 10,
|
|
31
|
+
"default": 5
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": ["owner", "repo"],
|
|
35
|
+
"additionalProperties": false
|
|
36
|
+
},
|
|
37
|
+
"outputSchema": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"properties": {
|
|
40
|
+
"success": {
|
|
41
|
+
"const": true
|
|
42
|
+
},
|
|
43
|
+
"status": {
|
|
44
|
+
"const": "ok"
|
|
45
|
+
},
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"pattern": "^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$"
|
|
49
|
+
},
|
|
50
|
+
"releases": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"minItems": 1,
|
|
53
|
+
"maxItems": 10,
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"title": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"minLength": 1
|
|
60
|
+
},
|
|
61
|
+
"url": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"pattern": "^https://github\\.com/.+/releases/tag/"
|
|
64
|
+
},
|
|
65
|
+
"updated": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"minLength": 1
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": ["title", "url", "updated"],
|
|
71
|
+
"additionalProperties": false
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"sources": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"properties": {
|
|
77
|
+
"atom": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"pattern": "^https://github\\.com/.+/releases\\.atom$"
|
|
80
|
+
},
|
|
81
|
+
"page": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"pattern": "^https://github\\.com/.+/releases(?:\\?.*)?$"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": ["atom", "page"],
|
|
87
|
+
"additionalProperties": false
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"required": ["success", "status", "repository", "releases", "sources"],
|
|
91
|
+
"additionalProperties": false
|
|
92
|
+
},
|
|
93
|
+
"steps": [
|
|
94
|
+
{
|
|
95
|
+
"tool": "chrome_javascript",
|
|
96
|
+
"args": {
|
|
97
|
+
"code": "const owner = String(input.owner || '').trim();\nconst repo = String(input.repo || '').trim();\nconst limit = Math.max(1, Math.min(Number(input.limit) || 5, 10));\nconst feed = new URL('/' + encodeURIComponent(owner) + '/' + encodeURIComponent(repo) + '/releases.atom', location.origin);\nconst response = await fetch(feed.href, { credentials: 'include' });\nif (!response.ok) return { success: false, status: 'http_error', repository: owner + '/' + repo, httpStatus: response.status, source: response.url };\nconst finalPath = new URL(response.url).pathname.split('/').filter(Boolean);\nconst repository = finalPath.length === 3 && finalPath[2] === 'releases.atom' ? decodeURIComponent(finalPath[0]) + '/' + decodeURIComponent(finalPath[1]) : owner + '/' + repo;\nconst xml = new DOMParser().parseFromString(await response.text(), 'application/xml');\nif (xml.querySelector('parsererror')) return { success: false, status: 'invalid_feed', repository, source: response.url };\nconst releases = Array.from(xml.querySelectorAll('entry'))\n .slice(0, limit)\n .map(entry => ({\n title: String(entry.querySelector('title') && entry.querySelector('title').textContent || '').trim(),\n url: String(entry.querySelector('link') && entry.querySelector('link').getAttribute('href') || ''),\n updated: String(entry.querySelector('updated') && entry.querySelector('updated').textContent || '').trim()\n }))\n .filter(item => item.title && /^https:\\/\\/github\\.com\\/.+\\/releases\\/tag\\//.test(item.url) && item.updated);\nif (!releases.length) return { success: false, status: 'empty', repository, source: response.url };\nreturn {\n success: true,\n status: 'ok',\n repository,\n releases,\n sources: { atom: response.url, page: new URL('/' + encodeURIComponent(repository.split('/')[0]) + '/' + encodeURIComponent(repository.split('/')[1]) + '/releases', location.origin).href }\n};"
|
|
98
|
+
},
|
|
99
|
+
"resultPath": "/result"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"verification": {
|
|
103
|
+
"tool": "chrome_read_dom",
|
|
104
|
+
"args": {
|
|
105
|
+
"format": "compact",
|
|
106
|
+
"selector": "main",
|
|
107
|
+
"activeViewportOnly": false,
|
|
108
|
+
"limit": 80,
|
|
109
|
+
"maxTextLength": 220
|
|
110
|
+
},
|
|
111
|
+
"resultPath": "/treeString"
|
|
112
|
+
},
|
|
113
|
+
"tests": [
|
|
114
|
+
{
|
|
115
|
+
"inputs": {
|
|
116
|
+
"owner": "react",
|
|
117
|
+
"repo": "react",
|
|
118
|
+
"limit": 3
|
|
119
|
+
},
|
|
120
|
+
"expect": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"properties": {
|
|
123
|
+
"success": {
|
|
124
|
+
"const": true
|
|
125
|
+
},
|
|
126
|
+
"repository": {
|
|
127
|
+
"const": "react/react"
|
|
128
|
+
},
|
|
129
|
+
"releases": {
|
|
130
|
+
"type": "array",
|
|
131
|
+
"minItems": 1
|
|
132
|
+
},
|
|
133
|
+
"sources": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"required": ["atom", "page"]
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"required": ["success", "repository", "releases", "sources"]
|
|
139
|
+
},
|
|
140
|
+
"observe": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"pattern": "Releases: react/react"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"inputs": {
|
|
147
|
+
"owner": "microsoft",
|
|
148
|
+
"repo": "vscode",
|
|
149
|
+
"limit": 2
|
|
150
|
+
},
|
|
151
|
+
"expect": {
|
|
152
|
+
"type": "object",
|
|
153
|
+
"properties": {
|
|
154
|
+
"success": {
|
|
155
|
+
"const": true
|
|
156
|
+
},
|
|
157
|
+
"repository": {
|
|
158
|
+
"const": "microsoft/vscode"
|
|
159
|
+
},
|
|
160
|
+
"releases": {
|
|
161
|
+
"type": "array",
|
|
162
|
+
"minItems": 1
|
|
163
|
+
},
|
|
164
|
+
"sources": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"required": ["atom", "page"]
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"required": ["success", "repository", "releases", "sources"]
|
|
170
|
+
},
|
|
171
|
+
"observe": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"pattern": "Releases: microsoft/vscode"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "mdn-search",
|
|
3
|
+
"name": "MDN documentation search",
|
|
4
|
+
"description": "Search MDN's public documentation API and return source-linked documentation results.",
|
|
5
|
+
"source": {
|
|
6
|
+
"type": "builtin",
|
|
7
|
+
"urls": [
|
|
8
|
+
"https://developer.mozilla.org/en-US/search?q=fetch",
|
|
9
|
+
"https://developer.mozilla.org/api/v1/search?q=fetch&locale=en-US"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"domains": ["developer.mozilla.org"],
|
|
13
|
+
"keywords": ["mdn", "documentation", "web api", "search"],
|
|
14
|
+
"startUrl": "https://developer.mozilla.org/en-US/search?q={{query}}",
|
|
15
|
+
"inputSchema": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"properties": {
|
|
18
|
+
"query": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"maxLength": 200
|
|
22
|
+
},
|
|
23
|
+
"limit": {
|
|
24
|
+
"type": "integer",
|
|
25
|
+
"minimum": 1,
|
|
26
|
+
"maximum": 10,
|
|
27
|
+
"default": 5
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": ["query"],
|
|
31
|
+
"additionalProperties": false
|
|
32
|
+
},
|
|
33
|
+
"outputSchema": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"success": {
|
|
37
|
+
"const": true
|
|
38
|
+
},
|
|
39
|
+
"status": {
|
|
40
|
+
"const": "ok"
|
|
41
|
+
},
|
|
42
|
+
"query": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"minLength": 1
|
|
45
|
+
},
|
|
46
|
+
"documents": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"minItems": 1,
|
|
49
|
+
"maxItems": 10,
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"title": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"minLength": 1
|
|
56
|
+
},
|
|
57
|
+
"url": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"pattern": "^https://developer\\.mozilla\\.org/[a-z]{2}(?:-[A-Z]{2})?/docs/"
|
|
60
|
+
},
|
|
61
|
+
"summary": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": ["title", "url", "summary"],
|
|
66
|
+
"additionalProperties": false
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"sources": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"api": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"pattern": "^https://developer\\.mozilla\\.org/api/v1/search"
|
|
75
|
+
},
|
|
76
|
+
"page": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"pattern": "^https://developer\\.mozilla\\.org/"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"required": ["api", "page"],
|
|
82
|
+
"additionalProperties": false
|
|
83
|
+
},
|
|
84
|
+
"total": {
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"minimum": 0
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"required": ["success", "status", "query", "documents", "sources", "total"],
|
|
90
|
+
"additionalProperties": false
|
|
91
|
+
},
|
|
92
|
+
"steps": [
|
|
93
|
+
{
|
|
94
|
+
"tool": "chrome_javascript",
|
|
95
|
+
"args": {
|
|
96
|
+
"code": "const query = String(input.query || '').trim();\nconst limit = Math.max(1, Math.min(Number(input.limit) || 5, 10));\nconst endpoint = new URL('/api/v1/search', location.origin);\nendpoint.searchParams.set('q', query);\nendpoint.searchParams.set('locale', 'en-US');\nconst response = await fetch(endpoint.href, { credentials: 'include', headers: { Accept: 'application/json' } });\nif (!response.ok) return { success: false, status: 'http_error', query, httpStatus: response.status, source: response.url };\nconst data = await response.json();\nconst documents = (Array.isArray(data.documents) ? data.documents : [])\n .filter(item => item && typeof item.mdn_url === 'string' && item.mdn_url.startsWith('/'))\n .slice(0, limit)\n .map(item => ({\n title: String(item.title || '').replace(/<[^>]*>/g, ''),\n url: new URL(item.mdn_url, location.origin).href,\n summary: String(item.summary || '').replace(/<[^>]*>/g, '')\n }));\nif (!documents.length) return { success: false, status: 'empty', query, source: endpoint.href };\nreturn {\n success: true,\n status: 'ok',\n query,\n documents,\n sources: { api: response.url, page: location.href },\n total: Number(data.metadata && data.metadata.total && data.metadata.total.value || documents.length)\n};"
|
|
97
|
+
},
|
|
98
|
+
"resultPath": "/result"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"verification": {
|
|
102
|
+
"tool": "chrome_read_dom",
|
|
103
|
+
"args": {
|
|
104
|
+
"format": "compact",
|
|
105
|
+
"selector": "body",
|
|
106
|
+
"activeViewportOnly": false,
|
|
107
|
+
"limit": 90,
|
|
108
|
+
"maxTextLength": 220
|
|
109
|
+
},
|
|
110
|
+
"resultPath": "/treeString"
|
|
111
|
+
},
|
|
112
|
+
"tests": [
|
|
113
|
+
{
|
|
114
|
+
"inputs": {
|
|
115
|
+
"query": "fetch",
|
|
116
|
+
"limit": 3
|
|
117
|
+
},
|
|
118
|
+
"expect": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"properties": {
|
|
121
|
+
"success": {
|
|
122
|
+
"const": true
|
|
123
|
+
},
|
|
124
|
+
"query": {
|
|
125
|
+
"const": "fetch"
|
|
126
|
+
},
|
|
127
|
+
"documents": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"minItems": 1
|
|
130
|
+
},
|
|
131
|
+
"sources": {
|
|
132
|
+
"type": "object",
|
|
133
|
+
"required": ["api", "page"]
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"required": ["success", "query", "documents", "sources"]
|
|
137
|
+
},
|
|
138
|
+
"observe": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"pattern": "Fetch API"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"inputs": {
|
|
145
|
+
"query": "AbortController",
|
|
146
|
+
"limit": 2
|
|
147
|
+
},
|
|
148
|
+
"expect": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"properties": {
|
|
151
|
+
"success": {
|
|
152
|
+
"const": true
|
|
153
|
+
},
|
|
154
|
+
"query": {
|
|
155
|
+
"const": "AbortController"
|
|
156
|
+
},
|
|
157
|
+
"documents": {
|
|
158
|
+
"type": "array",
|
|
159
|
+
"minItems": 1
|
|
160
|
+
},
|
|
161
|
+
"sources": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"required": ["api", "page"]
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"required": ["success", "query", "documents", "sources"]
|
|
167
|
+
},
|
|
168
|
+
"observe": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"pattern": "AbortController"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|