feat: agentmask + service discovery infrastructure#952
Conversation
Add the @ocap/agentmask package with an OpenClaw plugin that lets an LLM agent request and use wallet capabilities from a MetaMask capability vendor via the OCAP kernel daemon. The plugin provides three tools: - metamask_request_capability: redeem OCAP URL and request capabilities - metamask_call_capability: call methods on obtained capabilities - metamask_list_capabilities: list capabilities obtained in the session Also includes docs migrated from the extension repo (capability-vendor, demo-two-way-comms, kernel-guide) and updates demo-two-way-comms with parallel Manual CLI / OpenClaw agent instructions for the away side. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…edemption The agent can now ask the user for their OCAP URL during conversation and redeem it on the fly via the new metamask_obtain_vendor tool, rather than requiring the URL to be pre-configured in .env or plugin config. - Add metamask_obtain_vendor tool (accepts URL, redeems, stores vendor kref) - Move ocapUrl into mutable PluginState (seeded from config, overridable) - ensureVendor() directs the agent to metamask_obtain_vendor when no URL set - Update SKILL.md workflow and demo doc OpenClaw section Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ion__ After obtaining a capability from the vendor, request_capability now calls __getDescription__ on it to retrieve method schemas (name, args, return type). The full schema is shown in the tool response and stored in plugin state. list_capabilities also shows method names. Discovery is best-effort — if the capability is not discoverable, the tool still works without method listings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bd1868d. Configure here.
Pre-redemption of the configured matcher URL was fire-and-forget, so a tool call landing during the redemption window would see a misleading 'no matcher connection' error from requireMatcher. Park the pending promise in state.matcherPending and have requireMatcher await it, surfacing the underlying failure when redemption rejects.
… discovery/daemon.ts Both OpenClaw plugins kept a near-identical copy of the daemon caller; the discovery version added optional ocapHome support, so a future fix in one copy would drift from the other. Sync the two files (metamask now accepts the same optional ocapHome param, even though it does not use it today) and add a header note instructing future editors to keep them in sync. Plugins remain self-contained so 'openclaw plugins install -l' still works on either directory in isolation.

Summary
rekm/agentmaskbranch as base (agentmask vats, OpenClaw MetaMask vendor plugin, capability schema discovery) ontomainImportant caveat: this requires using the updated version of the MetaMask browser extension (Erik's updates to put the ocap kernel into it and then some further stuff I needed to add on top of that) in the
chip/agentmaskbranch of themetamask-extensionrepo. While the changes this PR represents are being proposed for merging into ourmainbranch, we don't really have that option for the browser extension since it's not our repo to mess with. (I suppose we could merge it with some negotiation with the MetaMake team, but since it's highly experimental I'm pretty sure they wouldn't be too keen on that idea. I believe Erik's plan was to eventually have it in under a flag, but I don't thing that's yet an option.)Test plan
packages/agentmask/openclaw-plugin-discovery/VALIDATION.mdend-to-end (matcher daemon and LLM service consumer on VPS, sample services + MetaMask browser extension (providing MetaMask services) on laptop, OpenClaw agent driving discovery and contact)Note
Medium Risk
Adds new OpenClaw plugins and supporting docs/state management plus changes CLI behavior (
--home, relay bookkeeping, daemon socket safety), which could affect developer workflows and runtime connectivity if misconfigured.Overview
Adds a new
packages/agentmaskworkspace with documentation and tests, including two OpenClaw plugins:@openclaw/metamask(redeem vendor OCAP URL, request capabilities, introspect via__getDescription__, and call capability methods) and@openclaw/discovery(redeem matcher URL,findServices, inspect contact descriptions, initiate contact, and call obtained services) along with a discovery skill and an end-to-end validation walkthrough.Updates developer tooling/config: Claude sandbox permissions and Yarn proxy settings for sandboxed installs, plus new discovery planning docs.
Improves
@metamask/kernel-cliUX and robustness by adding a global--homeoverride for targeting multiple daemons, enhancing relay startup/status with a dedicated relay state directory and optional--public-ipannouncement for NATed hosts, and preventingdaemon startfrom clobbering an already-running daemon’s Unix socket.Reviewed by Cursor Bugbot for commit 609b020. Bugbot is set up for automated code reviews on this repo. Configure here.