@deeeed/metamask-harness 0.17.4 → 0.17.5

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 (114) hide show
  1. package/CHANGELOG.md +6 -103
  2. package/README.md +136 -96
  3. package/adapters/extension/console-tail.mjs +24 -55
  4. package/adapters/extension/ensure-browser.sh +7 -1
  5. package/adapters/extension/inject.mjs +15 -5
  6. package/adapters/extension/launch-browser.cjs +4 -3
  7. package/adapters/extension/launch.sh +11 -8
  8. package/adapters/extension/lib/chrome-args.cjs +24 -0
  9. package/adapters/extension/live.sh +1 -2
  10. package/adapters/extension/reattach.sh +0 -1
  11. package/adapters/extension/seed-fixture.sh +12 -4
  12. package/adapters/extension/sidepanel-toggle.sh +1 -4
  13. package/adapters/extension/start-watch.sh +4 -17
  14. package/adapters/extension/stop-viewers.sh +1 -1
  15. package/adapters/extension/verify.sh +1 -1
  16. package/adapters/manifest.json +45 -53
  17. package/adapters/mobile/bridge-runtime/cdp-bridge.cjs +0 -16
  18. package/adapters/mobile/bridge-runtime/console-forwarder.cjs +1 -1
  19. package/adapters/mobile/bridge-runtime/lib/match-bridge-target.cjs +1 -3
  20. package/adapters/mobile/bridge-runtime/lib/target-discovery.cjs +3 -2
  21. package/adapters/mobile/cleanup.sh +176 -16
  22. package/adapters/mobile/inject.sh +671 -90
  23. package/adapters/mobile/overlay/app/dev-tools/AgenticService/AgentStepHud.tsx.patch +185 -0
  24. package/adapters/mobile/overlay/app/dev-tools/AgenticService/AgenticService.ts.patch +1662 -0
  25. package/adapters/mobile/overlay/compat/README.md +28 -0
  26. package/adapters/mobile/overlay/compat/rn81-message-event-source.patch +42 -0
  27. package/adapters/mobile/start-metro.sh +41 -0
  28. package/adapters/mobile/verify.sh +61 -4
  29. package/adapters/mobile/wait-for-bridge.sh +8 -22
  30. package/adapters/shared/harness-source-fingerprint.mjs +49 -0
  31. package/adapters/shared/install-repo-deps.sh +1 -5
  32. package/adapters/shared/open-debug.mjs +184 -103
  33. package/adapters/shared/resolve-farmslot-ports-core.mjs +3 -0
  34. package/adapters/shared/resolve-farmslot-ports.mjs +5 -0
  35. package/adapters/shared/resolve-farmslot-ports.sh +7 -0
  36. package/adapters/shared/resolve-slot-ports-core.mjs +6 -0
  37. package/adapters/shared/resolve-slot-ports.sh +7 -2
  38. package/bin/mm-harness +0 -7
  39. package/dist/adapters/extension/harness-freshness.js +39 -0
  40. package/dist/adapters/extension/runtime-decision.js +4 -73
  41. package/dist/adapters/extension/surface.js +2 -3
  42. package/dist/adapters/mobile/perps-env.js +3 -43
  43. package/dist/adapters/mobile/prepare.js +7 -22
  44. package/dist/adapters/mobile/source-freshness.js +26 -41
  45. package/dist/adapters/mobile/surface.js +1 -1
  46. package/dist/adapters/resolve-slot-ports.js +2 -0
  47. package/dist/adapters/slot-ports.js +0 -16
  48. package/dist/adapters.js +5 -12
  49. package/dist/cli-commands.js +1 -1
  50. package/dist/cli.js +12 -6
  51. package/dist/commands/call.js +22 -56
  52. package/dist/commands/check.js +3 -9
  53. package/dist/commands/checklist.js +4 -1
  54. package/dist/commands/debug.js +31 -38
  55. package/dist/commands/device-target.js +12 -27
  56. package/dist/commands/doctor.js +23 -77
  57. package/dist/commands/fixtures.js +17 -27
  58. package/dist/commands/launch/extension.js +2 -0
  59. package/dist/commands/launch/index.js +59 -167
  60. package/dist/commands/logs.js +6 -8
  61. package/dist/commands/manifest.js +25 -151
  62. package/dist/commands/parse-args.js +0 -2
  63. package/dist/commands/provision.js +3 -10
  64. package/dist/commands/run-engine.js +69 -71
  65. package/dist/commands/run-report.js +3 -12
  66. package/dist/commands/run.js +35 -245
  67. package/dist/commands/shared.js +3 -55
  68. package/dist/commands/status-probe.js +1 -1
  69. package/dist/commands/status.js +1 -1
  70. package/dist/commands/stop.js +2 -7
  71. package/dist/commands/update.js +28 -16
  72. package/dist/doctor.js +4 -1
  73. package/dist/harness.js +134 -43
  74. package/dist/heal-bounds.js +1 -1
  75. package/dist/live-adapter-contract.js +20 -6
  76. package/dist/mm-harness-cli.js +48 -123
  77. package/dist/paths.js +5 -2
  78. package/dist/runner.js +2 -37
  79. package/dist/runtime-context.js +8 -26
  80. package/docs/ADAPTER-SURFACE.md +112 -19
  81. package/docs/CHEATSHEET.md +52 -39
  82. package/docs/CLI-SPEC.md +1098 -0
  83. package/docs/CODE-MAP.md +1 -1
  84. package/docs/DEBUG-HANDOVER.md +36 -0
  85. package/docs/MENTAL-MODEL.md +295 -0
  86. package/docs/UX-PRINCIPLES.md +1 -3
  87. package/docs/architecture.md +375 -65
  88. package/docs/live-adapter-contract.md +2 -4
  89. package/docs/recipe-libraries.md +275 -45
  90. package/library/README.md +0 -4
  91. package/library/actions/core/perps/_controller.mjs +55 -10
  92. package/library/actions/mobile/platform/bridge.mjs +1 -5
  93. package/library/manifests/core.action-manifest.json +7 -7
  94. package/library/manifests/mobile.action-manifest.json +3 -28
  95. package/package.json +1 -4
  96. package/adapters/extension/launch-webpack.cjs +0 -83
  97. package/adapters/extension/stamp-runtime-title.cjs +0 -58
  98. package/adapters/extension/sync-webpack-dist.cjs +0 -107
  99. package/adapters/mobile/launch-console-forwarder.cjs +0 -39
  100. package/adapters/mobile/start-console-forwarder.sh +0 -70
  101. package/adapters/shared/update-check-worker.mjs +0 -43
  102. package/dist/adapters/extension/console-capture.js +0 -93
  103. package/dist/command-contract.js +0 -441
  104. package/dist/command-journal.js +0 -225
  105. package/dist/commands/last.js +0 -52
  106. package/dist/json-stream.js +0 -57
  107. package/dist/run-diagnostics.js +0 -261
  108. package/docs/CLI-ERGONOMICS-AUDIT.md +0 -32
  109. package/docs/CLI-ERGONOMICS-HUMAN-QA.md +0 -64
  110. package/docs/VIDEO-DEMO-VALIDATION.md +0 -74
  111. package/library/recipes/runner/smoke.core.recipe.json +0 -27
  112. package/library/recipes/wallet/smoke.extension.recipe.json +0 -42
  113. package/library/recipes/wallet/smoke.mobile.recipe.json +0 -42
  114. package/scripts/validate-human-outcomes.mjs +0 -169
@@ -1,48 +1,61 @@
1
- # mm-harness cheatsheet
1
+ # mm-harness — user cheatsheet
2
2
 
3
- Run inside a MetaMask checkout. Product, slot, ports, and runtime paths are
4
- auto-detected.
3
+ `mm-harness <command> [target] [flags]` · Run from inside any MetaMask checkout · Platform auto-detected
5
4
 
6
- ## Operate
5
+ ---
7
6
 
8
- | Need | Command |
7
+ ## Daily loop
8
+
9
+ | Situation | Command |
9
10
  |---|---|
10
- | Extension | `mm-harness launch` |
11
- | Extension sidepanel | `mm-harness launch --sidepanel` |
12
- | iOS / Android | `mm-harness launch ios` / `mm-harness launch android` |
13
- | Clean rebuild | `mm-harness launch --build` |
14
- | Runtime status | `mm-harness status` |
15
- | Logs | `mm-harness logs` |
16
- | Debugger | `mm-harness debug` |
17
- | Apply wallet fixture | `mm-harness fixtures set` |
18
-
19
- Extension log sources: `extension`, `dapp`, `webpack`, `watcher`, `rebuild`.
20
- Mobile log sources: `app`, `metro`.
21
-
22
- ## Discover and prove
23
-
24
- ```bash
25
- mm-harness actions positions
26
- mm-harness actions --action metamask.wallet.ensure_unlocked
27
- mm-harness call metamask.wallet.ensure_unlocked
28
- mm-harness flows
29
- mm-harness run recipe.json --plan
30
- mm-harness run recipe.json --artifacts-dir temp/recipe-proof
31
- ```
11
+ | Start / relaunch iOS | `mm-harness launch ios` |
12
+ | Start / relaunch Android | `mm-harness launch android` |
13
+ | Launch extension (fullscreen) | `mm-harness launch` |
14
+ | Launch extension in sidepanel | `mm-harness launch --sidepanel` |
15
+ | Native code changed — rebuild first | `mm-harness launch ios --build` |
16
+ | Tail Metro / webpack logs | `mm-harness logs` |
17
+ | Open DevTools / RN inspector | `mm-harness debug` |
18
+ | Seed wallet from fixture — no typing | `mm-harness fixtures set` |
19
+ | Refresh wallet fixture files on slot | `mm-harness fixtures sync` |
32
20
 
33
- The run result prints diagnostics plus absolute evidence paths. Resume safely with
34
- `mm-harness last --json`.
21
+ `launch` auto-installs the overlay on first use.
22
+ `fixtures set` reads the password **from** the fixture — never typed.
35
23
 
36
- ## Recover
24
+ ---
37
25
 
38
- ```bash
39
- mm-harness doctor
40
- mm-harness doctor --fix
41
- mm-harness verify
42
- mm-harness cleanup
43
- mm-harness update
26
+ ## Proof loop
27
+
28
+ ```
29
+ actions → call <action> → flows → run recipe.json --plan → run recipe.json
44
30
  ```
45
31
 
46
- For automation, add `--json`. Use `--json-stream` for line-delimited run progress.
47
- Bad input exits `2`; recipe/action failure exits `1`; recipe validation failure
48
- exits `5`.
32
+ | Command | What it does |
33
+ |---|---|
34
+ | `mm-harness actions` | Action vocabulary for this adapter |
35
+ | `mm-harness call unlock` | One action through the real engine (fuzzy name ok) |
36
+ | `mm-harness flows` | Reusable flows (personal > team > canonical) |
37
+ | `mm-harness run recipe.json --plan` | Validate + print plan, no device touched; exit 5 if invalid |
38
+ | `mm-harness run recipe.json` | Execute + write evidence (summary / trace / artifacts) |
39
+
40
+ ---
41
+
42
+ ## Health
43
+
44
+ | Command | What it does |
45
+ |---|---|
46
+ | `mm-harness doctor` | Full readiness check — fixture, runtime context, overlay. No launch. |
47
+ | `mm-harness doctor --fix` | Repair overlay + runtime context without launching the app. |
48
+ | `mm-harness verify` | Check overlay/runtime is present and healthy. No launch. |
49
+ | `mm-harness cleanup` | Remove the overlay and restore the checkout. |
50
+
51
+ ---
52
+
53
+ ## For agents and scripts
54
+
55
+ **`--json`** — machine-readable output on every command; includes `recovered[]`, `mutations[]`, `schemaVersion`.
56
+
57
+ **`--heal`** — `off` (fail fast, repro-preserving) · `infra-only` (heal transport, never wallet; `run`/`call` default) · `auto` (auto-ensure overlay + heal; `launch` default).
58
+
59
+ **Exit codes** — `0` success · `1` recipe/action failed · `2` bad args / missing target · `5` validation failure (fix recipe).
60
+
61
+ **Tab completion** — `mm-harness completions install` prints the lines to add to `~/.zshrc` / `~/.bashrc`.