clishop 1.5.9 → 1.5.11

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
@@ -98,7 +98,7 @@ clishop setup start --email user@example.com --json
98
98
 
99
99
  `setup start` returns immediately with account-ready status and stores auth locally.
100
100
 
101
- In OpenClaw, prefer the installed CLISHOP MCP tools over CLI shell commands. For address management, the intended flow is to call `list_addresses` first, then `add_address` non-interactively with any known fields, and ask the user only for missing required address fields (`label`, `firstName`, `lastName`, `line1`, `city`, `postalCode`, `country`).
101
+ In OpenClaw, prefer the installed CLISHOP MCP tools over CLI shell commands. For address management, the intended flow is to call `list_addresses` first, then `add_address` non-interactively with any known fields, and ask the user only for missing required address fields (`label`, `firstName`, `lastName`, `line1`, `city`, `postalCode`, `country`). For payments, use `add_payment_method` to generate a secure setup link for the human, then check `list_payment_methods` after the human completes the web flow. The agent should never ask for raw card details in chat.
102
102
 
103
103
  - Search products right away with `clishop search <query>`
104
104
  - Add a shipping address later with `clishop address add`
package/dist/index.js CHANGED
@@ -1114,8 +1114,8 @@ async function runSetupWizard(emailArg, { json = false } = {}) {
1114
1114
  console.log();
1115
1115
  console.log(chalk4.bold.cyan(" W E L C O M E T O C L I S H O P"));
1116
1116
  console.log(chalk4.dim(" Order anything from your terminal."));
1117
- console.log(chalk4.dim(` npm: v${"1.5.9"}`));
1118
- console.log(chalk4.dim(` Build: ${"2026-04-06T11:34:30.345Z"}`));
1117
+ console.log(chalk4.dim(` npm: v${"1.5.11"}`));
1118
+ console.log(chalk4.dim(` Build: ${"2026-04-06T12:16:41.297Z"}`));
1119
1119
  console.log();
1120
1120
  divider(chalk4.cyan);
1121
1121
  console.log();
@@ -4261,7 +4261,7 @@ function registerDoctorCommand(program2) {
4261
4261
 
4262
4262
  // src/index.ts
4263
4263
  var program = new Command();
4264
- program.name("clishop").version("1.5.9").description(
4264
+ program.name("clishop").version("1.5.11").description(
4265
4265
  chalk16.bold("CLISHOP") + ` \u2014 Order anything from your terminal.
4266
4266
 
4267
4267
  Run 'clishop setup <email>' or 'clishop setup start --email <email> --json' to create your account.
package/dist/mcp.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  claimSetupSession,
4
+ ensureAgentOnBackend,
4
5
  getApiClient,
5
6
  getSetupStatus,
6
7
  getUserInfo,
@@ -13815,7 +13816,7 @@ function safeCall(fn) {
13815
13816
  var server = new McpServer(
13816
13817
  {
13817
13818
  name: "clishop",
13818
- version: "1.5.9"
13819
+ version: "1.5.11"
13819
13820
  },
13820
13821
  {
13821
13822
  capabilities: {
@@ -13999,7 +14000,7 @@ server.registerTool("buy_product", {
13999
14000
  throw new Error("No shipping address set. Add one first via the add_address tool.");
14000
14001
  }
14001
14002
  if (!paymentId) {
14002
- throw new Error("No payment method linked. Add one with the payment method tools before placing the order.");
14003
+ throw new Error("No payment method linked. Use the add_payment_method tool to generate a secure human payment-setup link, then list_payment_methods after the human completes setup.");
14003
14004
  }
14004
14005
  const api = getApiClient();
14005
14006
  let product;
@@ -14212,6 +14213,41 @@ server.registerTool("remove_address", {
14212
14213
  return { success: true, message: "Address removed." };
14213
14214
  });
14214
14215
  });
14216
+ server.registerTool("add_payment_method", {
14217
+ title: "Add Payment Method",
14218
+ description: "Generate a secure payment-setup link for the active agent. Give this URL to the human so they can add a payment method in the web portal. The agent never handles raw card details.",
14219
+ inputSchema: {
14220
+ agent: external_exports.string().optional().describe("Agent name (defaults to active agent)")
14221
+ },
14222
+ annotations: {
14223
+ title: "Add Payment Method",
14224
+ readOnlyHint: false,
14225
+ destructiveHint: false,
14226
+ idempotentHint: false,
14227
+ openWorldHint: true
14228
+ }
14229
+ }, async (args) => {
14230
+ return safeCall(async () => {
14231
+ const activeAgent = getActiveAgent();
14232
+ const agentName = args.agent || activeAgent.name;
14233
+ await ensureAgentOnBackend(agentName);
14234
+ const api = getApiClient();
14235
+ const res = await api.post("/payment-methods/setup", {
14236
+ agent: agentName
14237
+ });
14238
+ const setupUrl = res.data?.setupUrl;
14239
+ if (!setupUrl) {
14240
+ throw new Error("Payment setup link was not returned by the backend.");
14241
+ }
14242
+ return {
14243
+ ok: true,
14244
+ agent: agentName,
14245
+ setupUrl,
14246
+ next_action: "open_setup_url",
14247
+ human_message: "Give this secure link to the human so they can add their payment method. CLISHOP never collects raw card details inside the agent."
14248
+ };
14249
+ });
14250
+ });
14215
14251
  server.registerTool("list_payment_methods", {
14216
14252
  title: "List Payment Methods",
14217
14253
  description: "List saved payment methods for the active agent.",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "clishop",
3
3
  "displayName": "CLISHOP",
4
- "version": "1.5.9",
4
+ "version": "1.5.11",
5
5
  "mcpName": "io.github.StefDCL/clishop",
6
6
  "description": "CLISHOP — Order anything from your terminal",
7
7
  "main": "dist/index.js",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/DavooxBv2/CLISHOP",
7
7
  "source": "github"
8
8
  },
9
- "version": "1.5.9",
9
+ "version": "1.5.11",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "clishop",
14
- "version": "1.5.9",
14
+ "version": "1.5.11",
15
15
  "runtime": "node",
16
16
  "args": ["--mcp"],
17
17
  "transport": {
@@ -34,9 +34,10 @@ node ./dist/mcp.js # From the installed package directory
34
34
 
35
35
  When CLISHOP is installed in OpenClaw, prefer the MCP tools exposed by the CLISHOP server instead of shell commands.
36
36
 
37
- - OpenClaw commonly exposes these tools with a `clishop__<tool_name>` naming pattern, for example `clishop__list_addresses`, `clishop__add_address`, `clishop__set_default_address`, `clishop__list_payment_methods`, and `clishop__buy_product`.
37
+ - OpenClaw commonly exposes these tools with a `clishop__<tool_name>` naming pattern, for example `clishop__list_addresses`, `clishop__add_address`, `clishop__set_default_address`, `clishop__add_payment_method`, `clishop__list_payment_methods`, and `clishop__buy_product`.
38
38
  - If those MCP tools are available, do not fall back to `clishop address add` or other CLI subcommands.
39
39
  - If a user asks to add a home or shipping address and the address is already known from memory or prior conversation context, call the address tool directly and only ask for missing required fields.
40
+ - If a user asks to add a payment method, call `clishop__add_payment_method` or `add_payment_method` to generate a secure setup link for the human. Do not ask the user to paste card details into chat.
40
41
 
41
42
  ### Non-interactive address flow
42
43
 
@@ -46,6 +47,16 @@ When CLISHOP is installed in OpenClaw, prefer the MCP tools exposed by the CLISH
46
47
  4. Ask the user only for any missing required fields.
47
48
  5. Prefer `setDefault: true` when adding the main home address.
48
49
 
50
+ ### Payment method flow
51
+
52
+ 1. Call `clishop__list_payment_methods` or `list_payment_methods` first to see whether a payment method already exists.
53
+ 2. If none exists, call `clishop__add_payment_method` or `add_payment_method`.
54
+ 3. Give the returned `setupUrl` to the human and tell them to complete payment setup in the secure web portal.
55
+ 4. After the human confirms completion, call `clishop__list_payment_methods` again.
56
+ 5. If needed, call `clishop__set_default_payment_method` or `set_default_payment_method` with the chosen payment method ID.
57
+
58
+ The agent must never collect raw card details in chat. The secure web flow is the supported path.
59
+
49
60
  Required fields for `add_address`:
50
61
 
51
62
  - `label`
@@ -67,6 +78,24 @@ Optional fields:
67
78
  - `instructions`
68
79
  - `setDefault`
69
80
 
81
+ Example `add_address` payload for a US home address in San Francisco:
82
+
83
+ ```json
84
+ {
85
+ "label": "Home",
86
+ "firstName": "Alex",
87
+ "lastName": "Johnson",
88
+ "line1": "1234 Hayes Street",
89
+ "city": "San Francisco",
90
+ "region": "CA",
91
+ "postalCode": "94117",
92
+ "country": "United States",
93
+ "phone": "+14155550123",
94
+ "instructions": "Leave at front door",
95
+ "setDefault": true
96
+ }
97
+ ```
98
+
70
99
  ## Tools
71
100
 
72
101
  | Tool | Description | Read-only |
@@ -84,6 +113,7 @@ Optional fields:
84
113
  | `remove_address` | Remove a saved address | ❌ |
85
114
  | `set_default_address` | Set the default shipping address for the active agent | ❌ |
86
115
  | `list_payment_methods` | List saved payment methods | ✅ |
116
+ | `add_payment_method` | Generate a secure payment-setup link for the human | ❌ |
87
117
  | `remove_payment_method` | Remove a saved payment method | ❌ |
88
118
  | `set_default_payment_method` | Set the default payment method for the active agent | ❌ |
89
119
  | `list_stores` | Browse available stores | ✅ |