@replohq/canopy-sdk 0.8.2 → 0.8.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/next/config.js CHANGED
@@ -17,6 +17,7 @@ const PLATFORM_SERVER_ACTION_ORIGINS = [
17
17
  ];
18
18
  const dedupe = (origins) => Array.from(new Set(origins));
19
19
  function siteConfig(overrides = {}) {
20
+ const isBuild = process.env.BUILD_ENV === "build";
20
21
  const {
21
22
  turbopack: overrideTurbopack,
22
23
  images: overrideImages,
@@ -33,19 +34,19 @@ function siteConfig(overrides = {}) {
33
34
  // Platform invariants — re-asserted after the spread so a site override
34
35
  // can never break sandbox builds, publish, or the dev server.
35
36
  output: "standalone",
36
- distDir: process.env.BUILD_ENV === "build" ? ".next" : ".next-dev",
37
+ distDir: isBuild ? ".next" : ".next-dev",
37
38
  // NOTE (Cole, 2026-04-30, REPL-26637): The publish tool patches
38
39
  // required-server-files.json to clear this value before OpenNext bundles,
39
40
  // since "/" makes esbuild emit absolute-path requires that break in Workers.
40
41
  // NOTE (Patrick Lu, 2026-07-06, REPL-28775): Leave outputFileTracingRoot
41
42
  // unset outside builds because Next 15.5+ otherwise forces turbopack.root to
42
43
  // "/" and makes the dev watcher retain whole-filesystem state.
43
- outputFileTracingRoot: process.env.BUILD_ENV === "build" ? "/" : void 0,
44
- // NOTE (Patrick Lu, 2026-07-06, REPL-28775): Keep Turbopack's watcher on
45
- // the user app tree; workspace packages are copied into node_modules there.
44
+ outputFileTracingRoot: isBuild ? "/" : void 0,
45
+ // NOTE (Patrick Lu, 2026-07-06, REPL-28775): Match build tracing at publish
46
+ // time; keep dev's watcher on the user app tree.
46
47
  turbopack: {
47
48
  ...overrideTurbopack,
48
- root: "/workspace/dev"
49
+ root: isBuild ? "/" : "/workspace/dev"
49
50
  },
50
51
  allowedDevOrigins: dedupe([
51
52
  ...overrideDevOrigins ?? [],
@@ -68,7 +69,7 @@ function siteConfig(overrides = {}) {
68
69
  // off os.cpus().length = host cores (~64) inside a cgroup-limited sandbox,
69
70
  // not the 2 the container actually has — a worker swarm that OOMs the
70
71
  // 4 GiB box. availableParallelism() is cgroup-aware. Gated to prod build.
71
- cpus: process.env.BUILD_ENV === "build" ? os.availableParallelism() : void 0,
72
+ cpus: isBuild ? os.availableParallelism() : void 0,
72
73
  serverActions: {
73
74
  ...overrideServerActions,
74
75
  allowedOrigins: dedupe([
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../next/config.ts"],
4
- "sourcesContent": ["import os from \"os\";\nimport type { NextConfig } from \"next\";\n\n// Origins browsers load sandbox previews from \u2014 PREVIEW_HOSTNAME in the\n// coordinator's wrangler.jsonc plus Daytona's native preview domain. Next 16\n// hard-blocks cross-origin dev requests (HMR WebSocket, Server Actions) from\n// origins missing here.\nconst PLATFORM_DEV_ORIGINS = [\n \"localhost:*\",\n \"*.localhost:*\",\n \"*.lvh.me:*\",\n \"*.daytonaproxy01.net\",\n \"*.preview.reploapi.com\",\n \"*.preview-staging.reploapi.com\",\n];\n\nconst PLATFORM_SERVER_ACTION_ORIGINS = [\n \"localhost:*\",\n \"*.localhost:*\",\n \"*.lvh.me:*\",\n \"*.cloudflare-agent-coordinator.replo.workers.dev\",\n \"*.preview.reploapi.com\",\n \"*.preview-staging.reploapi.com\",\n];\n\nconst dedupe = (origins: string[]): string[] => Array.from(new Set(origins));\n\n// The canonical Next.js runtime contract shared by every agent-built site.\n// Sites re-export `default` from here through a one-line `next.config.ts` shim,\n// so the platform wiring (sandbox dist dirs, Turbopack root, preview origins,\n// Cloudflare image loader) lives in exactly one place instead of being copied\n// into each template.\n//\n// `overrides` is a per-site customization surface, but it must not be able to\n// silently amputate platform wiring. A plain `...overrides` spread is a shallow\n// merge: a site that sets any nested key (e.g. `experimental.typedRoutes`)\n// would replace the whole `experimental`/`images` block and drop platform\n// defaults like the build-worker OOM guard or the Cloudflare image loader. So\n// load-bearing keys are re-asserted after the spread and the nested blocks are\n// deep-merged: a site can add keys, but platform invariants always win and\n// platform origin lists are preserved (site entries are appended, not swapped).\nexport function siteConfig(overrides: NextConfig = {}): NextConfig {\n const {\n turbopack: overrideTurbopack,\n images: overrideImages,\n experimental: overrideExperimental,\n allowedDevOrigins: overrideDevOrigins,\n ...restOverrides\n } = overrides;\n\n const { serverActions: overrideServerActions, ...restOverrideExperimental } =\n overrideExperimental ?? {};\n\n return {\n // Site-overridable defaults.\n reactStrictMode: true,\n devIndicators: false,\n ...restOverrides,\n\n // Platform invariants \u2014 re-asserted after the spread so a site override\n // can never break sandbox builds, publish, or the dev server.\n output: \"standalone\",\n distDir: process.env.BUILD_ENV === \"build\" ? \".next\" : \".next-dev\",\n // NOTE (Cole, 2026-04-30, REPL-26637): The publish tool patches\n // required-server-files.json to clear this value before OpenNext bundles,\n // since \"/\" makes esbuild emit absolute-path requires that break in Workers.\n // NOTE (Patrick Lu, 2026-07-06, REPL-28775): Leave outputFileTracingRoot\n // unset outside builds because Next 15.5+ otherwise forces turbopack.root to\n // \"/\" and makes the dev watcher retain whole-filesystem state.\n outputFileTracingRoot: process.env.BUILD_ENV === \"build\" ? \"/\" : undefined,\n // NOTE (Patrick Lu, 2026-07-06, REPL-28775): Keep Turbopack's watcher on\n // the user app tree; workspace packages are copied into node_modules there.\n turbopack: {\n ...overrideTurbopack,\n root: \"/workspace/dev\",\n },\n allowedDevOrigins: dedupe([\n ...(overrideDevOrigins ?? []),\n ...PLATFORM_DEV_ORIGINS,\n ]),\n images: {\n ...overrideImages,\n loader: \"custom\",\n loaderFile: \"./image-loader.ts\",\n remotePatterns: overrideImages?.remotePatterns ?? [\n {\n protocol: \"https\",\n hostname: \"**\",\n },\n ],\n },\n experimental: {\n ...restOverrideExperimental,\n // NOTE (Cole, 2026-06-18, REPL-28180): Next sizes its build worker pool\n // off os.cpus().length = host cores (~64) inside a cgroup-limited sandbox,\n // not the 2 the container actually has \u2014 a worker swarm that OOMs the\n // 4 GiB box. availableParallelism() is cgroup-aware. Gated to prod build.\n cpus:\n process.env.BUILD_ENV === \"build\"\n ? os.availableParallelism()\n : undefined,\n serverActions: {\n ...overrideServerActions,\n allowedOrigins: dedupe([\n ...(overrideServerActions?.allowedOrigins ?? []),\n ...PLATFORM_SERVER_ACTION_ORIGINS,\n ]),\n },\n },\n };\n}\n\nconst nextConfig: NextConfig = siteConfig();\n\nexport default nextConfig;\n"],
5
- "mappings": "AAAA,OAAO,QAAQ;AAOf,MAAM,uBAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,iCAAiC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,SAAS,CAAC,YAAgC,MAAM,KAAK,IAAI,IAAI,OAAO,CAAC;AAgBpE,SAAS,WAAW,YAAwB,CAAC,GAAe;AACjE,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,EAAE,eAAe,uBAAuB,GAAG,yBAAyB,IACxE,wBAAwB,CAAC;AAE3B,SAAO;AAAA;AAAA,IAEL,iBAAiB;AAAA,IACjB,eAAe;AAAA,IACf,GAAG;AAAA;AAAA;AAAA,IAIH,QAAQ;AAAA,IACR,SAAS,QAAQ,IAAI,cAAc,UAAU,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOvD,uBAAuB,QAAQ,IAAI,cAAc,UAAU,MAAM;AAAA;AAAA;AAAA,IAGjE,WAAW;AAAA,MACT,GAAG;AAAA,MACH,MAAM;AAAA,IACR;AAAA,IACA,mBAAmB,OAAO;AAAA,MACxB,GAAI,sBAAsB,CAAC;AAAA,MAC3B,GAAG;AAAA,IACL,CAAC;AAAA,IACD,QAAQ;AAAA,MACN,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB,gBAAgB,kBAAkB;AAAA,QAChD;AAAA,UACE,UAAU;AAAA,UACV,UAAU;AAAA,QACZ;AAAA,MACF;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,MAKH,MACE,QAAQ,IAAI,cAAc,UACtB,GAAG,qBAAqB,IACxB;AAAA,MACN,eAAe;AAAA,QACb,GAAG;AAAA,QACH,gBAAgB,OAAO;AAAA,UACrB,GAAI,uBAAuB,kBAAkB,CAAC;AAAA,UAC9C,GAAG;AAAA,QACL,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;AAEA,MAAM,aAAyB,WAAW;AAE1C,IAAO,iBAAQ;",
4
+ "sourcesContent": ["import os from \"os\";\nimport type { NextConfig } from \"next\";\n\n// Origins browsers load sandbox previews from \u2014 PREVIEW_HOSTNAME in the\n// coordinator's wrangler.jsonc plus Daytona's native preview domain. Next 16\n// hard-blocks cross-origin dev requests (HMR WebSocket, Server Actions) from\n// origins missing here.\nconst PLATFORM_DEV_ORIGINS = [\n \"localhost:*\",\n \"*.localhost:*\",\n \"*.lvh.me:*\",\n \"*.daytonaproxy01.net\",\n \"*.preview.reploapi.com\",\n \"*.preview-staging.reploapi.com\",\n];\n\nconst PLATFORM_SERVER_ACTION_ORIGINS = [\n \"localhost:*\",\n \"*.localhost:*\",\n \"*.lvh.me:*\",\n \"*.cloudflare-agent-coordinator.replo.workers.dev\",\n \"*.preview.reploapi.com\",\n \"*.preview-staging.reploapi.com\",\n];\n\nconst dedupe = (origins: string[]): string[] => Array.from(new Set(origins));\n\n// The canonical Next.js runtime contract shared by every agent-built site.\n// Sites re-export `default` from here through a one-line `next.config.ts` shim,\n// so the platform wiring (sandbox dist dirs, Turbopack root, preview origins,\n// Cloudflare image loader) lives in exactly one place instead of being copied\n// into each template.\n//\n// `overrides` is a per-site customization surface, but it must not be able to\n// silently amputate platform wiring. A plain `...overrides` spread is a shallow\n// merge: a site that sets any nested key (e.g. `experimental.typedRoutes`)\n// would replace the whole `experimental`/`images` block and drop platform\n// defaults like the build-worker OOM guard or the Cloudflare image loader. So\n// load-bearing keys are re-asserted after the spread and the nested blocks are\n// deep-merged: a site can add keys, but platform invariants always win and\n// platform origin lists are preserved (site entries are appended, not swapped).\nexport function siteConfig(overrides: NextConfig = {}): NextConfig {\n const isBuild = process.env.BUILD_ENV === \"build\";\n const {\n turbopack: overrideTurbopack,\n images: overrideImages,\n experimental: overrideExperimental,\n allowedDevOrigins: overrideDevOrigins,\n ...restOverrides\n } = overrides;\n\n const { serverActions: overrideServerActions, ...restOverrideExperimental } =\n overrideExperimental ?? {};\n\n return {\n // Site-overridable defaults.\n reactStrictMode: true,\n devIndicators: false,\n ...restOverrides,\n\n // Platform invariants \u2014 re-asserted after the spread so a site override\n // can never break sandbox builds, publish, or the dev server.\n output: \"standalone\",\n distDir: isBuild ? \".next\" : \".next-dev\",\n // NOTE (Cole, 2026-04-30, REPL-26637): The publish tool patches\n // required-server-files.json to clear this value before OpenNext bundles,\n // since \"/\" makes esbuild emit absolute-path requires that break in Workers.\n // NOTE (Patrick Lu, 2026-07-06, REPL-28775): Leave outputFileTracingRoot\n // unset outside builds because Next 15.5+ otherwise forces turbopack.root to\n // \"/\" and makes the dev watcher retain whole-filesystem state.\n outputFileTracingRoot: isBuild ? \"/\" : undefined,\n // NOTE (Patrick Lu, 2026-07-06, REPL-28775): Match build tracing at publish\n // time; keep dev's watcher on the user app tree.\n turbopack: {\n ...overrideTurbopack,\n root: isBuild ? \"/\" : \"/workspace/dev\",\n },\n allowedDevOrigins: dedupe([\n ...(overrideDevOrigins ?? []),\n ...PLATFORM_DEV_ORIGINS,\n ]),\n images: {\n ...overrideImages,\n loader: \"custom\",\n loaderFile: \"./image-loader.ts\",\n remotePatterns: overrideImages?.remotePatterns ?? [\n {\n protocol: \"https\",\n hostname: \"**\",\n },\n ],\n },\n experimental: {\n ...restOverrideExperimental,\n // NOTE (Cole, 2026-06-18, REPL-28180): Next sizes its build worker pool\n // off os.cpus().length = host cores (~64) inside a cgroup-limited sandbox,\n // not the 2 the container actually has \u2014 a worker swarm that OOMs the\n // 4 GiB box. availableParallelism() is cgroup-aware. Gated to prod build.\n cpus: isBuild ? os.availableParallelism() : undefined,\n serverActions: {\n ...overrideServerActions,\n allowedOrigins: dedupe([\n ...(overrideServerActions?.allowedOrigins ?? []),\n ...PLATFORM_SERVER_ACTION_ORIGINS,\n ]),\n },\n },\n };\n}\n\nconst nextConfig: NextConfig = siteConfig();\n\nexport default nextConfig;\n"],
5
+ "mappings": "AAAA,OAAO,QAAQ;AAOf,MAAM,uBAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,iCAAiC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,SAAS,CAAC,YAAgC,MAAM,KAAK,IAAI,IAAI,OAAO,CAAC;AAgBpE,SAAS,WAAW,YAAwB,CAAC,GAAe;AACjE,QAAM,UAAU,QAAQ,IAAI,cAAc;AAC1C,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,EAAE,eAAe,uBAAuB,GAAG,yBAAyB,IACxE,wBAAwB,CAAC;AAE3B,SAAO;AAAA;AAAA,IAEL,iBAAiB;AAAA,IACjB,eAAe;AAAA,IACf,GAAG;AAAA;AAAA;AAAA,IAIH,QAAQ;AAAA,IACR,SAAS,UAAU,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAO7B,uBAAuB,UAAU,MAAM;AAAA;AAAA;AAAA,IAGvC,WAAW;AAAA,MACT,GAAG;AAAA,MACH,MAAM,UAAU,MAAM;AAAA,IACxB;AAAA,IACA,mBAAmB,OAAO;AAAA,MACxB,GAAI,sBAAsB,CAAC;AAAA,MAC3B,GAAG;AAAA,IACL,CAAC;AAAA,IACD,QAAQ;AAAA,MACN,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB,gBAAgB,kBAAkB;AAAA,QAChD;AAAA,UACE,UAAU;AAAA,UACV,UAAU;AAAA,QACZ;AAAA,MACF;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,MAKH,MAAM,UAAU,GAAG,qBAAqB,IAAI;AAAA,MAC5C,eAAe;AAAA,QACb,GAAG;AAAA,QACH,gBAAgB,OAAO;AAAA,UACrB,GAAI,uBAAuB,kBAAkB,CAAC;AAAA,UAC9C,GAAG;AAAA,QACL,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;AAEA,MAAM,aAAyB,WAAW;AAE1C,IAAO,iBAAQ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replohq/canopy-sdk",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Replo Canopy SDK — cart, analytics, data loaders, and editor runtime for agent-built Next.js sites.",
5
5
  "type": "module",
6
6
  "sideEffects": false,