feat(wallet-cli): add daemon commands, dev-mode launchers, and e2e smoke test#9255
Draft
sirtimid wants to merge 4 commits into
Draft
feat(wallet-cli): add daemon commands, dev-mode launchers, and e2e smoke test#9255sirtimid wants to merge 4 commits into
sirtimid wants to merge 4 commits into
Conversation
…oke test Add the `mm daemon` command suite — `start`, `stop`, `status`, `purge`, and `call` — completing the CLI's user-facing surface, plus the oclif test harness (`src/test/run-command.ts`) and the dev-mode launchers (`bin/dev.mjs`, `bin/dev.cmd`) deferred from the scaffold slice. The commands are Erik's verbatim; their imported daemon interfaces all match the modules already on `main` from the persistence/transport/factory slices. Also add `tsx` as the dev-mode `--import` loader (with a knip `ignoreDependencies` entry, since it's referenced only as an argument string), exclude the test harness from coverage, and add a real-construction e2e smoke test that feeds `buildInstanceOptions` into a real `Wallet` against `:memory:` — closing the gap that the mocked unit test cannot reach. Documents the `mm daemon` usage in the README and adds an ARCHITECTURE.md describing the daemon → factory → persistence → transport layering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tion
README documented MM_DAEMON_DATA_DIR as the data-dir override, but that's only
the internal start->daemon spawn-contract var (overwritten with config.dataDir
and ignored by the other commands). The real user override is MM_DATA_DIR, the
oclif scopedEnvVar('DATA_DIR'). Also assert the e2e's first account is a real
SRP-derived EVM address, so it fails loudly on an empty/placeholder account.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
The final landing slice for
@metamask/wallet-cli, after the scaffold (#9065), persistence (#9067), transport (#9108), and factory (#9226) slices. It adds the user-facing command surface so the package is actually runnable:src/commands/daemon/{start,stop,status,purge,call}.ts(+ tests) — themm daemoncommand suite. Thin oclif command classes over the daemon layers already onmain:startspawns the daemon and reports the socket (or that one is already running),status/stopping and tear it down,purgedeletes the whitelisted daemon state files, andcalldispatches an arbitraryController:methodmessenger action and prints the result.src/test/run-command.ts— the oclif test harness used by the command tests (excluded from coverage viacoveragePathIgnorePatterns).bin/dev.mjs+bin/dev.cmd— the dev-mode launchers deferred from the scaffold slice, run via thetsxloader.The command files are lifted verbatim from Erik's
rekm/wallet-cli; their imported daemon interfaces (ensureDaemon,pingDaemon/sendCommand,stopDaemon,getDaemonPaths,readPidFile,confirmPurge, …) all match the modules already landed onmain, so no rewrites were needed.Additional, beyond Erik's verbatim files:
tsxdev dependency added as the dev-mode--importloader, with aknipignoreDependencies: ['tsx']entry since it's referenced only as an argument string (indaemon-spawn's source-entry path andbin/dev), never as a traceable import.wallet-factory.e2e.test.ts— a real-construction smoke test that feedsbuildInstanceOptionsinto a realWallet(no@metamask/walletmock) against:memory:, asserts the keyring unlocks on first-run SRP import, and dispatches a messenger action. This closes the one gap flagged in feat(wallet-cli): add wallet factory and daemon entry point #9226 review: the mocked unit test never feeds the wiredinstanceOptionsto a real wallet. Constructing aWalletnever triggers the RemoteFeatureFlagController's network fetch, so it stays offline/CI-safe.mm --help+ the daemon smoke flow) and a per-packageARCHITECTURE.mddescribing the daemon → factory → persistence → transport layering.Stacked on #9226; the diff collapses to the true delta once that merges.
Checklist
build,test(100% coverage),lint(eslint, oxfmt, constraints, knip, changelog), andchangelog:validatepass.