@deeeed/metamask-harness 0.89.0 → 0.91.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 (35) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/adapters/mobile/reload-app.mjs +10 -0
  3. package/dist/adapters/extension/reload.js +3 -3
  4. package/dist/adapters/extension/run.js +1 -6
  5. package/dist/adapters/mobile/android-screenrecord.js +28 -58
  6. package/dist/adapters/mobile/devices.js +2 -1
  7. package/dist/adapters/mobile/reload.js +3 -3
  8. package/dist/adapters/mobile/run.js +2 -3
  9. package/dist/checkout-view.js +10 -3
  10. package/dist/command-contract.js +2 -0
  11. package/dist/commands/check.js +18 -20
  12. package/dist/commands/device-target.js +1 -1
  13. package/dist/commands/doctor.js +31 -27
  14. package/dist/commands/logs.js +13 -30
  15. package/dist/doctor.js +26 -85
  16. package/dist/mm-harness-cli.js +1 -7
  17. package/dist/provider-doctor.js +36 -0
  18. package/dist/provider-lifecycle.js +26 -0
  19. package/dist/provider-logs.js +31 -0
  20. package/dist/provider.js +6 -1
  21. package/dist/runner.js +1 -0
  22. package/library/actions/core/perps/_controller.mjs +1 -19
  23. package/library/actions/extension/perps/perps.mjs +1 -11
  24. package/library/actions/extension/platform/cdp.mjs +3 -19
  25. package/library/actions/extension/ui/navigate.mjs +27 -2
  26. package/library/actions/mobile/perps/perps.mjs +1 -7
  27. package/library/actions/mobile/platform/observe-ui.mjs +45 -15
  28. package/library/actions/shared/perps/item-side.mjs +18 -0
  29. package/library/manifests/core.action-manifest.json +6 -1
  30. package/library/manifests/extension.action-manifest.json +8 -2
  31. package/library/manifests/mobile.action-manifest.json +13 -3
  32. package/library/manifests/web-dapp.action-manifest.json +38 -0
  33. package/library/recipes/extension/performance/navigation-memory-suite.recipe.json +30 -8
  34. package/library/recipes/extension/performance/navigation-memory.recipe.json +23 -1
  35. package/package.json +9 -9
@@ -0,0 +1,18 @@
1
+ // Normalize explicit order sides and the signed sizes returned for Perps positions.
2
+ export function normalizeSide(rawSide) {
3
+ const side = String(rawSide ?? '').toLowerCase();
4
+ if (side === 'buy' || side === 'b') return 'long';
5
+ if (side === 'sell' || side === 'a' || side === 's') return 'short';
6
+ return side;
7
+ }
8
+
9
+ export function sideForItem(item, itemType) {
10
+ if (itemType !== 'position') {
11
+ const side = normalizeSide(item?.side ?? item?.direction);
12
+ if (side || itemType !== undefined) return side;
13
+ }
14
+ const rawSize = item?.size ?? item?.szi;
15
+ if (typeof rawSize !== 'string' && typeof rawSize !== 'number') return '';
16
+ const size = Number(rawSize);
17
+ return Number.isFinite(size) && size !== 0 ? (size > 0 ? 'long' : 'short') : '';
18
+ }
@@ -362,7 +362,7 @@
362
362
  }
363
363
  },
364
364
  "watch_logs": {
365
- "description": "Base log assertion/capture action.",
365
+ "description": "Observe log text immediately or within a declared timeout_ms window.",
366
366
  "examples": [
367
367
  {
368
368
  "action": "watch_logs",
@@ -386,6 +386,11 @@
386
386
  "run",
387
387
  "file"
388
388
  ]
389
+ },
390
+ "timeout_ms": {
391
+ "type": "integer",
392
+ "minimum": 0,
393
+ "description": "Observation window from 0 through 60000 ms; a positive window requires nonempty contains."
389
394
  }
390
395
  },
391
396
  "required": [
@@ -342,7 +342,7 @@
342
342
  }
343
343
  },
344
344
  "watch_logs": {
345
- "description": "Base log assertion/capture action.",
345
+ "description": "Observe log text immediately or within a declared timeout_ms window.",
346
346
  "examples": [
347
347
  {
348
348
  "action": "watch_logs",
@@ -366,6 +366,11 @@
366
366
  "run",
367
367
  "file"
368
368
  ]
369
+ },
370
+ "timeout_ms": {
371
+ "type": "integer",
372
+ "minimum": 0,
373
+ "description": "Observation window from 0 through 60000 ms; a positive window requires nonempty contains."
369
374
  }
370
375
  },
371
376
  "required": [
@@ -509,7 +514,8 @@
509
514
  "perps-market-list",
510
515
  "perps-market",
511
516
  "perps-activity",
512
- "swap"
517
+ "swap",
518
+ "settings"
513
519
  ]
514
520
  },
515
521
  "market": {
@@ -345,7 +345,7 @@
345
345
  }
346
346
  },
347
347
  "watch_logs": {
348
- "description": "Base log assertion/capture action.",
348
+ "description": "Observe log text immediately or within a declared timeout_ms window.",
349
349
  "examples": [
350
350
  {
351
351
  "action": "watch_logs",
@@ -365,10 +365,20 @@
365
365
  },
366
366
  "scope": {
367
367
  "type": "string",
368
- "enum": ["run", "file"]
368
+ "enum": [
369
+ "run",
370
+ "file"
371
+ ]
372
+ },
373
+ "timeout_ms": {
374
+ "type": "integer",
375
+ "minimum": 0,
376
+ "description": "Observation window from 0 through 60000 ms; a positive window requires nonempty contains."
369
377
  }
370
378
  },
371
- "required": ["path"],
379
+ "required": [
380
+ "path"
381
+ ],
372
382
  "additionalProperties": false
373
383
  }
374
384
  },
@@ -1097,6 +1097,44 @@
1097
1097
  },
1098
1098
  "additionalProperties": false
1099
1099
  }
1100
+ },
1101
+ "watch_logs": {
1102
+ "description": "Observe log text immediately or within a declared timeout_ms window.",
1103
+ "examples": [
1104
+ {
1105
+ "action": "watch_logs",
1106
+ "path": "logs/app.log",
1107
+ "intent": "Observe the runtime behavior needed for this proof.",
1108
+ "next": "done"
1109
+ }
1110
+ ],
1111
+ "schema": {
1112
+ "type": "object",
1113
+ "properties": {
1114
+ "path": {
1115
+ "type": "string"
1116
+ },
1117
+ "contains": {
1118
+ "type": "string"
1119
+ },
1120
+ "scope": {
1121
+ "type": "string",
1122
+ "enum": [
1123
+ "run",
1124
+ "file"
1125
+ ]
1126
+ },
1127
+ "timeout_ms": {
1128
+ "type": "integer",
1129
+ "minimum": 0,
1130
+ "description": "Observation window from 0 through 60000 ms; a positive window requires nonempty contains."
1131
+ }
1132
+ },
1133
+ "required": [
1134
+ "path"
1135
+ ],
1136
+ "additionalProperties": false
1137
+ }
1100
1138
  }
1101
1139
  }
1102
1140
  }
@@ -184,10 +184,7 @@
184
184
  "timeout_ms": 400000,
185
185
  "max_detached_growth": 50,
186
186
  "intent": "Compare retained detached DOM before and after market-detail navigation churn.",
187
- "proves": [
188
- "detached-dom"
189
- ],
190
- "next": "idle-control-market-detail"
187
+ "next": "assert-detached"
191
188
  },
192
189
  "idle-control-market-detail": {
193
190
  "action": "metamask.performance.compare_idle_navigation_memory",
@@ -199,10 +196,7 @@
199
196
  "timeout_ms": 400000,
200
197
  "max_attributable_listeners_per_cycle": 2,
201
198
  "intent": "Subtract equal-duration idle growth from the market-detail navigation slope.",
202
- "proves": [
203
- "idle-control"
204
- ],
205
- "next": "return-home"
199
+ "next": "assert-idle-control"
206
200
  },
207
201
  "return-home": {
208
202
  "action": "ui.navigate",
@@ -213,6 +207,34 @@
213
207
  "done": {
214
208
  "action": "end",
215
209
  "status": "pass"
210
+ },
211
+ "assert-detached": {
212
+ "action": "assert_output",
213
+ "source": "detached-market-detail",
214
+ "assert": {
215
+ "path": "$.passed",
216
+ "operator": "eq",
217
+ "value": true
218
+ },
219
+ "proves": [
220
+ "detached-dom"
221
+ ],
222
+ "intent": "Verify the observed detached-DOM growth stays within its bound",
223
+ "next": "idle-control-market-detail"
224
+ },
225
+ "assert-idle-control": {
226
+ "action": "assert_output",
227
+ "source": "idle-control-market-detail",
228
+ "assert": {
229
+ "path": "$.passed",
230
+ "operator": "eq",
231
+ "value": true
232
+ },
233
+ "proves": [
234
+ "idle-control"
235
+ ],
236
+ "intent": "Verify the observed navigation-attributable growth stays within its bound",
237
+ "next": "return-home"
216
238
  }
217
239
  }
218
240
  }
@@ -69,11 +69,33 @@
69
69
  "screen_timeout_ms": "{{params.screen_timeout_ms}}",
70
70
  "timeout_ms": "{{params.timeout_ms}}",
71
71
  "intent": "Measure post-GC retained-node and listener slopes for the requested screen",
72
- "next": "done"
72
+ "next": "assert-node-bound"
73
73
  },
74
74
  "done": {
75
75
  "action": "end",
76
76
  "status": "pass"
77
+ },
78
+ "assert-node-bound": {
79
+ "action": "assert_output",
80
+ "source": "measure",
81
+ "assert": {
82
+ "path": "$.passed.nodes",
83
+ "operator": "eq",
84
+ "value": true
85
+ },
86
+ "intent": "Verify the observed retained-node slope satisfies its declared bound",
87
+ "next": "assert-listener-bound"
88
+ },
89
+ "assert-listener-bound": {
90
+ "action": "assert_output",
91
+ "source": "measure",
92
+ "assert": {
93
+ "path": "$.passed.listeners",
94
+ "operator": "eq",
95
+ "value": true
96
+ },
97
+ "intent": "Verify the observed listener slope satisfies its declared bound",
98
+ "next": "done"
77
99
  }
78
100
  }
79
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeeed/metamask-harness",
3
- "version": "0.89.0",
3
+ "version": "0.91.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mm-harness": "bin/mm-harness"
@@ -21,15 +21,15 @@
21
21
  "check:syntax": "find . -name '*.mjs' -print0 | xargs -0 -n1 node --check"
22
22
  },
23
23
  "dependencies": {
24
- "@farmslot/adapter-node": "0.1.12",
25
- "@farmslot/adapter-rn": "0.19.10",
26
- "@farmslot/adapter-sdk": "0.8.6",
27
- "@farmslot/adapter-web": "0.6.10",
28
- "@farmslot/agent-runtime": "0.17.5",
24
+ "@farmslot/adapter-node": "0.1.14",
25
+ "@farmslot/adapter-rn": "0.20.1",
26
+ "@farmslot/adapter-sdk": "0.9.1",
27
+ "@farmslot/adapter-web": "0.7.1",
28
+ "@farmslot/agent-runtime": "0.18.1",
29
29
  "@farmslot/handoff": "^0.3.1",
30
- "@farmslot/protocol": "0.37.0",
31
- "@farmslot/recipe-cli": "0.13.0",
32
- "@farmslot/recipe-runner": "0.29.0",
30
+ "@farmslot/protocol": "0.40.0",
31
+ "@farmslot/recipe-cli": "0.14.2",
32
+ "@farmslot/recipe-runner": "0.31.0",
33
33
  "agent-device": "0.19.3",
34
34
  "commander": "^12.0.0",
35
35
  "esbuild": "0.28.1",