@visa/cli 4.1.0-rc.237 → 4.1.0-rc.239

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.
@@ -87,14 +87,30 @@ mcp_servers:
87
87
  # PATH: /usr/local/bin:/usr/bin:/bin
88
88
  ```
89
89
 
90
+ ### Keep one local-state namespace
91
+
92
+ The gateway shell and the Visa MCP subprocess must resolve the same `HOME` and
93
+ `VISA_CLI_HOME`. Set that boundary before pairing and keep it stable. Changing
94
+ `VISA_CLI_HOME` later also changes where paired identity and grant records are
95
+ read; it is not a safe way to make an old contact file visible.
96
+
97
+ For example, with `HOME=/opt/data/home` and no `VISA_CLI_HOME`, identity lives
98
+ under `/opt/data/home/.visa-cli` and checkout contact under
99
+ `/opt/data/home/.visa-mcp`. A profile at `/opt/data/.visa-mcp` belongs to a
100
+ different state namespace. Do not scan, copy, or auto-adopt it: contact files
101
+ contain owner PII. Save the profile explicitly through `checkout_profile` in
102
+ the running MCP process, or run the CLI command with the exact same environment.
103
+ `visa agent preflight --format json` reports the non-secret path and source it
104
+ checked.
105
+
90
106
  ## Runtime setup map
91
107
 
92
- | Runtime | Setup surface |
93
- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
94
- | OpenClaw | Install `@visa/visa-cli-openclaw` for the bundled skill. The plugin auto-mounts the Visa MCP server, which serves `setup_start` / `setup_status`. |
108
+ | Runtime | Setup surface |
109
+ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
110
+ | OpenClaw | Install `@visa/visa-cli-openclaw` for the bundled skill. The plugin auto-mounts the Visa MCP server, which serves `setup_start` / `setup_status`. |
95
111
  | Hermes | Run `visa-cli connect hermes`, install the skill with `visa agent skill --runtime hermes` (it resolves the per-profile dir), and use `setup_start`. `hermes claw migrate` can import an existing OpenClaw setup. |
96
- | Codex | Run `visa agent skill --runtime codex`. It plants the skill under `~/.codex/skills/` and mounts the Visa MCP server into `~/.codex/config.toml` in the same step. |
97
- | Other runtime | Put `visa` on `PATH`, mount the same MCP server if supported, or use the raw `visa setup start` and `visa setup status` commands as the universal fallback. |
112
+ | Codex | Run `visa agent skill --runtime codex`. It plants the skill under `~/.codex/skills/` and mounts the Visa MCP server into `~/.codex/config.toml` in the same step. |
113
+ | Other runtime | Put `visa` on `PATH`, mount the same MCP server if supported, or use the raw `visa setup start` and `visa setup status` commands as the universal fallback. |
98
114
 
99
115
  The skill itself can be installed with `visa agent skill`. Pass `--runtime <name>` or
100
116
  `--dir <path>` when auto-detection is not appropriate, then reload the runtime.
@@ -356,7 +356,7 @@ asking them to approve a second time.
356
356
  ## Already connected — do NOT connect again
357
357
 
358
358
  If this device already holds an agent, a fresh setup is not needed and creates a
359
- *second, separate* agent. Do this instead:
359
+ _second, separate_ agent. Do this instead:
360
360
 
361
361
  1. **Tell the user plainly:** "This device is already connected as `<name>.visa`." Read
362
362
  the name from the response. Start another setup only if they explicitly want a second
@@ -398,7 +398,7 @@ against its **exact `agentId`** — never a name, never "the most recent one":
398
398
  shorten, or guess a Visa URL, and never open it yourself.
399
399
  - [ ] **The owner approves once** on the v4 agent dashboard, confirming the caps.
400
400
  - [ ] **Poll to activation** with `agent_connect_poll` (`{"attachId":"<from
401
- agent_connect>"}`) — one bounded poll per call, until
401
+ agent_connect>"}`) — one bounded poll per call, until
402
402
  `{"ok":true,"state":"grant_activated"}`.
403
403
  - [ ] **Confirm the rail is live.** Wallet: `wallet_status` / `visa wallet show`
404
404
  (`agent_capabilities.wallet.available`). Card: `agent_capabilities.card.available`.
@@ -472,6 +472,13 @@ once card authority exists and `checkout_agent_access` is enabled. Collect every
472
472
  from the human before the first review; never infer or invent identity or address data.
473
473
  Write the file with mode `0600`.
474
474
 
475
+ Create and inspect this profile through the `checkout_profile` MCP tool whenever the
476
+ payment flow runs through MCP. Do not shell `visa agent preflight` as a substitute unless
477
+ the shell has the exact same `HOME` and `VISA_CLI_HOME` as the MCP subprocess. A profile
478
+ found under another root is owner PII, not a migration candidate: never scan, copy, or
479
+ auto-adopt it. If the roots drifted, keep the root holding the paired identity and have the
480
+ owner save the profile again through `checkout_profile` in that runtime.
481
+
475
482
  ```jsonc
476
483
  {
477
484
  "fullName": "Ada Lovelace",
@@ -56,7 +56,17 @@ Preserve the merchant origin, checkout id, continuation, currency, line items, f
56
56
 
57
57
  For a checkout in `requires_escalation`, call `ucp_checkout_handoff`. It is read-only and should return the exact `pay_merchant` review request. Copy its checkout fields unchanged. Do not claim direct UCP payment-handler support merely because UCP constructed the checkout.
58
58
 
59
- If the UCP status is not accepted by the handoff tool, stop with `unsupported_checkout_state`. Do not reinterpret another state as payable.
59
+ Treat the handoff or reconcile result's typed `route` as the server's routing decision. Render `route.stage`, `route.moneyState`, and the single `route.nextAction` in Telegram or other chat status. Retain the opaque `route.resumePoint` only as transient resumable state; never replace it with a checkout URL, checkout id, credential, token, PII, or raw tool output. Never calculate a different next action from a handler namespace or an advertised profile capability.
60
+
61
+ Follow the lifecycle exactly:
62
+
63
+ - `incomplete` / `update_checkout`: update the same checkout;
64
+ - `requires_escalation` / `escalate_continue_url`: proceed only through the validated HTTPS continuation already held in the handoff tool result;
65
+ - `complete_in_progress` / `get_checkout`: poll the same checkout without submitting again;
66
+ - `completed` / `reconcile_checkout`: reconcile the same checkout and Visa receipt;
67
+ - `canceled`, an unknown state, or `blocked`: stop fail-closed.
68
+
69
+ A profile-only payment handler is advertised but unproven. Even a response-confirmed handler and selected instrument do not authorize `complete_checkout` unless the server has an exact production adapter allowlist; this bundle currently has none, so `native_complete` is unreachable. If the UCP status is not accepted by the handoff tool, stop with `unsupported_checkout_state`. Do not reinterpret another state as payable.
60
70
 
61
71
  ## Review before payment
62
72
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visa/cli",
3
- "version": "4.1.0-rc.237",
3
+ "version": "4.1.0-rc.239",
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-12-11/server.schema.json",
3
3
  "name": "io.github.visa-crypto-labs/visa-cli",
4
- "version": "4.1.0-rc.237",
4
+ "version": "4.1.0-rc.239",
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.237",
12
+ "version": "4.1.0-rc.239",
13
13
  "transport": {
14
14
  "type": "stdio"
15
15
  },