@deeeed/metamask-harness 0.33.2 → 0.34.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 (54) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/adapters/mobile/bridge-runtime/cdp-bridge.cjs +18 -2
  3. package/adapters/mobile/bridge-runtime/lib/target-discovery.cjs +83 -23
  4. package/dist/adapters/mobile/prepare.js +14 -0
  5. package/dist/adapters/mobile/video-recorder.js +282 -0
  6. package/dist/adapters.js +225 -35
  7. package/dist/command-contract.js +1 -0
  8. package/dist/commands/device-target.js +17 -6
  9. package/dist/commands/launch/index.js +27 -5
  10. package/dist/commands/launch/mobile.js +9 -2
  11. package/dist/commands/run-engine.js +34 -2
  12. package/dist/devices.js +9 -2
  13. package/dist/heal-bounds.js +10 -0
  14. package/dist/mm-harness-cli.js +4 -2
  15. package/dist/recipe-security.js +1 -0
  16. package/dist/recording-target.js +23 -5
  17. package/dist/runner.js +107 -6
  18. package/dist/runtime-context.js +33 -1
  19. package/docs/RECIPES.md +41 -0
  20. package/library/actions/mobile/app/network-control.mjs +135 -0
  21. package/library/actions/mobile/app/network.mjs +4 -0
  22. package/library/actions/mobile/perps/capture_performance.mjs +4 -0
  23. package/library/actions/mobile/perps/performance-capture.mjs +383 -0
  24. package/library/actions/mobile/perps/perps.mjs +16 -0
  25. package/library/actions/mobile/platform/bridge.mjs +229 -13
  26. package/library/actions/mobile/wallet/ensure_unlocked.mjs +27 -6
  27. package/library/actions/mobile/wallet/select_account.mjs +21 -17
  28. package/library/manifests/mobile.action-manifest.json +130 -1
  29. package/library/recipes/mobile/perps/performance.homepage.android-background-reconnect.recipe.json +159 -0
  30. package/library/recipes/mobile/perps/performance.homepage.android-background-short.recipe.json +157 -0
  31. package/library/recipes/mobile/perps/performance.homepage.android-cold-disk-cache.recipe.json +147 -0
  32. package/library/recipes/mobile/perps/performance.homepage.android-cold-no-cache.recipe.json +137 -0
  33. package/library/recipes/mobile/perps/performance.homepage.android-network-recovery.recipe.json +149 -0
  34. package/library/recipes/mobile/perps/performance.homepage.ios-background-reconnect.recipe.json +110 -0
  35. package/library/recipes/mobile/perps/performance.homepage.ios-background-short.recipe.json +108 -0
  36. package/library/recipes/mobile/perps/performance.homepage.ios-cold-disk-cache.recipe.json +122 -0
  37. package/library/recipes/mobile/perps/performance.homepage.ios-cold-no-cache.recipe.json +95 -0
  38. package/package.json +1 -1
  39. package/scripts/site-contrast.mjs +34 -1
  40. package/site/architecture.html +12 -2
  41. package/site/assets/style.css +20 -1
  42. package/site/cheatsheet.html +7 -6
  43. package/site/index.html +119 -77
  44. package/site/perps.html +195 -0
  45. package/site/recipes.html +23 -1
  46. package/site/reviewers.html +2 -1
  47. package/site/tutorials/index.html +2 -1
  48. package/site/tutorials/v1.html +3 -2
  49. package/site/tutorials/v2.html +6 -5
  50. package/site/tutorials/v3.html +43 -2
  51. package/site/tutorials/v4.html +2 -1
  52. package/site/tutorials/v5.html +2 -1
  53. package/site/tutorials/v6.html +2 -1
  54. package/site/tutorials/v7.html +2 -1
@@ -19,6 +19,7 @@
19
19
  <nav class="nav" aria-label="Main">
20
20
  <a href="../index.html">Start Here</a>
21
21
  <a href="../recipes.html">Recipes</a>
22
+ <a href="../perps.html">Perps</a>
22
23
  <a href="../cheatsheet.html">Cheatsheet</a>
23
24
  <a href="../architecture.html">Architecture</a>
24
25
  <a href="index.html" aria-current="page">Tutorials</a>
@@ -84,6 +85,46 @@
84
85
  <section class="wrap">
85
86
  <h2 id="steps">Set it up</h2>
86
87
 
88
+ <div class="agent-card">
89
+ <h3 style="margin-top:0">Paste this into your agent</h3>
90
+ <div class="cmd cmd-hero"><pre><code>Task: install the latest recipe skills and shared MetaMask Perps recipe library,
91
+ then prove one real recipe runs end to end.
92
+
93
+ 1. Work from the MetaMask product checkout I started you in. Run
94
+ `npm i -g @deeeed/metamask-harness@latest` and `mm-harness --version`.
95
+ 2. Install the latest Consensys recipe skills into this checkout:
96
+ `yarn skills --maturity experimental --include
97
+ agentic/recipe-cook,agentic/recipe-quality --save`
98
+ This command updates the skills sources before syncing. Show me that
99
+ recipe-cook and recipe-quality were installed.
100
+ 3. Use this exact library directory:
101
+ `$HOME/shared-library/metamask-recipe-perps`.
102
+ If it does not exist, clone
103
+ `git@github.com:MetaMask/experimental-metamask-recipe-perps.git` there.
104
+ If it exists and is clean, update it with `git pull --ff-only`; if it is
105
+ dirty, preserve it and report that instead of changing its files.
106
+ If cloning reports 404 or permission denied, stop and tell me that repository
107
+ access is missing; do not search for a substitute repository.
108
+ 4. Run `mm-harness run --list --library
109
+ "perps=$HOME/shared-library/metamask-recipe-perps"` and show me the recipes
110
+ tagged `[perps]`. Use this explicit `--library` on every later command; do not
111
+ assume an `export` survives between tool shells.
112
+ 5. Run `mm-harness status`. If the app is not ready, follow its public `Next:`
113
+ command while preserving the same device UUID or serial used during setup.
114
+ 6. Choose only a recipe actually printed by step 4. Prefer
115
+ `perps.open-market` on Extension/Mobile or `perps.snapshot-market` on Core.
116
+ If that shared recipe has no variant for this checkout, use the listed bundled
117
+ `wallet.smoke` (Extension/Mobile) or `runner.smoke` (Core) recipe.
118
+ 7. Run the chosen recipe with `--describe`, then `--plan`, then for real with
119
+ `--artifacts-dir ./first-team-recipe-artifacts`. Include
120
+ `--library "perps=$HOME/shared-library/metamask-recipe-perps"` each time.
121
+ For a Perps recipe use `network=testnet market=BTC`. Never place an order or
122
+ use mainnet in this setup proof.
123
+ 8. Show me summary.json status, every trace.json node result, and all artifact
124
+ paths. Then confirm the checkout is ready for a bug-fix task using the
125
+ installed recipe-cook skill.</code></pre></div>
126
+ </div>
127
+
87
128
  <ol class="steps">
88
129
  <li class="step" data-step="skills">
89
130
  <div class="step-head">
@@ -91,7 +132,7 @@
91
132
  <h3 class="step-title" id="t3-skills">Install the skills into your checkout</h3>
92
133
  </div>
93
134
  <p class="step-why">Run this from the product checkout you work in.</p>
94
- <div class="cmd"><pre><code><span class="p">$ </span>yarn skills --include agentic/recipe-cook,agentic/recipe-quality --save</code></pre></div>
135
+ <div class="cmd"><pre><code><span class="p">$ </span>yarn skills --maturity experimental --include agentic/recipe-cook,agentic/recipe-quality --save</code></pre></div>
95
136
  <p class="step-why">
96
137
  The agentic skills carry <code>experimental</code> maturity, so they are visible only when
97
138
  experimental skills are enabled. <code>recipe-cook</code> is the one you want first — it owns
@@ -205,7 +246,7 @@ Inspect: mm-harness run &lt;recipe&gt; --describe
205
246
  <footer class="footer">
206
247
  <div class="wrap">
207
248
  <p>Internal getting-started guide for the MetaMask agentic coding workflow. Not official MetaMask product documentation.</p>
208
- <p>Verified against mm-harness 0.26+.</p>
249
+ <p>Verified against mm-harness 0.33+.</p>
209
250
  </div>
210
251
  </footer>
211
252
 
@@ -19,6 +19,7 @@
19
19
  <nav class="nav" aria-label="Main">
20
20
  <a href="../index.html">Start Here</a>
21
21
  <a href="../recipes.html">Recipes</a>
22
+ <a href="../perps.html">Perps</a>
22
23
  <a href="../cheatsheet.html">Cheatsheet</a>
23
24
  <a href="../architecture.html">Architecture</a>
24
25
  <a href="index.html" aria-current="page">Tutorials</a>
@@ -186,7 +187,7 @@
186
187
  <footer class="footer">
187
188
  <div class="wrap">
188
189
  <p>Internal getting-started guide for the MetaMask agentic coding workflow. Not official MetaMask product documentation.</p>
189
- <p>Verified against mm-harness 0.26+.</p>
190
+ <p>Verified against mm-harness 0.33+.</p>
190
191
  </div>
191
192
  </footer>
192
193
 
@@ -19,6 +19,7 @@
19
19
  <nav class="nav" aria-label="Main">
20
20
  <a href="../index.html">Start Here</a>
21
21
  <a href="../recipes.html">Recipes</a>
22
+ <a href="../perps.html">Perps</a>
22
23
  <a href="../cheatsheet.html">Cheatsheet</a>
23
24
  <a href="../architecture.html">Architecture</a>
24
25
  <a href="index.html" aria-current="page">Tutorials</a>
@@ -154,7 +155,7 @@
154
155
  <footer class="footer">
155
156
  <div class="wrap">
156
157
  <p>Internal getting-started guide for the MetaMask agentic coding workflow. Not official MetaMask product documentation.</p>
157
- <p>Verified against mm-harness 0.26+.</p>
158
+ <p>Verified against mm-harness 0.33+.</p>
158
159
  </div>
159
160
  </footer>
160
161
 
@@ -19,6 +19,7 @@
19
19
  <nav class="nav" aria-label="Main">
20
20
  <a href="../index.html">Start Here</a>
21
21
  <a href="../recipes.html">Recipes</a>
22
+ <a href="../perps.html">Perps</a>
22
23
  <a href="../cheatsheet.html">Cheatsheet</a>
23
24
  <a href="../architecture.html">Architecture</a>
24
25
  <a href="index.html" aria-current="page">Tutorials</a>
@@ -156,7 +157,7 @@
156
157
  <footer class="footer">
157
158
  <div class="wrap">
158
159
  <p>Internal getting-started guide for the MetaMask agentic coding workflow. Not official MetaMask product documentation.</p>
159
- <p>Verified against mm-harness 0.26+.</p>
160
+ <p>Verified against mm-harness 0.33+.</p>
160
161
  </div>
161
162
  </footer>
162
163
 
@@ -19,6 +19,7 @@
19
19
  <nav class="nav" aria-label="Main">
20
20
  <a href="../index.html">Start Here</a>
21
21
  <a href="../recipes.html">Recipes</a>
22
+ <a href="../perps.html">Perps</a>
22
23
  <a href="../cheatsheet.html">Cheatsheet</a>
23
24
  <a href="../architecture.html">Architecture</a>
24
25
  <a href="index.html" aria-current="page">Tutorials</a>
@@ -175,7 +176,7 @@
175
176
  <footer class="footer">
176
177
  <div class="wrap">
177
178
  <p>Internal getting-started guide for the MetaMask agentic coding workflow. Not official MetaMask product documentation.</p>
178
- <p>Verified against mm-harness 0.26+.</p>
179
+ <p>Verified against mm-harness 0.33+.</p>
179
180
  </div>
180
181
  </footer>
181
182