shopstack 0.2.2 → 0.2.3

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
@@ -63,12 +63,14 @@ Configure any stdio MCP client to run:
63
63
 
64
64
  The MCP server can start and poll verified signup, manage local profiles,
65
65
  create developer-owned users, list/connect Link, and create/poll/message/cancel
66
- checkouts. It exposes status, activity, and the latest bounded mechanical intent
67
- phase. It deliberately has no card-input or payment-approval tool.
66
+ checkouts. Checkout creation returns the exact live-view URL as a clickable MCP
67
+ resource; `get_live_view` replaces a lost one-time link for an active checkout.
68
+ It exposes status, activity, and the latest bounded mechanical intent phase. It
69
+ deliberately has no card-input or payment-approval tool.
68
70
 
69
71
  The canonical agent skill ships as `SKILL.md` in this package. After
70
72
  publication it is available at
71
- `https://unpkg.com/shopstack@0.2.2/SKILL.md` with the release-pinned package.
73
+ `https://unpkg.com/shopstack@0.2.3/SKILL.md` with the release-pinned package.
72
74
 
73
75
  ## Connections
74
76
 
@@ -119,6 +121,10 @@ is view-only unless the model explicitly requests human assistance; while that
119
121
  request is active, one owner viewer can use **Take control** and **Return
120
122
  control**. **Stop** is always available and never approves payment.
121
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.
122
128
  When no provider is selected, the checkout runs normally until the payment
123
129
  form, then asks for card details through a no-echo terminal prompt. Card data is
124
130
  sent only to the protected payment-details endpoint. The CLI separately shows
package/SKILL.md CHANGED
@@ -131,6 +131,12 @@ The optional `live_view_url` is a private owner-viewer capability. Show it only
131
131
  to the initiating user. Do not store it in browser storage, analytics, logs,
132
132
  model context, or ordinary messages.
133
133
 
134
+ Present `live_view_url` exactly as returned, including its fragment; never
135
+ construct a viewer URL from the checkout ID. MCP returns it as a clickable
136
+ resource link. If it is lost while the checkout is active, call
137
+ `get_live_view` (or `shopstack checkout view CHECKOUT_ID`) once and present the
138
+ replacement verbatim.
139
+
134
140
  ## Respond at typed boundaries
135
141
 
136
142
  - Use `GET/POST /v1/checkout/{id}/messages` only for ordinary missing information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopstack",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Production Shopstack SDK and CLI for agentic checkout.",
5
5
  "type": "module",
6
6
  "exports": {
package/src/cli.js CHANGED
@@ -40,6 +40,8 @@ Checkout:
40
40
  # Create, monitor, and complete a checkout interactively.
41
41
  shopstack checkout get CHECKOUT_ID
42
42
  # Read the canonical current checkout state.
43
+ shopstack checkout view CHECKOUT_ID
44
+ # Replace and return the active checkout's private owner live-view URL.
43
45
  shopstack checkout cancel CHECKOUT_ID
44
46
  # Cancel a checkout that has not reached a terminal state.
45
47
 
@@ -542,13 +544,18 @@ export async function runCli(args, supplied = {}) {
542
544
  return;
543
545
  }
544
546
 
545
- if (group === "checkout" && (action === "get" || action === "cancel")) {
547
+ if (
548
+ group === "checkout" &&
549
+ (action === "get" || action === "view" || action === "cancel")
550
+ ) {
546
551
  if (rest.length !== 1) throw new Error("A checkout ID is required.");
547
552
  const { client } = await activeClient(dependencies, "user");
548
553
  const result =
549
554
  action === "get"
550
555
  ? await client.getCheckout(rest[0])
551
- : await client.cancelCheckout(rest[0]);
556
+ : action === "view"
557
+ ? await client.createLiveView(rest[0])
558
+ : await client.cancelCheckout(rest[0]);
552
559
  writeJson(dependencies.stdout, result);
553
560
  return;
554
561
  }
package/src/client.d.ts CHANGED
@@ -78,6 +78,10 @@ export interface CheckoutUpdateSubscription {
78
78
  presentation_revision: number;
79
79
  }
80
80
 
81
+ export interface LiveViewCapability {
82
+ live_view_url: string;
83
+ }
84
+
81
85
  export interface AccountSignupStarted {
82
86
  id: string;
83
87
  account_type: "personal" | "developer";
@@ -200,6 +204,10 @@ export class ShopstackClient {
200
204
  options?: { idempotencyKey?: string },
201
205
  ): Promise<Checkout>;
202
206
  getCheckout(checkoutId: string): Promise<Checkout>;
207
+ createLiveView(
208
+ checkoutId: string,
209
+ options?: { idempotencyKey?: string },
210
+ ): Promise<LiveViewCapability>;
203
211
  createCheckoutUpdateSubscription(
204
212
  checkoutId: string,
205
213
  ): Promise<CheckoutUpdateSubscription>;
package/src/client.js CHANGED
@@ -444,6 +444,16 @@ export class ShopstackClient {
444
444
  return this.request(`/checkout/${encodeURIComponent(checkoutId)}`);
445
445
  }
446
446
 
447
+ createLiveView(checkoutId, { idempotencyKey: key } = {}) {
448
+ return this.request(
449
+ `/checkout/${encodeURIComponent(checkoutId)}/live-view`,
450
+ {
451
+ idempotencyKey: key ?? idempotencyKey("live-view"),
452
+ method: "POST",
453
+ },
454
+ );
455
+ }
456
+
447
457
  createCheckoutUpdateSubscription(checkoutId) {
448
458
  return this.request(`/checkout/${encodeURIComponent(checkoutId)}/updates`, {
449
459
  method: "POST",