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.
Files changed (45) hide show
  1. package/LICENSE +681 -0
  2. package/README.md +4 -2
  3. package/dist/v5/cli-files.cjs +147 -0
  4. package/dist/v5/cli.cjs +4028 -0
  5. package/dist/v5/extension/assets/popup-Djl4pI1R.css +359 -0
  6. package/dist/v5/extension/background.js +37712 -0
  7. package/dist/v5/extension/browserpaw-build.json +184 -0
  8. package/dist/v5/extension/chunks/popup-DjxqduQH.js +6542 -0
  9. package/dist/v5/extension/content-scripts/agent-cursor.js +1459 -0
  10. package/dist/v5/extension/icon/128.png +0 -0
  11. package/dist/v5/extension/icon/16.png +0 -0
  12. package/dist/v5/extension/icon/32.png +0 -0
  13. package/dist/v5/extension/icon/48.png +0 -0
  14. package/dist/v5/extension/icon/96.png +0 -0
  15. package/dist/v5/extension/images/cursor-chat.png +0 -0
  16. package/dist/v5/extension/inject-scripts/accessibility-tree-helper.js +1883 -0
  17. package/dist/v5/extension/inject-scripts/keyboard-helper.js +402 -0
  18. package/dist/v5/extension/inject-scripts/network-helper.js +213 -0
  19. package/dist/v5/extension/inject-scripts/screenshot-helper.js +408 -0
  20. package/dist/v5/extension/inpage-engine.js +9300 -0
  21. package/dist/v5/extension/manifest.json +1 -0
  22. package/dist/v5/extension/popup.html +14 -0
  23. package/dist/v5/host.cjs +19441 -0
  24. package/dist/v5/recipes/developer.mozilla.org.md +15 -0
  25. package/dist/v5/recipes/github-releases.json +177 -0
  26. package/dist/v5/recipes/mdn-search.json +174 -0
  27. package/dist/v5/recipes/npm-compare.json +456 -0
  28. package/dist/v5/recipes/x-search-thread.json +321 -0
  29. package/dist/v5/recipes/x-visible-thread.json +303 -0
  30. package/dist/v5/run_host.bat +7 -0
  31. package/dist/v5/run_host.sh +6 -0
  32. package/dist/v5/skill/browserpaw/SKILL.md +48 -0
  33. package/dist/v5/skill/browserpaw/assets/recipes/developer.mozilla.org.md +15 -0
  34. package/dist/v5/skill/browserpaw/assets/recipes/github-releases.json +177 -0
  35. package/dist/v5/skill/browserpaw/assets/recipes/mdn-search.json +174 -0
  36. package/dist/v5/skill/browserpaw/assets/recipes/npm-compare.json +456 -0
  37. package/dist/v5/skill/browserpaw/assets/recipes/x-search-thread.json +321 -0
  38. package/dist/v5/skill/browserpaw/assets/recipes/x-visible-thread.json +303 -0
  39. package/dist/v5/skill/browserpaw/references/TROUBLESHOOTING.md +7 -0
  40. package/dist/v5/skill/browserpaw/references/TROUBLESHOOTING.zh-CN.md +5 -0
  41. package/dist/v5/skill/browserpaw/references/browser-data.md +33 -0
  42. package/dist/v5/skill/browserpaw/references/commands.md +103 -0
  43. package/dist/v5/skill/browserpaw/references/debugging.md +32 -0
  44. package/dist/v5/skill/browserpaw/references/recipe-contract.md +46 -0
  45. package/package.json +67 -4
@@ -0,0 +1,456 @@
1
+ {
2
+ "id": "npm-compare",
3
+ "name": "npm package comparison",
4
+ "description": "Compare two npm packages using official registry metadata and last-week download metrics.",
5
+ "source": {
6
+ "type": "builtin",
7
+ "urls": [
8
+ "https://registry.npmjs.org/react/latest",
9
+ "https://api.npmjs.org/downloads/point/last-week/react",
10
+ "https://www.npmjs.com/package/react",
11
+ "https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md",
12
+ "https://github.com/npm/registry/blob/master/docs/download-counts.md"
13
+ ]
14
+ },
15
+ "domains": [
16
+ "registry.npmjs.org",
17
+ "api.npmjs.org"
18
+ ],
19
+ "keywords": [
20
+ "npm",
21
+ "package",
22
+ "compare",
23
+ "version",
24
+ "downloads",
25
+ "capabilities"
26
+ ],
27
+ "startUrl": "https://registry.npmjs.org/{{left}}/latest",
28
+ "inputSchema": {
29
+ "type": "object",
30
+ "properties": {
31
+ "left": {
32
+ "type": "string",
33
+ "pattern": "^(@[a-z0-9][a-z0-9._-]{0,213}/)?[a-z0-9][a-z0-9._-]{0,213}$",
34
+ "maxLength": 214
35
+ },
36
+ "right": {
37
+ "type": "string",
38
+ "pattern": "^(@[a-z0-9][a-z0-9._-]{0,213}/)?[a-z0-9][a-z0-9._-]{0,213}$",
39
+ "maxLength": 214
40
+ }
41
+ },
42
+ "required": [
43
+ "left",
44
+ "right"
45
+ ],
46
+ "additionalProperties": false
47
+ },
48
+ "outputSchema": {
49
+ "type": "object",
50
+ "properties": {
51
+ "success": {
52
+ "const": true
53
+ },
54
+ "status": {
55
+ "const": "ok"
56
+ },
57
+ "left": {
58
+ "$ref": "#/definitions/packageMetric"
59
+ },
60
+ "right": {
61
+ "$ref": "#/definitions/packageMetric"
62
+ },
63
+ "leader": {
64
+ "type": "string",
65
+ "enum": [
66
+ "left",
67
+ "right",
68
+ "tie"
69
+ ]
70
+ },
71
+ "sources": {
72
+ "type": "object",
73
+ "properties": {
74
+ "left": {
75
+ "type": "string",
76
+ "pattern": "^https://api\\.npmjs\\.org/downloads/point/last-week/"
77
+ },
78
+ "right": {
79
+ "type": "string",
80
+ "pattern": "^https://api\\.npmjs\\.org/downloads/point/last-week/"
81
+ },
82
+ "metadata": {
83
+ "type": "object",
84
+ "properties": {
85
+ "left": {
86
+ "type": "string",
87
+ "pattern": "^https://registry\\.npmjs\\.org/"
88
+ },
89
+ "right": {
90
+ "type": "string",
91
+ "pattern": "^https://registry\\.npmjs\\.org/"
92
+ }
93
+ },
94
+ "required": [
95
+ "left",
96
+ "right"
97
+ ],
98
+ "additionalProperties": false
99
+ }
100
+ },
101
+ "required": [
102
+ "left",
103
+ "right",
104
+ "metadata"
105
+ ],
106
+ "additionalProperties": false
107
+ }
108
+ },
109
+ "required": [
110
+ "success",
111
+ "status",
112
+ "left",
113
+ "right",
114
+ "leader",
115
+ "sources"
116
+ ],
117
+ "additionalProperties": false,
118
+ "definitions": {
119
+ "packageMetric": {
120
+ "type": "object",
121
+ "properties": {
122
+ "package": {
123
+ "type": "string",
124
+ "minLength": 1
125
+ },
126
+ "downloads": {
127
+ "type": "integer",
128
+ "minimum": 0
129
+ },
130
+ "latestVersion": {
131
+ "type": "string",
132
+ "minLength": 1
133
+ },
134
+ "description": {
135
+ "type": "string",
136
+ "minLength": 1
137
+ },
138
+ "license": {
139
+ "oneOf": [
140
+ {
141
+ "type": "string"
142
+ },
143
+ {
144
+ "type": "null"
145
+ }
146
+ ]
147
+ },
148
+ "repository": {
149
+ "oneOf": [
150
+ {
151
+ "type": "string",
152
+ "pattern": "^https?://"
153
+ },
154
+ {
155
+ "type": "null"
156
+ }
157
+ ]
158
+ },
159
+ "engines": {
160
+ "type": "object",
161
+ "additionalProperties": {
162
+ "type": "string"
163
+ }
164
+ },
165
+ "start": {
166
+ "type": "string",
167
+ "minLength": 1
168
+ },
169
+ "end": {
170
+ "type": "string",
171
+ "minLength": 1
172
+ },
173
+ "source": {
174
+ "type": "string",
175
+ "pattern": "^https://api\\.npmjs\\.org/downloads/point/last-week/"
176
+ }
177
+ },
178
+ "required": [
179
+ "package",
180
+ "downloads",
181
+ "latestVersion",
182
+ "description",
183
+ "license",
184
+ "repository",
185
+ "engines",
186
+ "start",
187
+ "end",
188
+ "source"
189
+ ],
190
+ "additionalProperties": false
191
+ }
192
+ }
193
+ },
194
+ "steps": [
195
+ {
196
+ "tool": "chrome_javascript",
197
+ "args": {
198
+ "code": "const registryOrigin = 'https://registry.npmjs.org/';\nconst downloadsOrigin = 'https://api.npmjs.org/downloads/point/last-week/';\nconst packagePath = name => encodeURIComponent(name);\nconst loadJson = async (url, label) => {\n let response;\n try {\n response = await fetch(url, { credentials: 'omit', headers: { Accept: 'application/json' } });\n } catch (error) {\n throw new Error(label + ' request failed: ' + String(error && error.message || error));\n }\n if (!response.ok) throw new Error(label + ' failed with status ' + response.status);\n let payload;\n try {\n payload = await response.json();\n } catch (error) {\n throw new Error(label + ' returned invalid JSON: ' + String(error && error.message || error));\n }\n if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {\n throw new Error(label + ' returned invalid data');\n }\n return { payload, source: String(response.url || url) };\n};\nconst repositoryUrl = value => {\n let raw = typeof value === 'string' ? value : value && typeof value.url === 'string' ? value.url : '';\n raw = raw.trim();\n if (!raw) return null;\n raw = raw.replace(/^git\\+/, '').replace(/^git:\\/\\/github\\.com\\//i, 'https://github.com/');\n if (/^github:/i.test(raw)) raw = 'https://github.com/' + raw.slice(7);\n else if (/^[^/:]+\\/[^/]+$/.test(raw)) raw = 'https://github.com/' + raw;\n raw = raw.replace(/\\.git(?:#.*)?$/, '');\n try {\n const url = new URL(raw);\n return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : null;\n } catch {\n return null;\n }\n};\nconst loadPackage = async packageName => {\n const encoded = packagePath(packageName);\n const [metadata, downloads] = await Promise.all([\n loadJson(registryOrigin + encoded + '/latest', 'npm metadata for ' + packageName),\n loadJson(downloadsOrigin + encoded, 'npm downloads for ' + packageName)\n ]);\n const manifest = metadata.payload;\n if (manifest.name !== packageName) {\n throw new Error('npm metadata name mismatch for ' + packageName + ': ' + String(manifest.name));\n }\n const latestVersion = manifest.version;\n if (typeof latestVersion !== 'string' || !latestVersion) {\n throw new Error('npm metadata missing version for ' + packageName);\n }\n const description = typeof manifest.description === 'string' ? manifest.description.trim() : '';\n if (!description) throw new Error('npm metadata missing description for ' + packageName + '@' + latestVersion);\n const rawLicense = manifest.license;\n const license = typeof rawLicense === 'string' && rawLicense.trim()\n ? rawLicense.trim()\n : rawLicense && typeof rawLicense.type === 'string' && rawLicense.type.trim()\n ? rawLicense.type.trim()\n : null;\n const rawEngines = manifest.engines && typeof manifest.engines === 'object' && !Array.isArray(manifest.engines)\n ? manifest.engines\n : {};\n const engines = Object.fromEntries(Object.entries(rawEngines).filter(([, value]) => typeof value === 'string'));\n if (downloads.payload.package !== packageName) {\n throw new Error('npm downloads name mismatch for ' + packageName + ': ' + String(downloads.payload.package));\n }\n const count = Number(downloads.payload.downloads);\n if (!Number.isInteger(count) || count < 0) {\n throw new Error('npm downloads returned an invalid count for ' + packageName);\n }\n const start = String(downloads.payload.start || '');\n const end = String(downloads.payload.end || '');\n if (!start || !end) throw new Error('npm downloads returned an invalid date range for ' + packageName);\n return {\n metric: {\n package: packageName,\n downloads: count,\n latestVersion,\n description,\n license,\n repository: repositoryUrl(manifest.repository),\n engines,\n start,\n end,\n source: downloads.source\n },\n metadataSource: metadata.source\n };\n};\nconst leftName = String(input.left || '').trim();\nconst rightName = String(input.right || '').trim();\ntry {\n const [left, right] = await Promise.all([loadPackage(leftName), loadPackage(rightName)]);\n return {\n success: true,\n status: 'ok',\n left: left.metric,\n right: right.metric,\n leader: left.metric.downloads === right.metric.downloads ? 'tie' : left.metric.downloads > right.metric.downloads ? 'left' : 'right',\n sources: {\n left: left.metric.source,\n right: right.metric.source,\n metadata: { left: left.metadataSource, right: right.metadataSource }\n }\n };\n} catch (error) {\n return { success: false, status: 'api_error', message: String(error && error.message || error), left: leftName, right: rightName };\n}",
199
+ "timeoutMs": 60000
200
+ },
201
+ "resultPath": "/result"
202
+ }
203
+ ],
204
+ "verification": [
205
+ {
206
+ "tool": "chrome_network_request",
207
+ "args": {
208
+ "url": "https://registry.npmjs.org/{{left}}/latest",
209
+ "method": "GET",
210
+ "timeout": 30000
211
+ },
212
+ "resultPath": "/response/body"
213
+ },
214
+ {
215
+ "tool": "chrome_network_request",
216
+ "args": {
217
+ "url": "https://registry.npmjs.org/{{right}}/latest",
218
+ "method": "GET",
219
+ "timeout": 30000
220
+ },
221
+ "resultPath": "/response/body"
222
+ }
223
+ ],
224
+ "tests": [
225
+ {
226
+ "inputs": {
227
+ "left": "react",
228
+ "right": "vue"
229
+ },
230
+ "expect": {
231
+ "type": "object",
232
+ "properties": {
233
+ "success": {
234
+ "const": true
235
+ },
236
+ "left": {
237
+ "type": "object",
238
+ "properties": {
239
+ "package": {
240
+ "const": "react"
241
+ },
242
+ "downloads": {
243
+ "type": "integer",
244
+ "minimum": 0
245
+ },
246
+ "latestVersion": {
247
+ "type": "string",
248
+ "minLength": 1
249
+ },
250
+ "description": {
251
+ "type": "string",
252
+ "minLength": 1
253
+ }
254
+ },
255
+ "required": [
256
+ "package",
257
+ "downloads",
258
+ "latestVersion",
259
+ "description"
260
+ ]
261
+ },
262
+ "right": {
263
+ "type": "object",
264
+ "properties": {
265
+ "package": {
266
+ "const": "vue"
267
+ },
268
+ "downloads": {
269
+ "type": "integer",
270
+ "minimum": 0
271
+ },
272
+ "latestVersion": {
273
+ "type": "string",
274
+ "minLength": 1
275
+ },
276
+ "description": {
277
+ "type": "string",
278
+ "minLength": 1
279
+ }
280
+ },
281
+ "required": [
282
+ "package",
283
+ "downloads",
284
+ "latestVersion",
285
+ "description"
286
+ ]
287
+ }
288
+ },
289
+ "required": [
290
+ "success",
291
+ "left",
292
+ "right"
293
+ ]
294
+ },
295
+ "observe": [
296
+ {
297
+ "type": "object",
298
+ "properties": {
299
+ "name": {
300
+ "const": "react"
301
+ },
302
+ "version": {
303
+ "type": "string",
304
+ "minLength": 1
305
+ },
306
+ "description": {
307
+ "type": "string",
308
+ "minLength": 1
309
+ }
310
+ },
311
+ "required": [
312
+ "name",
313
+ "version",
314
+ "description"
315
+ ]
316
+ },
317
+ {
318
+ "type": "object",
319
+ "properties": {
320
+ "name": {
321
+ "const": "vue"
322
+ },
323
+ "version": {
324
+ "type": "string",
325
+ "minLength": 1
326
+ },
327
+ "description": {
328
+ "type": "string",
329
+ "minLength": 1
330
+ }
331
+ },
332
+ "required": [
333
+ "name",
334
+ "version",
335
+ "description"
336
+ ]
337
+ }
338
+ ]
339
+ },
340
+ {
341
+ "inputs": {
342
+ "left": "express",
343
+ "right": "fastify"
344
+ },
345
+ "expect": {
346
+ "type": "object",
347
+ "properties": {
348
+ "success": {
349
+ "const": true
350
+ },
351
+ "left": {
352
+ "type": "object",
353
+ "properties": {
354
+ "package": {
355
+ "const": "express"
356
+ },
357
+ "downloads": {
358
+ "type": "integer",
359
+ "minimum": 0
360
+ },
361
+ "latestVersion": {
362
+ "type": "string",
363
+ "minLength": 1
364
+ },
365
+ "description": {
366
+ "type": "string",
367
+ "minLength": 1
368
+ }
369
+ },
370
+ "required": [
371
+ "package",
372
+ "downloads",
373
+ "latestVersion",
374
+ "description"
375
+ ]
376
+ },
377
+ "right": {
378
+ "type": "object",
379
+ "properties": {
380
+ "package": {
381
+ "const": "fastify"
382
+ },
383
+ "downloads": {
384
+ "type": "integer",
385
+ "minimum": 0
386
+ },
387
+ "latestVersion": {
388
+ "type": "string",
389
+ "minLength": 1
390
+ },
391
+ "description": {
392
+ "type": "string",
393
+ "minLength": 1
394
+ }
395
+ },
396
+ "required": [
397
+ "package",
398
+ "downloads",
399
+ "latestVersion",
400
+ "description"
401
+ ]
402
+ }
403
+ },
404
+ "required": [
405
+ "success",
406
+ "left",
407
+ "right"
408
+ ]
409
+ },
410
+ "observe": [
411
+ {
412
+ "type": "object",
413
+ "properties": {
414
+ "name": {
415
+ "const": "express"
416
+ },
417
+ "version": {
418
+ "type": "string",
419
+ "minLength": 1
420
+ },
421
+ "description": {
422
+ "type": "string",
423
+ "minLength": 1
424
+ }
425
+ },
426
+ "required": [
427
+ "name",
428
+ "version",
429
+ "description"
430
+ ]
431
+ },
432
+ {
433
+ "type": "object",
434
+ "properties": {
435
+ "name": {
436
+ "const": "fastify"
437
+ },
438
+ "version": {
439
+ "type": "string",
440
+ "minLength": 1
441
+ },
442
+ "description": {
443
+ "type": "string",
444
+ "minLength": 1
445
+ }
446
+ },
447
+ "required": [
448
+ "name",
449
+ "version",
450
+ "description"
451
+ ]
452
+ }
453
+ ]
454
+ }
455
+ ]
456
+ }