@replohq/sdk 1.7.1 → 1.7.2

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.
@@ -261,6 +261,7 @@ export declare const errorUserFacingDetailsMessageSchema: z.ZodObject<{
261
261
  isRecoverable: z.ZodOptional<z.ZodBoolean>;
262
262
  detail: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString>, z.ZodString]>>;
263
263
  key: z.ZodString;
264
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
264
265
  usage: z.ZodOptional<z.ZodObject<{
265
266
  current: z.ZodNumber;
266
267
  maximum: z.ZodNumber;
@@ -327,6 +328,7 @@ export declare const errorUserFacingDetailsSchema: z.ZodDiscriminatedUnion<[z.Zo
327
328
  isRecoverable: z.ZodOptional<z.ZodBoolean>;
328
329
  detail: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString>, z.ZodString]>>;
329
330
  key: z.ZodString;
331
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
330
332
  usage: z.ZodOptional<z.ZodObject<{
331
333
  current: z.ZodNumber;
332
334
  maximum: z.ZodNumber;
@@ -4,6 +4,9 @@ export type ErrorUserFacingDetailsWithMessage = {
4
4
  isRecoverable?: boolean;
5
5
  detail?: string[] | string;
6
6
  key: string;
7
+ details?: {
8
+ [x: string]: unknown;
9
+ };
7
10
  usage?: {
8
11
  current: number;
9
12
  maximum: number;
@@ -1,4 +1,4 @@
1
- import { ReploError } from '../../chunk-5M7VU32I.mjs';
1
+ import { ReploError } from '../../chunk-YJQVNUW7.mjs';
2
2
  import '../../chunk-AL3F36PH.mjs';
3
3
  import '../../chunk-GV5FY7ZZ.mjs';
4
4
  import { __commonJS, __toESM } from '../../chunk-UJCSKKID.mjs';
@@ -1,4 +1,4 @@
1
- import { ReploError } from '../../../chunk-5M7VU32I.mjs';
1
+ import { ReploError } from '../../../chunk-YJQVNUW7.mjs';
2
2
  import '../../../chunk-AL3F36PH.mjs';
3
3
  import '../../../chunk-GV5FY7ZZ.mjs';
4
4
  import '../../../chunk-UJCSKKID.mjs';
@@ -1,5 +1,5 @@
1
1
  import { getParamSegment, getRouteParams, hasRouteParam, matchSource } from '../../../chunk-VPEVERWE.mjs';
2
- import { ReploError } from '../../../chunk-5M7VU32I.mjs';
2
+ import { ReploError } from '../../../chunk-YJQVNUW7.mjs';
3
3
  import '../../../chunk-AL3F36PH.mjs';
4
4
  import '../../../chunk-GV5FY7ZZ.mjs';
5
5
  import '../../../chunk-UJCSKKID.mjs';
@@ -46,6 +46,11 @@ var errorUserFacingDetailsMessageSchema = z.object({
46
46
  // in FullPageModal only.
47
47
  detail: z.array(z.string()).or(z.string()).optional(),
48
48
  key: z.string(),
49
+ // Structured data for API callers next to the human message, e.g. the
50
+ // current draft version on a project-context 409 or the offending paths on
51
+ // a 422. The worker error handler serializes userFacingDetails as-is, so
52
+ // this is the one place such data can travel without a second envelope.
53
+ details: z.record(z.string(), z.unknown()).optional(),
49
54
  usage: z.object({
50
55
  current: z.number(),
51
56
  maximum: z.number()
@@ -1,7 +1,7 @@
1
1
  export const BUILD_METADATA = {
2
2
  "packageName": "@replohq/sdk",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "branch": "HEAD",
5
- "commit": "02341f30e58f02e0d8482f829ff4346d95f3f3ec",
6
- "builtAt": "2026-09-11T19:49:03.840Z"
5
+ "commit": "5d0cc60f9bd67d3ed2c181939fca1a8cacc979e9",
6
+ "builtAt": "2026-09-14T22:55:35.132Z"
7
7
  };
@@ -20,9 +20,7 @@ function cloudflareLoader({
20
20
  width,
21
21
  quality
22
22
  }) {
23
- if (process.env.NODE_ENV === "development") {
24
- return src;
25
- }
23
+ const isDevelopment = process.env.NODE_ENV === "development";
26
24
  const params = [`width=${width}`, `quality=${quality ?? 75}`, "format=auto"];
27
25
  if (/^https:\/\//i.test(src)) {
28
26
  let hostname;
@@ -38,11 +36,15 @@ function cloudflareLoader({
38
36
  return src;
39
37
  }
40
38
  if (/(^|\.)replocdn\.com$/i.test(hostname)) {
41
- return `/cdn-cgi/image/${params.join(",")}/${src}`;
39
+ const resizerOrigin = isDevelopment ? REPLO_IMAGE_CDN : "";
40
+ return `${resizerOrigin}/cdn-cgi/image/${params.join(",")}/${src}`;
42
41
  }
43
42
  const passthroughUrl = `${REPLO_IMAGE_CDN}/images/external?url=${encodeURIComponent(src)}`;
44
43
  return `${REPLO_IMAGE_CDN}/cdn-cgi/image/${[...params, "onerror=redirect"].join(",")}/${passthroughUrl}`;
45
44
  }
45
+ if (isDevelopment) {
46
+ return src;
47
+ }
46
48
  const normalizedSrc = src.startsWith("/") ? src.slice(1) : src;
47
49
  return `/cdn-cgi/image/${params.join(",")}/${normalizedSrc}`;
48
50
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../next/image-loader.ts"],
4
- "sourcesContent": ["import type { ImageLoaderProps } from \"next/image\";\n\nconst REPLO_IMAGE_CDN = \"https://assets.replocdn.com\";\n\n// Contentful Images API hosts (US + regional, e.g. images.eu.ctfassets.net).\n// These already resize/format via query params \u2014 do not Cloudflare-proxy them.\nfunction isContentfulImagesCdn(hostname: string): boolean {\n return /^images(?:\\.[a-z]+)?\\.ctfassets\\.net$/i.test(hostname);\n}\n\nfunction contentfulImagesApiUrl({\n src,\n width,\n quality,\n}: {\n src: string;\n width: number;\n quality?: number;\n}): string {\n const url = new URL(src);\n url.searchParams.set(\"w\", String(width));\n url.searchParams.set(\"q\", String(quality ?? 75));\n if (!url.searchParams.has(\"fm\")) {\n url.searchParams.set(\"fm\", \"webp\");\n }\n return url.toString();\n}\n\nexport default function cloudflareLoader({\n src,\n width,\n quality,\n}: ImageLoaderProps): string {\n // NOTE (Cole, 2026-05-15, REPL-27122): /cdn-cgi/image/ only exists on\n // Cloudflare's edge. During `next dev` in the sandbox the preview is served\n // through the Daytona proxy, so rewritten URLs would 404.\n if (process.env.NODE_ENV === \"development\") {\n return src;\n }\n\n const params = [`width=${width}`, `quality=${quality ?? 75}`, \"format=auto\"];\n\n if (/^https:\\/\\//i.test(src)) {\n let hostname: string;\n try {\n hostname = new URL(src).hostname;\n } catch {\n return src;\n }\n // NOTE (Noah, 2026-07-31): Contentful's own CDN owns transforms\n // (Images API on images*.ctfassets.net). Never route ctfassets through the\n // Cloudflare/replocdn passthrough \u2014 double-proxying fights their params.\n if (/(^|\\.)ctfassets\\.net$/i.test(hostname)) {\n if (isContentfulImagesCdn(hostname)) {\n return contentfulImagesApiUrl({ src, width, quality });\n }\n return src;\n }\n if (/(^|\\.)replocdn\\.com$/i.test(hostname)) {\n return `/cdn-cgi/image/${params.join(\",\")}/${src}`;\n }\n // NOTE (Cole, 2026-07-02, REPL-28680): commerce CDNs (Shopify, BigCommerce)\n // reject the Cloudflare resizer's own fetches, so third-party images resize\n // on the replocdn zone from our passthrough endpoint, which re-fetches them\n // with an ordinary request. The replocdn zone only resizes same-zone\n // sources, so the passthrough URL must stay on assets.replocdn.com.\n // onerror=redirect serves the unoptimized original if the transform fails.\n const passthroughUrl = `${REPLO_IMAGE_CDN}/images/external?url=${encodeURIComponent(src)}`;\n return `${REPLO_IMAGE_CDN}/cdn-cgi/image/${[...params, \"onerror=redirect\"].join(\",\")}/${passthroughUrl}`;\n }\n\n const normalizedSrc = src.startsWith(\"/\") ? src.slice(1) : src;\n return `/cdn-cgi/image/${params.join(\",\")}/${normalizedSrc}`;\n}\n"],
5
- "mappings": "AAEA,MAAM,kBAAkB;AAIxB,SAAS,sBAAsB,UAA2B;AACxD,SAAO,yCAAyC,KAAK,QAAQ;AAC/D;AAEA,SAAS,uBAAuB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,GAIW;AACT,QAAM,MAAM,IAAI,IAAI,GAAG;AACvB,MAAI,aAAa,IAAI,KAAK,OAAO,KAAK,CAAC;AACvC,MAAI,aAAa,IAAI,KAAK,OAAO,WAAW,EAAE,CAAC;AAC/C,MAAI,CAAC,IAAI,aAAa,IAAI,IAAI,GAAG;AAC/B,QAAI,aAAa,IAAI,MAAM,MAAM;AAAA,EACnC;AACA,SAAO,IAAI,SAAS;AACtB;AAEe,SAAR,iBAAkC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AACF,GAA6B;AAI3B,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,CAAC,SAAS,KAAK,IAAI,WAAW,WAAW,EAAE,IAAI,aAAa;AAE3E,MAAI,eAAe,KAAK,GAAG,GAAG;AAC5B,QAAI;AACJ,QAAI;AACF,iBAAW,IAAI,IAAI,GAAG,EAAE;AAAA,IAC1B,QAAQ;AACN,aAAO;AAAA,IACT;AAIA,QAAI,yBAAyB,KAAK,QAAQ,GAAG;AAC3C,UAAI,sBAAsB,QAAQ,GAAG;AACnC,eAAO,uBAAuB,EAAE,KAAK,OAAO,QAAQ,CAAC;AAAA,MACvD;AACA,aAAO;AAAA,IACT;AACA,QAAI,wBAAwB,KAAK,QAAQ,GAAG;AAC1C,aAAO,kBAAkB,OAAO,KAAK,GAAG,CAAC,IAAI,GAAG;AAAA,IAClD;AAOA,UAAM,iBAAiB,GAAG,eAAe,wBAAwB,mBAAmB,GAAG,CAAC;AACxF,WAAO,GAAG,eAAe,kBAAkB,CAAC,GAAG,QAAQ,kBAAkB,EAAE,KAAK,GAAG,CAAC,IAAI,cAAc;AAAA,EACxG;AAEA,QAAM,gBAAgB,IAAI,WAAW,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI;AAC3D,SAAO,kBAAkB,OAAO,KAAK,GAAG,CAAC,IAAI,aAAa;AAC5D;",
4
+ "sourcesContent": ["import type { ImageLoaderProps } from \"next/image\";\n\nconst REPLO_IMAGE_CDN = \"https://assets.replocdn.com\";\n\n// Contentful Images API hosts (US + regional, e.g. images.eu.ctfassets.net).\n// These already resize/format via query params \u2014 do not Cloudflare-proxy them.\nfunction isContentfulImagesCdn(hostname: string): boolean {\n return /^images(?:\\.[a-z]+)?\\.ctfassets\\.net$/i.test(hostname);\n}\n\nfunction contentfulImagesApiUrl({\n src,\n width,\n quality,\n}: {\n src: string;\n width: number;\n quality?: number;\n}): string {\n const url = new URL(src);\n url.searchParams.set(\"w\", String(width));\n url.searchParams.set(\"q\", String(quality ?? 75));\n if (!url.searchParams.has(\"fm\")) {\n url.searchParams.set(\"fm\", \"webp\");\n }\n return url.toString();\n}\n\nexport default function cloudflareLoader({\n src,\n width,\n quality,\n}: ImageLoaderProps): string {\n // NOTE (Cole, 2026-05-15, REPL-27122): /cdn-cgi/image/ only exists on\n // Cloudflare's edge. During `next dev` in the sandbox the preview is served\n // through the Daytona proxy, so site-zone resizer URLs would 404.\n // NOTE (Cole, 2026-09-13, REPL-30607): Only site-zone URLs skip resizing in\n // dev. Returning every src unchanged made Next warn that the loader \"does not\n // implement width\" for each image, and absolute sources can resize on the\n // replocdn zone, which is reachable from dev.\n const isDevelopment = process.env.NODE_ENV === \"development\";\n\n const params = [`width=${width}`, `quality=${quality ?? 75}`, \"format=auto\"];\n\n if (/^https:\\/\\//i.test(src)) {\n let hostname: string;\n try {\n hostname = new URL(src).hostname;\n } catch {\n return src;\n }\n // NOTE (Noah, 2026-07-31): Contentful's own CDN owns transforms\n // (Images API on images*.ctfassets.net). Never route ctfassets through the\n // Cloudflare/replocdn passthrough \u2014 double-proxying fights their params.\n if (/(^|\\.)ctfassets\\.net$/i.test(hostname)) {\n if (isContentfulImagesCdn(hostname)) {\n return contentfulImagesApiUrl({ src, width, quality });\n }\n return src;\n }\n if (/(^|\\.)replocdn\\.com$/i.test(hostname)) {\n const resizerOrigin = isDevelopment ? REPLO_IMAGE_CDN : \"\";\n return `${resizerOrigin}/cdn-cgi/image/${params.join(\",\")}/${src}`;\n }\n // NOTE (Cole, 2026-07-02, REPL-28680): commerce CDNs (Shopify, BigCommerce)\n // reject the Cloudflare resizer's own fetches, so third-party images resize\n // on the replocdn zone from our passthrough endpoint, which re-fetches them\n // with an ordinary request. The replocdn zone only resizes same-zone\n // sources, so the passthrough URL must stay on assets.replocdn.com.\n // onerror=redirect serves the unoptimized original if the transform fails.\n const passthroughUrl = `${REPLO_IMAGE_CDN}/images/external?url=${encodeURIComponent(src)}`;\n return `${REPLO_IMAGE_CDN}/cdn-cgi/image/${[...params, \"onerror=redirect\"].join(\",\")}/${passthroughUrl}`;\n }\n\n if (isDevelopment) {\n return src;\n }\n\n const normalizedSrc = src.startsWith(\"/\") ? src.slice(1) : src;\n return `/cdn-cgi/image/${params.join(\",\")}/${normalizedSrc}`;\n}\n"],
5
+ "mappings": "AAEA,MAAM,kBAAkB;AAIxB,SAAS,sBAAsB,UAA2B;AACxD,SAAO,yCAAyC,KAAK,QAAQ;AAC/D;AAEA,SAAS,uBAAuB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,GAIW;AACT,QAAM,MAAM,IAAI,IAAI,GAAG;AACvB,MAAI,aAAa,IAAI,KAAK,OAAO,KAAK,CAAC;AACvC,MAAI,aAAa,IAAI,KAAK,OAAO,WAAW,EAAE,CAAC;AAC/C,MAAI,CAAC,IAAI,aAAa,IAAI,IAAI,GAAG;AAC/B,QAAI,aAAa,IAAI,MAAM,MAAM;AAAA,EACnC;AACA,SAAO,IAAI,SAAS;AACtB;AAEe,SAAR,iBAAkC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AACF,GAA6B;AAQ3B,QAAM,gBAAgB,QAAQ,IAAI,aAAa;AAE/C,QAAM,SAAS,CAAC,SAAS,KAAK,IAAI,WAAW,WAAW,EAAE,IAAI,aAAa;AAE3E,MAAI,eAAe,KAAK,GAAG,GAAG;AAC5B,QAAI;AACJ,QAAI;AACF,iBAAW,IAAI,IAAI,GAAG,EAAE;AAAA,IAC1B,QAAQ;AACN,aAAO;AAAA,IACT;AAIA,QAAI,yBAAyB,KAAK,QAAQ,GAAG;AAC3C,UAAI,sBAAsB,QAAQ,GAAG;AACnC,eAAO,uBAAuB,EAAE,KAAK,OAAO,QAAQ,CAAC;AAAA,MACvD;AACA,aAAO;AAAA,IACT;AACA,QAAI,wBAAwB,KAAK,QAAQ,GAAG;AAC1C,YAAM,gBAAgB,gBAAgB,kBAAkB;AACxD,aAAO,GAAG,aAAa,kBAAkB,OAAO,KAAK,GAAG,CAAC,IAAI,GAAG;AAAA,IAClE;AAOA,UAAM,iBAAiB,GAAG,eAAe,wBAAwB,mBAAmB,GAAG,CAAC;AACxF,WAAO,GAAG,eAAe,kBAAkB,CAAC,GAAG,QAAQ,kBAAkB,EAAE,KAAK,GAAG,CAAC,IAAI,cAAc;AAAA,EACxG;AAEA,MAAI,eAAe;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,gBAAgB,IAAI,WAAW,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI;AAC3D,SAAO,kBAAkB,OAAO,KAAK,GAAG,CAAC,IAAI,aAAa;AAC5D;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sdk",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sdk",
6
- "version": "1.7.1",
6
+ "version": "1.7.2",
7
7
  "branch": "HEAD",
8
- "commit": "02341f30e58f02e0d8482f829ff4346d95f3f3ec",
9
- "builtAt": "2026-09-11T19:49:03.840Z"
8
+ "commit": "5d0cc60f9bd67d3ed2c181939fca1a8cacc979e9",
9
+ "builtAt": "2026-09-14T22:55:35.132Z"
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",