@deeeed/metamask-harness 0.15.0 → 0.15.1
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 +6 -0
- package/bin/mm-harness +7 -0
- package/dist/commands/doctor.js +15 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.15.1 - 2026-07-13
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `doctor --fix` recovery `nextActions` (numbered fixture choices, overlay install, runtime-context retry) now embed the resolved `--adapter` and absolute `--target`, shell-quoted, so each command works verbatim from any cwd. They are also prefixed with the resolved `bin/mm-harness` executable path, so they work in task-local installs where `mm-harness` is not on PATH.
|
|
10
|
+
|
|
5
11
|
## 0.15.0 - 2026-07-13
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/bin/mm-harness
CHANGED
|
@@ -50,6 +50,13 @@ if [ -n "${MM_HARNESS_BIN:-}" ]; then
|
|
|
50
50
|
fi
|
|
51
51
|
fi
|
|
52
52
|
|
|
53
|
+
# Internal executable identity (not part of the public env surface): the CLI
|
|
54
|
+
# embeds this in emitted recovery commands so they run verbatim even when
|
|
55
|
+
# mm-harness is not on PATH (task-local installs). Set AFTER the MM_HARNESS_BIN
|
|
56
|
+
# delegation above so the final executable entered always overwrites any
|
|
57
|
+
# inherited/stale value with its own resolved self path.
|
|
58
|
+
export MM_HARNESS_EXECUTABLE="$SCRIPT_DIR/$(basename "$SOURCE")"
|
|
59
|
+
|
|
53
60
|
ENTRY_TS="$RUNNER_DIR/src/mm-harness-cli.ts"
|
|
54
61
|
ENTRY_DIST="$RUNNER_DIR/dist/mm-harness-cli.js"
|
|
55
62
|
|
package/dist/commands/doctor.js
CHANGED
|
@@ -4,7 +4,7 @@ import fs from "node:fs";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { color } from "../cli-color.js";
|
|
6
6
|
import { createDoctorReport, fixtureSummary, renderRuntimeContext, requiredDoctorCheckSummary } from "../doctor.js";
|
|
7
|
-
import { detectAdapter } from "../harness.js";
|
|
7
|
+
import { detectAdapter, resolveRuntimeContextPath } from "../harness.js";
|
|
8
8
|
import { assertAdapter, runnerDir } from "../paths.js";
|
|
9
9
|
import { getAdapterSurface } from "../adapters/surface.js";
|
|
10
10
|
import { ensureMobilePerpsEnvironment, mobilePerpsEnvironment } from "../adapters/mobile/perps-env.js";
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
applyRuntimeDirOption,
|
|
28
28
|
optionFlag,
|
|
29
29
|
optionString,
|
|
30
|
+
shellQuote,
|
|
30
31
|
targetPath
|
|
31
32
|
} from "./parse-args.js";
|
|
32
33
|
function applyDoctorRuntimePorts(options) {
|
|
@@ -95,7 +96,7 @@ async function handleDoctor({ options }) {
|
|
|
95
96
|
lock.release();
|
|
96
97
|
}
|
|
97
98
|
const result2 = createDoctorReport(adapter, target, manifestValidation, actionManifestPath);
|
|
98
|
-
const nextActions = doctorFixNextActions(failed, result2.fixture);
|
|
99
|
+
const nextActions = doctorFixNextActions(failed, result2.fixture, adapter, target);
|
|
99
100
|
const status = result2.status === "pass" && failed.length === 0 ? "pass" : "fail";
|
|
100
101
|
if (json) console.log(JSON.stringify({ ...result2, status, fixed, failed, nextActions }, null, 2));
|
|
101
102
|
else {
|
|
@@ -215,15 +216,21 @@ function doctorRuntimeCheck(runtime, error, expectLive) {
|
|
|
215
216
|
detail: runtime?.reasons.join(" | ") || "Runtime readiness probe returned no result."
|
|
216
217
|
};
|
|
217
218
|
}
|
|
218
|
-
function doctorFixNextActions(failed, fixture) {
|
|
219
|
+
function doctorFixNextActions(failed, fixture, adapter, target) {
|
|
219
220
|
const actions = [];
|
|
221
|
+
const executable = process.env.MM_HARNESS_EXECUTABLE ? shellQuote(process.env.MM_HARNESS_EXECUTABLE) : "mm-harness";
|
|
222
|
+
const scope = `--adapter ${adapter} --target ${shellQuote(target)}`;
|
|
220
223
|
if (failed.includes("wallet-fixture")) {
|
|
221
224
|
const force = fixture.status === "invalid" || fixture.status === "incomplete" ? " --force" : "";
|
|
222
|
-
actions.push(`1)
|
|
223
|
-
actions.push(`2)
|
|
225
|
+
actions.push(`1) ${executable} fixtures init --from <path>${force} ${scope} # existing team/test fixture`);
|
|
226
|
+
actions.push(`2) ${executable} fixtures init --dev${force} ${scope} # disposable public test wallet; never real funds`);
|
|
224
227
|
}
|
|
225
|
-
if (failed.includes("runtime-context"))
|
|
226
|
-
|
|
228
|
+
if (failed.includes("runtime-context")) {
|
|
229
|
+
actions.push(
|
|
230
|
+
`inspect ${shellQuote(resolveRuntimeContextPath(target))}, then retry ${executable} doctor --fix ${scope}`
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
if (failed.includes("overlay")) actions.push(`${executable} install ${scope}`);
|
|
227
234
|
return actions;
|
|
228
235
|
}
|
|
229
236
|
function emitExpectLiveVerdict(adapter, target, runtime, verdict) {
|
|
@@ -389,6 +396,7 @@ function readTextSnapshot(file) {
|
|
|
389
396
|
}
|
|
390
397
|
}
|
|
391
398
|
export {
|
|
399
|
+
doctorFixNextActions,
|
|
392
400
|
ensureExtensionPerpsBuildFlag,
|
|
393
401
|
handleDoctor
|
|
394
402
|
};
|