@deeeed/metamask-harness 0.57.0 → 0.59.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/dist/harness.js CHANGED
@@ -259,16 +259,7 @@ Next: mm-harness install --platform core --target ${target}`
259
259
  }
260
260
  return { command: delegate, prefixArgs: ["doctor", "--adapter", "core"] };
261
261
  }
262
- const installedScript = path.join(recipeHarnessPath(target, adapter), "scripts", `${action}.sh`);
263
- if (fs.existsSync(installedScript)) {
264
- return { command: installedScript, prefixArgs: [] };
265
- }
266
- const command = resolveEntry(
267
- runnerDir,
268
- [`adapters/${adapter}/${action}.sh`, `scripts/${adapter}/${action}.sh`],
269
- "file"
270
- );
271
- return { command, prefixArgs: [] };
262
+ return { inProcess: adapter === "mobile" ? "mobile-verify" : "extension-verify" };
272
263
  }
273
264
  async function handleHarness(argv) {
274
265
  const action = argv[0];
@@ -336,6 +327,29 @@ async function handleHarness(argv) {
336
327
  console.error(colorHumanMessage(`\u2192 ${harnessAction} (${adapter}${detected}) \u2014 target: ${target}`));
337
328
  }
338
329
  const start = Date.now();
330
+ if ("inProcess" in dispatch) {
331
+ const runVerify = dispatch.inProcess === "mobile-verify" ? (await import("./adapters/mobile/verify.js")).runMobileVerify : (await import("./adapters/extension/verify.js")).runExtensionVerify;
332
+ let exitCode;
333
+ try {
334
+ exitCode = await runVerify(forwardArgs, {
335
+ out: quiet ? () => {
336
+ } : (line) => {
337
+ (json ? process.stderr : process.stdout).write(`${line}
338
+ `);
339
+ },
340
+ err: quiet ? () => {
341
+ } : (line) => {
342
+ process.stderr.write(`${line}
343
+ `);
344
+ }
345
+ });
346
+ } catch (error) {
347
+ if (!quiet) process.stderr.write(`${error instanceof Error ? error.message : String(error)}
348
+ `);
349
+ exitCode = 1;
350
+ }
351
+ return reportHarnessOutcome(harnessAction, adapter, target, exitCode, autoDetected, json, quiet, start);
352
+ }
339
353
  if (shellLeafMissing(dispatch.command)) {
340
354
  const message = missingShellLeafMessage(dispatch.command);
341
355
  if (quiet) {
@@ -363,7 +377,6 @@ async function handleHarness(argv) {
363
377
  stdio: quiet ? "ignore" : json ? ["inherit", 2, "inherit"] : "inherit",
364
378
  env: process.env
365
379
  });
366
- const seconds = ((Date.now() - start) / 1e3).toFixed(1);
367
380
  if (result.error) {
368
381
  if (quiet) {
369
382
  return 1;
@@ -381,27 +394,30 @@ async function handleHarness(argv) {
381
394
  }
382
395
  return 1;
383
396
  }
384
- const exitCode = result.status ?? 1;
397
+ return reportHarnessOutcome(harnessAction, adapter, target, result.status ?? 1, autoDetected, json, quiet, start);
398
+ }
399
+ function reportHarnessOutcome(action, adapter, target, exitCode, autoDetected, json, quiet, start) {
400
+ const seconds = ((Date.now() - start) / 1e3).toFixed(1);
385
401
  if (quiet) {
386
402
  return exitCode;
387
403
  } else if (json) {
388
404
  console.log(
389
405
  harnessSummary(
390
- harnessAction,
406
+ action,
391
407
  adapter,
392
408
  target,
393
409
  exitCode === 0 ? "pass" : "fail",
394
410
  exitCode,
395
411
  autoDetected,
396
- exitCode === 0 ? void 0 : { code: "HARNESS_FAILED", message: `${harnessAction} ${adapter} failed (exit ${exitCode})`, userAction: failureHint(adapter, harnessAction) }
412
+ exitCode === 0 ? void 0 : { code: "HARNESS_FAILED", message: `${action} ${adapter} failed (exit ${exitCode})`, userAction: failureHint(adapter, action) }
397
413
  )
398
414
  );
399
415
  } else if (exitCode === 0) {
400
- console.error(colorHumanMessage(`\u2713 ${harnessAction} ${adapter} passed (${seconds}s)
401
- Next: ${successNext(adapter, harnessAction, target)}`));
416
+ console.error(colorHumanMessage(`\u2713 ${action} ${adapter} passed (${seconds}s)
417
+ Next: ${successNext(adapter, action, target)}`));
402
418
  } else {
403
- console.error(colorHumanMessage(`\u2717 ${harnessAction} ${adapter} failed (exit ${exitCode}, ${seconds}s)
404
- ${failureHint(adapter, harnessAction)}`));
419
+ console.error(colorHumanMessage(`\u2717 ${action} ${adapter} failed (exit ${exitCode}, ${seconds}s)
420
+ ${failureHint(adapter, action)}`));
405
421
  }
406
422
  return exitCode;
407
423
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeeed/metamask-harness",
3
- "version": "0.57.0",
3
+ "version": "0.59.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mm-harness": "bin/mm-harness"
@@ -20,7 +20,7 @@
20
20
  "check:syntax": "find . -name '*.mjs' -print0 | xargs -0 -n1 node --check"
21
21
  },
22
22
  "dependencies": {
23
- "@farmslot/agent-runtime": "0.11.0",
23
+ "@farmslot/agent-runtime": "0.12.0",
24
24
  "@farmslot/expo-recipe": "0.10.0",
25
25
  "@farmslot/handoff": "^0.3.1",
26
26
  "@farmslot/protocol": "0.29.0",