@keeperhub/wallet 0.1.11 → 0.1.13

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/README.md CHANGED
@@ -5,21 +5,37 @@ Agentic wallet for AI agents. Auto-pays x402 (Base USDC) and MPP (Tempo USDC.e)
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npx @keeperhub/wallet skill install
9
- npx @keeperhub/wallet add
8
+ npx -p @keeperhub/wallet keeperhub-wallet skill install
9
+ npx -p @keeperhub/wallet keeperhub-wallet add
10
10
  ```
11
11
 
12
- `skill install` writes the skill file into every detected agent directory AND registers the `keeperhub-wallet-hook` PreToolUse safety hook in `~/.claude/settings.json`. The alternate `npx skills add keeperhub/agentic-wallet-skills` path installs the skill file only — if you use it, follow up with `npx @keeperhub/wallet skill install` to activate the safety hook.
12
+ `skill install` writes the skill file into every detected agent directory AND registers the `keeperhub-wallet-hook` PreToolUse safety hook in `~/.claude/settings.json`. The alternate `npx skills add keeperhub/agentic-wallet-skills` path installs the skill file only — if you use it, follow up with `npx -p @keeperhub/wallet keeperhub-wallet skill install` to activate the safety hook.
13
13
 
14
14
  The installer probes `PATH` and chooses the form that will resolve later when your shell fires the hook:
15
15
 
16
16
  - If `keeperhub-wallet-hook` is on `PATH` (global install or `npm link`), the installer writes the bare command for lowest startup latency.
17
- - Otherwise (the typical `npx @keeperhub/wallet skill install` flow, where the bin is only inside an `npx` cache), it writes `npx -y -p @keeperhub/wallet@<version> keeperhub-wallet-hook` so the hook resolves on every fire without a global install.
17
+ - Otherwise (the typical `npx -p @keeperhub/wallet keeperhub-wallet skill install` flow, where the bin is only inside an `npx` cache), it writes `npx -y -p @keeperhub/wallet@<version> keeperhub-wallet-hook` so the hook resolves on every fire without a global install.
18
18
 
19
- The `npx` form is **pinned to the installer's own version** — never `@latest`. Pinning bounds supply-chain risk: `npx -y` runs whatever is in the registry, so a `latest`-pulling hook would execute new code on every tool call after any future scope compromise. To upgrade, re-run `skill install` from a fresh `npx @keeperhub/wallet@<new-version>`.
19
+ The `npx` form is **pinned to the installer's own version** — never `@latest`. Pinning bounds supply-chain risk: `npx -y` runs whatever is in the registry, so a `latest`-pulling hook would execute new code on every tool call after any future scope compromise. To upgrade, re-run `skill install` from a fresh `npx -p @keeperhub/wallet@<new-version> keeperhub-wallet skill install`.
20
20
 
21
21
  Override with `KEEPERHUB_WALLET_HOOK_COMMAND` if you need a different command (monorepo bin path, wrapper script, etc.) — it is written verbatim into `settings.json`, so treat it as trusted input. Re-running `skill install` is idempotent across either form: switching between global, npx, or version-bumped npx replaces the existing entry rather than duplicating it. The de-dup matcher only inspects the `command` field of each hook, so unrelated entries that mention `keeperhub-wallet-hook` in their `matcher` or args are preserved.
22
22
 
23
+ ## MCP server
24
+
25
+ `skill install` also registers a stdio MCP server (`keeperhub-wallet`) in each detected agent's MCP config so Claude — and any MCP-aware client — can call paid KeeperHub workflows from a tool call without writing a Node script.
26
+
27
+ Three tools are exposed:
28
+
29
+ - `call_workflow(slug, body?, paymentHint?, responseFormat?)` — pay-and-invoke a marketplace workflow by slug. Auto-pays x402 on Base USDC or MPP on Tempo USDC.e.
30
+ - `balance()` — Base USDC + Tempo USDC.e on-chain balance.
31
+ - `info()` — public wallet metadata (`subOrgId`, `walletAddress`). The HMAC secret is never returned.
32
+
33
+ On the very first tool call, if `~/.keeperhub/wallet.json` is missing the server provisions a fresh wallet automatically — there is no manual `keeperhub-wallet add` step to run. The provisioned wallet starts with zero balance; the first 402 round-trip surfaces `INSUFFICIENT_FUNDS` with a Coinbase Onramp URL.
34
+
35
+ The local `block_threshold_usd` from `~/.keeperhub/safety.json` is enforced inside the MCP server before paymentSigner signs. Calls above the cap return `{code:"POLICY_BLOCKED"}` without contacting Turnkey. Auto/ask thresholds are not enforced by the MCP server in v1 — everything below `block_threshold_usd` is auto-paid.
36
+
37
+ Auto-registration covers Claude Code, Cursor, Windsurf, and OpenCode. Cline emits a copy-paste notice with the exact entry to paste into its config (the VS Code extension's globalStorage path is too variant-dependent to auto-detect reliably).
38
+
23
39
  ## First use
24
40
 
25
41
  ```ts
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import { runMcpServer } from "../dist/mcp-server.js";
3
+
4
+ function reportCrash(label, err) {
5
+ const detail = err instanceof Error && err.stack ? err.stack : String(err);
6
+ process.stderr.write(`[keeperhub-wallet] ${label}:\n${detail}\n`);
7
+ }
8
+
9
+ process.on("uncaughtException", (err) => {
10
+ reportCrash("uncaughtException", err);
11
+ process.exit(2);
12
+ });
13
+ process.on("unhandledRejection", (reason) => {
14
+ reportCrash("unhandledRejection", reason);
15
+ process.exit(3);
16
+ });
17
+
18
+ runMcpServer().catch((err) => {
19
+ reportCrash("mcp server crashed", err);
20
+ process.exit(1);
21
+ });