personal-agent-benchmark 0.0.0-stage → 0.2.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 (81) hide show
  1. package/README.md +128 -2
  2. package/bin/pab.js +5 -0
  3. package/dist/src/browser.d.ts +29 -0
  4. package/dist/src/browser.js +37 -0
  5. package/dist/src/browser.js.map +1 -0
  6. package/dist/src/cli.d.ts +20 -0
  7. package/dist/src/cli.js +331 -0
  8. package/dist/src/cli.js.map +1 -0
  9. package/dist/src/core/archive.d.ts +49 -0
  10. package/dist/src/core/archive.js +213 -0
  11. package/dist/src/core/archive.js.map +1 -0
  12. package/dist/src/core/audit.d.ts +15 -0
  13. package/dist/src/core/audit.js +85 -0
  14. package/dist/src/core/audit.js.map +1 -0
  15. package/dist/src/core/bundle.d.ts +42 -0
  16. package/dist/src/core/bundle.js +80 -0
  17. package/dist/src/core/bundle.js.map +1 -0
  18. package/dist/src/core/lookup.d.ts +15 -0
  19. package/dist/src/core/lookup.js +82 -0
  20. package/dist/src/core/lookup.js.map +1 -0
  21. package/dist/src/core/normalize.d.ts +45 -0
  22. package/dist/src/core/normalize.js +143 -0
  23. package/dist/src/core/normalize.js.map +1 -0
  24. package/dist/src/core/rules.d.ts +38 -0
  25. package/dist/src/core/rules.js +187 -0
  26. package/dist/src/core/rules.js.map +1 -0
  27. package/dist/src/core/store.d.ts +26 -0
  28. package/dist/src/core/store.js +78 -0
  29. package/dist/src/core/store.js.map +1 -0
  30. package/dist/src/core/types.d.ts +125 -0
  31. package/dist/src/core/types.js +3 -0
  32. package/dist/src/core/types.js.map +1 -0
  33. package/dist/src/core/util.d.ts +21 -0
  34. package/dist/src/core/util.js +150 -0
  35. package/dist/src/core/util.js.map +1 -0
  36. package/dist/src/core/warc.d.ts +55 -0
  37. package/dist/src/core/warc.js +258 -0
  38. package/dist/src/core/warc.js.map +1 -0
  39. package/dist/src/core/writer.d.ts +26 -0
  40. package/dist/src/core/writer.js +119 -0
  41. package/dist/src/core/writer.js.map +1 -0
  42. package/dist/src/grading.d.ts +63 -0
  43. package/dist/src/grading.js +173 -0
  44. package/dist/src/grading.js.map +1 -0
  45. package/dist/src/judge.d.ts +25 -0
  46. package/dist/src/judge.js +119 -0
  47. package/dist/src/judge.js.map +1 -0
  48. package/dist/src/paths.d.ts +2 -0
  49. package/dist/src/paths.js +40 -0
  50. package/dist/src/paths.js.map +1 -0
  51. package/dist/src/replay/clock.d.ts +19 -0
  52. package/dist/src/replay/clock.js +60 -0
  53. package/dist/src/replay/clock.js.map +1 -0
  54. package/dist/src/replay/engine.d.ts +53 -0
  55. package/dist/src/replay/engine.js +280 -0
  56. package/dist/src/replay/engine.js.map +1 -0
  57. package/dist/src/replay/launcher.d.ts +36 -0
  58. package/dist/src/replay/launcher.js +163 -0
  59. package/dist/src/replay/launcher.js.map +1 -0
  60. package/dist/src/replay/whistle-plugin.d.ts +24 -0
  61. package/dist/src/replay/whistle-plugin.js +82 -0
  62. package/dist/src/replay/whistle-plugin.js.map +1 -0
  63. package/dist/src/report.d.ts +3 -0
  64. package/dist/src/report.js +143 -0
  65. package/dist/src/report.js.map +1 -0
  66. package/dist/src/scoring.d.ts +87 -0
  67. package/dist/src/scoring.js +232 -0
  68. package/dist/src/scoring.js.map +1 -0
  69. package/dist/src/tasks.d.ts +61 -0
  70. package/dist/src/tasks.js +152 -0
  71. package/dist/src/tasks.js.map +1 -0
  72. package/docs/bundle-format.md +114 -0
  73. package/docs/deploy.md +78 -0
  74. package/docs/grading.md +81 -0
  75. package/docs/site-rules.md +114 -0
  76. package/docs/tasks.md +63 -0
  77. package/package.json +121 -4
  78. package/plugins/whistle.bench-replay/index.js +1 -0
  79. package/plugins/whistle.bench-replay/package.json +7 -0
  80. package/sites/_default.yaml +80 -0
  81. package/sites/amazon.com.yaml +125 -0
package/package.json CHANGED
@@ -1,6 +1,123 @@
1
1
  {
2
2
  "name": "personal-agent-benchmark",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "A real-world benchmark for personal agents: tasks on real sites, replayed offline from network recordings.",
5
+ "license": "UNLICENSED",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/maxgent-ai/Personal-Agent-Benchmark.git"
9
+ },
10
+ "homepage": "https://github.com/maxgent-ai/Personal-Agent-Benchmark#readme",
11
+ "bugs": "https://github.com/maxgent-ai/Personal-Agent-Benchmark/issues",
12
+ "bin": {
13
+ "pab": "bin/pab.js"
14
+ },
15
+ "exports": {
16
+ "./package.json": "./package.json",
17
+ "./browser": {
18
+ "types": "./dist/src/browser.d.ts",
19
+ "default": "./dist/src/browser.js"
20
+ },
21
+ "./cli": {
22
+ "types": "./dist/src/cli.d.ts",
23
+ "default": "./dist/src/cli.js"
24
+ },
25
+ "./grading": {
26
+ "types": "./dist/src/grading.d.ts",
27
+ "default": "./dist/src/grading.js"
28
+ },
29
+ "./judge": {
30
+ "types": "./dist/src/judge.d.ts",
31
+ "default": "./dist/src/judge.js"
32
+ },
33
+ "./scoring": {
34
+ "types": "./dist/src/scoring.d.ts",
35
+ "default": "./dist/src/scoring.js"
36
+ },
37
+ "./tasks": {
38
+ "types": "./dist/src/tasks.d.ts",
39
+ "default": "./dist/src/tasks.js"
40
+ },
41
+ "./replay/engine": {
42
+ "types": "./dist/src/replay/engine.d.ts",
43
+ "default": "./dist/src/replay/engine.js"
44
+ },
45
+ "./replay/launcher": {
46
+ "types": "./dist/src/replay/launcher.d.ts",
47
+ "default": "./dist/src/replay/launcher.js"
48
+ },
49
+ "./core/archive": {
50
+ "types": "./dist/src/core/archive.d.ts",
51
+ "default": "./dist/src/core/archive.js"
52
+ },
53
+ "./core/audit": {
54
+ "types": "./dist/src/core/audit.d.ts",
55
+ "default": "./dist/src/core/audit.js"
56
+ },
57
+ "./core/bundle": {
58
+ "types": "./dist/src/core/bundle.d.ts",
59
+ "default": "./dist/src/core/bundle.js"
60
+ },
61
+ "./core/lookup": {
62
+ "types": "./dist/src/core/lookup.d.ts",
63
+ "default": "./dist/src/core/lookup.js"
64
+ },
65
+ "./core/normalize": {
66
+ "types": "./dist/src/core/normalize.d.ts",
67
+ "default": "./dist/src/core/normalize.js"
68
+ },
69
+ "./core/rules": {
70
+ "types": "./dist/src/core/rules.d.ts",
71
+ "default": "./dist/src/core/rules.js"
72
+ },
73
+ "./core/store": {
74
+ "types": "./dist/src/core/store.d.ts",
75
+ "default": "./dist/src/core/store.js"
76
+ },
77
+ "./core/types": {
78
+ "types": "./dist/src/core/types.d.ts",
79
+ "default": "./dist/src/core/types.js"
80
+ },
81
+ "./core/util": {
82
+ "types": "./dist/src/core/util.d.ts",
83
+ "default": "./dist/src/core/util.js"
84
+ },
85
+ "./core/warc": {
86
+ "types": "./dist/src/core/warc.d.ts",
87
+ "default": "./dist/src/core/warc.js"
88
+ },
89
+ "./core/writer": {
90
+ "types": "./dist/src/core/writer.d.ts",
91
+ "default": "./dist/src/core/writer.js"
92
+ }
93
+ },
94
+ "files": [
95
+ "bin",
96
+ "dist/src",
97
+ "docs",
98
+ "plugins",
99
+ "sites"
100
+ ],
101
+ "scripts": {
102
+ "build": "rm -rf dist && tsc -p tsconfig.json",
103
+ "prepare": "npm run build",
104
+ "test": "npm run build && node --test \"dist/test/**/*.test.js\"",
105
+ "pab": "node bin/pab.js"
106
+ },
107
+ "engines": {
108
+ "node": ">=22"
109
+ },
110
+ "dependencies": {
111
+ "@anthropic-ai/sdk": "^1.3.0",
112
+ "cheerio": "^1.2.0",
113
+ "playwright-core": "^1.64.1",
114
+ "tar": "^7.5.22",
115
+ "warcio": "^2.4.12",
116
+ "whistle": "^2.10.12",
117
+ "yaml": "^2.9.1"
118
+ },
119
+ "devDependencies": {
120
+ "@types/node": "^26.6.5",
121
+ "typescript": "^7.0.2"
122
+ }
123
+ }
@@ -0,0 +1 @@
1
+ module.exports = require('../../dist/src/replay/whistle-plugin.js');
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "whistle.bench-replay",
3
+ "version": "0.1.0",
4
+ "description": "Replays a Personal Agent Benchmark recording; never forwards requests to the network",
5
+ "main": "index.js",
6
+ "whistleConfig": {}
7
+ }
@@ -0,0 +1,80 @@
1
+ # Rules applied to every site. Site files add to these lists.
2
+ site: _default
3
+ hosts: []
4
+ drop_params:
5
+ - _
6
+ - cb
7
+ - cachebuster
8
+ - rnd
9
+ - random
10
+ - nocache
11
+ - t
12
+ - ts
13
+ - timestamp
14
+ - utm_*
15
+ - fbclid
16
+ - gclid
17
+ - msclkid
18
+ - "*session*"
19
+ body_drop:
20
+ - csrf*
21
+ - "*csrf*"
22
+ - "*token*"
23
+ - nonce
24
+ - timestamp
25
+ - requestId
26
+ - request_id
27
+ - "*session*"
28
+ exclude:
29
+ - "*/errors/validateCaptcha*"
30
+ # Pages that show what was done before them (cart, checkout): replay answers them with the last
31
+ # recording, which is where the task left them, instead of the first.
32
+ latest:
33
+ - "*/cart*"
34
+ - "*/basket*"
35
+ - "*/bag"
36
+ - "*/bag/*"
37
+ - "*/trolley*"
38
+ - "*/checkout*"
39
+ block:
40
+ - "*.google-analytics.com"
41
+ - "*.googletagmanager.com"
42
+ - "*.doubleclick.net"
43
+ - "*.googlesyndication.com"
44
+ - "*.facebook.net"
45
+ - "*.facebook.com"
46
+ - "*.hotjar.com"
47
+ - "*.scorecardresearch.com"
48
+ - "*.adsrvr.org"
49
+ - "*.criteo.com"
50
+ - "*.criteo.net"
51
+ - "*.bing.com"
52
+ - "*.clarity.ms"
53
+ # ad-tech cookie syncing and impression pixels
54
+ - "*.agkn.com"
55
+ - "*.zeotap.com"
56
+ - "*.samplicio.us"
57
+ - "*.samba.tv"
58
+ - "*.mookie1.com"
59
+ - "*.pubmatic.com"
60
+ - "*.smartadserver.com"
61
+ - "*.fwmrm.net"
62
+ - "*.mediarithmics.com"
63
+ - "*.adnxs.com"
64
+ - "*.rubiconproject.com"
65
+ - "*.openx.net"
66
+ - "*.casalemedia.com"
67
+ - "*.bidswitch.net"
68
+ - "*.3lift.com"
69
+ - "*.rlcdn.com"
70
+ - "*.demdex.net"
71
+ # Chrome's own background services, not page traffic
72
+ - "content-autofill.googleapis.com"
73
+ - "update.googleapis.com"
74
+ - "optimizationguide-pa.googleapis.com"
75
+ - "safebrowsing.googleapis.com"
76
+ - "android.clients.google.com"
77
+ - "clients2.google.com"
78
+ - "accounts.google.com/ListAccounts*"
79
+ - "www.gstatic.com/ohttp_gateway/**"
80
+ - "www.google.com/async/folae*"
@@ -0,0 +1,125 @@
1
+ # Amazon (US).
2
+ site: amazon
3
+ hosts:
4
+ - "amazon.com"
5
+ - "*.amazon.com"
6
+ - "*.media-amazon.com"
7
+ - "*.ssl-images-amazon.com"
8
+ - "*.amazon-adsystem.com"
9
+ drop_params:
10
+ - ref
11
+ - ref_
12
+ - qid
13
+ - sr
14
+ - crid
15
+ - sprefix
16
+ - pd_rd_*
17
+ - pf_rd_*
18
+ - content-id
19
+ - _encoding
20
+ - dib
21
+ - dib_tag
22
+ - hv*
23
+ - tag
24
+ - linkCode
25
+ - sp_csd
26
+ - spIA
27
+ - spLa
28
+ - sbo
29
+ - cv_ct_cx
30
+ - __mk_*
31
+ - rnid
32
+ - smid
33
+ - th
34
+ - psc
35
+ - showmri
36
+ - rshVal
37
+ - stamp
38
+ - request-id
39
+ exclude:
40
+ - "www.amazon.com/checkpoint/**"
41
+ - "www.amazon.com/errors/validateCaptcha*"
42
+ block:
43
+ - "*.amazon-adsystem.com"
44
+ - "fls-na.amazon.com"
45
+ - "unagi.amazon.com"
46
+ - "unagi-na.amazon.com"
47
+ - "www.amazon.com/1/batch/**"
48
+ - "www.amazon.com/uedata*"
49
+ - "www.amazon.com/rd/uedata*"
50
+ - "www.amazon.com/empty.gif*"
51
+ - "*.amazon.com/csm/**"
52
+ - "www.amazon.com/af/feedback-link*"
53
+ - "aax-*.amazon.com"
54
+ - "sponsored-ads.amazon.com"
55
+ - "www.amazon.com/rd/uedata*"
56
+ endpoints:
57
+ # A product page is determined by its ASIN; title slugs, ref and tracking parameters vary.
58
+ - name: product
59
+ match: "GET /*/dp/{asin}/**"
60
+ key: "/dp/{asin}"
61
+ keep_params: []
62
+ - name: product_dp
63
+ match: "GET /dp/{asin}/**"
64
+ key: "/dp/{asin}"
65
+ keep_params: []
66
+ - name: product_gp
67
+ match: "GET /gp/product/{asin}/**"
68
+ key: "/dp/{asin}"
69
+ keep_params: []
70
+ - name: search
71
+ match: "GET /s"
72
+ host: "www.amazon.com"
73
+ keep_params: [k, i, page, rh, s]
74
+ kind: search
75
+ text_param: k
76
+ - name: search_legacy # the header search form posts to /s/ref=...?field-keywords=
77
+ match: "GET /s/**"
78
+ host: "www.amazon.com"
79
+ key: "/s"
80
+ keep_params: [field-keywords, page]
81
+ kind: search
82
+ text_param: field-keywords
83
+ - name: suggestions
84
+ match: "GET /api/2017/suggestions"
85
+ host: "completion.amazon.com"
86
+ keep_params: [prefix, mid, alias]
87
+ kind: search
88
+ text_param: prefix
89
+ similarity: 0.3
90
+ - name: suggestions_www
91
+ match: "GET /suggestions"
92
+ host: "www.amazon.com"
93
+ keep_params: [prefix, alias]
94
+ kind: search
95
+ text_param: prefix
96
+ similarity: 0.3
97
+ # Cart: only what was done while recording replays; another item or quantity misses. Cart
98
+ # pages answer with their last recording (latest in _default.yaml).
99
+ - name: add_to_cart
100
+ match: "POST /cart/add-to-cart/**"
101
+ kind: stateful
102
+ body_keep: [ASIN, quantity]
103
+ - name: cart_update_quantity
104
+ match: "POST /cart/ref=ox_sc_update_quantity*"
105
+ kind: stateful
106
+ body_keep: [asin, actionType]
107
+ # Page components fetched by JS. Bodies carry the session id from cookies, which the
108
+ # bundle stores redacted, so match on the fields that select the content.
109
+ - name: cross_border_interstitial
110
+ match: "POST /cross_border_interstitial_sp/render"
111
+ body_keep: [url, pageType]
112
+ # page-type is filled in by page script and reads "undefined" when a component loads before
113
+ # the page has set it, so the same request is recorded with "undefined" and replayed with
114
+ # "Detail"; the component path and body decide the content.
115
+ - name: ajax_components
116
+ match: "POST /acp/**"
117
+ drop_params: [page-type]
118
+ fuzzy: true
119
+ - name: video_player
120
+ match: "POST /vap/**"
121
+ fuzzy: true
122
+ - name: search_pagination
123
+ match: "POST /s/query"
124
+ keep_params: [k, page]
125
+ fuzzy: true