@visa/cli 4.1.0-rc.2 → 4.1.0-rc.21

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.
Files changed (62) hide show
  1. package/dist/checkout-engine/adapters/generic.d.ts +19 -0
  2. package/dist/checkout-engine/adapters/generic.js +201 -0
  3. package/dist/checkout-engine/adapters/index.d.ts +7 -0
  4. package/dist/checkout-engine/adapters/index.js +17 -0
  5. package/dist/checkout-engine/adapters/stripe-like.d.ts +10 -0
  6. package/dist/checkout-engine/adapters/stripe-like.js +21 -0
  7. package/dist/checkout-engine/browser-launch.d.ts +46 -0
  8. package/dist/checkout-engine/browser-launch.js +81 -0
  9. package/dist/checkout-engine/ceremony.d.ts +64 -0
  10. package/dist/checkout-engine/ceremony.js +261 -0
  11. package/dist/checkout-engine/cli-engine.d.ts +60 -0
  12. package/dist/checkout-engine/cli-engine.js +242 -0
  13. package/dist/checkout-engine/detect.d.ts +61 -0
  14. package/dist/checkout-engine/detect.js +372 -0
  15. package/dist/checkout-engine/evidence.d.ts +22 -0
  16. package/dist/checkout-engine/evidence.js +59 -0
  17. package/dist/checkout-engine/executor.d.ts +172 -0
  18. package/dist/checkout-engine/executor.js +1233 -0
  19. package/dist/checkout-engine/hosted-approval.d.ts +78 -0
  20. package/dist/checkout-engine/hosted-approval.js +171 -0
  21. package/dist/checkout-engine/index.d.ts +3 -0
  22. package/dist/checkout-engine/index.js +5 -0
  23. package/dist/checkout-engine/inline-target.d.ts +13 -0
  24. package/dist/checkout-engine/inline-target.js +37 -0
  25. package/dist/checkout-engine/instrument.d.ts +54 -0
  26. package/dist/checkout-engine/instrument.js +83 -0
  27. package/dist/checkout-engine/live-fill-approval.d.ts +52 -0
  28. package/dist/checkout-engine/live-fill-approval.js +107 -0
  29. package/dist/checkout-engine/mandate.d.ts +25 -0
  30. package/dist/checkout-engine/mandate.js +100 -0
  31. package/dist/checkout-engine/outcome.d.ts +30 -0
  32. package/dist/checkout-engine/outcome.js +190 -0
  33. package/dist/checkout-engine/owner-only-file.d.ts +10 -0
  34. package/dist/checkout-engine/owner-only-file.js +22 -0
  35. package/dist/checkout-engine/package.json +3 -0
  36. package/dist/checkout-engine/pay-args.d.ts +14 -0
  37. package/dist/checkout-engine/pay-args.js +44 -0
  38. package/dist/checkout-engine/pay.d.ts +1 -0
  39. package/dist/checkout-engine/pay.js +13 -0
  40. package/dist/checkout-engine/receipt.d.ts +81 -0
  41. package/dist/checkout-engine/receipt.js +109 -0
  42. package/dist/checkout-engine/repo-env.d.ts +11 -0
  43. package/dist/checkout-engine/repo-env.js +23 -0
  44. package/dist/checkout-engine/run-live-fill.d.ts +1 -0
  45. package/dist/checkout-engine/run-live-fill.js +443 -0
  46. package/dist/checkout-engine/types.d.ts +26 -0
  47. package/dist/checkout-engine/types.js +2 -0
  48. package/dist/checkout-engine/vgs-gateway/fetch-credential.d.mts +74 -0
  49. package/dist/checkout-engine/vgs-gateway/fetch-credential.mjs +248 -0
  50. package/dist/checkout-engine/vgs-gateway/server-mint-client.d.ts +49 -0
  51. package/dist/checkout-engine/vgs-gateway/server-mint-client.js +150 -0
  52. package/dist/checkout-engine/vgs-live-instrument.d.ts +141 -0
  53. package/dist/checkout-engine/vgs-live-instrument.js +252 -0
  54. package/dist/checkout-engine/vic-confirmation.d.ts +34 -0
  55. package/dist/checkout-engine/vic-confirmation.js +39 -0
  56. package/dist/cli.js +352 -288
  57. package/dist/mcp-server/index.js +141 -141
  58. package/dist/skills/pair-visa-agent/SKILL.md +299 -0
  59. package/dist/skills/pair-visa-agent/scripts/setup.mjs +48 -0
  60. package/native/bin/win32-x64/visa-keychain-win.exe +0 -0
  61. package/package.json +5 -3
  62. package/server.json +2 -2
@@ -0,0 +1,299 @@
1
+ ---
2
+ name: pair-visa-agent
3
+ description: Pair a Visa CLI v4 agent identity to this device so the agent can pay on the user's behalf. You paste a link, the user enrolls on mobile web, and the credential auto-pairs back to this device — no code is ever typed back. Use when the user says "pair my agent", "enroll my Visa CLI", "connect my Visa wallet", "set up my agent identity", "get me set up to pay", "log in to Visa", or asks to connect/sign up their .visa account.
4
+ compatibility: Needs the `visa` CLI (`npm i -g @visa/cli@rc`) — run `node scripts/setup.mjs` to auto-install it if missing — plus network access to the Visa verify-web origin. Works in OpenClaw, Hermes, or any Agent Skills runtime.
5
+ allowed-tools: Bash(visa:*) Bash(visa-cli:*) Bash(node:*) Bash(npm:*) Bash(npx:*)
6
+ metadata:
7
+ author: visa
8
+ homepage: https://visacli.sh/agents
9
+ version: '0.5.0'
10
+ # OpenClaw-namespaced extension (agentskills.io keeps `metadata` free-form, so
11
+ # non-standard runtime config lives here — `user-invocable` is not a standard
12
+ # top-level field). OpenClaw auto-installs `install[]` when `requires.bins` are
13
+ # missing; other runtimes (Hermes, Claude Code, …) self-provision via the
14
+ # bundled `scripts/setup.mjs` (see compatibility + Getting set up). @rc pinned
15
+ # until 4.1.0 is promoted to latest.
16
+ openclaw:
17
+ user-invocable: true
18
+ emoji: '💳'
19
+ requires:
20
+ bins:
21
+ - visa
22
+ install:
23
+ - kind: node
24
+ package: '@visa/cli@rc'
25
+ bins:
26
+ - visa
27
+ - visa-cli
28
+ ---
29
+
30
+ # Pair a Visa CLI v4 Agent Identity
31
+
32
+ Connects a Visa v4 identity (`.visa` name + delegated wallet + card) to THIS device
33
+ through a mobile-web enrollment link. This is the device-link flow: the credential
34
+ pairs back **automatically** to the terminal that started it. **No confirmation code is
35
+ ever typed back into you** — the code is an out-of-band check the human reads to confirm
36
+ the page they are on is the flow you started.
37
+
38
+ Driven through the local `visa` binary. **This skill is runtime-agnostic** — it works in
39
+ OpenClaw, Hermes, or any agent runtime that can run the `visa` CLI or mount its MCP
40
+ server (see Runtimes). Use whichever pairing surface your runtime exposes; they all wrap
41
+ the same two `visa` commands:
42
+
43
+ - **`pair_agent_start` / `pair_agent_poll`** — the OpenClaw plugin tools (parse JSON for you). Use these if present.
44
+ - **`enroll_agent`** — the `visa` MCP server tool, if the runtime has the server mounted.
45
+ - **`visa agent enroll` / `visa agent enroll-claim`** — the raw CLI, always available if `visa` is on PATH. The universal fallback.
46
+
47
+ Pick the first one available; if unsure, shell out to the raw CLI commands — every path
48
+ hits the same hand-off on this device.
49
+
50
+ ## Getting this skill
51
+
52
+ The skill ships **inside the public `@visa/cli` npm package** — no git clone of the
53
+ (private) monorepo is required, so any agent box that can reach npm can install it:
54
+
55
+ ```
56
+ npm install -g @visa/cli@rc # public npm — puts `visa` on PATH
57
+ visa agent skill # plants this skill into your runtime's skills dir
58
+ ```
59
+
60
+ `visa agent skill` auto-detects OpenClaw / Hermes / Claude Code (falling back to the
61
+ project-local `./.agents/skills`); pass `--runtime <name>` or `--dir <path>` to target
62
+ one explicitly, `--force` to overwrite, or `--print` to read it without writing. After
63
+ it lands, **reload/restart your agent** so the runtime registers the skill, then prompt
64
+ the agent — "set up my Visa agent to pay" — to run the pairing flow below. (Installing a
65
+ skill does not run it; the agent activates it on a matching prompt.)
66
+
67
+ Access is gated server-side by the employee allowlist + Turnkey, so shipping the playbook
68
+ over public npm exposes no capability — only allowlisted accounts can actually pair.
69
+
70
+ (OpenClaw users also get it auto-bundled with the `@visa/visa-cli-openclaw` plugin. The
71
+ `npx skills add` open-standard path applies once the skill is published to a public repo.)
72
+
73
+ ## Getting set up (install → mount → pair → transact)
74
+
75
+ The whole flow, top to bottom:
76
+
77
+ 1. **Install the CLI (prerelease)** — `npm install -g @visa/cli@rc`, **or** run the bundled
78
+ provisioner `node scripts/setup.mjs` (idempotent — installs `@visa/cli@rc` only if `visa`
79
+ is missing; this is how **Hermes / Claude Code / any runtime** self-provisions, and what
80
+ OpenClaw runs automatically via the manifest). You **must** use the `@rc` tag: the
81
+ `@latest` tag (4.0.x) predates the `visa agent` commands and reports "does not expose
82
+ agent enroll". This puts both `visa` and `visa-cli` on PATH and ships the bundled MCP
83
+ server (`@visa/cli/dist/mcp-server/index.js`). (Once 4.1.0 is promoted to `latest`, bare
84
+ `@visa/cli` will work.)
85
+ 2. **Mount the MCP server** — one mount gives this agent the _entire_ v4 toolset:
86
+ - **OpenClaw:** installing the `@visa/visa-cli-openclaw` plugin **auto-mounts** the server
87
+ (its postinstall writes `mcp.servers["visa-cli"]` into `~/.openclaw/openclaw.json`).
88
+ Nothing to do by hand.
89
+ - **Hermes / anything else:** run `visa-cli install hermes` (or `visa-cli install <runtime>`).
90
+ This writes the server entry idempotently into the runtime's config (Hermes →
91
+ `~/.hermes/config.yaml` under `mcp_servers`). See Runtimes below for the exact shape.
92
+ - **No runtime integration?** The raw `visa agent …` CLI still works — the universal fallback.
93
+ 3. **Pair** — run the Core flow below. This binds a `.visa` identity + delegated wallet + card
94
+ to this device.
95
+ 4. **Transact** — once paired, use the mounted tools (see "What you can do once paired").
96
+
97
+ ## Runtimes
98
+
99
+ One artifact, both runtimes. The `visa` CLI is the portable substrate; mount its MCP
100
+ server so the runtime exposes the tools (both use the same server entrypoint — replace
101
+ `<npm root -g>` with the output of `npm root -g`):
102
+
103
+ **OpenClaw** (`~/.openclaw/openclaw.json`):
104
+
105
+ ```json
106
+ {
107
+ "mcp": {
108
+ "servers": {
109
+ "visa-cli": {
110
+ "command": "node",
111
+ "args": ["<npm root -g>/@visa/cli/dist/mcp-server/index.js"]
112
+ }
113
+ }
114
+ }
115
+ }
116
+ ```
117
+
118
+ **Hermes** (`~/.hermes/config.yaml`):
119
+
120
+ ```yaml
121
+ mcp_servers:
122
+ visa-cli:
123
+ command: node
124
+ args: ['<npm root -g>/@visa/cli/dist/mcp-server/index.js']
125
+ ```
126
+
127
+ No MCP server configured? The raw `visa agent …` CLI commands below work as long as `visa`
128
+ is on PATH. (In Hermes, `hermes claw migrate` also imports this skill from an existing
129
+ OpenClaw install into `~/.hermes/skills/`.) See `RUNTIMES.md` for the full plugin/config map.
130
+
131
+ ## Running commands
132
+
133
+ - Every command supports `--format json`; the tools use it. On success JSON goes to
134
+ stdout; on failure a JSON object with `error` (and, for claim, a `status`) goes to
135
+ stdout with a non-zero exit code. **Always parse the JSON — never scrape prose.**
136
+ - `enroll-claim` exit codes are load-bearing: `0` = claimed (done), `3` = not ready yet
137
+ (poll again), `1` = terminal failure (stop, recover).
138
+
139
+ ## Core flow
140
+
141
+ Copy this checklist and track progress:
142
+
143
+ - [ ] Step 1 — Start the hand-off (`pair_agent_start` / `enroll_agent` / `visa agent enroll --format json`)
144
+ - [ ] Step 2 — Present the link AND the confirmation code to the user
145
+ - [ ] Step 3 — Poll until paired (`pair_agent_poll` / `visa agent enroll-claim --format json`) — auto-pairs, no code entry
146
+ - [ ] Step 4 — Confirm the identity is bound to this device
147
+
148
+ Below, "start" and "poll" mean whichever surface your runtime exposes (see the top of
149
+ this skill). The returned fields and the poll semantics are identical across all of them.
150
+
151
+ ### Step 1 — Start the hand-off
152
+
153
+ **CRITICAL:** Only ONE hand-off can be in flight per device; starting a new one replaces
154
+ any prior. If the user says they already started enrolling, go to Step 3 first.
155
+
156
+ Start the hand-off (`pair_agent_start`, or `visa agent enroll --format json`). It returns
157
+ `browserUrl`, `confirmCode`, `expiresAt`.
158
+
159
+ If it returns an error containing `verify-web URL not available in stable builds`, this is
160
+ a stable CLI build with the surface not yet public. **Do NOT proceed** — tell the user to
161
+ set `VISA_VERIFY_WEB_URL` (or use a preview/RC build), then stop.
162
+
163
+ If it returns an error containing `RC build requires access` (often suffixed `Run: visa-cli
164
+ setup`), this is an **older RC build** whose employee gate still fires on the pairing
165
+ bootstrap. **Do NOT run `visa-cli setup`** — that is the legacy v3 GitHub-OAuth path, it is
166
+ NOT how v4 pairing authenticates, and it dead-ends on the same gate. Recover by either
167
+ upgrading to a current RC (`npm install -g @visa/cli@rc` — recent RCs exempt `agent enroll`
168
+ / `agent enroll-claim` from this gate) or, if the operator has the code, setting the
169
+ `VISA_RC_CODE` env var on the host. Then retry the hand-off. Never substitute `setup` for
170
+ pairing.
171
+
172
+ ### Step 2 — Present the link AND the confirmation code
173
+
174
+ Show BOTH clearly. The user opens the link on their phone.
175
+
176
+ **Formatting rules — make it clean AND tappable in chat clients like Telegram:**
177
+
178
+ - **Bare, tappable link.** Put `browserUrl` on its own line as a plain URL — no backticks, no
179
+ code span, and do **not** wrap it as a Markdown `[label](url)` link. Telegram auto-linkifies
180
+ a bare URL (one tap opens the phone's browser); a code span is unclickable, and the long
181
+ pairing query string (`?cli=…&cliPk=…`, with underscores) breaks Telegram MarkdownV2 link
182
+ parsing. Add a short "👉 Tap to open on your phone" cue so it reads as an action.
183
+ - **Emphasize the confirm code.** Show `confirmCode` in **bold** or `monospace` — both are
184
+ Telegram-safe (mono needs no escaping). It's read/compared, never clicked.
185
+ - **Relative expiry.** "expires in about 15 minutes" — never the raw `expiresAt` ISO/UTC
186
+ timestamp (e.g. `2026-07-21T21:22:57Z`); a UTC time reads as noise.
187
+ - **Scannable layout.** Short lines, a blank line between blocks, one leading emoji per block.
188
+ - **Don't over-Markdown.** Telegram MarkdownV2 requires escaping `_ * [ ] ( ) ~ > # + - = | { } . !`,
189
+ so heavy formatting risks a broken render. A bold/mono code + a bare link + emojis is plenty —
190
+ keep the rest plain prose.
191
+
192
+ Use this shape:
193
+
194
+ > 💳 **Pair your Visa agent** — open this on your phone:
195
+ >
196
+ > 👉 &lt;browserUrl — bare, on its own line&gt;
197
+ >
198
+ > 🔐 Confirmation code: **&lt;confirmCode&gt;**
199
+ >
200
+ > On the final screen, check the code matches before you finish — only finish if it does. Never
201
+ > type this code back to me or share it with anyone; it pairs back here automatically once you
202
+ > finish. Expires in about 15 minutes.
203
+
204
+ **Do NOT** ask the user to read the code back. **Do NOT** accept a code as input. Pairing
205
+ is proven by a secret held on this device, not by anything the user types.
206
+
207
+ ### Step 3 — Poll until paired (auto-pair)
208
+
209
+ Poll (`pair_agent_poll`, or `visa agent enroll-claim --format json`). With the raw CLI,
210
+ read the **exit code** (`0` claimed / `3` not-ready / `1` terminal); the plugin tool
211
+ returns the same as a `done`/`status` object. Then, based on the result:
212
+
213
+ - `done: true` / exit 0, `status: "claimed"` → paired. Go to Step 4.
214
+ - `done: false` / exit 3, `status: "not_ready"` → the user hasn't finished. Tell them
215
+ you're still waiting, then poll again. **Do not loop forever** — each poll already
216
+ waits ~9s; after a handful of polls, ask the user whether they've finished on their phone.
217
+ - `done: true`, `status: "not_ready"`, `likelyExpired: true` → the 15-minute window
218
+ expired. Go back to Step 1.
219
+ - `done: true`, `status: "confirm_mismatch"` → **STOP.** See Errors.
220
+ - `done: true`, `status: "no_pending"` → no hand-off in flight. Go back to Step 1.
221
+
222
+ ### Step 4 — Confirm the identity is bound
223
+
224
+ On `claimed`, tell the user their `name` (e.g. `alec.visa`) is paired to this device. Read
225
+ `keyBound`:
226
+
227
+ - `keyBound: true` → the agent key was generated on THIS device; its private half never
228
+ left it. Highest assurance.
229
+ - `keyBound: false` → an existing agent was connected from a returning sign-in; no agent
230
+ key is held locally. Normal and expected for returning users — the credential is fully
231
+ valid.
232
+
233
+ ## What you can do once paired
234
+
235
+ Pairing is the on-ramp. v4 is **non-custodial** — a Turnkey-delegated wallet bounded by
236
+ on-device keys and policies, **not** a stored credit line or a server-custodied card.
237
+ Describe it that way to the user. The mounted MCP server exposes:
238
+
239
+ - **x402 wallet spend (the core rail)** — `wallet_discover` (find payable x402 services by
240
+ outcome; free) → `wallet_probe` (preview a fresh x402 challenge; free) → `wallet_pay` /
241
+ `wallet_directory_pay` (a bounded payment settled directly from the delegated wallet over
242
+ x402, wallet→endpoint — never touching credits, cards, or server-side spend controls).
243
+ These `wallet_*` tools are **default-on in the supported build** (the v4 wallet runtime is
244
+ bundled); spend stays bounded by the on-device wallet policy. The same rail is on the CLI
245
+ as `visa find` / `inspect` / `pay`.
246
+ - **Visa catalog (curated tools)** — `discover_tools` → `execute_tool` (or `visa tools` /
247
+ `visa run`): enumerate the curated catalog and run a tool; paid ones show a preview and
248
+ settle inline. Distinct from the open x402 directory above.
249
+ - **Subway mesh** — `subway_*` route calls across the agent mesh. **Gated:** present but only
250
+ reach the mesh once the `.visa` relay is wired (`SUBWAY_MESH` / `SUBWAY_RELAY_MULTIADDR`);
251
+ until then they no-op against an unreachable relay.
252
+ - **Real-merchant card checkout (experimental, opt-in)** — `pay_merchant` fills and pays an
253
+ ordinary merchant web checkout with a **Verified Agent card credential**: a one-shot
254
+ network-token cryptogram minted **on this device** (non-custodial) — not a stored card,
255
+ not x402, not server-side spend controls. Two steps: `review` (free; returns merchant +
256
+ exact amount as a `reviewId`) then `pay` (requires `confirm: "PAY <reviewId>"` + a passkey,
257
+ and CHARGES). **Tester-gated** (`checkout_agent_access`) and **RC/preview builds only** —
258
+ opt-in, never paired-and-go.
259
+
260
+ If a tool you expect isn't visible, the MCP server isn't mounted (or the v4 wallet runtime
261
+ isn't bundled in this build) — go back to "Getting set up".
262
+
263
+ ## Important
264
+
265
+ - **The confirmation code is display-only.** Show it; never ask for it; never accept it as
266
+ input. It lets the human verify the page matches the flow you started.
267
+ - **Never read, print, log, or echo** the credential file or the enrollment pending file,
268
+ or the `browserUrl` query values beyond the single presentation to the user. The link
269
+ carries only a hash + a public key — safe in history — but treat it as one-time.
270
+ - Do not run API-key setup, card enrollment, or a balance top-up as a substitute for
271
+ pairing. Once paired, use the `visa-cli` skill's Rail 1 commands to pay.
272
+
273
+ ## Limits
274
+
275
+ | Limit | Value |
276
+ | ------------------------------ | ------------------------------------------------------------ |
277
+ | Hand-off validity | 15 minutes from `pair_agent_start` |
278
+ | In-flight hand-offs per device | 1 (a new start replaces the prior) |
279
+ | Claim | single-shot server-side; once claimed the entry is destroyed |
280
+ | Confirmation code | 6 chars, no ambiguous glyphs; display-only |
281
+
282
+ ## Errors
283
+
284
+ All errors are JSON with a non-zero exit code; `enroll-claim` tags them with `status`.
285
+
286
+ | status / symptom | Cause | Recovery |
287
+ | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
288
+ | `error: verify-web URL not available in stable builds` | Stable CLI build, surface not public | Set `VISA_VERIFY_WEB_URL` or use a preview build. Do not proceed otherwise. |
289
+ | `error: RC build requires access` (may say `Run: visa-cli setup`) | Older RC build whose employee gate still fires on the bootstrap | **Do NOT run `visa-cli setup`** (legacy v3 GitHub-OAuth path; dead-ends on the same gate). Upgrade the RC (`npm install -g @visa/cli@rc`) or set `VISA_RC_CODE`, then retry the hand-off. |
290
+ | `no_pending` | No hand-off in flight (never started, or already claimed/expired) | Start fresh with `pair_agent_start`. |
291
+ | `not_ready`, `likelyExpired: false` | User hasn't finished the mobile flow | Wait, tell the user, poll again. Bounded polling only. |
292
+ | `not_ready`, `likelyExpired: true` | 15-minute window elapsed | Start over with `pair_agent_start`. |
293
+ | `confirm_mismatch` | The claim didn't match THIS device's secret | STOP. Show the re-derived `confirmCode`. If the user did not just finish the flow, someone else may hold their link — start over. Never retry blindly. |
294
+ | `error` (network / malformed) | Transport or server error | Surface the message. Poll once more; if it persists, start over. |
295
+
296
+ ## Further docs
297
+
298
+ - `docs/agents/ARCHITECTURE.md` — where the enroll hand-off sits in the v4 request paths.
299
+ - `visacli.sh/agents` — product-facing agent docs.
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env node
2
+ // Portable provisioner for the pair-visa-agent skill.
3
+ //
4
+ // Ensures the `visa` CLI is installed so ANY Agent Skills runtime can pair —
5
+ // not just OpenClaw (whose `metadata.openclaw.install` auto-runs). Hermes,
6
+ // Claude Code, and any other agentskills.io-compatible runtime run this bundled
7
+ // script per the standard's `scripts/` execution stage.
8
+ //
9
+ // Safe to run repeatedly: it no-ops when `visa` already resolves. Pinned to @rc
10
+ // because the v4 agent surface is prerelease (the @latest tag predates the
11
+ // `visa agent` commands); drop the tag once 4.1.0 is promoted to latest.
12
+
13
+ import { execSync } from 'node:child_process'
14
+
15
+ function resolves(cmd) {
16
+ try {
17
+ execSync(`${cmd} --version`, { stdio: 'ignore' })
18
+ return true
19
+ } catch {
20
+ return false
21
+ }
22
+ }
23
+
24
+ if (resolves('visa') || resolves('visa-cli')) {
25
+ console.log('✓ visa CLI already installed — nothing to do. Run the pairing flow in SKILL.md.')
26
+ process.exit(0)
27
+ }
28
+
29
+ console.log('Installing @visa/cli@rc (the v4 agent surface is prerelease)…')
30
+ try {
31
+ execSync('npm install -g @visa/cli@rc', { stdio: 'inherit' })
32
+ } catch {
33
+ console.error(
34
+ 'Global install failed. Try `npm install -g @visa/cli@rc` manually (may need sudo, or set a\n' +
35
+ 'user-writable npm prefix: `npm config set prefix ~/.npm-global` and add its `bin` to PATH).'
36
+ )
37
+ process.exit(1)
38
+ }
39
+
40
+ if (!resolves('visa') && !resolves('visa-cli')) {
41
+ console.error(
42
+ 'Installed, but `visa` is not on PATH. Ensure your npm global bin dir is on PATH\n' +
43
+ '(`npm bin -g` shows it), then re-run this script.'
44
+ )
45
+ process.exit(1)
46
+ }
47
+
48
+ console.log('✓ visa CLI ready. Now run the pairing flow in SKILL.md.')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visa/cli",
3
- "version": "4.1.0-rc.2",
3
+ "version": "4.1.0-rc.21",
4
4
  "description": "AI-powered payments for Claude Code",
5
5
  "bin": {
6
6
  "visa-cli": "./bin/visa-cli.js",
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "sync:server-json": "node scripts/sync-server-json.mjs",
11
11
  "check:server-json": "node scripts/sync-server-json.mjs --check",
12
- "prebuild": "node scripts/sync-server-json.mjs && pnpm --filter @visa/money build && pnpm --filter @visa/crypto build && pnpm --filter subway-sdk build && pnpm --filter @visa-cli/tools build && pnpm --filter @visa/identity build && pnpm --filter @visa/wallet build && pnpm --filter @visa/wallet-tools build",
12
+ "prebuild": "node scripts/sync-server-json.mjs && pnpm --filter @visa/money build && pnpm --filter @visa/crypto build && pnpm --filter subway-sdk build && pnpm --filter @visa-cli/tools build && pnpm --filter @visa/identity build && pnpm --filter @visa/wallet build && pnpm --filter @visa/wallet-tools build && pnpm --filter @visa/checkout-engine build",
13
13
  "build": "tsc --noEmit && node esbuild.config.js",
14
14
  "prepack": "node scripts/sync-server-json.mjs --check",
15
15
  "dev": "tsc --watch",
@@ -53,9 +53,11 @@
53
53
  "@chainsafe/libp2p-noise": "^17.0.0",
54
54
  "@chainsafe/libp2p-yamux": "^8.0.1",
55
55
  "@multiformats/multiaddr": "^13.0.3",
56
- "uint8arrays": "^6.1.1"
56
+ "uint8arrays": "^6.1.1",
57
+ "playwright-core": "^1.48.2"
57
58
  },
58
59
  "devDependencies": {
60
+ "@visa/checkout-engine": "workspace:*",
59
61
  "@visa/crypto": "workspace:*",
60
62
  "subway-sdk": "workspace:*",
61
63
  "@visa/money": "workspace:*",
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.2",
4
+ "version": "4.1.0-rc.21",
5
5
  "title": "Visa CLI",
6
6
  "description": "AI-powered payments and creative tools for coding agents. Generate images, music, video, query crypto prices, and make purchases — all 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.2",
12
+ "version": "4.1.0-rc.21",
13
13
  "transport": {
14
14
  "type": "stdio"
15
15
  },