@deeeed/metamask-harness 0.74.0 → 0.76.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 (96) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/README.md +1 -1
  3. package/adapters/shared/ensure-runner-deps.sh +15 -3
  4. package/adapters/shared/reap-checkout-metros.sh +9 -0
  5. package/dist/action-values.js +15 -0
  6. package/dist/adapters/core/actions.js +20 -0
  7. package/dist/adapters/core/live-script-env.js +36 -0
  8. package/dist/adapters/core/overlay.js +34 -0
  9. package/dist/adapters/core/readiness.js +8 -0
  10. package/dist/adapters/core/run.js +54 -0
  11. package/dist/adapters/core/surface.js +12 -1
  12. package/dist/adapters/extension/action-inputs.js +206 -0
  13. package/dist/adapters/extension/actions.js +51 -0
  14. package/dist/adapters/extension/console-capture.js +13 -1
  15. package/dist/adapters/extension/doctor-checks.js +135 -0
  16. package/dist/adapters/extension/fixtures.js +103 -0
  17. package/dist/adapters/extension/launch.js +315 -0
  18. package/dist/adapters/extension/launched-browser.js +51 -0
  19. package/dist/adapters/extension/overlay.js +55 -0
  20. package/dist/adapters/extension/readiness.js +32 -0
  21. package/dist/adapters/extension/reload.js +40 -0
  22. package/dist/adapters/extension/run.js +105 -0
  23. package/dist/adapters/extension/surface.js +31 -3
  24. package/dist/adapters/harness-freshness.js +4 -2
  25. package/dist/adapters/mobile/actions.js +54 -0
  26. package/dist/adapters/mobile/devices.js +21 -0
  27. package/dist/adapters/mobile/doctor-checks.js +40 -0
  28. package/dist/adapters/mobile/fixtures.js +141 -0
  29. package/dist/adapters/mobile/launch.js +192 -0
  30. package/dist/adapters/mobile/lifecycle.js +300 -0
  31. package/dist/adapters/mobile/overlay.js +27 -0
  32. package/dist/adapters/mobile/prepare-target.js +38 -0
  33. package/dist/adapters/mobile/readiness.js +39 -0
  34. package/dist/adapters/mobile/reload.js +15 -0
  35. package/dist/adapters/mobile/run.js +156 -0
  36. package/dist/adapters/mobile/runtime-identity.js +34 -0
  37. package/dist/adapters/mobile/surface.js +39 -3
  38. package/dist/adapters/mobile/ui.js +701 -0
  39. package/dist/adapters/performance/cdp-trace.js +24 -6
  40. package/dist/adapters/performance/device-platform.js +10 -0
  41. package/dist/adapters/registry.js +1 -1
  42. package/dist/adapters/terminal/actions.js +43 -0
  43. package/dist/adapters/terminal/console-capture.js +14 -1
  44. package/dist/adapters/terminal/doctor-checks.js +22 -0
  45. package/dist/adapters/terminal/overlay.js +18 -0
  46. package/dist/adapters/terminal/readiness.js +11 -0
  47. package/dist/adapters/terminal/run.js +30 -0
  48. package/dist/adapters/terminal/surface.js +21 -3
  49. package/dist/adapters.js +32 -824
  50. package/dist/cli-commands.js +1 -0
  51. package/dist/cli.js +3 -1
  52. package/dist/command-contract.js +3 -0
  53. package/dist/commands/call.js +2 -5
  54. package/dist/commands/debug.js +6 -25
  55. package/dist/commands/device-target.js +2 -1
  56. package/dist/commands/doctor.js +26 -137
  57. package/dist/commands/fixtures.js +13 -217
  58. package/dist/commands/launch/device.js +2 -6
  59. package/dist/commands/launch/extension.js +3 -303
  60. package/dist/commands/launch/index.js +1 -1
  61. package/dist/commands/launch/mobile.js +2 -190
  62. package/dist/commands/launch/quote.js +7 -0
  63. package/dist/commands/logs.js +1 -1
  64. package/dist/commands/parse-args.js +9 -4
  65. package/dist/commands/pin.js +226 -0
  66. package/dist/commands/prepare.js +23 -53
  67. package/dist/commands/provision.js +3 -7
  68. package/dist/commands/reload.js +8 -47
  69. package/dist/commands/run-engine.js +38 -138
  70. package/dist/commands/run-report.js +4 -48
  71. package/dist/commands/run.js +6 -48
  72. package/dist/commands/runtime-decision.js +5 -27
  73. package/dist/commands/self-test.js +1 -3
  74. package/dist/commands/status.js +20 -28
  75. package/dist/commands/stop.js +1 -1
  76. package/dist/doctor.js +12 -120
  77. package/dist/execution-provenance.js +3 -2
  78. package/dist/harness-pin.js +10 -0
  79. package/dist/harness.js +31 -100
  80. package/dist/heal-bounds.js +3 -2
  81. package/dist/live-adapter-contract.js +8 -34
  82. package/dist/manifest.js +3 -5
  83. package/dist/metamask-action-validation.js +5 -196
  84. package/dist/mm-harness-cli.js +30 -4
  85. package/dist/network-observation.js +10 -3
  86. package/dist/paths.js +8 -2
  87. package/dist/performance-observation.js +15 -22
  88. package/dist/pr-body/render.js +3 -1
  89. package/dist/recording-target.js +4 -39
  90. package/dist/run-diagnostics.js +21 -60
  91. package/dist/run-recording.js +5 -4
  92. package/dist/runner.js +20 -368
  93. package/dist/runtime-context.js +12 -17
  94. package/docs/CONTRIBUTING.md +29 -7
  95. package/package.json +2 -1
  96. package/scripts/completions.sh +2 -1
@@ -62,13 +62,35 @@ 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, and commands look adapters up
66
+ in the registry, so a platform registered the same way is reached by the
67
+ commands that take `--adapter` with no edit to shared code
68
+ (`tests/fixtures/example-adapter.ts`); `status` detects the adapter from the
69
+ checkout.
70
+ The CLI contract (`src/command-contract.ts`) still lists the four built-ins for
71
+ `--adapter`, so a new platform reaches `bin/mm-harness` once a plugin loader
72
+ registers it and extends that list.
73
+
74
+ Extend `AdapterSurface` when a platform owns the behavior; members a platform
75
+ does not need are optional, and Core reports headless/N/A explicitly. Put each
76
+ platform's implementation under `src/adapters/<adapter>/`: `launch.ts`,
77
+ `run.ts`, `actions.ts`, `overlay.ts` (install/verify/cleanup, the runtime
78
+ context, prepare) and `readiness.ts` (doctor and status). Do not add
79
+ command-local platform ladders for surface-owned behavior:
80
+ - `launch` dispatches through `AdapterSurface.launch` (the device platforms
81
+ share `src/commands/launch/device.ts` through a `DeviceLaunchProfile`);
82
+ - `run`/`call` read `run`, `recording`, `diagnostics`, `observation` and
83
+ `sourceFingerprint`;
84
+ - the runner reads `actions` (manifest, bundled semantic actions, live adapter
85
+ scripts, `cdp.target`, the `ui.*` transport, adapter wrappers, input checks);
86
+ - `install`/`verify`/`cleanup` read `harness`, `agentic-runtime.json` reads
87
+ `runtimeContext`, `doctor`/`status` read `readiness`, and `fixtures`,
88
+ `prepare`, `debug`, `reload` and `runtime-decision` read their own members.
89
+
90
+ A few comparisons remain where a command exists for one platform
91
+ (`runtime-health`, `resolve-extension`, `ensure-ready`, `runtime-launch`) or
92
+ code compares a platform's own data (`review/knowledge.ts`, the Core jest
93
+ grouping in `check.ts`, the Mobile release-artifact state file).
72
94
 
73
95
  Each checkout owns:
74
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeeed/metamask-harness",
3
- "version": "0.74.0",
3
+ "version": "0.76.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" ;;