feat(wallet-cli): add mm daemon list for callable-surface discovery#9339
Merged
Conversation
sirtimid
added a commit
that referenced
this pull request
Jul 1, 2026
sirtimid
added a commit
that referenced
this pull request
Jul 1, 2026
bf5b16c to
c6ed2ec
Compare
sirtimid
added a commit
that referenced
this pull request
Jul 1, 2026
Follow-up to the `mm daemon list` review: - Distinguish `ECONNRESET` (connection dropped mid-request, likely a daemon crash) from a stopped daemon, rather than telling the user to `mm daemon start` when one is already running. - Name `MM_DATA_DIR` (the user-facing override) instead of the internal `MM_DAEMON_DATA_DIR` in the permission-denied hint. - Extract a shared `formatJsonRpcError` helper and move `isStringArray` into `daemon/utils`; `daemon call` and `daemon list` now both use them. - Parse argv in `daemon list` so unknown flags are rejected (matching `daemon call`). - Fix the `daemon call` action example to a wired controller (`KeyringController:getState`). - Point the connection-error changelog entry at #9339 (was #9343). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sirtimid
added a commit
that referenced
this pull request
Jul 1, 2026
sirtimid
added a commit
that referenced
this pull request
Jul 1, 2026
Follow-up to the `mm daemon list` review: - Distinguish `ECONNRESET` (connection dropped mid-request, likely a daemon crash) from a stopped daemon, rather than telling the user to `mm daemon start` when one is already running. - Name `MM_DATA_DIR` (the user-facing override) instead of the internal `MM_DAEMON_DATA_DIR` in the permission-denied hint. - Extract a shared `formatJsonRpcError` helper and move `isStringArray` into `daemon/utils`; `daemon call` and `daemon list` now both use them. - Parse argv in `daemon list` so unknown flags are rejected (matching `daemon call`). - Fix the `daemon call` action example to a wired controller (`KeyringController:getState`). - Point the connection-error changelog entry at #9339 (was #9343). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
25db423 to
26cca95
Compare
sirtimid
added a commit
that referenced
this pull request
Jul 1, 2026
sirtimid
added a commit
that referenced
this pull request
Jul 1, 2026
Follow-up to the `mm daemon list` review: - Distinguish `ECONNRESET` (connection dropped mid-request, likely a daemon crash) from a stopped daemon, rather than telling the user to `mm daemon start` when one is already running. - Name `MM_DATA_DIR` (the user-facing override) instead of the internal `MM_DAEMON_DATA_DIR` in the permission-denied hint. - Extract a shared `formatJsonRpcError` helper and move `isStringArray` into `daemon/utils`; `daemon call` and `daemon list` now both use them. - Parse argv in `daemon list` so unknown flags are rejected (matching `daemon call`). - Fix the `daemon call` action example to a wired controller (`KeyringController:getState`). - Point the connection-error changelog entry at #9339 (was #9343). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
64ccbdb to
1376aa0
Compare
Add a `daemon list` command that prints the messenger actions the running daemon can dispatch via `daemon call`. The daemon exposes a `listActions` RPC handler backed by the live messenger's `getRegisteredActionTypes()`, so the list can never drift from what `call` actually accepts. `list` renders an indented, counted list on a TTY and a bare, sorted, newline-delimited list when piped (greppable). Also refresh the README usage section and drop the stale `@deprecated AccountsController:listAccounts` example. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Every existing test forced `process.stdout.isTTY` to a concrete boolean, leaving the `?? false` nullish fallback on line 55 uncovered. Widen the `withTTY` helper to accept `undefined` and add a case asserting the bare non-TTY output, restoring 100% branch coverage for `list.ts`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the duplicated connection-error `catch` blocks in `daemon call` and `daemon list` with a shared `makeDaemonConnectionError` helper that maps daemon socket errno codes to a user-facing message. Aligns the handled codes with `classifyUnreachable` (adds `ECONNRESET` and `EPERM`). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to the `mm daemon list` review: - Distinguish `ECONNRESET` (connection dropped mid-request, likely a daemon crash) from a stopped daemon, rather than telling the user to `mm daemon start` when one is already running. - Name `MM_DATA_DIR` (the user-facing override) instead of the internal `MM_DAEMON_DATA_DIR` in the permission-denied hint. - Extract a shared `formatJsonRpcError` helper and move `isStringArray` into `daemon/utils`; `daemon call` and `daemon list` now both use them. - Parse argv in `daemon list` so unknown flags are rejected (matching `daemon call`). - Fix the `daemon call` action example to a wired controller (`KeyringController:getState`). - Point the connection-error changelog entry at #9339 (was #9343). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1376aa0 to
e9a0545
Compare
grypez
approved these changes
Jul 1, 2026
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.
What
mm daemon call <Controller>:<method>can dispatch any registered messenger action, but a consumer had no way to see what's callable — and the surface grows silently as controllers are wired. This addsmm daemon listto enumerate it.listActionsRPC handler in the daemon, backed by the live messenger'sgetRegisteredActionTypes()(landed in feat(messenger): add getRegisteredActionTypes accessor #9271), so the list can never drift from whatcallactually accepts — no hand-kept catalog to rot.mm daemon listcommand renders an indented, counted list on a TTY, and a bare, sorted, newline-delimited list when piped (so it pipes cleanly intogrep/fzf).list, frames the surface as evolving (not a stability contract), links out to each controller's TypeDoc/README for exhaustive detail, and drops the stale@deprecated AccountsController:listAccountsexample (fixed toKeyringController:getState).Testing
list.test.tsand alistActionshandler test indaemon-entry.test.ts; package stays at 100% coverage.build,test,lint, andchangelog:validateall pass.🤖 Generated with Claude Code
Note
Low Risk
CLI-only discovery and error-message refactors; no changes to wallet auth, key handling, or messenger dispatch semantics beyond a read-only introspection RPC.
Overview
Adds
mm daemon listso users can see which messenger actions the running wallet daemon accepts viadaemon call, without maintaining a static catalog.The daemon exposes a new
listActionsJSON-RPC handler that returnsmessenger.getRegisteredActionTypes(), keeping discovery aligned with whatcallcan dispatch. The CLI sorts actions lexicographically: on a TTY it prints a counted, indented list with usage hints; when piped it emits a bare newline-delimited list forgrep/fzf.mm daemon callnow shares centralized socket and JSON-RPC error handling viamakeDaemonConnectionError,formatJsonRpcError, andisStringArrayindaemon/utils, including clearer messages forECONNRESETand permission errors. README and changelog documentlistand refreshcallexamples.Reviewed by Cursor Bugbot for commit e9a0545. Bugbot is set up for automated code reviews on this repo. Configure here.