@deeeed/metamask-harness 0.74.0 → 0.75.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 (60) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/README.md +1 -1
  3. package/adapters/shared/ensure-runner-deps.sh +15 -3
  4. package/dist/action-values.js +15 -0
  5. package/dist/adapters/core/actions.js +20 -0
  6. package/dist/adapters/core/live-script-env.js +36 -0
  7. package/dist/adapters/core/run.js +54 -0
  8. package/dist/adapters/core/surface.js +5 -1
  9. package/dist/adapters/extension/action-inputs.js +206 -0
  10. package/dist/adapters/extension/actions.js +51 -0
  11. package/dist/adapters/extension/console-capture.js +13 -1
  12. package/dist/adapters/extension/launch.js +315 -0
  13. package/dist/adapters/extension/launched-browser.js +51 -0
  14. package/dist/adapters/extension/run.js +105 -0
  15. package/dist/adapters/extension/surface.js +9 -2
  16. package/dist/adapters/mobile/actions.js +54 -0
  17. package/dist/adapters/mobile/launch.js +192 -0
  18. package/dist/adapters/mobile/lifecycle.js +300 -0
  19. package/dist/adapters/mobile/run.js +156 -0
  20. package/dist/adapters/mobile/runtime-identity.js +34 -0
  21. package/dist/adapters/mobile/surface.js +11 -2
  22. package/dist/adapters/mobile/ui.js +701 -0
  23. package/dist/adapters/performance/cdp-trace.js +24 -6
  24. package/dist/adapters/performance/device-platform.js +10 -0
  25. package/dist/adapters/registry.js +1 -1
  26. package/dist/adapters/terminal/actions.js +43 -0
  27. package/dist/adapters/terminal/console-capture.js +14 -1
  28. package/dist/adapters/terminal/run.js +30 -0
  29. package/dist/adapters/terminal/surface.js +6 -1
  30. package/dist/adapters.js +32 -824
  31. package/dist/cli-commands.js +1 -0
  32. package/dist/command-contract.js +3 -0
  33. package/dist/commands/call.js +2 -5
  34. package/dist/commands/launch/device.js +2 -6
  35. package/dist/commands/launch/extension.js +3 -303
  36. package/dist/commands/launch/index.js +1 -1
  37. package/dist/commands/launch/mobile.js +2 -190
  38. package/dist/commands/launch/quote.js +7 -0
  39. package/dist/commands/pin.js +226 -0
  40. package/dist/commands/run-engine.js +38 -138
  41. package/dist/commands/run-report.js +4 -48
  42. package/dist/commands/run.js +6 -48
  43. package/dist/doctor.js +3 -1
  44. package/dist/execution-provenance.js +3 -2
  45. package/dist/harness-pin.js +10 -0
  46. package/dist/heal-bounds.js +3 -2
  47. package/dist/live-adapter-contract.js +8 -34
  48. package/dist/manifest.js +3 -5
  49. package/dist/metamask-action-validation.js +5 -196
  50. package/dist/mm-harness-cli.js +27 -2
  51. package/dist/network-observation.js +10 -3
  52. package/dist/performance-observation.js +15 -22
  53. package/dist/pr-body/render.js +3 -1
  54. package/dist/recording-target.js +4 -39
  55. package/dist/run-diagnostics.js +21 -60
  56. package/dist/run-recording.js +5 -4
  57. package/dist/runner.js +20 -368
  58. package/docs/CONTRIBUTING.md +19 -7
  59. package/package.json +2 -1
  60. package/scripts/completions.sh +2 -1
@@ -62,13 +62,25 @@ exits.
62
62
 
63
63
  Commands resolve shared platform behavior through
64
64
  `src/adapters/surface.ts`. Each platform's surface registers itself in
65
- `src/adapters/registry.ts` when its module loads; a new platform registers the
66
- same way and needs no edit to shared code. Extend `AdapterSurface` only when all
67
- platforms need the concept, implement it in every adapter, and let Core report
68
- headless/N/A explicitly. Do not add command-local platform ladders for
69
- surface-owned behavior: `launch` already dispatches through
70
- `AdapterSurface.launch`, and the device platforms supply a `DeviceLaunchProfile`
71
- (`src/commands/launch/device.ts`).
65
+ `src/adapters/registry.ts` when its module loads. A platform registered the same
66
+ way is reached by `launch`, by the `run`/`call` engine and by the runner's
67
+ action set with no edit to shared code (`tests/fixtures/example-adapter.ts`).
68
+ The CLI front door still validates `--adapter` against the four built-ins
69
+ (`src/command-contract.ts`), and the other commands still branch on the name,
70
+ so a new platform reaches `bin/mm-harness` only when those families move and a
71
+ plugin loader registers it.
72
+
73
+ Extend `AdapterSurface` when a platform owns the behavior; members a platform
74
+ does not need are optional (`actions` is required: every platform has an
75
+ action set), and Core reports headless/N/A explicitly. Put each platform's
76
+ implementation under `src/adapters/<adapter>/` (`launch.ts`, `run.ts`,
77
+ `actions.ts`). Do not add command-local platform ladders for surface-owned
78
+ behavior: `launch` dispatches through `AdapterSurface.launch` (the device
79
+ platforms share `src/commands/launch/device.ts` through a
80
+ `DeviceLaunchProfile`), `run`/`call` read `run`, `recording`, `diagnostics`,
81
+ `observation` and `sourceFingerprint`, and the runner reads `actions`
82
+ (manifest, bundled semantic actions, live adapter scripts, `cdp.target`, the
83
+ `ui.*` transport, adapter wrappers, input checks).
72
84
 
73
85
  Each checkout owns:
74
86
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeeed/metamask-harness",
3
- "version": "0.74.0",
3
+ "version": "0.75.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mm-harness": "bin/mm-harness"
@@ -45,6 +45,7 @@
45
45
  "@vitest/coverage-v8": "^4.1.10",
46
46
  "eslint": "^9",
47
47
  "globals": "^17.7.0",
48
+ "proper-lockfile": "^4.1.2",
48
49
  "tsx": "^4.23.0",
49
50
  "typescript": "^5.6.0",
50
51
  "typescript-eslint": "^8",
@@ -29,13 +29,14 @@ _mmh_bin() {
29
29
  return 1
30
30
  }
31
31
 
32
- _mmh_commands="launch stop logs debug reload fixtures actions call run doctor check checklist execution-template recipe-quality install verify cleanup completions"
32
+ _mmh_commands="launch stop logs debug reload fixtures actions call run doctor check checklist execution-template recipe-quality install verify cleanup pin completions"
33
33
 
34
34
  # Per-command flags (static, from the mm-harness surface).
35
35
  _mmh_flags_for() {
36
36
  case "$1" in
37
37
  launch) printf '%s' "--build --watch --verify --sidepanel --fullscreen --runway --device --cdp-port --watcher-port --heal --adapter --target --json" ;;
38
38
  stop) printf '%s' "--port --target --json" ;;
39
+ pin) printf '%s' "--json" ;;
39
40
  logs) printf '%s' "--full --events --source --adapter --target --json" ;;
40
41
  debug) printf '%s' "--worker --dev-menu --adapter --target --json" ;;
41
42
  reload) printf '%s' "--adapter --platform --target --json" ;;