@anthusai/papyrus 5.42.0 → 5.42.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/package.json CHANGED
@@ -456,7 +456,7 @@
456
456
  "optional": true
457
457
  }
458
458
  },
459
- "version": "5.42.0",
459
+ "version": "5.42.1",
460
460
  "dependencies": {
461
461
  "@aws-amplify/adapter-nextjs": "^1.7.3",
462
462
  "@aws-crypto/sha256-js": "5.2.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.42.0",
2
+ "version": "5.42.1",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",
@@ -9,3 +9,4 @@ export function staticGenerationSettings(): {
9
9
  staticGenerationMaxConcurrency: number;
10
10
  staticGenerationRetryCount: number;
11
11
  };
12
+ export function redirectChatticusZod(resource: { request: string; context?: string }): void;
@@ -56,6 +56,18 @@ export function mergeTranspilePackages(existing = []) {
56
56
  return [...new Set([...existing, ...DEFAULT_TRANSPILE_PACKAGES])];
57
57
  }
58
58
 
59
+ /**
60
+ * chatticus's prebuilt chat runtime is written against zod 4 (`z.looseObject`) and imports bare `zod`.
61
+ * Publication repos pin zod 3.25 through a root `overrides` entry (Amplify constructs need it), which
62
+ * also flattens chatticus's own zod 4 dependency, so the bundle then fails to build. zod 3.25 ships the
63
+ * zod 4 API at `zod/v4`; point only chatticus's `zod` imports there, leaving every other zod import alone.
64
+ */
65
+ export const CHATTICUS_PACKAGE_PATH = /[\\/]node_modules[\\/]chatticus[\\/]/;
66
+
67
+ export function redirectChatticusZod(resource) {
68
+ if (resource.request === "zod" && CHATTICUS_PACKAGE_PATH.test(resource.context ?? "")) resource.request = "zod/v4";
69
+ }
70
+
59
71
  export const RUNTIME_TRACED_FILES = ["./corpora/**/*", "./amplify_outputs.json"];
60
72
 
61
73
  export function mergeOutputFileTracingIncludes(existing = {}) {
@@ -99,6 +111,10 @@ export function withPapyrus(nextConfig = {}, options = {}) {
99
111
  },
100
112
  webpack(config, context) {
101
113
  config.resolve.alias = { ...config.resolve.alias, ...aliases };
114
+ config.plugins = [
115
+ ...(config.plugins ?? []),
116
+ new context.webpack.NormalModuleReplacementPlugin(/^zod$/, redirectChatticusZod),
117
+ ];
102
118
  return typeof nextConfig.webpack === "function" ? nextConfig.webpack(config, context) : config;
103
119
  },
104
120
  };