@anthusai/papyrus 1.0.0-next.3 → 1.0.0-next.30

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 (127) hide show
  1. package/amplify/auth/resource.js +17 -4
  2. package/amplify/auth/resource.ts +21 -4
  3. package/amplify/data/resource.js +26 -70
  4. package/amplify/data/resource.ts +27 -70
  5. package/amplify/data/schema.js +26 -58
  6. package/amplify/data/schema.ts +27 -58
  7. package/amplify/functions/console-chat-responder/py/execute_tactus_runner.py +0 -10
  8. package/amplify/functions/console-chat-responder/resource.js +0 -7
  9. package/amplify/functions/console-chat-responder/resource.ts +0 -8
  10. package/amplify/functions/console-chat-responder/src/main.rs +0 -9
  11. package/amplify/functions/content-actions/handler.py +45 -3
  12. package/amplify/rebuild-trigger-settings.js +22 -0
  13. package/amplify/rebuild-trigger-settings.ts +42 -0
  14. package/amplify/site-backend-config.ts +12 -1
  15. package/amplify/site-backend.js +41 -27
  16. package/amplify/site-backend.ts +51 -34
  17. package/amplify/storage/resource.js +3 -0
  18. package/amplify/storage/resource.ts +3 -0
  19. package/app/%5F_preview/[[...path]]/route.ts +8 -0
  20. package/app/[year]/[month]/[day]/[articleSlug]/page.tsx +2 -0
  21. package/app/[year]/[month]/[day]/edition-route-page.tsx +2 -0
  22. package/app/api/media/[...path]/route.ts +5 -16
  23. package/app/api/revalidate/route.ts +8 -7
  24. package/app/articles/[slug]/page.tsx +6 -4
  25. package/app/blog-rhythm.css +278 -0
  26. package/app/globals.css +21 -0
  27. package/app/layout.tsx +20 -0
  28. package/app/newsroom/[section]/[...selection]/page.tsx +6 -5
  29. package/app/newsroom/[section]/page.tsx +4 -3
  30. package/app/newsroom/articles/[id]/page.tsx +15 -0
  31. package/app/newsroom/articles/page.tsx +13 -0
  32. package/app/newsroom/layout.tsx +2 -9
  33. package/app/page.tsx +18 -5
  34. package/app/robots.ts +11 -0
  35. package/bin/papyrus-app.mjs +12 -2
  36. package/bin/papyrus-infra.mjs +74 -18
  37. package/components/archive-shell.tsx +2 -22
  38. package/components/article-video.tsx +247 -3
  39. package/components/blog-page-background.tsx +23 -6
  40. package/components/markus-ir-preview.tsx +300 -0
  41. package/components/newspaper.tsx +6 -2
  42. package/components/newsroom-access-gate.tsx +67 -0
  43. package/components/newsroom-article-editor.tsx +741 -0
  44. package/components/newsroom-articles-view.tsx +129 -0
  45. package/components/newsroom-client-shell.tsx +12 -0
  46. package/components/newsroom-ops-overview.tsx +28 -11
  47. package/components/newsroom-ops-shell.tsx +3 -1
  48. package/components/papyrus-console-shell.tsx +4 -2
  49. package/components/pictogram-figure.tsx +9 -2
  50. package/components/presentation-header.tsx +135 -0
  51. package/components/presentation-rhythm-hrule.tsx +17 -0
  52. package/components/settings-page.tsx +2 -1
  53. package/components/staging-banner.tsx +11 -0
  54. package/components/topic-steering-workspace.tsx +6 -63
  55. package/components/use-blog-header-obstacles.ts +81 -0
  56. package/components/use-brand-fonts-ready.ts +28 -0
  57. package/components/use-rhythm-overlay.ts +29 -0
  58. package/infra/amplify-app-shell.js +285 -80
  59. package/infra/amplify-app-shell.ts +326 -113
  60. package/infra/build-specs.js +95 -0
  61. package/infra/build-specs.ts +142 -0
  62. package/infra/github-oidc-provider.js +24 -0
  63. package/infra/github-oidc-provider.ts +30 -0
  64. package/infra/index.js +3 -0
  65. package/infra/site-config.js +273 -0
  66. package/infra/site-config.ts +336 -0
  67. package/lib/amplify-outputs-path.ts +5 -1
  68. package/lib/blog-feature-solver.ts +459 -0
  69. package/lib/blog-rhythm.ts +134 -0
  70. package/lib/brand-fonts-watch.ts +43 -0
  71. package/lib/brand-fonts.ts +112 -0
  72. package/lib/cached-content-repository.ts +14 -1
  73. package/lib/category-repository.ts +1 -93
  74. package/lib/content-actions-demo.ts +190 -0
  75. package/lib/content-repository.ts +6 -0
  76. package/lib/content-source-context.ts +26 -0
  77. package/lib/content-types.ts +4 -0
  78. package/lib/edition-routes.ts +31 -29
  79. package/lib/graphql-content-repository.ts +239 -43
  80. package/lib/media-route-response.ts +45 -0
  81. package/lib/newspaper-layout.ts +3 -2
  82. package/lib/newsroom-articles.ts +325 -0
  83. package/lib/newsroom-base-path.ts +12 -3
  84. package/lib/newsroom-category-drilldown.ts +3 -2
  85. package/lib/newsroom-demo-articles.ts +90 -0
  86. package/lib/newsroom-forum-routes.ts +6 -4
  87. package/lib/newsroom-index-filters.ts +14 -10
  88. package/lib/newsroom-media-backend.ts +142 -0
  89. package/lib/newsroom-media.ts +182 -0
  90. package/lib/newsroom-nav.ts +3 -0
  91. package/lib/papyrus-web-locations.ts +7 -6
  92. package/lib/presentation-footer.ts +3 -2
  93. package/lib/pretext-layout.ts +12 -3
  94. package/lib/reader-base-path.ts +24 -0
  95. package/lib/reader-static-params.ts +8 -0
  96. package/lib/renderer.ts +7 -0
  97. package/lib/revalidate-secret.ts +59 -0
  98. package/lib/root-route-redirect.ts +16 -0
  99. package/lib/semantic-graph.ts +5 -0
  100. package/lib/site-brand.ts +51 -0
  101. package/lib/site-env.ts +52 -0
  102. package/lib/staging-gate.ts +37 -0
  103. package/lib/staging-gated-path.ts +23 -0
  104. package/lib/staging-preview-object.ts +114 -0
  105. package/lib/video-mode.ts +42 -0
  106. package/lib/video-script.ts +77 -0
  107. package/middleware.ts +52 -10
  108. package/package.json +41 -1
  109. package/renderers/pretext/article-page.tsx +39 -3
  110. package/renderers/pretext/presentation-shared.tsx +113 -0
  111. package/renderers/pretext/presentation-shell.tsx +15 -102
  112. package/renderers/pretext/rhythm-article-page.tsx +165 -0
  113. package/renderers/pretext/rhythm-blog-presentation.tsx +279 -0
  114. package/renderers/pretext/rhythm-shell-style.ts +35 -0
  115. package/routes.manifest.json +37 -2
  116. package/scripts/videoml/build-browser-bundle.mjs +22 -0
  117. package/scripts/videoml/build-preview-bundle.mjs +50 -0
  118. package/scripts/videoml/bundle-common.mjs +129 -0
  119. package/scripts/videoml/preview/preview-entry.tsx +381 -0
  120. package/scripts/videoml/preview/preview-stage-fit.ts +28 -0
  121. package/scripts/videoml/preview/preview-timing.ts +42 -0
  122. package/scripts/videoml/preview.html +77 -0
  123. package/scripts/videoml/standard-entry.tsx +46 -0
  124. package/src/sync.mjs +30 -6
  125. package/amplify/functions/graphql-jwt-authorizer/handler.ts +0 -193
  126. package/amplify/functions/graphql-jwt-authorizer/resource.js +0 -14
  127. package/amplify/functions/graphql-jwt-authorizer/resource.ts +0 -15
@@ -272,7 +272,6 @@ export const schema = a.schema({
272
272
  .returns(a.ref("ReferenceCurationActionResult"))
273
273
  .authorization((allow) => [
274
274
  allow.groups(categoryWriteGroups),
275
- allow.custom(),
276
275
  ])
277
276
  .handler(a.handler.function(categoryAction)),
278
277
 
@@ -288,7 +287,6 @@ export const schema = a.schema({
288
287
  .returns(a.ref("ReferenceQualityActionResult"))
289
288
  .authorization((allow) => [
290
289
  allow.groups(categoryWriteGroups),
291
- allow.custom(),
292
290
  ])
293
291
  .handler(a.handler.function(categoryAction)),
294
292
 
@@ -400,7 +398,7 @@ export const schema = a.schema({
400
398
  getNewsroomSummary: a
401
399
  .query()
402
400
  .returns(a.ref("NewsroomSummary"))
403
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
401
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
404
402
  .handler(a.handler.function(newsroomSummary)),
405
403
 
406
404
  deriveMarkus: a
@@ -431,13 +429,20 @@ export const schema = a.schema({
431
429
  .authorization((allow) => [allow.groups(contentWriteGroups)])
432
430
  .handler(a.handler.function(contentActions)),
433
431
 
432
+ requestStagingBuild: a
433
+ .mutation()
434
+ .arguments({ input: a.json().required() })
435
+ .returns(a.json())
436
+ .authorization((allow) => [allow.groups(contentWriteGroups)])
437
+ .handler(a.handler.function(contentActions)),
438
+
434
439
  knowledgeQuery: a
435
440
  .query()
436
441
  .arguments({
437
442
  input: a.json().required(),
438
443
  })
439
444
  .returns(a.json())
440
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
445
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
441
446
  .handler(a.handler.function(knowledgeQuery)),
442
447
 
443
448
  updateNewsroomSummary: a
@@ -448,7 +453,7 @@ export const schema = a.schema({
448
453
  reason: a.string(),
449
454
  })
450
455
  .returns(a.ref("NewsroomSummary"))
451
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
456
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
452
457
  .handler(a.handler.function(newsroomSummary)),
453
458
 
454
459
  ModelAttachmentUploadSlot: a.customType({
@@ -508,7 +513,7 @@ export const schema = a.schema({
508
513
  status: a.string(),
509
514
  })
510
515
  .returns(a.ref("ModelAttachmentUploadSlot"))
511
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
516
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
512
517
  .handler(a.handler.function(modelAttachmentUpload)),
513
518
 
514
519
  completeModelAttachmentUpload: a
@@ -530,7 +535,7 @@ export const schema = a.schema({
530
535
  status: a.string(),
531
536
  })
532
537
  .returns(a.ref("ModelAttachment"))
533
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
538
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
534
539
  .handler(a.handler.function(modelAttachmentUpload)),
535
540
 
536
541
  abortModelAttachmentUpload: a
@@ -552,7 +557,7 @@ export const schema = a.schema({
552
557
  status: a.string(),
553
558
  })
554
559
  .returns(a.ref("ModelAttachmentUploadAbortResult"))
555
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
560
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
556
561
  .handler(a.handler.function(modelAttachmentUpload)),
557
562
 
558
563
  createModelAttachmentDownload: a
@@ -561,7 +566,7 @@ export const schema = a.schema({
561
566
  attachmentId: a.id().required(),
562
567
  })
563
568
  .returns(a.ref("ModelAttachmentDownloadSlot"))
564
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
569
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
565
570
  .handler(a.handler.function(modelAttachmentUpload)),
566
571
 
567
572
  AssignmentActionResult: a.customType({
@@ -655,7 +660,7 @@ export const schema = a.schema({
655
660
  limit: a.integer(),
656
661
  })
657
662
  .returns(a.ref("AssignmentContext").array().required())
658
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
663
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
659
664
  .handler(a.handler.function(assignmentAction)),
660
665
 
661
666
  listAssignmentQueue: a
@@ -666,7 +671,7 @@ export const schema = a.schema({
666
671
  limit: a.integer(),
667
672
  })
668
673
  .returns(a.ref("AssignmentContext").array().required())
669
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
674
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
670
675
  .handler(a.handler.function(assignmentAction)),
671
676
 
672
677
  getAssignmentContext: a
@@ -675,7 +680,7 @@ export const schema = a.schema({
675
680
  assignmentId: a.id().required(),
676
681
  })
677
682
  .returns(a.ref("AssignmentContext"))
678
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
683
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
679
684
  .handler(a.handler.function(assignmentAction)),
680
685
 
681
686
  claimAssignment: a
@@ -692,7 +697,7 @@ export const schema = a.schema({
692
697
  note: a.string(),
693
698
  })
694
699
  .returns(a.ref("AssignmentActionResult"))
695
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
700
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
696
701
  .handler(a.handler.function(assignmentAction)),
697
702
 
698
703
  releaseAssignment: a
@@ -704,7 +709,7 @@ export const schema = a.schema({
704
709
  note: a.string(),
705
710
  })
706
711
  .returns(a.ref("AssignmentActionResult"))
707
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
712
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
708
713
  .handler(a.handler.function(assignmentAction)),
709
714
 
710
715
  completeAssignment: a
@@ -716,7 +721,7 @@ export const schema = a.schema({
716
721
  note: a.string(),
717
722
  })
718
723
  .returns(a.ref("AssignmentActionResult"))
719
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
724
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
720
725
  .handler(a.handler.function(assignmentAction)),
721
726
 
722
727
  cancelAssignment: a
@@ -728,7 +733,7 @@ export const schema = a.schema({
728
733
  note: a.string(),
729
734
  })
730
735
  .returns(a.ref("AssignmentActionResult"))
731
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
736
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
732
737
  .handler(a.handler.function(assignmentAction)),
733
738
 
734
739
  reopenAssignment: a
@@ -740,7 +745,7 @@ export const schema = a.schema({
740
745
  note: a.string(),
741
746
  })
742
747
  .returns(a.ref("AssignmentActionResult"))
743
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
748
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
744
749
  .handler(a.handler.function(assignmentAction)),
745
750
 
746
751
  retryImmediateAssignment: a
@@ -752,7 +757,7 @@ export const schema = a.schema({
752
757
  note: a.string(),
753
758
  })
754
759
  .returns(a.ref("AssignmentActionResult"))
755
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
760
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
756
761
  .handler(a.handler.function(assignmentAction)),
757
762
 
758
763
  listNewsroomProcedureDefinitions: a
@@ -768,7 +773,7 @@ export const schema = a.schema({
768
773
  procedureKey: a.string(),
769
774
  })
770
775
  .returns(a.json())
771
- .authorization((allow) => [allow.group(adminGroup), allow.custom()])
776
+ .authorization((allow) => [allow.group(adminGroup)])
772
777
  .handler(a.handler.function(procedureAction)),
773
778
 
774
779
  saveNewsroomProcedureDefinition: a
@@ -810,7 +815,7 @@ export const schema = a.schema({
810
815
  actorLabel: a.string(),
811
816
  })
812
817
  .returns(a.json())
813
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
818
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
814
819
  .handler(a.handler.function(procedureAction)),
815
820
 
816
821
  getNewsroomProcedureRun: a
@@ -819,7 +824,7 @@ export const schema = a.schema({
819
824
  id: a.id().required(),
820
825
  })
821
826
  .returns(a.json())
822
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
827
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
823
828
  .handler(a.handler.function(procedureAction)),
824
829
 
825
830
  listNewsroomProcedureRunsByProcedure: a
@@ -828,7 +833,7 @@ export const schema = a.schema({
828
833
  procedureId: a.id().required(),
829
834
  })
830
835
  .returns(a.json())
831
- .authorization((allow) => [allow.groups(categoryWriteGroups), allow.custom()])
836
+ .authorization((allow) => [allow.groups(categoryWriteGroups)])
832
837
  .handler(a.handler.function(procedureAction)),
833
838
 
834
839
  Assignment: modelWithoutSubscriptions({
@@ -878,7 +883,6 @@ export const schema = a.schema({
878
883
  .authorization((allow) => [
879
884
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
880
885
  allow.authenticated("identityPool").to(authoringOperations),
881
- allow.custom().to(authoringOperations),
882
886
  ]),
883
887
 
884
888
  AssignmentEvent: modelWithoutSubscriptions({
@@ -901,7 +905,6 @@ export const schema = a.schema({
901
905
  ])
902
906
  .authorization((allow) => [
903
907
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
904
- allow.custom().to(authoringOperations),
905
908
  ]),
906
909
 
907
910
  ProcedureDefinition: modelWithoutSubscriptions({
@@ -926,7 +929,6 @@ export const schema = a.schema({
926
929
  ])
927
930
  .authorization((allow) => [
928
931
  allow.group(adminGroup),
929
- allow.custom().to(authoringOperations),
930
932
  ]),
931
933
 
932
934
  ProcedureVersion: modelWithoutSubscriptions({
@@ -953,7 +955,6 @@ export const schema = a.schema({
953
955
  ])
954
956
  .authorization((allow) => [
955
957
  allow.group(adminGroup),
956
- allow.custom().to(authoringOperations),
957
958
  ]),
958
959
 
959
960
  ProcedureRun: modelWithoutSubscriptions({
@@ -986,7 +987,6 @@ export const schema = a.schema({
986
987
  .authorization((allow) => [
987
988
  allow.group("editor").to(["read"]),
988
989
  allow.group(adminGroup).to(authoringOperations),
989
- allow.custom().to(authoringOperations),
990
990
  ]),
991
991
 
992
992
  NewsroomSection: modelWithoutSubscriptions({
@@ -1014,7 +1014,6 @@ export const schema = a.schema({
1014
1014
  ])
1015
1015
  .authorization((allow) => [
1016
1016
  allow.groups(categoryWriteGroups),
1017
- allow.custom().to(authoringOperations),
1018
1017
  ]),
1019
1018
 
1020
1019
  KnowledgeCorpus: modelWithoutSubscriptions({
@@ -1032,7 +1031,6 @@ export const schema = a.schema({
1032
1031
  ])
1033
1032
  .authorization((allow) => [
1034
1033
  allow.groups(categoryWriteGroups).to(["read"]),
1035
- allow.custom().to(authoringOperations),
1036
1034
  ]),
1037
1035
 
1038
1036
  KnowledgeImportRun: modelWithoutSubscriptions({
@@ -1060,7 +1058,6 @@ export const schema = a.schema({
1060
1058
  ])
1061
1059
  .authorization((allow) => [
1062
1060
  allow.groups(categoryWriteGroups).to(["read"]),
1063
- allow.custom().to(authoringOperations),
1064
1061
  ]),
1065
1062
 
1066
1063
  KnowledgeRawPayload: modelWithoutSubscriptions({
@@ -1078,7 +1075,6 @@ export const schema = a.schema({
1078
1075
  ])
1079
1076
  .authorization((allow) => [
1080
1077
  allow.groups(categoryWriteGroups),
1081
- allow.custom().to(authoringOperations),
1082
1078
  ]),
1083
1079
 
1084
1080
  KnowledgeArtifact: modelWithoutSubscriptions({
@@ -1098,7 +1094,6 @@ export const schema = a.schema({
1098
1094
  ])
1099
1095
  .authorization((allow) => [
1100
1096
  allow.groups(categoryWriteGroups).to(["read"]),
1101
- allow.custom().to(authoringOperations),
1102
1097
  ]),
1103
1098
 
1104
1099
  CategorySet: modelWithoutSubscriptions({
@@ -1128,7 +1123,6 @@ export const schema = a.schema({
1128
1123
  ])
1129
1124
  .authorization((allow) => [
1130
1125
  allow.groups(categoryWriteGroups),
1131
- allow.custom().to(authoringOperations),
1132
1126
  ]),
1133
1127
 
1134
1128
  Category: modelWithoutSubscriptions({
@@ -1170,7 +1164,6 @@ export const schema = a.schema({
1170
1164
  ])
1171
1165
  .authorization((allow) => [
1172
1166
  allow.groups(categoryWriteGroups),
1173
- allow.custom().to(authoringOperations),
1174
1167
  ]),
1175
1168
 
1176
1169
  CategoryKeyword: modelWithoutSubscriptions({
@@ -1199,7 +1192,6 @@ export const schema = a.schema({
1199
1192
  ])
1200
1193
  .authorization((allow) => [
1201
1194
  allow.groups(categoryWriteGroups),
1202
- allow.custom().to(authoringOperations),
1203
1195
  ]),
1204
1196
 
1205
1197
  LexicalSteeringRule: modelWithoutSubscriptions({
@@ -1228,7 +1220,6 @@ export const schema = a.schema({
1228
1220
  ])
1229
1221
  .authorization((allow) => [
1230
1222
  allow.groups(categoryWriteGroups),
1231
- allow.custom().to(authoringOperations),
1232
1223
  ]),
1233
1224
 
1234
1225
  SteeringProposal: modelWithoutSubscriptions({
@@ -1266,7 +1257,6 @@ export const schema = a.schema({
1266
1257
  ])
1267
1258
  .authorization((allow) => [
1268
1259
  allow.groups(categoryWriteGroups).to(["read"]),
1269
- allow.custom().to(authoringOperations),
1270
1260
  ]),
1271
1261
 
1272
1262
  SteeringDecision: modelWithoutSubscriptions({
@@ -1286,7 +1276,6 @@ export const schema = a.schema({
1286
1276
  ])
1287
1277
  .authorization((allow) => [
1288
1278
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1289
- allow.custom().to(authoringOperations),
1290
1279
  ]),
1291
1280
 
1292
1281
  Reference: realtimeModel({
@@ -1338,7 +1327,6 @@ export const schema = a.schema({
1338
1327
  ])
1339
1328
  .authorization((allow) => [
1340
1329
  allow.groups(categoryWriteGroups).to(["read"]),
1341
- allow.custom().to(authoringOperations),
1342
1330
  ]),
1343
1331
 
1344
1332
  ReferenceAttachment: modelWithoutSubscriptions({
@@ -1368,7 +1356,6 @@ export const schema = a.schema({
1368
1356
  ])
1369
1357
  .authorization((allow) => [
1370
1358
  allow.groups(categoryWriteGroups).to(["read"]),
1371
- allow.custom().to(authoringOperations),
1372
1359
  ]),
1373
1360
 
1374
1361
  SemanticNode: modelWithoutSubscriptions({
@@ -1406,7 +1393,6 @@ export const schema = a.schema({
1406
1393
  ])
1407
1394
  .authorization((allow) => [
1408
1395
  allow.groups(categoryWriteGroups).to(["read"]),
1409
- allow.custom().to(authoringOperations),
1410
1396
  ]),
1411
1397
 
1412
1398
  Message: realtimeModel({
@@ -1455,7 +1441,6 @@ export const schema = a.schema({
1455
1441
  ])
1456
1442
  .authorization((allow) => [
1457
1443
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1458
- allow.custom().to(authoringOperations),
1459
1444
  ]),
1460
1445
 
1461
1446
  MessageThread: realtimeModel({
@@ -1493,7 +1478,6 @@ export const schema = a.schema({
1493
1478
  .authorization((allow) => [
1494
1479
  allow.groups(categoryWriteGroups).to(["read", "create", "update"]),
1495
1480
  allow.authenticated("identityPool").to(authoringOperations),
1496
- allow.custom().to(authoringOperations),
1497
1481
  ]),
1498
1482
 
1499
1483
  ModelAttachment: modelWithoutSubscriptions({
@@ -1525,7 +1509,6 @@ export const schema = a.schema({
1525
1509
  ])
1526
1510
  .authorization((allow) => [
1527
1511
  allow.groups(categoryWriteGroups).to(["read"]),
1528
- allow.custom().to(authoringOperations),
1529
1512
  ]),
1530
1513
 
1531
1514
  SemanticRelationType: modelWithoutSubscriptions({
@@ -1553,7 +1536,6 @@ export const schema = a.schema({
1553
1536
  ])
1554
1537
  .authorization((allow) => [
1555
1538
  allow.groups(categoryWriteGroups),
1556
- allow.custom().to(authoringOperations),
1557
1539
  ]),
1558
1540
 
1559
1541
  SemanticRelation: modelWithoutSubscriptions({
@@ -1604,7 +1586,6 @@ export const schema = a.schema({
1604
1586
  ])
1605
1587
  .authorization((allow) => [
1606
1588
  allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
1607
- allow.custom().to(authoringOperations),
1608
1589
  ]),
1609
1590
 
1610
1591
  Item: modelWithoutSubscriptions({
@@ -1654,7 +1635,6 @@ export const schema = a.schema({
1654
1635
  ])
1655
1636
  .authorization((allow) => [
1656
1637
  allow.groups(contentWriteGroups),
1657
- allow.custom().to(authoringOperations),
1658
1638
  ]),
1659
1639
 
1660
1640
  Tag: modelWithoutSubscriptions({
@@ -1671,7 +1651,6 @@ export const schema = a.schema({
1671
1651
  ])
1672
1652
  .authorization((allow) => [
1673
1653
  allow.groups(contentWriteGroups),
1674
- allow.custom().to(authoringOperations),
1675
1654
  ]),
1676
1655
 
1677
1656
  ItemTag: modelWithoutSubscriptions({
@@ -1691,7 +1670,6 @@ export const schema = a.schema({
1691
1670
  ])
1692
1671
  .authorization((allow) => [
1693
1672
  allow.groups(contentWriteGroups),
1694
- allow.custom().to(authoringOperations),
1695
1673
  ]),
1696
1674
 
1697
1675
  MediaAsset: modelWithoutSubscriptions({
@@ -1724,7 +1702,6 @@ export const schema = a.schema({
1724
1702
  ])
1725
1703
  .authorization((allow) => [
1726
1704
  allow.groups(contentWriteGroups),
1727
- allow.custom().to(authoringOperations),
1728
1705
  ]),
1729
1706
 
1730
1707
  Edition: modelWithoutSubscriptions({
@@ -1756,7 +1733,6 @@ export const schema = a.schema({
1756
1733
  ])
1757
1734
  .authorization((allow) => [
1758
1735
  allow.groups(contentWriteGroups),
1759
- allow.custom().to(authoringOperations),
1760
1736
  ]),
1761
1737
 
1762
1738
  EditionItem: modelWithoutSubscriptions({
@@ -1779,7 +1755,6 @@ export const schema = a.schema({
1779
1755
  ])
1780
1756
  .authorization((allow) => [
1781
1757
  allow.groups(contentWriteGroups),
1782
- allow.custom().to(authoringOperations),
1783
1758
  ]),
1784
1759
 
1785
1760
  PublishedItem: modelWithoutSubscriptions({
@@ -1820,7 +1795,6 @@ export const schema = a.schema({
1820
1795
  .authorization((allow) => [
1821
1796
  allow.guest().to(["read"]),
1822
1797
  allow.groups(contentWriteGroups),
1823
- allow.custom().to(authoringOperations),
1824
1798
  ]),
1825
1799
 
1826
1800
  PublishedMediaAsset: modelWithoutSubscriptions({
@@ -1856,7 +1830,6 @@ export const schema = a.schema({
1856
1830
  .authorization((allow) => [
1857
1831
  allow.guest().to(["read"]),
1858
1832
  allow.groups(contentWriteGroups),
1859
- allow.custom().to(authoringOperations),
1860
1833
  ]),
1861
1834
 
1862
1835
  PublishedEdition: modelWithoutSubscriptions({
@@ -1882,7 +1855,6 @@ export const schema = a.schema({
1882
1855
  .authorization((allow) => [
1883
1856
  allow.guest().to(["read"]),
1884
1857
  allow.groups(contentWriteGroups),
1885
- allow.custom().to(authoringOperations),
1886
1858
  ]),
1887
1859
 
1888
1860
  PublishedEditionItem: modelWithoutSubscriptions({
@@ -1907,7 +1879,6 @@ export const schema = a.schema({
1907
1879
  .authorization((allow) => [
1908
1880
  allow.guest().to(["read"]),
1909
1881
  allow.groups(contentWriteGroups),
1910
- allow.custom().to(authoringOperations),
1911
1882
  ]),
1912
1883
 
1913
1884
  PublishedCategorySet: modelWithoutSubscriptions({
@@ -1933,7 +1904,6 @@ export const schema = a.schema({
1933
1904
  .authorization((allow) => [
1934
1905
  allow.guest().to(["read"]),
1935
1906
  allow.groups(contentWriteGroups),
1936
- allow.custom().to(authoringOperations),
1937
1907
  ]),
1938
1908
 
1939
1909
  PublishedCategory: modelWithoutSubscriptions({
@@ -1969,7 +1939,6 @@ export const schema = a.schema({
1969
1939
  .authorization((allow) => [
1970
1940
  allow.guest().to(["read"]),
1971
1941
  allow.groups(contentWriteGroups),
1972
- allow.custom().to(authoringOperations),
1973
1942
  ]),
1974
1943
  }).authorization((allow) => [
1975
1944
  allow.resource(categoryAction),
@@ -2,7 +2,6 @@
2
2
  from __future__ import annotations
3
3
 
4
4
  import json
5
- import os
6
5
  import sys
7
6
  from pathlib import Path
8
7
  from typing import Any
@@ -16,14 +15,6 @@ for root in SEARCH_PATHS:
16
15
  sys.path.insert(0, str(root))
17
16
 
18
17
 
19
- def _ensure_graphql_authoring_jwt() -> None:
20
- if not os.environ.get("AWS_LAMBDA_FUNCTION_NAME", "").strip():
21
- return
22
- from papyrus_content.env import ensure_graphql_authoring_jwt # type: ignore
23
-
24
- ensure_graphql_authoring_jwt()
25
-
26
-
27
18
  def _error(code: str, message: str, *, retryable: bool = False) -> dict[str, Any]:
28
19
  return {
29
20
  "ok": False,
@@ -94,7 +85,6 @@ def _execute_tactus(arguments: dict[str, Any], web_ui_context: dict[str, Any] |
94
85
 
95
86
 
96
87
  def main() -> None:
97
- _ensure_graphql_authoring_jwt()
98
88
  raw = sys.stdin.read()
99
89
  payload = json.loads(raw or "{}")
100
90
  mode = str(payload.get("mode") or "").strip()
@@ -19,11 +19,6 @@ export class ConsoleChatResponderStack extends NestedStack {
19
19
  PAPYRUS_CONSOLE_STATIC_CONTEXT_TTL_SECONDS: process.env.PAPYRUS_CONSOLE_STATIC_CONTEXT_TTL_SECONDS || "900",
20
20
  PAPYRUS_EXECUTE_TACTUS_RUNNER: process.env.PAPYRUS_EXECUTE_TACTUS_RUNNER || "/opt/papyrus/execute_tactus_runner.py",
21
21
  PAPYRUS_EXECUTE_TACTUS_TIMEOUT_SECONDS: process.env.PAPYRUS_EXECUTE_TACTUS_TIMEOUT_SECONDS || "30",
22
- PAPYRUS_JWT_ISSUER: process.env.PAPYRUS_JWT_ISSUER || "papyrus-cli",
23
- PAPYRUS_JWT_SUBJECT: process.env.PAPYRUS_JWT_SUBJECT || "papyrus-cli",
24
- PAPYRUS_JWT_AUDIENCE: process.env.PAPYRUS_JWT_AUDIENCE || "papyrus-authoring",
25
- PAPYRUS_JWT_GROUPS: process.env.PAPYRUS_JWT_GROUPS || "editor",
26
- ...(props.amplifySsmEnvConfig ? { AMPLIFY_SSM_ENV_CONFIG: props.amplifySsmEnvConfig } : {}),
27
22
  };
28
23
  const imageUri = props.prebuiltImageUri?.trim() || process.env.PAPYRUS_CONSOLE_RESPONDER_IMAGE_URI?.trim() || "";
29
24
  const allowLocalImageBuild = parseBooleanEnv(process.env.PAPYRUS_CONSOLE_RESPONDER_ALLOW_LOCAL_BUILD);
@@ -87,8 +82,6 @@ export class ConsoleChatResponderStack extends NestedStack {
87
82
  ],
88
83
  }));
89
84
  const stack = Stack.of(this);
90
- // execute_tactus_runner mints PAPYRUS_GRAPHQL_JWT via boto3 get_parameters; branch policies
91
- // often grant GetParameters on path prefixes, not GetParameter per secret name.
92
85
  this.responderFunction.addToRolePolicy(new PolicyStatement({
93
86
  effect: Effect.ALLOW,
94
87
  actions: ["ssm:GetParameter", "ssm:GetParameters"],
@@ -12,7 +12,6 @@ export type ConsoleChatResponderStackProps = NestedStackProps & {
12
12
  threadTable: ITable;
13
13
  projectRoot: string;
14
14
  graphqlEndpoint: string;
15
- amplifySsmEnvConfig?: string;
16
15
  responseTarget?: string;
17
16
  model?: string;
18
17
  prebuiltImageUri?: string;
@@ -36,11 +35,6 @@ export class ConsoleChatResponderStack extends NestedStack {
36
35
  PAPYRUS_CONSOLE_STATIC_CONTEXT_TTL_SECONDS: process.env.PAPYRUS_CONSOLE_STATIC_CONTEXT_TTL_SECONDS || "900",
37
36
  PAPYRUS_EXECUTE_TACTUS_RUNNER: process.env.PAPYRUS_EXECUTE_TACTUS_RUNNER || "/opt/papyrus/execute_tactus_runner.py",
38
37
  PAPYRUS_EXECUTE_TACTUS_TIMEOUT_SECONDS: process.env.PAPYRUS_EXECUTE_TACTUS_TIMEOUT_SECONDS || "30",
39
- PAPYRUS_JWT_ISSUER: process.env.PAPYRUS_JWT_ISSUER || "papyrus-cli",
40
- PAPYRUS_JWT_SUBJECT: process.env.PAPYRUS_JWT_SUBJECT || "papyrus-cli",
41
- PAPYRUS_JWT_AUDIENCE: process.env.PAPYRUS_JWT_AUDIENCE || "papyrus-authoring",
42
- PAPYRUS_JWT_GROUPS: process.env.PAPYRUS_JWT_GROUPS || "editor",
43
- ...(props.amplifySsmEnvConfig ? { AMPLIFY_SSM_ENV_CONFIG: props.amplifySsmEnvConfig } : {}),
44
38
  };
45
39
 
46
40
  const imageUri = props.prebuiltImageUri?.trim() || process.env.PAPYRUS_CONSOLE_RESPONDER_IMAGE_URI?.trim() || "";
@@ -109,8 +103,6 @@ export class ConsoleChatResponderStack extends NestedStack {
109
103
  ],
110
104
  }));
111
105
  const stack = Stack.of(this);
112
- // execute_tactus_runner mints PAPYRUS_GRAPHQL_JWT via boto3 get_parameters; branch policies
113
- // often grant GetParameters on path prefixes, not GetParameter per secret name.
114
106
  this.responderFunction.addToRolePolicy(new PolicyStatement({
115
107
  effect: Effect.ALLOW,
116
108
  actions: ["ssm:GetParameter", "ssm:GetParameters"],
@@ -3017,15 +3017,6 @@ fn optional_env(name: &str) -> Option<String> {
3017
3017
  .filter(|value| !value.is_empty())
3018
3018
  }
3019
3019
 
3020
- fn normalize_jwt(token: String) -> String {
3021
- token
3022
- .trim()
3023
- .trim_start_matches("Bearer ")
3024
- .trim_start_matches("bearer ")
3025
- .trim()
3026
- .to_string()
3027
- }
3028
-
3029
3020
  fn format_error_chain(error: &anyhow::Error) -> String {
3030
3021
  error
3031
3022
  .chain()
@@ -1,10 +1,18 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import json
4
+ import os
4
5
  from typing import Any
5
6
 
6
7
  from papyrus_content.graphql_authoring import create_authoring_client
7
8
  from papyrus_content.markus_renderer.derive import derive_body
9
+ from papyrus_content.rebuild_trigger import (
10
+ DEFAULT_STAGING_BRANCH,
11
+ reader_target_from_environment,
12
+ trigger_pretext_revalidation,
13
+ trigger_rebuild,
14
+ trigger_staging_build,
15
+ )
8
16
  from papyrus_content.publishing import (
9
17
  ItemFields,
10
18
  PublishError,
@@ -72,25 +80,57 @@ def save_item_draft_action(arguments: dict, actor: str) -> dict:
72
80
  }
73
81
 
74
82
 
83
+ def site_triggers_for(client, item_id: str) -> dict:
84
+ triggers: dict = {}
85
+ reader_app_id, reader_branch = reader_target_from_environment()
86
+ revalidate_base_url = (os.environ.get("PAPYRUS_REVALIDATE_BASE_URL") or "").strip()
87
+ if revalidate_base_url:
88
+ try:
89
+ item = client.get_record("Item", item_id) or {}
90
+ slugs = [item["slug"]] if item.get("slug") else []
91
+ revalidated = trigger_pretext_revalidation(slugs, None, base_url=revalidate_base_url)
92
+ triggers["revalidated"] = revalidated if revalidated is not None else {"ok": False, "reason": "not-configured"}
93
+ except Exception as error: # noqa: BLE001 - a trigger failure never fails the publish
94
+ triggers["revalidated"] = {"ok": False, "error": f"{type(error).__name__}: {error}"}
95
+ if reader_app_id:
96
+ triggers["rebuild"] = trigger_rebuild(reader_app_id=reader_app_id, reader_branch=reader_branch)
97
+ return triggers
98
+
99
+
75
100
  def publish_item_action(arguments: dict, actor: str) -> dict:
76
101
  client, _claims = create_authoring_client()
77
102
  result = publish_item(client, arguments["id"], actor=actor)
78
- return {
103
+ response = {
79
104
  "ok": True,
80
105
  "changed": result.changed,
81
106
  "publishedId": result.published_item_id,
82
107
  "versionNumber": result.version_number,
83
108
  }
109
+ if result.changed:
110
+ response.update(site_triggers_for(client, arguments["id"]))
111
+ return response
84
112
 
85
113
 
86
114
  def unpublish_item_action(arguments: dict, actor: str) -> dict:
87
115
  client, _claims = create_authoring_client()
88
116
  result = unpublish_item(client, arguments["id"], actor=actor)
89
- return {"ok": True, "changed": result.changed}
117
+ response = {"ok": True, "changed": result.changed}
118
+ if result.changed:
119
+ response.update(site_triggers_for(client, arguments["id"]))
120
+ return response
121
+
122
+
123
+ def request_staging_build_action() -> dict:
124
+ cms_app_id = (os.environ.get("PAPYRUS_CMS_AMPLIFY_APP_ID") or "").strip()
125
+ if not cms_app_id:
126
+ return {"ok": False, "errors": [{"code": "staging-build-not-configured", "message": "This site has no staging build configured.", "line": None}]}
127
+ staging_branch = (os.environ.get("PAPYRUS_STAGING_BRANCH") or "").strip() or DEFAULT_STAGING_BRANCH
128
+ build = trigger_staging_build(cms_app_id=cms_app_id, staging_branch=staging_branch)
129
+ return {"ok": True, "build": build}
90
130
 
91
131
 
92
132
  def handler(event, context):
93
- field = event["info"]["fieldName"]
133
+ field = event["fieldName"]
94
134
  arguments = parse_input(event["arguments"]["input"])
95
135
  actor = actor_from_event(event)
96
136
  try:
@@ -102,6 +142,8 @@ def handler(event, context):
102
142
  return publish_item_action(arguments, actor)
103
143
  if field == "unpublishItem":
104
144
  return unpublish_item_action(arguments, actor)
145
+ if field == "requestStagingBuild":
146
+ return request_staging_build_action()
105
147
  except PublishError as error:
106
148
  return failure_response(error)
107
149
  raise ValueError(f"Unsupported field {field}")
@@ -0,0 +1,22 @@
1
+ export const REBUILD_TRIGGER_ACTIONS = ["amplify:StartJob", "amplify:ListJobs"];
2
+ function branchJobsArn(input, appId, branch) {
3
+ return `arn:aws:amplify:${input.region}:${input.account}:apps/${appId}/branches/${branch}/jobs/*`;
4
+ }
5
+ export function rebuildTriggerSettings(input) {
6
+ const environment = {};
7
+ const resources = [];
8
+ const readerAppId = (input.reader?.amplifyAppId ?? "").trim();
9
+ if (readerAppId !== "") {
10
+ const readerBranch = (input.reader?.branchName ?? "").trim() || "main";
11
+ environment.PAPYRUS_READER_AMPLIFY_APP_ID = readerAppId;
12
+ environment.PAPYRUS_READER_BRANCH = readerBranch;
13
+ resources.push(branchJobsArn(input, readerAppId, readerBranch));
14
+ }
15
+ const cmsAppId = input.cmsAppId.trim();
16
+ if (input.stagingBuildEnabled && cmsAppId !== "") {
17
+ environment.PAPYRUS_CMS_AMPLIFY_APP_ID = cmsAppId;
18
+ environment.PAPYRUS_STAGING_BRANCH = "staging";
19
+ resources.push(branchJobsArn(input, cmsAppId, "staging"));
20
+ }
21
+ return { environment, actions: REBUILD_TRIGGER_ACTIONS, resources };
22
+ }