@anthusai/papyrus 2.0.0-next.11 → 2.0.0-next.110

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.
Files changed (227) hide show
  1. package/amplify/auth/resource.js +16 -1
  2. package/amplify/auth/resource.ts +19 -1
  3. package/amplify/data/function-handler.js +20 -0
  4. package/amplify/data/function-handler.ts +40 -0
  5. package/amplify/data/resource.js +152 -62
  6. package/amplify/data/resource.ts +158 -62
  7. package/amplify/data/schema.js +2101 -1987
  8. package/amplify/data/schema.ts +197 -70
  9. package/amplify/functions/assignment-action/data-access.js +2 -0
  10. package/amplify/functions/assignment-action/data-access.ts +2 -0
  11. package/amplify/functions/assignment-action/handler.ts +1 -1
  12. package/amplify/functions/automation-view/handler.py +17 -0
  13. package/amplify/functions/automation-view/resource.js +24 -0
  14. package/amplify/functions/automation-view/resource.ts +34 -0
  15. package/amplify/functions/automation-view/schema.js +26 -0
  16. package/amplify/functions/automation-view/schema.ts +28 -0
  17. package/amplify/functions/automation-view/wire.js +56 -0
  18. package/amplify/functions/automation-view/wire.ts +76 -0
  19. package/amplify/functions/content-actions/handler.py +64 -3
  20. package/amplify/functions/content-actions/requirements.txt +1 -0
  21. package/amplify/functions/content-actions/resource.js +1 -1
  22. package/amplify/functions/content-actions/resource.ts +1 -1
  23. package/amplify/functions/editorial-checks/handler.py +2 -2
  24. package/amplify/functions/editorial-checks/requirements.txt +1 -1
  25. package/amplify/functions/editorial-checks/resource.js +3 -3
  26. package/amplify/functions/editorial-checks/resource.ts +3 -3
  27. package/amplify/functions/editorial-checks/schema.js +38 -8
  28. package/amplify/functions/editorial-checks/schema.ts +38 -8
  29. package/amplify/functions/editorial-checks/wire.js +4 -0
  30. package/amplify/functions/editorial-checks/wire.ts +4 -0
  31. package/amplify/functions/monitoring-view/handler.py +11 -0
  32. package/amplify/functions/monitoring-view/resource.js +24 -0
  33. package/amplify/functions/monitoring-view/resource.ts +34 -0
  34. package/amplify/functions/monitoring-view/schema.js +29 -0
  35. package/amplify/functions/monitoring-view/schema.ts +31 -0
  36. package/amplify/functions/monitoring-view/wire.js +64 -0
  37. package/amplify/functions/monitoring-view/wire.ts +81 -0
  38. package/amplify/functions/public-forms/core.js +247 -0
  39. package/amplify/functions/public-forms/core.ts +310 -0
  40. package/amplify/functions/public-forms/handler.ts +41 -0
  41. package/amplify/functions/public-forms/origins.js +35 -0
  42. package/amplify/functions/public-forms/origins.ts +43 -0
  43. package/amplify/functions/public-forms/resource.js +9 -0
  44. package/amplify/functions/public-forms/resource.ts +10 -0
  45. package/amplify/functions/public-forms/wire.js +25 -0
  46. package/amplify/functions/public-forms/wire.ts +32 -0
  47. package/amplify/functions/shared/editorial-context.ts +63 -4
  48. package/amplify/functions/shared/python-bundle.js +20 -14
  49. package/amplify/functions/shared/python-bundle.ts +25 -18
  50. package/amplify/plugins/newsletter/config.js +245 -0
  51. package/amplify/plugins/newsletter/config.ts +305 -0
  52. package/amplify/plugins/newsletter/function/handler.py +6 -0
  53. package/amplify/plugins/newsletter/function/requirements.txt +5 -0
  54. package/amplify/plugins/newsletter/ops/handler.py +12 -0
  55. package/amplify/plugins/newsletter/ops/resource.js +27 -0
  56. package/amplify/plugins/newsletter/ops/resource.ts +37 -0
  57. package/amplify/plugins/newsletter/papyrus.plugin.js +263 -0
  58. package/amplify/plugins/newsletter/papyrus.plugin.ts +311 -0
  59. package/amplify/plugins/newsletter/schema.js +57 -0
  60. package/amplify/plugins/newsletter/schema.ts +62 -0
  61. package/amplify/plugins/newsletter/secure-string-parameter.js +107 -0
  62. package/amplify/plugins/newsletter/secure-string-parameter.ts +120 -0
  63. package/amplify/plugins/newsletter/sending.js +140 -0
  64. package/amplify/plugins/newsletter/sending.ts +186 -0
  65. package/amplify/plugins/reader-steering/config.js +182 -0
  66. package/amplify/plugins/reader-steering/config.ts +290 -0
  67. package/amplify/plugins/reader-steering/function/ai_moderation.py +246 -0
  68. package/amplify/plugins/reader-steering/function/handler.py +1589 -0
  69. package/amplify/plugins/reader-steering/function/moderation-prompt.md +27 -0
  70. package/amplify/plugins/reader-steering/function/moderation.py +316 -0
  71. package/amplify/plugins/reader-steering/function/proposals.py +487 -0
  72. package/amplify/plugins/reader-steering/function/resource.js +27 -0
  73. package/amplify/plugins/reader-steering/function/resource.ts +35 -0
  74. package/amplify/plugins/reader-steering/papyrus.plugin.js +187 -0
  75. package/amplify/plugins/reader-steering/papyrus.plugin.ts +213 -0
  76. package/amplify/plugins/reader-steering/schema.js +252 -0
  77. package/amplify/plugins/reader-steering/schema.ts +254 -0
  78. package/amplify/plugins/registry.js +4 -0
  79. package/amplify/plugins/registry.ts +4 -0
  80. package/amplify/plugins/signup/schema.js +2 -1
  81. package/amplify/plugins/signup/schema.ts +2 -1
  82. package/amplify/plugins/types.ts +5 -0
  83. package/amplify/plugins/wire.js +1 -0
  84. package/amplify/plugins/wire.ts +1 -0
  85. package/amplify/publication/projection-lease.js +30 -0
  86. package/amplify/publication/projection-lease.ts +39 -0
  87. package/amplify/publication/redirect-and-index.js +105 -0
  88. package/amplify/publication/redirect-rules.js +73 -0
  89. package/amplify/publication/redirect-rules.ts +93 -0
  90. package/amplify/publication/s3-projection.js +7 -1
  91. package/amplify/publication/s3-projection.ts +9 -1
  92. package/amplify/site-backend-config.js +19 -0
  93. package/amplify/site-backend-config.ts +45 -1
  94. package/amplify/site-backend-names.js +4 -2
  95. package/amplify/site-backend-names.ts +4 -2
  96. package/amplify/site-backend.js +42 -4
  97. package/amplify/site-backend.ts +45 -4
  98. package/app/.well-known/papyrus-cli.json/route.ts +9 -0
  99. package/app/api/auth/prospectus/sign-in/route.ts +4 -0
  100. package/app/api/newsletter/confirm/route.ts +13 -0
  101. package/app/api/newsletter/preferences/route.ts +13 -0
  102. package/app/api/newsletter/state/route.ts +9 -0
  103. package/app/api/newsletter/subscribe/route.ts +9 -0
  104. package/app/api/newsletter/unsubscribe/route.ts +13 -0
  105. package/app/api/newsroom/chat/[...path]/route.ts +17 -0
  106. package/app/api/newsroom/curation/context/route.ts +9 -0
  107. package/app/api/newsroom/curation/priming/route.ts +9 -0
  108. package/app/api/newsroom/curation/publication/route.ts +9 -0
  109. package/app/api/reader/comment/delete/route.ts +9 -0
  110. package/app/api/reader/comment/edit/route.ts +9 -0
  111. package/app/api/reader/comment/route.ts +9 -0
  112. package/app/api/reader/flag/route.ts +9 -0
  113. package/app/api/reader/handle/route.ts +9 -0
  114. package/app/api/reader/me/route.ts +9 -0
  115. package/app/api/reader/rating/route.ts +9 -0
  116. package/app/api/reader/report/route.ts +9 -0
  117. package/app/api/reader/retired/route.ts +9 -0
  118. package/app/api/reader/submit/route.ts +9 -0
  119. package/app/api/reader/vote/route.ts +9 -0
  120. package/app/layout.tsx +5 -1
  121. package/bin/papyrus-infra.mjs +20 -1
  122. package/components/automation-panel.tsx +49 -0
  123. package/components/automation-run-now.tsx +97 -0
  124. package/components/automation-view.tsx +195 -0
  125. package/components/editorial-checks-admin-panel.tsx +32 -17
  126. package/components/moderation-panel.tsx +248 -0
  127. package/components/monitoring-overview-view.tsx +422 -0
  128. package/components/monitoring-panel.tsx +60 -0
  129. package/components/news-desk-client-provider.tsx +18 -18
  130. package/components/news-desk-taxonomy-client.ts +28 -8
  131. package/components/newsletter-panel.tsx +474 -0
  132. package/components/newsletter-sections.tsx +163 -0
  133. package/components/newsroom-access-gate.tsx +16 -2
  134. package/components/newsroom-article-editor.tsx +9 -7
  135. package/components/newsroom-articles-view.tsx +6 -6
  136. package/components/newsroom-assignment-detail.tsx +6 -6
  137. package/components/newsroom-board-view.tsx +8 -3
  138. package/components/newsroom-curation-bootstrap.tsx +45 -0
  139. package/components/newsroom-ops-overview.tsx +26 -96
  140. package/components/newsroom-ops-shell.tsx +2 -2
  141. package/components/newsroom-organizer.css +33 -0
  142. package/components/newsroom-overview-skeleton.tsx +25 -0
  143. package/components/newsroom-references-view.tsx +192 -49
  144. package/components/notification-center.tsx +281 -0
  145. package/components/papyrus-console-conversation.css +14 -0
  146. package/components/papyrus-console-conversation.tsx +55 -0
  147. package/components/papyrus-console-shell.tsx +62 -420
  148. package/components/papyrus-private-chat-panel.tsx +134 -0
  149. package/components/publication-cyclotron-panel.tsx +15 -10
  150. package/components/reader-auth-state.ts +1 -1
  151. package/components/reference-add-entry.tsx +75 -0
  152. package/components/reference-curation-controls.tsx +31 -22
  153. package/components/reference-cyclotron-priming.tsx +58 -19
  154. package/components/reference-cyclotron-suggestion.tsx +10 -6
  155. package/components/reference-priming.tsx +14 -10
  156. package/components/reference-relevance-review.tsx +3 -3
  157. package/components/reference-section-suggestion.tsx +1 -1
  158. package/components/topic-steering-workspace.tsx +230 -144
  159. package/infra/amplify-app-shell.js +96 -16
  160. package/infra/amplify-app-shell.ts +108 -18
  161. package/infra/cloud-email-config.js +32 -0
  162. package/infra/cloud-email-config.ts +39 -0
  163. package/infra/cloud-email.js +57 -0
  164. package/infra/cloud-email.test.js +69 -0
  165. package/infra/cloud-email.test.ts +66 -0
  166. package/infra/cloud-email.ts +60 -0
  167. package/infra/index.js +1 -0
  168. package/infra/secure-string-parameter-handler.js +41 -0
  169. package/infra/secure-string-parameter-handler.ts +41 -0
  170. package/infra/secure-string-parameter.js +79 -0
  171. package/infra/secure-string-parameter.ts +91 -0
  172. package/infra/site-config.js +92 -6
  173. package/infra/site-config.ts +138 -6
  174. package/lib/automation-client.ts +54 -0
  175. package/lib/automation-fixture.ts +93 -0
  176. package/lib/automation-overview.ts +252 -0
  177. package/lib/category-repository.ts +14 -12
  178. package/lib/cli-login-discovery.ts +78 -0
  179. package/lib/console-web-context.ts +1 -1
  180. package/lib/curation-routes.ts +345 -0
  181. package/lib/cyclotron-suggestions.ts +4 -4
  182. package/lib/editorial-checks-client.ts +18 -0
  183. package/lib/editorial-checks-demo.ts +1 -1
  184. package/lib/editorial-checks.ts +8 -4
  185. package/lib/editorial-preview.ts +5 -5
  186. package/lib/monitoring-client.ts +83 -0
  187. package/lib/monitoring-overview-fixture.ts +51 -0
  188. package/lib/monitoring-overview.ts +191 -0
  189. package/lib/news-desk-session.ts +12 -21
  190. package/lib/newsletter-api.ts +418 -0
  191. package/lib/newsletter-client.ts +46 -0
  192. package/lib/newsletter-fixture.ts +184 -0
  193. package/lib/newsletter-model.ts +202 -0
  194. package/lib/newsroom-demo-dashboard.ts +1 -1
  195. package/lib/newsroom-nav.ts +1 -1
  196. package/lib/newsroom-organizer-nav.ts +2 -1
  197. package/lib/papyrus-chat-admission.ts +65 -0
  198. package/lib/papyrus-hosted-chat.ts +217 -0
  199. package/lib/papyrus-private-chat-client.ts +81 -0
  200. package/lib/prospectus-session.ts +30 -14
  201. package/lib/prospectus-sign-in-routes.ts +106 -31
  202. package/lib/prospectus-site-identity.ts +46 -6
  203. package/lib/reader-api.ts +145 -0
  204. package/lib/reader-moderation.ts +220 -0
  205. package/lib/reader-retirement-route.ts +89 -0
  206. package/lib/reader-subject.md +29 -0
  207. package/lib/reader-subject.ts +53 -0
  208. package/lib/reference-review-details.ts +71 -0
  209. package/lib/reference-review-request.ts +14 -0
  210. package/lib/relevance-decisions.ts +42 -10
  211. package/lib/relevance-status.ts +2 -2
  212. package/lib/review-client.ts +120 -0
  213. package/lib/review-fixture.ts +45 -0
  214. package/lib/review-requests.ts +246 -0
  215. package/lib/semantic-graph.ts +2 -0
  216. package/lib/shared-chat-admission.ts +182 -0
  217. package/lib/site-brand-tenant.ts +11 -6
  218. package/lib/site-brand.ts +6 -3
  219. package/lib/site-origin-value.ts +50 -0
  220. package/lib/site-origin.ts +8 -0
  221. package/lib/use-reference-review-data.ts +44 -0
  222. package/middleware.ts +14 -3
  223. package/package.json +67 -3
  224. package/routes.manifest.json +238 -2
  225. package/src/sync.mjs +11 -2
  226. package/src/with-papyrus.d.mts +1 -0
  227. package/src/with-papyrus.mjs +17 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0-next.11",
2
+ "version": "2.0.0-next.110",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",
@@ -11,6 +11,17 @@
11
11
  "dynamic": "\"force-dynamic\""
12
12
  }
13
13
  },
14
+ {
15
+ "file": "app/.well-known/papyrus-cli.json/route.ts",
16
+ "hasDefault": false,
17
+ "exports": [
18
+ "GET"
19
+ ],
20
+ "config": {
21
+ "dynamic": "\"force-dynamic\"",
22
+ "runtime": "\"nodejs\""
23
+ }
24
+ },
14
25
  {
15
26
  "file": "app/[year]/[month]/[day]/[articleSlug]/page.tsx",
16
27
  "reader": true,
@@ -114,7 +125,8 @@
114
125
  "file": "app/api/auth/prospectus/sign-in/route.ts",
115
126
  "hasDefault": false,
116
127
  "exports": [
117
- "GET"
128
+ "GET",
129
+ "POST"
118
130
  ],
119
131
  "config": {
120
132
  "dynamic": "\"force-dynamic\"",
@@ -170,6 +182,230 @@
170
182
  "dynamic": "\"force-dynamic\""
171
183
  }
172
184
  },
185
+ {
186
+ "file": "app/api/newsletter/confirm/route.ts",
187
+ "hasDefault": false,
188
+ "exports": [
189
+ "GET",
190
+ "POST"
191
+ ],
192
+ "config": {
193
+ "dynamic": "\"force-dynamic\"",
194
+ "runtime": "\"nodejs\""
195
+ }
196
+ },
197
+ {
198
+ "file": "app/api/newsletter/preferences/route.ts",
199
+ "hasDefault": false,
200
+ "exports": [
201
+ "GET",
202
+ "POST"
203
+ ],
204
+ "config": {
205
+ "dynamic": "\"force-dynamic\"",
206
+ "runtime": "\"nodejs\""
207
+ }
208
+ },
209
+ {
210
+ "file": "app/api/newsletter/state/route.ts",
211
+ "hasDefault": false,
212
+ "exports": [
213
+ "GET"
214
+ ],
215
+ "config": {
216
+ "dynamic": "\"force-dynamic\"",
217
+ "runtime": "\"nodejs\""
218
+ }
219
+ },
220
+ {
221
+ "file": "app/api/newsletter/subscribe/route.ts",
222
+ "hasDefault": false,
223
+ "exports": [
224
+ "POST"
225
+ ],
226
+ "config": {
227
+ "dynamic": "\"force-dynamic\"",
228
+ "runtime": "\"nodejs\""
229
+ }
230
+ },
231
+ {
232
+ "file": "app/api/newsletter/unsubscribe/route.ts",
233
+ "hasDefault": false,
234
+ "exports": [
235
+ "GET",
236
+ "POST"
237
+ ],
238
+ "config": {
239
+ "dynamic": "\"force-dynamic\"",
240
+ "runtime": "\"nodejs\""
241
+ }
242
+ },
243
+ {
244
+ "file": "app/api/newsroom/chat/[...path]/route.ts",
245
+ "hasDefault": false,
246
+ "exports": [
247
+ "GET",
248
+ "POST"
249
+ ],
250
+ "config": {
251
+ "dynamic": "\"force-dynamic\"",
252
+ "runtime": "\"nodejs\""
253
+ }
254
+ },
255
+ {
256
+ "file": "app/api/newsroom/curation/context/route.ts",
257
+ "hasDefault": false,
258
+ "exports": [
259
+ "GET"
260
+ ],
261
+ "config": {
262
+ "dynamic": "\"force-dynamic\"",
263
+ "runtime": "\"nodejs\""
264
+ }
265
+ },
266
+ {
267
+ "file": "app/api/newsroom/curation/priming/route.ts",
268
+ "hasDefault": false,
269
+ "exports": [
270
+ "POST"
271
+ ],
272
+ "config": {
273
+ "dynamic": "\"force-dynamic\"",
274
+ "runtime": "\"nodejs\""
275
+ }
276
+ },
277
+ {
278
+ "file": "app/api/newsroom/curation/publication/route.ts",
279
+ "hasDefault": false,
280
+ "exports": [
281
+ "POST"
282
+ ],
283
+ "config": {
284
+ "dynamic": "\"force-dynamic\"",
285
+ "runtime": "\"nodejs\""
286
+ }
287
+ },
288
+ {
289
+ "file": "app/api/reader/comment/delete/route.ts",
290
+ "hasDefault": false,
291
+ "exports": [
292
+ "POST"
293
+ ],
294
+ "config": {
295
+ "dynamic": "\"force-dynamic\"",
296
+ "runtime": "\"nodejs\""
297
+ }
298
+ },
299
+ {
300
+ "file": "app/api/reader/comment/edit/route.ts",
301
+ "hasDefault": false,
302
+ "exports": [
303
+ "POST"
304
+ ],
305
+ "config": {
306
+ "dynamic": "\"force-dynamic\"",
307
+ "runtime": "\"nodejs\""
308
+ }
309
+ },
310
+ {
311
+ "file": "app/api/reader/comment/route.ts",
312
+ "hasDefault": false,
313
+ "exports": [
314
+ "POST"
315
+ ],
316
+ "config": {
317
+ "dynamic": "\"force-dynamic\"",
318
+ "runtime": "\"nodejs\""
319
+ }
320
+ },
321
+ {
322
+ "file": "app/api/reader/flag/route.ts",
323
+ "hasDefault": false,
324
+ "exports": [
325
+ "POST"
326
+ ],
327
+ "config": {
328
+ "dynamic": "\"force-dynamic\"",
329
+ "runtime": "\"nodejs\""
330
+ }
331
+ },
332
+ {
333
+ "file": "app/api/reader/handle/route.ts",
334
+ "hasDefault": false,
335
+ "exports": [
336
+ "POST"
337
+ ],
338
+ "config": {
339
+ "dynamic": "\"force-dynamic\"",
340
+ "runtime": "\"nodejs\""
341
+ }
342
+ },
343
+ {
344
+ "file": "app/api/reader/me/route.ts",
345
+ "hasDefault": false,
346
+ "exports": [
347
+ "GET"
348
+ ],
349
+ "config": {
350
+ "dynamic": "\"force-dynamic\"",
351
+ "runtime": "\"nodejs\""
352
+ }
353
+ },
354
+ {
355
+ "file": "app/api/reader/rating/route.ts",
356
+ "hasDefault": false,
357
+ "exports": [
358
+ "POST"
359
+ ],
360
+ "config": {
361
+ "dynamic": "\"force-dynamic\"",
362
+ "runtime": "\"nodejs\""
363
+ }
364
+ },
365
+ {
366
+ "file": "app/api/reader/report/route.ts",
367
+ "hasDefault": false,
368
+ "exports": [
369
+ "POST"
370
+ ],
371
+ "config": {
372
+ "dynamic": "\"force-dynamic\"",
373
+ "runtime": "\"nodejs\""
374
+ }
375
+ },
376
+ {
377
+ "file": "app/api/reader/retired/route.ts",
378
+ "hasDefault": false,
379
+ "exports": [
380
+ "GET"
381
+ ],
382
+ "config": {
383
+ "dynamic": "\"force-dynamic\"",
384
+ "runtime": "\"nodejs\""
385
+ }
386
+ },
387
+ {
388
+ "file": "app/api/reader/submit/route.ts",
389
+ "hasDefault": false,
390
+ "exports": [
391
+ "POST"
392
+ ],
393
+ "config": {
394
+ "dynamic": "\"force-dynamic\"",
395
+ "runtime": "\"nodejs\""
396
+ }
397
+ },
398
+ {
399
+ "file": "app/api/reader/vote/route.ts",
400
+ "hasDefault": false,
401
+ "exports": [
402
+ "POST"
403
+ ],
404
+ "config": {
405
+ "dynamic": "\"force-dynamic\"",
406
+ "runtime": "\"nodejs\""
407
+ }
408
+ },
173
409
  {
174
410
  "file": "app/api/revalidate/route.ts",
175
411
  "hasDefault": false,
package/src/sync.mjs CHANGED
@@ -37,6 +37,15 @@ function shimFor(route) {
37
37
  return lines.join("\n") + "\n";
38
38
  }
39
39
 
40
+ /** Anchored .gitignore line for a literal path; escapes gitignore metacharacters (Next dynamic routes use [ ]). */
41
+ export function gitignoreEntry(rel) {
42
+ const escaped = rel
43
+ .replace(/[\\[\]*?]/g, "\\$&")
44
+ .replace(/^[#!]/, "\\$&")
45
+ .replace(/ +$/, (m) => m.replace(/ /g, "\\ "));
46
+ return "/" + escaped;
47
+ }
48
+
40
49
  export function middlewareShim(manifest) {
41
50
  const matcher = manifest.middleware.matcher ?? '["/((?!_next/static|_next/image|favicon.ico|icon).*)"]';
42
51
  return [
@@ -101,9 +110,9 @@ export function sync({ root = process.cwd(), log = console.log, manifest: manife
101
110
  // Keep generated shims out of git.
102
111
  const giFile = path.join(root, ".gitignore");
103
112
  const gi = fs.existsSync(giFile) ? fs.readFileSync(giFile, "utf8") : "";
104
- const block = [GITIGNORE_BEGIN, ...generated.map((g) => "/" + g), "/.papyrus/", GITIGNORE_END].join("\n");
113
+ const block = [GITIGNORE_BEGIN, ...generated.map(gitignoreEntry), "/.papyrus/", GITIGNORE_END].join("\n");
105
114
  const re = new RegExp(`${GITIGNORE_BEGIN.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}[\\s\\S]*?${GITIGNORE_END}`);
106
- fs.writeFileSync(giFile, re.test(gi) ? gi.replace(re, block) : `${gi}${gi.endsWith("\n") || !gi ? "" : "\n"}${block}\n`);
115
+ fs.writeFileSync(giFile, re.test(gi) ? gi.replace(re, () => block) : `${gi}${gi.endsWith("\n") || !gi ? "" : "\n"}${block}\n`);
107
116
 
108
117
  log(`papyrus-app sync: ${generated.length} shim(s) written, ${skipped.length} site-owned file(s) kept (${PKG}@${manifest.version})${readerBasePath ? `, reader mounted at ${readerBasePath}` : ""}`);
109
118
  for (const rel of skipped) log(` site-owned: ${rel}`);
@@ -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;
@@ -50,12 +50,24 @@ export function staticGenerationSettings() {
50
50
  };
51
51
  }
52
52
 
53
- export const DEFAULT_TRANSPILE_PACKAGES = ["@anthusai/papyrus", "cyclotron"];
53
+ export const DEFAULT_TRANSPILE_PACKAGES = ["@anthusai/papyrus", "cyclotron", "chatticus", "lucide-react"];
54
54
 
55
55
  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
  };