@deeeed/metamask-harness 0.14.5 → 0.15.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.
- package/CHANGELOG.md +96 -6
- package/adapters/extension/ensure-browser.sh +4 -2
- package/adapters/extension/launch-browser.cjs +73 -34
- package/adapters/extension/live.sh +21 -10
- package/adapters/extension/reattach.sh +3 -3
- package/adapters/extension/sidepanel-toggle.sh +10 -4
- package/adapters/extension/start-watch.sh +2 -2
- package/adapters/extension/verify.sh +19 -2
- package/adapters/extension/wallet-fixture-state.cjs +14 -1
- package/adapters/manifest.json +19 -3
- package/adapters/mobile/bridge-runtime/setup-wallet.sh +6 -4
- package/adapters/mobile/launch-metro.cjs +74 -0
- package/adapters/mobile/lib/tmux-viewer.sh +4 -4
- package/adapters/mobile/open-device.sh +3 -1
- package/adapters/mobile/start-metro.sh +12 -18
- package/adapters/mobile/stop-metro.sh +1 -0
- package/adapters/mobile/verify.sh +5 -5
- package/adapters/shared/install-repo-deps.sh +29 -0
- package/adapters/shared/open-debug.mjs +35 -4
- package/adapters/shared/open-log-window.sh +1 -1
- package/adapters/shared/resolve-slot-ports-core.mjs +72 -1
- package/adapters/shared/resolve-slot-ports.sh +21 -17
- package/adapters/shared/tmux-session.sh +0 -5
- package/adapters/shared/tmux-viewer.sh +7 -2
- package/dist/adapters/core/surface.js +3 -0
- package/dist/adapters/extension/ensure-ready.js +0 -7
- package/dist/adapters/extension/runtime-decision.js +93 -3
- package/dist/adapters/extension/surface.js +17 -6
- package/dist/adapters/mobile/metro-env.js +67 -0
- package/dist/adapters/mobile/perps-env.js +101 -0
- package/dist/adapters/mobile/prepare.js +32 -14
- package/dist/adapters/mobile/runtime-decision.js +21 -2
- package/dist/adapters/mobile/source-freshness.js +116 -0
- package/dist/adapters/mobile/surface.js +5 -1
- package/dist/adapters/resolve-slot-ports.js +4 -0
- package/dist/adapters/slot-ports.js +131 -49
- package/dist/adapters.js +7 -2
- package/dist/checkout-lock.js +72 -0
- package/dist/cli-commands.js +1 -1
- package/dist/cli.js +2 -0
- package/dist/commands/call.js +91 -54
- package/dist/commands/check.js +266 -46
- package/dist/commands/checklist.js +136 -0
- package/dist/commands/debug.js +21 -2
- package/dist/commands/doctor.js +233 -18
- package/dist/commands/farmslot-ready.js +25 -0
- package/dist/commands/fixtures.js +177 -42
- package/dist/commands/launch/extension.js +6 -1
- package/dist/commands/launch/index.js +54 -22
- package/dist/commands/logs.js +24 -4
- package/dist/commands/parse-args.js +1 -0
- package/dist/commands/run-engine.js +223 -7
- package/dist/commands/run.js +67 -50
- package/dist/commands/shared.js +86 -5
- package/dist/commands/stop.js +1 -2
- package/dist/doctor.js +39 -17
- package/dist/harness.js +5 -2
- package/dist/heal-bounds.js +1 -1
- package/dist/mm-harness-cli.js +41 -12
- package/dist/runner.js +35 -5
- package/dist/runtime-context.js +228 -0
- package/docs/CLI-SPEC.md +15 -11
- package/docs/MENTAL-MODEL.md +6 -6
- package/library/actions/extension/perps/perps.mjs +29 -8
- package/library/actions/extension/platform/cdp.mjs +128 -28
- package/library/actions/extension/ui/navigate.mjs +1 -1
- package/library/actions/mobile/perps/perps.mjs +13 -1
- package/library/actions/mobile/platform/bridge.mjs +302 -29
- package/library/actions/mobile/wallet/ensure_unlocked.mjs +7 -2
- package/library/manifests/extension.action-manifest.json +32 -12
- package/library/manifests/mobile.action-manifest.json +25 -3
- package/package.json +4 -4
- package/scripts/completions.sh +7 -4
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
},
|
|
119
119
|
"hash": {
|
|
120
120
|
"type": "string",
|
|
121
|
-
"description": "Raw extension hash, e.g.
|
|
121
|
+
"description": "Raw extension hash, e.g. #/perps-home."
|
|
122
122
|
},
|
|
123
123
|
"path": {
|
|
124
124
|
"type": "string",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"description": "Fallback to a raw extension hash when no alias exists",
|
|
149
149
|
"node": {
|
|
150
150
|
"action": "ui.navigate",
|
|
151
|
-
"hash": "
|
|
151
|
+
"hash": "#/perps-home",
|
|
152
152
|
"intent": "Open a raw extension route"
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -190,6 +190,24 @@
|
|
|
190
190
|
},
|
|
191
191
|
"ui.wait_for": {
|
|
192
192
|
"description": "Wait for a UI condition through the Extension CDP adapter.",
|
|
193
|
+
"schema": {
|
|
194
|
+
"type": "object",
|
|
195
|
+
"properties": {
|
|
196
|
+
"action": { "const": "ui.wait_for" },
|
|
197
|
+
"selector": { "type": "string" },
|
|
198
|
+
"text": { "type": "string" },
|
|
199
|
+
"expected": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"enum": ["present", "absent", "visible", "hidden", "not_present"]
|
|
202
|
+
},
|
|
203
|
+
"visible": {
|
|
204
|
+
"type": "boolean",
|
|
205
|
+
"description": "Convenience alias: true means expected=visible; false means expected=absent."
|
|
206
|
+
},
|
|
207
|
+
"timeout_ms": { "type": "number" }
|
|
208
|
+
},
|
|
209
|
+
"required": ["action"]
|
|
210
|
+
},
|
|
193
211
|
"examples": [
|
|
194
212
|
{
|
|
195
213
|
"node": {
|
|
@@ -197,11 +215,20 @@
|
|
|
197
215
|
"text": "Perps",
|
|
198
216
|
"intent": "Wait for visible Extension text"
|
|
199
217
|
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"node": {
|
|
221
|
+
"action": "ui.wait_for",
|
|
222
|
+
"selector": "[data-testid=example]",
|
|
223
|
+
"visible": false,
|
|
224
|
+
"timeout_ms": 2000,
|
|
225
|
+
"intent": "Prove an Extension element is absent"
|
|
226
|
+
}
|
|
200
227
|
}
|
|
201
228
|
]
|
|
202
229
|
},
|
|
203
230
|
"ui.screenshot": {
|
|
204
|
-
"description": "Capture visual evidence through capture-helper
|
|
231
|
+
"description": "Capture registered visual evidence through capture-helper, bounded Chrome-native capture, or an explicitly labeled computed-style DOM raster fallback. Always read the resulting PNG; artifact metadata records the provider.",
|
|
205
232
|
"examples": [
|
|
206
233
|
{
|
|
207
234
|
"node": {
|
|
@@ -1717,15 +1744,8 @@
|
|
|
1717
1744
|
}
|
|
1718
1745
|
},
|
|
1719
1746
|
"page": {
|
|
1720
|
-
"
|
|
1721
|
-
|
|
1722
|
-
"type": "string"
|
|
1723
|
-
},
|
|
1724
|
-
{
|
|
1725
|
-
"const": false
|
|
1726
|
-
}
|
|
1727
|
-
],
|
|
1728
|
-
"description": "Final page target; false skips navigation for teardown."
|
|
1747
|
+
"type": "string",
|
|
1748
|
+
"description": "Initial Perps page target; omit it to use the profile or market default. Extension start_state always enters Perps before convergence."
|
|
1729
1749
|
},
|
|
1730
1750
|
"positions": {
|
|
1731
1751
|
"oneOf": [
|
|
@@ -191,6 +191,20 @@
|
|
|
191
191
|
},
|
|
192
192
|
"ui.wait_for": {
|
|
193
193
|
"description": "Wait for a mounted React Native testID/test_id. Optional text validates text returned by that testID; text alone is not supported on Mobile.",
|
|
194
|
+
"schema": {
|
|
195
|
+
"type": "object",
|
|
196
|
+
"properties": {
|
|
197
|
+
"action": { "const": "ui.wait_for" },
|
|
198
|
+
"test_id": { "type": "string" },
|
|
199
|
+
"text": { "type": "string" },
|
|
200
|
+
"expected": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"enum": ["present", "absent", "hidden", "not_present"]
|
|
203
|
+
},
|
|
204
|
+
"timeout_ms": { "type": "number" }
|
|
205
|
+
},
|
|
206
|
+
"required": ["action", "test_id"]
|
|
207
|
+
},
|
|
194
208
|
"examples": [
|
|
195
209
|
{
|
|
196
210
|
"node": {
|
|
@@ -199,11 +213,19 @@
|
|
|
199
213
|
"expected": "present",
|
|
200
214
|
"intent": "Wait for a React Native testID to be mounted"
|
|
201
215
|
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"node": {
|
|
219
|
+
"action": "ui.wait_for",
|
|
220
|
+
"test_id": "conditional-banner",
|
|
221
|
+
"expected": "absent",
|
|
222
|
+
"intent": "Prove a React Native testID is not mounted"
|
|
223
|
+
}
|
|
202
224
|
}
|
|
203
225
|
]
|
|
204
226
|
},
|
|
205
227
|
"ui.screenshot": {
|
|
206
|
-
"description": "Capture
|
|
228
|
+
"description": "Capture registered PNG evidence with xcrun simctl on iOS or adb screencap on Android. Artifact metadata records the native provider, command mode, and selected device; invalid or empty PNG output fails before registration.",
|
|
207
229
|
"examples": [
|
|
208
230
|
{
|
|
209
231
|
"node": {
|
|
@@ -676,7 +698,7 @@
|
|
|
676
698
|
]
|
|
677
699
|
},
|
|
678
700
|
"metamask.perps.start_state": {
|
|
679
|
-
"description": "Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested. Recommended configurable Perps start state that composes reusable domain operations before the proof window.",
|
|
701
|
+
"description": "Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested. Recommended configurable Perps start state that first restores the fixture-backed unlocked wallet, then composes reusable domain operations before the proof window.",
|
|
680
702
|
"examples": [
|
|
681
703
|
{
|
|
682
704
|
"description": "Clean BTC testnet market state",
|
|
@@ -1689,7 +1711,7 @@
|
|
|
1689
1711
|
{
|
|
1690
1712
|
"name": "metamask.perps.start_state",
|
|
1691
1713
|
"owner": "metamask",
|
|
1692
|
-
"description": "mobile Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested. Recommended configurable Perps start state that composes reusable domain operations before the proof window.",
|
|
1714
|
+
"description": "mobile Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested. Recommended configurable Perps start state that first restores the fixture-backed unlocked wallet, then composes reusable domain operations before the proof window.",
|
|
1693
1715
|
"schema": {
|
|
1694
1716
|
"type": "object",
|
|
1695
1717
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deeeed/metamask-harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mm-harness": "bin/mm-harness"
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"check:syntax": "find . -name '*.mjs' -print0 | xargs -0 -n1 node --check"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@farmslot/agent-runtime": "^0.
|
|
20
|
-
"@farmslot/protocol": "^0.
|
|
21
|
-
"@farmslot/recipe-harness": "^0.
|
|
19
|
+
"@farmslot/agent-runtime": "^0.2.0",
|
|
20
|
+
"@farmslot/protocol": "^0.8.0",
|
|
21
|
+
"@farmslot/recipe-harness": "^0.5.0",
|
|
22
22
|
"commander": "^12.0.0",
|
|
23
23
|
"viem": "^2.54.3",
|
|
24
24
|
"ws": "8.21.0"
|
package/scripts/completions.sh
CHANGED
|
@@ -29,7 +29,7 @@ _mmh_bin() {
|
|
|
29
29
|
return 1
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
_mmh_commands="launch stop logs debug fixtures actions call flows run doctor install verify cleanup completions"
|
|
32
|
+
_mmh_commands="launch stop logs debug fixtures actions call flows run doctor check checklist recipe-quality install verify cleanup completions"
|
|
33
33
|
|
|
34
34
|
# Per-command flags (static, from the mm-harness surface).
|
|
35
35
|
_mmh_flags_for() {
|
|
@@ -38,7 +38,8 @@ _mmh_flags_for() {
|
|
|
38
38
|
stop) printf '%s' "--port --target --json" ;;
|
|
39
39
|
logs) printf '%s' "--full --events --source --adapter --target --json" ;;
|
|
40
40
|
debug) printf '%s' "--worker --dev-menu --adapter --target --json" ;;
|
|
41
|
-
fixtures) printf '%s' "--fixture --adapter --target --json" ;;
|
|
41
|
+
fixtures) printf '%s' "--from --dev --force --fixture --adapter --target --json" ;;
|
|
42
|
+
checklist) printf '%s' "" ;;
|
|
42
43
|
actions) printf '%s' "--adapter --action --kind --raw --action-manifest --target --json" ;;
|
|
43
44
|
call) printf '%s' "--arg --adapter --target --artifacts-dir --action-manifest --heal --json" ;;
|
|
44
45
|
flows) printf '%s' "--library --json" ;;
|
|
@@ -76,7 +77,8 @@ if [ -n "${BASH_VERSION:-}" ]; then
|
|
|
76
77
|
|
|
77
78
|
case "$cmd" in
|
|
78
79
|
launch) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "ios android" -- "$cur")) ;;
|
|
79
|
-
fixtures) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "sync set" -- "$cur")) ;;
|
|
80
|
+
fixtures) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "init sync set generate finalize" -- "$cur")) ;;
|
|
81
|
+
checklist) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "mark" -- "$cur")) ;;
|
|
80
82
|
completions) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "install bash zsh status" -- "$cur")) ;;
|
|
81
83
|
flows) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "list promote" -- "$cur")) ;;
|
|
82
84
|
call) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "$(_mmh_actions)" -- "$cur")) ;;
|
|
@@ -110,7 +112,8 @@ if [ -n "${ZSH_VERSION:-}" ]; then
|
|
|
110
112
|
|
|
111
113
|
case "$cmd" in
|
|
112
114
|
launch) (( CURRENT == 3 )) && { candidates=(ios android); compadd -a candidates; } ;;
|
|
113
|
-
fixtures) (( CURRENT == 3 )) && { candidates=(sync set); compadd -a candidates; } ;;
|
|
115
|
+
fixtures) (( CURRENT == 3 )) && { candidates=(init sync set generate finalize); compadd -a candidates; } ;;
|
|
116
|
+
checklist) (( CURRENT == 3 )) && { candidates=(mark); compadd -a candidates; } ;;
|
|
114
117
|
completions) (( CURRENT == 3 )) && { candidates=(install bash zsh status); compadd -a candidates; } ;;
|
|
115
118
|
flows) (( CURRENT == 3 )) && { candidates=(list promote); compadd -a candidates; } ;;
|
|
116
119
|
call) (( CURRENT == 3 )) && { candidates=("${(@f)$(_mmh_actions)}"); compadd -a candidates; } ;;
|