@deeeed/metamask-harness 0.10.0 → 0.12.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/CHANGELOG.md +35 -0
- package/adapters/core/cleanup.sh +0 -0
- package/adapters/core/inject.sh +0 -0
- package/adapters/extension/cleanup.mjs +0 -0
- package/adapters/extension/ensure-browser.sh +0 -0
- package/adapters/extension/inject.mjs +0 -0
- package/adapters/extension/launch-browser.cjs +0 -0
- package/adapters/extension/launch.sh +0 -0
- package/adapters/extension/live.sh +0 -0
- package/adapters/extension/readiness.mjs +0 -0
- package/adapters/extension/reattach.sh +0 -0
- package/adapters/extension/refresh-build.sh +0 -0
- package/adapters/extension/seed-fixture.sh +0 -0
- package/adapters/extension/sidepanel-toggle.sh +0 -0
- package/adapters/extension/snapshot-dist.sh +0 -0
- package/adapters/extension/start-watch.sh +0 -0
- package/adapters/extension/verify.sh +0 -0
- package/adapters/extension/wallet-fixture-state.cjs +0 -0
- package/adapters/mobile/bridge-runtime/cdp-bridge.cjs +47 -0
- package/adapters/mobile/bridge-runtime/console-forwarder.cjs +343 -0
- package/adapters/mobile/bridge-runtime/lib/target-discovery.cjs +31 -29
- package/adapters/mobile/bridge-runtime/setup-wallet.sh +0 -0
- package/adapters/mobile/cleanup.sh +4 -0
- package/adapters/mobile/inject.sh +0 -0
- package/adapters/mobile/lib/metro-listener.sh +0 -0
- package/adapters/mobile/lib/tmux-viewer.sh +0 -0
- package/adapters/mobile/open-device.sh +0 -0
- package/adapters/mobile/prewarm-bundle.sh +0 -0
- package/adapters/mobile/start-metro.sh +110 -36
- package/adapters/mobile/stop-metro.sh +21 -0
- package/adapters/mobile/verify.sh +0 -0
- package/adapters/mobile/wait-for-bridge.sh +15 -1
- package/adapters/mobile/yarn-setup.sh +0 -0
- package/adapters/shared/activate-repo-node.sh +0 -0
- package/adapters/shared/activate-repo-ruby.sh +0 -0
- package/adapters/shared/cli-ux.sh +0 -0
- package/adapters/shared/ensure-runner-deps.sh +0 -0
- package/adapters/shared/harness-path.sh +0 -0
- package/adapters/shared/hash-helpers.sh +0 -0
- package/adapters/shared/json-field.sh +0 -0
- package/adapters/shared/open-debug.mjs +5 -0
- package/adapters/shared/open-log-window.sh +0 -0
- package/adapters/shared/reap-checkout-metros.sh +0 -0
- package/adapters/shared/resolve-farmslot-ports.mjs +0 -0
- package/adapters/shared/resolve-farmslot-ports.sh +0 -0
- package/adapters/shared/resolve-slot-ports.mjs +0 -0
- package/adapters/shared/resolve-slot-ports.sh +0 -0
- package/adapters/shared/sync-wallet-fixture.sh +0 -0
- package/adapters/shared/tmux-session.sh +0 -0
- package/dist/adapters.js +49 -19
- package/dist/app-lifecycle.js +72 -0
- package/dist/cli-commands.js +1 -1
- package/dist/commands/device-target.js +35 -9
- package/dist/commands/fixtures.js +13 -1
- package/dist/commands/launch/index.js +35 -7
- package/dist/commands/run-engine.js +1 -0
- package/dist/mm-harness-cli.js +1 -0
- package/dist/paths.js +8 -1
- package/dist/runner.js +10 -4
- package/docs/CLI-SPEC.md +2 -1
- package/docs/recipe-libraries.md +19 -0
- package/library/actions/mobile/platform/bridge.mjs +29 -7
- package/library/actions/mobile/wallet/ensure_unlocked.mjs +66 -8
- package/library/manifests/mobile.action-manifest.json +18 -0
- package/library/recipes/app-lifecycle-android-smoke.mobile.recipe.json +87 -0
- package/library/recipes/perps-performance-background-resume.mobile.recipe.json +72 -0
- package/library/recipes/perps-performance-cold-start.mobile.recipe.json +72 -0
- package/library/recipes/perps-performance-warm-start.mobile.recipe.json +64 -0
- package/library/recipes/perps-performance.mobile.recipe.json +15 -9
- package/package.json +3 -3
- package/scripts/completions.sh +0 -0
- package/scripts/install-completions.sh +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"title": "MetaMask Mobile Perps performance flow - cold process start",
|
|
4
|
+
"description": "Measured Perps flow from a deterministic cold-process start state. Setup force-stops/terminates the installed app, relaunches it through the Expo dev-client deep link without rebuilding, and unlocks if needed. startState records the stable status. The measured workflow is only Perps list -> state -> BTC detail.",
|
|
5
|
+
"startState": {
|
|
6
|
+
"action": "app.status",
|
|
7
|
+
"intent": "Record the stable run start status after cold-start setup",
|
|
8
|
+
"detail": "Read-only start-state marker after lifecycle and wallet setup have completed."
|
|
9
|
+
},
|
|
10
|
+
"validate": {
|
|
11
|
+
"workflow": {
|
|
12
|
+
"setup": [
|
|
13
|
+
{
|
|
14
|
+
"id": "terminate-app",
|
|
15
|
+
"action": "app.lifecycle",
|
|
16
|
+
"command": "terminate",
|
|
17
|
+
"settle_ms": 3000,
|
|
18
|
+
"intent": "Terminate the installed app process before measuring cold start",
|
|
19
|
+
"detail": "Uses adb force-stop on Android or simctl terminate on iOS simulator; it does not uninstall or rebuild."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "launch-app",
|
|
23
|
+
"action": "app.lifecycle",
|
|
24
|
+
"command": "launch",
|
|
25
|
+
"settle_ms": 15000,
|
|
26
|
+
"intent": "Launch the installed app through the Expo dev-client deep link",
|
|
27
|
+
"detail": "Uses the selected device, Metro port, and installed package; it does not rebuild."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "ensure-unlocked",
|
|
31
|
+
"action": "metamask.wallet.ensure_unlocked",
|
|
32
|
+
"intent": "Unlock the wallet before timing the Perps journey",
|
|
33
|
+
"detail": "Unlock only if the app is currently locked so the first measured node starts from a stable, signed-in state."
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"entry": "open-perps-list",
|
|
37
|
+
"nodes": {
|
|
38
|
+
"open-perps-list": {
|
|
39
|
+
"action": "ui.navigate",
|
|
40
|
+
"page": "perps",
|
|
41
|
+
"intent": "Open the Perps market list screen",
|
|
42
|
+
"detail": "Navigate to the Perps markets list via the stable page alias; its node duration measures market-list render time.",
|
|
43
|
+
"flow": "perps",
|
|
44
|
+
"next": "read-positions"
|
|
45
|
+
},
|
|
46
|
+
"read-positions": {
|
|
47
|
+
"action": "metamask.perps.read_positions",
|
|
48
|
+
"intent": "Read the live Perps positions shown on the market list",
|
|
49
|
+
"detail": "Read live Perps positions through the controller; its node duration measures how long live account state takes to resolve.",
|
|
50
|
+
"flow": "perps",
|
|
51
|
+
"next": "open-market-detail"
|
|
52
|
+
},
|
|
53
|
+
"open-market-detail": {
|
|
54
|
+
"action": "ui.navigate",
|
|
55
|
+
"page": "perps-market",
|
|
56
|
+
"market": "BTC",
|
|
57
|
+
"intent": "Open the BTC Perps market detail screen",
|
|
58
|
+
"detail": "Navigate to the BTC market detail via the stable page alias; its node duration measures market-detail render time.",
|
|
59
|
+
"flow": "perps",
|
|
60
|
+
"next": "end"
|
|
61
|
+
},
|
|
62
|
+
"end": {
|
|
63
|
+
"action": "end",
|
|
64
|
+
"status": "pass",
|
|
65
|
+
"intent": "Finish the cold-start Perps performance flow",
|
|
66
|
+
"detail": "Terminal node; trace.json holds setup plus measured Perps node durations.",
|
|
67
|
+
"flow": "complete"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"title": "MetaMask Mobile Perps performance flow - warm foreground start",
|
|
4
|
+
"description": "Measured Perps flow from a deterministic warm-foreground start state. Setup foregrounds the already installed app through the Expo dev-client deep link without rebuilding and unlocks if needed. startState records the stable status. The measured workflow is only Perps list -> state -> BTC detail.",
|
|
5
|
+
"startState": {
|
|
6
|
+
"action": "app.status",
|
|
7
|
+
"intent": "Record the stable run start status after warm foreground setup",
|
|
8
|
+
"detail": "Read-only start-state marker after lifecycle and wallet setup have completed."
|
|
9
|
+
},
|
|
10
|
+
"validate": {
|
|
11
|
+
"workflow": {
|
|
12
|
+
"setup": [
|
|
13
|
+
{
|
|
14
|
+
"id": "foreground-app",
|
|
15
|
+
"action": "app.lifecycle",
|
|
16
|
+
"command": "foreground",
|
|
17
|
+
"settle_ms": 10000,
|
|
18
|
+
"intent": "Foreground the installed app through the Expo dev-client deep link",
|
|
19
|
+
"detail": "Uses the selected device, Metro port, and installed package; it does not rebuild."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "ensure-unlocked",
|
|
23
|
+
"action": "metamask.wallet.ensure_unlocked",
|
|
24
|
+
"intent": "Unlock the wallet before timing the Perps journey",
|
|
25
|
+
"detail": "Unlock only if the app is currently locked so the first measured node starts from a stable, signed-in state."
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"entry": "open-perps-list",
|
|
29
|
+
"nodes": {
|
|
30
|
+
"open-perps-list": {
|
|
31
|
+
"action": "ui.navigate",
|
|
32
|
+
"page": "perps",
|
|
33
|
+
"intent": "Open the Perps market list screen",
|
|
34
|
+
"detail": "Navigate to the Perps markets list via the stable page alias; its node duration measures market-list render time.",
|
|
35
|
+
"flow": "perps",
|
|
36
|
+
"next": "read-positions"
|
|
37
|
+
},
|
|
38
|
+
"read-positions": {
|
|
39
|
+
"action": "metamask.perps.read_positions",
|
|
40
|
+
"intent": "Read the live Perps positions shown on the market list",
|
|
41
|
+
"detail": "Read live Perps positions through the controller; its node duration measures how long live account state takes to resolve.",
|
|
42
|
+
"flow": "perps",
|
|
43
|
+
"next": "open-market-detail"
|
|
44
|
+
},
|
|
45
|
+
"open-market-detail": {
|
|
46
|
+
"action": "ui.navigate",
|
|
47
|
+
"page": "perps-market",
|
|
48
|
+
"market": "BTC",
|
|
49
|
+
"intent": "Open the BTC Perps market detail screen",
|
|
50
|
+
"detail": "Navigate to the BTC market detail via the stable page alias; its node duration measures market-detail render time.",
|
|
51
|
+
"flow": "perps",
|
|
52
|
+
"next": "end"
|
|
53
|
+
},
|
|
54
|
+
"end": {
|
|
55
|
+
"action": "end",
|
|
56
|
+
"status": "pass",
|
|
57
|
+
"intent": "Finish the warm-start Perps performance flow",
|
|
58
|
+
"detail": "Terminal node; trace.json holds setup plus measured Perps node durations.",
|
|
59
|
+
"flow": "complete"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"title": "MetaMask Mobile Perps performance flow",
|
|
4
|
-
"description": "Canonical measured flow for MetaMask Mobile Perps:
|
|
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
|
+
},
|
|
5
10
|
"validate": {
|
|
6
11
|
"workflow": {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
"setup": [
|
|
13
|
+
{
|
|
14
|
+
"id": "ensure-unlocked",
|
|
10
15
|
"action": "metamask.wallet.ensure_unlocked",
|
|
11
16
|
"intent": "Unlock the wallet before timing the Perps journey",
|
|
12
|
-
"detail": "Unlock only if the app is currently locked so the first measured node starts from a stable, signed-in state."
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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": {
|
|
16
22
|
"open-perps-list": {
|
|
17
23
|
"action": "ui.navigate",
|
|
18
24
|
"page": "perps",
|
|
@@ -41,7 +47,7 @@
|
|
|
41
47
|
"action": "end",
|
|
42
48
|
"status": "pass",
|
|
43
49
|
"intent": "Finish the measured Perps performance flow",
|
|
44
|
-
"detail": "Terminal node; the passing run's trace.json holds the per-node durations to diff across runs.",
|
|
50
|
+
"detail": "Terminal node; the passing run's trace.json holds the setup, startState, and measured per-node durations to diff across runs.",
|
|
45
51
|
"flow": "complete"
|
|
46
52
|
}
|
|
47
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deeeed/metamask-harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.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.
|
|
21
|
+
"@farmslot/recipe-harness": "^0.4.0",
|
|
22
22
|
"commander": "^12.0.0",
|
|
23
23
|
"viem": "^2.54.3"
|
|
24
24
|
},
|
|
@@ -69,4 +69,4 @@
|
|
|
69
69
|
"url": "https://github.com/MetaMask/experimental-metamask-harness/issues"
|
|
70
70
|
},
|
|
71
71
|
"homepage": "https://github.com/MetaMask/experimental-metamask-harness#readme"
|
|
72
|
-
}
|
|
72
|
+
}
|
package/scripts/completions.sh
CHANGED
|
File without changes
|
|
File without changes
|