shopstack 0.3.0 → 0.3.1
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 +17 -14
- package/SKILL.md +14 -9
- package/package.json +1 -1
- package/specs/openapi.json +33 -4
- package/src/cli.js +4 -1
- package/src/client.d.ts +2 -0
- package/src/client.js +2 -2
- package/src/config.d.ts +2 -0
- package/src/config.js +4 -1
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@ guest restaurant reservations.
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
|
-
npm install shopstack@0.3.
|
|
9
|
+
npm install shopstack@0.3.1
|
|
10
10
|
# or
|
|
11
|
-
npm install -g shopstack@0.3.
|
|
11
|
+
npm install -g shopstack@0.3.1
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Node.js 18 or newer is required.
|
|
@@ -18,12 +18,13 @@ WebSocket (Node.js 22 or newer). It reads the authenticated checkout resource
|
|
|
18
18
|
after each notification. Older runtimes, or a failed socket connection, use the
|
|
19
19
|
bounded HTTP update wait. The one-time socket token is never placed in a URL.
|
|
20
20
|
|
|
21
|
-
This preview release pairs `shopstack@0.3.
|
|
21
|
+
This preview release pairs `shopstack@0.3.1` with `shopstack-mcp@0.2.1`.
|
|
22
22
|
Both packages use the `preview` distribution tag. The `latest` versions are
|
|
23
23
|
unchanged. Use the exact versions above to install this release.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
The CLI and MCP use `https://shopstack-release-preview.shopstack.workers.dev/v1`
|
|
26
|
+
by default. No API URL setting is needed for this hosted release. Set
|
|
27
|
+
`SHOPSTACK_API_URL` only to select another environment. Use a separate
|
|
27
28
|
`SHOPSTACK_CONFIG_FILE` for each environment. Both features use that one API and
|
|
28
29
|
verified profile; customers do not run a Worker, model, database, or proxy.
|
|
29
30
|
|
|
@@ -34,18 +35,20 @@ export SHOPSTACK_CONFIG_FILE="/absolute/private/path/shopstack-config.json"
|
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
New profiles remember their API address. A conflicting environment override
|
|
37
|
-
fails before the credential is sent.
|
|
38
|
-
|
|
38
|
+
fails before the credential is sent. For a legacy profile without an address,
|
|
39
|
+
set its original `SHOPSTACK_API_URL` if it does not belong to the hosted release.
|
|
39
40
|
|
|
40
|
-
## Verified signup
|
|
41
|
+
## Verified signup and sign-in
|
|
41
42
|
|
|
42
43
|
```bash
|
|
43
|
-
shopstack
|
|
44
|
+
shopstack login
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
The command asks for email and Personal or Developer account type. It starts a
|
|
47
|
-
15-minute
|
|
48
|
-
|
|
48
|
+
15-minute verification and waits while you open the email. A new email creates
|
|
49
|
+
an account; an existing email signs in to the same account with a new device
|
|
50
|
+
key. Other devices remain signed in. `shopstack signup` remains an alias. No
|
|
51
|
+
new key is issued until verification. The CLI generates and privately
|
|
49
52
|
persists all retry and polling capabilities before the first request, then
|
|
50
53
|
retrieves the first key after verification and stores it in
|
|
51
54
|
`~/.config/shopstack/config.json` with file mode `0600`; it never prints the
|
|
@@ -76,7 +79,7 @@ Configure any stdio MCP client to run:
|
|
|
76
79
|
"mcpServers": {
|
|
77
80
|
"shopstack": {
|
|
78
81
|
"command": "npx",
|
|
79
|
-
"args": ["-y", "shopstack-mcp@0.2.
|
|
82
|
+
"args": ["-y", "shopstack-mcp@0.2.1"],
|
|
80
83
|
"env": {
|
|
81
84
|
"SHOPSTACK_API_URL": "https://shopstack-release-preview.shopstack.workers.dev/v1",
|
|
82
85
|
"SHOPSTACK_CONFIG_FILE": "/absolute/private/path/shopstack-config.json"
|
|
@@ -107,7 +110,7 @@ one MCP server and three focused skills:
|
|
|
107
110
|
- `shopstack-checkout` for checkout creation and monitoring;
|
|
108
111
|
- `shopstack-onboarding` for verified signup and private local profiles.
|
|
109
112
|
|
|
110
|
-
The plugin pins `shopstack-mcp@0.2.
|
|
113
|
+
The plugin pins `shopstack-mcp@0.2.1`, which installs the matching
|
|
111
114
|
reservation-capable `shopstack` client. Configure the API address
|
|
112
115
|
before starting the plugin or use a profile already bound to that API. The existing top-level
|
|
113
116
|
`SKILL.md` remains in the npm client package for compatibility.
|
|
@@ -234,7 +237,7 @@ restart recovery and durable credential storage; never use browser storage.
|
|
|
234
237
|
omitted. Final payment approval is never inferred from a message or from
|
|
235
238
|
supplying a card.
|
|
236
239
|
|
|
237
|
-
|
|
240
|
+
Optionally set `SHOPSTACK_API_URL` to override the hosted API and
|
|
238
241
|
`SHOPSTACK_CONFIG_FILE` to select its private profile store.
|
|
239
242
|
|
|
240
243
|
## Release verification
|
package/SKILL.md
CHANGED
|
@@ -8,8 +8,8 @@ description: Use Shopstack to onboard a verified personal account or a developer
|
|
|
8
8
|
Use Shopstack as the checkout execution layer. Keep account verification, user ownership, protected payment input, and final payment approval at their typed boundaries.
|
|
9
9
|
|
|
10
10
|
Use one Shopstack API and verified user profile for checkout and reservations.
|
|
11
|
-
|
|
12
|
-
`SHOPSTACK_API_URL
|
|
11
|
+
The CLI and MCP default to `https://shopstack-release-preview.shopstack.workers.dev/v1`.
|
|
12
|
+
Use `SHOPSTACK_API_URL` only to select a different API. Use a
|
|
13
13
|
separate private profile store for each environment. New profiles save their API
|
|
14
14
|
address and reject a conflicting override. Never ask the user to paste a key in
|
|
15
15
|
chat to fix an environment mismatch.
|
|
@@ -19,8 +19,8 @@ chat to fix an environment mismatch.
|
|
|
19
19
|
For the JavaScript client and CLI:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npm install shopstack@0.3.
|
|
23
|
-
npm install -g shopstack@0.3.
|
|
22
|
+
npm install shopstack@0.3.1
|
|
23
|
+
npm install -g shopstack@0.3.1
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
For MCP clients, configure the local stdio server:
|
|
@@ -30,7 +30,7 @@ For MCP clients, configure the local stdio server:
|
|
|
30
30
|
"mcpServers": {
|
|
31
31
|
"shopstack": {
|
|
32
32
|
"command": "npx",
|
|
33
|
-
"args": ["-y", "shopstack-mcp@0.2.
|
|
33
|
+
"args": ["-y", "shopstack-mcp@0.2.1"]
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -67,7 +67,10 @@ summary. Send a clear confirmation only when the user confirms that exact
|
|
|
67
67
|
summary. This confirmation is an ordinary reservation message and can create
|
|
68
68
|
the booking. There is no separate reservation approval endpoint or MCP tool.
|
|
69
69
|
An ambiguous reply must not be treated as confirmation. The anonymous guest
|
|
70
|
-
profile
|
|
70
|
+
profile is created only when booking. Pass optional `diner.email` when the user
|
|
71
|
+
supplies it; that is the guest contact address. Otherwise omit it and Shopstack
|
|
72
|
+
creates a temporary inbox when booking. Never require the user to give a
|
|
73
|
+
restaurant email. Cancel a confirmed
|
|
71
74
|
reservation with the typed reservation cancellation operation.
|
|
72
75
|
|
|
73
76
|
## Choose the account shape
|
|
@@ -80,12 +83,14 @@ reservation with the typed reservation cancellation operation.
|
|
|
80
83
|
Start verified CLI signup:
|
|
81
84
|
|
|
82
85
|
```bash
|
|
83
|
-
shopstack
|
|
86
|
+
shopstack login
|
|
84
87
|
```
|
|
85
88
|
|
|
86
89
|
The command prompts for email and Personal or Developer account type. The user
|
|
87
|
-
must open the time-limited verification link.
|
|
88
|
-
|
|
90
|
+
must open the time-limited verification link. A new email creates an account;
|
|
91
|
+
an existing email signs in to the same account and preserves other device keys.
|
|
92
|
+
The selected account type must match. `shopstack signup` is also supported.
|
|
93
|
+
No new API key is issued before verification. The CLI generates and privately stores its retry and
|
|
89
94
|
polling capabilities before the request, polls signup, saves the verified key
|
|
90
95
|
with mode `0600`, and prints none of those credentials. Rerunning
|
|
91
96
|
`shopstack signup` automatically resumes the matching pending attempt after an
|
package/package.json
CHANGED
package/specs/openapi.json
CHANGED
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"/accounts": {
|
|
24
24
|
"post": {
|
|
25
25
|
"operationId": "startAccountSignup",
|
|
26
|
-
"summary": "Start verified
|
|
26
|
+
"summary": "Start email-verified signup or sign-in",
|
|
27
|
+
"description": "A new email creates the selected account type after verification. An existing email signs in to the same account with a new profile key; other devices remain signed in. The requested account type must match the existing account. Suspended accounts and users remain blocked. No key is issued before verification, and the key is delivered once through the caller's private polling capability, never in the email page.",
|
|
27
28
|
"security": [],
|
|
28
29
|
"parameters": [
|
|
29
30
|
{
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
},
|
|
46
47
|
"responses": {
|
|
47
48
|
"202": {
|
|
48
|
-
"description": "Verification email accepted; no
|
|
49
|
+
"description": "Verification email accepted; no new API key has been issued",
|
|
49
50
|
"content": {
|
|
50
51
|
"application/json": {
|
|
51
52
|
"schema": {
|
|
@@ -198,6 +199,26 @@
|
|
|
198
199
|
}
|
|
199
200
|
}
|
|
200
201
|
},
|
|
202
|
+
"403": {
|
|
203
|
+
"description": "The verified account or implicit user is unavailable",
|
|
204
|
+
"content": {
|
|
205
|
+
"text/html": {
|
|
206
|
+
"schema": {
|
|
207
|
+
"type": "string"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"409": {
|
|
213
|
+
"description": "The requested account type does not match the verified existing account",
|
|
214
|
+
"content": {
|
|
215
|
+
"text/html": {
|
|
216
|
+
"schema": {
|
|
217
|
+
"type": "string"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
201
222
|
"410": {
|
|
202
223
|
"description": "Verification capability expired",
|
|
203
224
|
"content": {
|
|
@@ -1843,6 +1864,12 @@
|
|
|
1843
1864
|
"phone_number"
|
|
1844
1865
|
],
|
|
1845
1866
|
"properties": {
|
|
1867
|
+
"email": {
|
|
1868
|
+
"type": "string",
|
|
1869
|
+
"format": "email",
|
|
1870
|
+
"maxLength": 254,
|
|
1871
|
+
"description": "Optional booking contact email. When supplied, this exact trimmed address is used for the guest profile. Otherwise Shopstack creates a temporary inbox when booking. Do not ask for an email if it was omitted."
|
|
1872
|
+
},
|
|
1846
1873
|
"country": {
|
|
1847
1874
|
"type": "string",
|
|
1848
1875
|
"pattern": "^[A-Z]{2}$"
|
|
@@ -2358,7 +2385,8 @@
|
|
|
2358
2385
|
"minimum": 1
|
|
2359
2386
|
},
|
|
2360
2387
|
"status": {
|
|
2361
|
-
"type": "string"
|
|
2388
|
+
"type": "string",
|
|
2389
|
+
"description": "Shopstack booking outcome, confirmed. Provider lifecycle labels are not returned as this status."
|
|
2362
2390
|
}
|
|
2363
2391
|
}
|
|
2364
2392
|
}
|
|
@@ -2391,7 +2419,8 @@
|
|
|
2391
2419
|
"type": "string"
|
|
2392
2420
|
},
|
|
2393
2421
|
"status": {
|
|
2394
|
-
"type": "string"
|
|
2422
|
+
"type": "string",
|
|
2423
|
+
"description": "Shopstack cancellation outcome, cancelled."
|
|
2395
2424
|
}
|
|
2396
2425
|
}
|
|
2397
2426
|
}
|
package/src/cli.js
CHANGED
|
@@ -7,6 +7,9 @@ import { ConfigStore, resolveProfileBaseUrl } from "./config.js";
|
|
|
7
7
|
const HELP = `Shopstack
|
|
8
8
|
|
|
9
9
|
Account setup:
|
|
10
|
+
shopstack login
|
|
11
|
+
shopstack login user --email EMAIL
|
|
12
|
+
shopstack login developer --email EMAIL
|
|
10
13
|
shopstack signup
|
|
11
14
|
shopstack signup user --email EMAIL
|
|
12
15
|
shopstack signup developer --email EMAIL
|
|
@@ -305,7 +308,7 @@ export async function runCli(args, supplied = {}) {
|
|
|
305
308
|
return;
|
|
306
309
|
}
|
|
307
310
|
|
|
308
|
-
if (group === "signup") {
|
|
311
|
+
if (group === "signup" || group === "login") {
|
|
309
312
|
if (action === "resume") {
|
|
310
313
|
if (rest.length !== 1) {
|
|
311
314
|
throw new Error("Use `shopstack signup resume SIGNUP_ID`.");
|
package/src/client.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ export interface CreateCheckoutRequest {
|
|
|
40
40
|
|
|
41
41
|
export interface ReservationDiner {
|
|
42
42
|
country: string;
|
|
43
|
+
/** Optional booking contact address. If omitted, Shopstack creates a temporary inbox. */
|
|
44
|
+
email?: string;
|
|
43
45
|
first_name: string;
|
|
44
46
|
last_name: string;
|
|
45
47
|
phone_number: string;
|
package/src/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
2
2
|
import { readReservationProgress } from "./reservation-progress.js";
|
|
3
|
-
import { resolveProfileBaseUrl } from "./config.js";
|
|
3
|
+
import { DEFAULT_API_URL, resolveProfileBaseUrl } from "./config.js";
|
|
4
4
|
import { checkoutMonitor } from "./checkout-monitor.js";
|
|
5
5
|
|
|
6
6
|
const TERMINAL_STATUSES = new Set(["complete", "failed", "cancelled"]);
|
|
@@ -42,7 +42,7 @@ function delay(milliseconds) {
|
|
|
42
42
|
export class ShopstackClient {
|
|
43
43
|
constructor({
|
|
44
44
|
apiKey,
|
|
45
|
-
baseUrl = process.env.SHOPSTACK_API_URL,
|
|
45
|
+
baseUrl = process.env.SHOPSTACK_API_URL ?? DEFAULT_API_URL,
|
|
46
46
|
fetch: fetchImplementation = globalThis.fetch,
|
|
47
47
|
webSocket = globalThis.WebSocket,
|
|
48
48
|
} = {}) {
|
package/src/config.d.ts
CHANGED
package/src/config.js
CHANGED
|
@@ -2,6 +2,9 @@ import { chmod, mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
|
|
5
|
+
export const DEFAULT_API_URL =
|
|
6
|
+
"https://shopstack-release-preview.shopstack.workers.dev/v1";
|
|
7
|
+
|
|
5
8
|
export function resolveProfileBaseUrl(profile, selectedBaseUrl) {
|
|
6
9
|
const saved = profile?.baseUrl?.replace(/\/+$/u, "");
|
|
7
10
|
const selected = selectedBaseUrl?.replace(/\/+$/u, "");
|
|
@@ -10,7 +13,7 @@ export function resolveProfileBaseUrl(profile, selectedBaseUrl) {
|
|
|
10
13
|
"This profile belongs to a different Shopstack API. Select its endpoint or use a separate profile store.",
|
|
11
14
|
);
|
|
12
15
|
}
|
|
13
|
-
return saved ?? selected;
|
|
16
|
+
return saved ?? selected ?? DEFAULT_API_URL;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export function defaultConfigPath() {
|