@replohq/sdk 1.13.1 → 1.13.2-beta.repl-30952-actions-validation.3.1.g5b43eb6

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.
@@ -46,7 +46,7 @@ class CookieBasedCartGateway {
46
46
  const reconciledCart = await this.reconcile(cart, {
47
47
  clampQuantities: false
48
48
  });
49
- if (JSON.stringify(reconciledCart.lines) !== JSON.stringify(cart.lines)) {
49
+ if (JSON.stringify(reconciledCart.lines) !== JSON.stringify(cart.lines) || reconciledCart.cost.currencyCode !== cart.cost.currencyCode) {
50
50
  await saveCartToCookie(reconciledCart, this.config.cookieName);
51
51
  }
52
52
  return reconciledCart;
@@ -21,9 +21,10 @@ export declare function calculateLineItemsSubtotal(lineItems: CartLine[]): numbe
21
21
  */
22
22
  export declare function recalculateCartCost(cart: Cart): Cart;
23
23
  /**
24
- * Rewrite a cookie cart with the catalog's current facts: live prices always,
25
- * unavailable lines dropped, and — on write paths only — quantities clamped to
26
- * the purchasable remainder. Reads never clamp (`clampQuantities: false`):
24
+ * Rewrite a cookie cart with the catalog's current facts: live prices and
25
+ * currency always, unavailable lines dropped, and — on write paths only —
26
+ * quantities clamped to the purchasable remainder. Reads never clamp
27
+ * (`clampQuantities: false`):
27
28
  * a quantity change without messaging is worse than one the mutation or
28
29
  * checkout path reports, mirroring Shopify's cart behavior.
29
30
  *
@@ -58,7 +58,14 @@ function applyCartLineReconciliation(cart, reconciledLines, { clampQuantities })
58
58
  }
59
59
  ];
60
60
  });
61
- return recalculateCartCost({ ...cart, lines });
61
+ const currencyCode = reconciledLines.find((catalogLine) => {
62
+ return catalogLine.status === "purchasable";
63
+ })?.currencyCode ?? cart.cost.currencyCode;
64
+ return recalculateCartCost({
65
+ ...cart,
66
+ lines,
67
+ cost: { ...cart.cost, currencyCode }
68
+ });
62
69
  }
63
70
  function calculateCartTotals({
64
71
  lineItems,
@@ -1,7 +1,7 @@
1
1
  export const BUILD_METADATA = {
2
2
  "packageName": "@replohq/sdk",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "branch": "HEAD",
5
- "commit": "60a5a41bd113ba1be5e99d2726cc080d3e6015f0",
6
- "builtAt": "2026-09-22T21:16:06.717Z"
5
+ "commit": "5b43eb62ec6c5a6e06f23132aa71c8498c5ef416",
6
+ "builtAt": "2026-09-29T00:55:45.107Z"
7
7
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sdk",
3
- "version": "1.13.1",
3
+ "version": "1.13.2-beta.repl-30952-actions-validation.3.1.g5b43eb6",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sdk",
6
- "version": "1.13.1",
6
+ "version": "1.13.2",
7
7
  "branch": "HEAD",
8
- "commit": "60a5a41bd113ba1be5e99d2726cc080d3e6015f0",
9
- "builtAt": "2026-09-22T21:16:06.717Z"
8
+ "commit": "5b43eb62ec6c5a6e06f23132aa71c8498c5ef416",
9
+ "builtAt": "2026-09-29T00:55:45.107Z"
10
10
  },
11
11
  "description": "Replo SDK — cart, analytics, and data loaders for agent-built Next.js sites.",
12
12
  "license": "SEE LICENSE IN LICENSE",