shopstack 0.2.6 → 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 +139 -55
- package/SKILL.md +60 -43
- package/bin/shopstack +1 -3
- package/package.json +13 -23
- package/specs/openapi.json +3322 -0
- package/src/checkout-monitor.js +126 -0
- package/src/cli.js +364 -183
- package/src/client.d.ts +285 -51
- package/src/client.js +225 -205
- package/src/config.d.ts +19 -10
- package/src/config.js +46 -34
- package/src/reservation-progress.js +132 -0
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,42 +1,69 @@
|
|
|
1
1
|
# shopstack
|
|
2
2
|
|
|
3
|
-
JavaScript client and CLI for Shopstack
|
|
3
|
+
Dependency-free JavaScript client and CLI for Shopstack checkouts and guided
|
|
4
|
+
guest restaurant reservations.
|
|
4
5
|
|
|
5
6
|
## Install
|
|
6
7
|
|
|
7
8
|
```bash
|
|
8
|
-
npm install shopstack
|
|
9
|
+
npm install shopstack@0.3.1
|
|
9
10
|
# or
|
|
10
|
-
npm install -g shopstack
|
|
11
|
+
npm install -g shopstack@0.3.1
|
|
11
12
|
```
|
|
12
13
|
|
|
13
14
|
Node.js 18 or newer is required.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
`checkout run` uses WebSocket update notifications on runtimes that provide
|
|
17
|
+
WebSocket (Node.js 22 or newer). It reads the authenticated checkout resource
|
|
18
|
+
after each notification. Older runtimes, or a failed socket connection, use the
|
|
19
|
+
bounded HTTP update wait. The one-time socket token is never placed in a URL.
|
|
20
|
+
|
|
21
|
+
This preview release pairs `shopstack@0.3.1` with `shopstack-mcp@0.2.1`.
|
|
22
|
+
Both packages use the `preview` distribution tag. The `latest` versions are
|
|
23
|
+
unchanged. Use the exact versions above to install this release.
|
|
24
|
+
|
|
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
|
|
28
|
+
`SHOPSTACK_CONFIG_FILE` for each environment. Both features use that one API and
|
|
29
|
+
verified profile; customers do not run a Worker, model, database, or proxy.
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
# Isolated hosted release preview; not staging or production.
|
|
33
|
+
export SHOPSTACK_API_URL="https://shopstack-release-preview.shopstack.workers.dev/v1"
|
|
34
|
+
export SHOPSTACK_CONFIG_FILE="/absolute/private/path/shopstack-config.json"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
New profiles remember their API address. A conflicting environment override
|
|
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.
|
|
18
40
|
|
|
19
|
-
## Verified
|
|
41
|
+
## Verified signup and sign-in
|
|
20
42
|
|
|
21
43
|
```bash
|
|
22
|
-
shopstack login
|
|
44
|
+
shopstack login
|
|
23
45
|
```
|
|
24
46
|
|
|
25
|
-
The command asks for
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
the first
|
|
47
|
+
The command asks for email and Personal or Developer account type. It starts a
|
|
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
|
|
52
|
+
persists all retry and polling capabilities before the first request, then
|
|
53
|
+
retrieves the first key after verification and stores it in
|
|
32
54
|
`~/.config/shopstack/config.json` with file mode `0600`; it never prints the
|
|
33
55
|
key, recovery capability, or polling capability. If the command is interrupted,
|
|
34
|
-
rerun `shopstack
|
|
56
|
+
rerun `shopstack signup`; the matching pending attempt resumes automatically.
|
|
57
|
+
The explicit helper also remains available:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
shopstack signup resume sup_...
|
|
61
|
+
```
|
|
35
62
|
|
|
36
63
|
## Developer account and users
|
|
37
64
|
|
|
38
65
|
```bash
|
|
39
|
-
shopstack
|
|
66
|
+
shopstack signup
|
|
40
67
|
shopstack users create --external-id customer-123 --profile customer-123
|
|
41
68
|
```
|
|
42
69
|
|
|
@@ -52,22 +79,41 @@ Configure any stdio MCP client to run:
|
|
|
52
79
|
"mcpServers": {
|
|
53
80
|
"shopstack": {
|
|
54
81
|
"command": "npx",
|
|
55
|
-
"args": ["-y", "shopstack-mcp"]
|
|
82
|
+
"args": ["-y", "shopstack-mcp@0.2.1"],
|
|
83
|
+
"env": {
|
|
84
|
+
"SHOPSTACK_API_URL": "https://shopstack-release-preview.shopstack.workers.dev/v1",
|
|
85
|
+
"SHOPSTACK_CONFIG_FILE": "/absolute/private/path/shopstack-config.json"
|
|
86
|
+
}
|
|
56
87
|
}
|
|
57
88
|
}
|
|
58
89
|
}
|
|
59
90
|
```
|
|
60
91
|
|
|
61
|
-
|
|
92
|
+
Use a different API address only when Shopstack supplies one for your environment.
|
|
93
|
+
That command uses the coordinated packages. See `packages/mcp/README.md` for the release
|
|
94
|
+
gate and local development setup. The old source-only launcher is not evidence
|
|
95
|
+
that a registry installation contains the current SDK.
|
|
96
|
+
|
|
97
|
+
The MCP server can start and poll verified signup, manage local profiles,
|
|
62
98
|
create developer-owned users, list/connect Link, and create/poll/message/cancel
|
|
63
|
-
checkouts.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
99
|
+
checkouts. It also creates, reads, continues, and cancels reservation
|
|
100
|
+
conversations. It exposes status, activity, and the latest bounded mechanical
|
|
101
|
+
intent phase. It deliberately has no card-input or payment-approval tool.
|
|
102
|
+
|
|
103
|
+
## Codex plugin
|
|
67
104
|
|
|
68
|
-
The
|
|
69
|
-
|
|
70
|
-
|
|
105
|
+
The repository contains one Shopstack plugin in `plugins/shopstack`. It uses
|
|
106
|
+
one MCP server and three focused skills:
|
|
107
|
+
|
|
108
|
+
- `shopstack-reservations` for natural restaurant search, selection, booking,
|
|
109
|
+
and cancellation;
|
|
110
|
+
- `shopstack-checkout` for checkout creation and monitoring;
|
|
111
|
+
- `shopstack-onboarding` for verified signup and private local profiles.
|
|
112
|
+
|
|
113
|
+
The plugin pins `shopstack-mcp@0.2.1`, which installs the matching
|
|
114
|
+
reservation-capable `shopstack` client. Configure the API address
|
|
115
|
+
before starting the plugin or use a profile already bound to that API. The existing top-level
|
|
116
|
+
`SKILL.md` remains in the npm client package for compatibility.
|
|
71
117
|
|
|
72
118
|
## Connections
|
|
73
119
|
|
|
@@ -77,10 +123,43 @@ shopstack connect link
|
|
|
77
123
|
```
|
|
78
124
|
|
|
79
125
|
Link is currently the only persistent payment provider. Connecting it is
|
|
80
|
-
optional.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
126
|
+
optional.
|
|
127
|
+
|
|
128
|
+
## Run a guest reservation
|
|
129
|
+
|
|
130
|
+
Create `reservation.json` with the diner details, location name, and a detailed
|
|
131
|
+
natural-language request. Do not add coordinates or a time zone:
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"diner": {
|
|
136
|
+
"country": "US",
|
|
137
|
+
"first_name": "Ada",
|
|
138
|
+
"last_name": "Lovelace",
|
|
139
|
+
"phone_number": "+12125550123"
|
|
140
|
+
},
|
|
141
|
+
"location": {
|
|
142
|
+
"query": "Times Square, New York"
|
|
143
|
+
},
|
|
144
|
+
"request": "Dinner tomorrow for two around 7:30 PM. Quiet Italian, vegetarian choices required, about $80 per person."
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Then run:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
shopstack reservation run --file reservation.json
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The CLI asks natural follow-up questions and displays current location,
|
|
155
|
+
restaurant, and time IDs. It shows the exact locked booking summary before it
|
|
156
|
+
asks for confirmation. A clear confirmation is sent through the same
|
|
157
|
+
reservation message route; there is no separate reservation approval command.
|
|
158
|
+
Use `shopstack reservation get`, `message`, or `cancel` for individual API
|
|
159
|
+
operations. Use `shopstack reservation options RESERVATION_ID` for another
|
|
160
|
+
stored page and `shopstack reservation option RESERVATION_ID OPTION_ID` for
|
|
161
|
+
full provider details. These reads do not repeat model inference or restaurant
|
|
162
|
+
search.
|
|
84
163
|
|
|
85
164
|
## Run a checkout
|
|
86
165
|
|
|
@@ -115,19 +194,6 @@ Then run:
|
|
|
115
194
|
shopstack checkout run --file checkout.json
|
|
116
195
|
```
|
|
117
196
|
|
|
118
|
-
The CLI prints the private owner live-view URL as soon as checkout creation
|
|
119
|
-
succeeds. Do not redirect it into shared logs or expose it to a model. The page
|
|
120
|
-
is view-only unless the model explicitly requests human assistance; while that
|
|
121
|
-
request is active, one owner viewer can use **Take control** and **Return
|
|
122
|
-
control**. **Stop** is always available and never approves payment.
|
|
123
|
-
|
|
124
|
-
Treat the printed URL as opaque and open it exactly as returned, including its
|
|
125
|
-
`#token=...` fragment. If that fragment is lost while the checkout is active,
|
|
126
|
-
run `shopstack checkout view CHECKOUT_ID` to receive a replacement URL. The
|
|
127
|
-
replacement disconnects an older viewer session but does not restart checkout.
|
|
128
|
-
Omit `model_handle` to use the production GLM route. Set it to `qwen` only when
|
|
129
|
-
you explicitly need the fixed Qwen comparison route.
|
|
130
|
-
|
|
131
197
|
When no provider is selected, the checkout runs normally until the payment
|
|
132
198
|
form, then asks for card details through a no-echo terminal prompt. Card data is
|
|
133
199
|
sent only to the protected payment-details endpoint. The CLI separately shows
|
|
@@ -144,11 +210,11 @@ Card values are never accepted as command-line flags.
|
|
|
144
210
|
import { ShopstackClient } from "shopstack";
|
|
145
211
|
|
|
146
212
|
const onboarding = new ShopstackClient();
|
|
147
|
-
const account = await onboarding.
|
|
213
|
+
const account = await onboarding.signup({
|
|
148
214
|
accountType: "developer",
|
|
149
215
|
email: "developer@example.com",
|
|
150
216
|
onProgress: ({ state }) => console.log(state),
|
|
151
|
-
persistence:
|
|
217
|
+
persistence: secureSignupPersistence,
|
|
152
218
|
});
|
|
153
219
|
|
|
154
220
|
const shopstack = new ShopstackClient({
|
|
@@ -162,18 +228,36 @@ const result = await shopstack.runCheckout(checkoutRequest, {
|
|
|
162
228
|
});
|
|
163
229
|
```
|
|
164
230
|
|
|
165
|
-
`
|
|
166
|
-
identity only after the
|
|
231
|
+
`signup` generates retry state internally and returns the completed account
|
|
232
|
+
identity only after the one-time credential is stored. It never returns the API
|
|
167
233
|
key, recovery key, or polling token. Pass a secure persistence adapter for
|
|
168
234
|
restart recovery and durable credential storage; never use browser storage.
|
|
169
235
|
|
|
170
236
|
`runCheckout` returns at a required input if its corresponding callback is
|
|
171
237
|
omitted. Final payment approval is never inferred from a message or from
|
|
172
|
-
supplying a card.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
238
|
+
supplying a card.
|
|
239
|
+
|
|
240
|
+
Optionally set `SHOPSTACK_API_URL` to override the hosted API and
|
|
241
|
+
`SHOPSTACK_CONFIG_FILE` to select its private profile store.
|
|
242
|
+
|
|
243
|
+
## Release verification
|
|
244
|
+
|
|
245
|
+
```sh
|
|
246
|
+
npm test
|
|
247
|
+
npm run test:types
|
|
248
|
+
npm run test:coverage
|
|
249
|
+
npm run test:packed
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
The packed test creates actual SDK and MCP archives, installs them in a clean
|
|
253
|
+
directory, and runs both features through TCP HTTP and stdio MCP. It checks
|
|
254
|
+
verified signup, shared private profiles, exact package versions, progress,
|
|
255
|
+
restaurant details, stale revisions, and single-attempt failure handling.
|
|
256
|
+
Only package dependency downloads use the public network. The API is a local
|
|
257
|
+
fixture; this does not create a real booking or order.
|
|
258
|
+
The coverage gate needs Node.js 22.7 or newer and excludes test files. It enforces
|
|
259
|
+
80% source line/function coverage and 75% branch coverage.
|
|
260
|
+
|
|
261
|
+
Release order: validate the hosted preview, freeze the SDK archive, publish that
|
|
262
|
+
exact SDK archive, then publish the matching MCP archive. Do not publish only one
|
|
263
|
+
package or promote the hosted API before the release checks pass.
|
package/SKILL.md
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: shopstack-checkout
|
|
3
|
-
description: Use Shopstack to onboard a verified personal account or a developer with independently scoped end users, inspect optional Link connectivity, and run asynchronous online checkouts
|
|
3
|
+
description: Use Shopstack to onboard a verified personal account or a developer with independently scoped end users, run guided guest restaurant reservations, inspect optional Link connectivity, and run asynchronous online checkouts. Trigger for restaurant search or booking, buying products, automating checkout, integrating Shopstack into an agent, or managing developer-owned users.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Shopstack Checkout
|
|
7
7
|
|
|
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
|
+
Use one Shopstack API and verified user profile for checkout and reservations.
|
|
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
|
+
separate private profile store for each environment. New profiles save their API
|
|
14
|
+
address and reject a conflicting override. Never ask the user to paste a key in
|
|
15
|
+
chat to fix an environment mismatch.
|
|
16
|
+
|
|
10
17
|
## Install
|
|
11
18
|
|
|
12
19
|
For the JavaScript client and CLI:
|
|
13
20
|
|
|
14
21
|
```bash
|
|
15
|
-
npm install shopstack
|
|
16
|
-
npm install -g shopstack
|
|
22
|
+
npm install shopstack@0.3.1
|
|
23
|
+
npm install -g shopstack@0.3.1
|
|
17
24
|
```
|
|
18
25
|
|
|
19
26
|
For MCP clients, configure the local stdio server:
|
|
@@ -23,13 +30,48 @@ For MCP clients, configure the local stdio server:
|
|
|
23
30
|
"mcpServers": {
|
|
24
31
|
"shopstack": {
|
|
25
32
|
"command": "npx",
|
|
26
|
-
"args": ["-y", "shopstack-mcp"]
|
|
33
|
+
"args": ["-y", "shopstack-mcp@0.2.1"]
|
|
27
34
|
}
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
37
|
```
|
|
31
38
|
|
|
32
39
|
Never ask the model to print or relay a Shopstack API key. The CLI and MCP server save verified keys in the private local Shopstack profile file.
|
|
40
|
+
The install commands require the coordinated published release. Use the
|
|
41
|
+
verified release archives while it is unpublished; an old registry package is
|
|
42
|
+
not equivalent to the current source.
|
|
43
|
+
|
|
44
|
+
## Run a guest restaurant reservation
|
|
45
|
+
|
|
46
|
+
Give Shopstack the diner name, phone number, two-letter country, a location
|
|
47
|
+
name, and one detailed natural-language request. Do not supply coordinates or a
|
|
48
|
+
time zone. Shopstack resolves the valid OpenTable location and its time zone.
|
|
49
|
+
Include as much useful detail as possible: date, local time or range, party
|
|
50
|
+
size, cuisine, budget, travel distance, atmosphere, dietary needs, seating,
|
|
51
|
+
accessibility, occasion, and anything to avoid.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
shopstack reservation run --file reservation.json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Shopstack resolves the location name, asks a natural follow-up when needed, and
|
|
58
|
+
returns the first six compact observed restaurants. Use
|
|
59
|
+
`list_reservation_options` or `shopstack reservation options` for another page.
|
|
60
|
+
Use `get_reservation_option` or `shopstack reservation option` for the exact
|
|
61
|
+
stored provider description, photos, facts, and time IDs. These reads do not
|
|
62
|
+
run another model inference or OpenTable search. Preserve every current
|
|
63
|
+
`option_id` and `time_id`. A new search makes older IDs stale.
|
|
64
|
+
|
|
65
|
+
Selection rechecks availability, locks the slot, and returns one exact booking
|
|
66
|
+
summary. Send a clear confirmation only when the user confirms that exact
|
|
67
|
+
summary. This confirmation is an ordinary reservation message and can create
|
|
68
|
+
the booking. There is no separate reservation approval endpoint or MCP tool.
|
|
69
|
+
An ambiguous reply must not be treated as confirmation. The anonymous guest
|
|
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
|
|
74
|
+
reservation with the typed reservation cancellation operation.
|
|
33
75
|
|
|
34
76
|
## Choose the account shape
|
|
35
77
|
|
|
@@ -38,22 +80,23 @@ Never ask the model to print or relay a Shopstack API key. The CLI and MCP serve
|
|
|
38
80
|
- A developer management key creates and manages users but cannot run a user's checkout.
|
|
39
81
|
- Every developer-owned user receives an independent user API key and profile.
|
|
40
82
|
|
|
41
|
-
Start verified CLI
|
|
83
|
+
Start verified CLI signup:
|
|
42
84
|
|
|
43
85
|
```bash
|
|
44
|
-
shopstack login
|
|
86
|
+
shopstack login
|
|
45
87
|
```
|
|
46
88
|
|
|
47
|
-
The command prompts
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
89
|
+
The command prompts for email and Personal or Developer account type. The user
|
|
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
|
|
94
|
+
polling capabilities before the request, polls signup, saves the verified key
|
|
95
|
+
with mode `0600`, and prints none of those credentials. Rerunning
|
|
96
|
+
`shopstack signup` automatically resumes the matching pending attempt after an
|
|
97
|
+
interruption; `shopstack signup resume SIGNUP_ID` remains an explicit helper.
|
|
55
98
|
|
|
56
|
-
After developer
|
|
99
|
+
After developer signup, create an end user:
|
|
57
100
|
|
|
58
101
|
```bash
|
|
59
102
|
shopstack users create --external-id customer-123 --profile customer-123
|
|
@@ -70,11 +113,6 @@ shopstack connect list
|
|
|
70
113
|
shopstack connect link
|
|
71
114
|
```
|
|
72
115
|
|
|
73
|
-
The Link command opens the HTTPS setup page, displays the confirmation phrase,
|
|
74
|
-
and checks every five seconds for up to five minutes. Continue only after it
|
|
75
|
-
prints `Link connected` and reports `checkout_ready: true`. If the browser does
|
|
76
|
-
not open automatically, open the exact URL printed in the terminal.
|
|
77
|
-
|
|
78
116
|
Include `payment_provider: "link"` only when the active user's Link connection reports checkout-ready. Otherwise omit `payment_provider`. Shopstack will run until card entry and request one protected checkout-scoped card through the SDK or no-echo CLI prompt.
|
|
79
117
|
|
|
80
118
|
Never put card data in MCP arguments, natural-language messages, model output, logs, or ordinary CLI flags.
|
|
@@ -115,39 +153,18 @@ shopstack checkout run --file checkout.json
|
|
|
115
153
|
Or create with MCP, then call `poll_checkout`. Display these authoritative fields to the user when they change:
|
|
116
154
|
|
|
117
155
|
- `status`: one of exactly `queued`, `started`, `help_required`, `approval_required`, `submitting`, `complete`, `failed`, `cancelled`;
|
|
118
|
-
- `presentation_revision`: the monotonic revision for user-visible checkout state;
|
|
119
156
|
- `activity`: bounded present-tense display text;
|
|
120
157
|
- `intent.name`, `intent.phase`, and `intent.updated_at`: bounded mechanical action progress with no arguments or reasoning;
|
|
121
158
|
- `required_input`: a typed handoff such as protected payment-card input;
|
|
122
159
|
- `approval`: the exact amount-bound approval request when present.
|
|
123
160
|
|
|
124
|
-
|
|
125
|
-
WebSocket capability. Each valid notification means the presentation revision
|
|
126
|
-
changed; the client then fetches the canonical checkout before displaying or
|
|
127
|
-
acting on it. The notification is not checkout state truth and never grants
|
|
128
|
-
payment authority. The capability belongs in the WebSocket subprotocol, never
|
|
129
|
-
the URL, logs, model context, or messages. If WebSocket delivery is unavailable,
|
|
130
|
-
the client falls back to bounded HTTP waiting and then fixed polling.
|
|
131
|
-
|
|
132
|
-
MCP and manual integrations poll every two seconds for `queued`, `started`, and
|
|
133
|
-
`submitting`; every five seconds for `help_required` and `approval_required`;
|
|
134
|
-
stop at `complete`, `failed`, or `cancelled`.
|
|
135
|
-
|
|
136
|
-
The optional `live_view_url` is a private owner-viewer capability. Show it only
|
|
137
|
-
to the initiating user. Do not store it in browser storage, analytics, logs,
|
|
138
|
-
model context, or ordinary messages.
|
|
139
|
-
|
|
140
|
-
Present `live_view_url` exactly as returned, including its fragment; never
|
|
141
|
-
construct a viewer URL from the checkout ID. MCP returns it as a clickable
|
|
142
|
-
resource link. If it is lost while the checkout is active, call
|
|
143
|
-
`get_live_view` (or `shopstack checkout view CHECKOUT_ID`) once and present the
|
|
144
|
-
replacement verbatim.
|
|
161
|
+
Poll every two seconds for `queued`, `started`, and `submitting`; every five seconds for `help_required` and `approval_required`; stop at `complete`, `failed`, or `cancelled`.
|
|
145
162
|
|
|
146
163
|
## Respond at typed boundaries
|
|
147
164
|
|
|
148
165
|
- Use `GET/POST /v1/checkout/{id}/messages` only for ordinary missing information.
|
|
149
166
|
- Use protected SDK/CLI payment input when `required_input.type` is `payment_card`.
|
|
150
|
-
- Use only the dedicated payment-approval endpoint
|
|
167
|
+
- Use only the dedicated payment-approval endpoint from a separately scoped trusted backend.
|
|
151
168
|
- MCP and messages cannot approve payment and expose no approval tool.
|
|
152
169
|
- Never infer approval from a user's conversational message.
|
|
153
170
|
- Cancel with the typed cancellation operation if the user withdraws the request.
|
package/bin/shopstack
CHANGED
|
@@ -5,8 +5,6 @@ import { runCli } from "../src/cli.js";
|
|
|
5
5
|
try {
|
|
6
6
|
await runCli(process.argv.slice(2));
|
|
7
7
|
} catch (error) {
|
|
8
|
-
process.stderr.write(
|
|
9
|
-
`${error instanceof Error ? error.message : String(error)}\n`,
|
|
10
|
-
);
|
|
8
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
11
9
|
process.exitCode = 1;
|
|
12
10
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shopstack",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Shopstack API client and command-line checkout and reservation tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -11,24 +11,26 @@
|
|
|
11
11
|
"./config": {
|
|
12
12
|
"types": "./src/config.d.ts",
|
|
13
13
|
"import": "./src/config.js"
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
|
+
"./openapi": "./specs/openapi.json"
|
|
15
16
|
},
|
|
16
17
|
"types": "./src/client.d.ts",
|
|
17
18
|
"files": [
|
|
18
19
|
"SKILL.md",
|
|
19
20
|
"bin",
|
|
21
|
+
"specs",
|
|
20
22
|
"src"
|
|
21
23
|
],
|
|
22
24
|
"bin": {
|
|
23
25
|
"shopstack": "bin/shopstack"
|
|
24
26
|
},
|
|
25
27
|
"scripts": {
|
|
26
|
-
"check": "npm run format:check && npm run test:coverage",
|
|
27
|
-
"format:check": "prettier --check .",
|
|
28
28
|
"shopstack": "node ./bin/shopstack",
|
|
29
|
-
"test": "node --test
|
|
30
|
-
"test:
|
|
31
|
-
"
|
|
29
|
+
"test": "node --test",
|
|
30
|
+
"test:packed": "SHOPSTACK_PACKED_RELEASE_TEST=1 node --test test/packed-release.test.js",
|
|
31
|
+
"test:types": "tsc --noEmit --strict --module nodenext --moduleResolution nodenext --target es2022 --lib es2022,dom type-tests/public-contract.ts",
|
|
32
|
+
"sync:contract": "node scripts/sync-contract.mjs",
|
|
33
|
+
"test:coverage": "node --experimental-test-coverage --test --test-coverage-include='src/*.js' --test-coverage-include='packages/mcp/src/*.js' --test-coverage-lines=80 --test-coverage-functions=80 --test-coverage-branches=75"
|
|
32
34
|
},
|
|
33
35
|
"engines": {
|
|
34
36
|
"node": ">=18"
|
|
@@ -37,27 +39,15 @@
|
|
|
37
39
|
"type": "git",
|
|
38
40
|
"url": "git+https://github.com/jimbo132/shopstack-cli.git"
|
|
39
41
|
},
|
|
40
|
-
"homepage": "https://github.com/jimbo132/shopstack-cli#readme",
|
|
41
|
-
"bugs": {
|
|
42
|
-
"url": "https://github.com/jimbo132/shopstack-cli/issues"
|
|
43
|
-
},
|
|
44
|
-
"publishConfig": {
|
|
45
|
-
"access": "public"
|
|
46
|
-
},
|
|
47
|
-
"sideEffects": false,
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"ws": "8.21.3"
|
|
50
|
-
},
|
|
51
42
|
"license": "MIT",
|
|
52
43
|
"keywords": [
|
|
53
44
|
"shopstack",
|
|
54
45
|
"cli",
|
|
55
46
|
"checkout",
|
|
56
|
-
"payments"
|
|
57
|
-
"agentic-commerce",
|
|
58
|
-
"agents"
|
|
47
|
+
"payments"
|
|
59
48
|
],
|
|
60
49
|
"devDependencies": {
|
|
61
|
-
"
|
|
50
|
+
"typescript": "6.0.3",
|
|
51
|
+
"yaml": "2.9.0"
|
|
62
52
|
}
|
|
63
53
|
}
|