@deeeed/metamask-harness 0.17.0 → 0.17.2

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 (106) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +90 -140
  3. package/adapters/core/cleanup.sh +0 -0
  4. package/adapters/core/inject.sh +0 -0
  5. package/adapters/extension/cleanup.mjs +0 -0
  6. package/adapters/extension/console-tail.mjs +51 -24
  7. package/adapters/extension/ensure-browser.sh +0 -0
  8. package/adapters/extension/inject.mjs +5 -9
  9. package/adapters/extension/launch-browser.cjs +0 -0
  10. package/adapters/extension/launch-webpack.cjs +83 -0
  11. package/adapters/extension/launch.sh +8 -11
  12. package/adapters/extension/live.sh +2 -0
  13. package/adapters/extension/readiness.mjs +0 -0
  14. package/adapters/extension/reattach.sh +1 -0
  15. package/adapters/extension/refresh-build.sh +0 -0
  16. package/adapters/extension/seed-fixture.sh +4 -12
  17. package/adapters/extension/sidepanel-toggle.sh +4 -1
  18. package/adapters/extension/snapshot-dist.sh +0 -0
  19. package/adapters/extension/stamp-runtime-title.cjs +49 -0
  20. package/adapters/extension/start-watch.sh +16 -4
  21. package/adapters/extension/stop-viewers.sh +1 -1
  22. package/adapters/extension/sync-webpack-dist.cjs +105 -0
  23. package/adapters/extension/verify.sh +1 -1
  24. package/adapters/extension/wallet-fixture-state.cjs +0 -0
  25. package/adapters/manifest.json +46 -38
  26. package/adapters/mobile/bridge-runtime/cdp-bridge.cjs +0 -0
  27. package/adapters/mobile/bridge-runtime/console-forwarder.cjs +1 -1
  28. package/adapters/mobile/bridge-runtime/lib/target-discovery.cjs +2 -3
  29. package/adapters/mobile/bridge-runtime/setup-wallet.sh +0 -0
  30. package/adapters/mobile/cleanup.sh +16 -176
  31. package/adapters/mobile/inject.sh +88 -671
  32. package/adapters/mobile/launch-console-forwarder.cjs +39 -0
  33. package/adapters/mobile/lib/metro-listener.sh +0 -0
  34. package/adapters/mobile/lib/tmux-viewer.sh +0 -0
  35. package/adapters/mobile/open-device.sh +0 -0
  36. package/adapters/mobile/prewarm-bundle.sh +0 -0
  37. package/adapters/mobile/start-console-forwarder.sh +70 -0
  38. package/adapters/mobile/start-metro.sh +0 -41
  39. package/adapters/mobile/stop-metro.sh +0 -0
  40. package/adapters/mobile/verify.sh +4 -61
  41. package/adapters/mobile/wait-for-bridge.sh +0 -0
  42. package/adapters/mobile/yarn-setup.sh +0 -0
  43. package/adapters/shared/activate-repo-node.sh +0 -0
  44. package/adapters/shared/activate-repo-ruby.sh +0 -0
  45. package/adapters/shared/cli-ux.sh +0 -0
  46. package/adapters/shared/ensure-runner-deps.sh +0 -0
  47. package/adapters/shared/harness-path.sh +0 -0
  48. package/adapters/shared/hash-helpers.sh +0 -0
  49. package/adapters/shared/install-repo-deps.sh +0 -0
  50. package/adapters/shared/json-field.sh +0 -0
  51. package/adapters/shared/open-debug.mjs +90 -36
  52. package/adapters/shared/open-log-window.sh +0 -0
  53. package/adapters/shared/reap-checkout-metros.sh +0 -0
  54. package/adapters/shared/resolve-slot-ports-core.mjs +0 -6
  55. package/adapters/shared/resolve-slot-ports.mjs +0 -0
  56. package/adapters/shared/resolve-slot-ports.sh +0 -5
  57. package/adapters/shared/sync-wallet-fixture.sh +0 -0
  58. package/adapters/shared/tmux-session.sh +0 -0
  59. package/adapters/shared/tmux-viewer.sh +0 -0
  60. package/adapters/shared/update-check-worker.mjs +37 -0
  61. package/dist/adapters/extension/console-capture.js +84 -0
  62. package/dist/adapters/extension/runtime-decision.js +14 -2
  63. package/dist/adapters/extension/surface.js +3 -2
  64. package/dist/adapters/mobile/prepare.js +22 -7
  65. package/dist/adapters/mobile/surface.js +1 -1
  66. package/dist/adapters/resolve-slot-ports.js +0 -2
  67. package/dist/adapters/slot-ports.js +8 -0
  68. package/dist/cli.js +3 -11
  69. package/dist/commands/call.js +9 -4
  70. package/dist/commands/debug.js +38 -31
  71. package/dist/commands/fixtures.js +18 -10
  72. package/dist/commands/launch/index.js +10 -0
  73. package/dist/commands/logs.js +8 -6
  74. package/dist/commands/manifest.js +5 -17
  75. package/dist/commands/run-engine.js +1 -32
  76. package/dist/commands/run-report.js +1 -1
  77. package/dist/commands/run.js +50 -3
  78. package/dist/commands/status-probe.js +1 -1
  79. package/dist/commands/update.js +15 -28
  80. package/dist/doctor.js +1 -4
  81. package/dist/harness.js +5 -123
  82. package/dist/live-adapter-contract.js +6 -20
  83. package/dist/mm-harness-cli.js +6 -43
  84. package/dist/paths.js +2 -5
  85. package/dist/run-diagnostics.js +35 -40
  86. package/dist/runtime-context.js +26 -8
  87. package/docs/CHEATSHEET.md +39 -52
  88. package/docs/CLI-ERGONOMICS-HUMAN-QA.md +48 -104
  89. package/docs/CODE-MAP.md +1 -1
  90. package/docs/VIDEO-DEMO-VALIDATION.md +62 -0
  91. package/docs/architecture.md +65 -375
  92. package/docs/live-adapter-contract.md +3 -1
  93. package/library/actions/core/perps/_controller.mjs +10 -55
  94. package/library/manifests/mobile.action-manifest.json +1 -1
  95. package/package.json +2 -2
  96. package/scripts/completions.sh +0 -0
  97. package/scripts/install-completions.sh +0 -0
  98. package/adapters/mobile/overlay/app/dev-tools/AgenticService/AgentStepHud.tsx.patch +0 -185
  99. package/adapters/mobile/overlay/app/dev-tools/AgenticService/AgenticService.ts.patch +0 -1662
  100. package/adapters/mobile/overlay/compat/README.md +0 -28
  101. package/adapters/mobile/overlay/compat/rn81-message-event-source.patch +0 -42
  102. package/adapters/shared/resolve-farmslot-ports-core.mjs +0 -3
  103. package/adapters/shared/resolve-farmslot-ports.mjs +0 -5
  104. package/adapters/shared/resolve-farmslot-ports.sh +0 -7
  105. package/docs/CLI-SPEC.md +0 -1142
  106. package/docs/MENTAL-MODEL.md +0 -295
@@ -1,28 +0,0 @@
1
- # Compatibility overlays (historical-commit replay)
2
-
3
- NOT dead code. These overlays exist for replay/eval runs against OLD product
4
- commits — e.g. re-running a historical task on a fixed baseline to validate
5
- prompt or harness changes. A "zero current references" scan will always come
6
- up empty here by design: the feature's purpose is non-current checkouts.
7
-
8
- - Purpose: make historical product checkouts bootable/bridgeable under the
9
- current local toolchain so Recipe v1 evals can replay against them.
10
- - When it applies: mobile checkouts predating React Native 0.81 polyfill fixes.
11
- - How it is applied: MANUALLY (no automatic apply logic in this repo).
12
- The operator or the `/recipe-harness` skill applies the patch reversibly
13
- before a historical rebuild (`git apply <patch>` in the product checkout,
14
- `git apply -R` to remove) and records the overlay path in validation
15
- evidence. `adapters/mobile/inject.sh` does NOT apply these.
16
-
17
- Kept in the external runner repository, not Farmslot root scripts, so a
18
- `/recipe-harness` skill can apply the same reversible overlay before a
19
- historical rebuild and record the overlay path in validation evidence.
20
-
21
- Listed in adapters/manifest.json (kind: compat-overlay) so the doctor
22
- verifies the surface and this directory is never flagged as unused again.
23
-
24
- ## Patches
25
-
26
- - `rn81-message-event-source.patch`: adds a read-only `MessageEvent.prototype.source`
27
- getter for React Native 0.81 historical checkouts whose bundled polyfill omits
28
- it while CDP websocket clients expect browser-compatible `MessageEvent` shape.
@@ -1,42 +0,0 @@
1
- compat-overlay: rn81-message-event-source (historical-checkout replay support)
2
-
3
- What: patches metamask-mobile shim.js to add a read-only
4
- MessageEvent.prototype.source getter.
5
- Why: the harness CDP bridge expects browser-compatible MessageEvent shape;
6
- pre-RN-0.81 checkouts ship a polyfill that omits .source, so the bridge
7
- cannot attach when replaying tasks on those historical commits.
8
- When: only when replaying/evaluating against mobile checkouts older than the
9
- RN 0.81 upgrade (pre-RN-0.81 checkouts). Never needed on current main.
10
- How: applied MANUALLY in the historical product checkout —
11
- git apply <this file> (and `git apply -R` to remove)
12
- No automatic apply logic exists in this repo. See ../README.md.
13
-
14
- diff --git a/shim.js b/shim.js
15
- --- a/shim.js
16
- +++ b/shim.js
17
- @@
18
- if (typeof global.MessageEvent === 'undefined') {
19
- global.MessageEvent =
20
- require('react-native/src/private/webapis/html/events/MessageEvent').default;
21
- }
22
-
23
- +// Historical runner compatibility: React Native 0.81's MessageEvent polyfill
24
- +// can omit the browser `source` getter expected by CDP websocket clients under
25
- +// newer Xcode/Hermes toolchains. Keep the getter read-only and null, matching
26
- +// browser MessageEvent semantics for non-window messages.
27
- +if (
28
- + global.MessageEvent?.prototype &&
29
- + !Object.getOwnPropertyDescriptor(global.MessageEvent.prototype, 'source')
30
- +) {
31
- + Object.defineProperty(global.MessageEvent.prototype, 'source', {
32
- + configurable: true,
33
- + enumerable: true,
34
- + get() {
35
- + return null;
36
- + },
37
- + });
38
- +}
39
- +
40
- class AbortError extends Error {
41
- constructor(message) {
42
- super(message);
@@ -1,3 +0,0 @@
1
- // Back-compat shim: the port-resolution core is now resolve-slot-ports-core.mjs.
2
- // Re-exports it verbatim for one release so importers of the old path keep resolving.
3
- export * from './resolve-slot-ports-core.mjs';
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- // Back-compat shim: this leaf is now resolve-slot-ports.mjs. Delegates to it for one
3
- // release so `node resolve-farmslot-ports.mjs <fn> <repo>` keeps working (the new CLI
4
- // reads the same argv positions on import).
5
- import './resolve-slot-ports.mjs';
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Back-compat shim: this wrapper is now resolve-slot-ports.sh. Sources it for one
3
- # release so old callers keep the same sourced function names (including the
4
- # resolve_farmslot_ports_by_repo alias defined there).
5
- _SHIM_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
- # shellcheck disable=SC1091
7
- . "$_SHIM_DIR/resolve-slot-ports.sh"