@deeeed/metamask-harness 0.9.1 → 0.11.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 (31) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/adapters/mobile/bridge-runtime/lib/target-discovery.cjs +24 -16
  3. package/adapters/mobile/start-metro.sh +80 -36
  4. package/adapters/mobile/wait-for-bridge.sh +15 -1
  5. package/dist/adapters/extension/runtime.js +2 -3
  6. package/dist/adapters.js +41 -18
  7. package/dist/app-lifecycle.js +72 -0
  8. package/dist/cli-commands.js +1 -1
  9. package/dist/commands/device-target.js +39 -9
  10. package/dist/commands/fixtures.js +13 -1
  11. package/dist/commands/launch/index.js +35 -7
  12. package/dist/commands/run-engine.js +40 -12
  13. package/dist/commands/run.js +1 -2
  14. package/dist/live-adapter-contract.js +2 -3
  15. package/dist/mm-harness-cli.js +1 -0
  16. package/dist/paths.js +8 -1
  17. package/dist/runner.js +10 -4
  18. package/docs/CLI-SPEC.md +2 -1
  19. package/docs/recipe-libraries.md +203 -0
  20. package/library/actions/mobile/platform/bridge.mjs +91 -4
  21. package/library/actions/mobile/wallet/ensure_unlocked.mjs +69 -32
  22. package/library/actions/mobile/wallet/read_state.mjs +3 -24
  23. package/library/actions/mobile/wallet/setup.mjs +9 -27
  24. package/library/manifests/extension.action-manifest.json +13 -0
  25. package/library/manifests/mobile.action-manifest.json +31 -0
  26. package/library/recipes/app-lifecycle-android-smoke.mobile.recipe.json +87 -0
  27. package/library/recipes/perps-performance-background-resume.mobile.recipe.json +72 -0
  28. package/library/recipes/perps-performance-cold-start.mobile.recipe.json +72 -0
  29. package/library/recipes/perps-performance-warm-start.mobile.recipe.json +64 -0
  30. package/library/recipes/perps-performance.mobile.recipe.json +56 -0
  31. package/package.json +2 -2
@@ -0,0 +1,56 @@
1
+ {
2
+ "schema_version": 1,
3
+ "title": "MetaMask Mobile Perps performance flow",
4
+ "description": "Canonical measured flow for MetaMask Mobile Perps: setup unlocks the wallet, startState records the stable status, then the measured workflow opens the Perps market list, reads live state, and opens a market detail. Timings live in trace.json as each node's duration; there is no built-in benchmark verb. Run pinned so numbers are comparable: `mm-harness run perps-performance --device <serial> --heal off`. Optional testnet order placement is intentionally omitted because a live order would make the flow destructive and non-repeatable; add metamask.perps.place_order + close in a personal copy when you want to measure the trade path.",
5
+ "startState": {
6
+ "action": "app.status",
7
+ "intent": "Record the stable run start status after wallet setup",
8
+ "detail": "Read-only start-state marker so every trace states the adapter, checkout shape, and runner compatibility before measured Perps actions."
9
+ },
10
+ "validate": {
11
+ "workflow": {
12
+ "setup": [
13
+ {
14
+ "id": "ensure-unlocked",
15
+ "action": "metamask.wallet.ensure_unlocked",
16
+ "intent": "Unlock the wallet before timing the Perps journey",
17
+ "detail": "Unlock only if the app is currently locked so the first measured node starts from a stable, signed-in state."
18
+ }
19
+ ],
20
+ "entry": "open-perps-list",
21
+ "nodes": {
22
+ "open-perps-list": {
23
+ "action": "ui.navigate",
24
+ "page": "perps",
25
+ "intent": "Open the Perps market list screen",
26
+ "detail": "Navigate to the Perps markets list via the stable page alias; its node duration measures market-list render time.",
27
+ "flow": "perps",
28
+ "next": "read-positions"
29
+ },
30
+ "read-positions": {
31
+ "action": "metamask.perps.read_positions",
32
+ "intent": "Read the live Perps positions shown on the market list",
33
+ "detail": "Read live Perps positions through the controller; its node duration measures how long live account state takes to resolve. Mobile has no read_markets action, so read_positions is the canonical read of on-screen live state.",
34
+ "flow": "perps",
35
+ "next": "open-market-detail"
36
+ },
37
+ "open-market-detail": {
38
+ "action": "ui.navigate",
39
+ "page": "perps-market",
40
+ "market": "BTC",
41
+ "intent": "Open the BTC Perps market detail screen",
42
+ "detail": "Navigate to the BTC market detail via the stable page alias; its node duration measures market-detail render time.",
43
+ "flow": "perps",
44
+ "next": "end"
45
+ },
46
+ "end": {
47
+ "action": "end",
48
+ "status": "pass",
49
+ "intent": "Finish the measured Perps performance flow",
50
+ "detail": "Terminal node; the passing run's trace.json holds the setup, startState, and measured per-node durations to diff across runs.",
51
+ "flow": "complete"
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeeed/metamask-harness",
3
- "version": "0.9.1",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mm-harness": "bin/mm-harness"
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@farmslot/agent-runtime": "^0.1.0",
20
20
  "@farmslot/protocol": "^0.7.3",
21
- "@farmslot/recipe-harness": "^0.3.3",
21
+ "@farmslot/recipe-harness": "^0.4.0",
22
22
  "commander": "^12.0.0",
23
23
  "viem": "^2.54.3"
24
24
  },