@visa/cli 4.1.0-rc.155 → 4.1.0-rc.157

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.
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: pair-visa-agent
3
- description: Pair a Visa CLI v4 agent identity to this runtime. Present one authorization link, the returned public confirmation code, and the full public request-key fingerprint to the human, then poll until the runtime's local Ed25519 identity is activated. Use when the user says "pair my agent", "enroll my Visa CLI", "connect my Visa agent", or "set up my agent identity".
3
+ description: Pair a Visa CLI v4 agent identity to this runtime. Sign the owner in first (agent_login), then present one authorization link, the returned public confirmation code, and the full public request-key fingerprint to the human, then poll until the runtime's local Ed25519 identity is activated. Use when the user says "pair my agent", "enroll my Visa CLI", "connect my Visa agent", or "set up my agent identity".
4
4
  compatibility: Needs the `visa` CLI (`npm i -g @visa/cli@rc`) — run `node scripts/setup.mjs` to install it if missing — plus network access to the Visa authorization service. Works in OpenClaw, Hermes, or any Agent Skills runtime.
5
5
  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.9'
9
+ version: '0.7.0'
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
@@ -90,7 +90,9 @@ OpenClaw users also receive the skill with the `@visa/visa-cli-openclaw` plugin.
90
90
  `visa-cli connect <runtime>`. For Hermes, the entry is written under `mcp_servers`
91
91
  in `~/.hermes/config.yaml`.
92
92
  - **No MCP integration:** use the raw `visa agent …` commands.
93
- 3. **Pair.** Follow the core flow below.
93
+ 3. **Sign the owner in.** Pairing starts are owner-bound — see "Sign in first" below. On a
94
+ fresh runtime this step is required before any pairing command will succeed.
95
+ 4. **Pair.** Follow the core flow below.
94
96
 
95
97
  ## MCP mounting examples
96
98
 
@@ -112,15 +114,30 @@ OpenClaw (`~/.openclaw/openclaw.json`):
112
114
  }
113
115
  ```
114
116
 
115
- Hermes (`~/.hermes/config.yaml`):
117
+ Hermes (`~/.hermes/config.yaml`). **Hermes passes ONLY this `env:` map to the MCP
118
+ subprocess — it does NOT inherit the gateway environment.** Omitting a required variable
119
+ (an RC access code, the right `HOME`, `PATH`) makes the server exit on every start while
120
+ `agent_capabilities` — which reads on-disk grant state, not live tool registration — can
121
+ still report rails as available. Always set the map explicitly:
116
122
 
117
123
  ```yaml
118
124
  mcp_servers:
119
125
  visa-cli:
120
126
  command: node
121
127
  args: ['<npm root -g>/@visa/cli/dist/mcp-server/index.js']
128
+ # Hermes does NOT inherit the gateway env. This map is the entire
129
+ # subprocess environment; omit VISA_RC_CODE and the server exits on boot.
130
+ env:
131
+ HOME: /home/<user> # the home that holds this runtime's .visa-cli state
132
+ VISA_RC_CODE: <access code>
133
+ PATH: /usr/local/bin:/usr/bin:/bin
122
134
  ```
123
135
 
136
+ Hermes also loads skills **per profile** from `~/.hermes/profiles/<profile>/skills/`, not
137
+ from `~/.hermes/skills/` — on a multi-profile box, install with an explicit target:
138
+ `visa agent skill --dir ~/.hermes/profiles/<profile>/skills`. A flat-dir install exits 0
139
+ and is silently never loaded.
140
+
124
141
  In Hermes, `hermes claw migrate` can also import this skill and MCP configuration from an
125
142
  existing OpenClaw installation. See `RUNTIMES.md` for the complete runtime map.
126
143
 
@@ -140,15 +157,45 @@ Present it when the field is present and skip it when it is absent; an older ser
140
157
  simply omits it, which is not an error. The activation result includes protocol version
141
158
  `2`, `pairingId`, stable `agentId`, the display name, and `identityKeyJkt`.
142
159
 
160
+ ## Sign in first — pairing is owner-bound
161
+
162
+ Pairing starts are authenticated as the owner: the service pins the owner account at
163
+ initiation, and the browser review page rejects any other signed-in account
164
+ (`owner_profile_mismatch`). So on a fresh runtime the ceremony has a mandatory first leg —
165
+ establish the owner session **before** any pairing command:
166
+
167
+ - [ ] Call `agent_login` (MCP, default action `"start"`) or run
168
+ `visa agent login --format json` (CLI). The result carries a sign-in `browserUrl`
169
+ and a short 6-character confirmation code.
170
+ - [ ] Relay **both** to the human in your reply — the bare URL on its own line, and the
171
+ code. You are very often not in a terminal they can see; the chat message is the
172
+ only place these values reach them.
173
+ - [ ] The human opens the link, signs in (Google or email), and **types the confirmation
174
+ code into the sign-in page** — into the browser, never back to you in chat.
175
+ - [ ] Claim the session: `agent_login {"action":"claim"}` (the CLI command polls on its
176
+ own). Once claimed, the session token is stored locally and pairing can start.
177
+
178
+ If a pairing command returns "An owner profile is required before pairing" or
179
+ `{"code":"session_required"}`, that is this ordering rule — not a fault. Run `agent_login`,
180
+ drive the sign-in above to a claimed session, then retry the same pairing command once.
181
+
182
+ The account that signs in here is the owner the pairing binds to. The same person must
183
+ approve the pairing link in the next step from that same signed-in browser session;
184
+ a different account on the review page fails closed.
185
+
143
186
  ## Fastest path — one shot (`visa agent pair`)
144
187
 
145
- If the `visa` CLI is on PATH, prefer the one-shot command — it does the whole flow
146
- from a single call, so the user types nothing after their initial request:
188
+ If the `visa` CLI is on PATH, prefer the one-shot command — after the owner session above
189
+ exists, it does the whole flow from a single call, so the user types nothing after their
190
+ initial request:
147
191
 
148
192
  ```
149
193
  visa agent pair --format json
150
194
  ```
151
195
 
196
+ On a runtime with no owner session it fails with "An owner profile is required before
197
+ pairing" — run the sign-in leg above first, then re-run it.
198
+
152
199
  It returns `browserUrl`, `pairingId`, stable `agentId`, the full public
153
200
  `requestKeyFingerprint`, and — on newer builds — `confirmationCode` **immediately**. It
154
201
  starts a detached activation process only after the pending identity and private key are
@@ -216,9 +263,11 @@ approve — you poll to completion yourself:
216
263
  - [ ] **Pair** the identity (the flow above). Identity only — no rail yet.
217
264
  - [ ] **Establish the owner session once.** Grant creation is an account operation, so this
218
265
  runtime needs a live owner session: `agent_login` (MCP) or `visa agent login` (CLI).
219
- This is a short-lived session established once for the grant **not** a re-pair, and
220
- **not** something the owner repeats per payment. If `agent_connect` later returns
221
- `{"code":"session_required"}`, the session lapsed run `agent_login` again.
266
+ If you just paired, the session from the sign-in-first leg is usually still live
267
+ no re-login needed. This is a short-lived session established once — **not** a
268
+ re-pair, and **not** something the owner repeats per payment. If `agent_connect`
269
+ later returns `{"code":"session_required"}`, the session lapsed — run `agent_login`
270
+ again.
222
271
  - [ ] **Initiate the grant from MCP — no shelling, no invented URLs.** Call `agent_connect`
223
272
  with the rail and caps: `{"rail":"card","ceiling":"<usd>","perTransaction":"<usd>"}`
224
273
  (or `"rail":"wallet"`); omit `agentId` to target the most recently paired agent. It
@@ -254,6 +303,14 @@ visa agent grant-card <agentId> --ceiling <usd> --per-transaction <usd> --wait
254
303
  visa agent grant-wallet <agentId> --ceiling <usd> --per-transaction <usd> --wait
255
304
  ```
256
305
 
306
+ Rail selection is the owner's call — wallet only, card only, or both. Newer builds also
307
+ accept one compound command that runs the same ceremony per rail in sequence
308
+ (`both` = card, then wallet, under the same caps — expect one extra approval trip):
309
+
310
+ ```
311
+ visa agent connect --authority <card|wallet|both> --ceiling <usd> --per-transaction <usd> --wait
312
+ ```
313
+
257
314
  Use the stable `agentId` from pairing or `visa agent list` — never invent or alter the id.
258
315
  A policy refusal or timeout means **nothing was signed**: report it and stop; do not retry
259
316
  with a different command or a reconstructed URL.
@@ -267,6 +324,8 @@ dangerous). All spending is gated by the owner-approved local policy caps.
267
324
 
268
325
  ## Core flow
269
326
 
327
+ - [ ] Establish the owner session ("Sign in first" above) if this runtime does not have
328
+ one yet.
270
329
  - [ ] Start the pairing with `pair_agent_start`, `enroll_agent` action `start`, or
271
330
  `visa agent enroll --format json`.
272
331
  - [ ] Present the authorization URL, stable agent ID, full public fingerprint, and the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visa/cli",
3
- "version": "4.1.0-rc.155",
3
+ "version": "4.1.0-rc.157",
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",
@@ -100,7 +100,6 @@
100
100
  "native/build-win.bat",
101
101
  "native/bin/win32-x64/visa-keychain-win.exe",
102
102
  "server.json",
103
- "README.md",
104
- "LICENSE"
103
+ "README.md"
105
104
  ]
106
105
  }
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.155",
4
+ "version": "4.1.0-rc.157",
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.155",
12
+ "version": "4.1.0-rc.157",
13
13
  "transport": {
14
14
  "type": "stdio"
15
15
  },