@visa/cli 4.1.0-rc.72 → 4.1.0-rc.74

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.
@@ -6,7 +6,7 @@ allowed-tools: Bash(visa:*) Bash(visa-cli:*) Bash(node:*) Bash(npm:*) Bash(npx:*
6
6
  metadata:
7
7
  author: visa
8
8
  homepage: https://visacli.sh/agents
9
- version: '0.6.7'
9
+ version: '0.6.8'
10
10
  # OpenClaw-namespaced extension (agentskills.io keeps `metadata` free-form, so
11
11
  # non-standard runtime config lives here — `user-invocable` is not a standard
12
12
  # top-level field). OpenClaw auto-installs `install[]` when `requires.bins` are
@@ -189,59 +189,76 @@ possible (re-pairing an existing identity silently dead-ends). Do this instead:
189
189
  Missing **spend** blocks _checkout mandates_, not a delegated x402 wallet — but that
190
190
  wallet must first be acquired by owner approval (below); it is never self-minted.
191
191
 
192
- ## What you can do once paired — acquiring a wallet to spend
193
-
194
- Pairing binds **identity only**. To let this agent pay via the Turnkey x402
195
- (stablecoin) wallet, the wallet must be **delegated by the human owner** the runtime
196
- never self-mints it. On mainnet (production) `wallet_init` throws
197
- `WalletCredentialRequiredError` until that delegation lands, so do NOT call it as a
198
- setup step. Follow this sequence:
199
-
200
- - [ ] **Pair** the identity (the flow above). Identity only — no wallet yet.
201
- - [ ] **Sign in the account session FIRST.** Wallet delegation is an account
202
- operation, so this runtime needs a live owner session before `grant-wallet`:
203
- `agent_login` (MCP) or `visa agent login` (CLI). Without a session the grant has
204
- no account to delegate from.
205
- - [ ] **Initiate the wallet grant from MCP — no shelling.** Call `agent_connect`
206
- (`{"rail":"wallet","ceiling":"<usd>","perTransaction":"<usd>"}`); omit `agentId`
207
- to target the most recently paired agent. It creates the delegation request and
208
- returns `{ url, code, attachId, willGrant, expiresAt }`. Present the bare `url`
209
- and `code` to the human exactly as returned — the crypto approval happens in the
210
- browser and **cannot** run inline in chat. Prefer this over the raw
211
- `visa agent grant-wallet <agentId>` CLI ceremony; `setup_agent` (`{"rail":"wallet"}`)
212
- still sequences identity wallet policy ready if you need the next-step map.
213
- If `agent_connect` returns `{"code":"session_required"}`, run `agent_login` first.
214
- - [ ] **Owner approves the wallet.** The human opens the `url` and confirms the wallet
215
- grant on the **v4 agent dashboard** (`app.visacli.sh/agent/enroll`), approving with
216
- their **sign-in session no passkey** and confirming the caps. You cannot approve
217
- on their behalf.
218
- - [ ] **Finish from MCP with `agent_connect_poll`.** Call `agent_connect_poll`
219
- (`{"attachId":"<from agent_connect>"}`; or resume by `agentId`) each call runs one
220
- bounded poll. It returns `{"ok":false,"state":"...","blockedByKind":"awaiting_human_approval"}`
221
- while pending; call again until it returns `{"ok":true,"state":"grant_activated","fundAddress":...,"caps":...}`.
222
- Activation registers the delegated Turnkey signer + caps and writes the delegated
223
- Turnkey credential (`turnkey.json`) to this runtime. It never spends.
224
- - [ ] **Confirm the real wallet** with `wallet_status` (or `visa wallet show`). Only a
225
- provisioned/delegated credential not the served tool list means the wallet is
226
- usable; `agent_capabilities.wallet.available` reflects this.
227
- - [ ] **Set the spend policy** with `wallet_policy_set` — per-transaction / daily /
228
- session USD caps (plus optional network and merchant allow/deny lists) that refuse
229
- any x402 payment BEFORE it is signed. This is the `policy` step in the
230
- `setup_agent` chain, between a delegated wallet and spending.
231
- - [ ] **Spend** with `wallet_pay` (x402), enforced by the owner-approved local policy
232
- caps. Never raise a human-approved limit yourself.
233
-
234
- Once the wallet is delegated and a policy is set, these are the served wallet tools this
235
- agent can actually call: `wallet_discover` (search the public x402 Bazaar),
236
- `wallet_probe` (read a challenge without paying), `wallet_pay` / `wallet_directory_pay`
237
- (pay, policy-enforced), `wallet_history` / `wallet_reconcile` (local ledger + resolve
238
- `reconciling` holds), `wallet_fund` (funding address + faucet), and `wallet_export`
239
- (export key material dangerous). All spending is gated by the owner-approved local
240
- policy caps.
241
-
242
- Card checkout is a separate upgrade on top of this Turnkey-only base — approve a card on
243
- the **v4 agent dashboard** (`app.visacli.sh/agent/enroll`) with a **passkey**, then
244
- `start_card_mandate` / `pay_merchant` draw against it. Neither rail is enabled by pairing.
192
+ ## What you can do once paired — granting spend authority (card or wallet)
193
+
194
+ Pairing binds **identity only**. To let this agent pay, the human owner must **delegate**
195
+ a spend rail — the runtime never self-mints one. There are two rails, and **one** ceremony
196
+ drives both:
197
+
198
+ - **`wallet:x402`** (Turnkey stablecoin) — owner approves with their **sign-in session, no
199
+ passkey**. On mainnet `wallet_init` throws `WalletCredentialRequiredError` until this
200
+ delegation lands, so never call it as a setup step.
201
+ - **`card:vic`** (Visa card checkout) owner approves with a **passkey**.
202
+
203
+ The contract is identical for both rails, and it is **one command from you, one approval
204
+ from the owner**. You never hand a command, code, or URL back to the human after they
205
+ approve you poll to completion yourself:
206
+
207
+ 1. **You run one command** naming the rail and caps.
208
+ 2. **The owner opens the returned link and approves once** (they may adjust the amount).
209
+ 3. **You poll to activation** — the owner does nothing further.
210
+
211
+ - [ ] **Pair** the identity (the flow above). Identity only — no rail yet.
212
+ - [ ] **Establish the owner session once.** Grant creation is an account operation, so this
213
+ runtime needs a live owner session: `agent_login` (MCP) or `visa agent login` (CLI).
214
+ This is a short-lived session established once for the grant **not** a re-pair, and
215
+ **not** something the owner repeats per payment. If `agent_connect` later returns
216
+ `{"code":"session_required"}`, the session lapsedrun `agent_login` again.
217
+ - [ ] **Initiate the grant from MCP — no shelling, no invented URLs.** Call `agent_connect`
218
+ with the rail and caps: `{"rail":"card","ceiling":"<usd>","perTransaction":"<usd>"}`
219
+ (or `"rail":"wallet"`); omit `agentId` to target the most recently paired agent. It
220
+ returns `{ url, code, attachId, willGrant, expiresAt }`. Present the **bare `url` and
221
+ `code` exactly as returned** never construct, shorten, or guess a Visa URL, and never
222
+ open it yourself. The crypto approval happens in the owner's browser and cannot run
223
+ inline in chat. (`setup_agent {"rail":"card"|"wallet"}` returns the same next-step map
224
+ if you need it.)
225
+ - [ ] **Owner approves once** on the **v4 agent dashboard** (`app.visacli.sh/agent/enroll`),
226
+ confirming the caps — **card with a passkey, wallet with their sign-in session**. You
227
+ cannot approve on their behalf.
228
+ - [ ] **Poll to activation from MCP.** Call `agent_connect_poll` (`{"attachId":"<from
229
+ agent_connect>"}`; or resume by `agentId`) one bounded poll per call. It returns
230
+ `{"ok":false,"state":"...","blockedByKind":"awaiting_human_approval"}` while pending;
231
+ call again until `{"ok":true,"state":"grant_activated","caps":...}` (wallet also
232
+ returns `fundAddress`). Activation registers the delegated signer + caps: wallet writes
233
+ the Turnkey credential (`turnkey.json`); card writes the card pointer. It never spends.
234
+ - [ ] **Confirm the rail is live.** Wallet: `wallet_status` / `visa wallet show`
235
+ (`agent_capabilities.wallet.available`). Card: `agent_capabilities.card.available`.
236
+ Only a delegated credential not the served tool list — means the rail is usable.
237
+ - [ ] **Then spend against the owner-approved caps.** Wallet: set the policy with
238
+ `wallet_policy_set` (per-transaction / daily / session USD caps + optional network and
239
+ merchant allow/deny lists that refuse an x402 payment BEFORE it is signed), then
240
+ `wallet_pay`. Card: `start_card_mandate` then `pay_merchant`. Never raise a
241
+ human-approved limit yourself.
242
+
243
+ **Raw CLI equivalent (one shot).** If you cannot drive MCP, the same ceremony runs from the
244
+ CLI and `--wait` polls to activation in a single call. Present the URL it prints — don't
245
+ invent one:
246
+
247
+ ```
248
+ visa agent grant-card <agentId> --ceiling <usd> --per-transaction <usd> --wait
249
+ visa agent grant-wallet <agentId> --ceiling <usd> --per-transaction <usd> --wait
250
+ ```
251
+
252
+ Use the stable `agentId` from pairing or `visa agent list` — never invent or alter the id.
253
+ A policy refusal or timeout means **nothing was signed**: report it and stop; do not retry
254
+ with a different command or a reconstructed URL.
255
+
256
+ Once a wallet is delegated and a policy is set, these are the served wallet tools this agent
257
+ can actually call: `wallet_discover` (search the public x402 Bazaar), `wallet_probe` (read a
258
+ challenge without paying), `wallet_pay` / `wallet_directory_pay` (pay, policy-enforced),
259
+ `wallet_history` / `wallet_reconcile` (local ledger + resolve `reconciling` holds),
260
+ `wallet_fund` (funding address + faucet), and `wallet_export` (export key material —
261
+ dangerous). All spending is gated by the owner-approved local policy caps.
245
262
 
246
263
  ## Core flow
247
264
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visa/cli",
3
- "version": "4.1.0-rc.72",
3
+ "version": "4.1.0-rc.74",
4
4
  "description": "Visa CLI runtime for stable agent identity and separately authorized payment capabilities",
5
5
  "bin": {
6
6
  "visa-cli": "./bin/visa-cli.js",
package/server.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
3
3
  "name": "io.github.visa-crypto-labs/visa-cli",
4
- "version": "4.1.0-rc.72",
4
+ "version": "4.1.0-rc.74",
5
5
  "title": "Visa CLI",
6
6
  "description": "Pair a human-approved agent identity, configure payment capabilities separately, and discover and pay x402 services from your AI coding assistant.",
7
7
  "websiteUrl": "https://github.com/Visa-Crypto-Labs/Visa-mono/tree/main/packages/cli#readme",
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "registryType": "npm",
11
11
  "identifier": "@visa/cli",
12
- "version": "4.1.0-rc.72",
12
+ "version": "4.1.0-rc.74",
13
13
  "transport": {
14
14
  "type": "stdio"
15
15
  },