@anthusai/papyrus 2.0.0-next.5 → 2.0.0-next.51

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 (162) hide show
  1. package/amplify/data/resource.js +23 -3
  2. package/amplify/data/resource.ts +25 -3
  3. package/amplify/data/schema.js +2028 -1979
  4. package/amplify/data/schema.ts +72 -14
  5. package/amplify/functions/assignment-action/data-access.js +90 -0
  6. package/amplify/functions/assignment-action/data-access.ts +89 -0
  7. package/amplify/functions/assignment-action/handler.ts +1 -1
  8. package/amplify/functions/content-actions/handler.py +53 -2
  9. package/amplify/functions/content-actions/requirements.txt +1 -0
  10. package/amplify/functions/content-actions/resource.js +1 -1
  11. package/amplify/functions/content-actions/resource.ts +1 -1
  12. package/amplify/functions/editorial-checks/handler.py +14 -0
  13. package/amplify/functions/editorial-checks/requirements.txt +1 -0
  14. package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.js +7 -7
  15. package/amplify/{plugins/editorial-checks/function → functions/editorial-checks}/resource.ts +7 -7
  16. package/amplify/functions/editorial-checks/schema.js +121 -0
  17. package/amplify/{plugins → functions}/editorial-checks/schema.ts +33 -6
  18. package/amplify/functions/editorial-checks/wire.js +53 -0
  19. package/amplify/functions/editorial-checks/wire.ts +61 -0
  20. package/amplify/functions/monitoring-view/handler.py +11 -0
  21. package/amplify/functions/monitoring-view/resource.js +24 -0
  22. package/amplify/functions/monitoring-view/resource.ts +34 -0
  23. package/amplify/functions/monitoring-view/schema.js +16 -0
  24. package/amplify/functions/monitoring-view/schema.ts +18 -0
  25. package/amplify/functions/monitoring-view/wire.js +37 -0
  26. package/amplify/functions/monitoring-view/wire.ts +47 -0
  27. package/amplify/functions/public-forms/core.js +247 -0
  28. package/amplify/functions/public-forms/core.ts +310 -0
  29. package/amplify/functions/public-forms/handler.ts +41 -0
  30. package/amplify/functions/public-forms/origins.js +35 -0
  31. package/amplify/functions/public-forms/origins.ts +43 -0
  32. package/amplify/functions/public-forms/resource.js +9 -0
  33. package/amplify/functions/public-forms/resource.ts +10 -0
  34. package/amplify/functions/public-forms/wire.js +25 -0
  35. package/amplify/functions/public-forms/wire.ts +32 -0
  36. package/amplify/functions/shared/editorial-context.ts +63 -4
  37. package/amplify/functions/shared/python-bundle.js +20 -14
  38. package/amplify/functions/shared/python-bundle.ts +25 -18
  39. package/amplify/plugins/newsletter/config.js +195 -0
  40. package/amplify/plugins/newsletter/config.ts +240 -0
  41. package/amplify/plugins/newsletter/function/handler.py +6 -0
  42. package/amplify/plugins/newsletter/function/requirements.txt +5 -0
  43. package/amplify/plugins/newsletter/ops/handler.py +12 -0
  44. package/amplify/plugins/newsletter/ops/resource.js +27 -0
  45. package/amplify/plugins/newsletter/ops/resource.ts +37 -0
  46. package/amplify/plugins/newsletter/papyrus.plugin.js +260 -0
  47. package/amplify/plugins/newsletter/papyrus.plugin.ts +308 -0
  48. package/amplify/plugins/newsletter/schema.js +56 -0
  49. package/amplify/plugins/newsletter/schema.ts +61 -0
  50. package/amplify/plugins/newsletter/secure-string-parameter.js +107 -0
  51. package/amplify/plugins/newsletter/secure-string-parameter.ts +120 -0
  52. package/amplify/plugins/newsletter/sending.js +140 -0
  53. package/amplify/plugins/newsletter/sending.ts +186 -0
  54. package/amplify/plugins/reader-steering/config.js +162 -0
  55. package/amplify/plugins/reader-steering/config.ts +248 -0
  56. package/amplify/plugins/reader-steering/function/ai_moderation.py +246 -0
  57. package/amplify/plugins/reader-steering/function/handler.py +1363 -0
  58. package/amplify/plugins/reader-steering/function/moderation-prompt.md +27 -0
  59. package/amplify/plugins/reader-steering/function/moderation.py +316 -0
  60. package/amplify/plugins/reader-steering/function/resource.js +27 -0
  61. package/amplify/plugins/reader-steering/function/resource.ts +35 -0
  62. package/amplify/plugins/reader-steering/papyrus.plugin.js +175 -0
  63. package/amplify/plugins/reader-steering/papyrus.plugin.ts +201 -0
  64. package/amplify/plugins/reader-steering/schema.js +140 -0
  65. package/amplify/plugins/reader-steering/schema.ts +142 -0
  66. package/amplify/plugins/registry.js +4 -2
  67. package/amplify/plugins/registry.ts +4 -2
  68. package/amplify/plugins/types.ts +5 -0
  69. package/amplify/plugins/wire.js +1 -0
  70. package/amplify/plugins/wire.ts +1 -0
  71. package/amplify/publication/redirect-and-index.js +105 -0
  72. package/amplify/publication/redirect-rules.js +73 -0
  73. package/amplify/publication/redirect-rules.ts +93 -0
  74. package/amplify/publication/s3-projection.js +7 -1
  75. package/amplify/publication/s3-projection.ts +9 -1
  76. package/amplify/site-backend-config.ts +17 -0
  77. package/amplify/site-backend.js +36 -1
  78. package/amplify/site-backend.ts +44 -1
  79. package/app/api/newsletter/confirm/route.ts +13 -0
  80. package/app/api/newsletter/preferences/route.ts +13 -0
  81. package/app/api/newsletter/subscribe/route.ts +9 -0
  82. package/app/api/newsletter/unsubscribe/route.ts +13 -0
  83. package/app/api/newsroom/curation/context/route.ts +9 -0
  84. package/app/api/newsroom/curation/priming/route.ts +9 -0
  85. package/app/api/newsroom/curation/publication/route.ts +9 -0
  86. package/app/api/reader/comment/delete/route.ts +9 -0
  87. package/app/api/reader/comment/edit/route.ts +9 -0
  88. package/app/api/reader/comment/route.ts +9 -0
  89. package/app/api/reader/handle/route.ts +9 -0
  90. package/app/api/reader/me/route.ts +9 -0
  91. package/app/api/reader/rating/route.ts +9 -0
  92. package/app/api/reader/report/route.ts +9 -0
  93. package/app/api/reader/retired/route.ts +9 -0
  94. package/app/api/reader/submit/route.ts +9 -0
  95. package/app/api/reader/vote/route.ts +9 -0
  96. package/bin/papyrus-infra.mjs +20 -1
  97. package/components/editorial-checks-admin-panel.tsx +36 -11
  98. package/components/moderation-panel.tsx +248 -0
  99. package/components/monitoring-overview-view.tsx +241 -0
  100. package/components/monitoring-panel.tsx +40 -0
  101. package/components/newsletter-panel.tsx +474 -0
  102. package/components/newsletter-sections.tsx +163 -0
  103. package/components/newsroom-article-editor.tsx +2 -4
  104. package/components/newsroom-board-view.tsx +4 -1
  105. package/components/newsroom-curation-bootstrap.tsx +45 -0
  106. package/components/newsroom-organizer.css +31 -0
  107. package/components/newsroom-references-view.tsx +14 -14
  108. package/components/publication-cyclotron-panel.tsx +15 -10
  109. package/components/reference-add-entry.tsx +75 -0
  110. package/components/reference-curation-controls.tsx +31 -22
  111. package/components/reference-cyclotron-priming.tsx +58 -19
  112. package/components/reference-cyclotron-suggestion.tsx +1 -1
  113. package/components/reference-priming.tsx +14 -10
  114. package/components/reference-section-suggestion.tsx +1 -1
  115. package/components/topic-steering-workspace.tsx +64 -20
  116. package/components/use-editorial-checks.ts +12 -10
  117. package/infra/amplify-app-shell.js +90 -16
  118. package/infra/amplify-app-shell.ts +102 -18
  119. package/infra/index.js +1 -0
  120. package/infra/secure-string-parameter-handler.js +41 -0
  121. package/infra/secure-string-parameter-handler.ts +41 -0
  122. package/infra/secure-string-parameter.js +79 -0
  123. package/infra/secure-string-parameter.ts +91 -0
  124. package/infra/site-config.js +85 -6
  125. package/infra/site-config.ts +123 -6
  126. package/lib/category-repository.ts +11 -9
  127. package/lib/curation-routes.ts +345 -0
  128. package/lib/editorial-checks-backend.ts +1 -1
  129. package/lib/editorial-checks-client.ts +19 -1
  130. package/lib/editorial-checks-demo.ts +2 -2
  131. package/lib/editorial-checks-settings.ts +3 -0
  132. package/lib/editorial-checks.ts +8 -11
  133. package/lib/editorial-preview.ts +5 -5
  134. package/lib/monitoring-client.ts +29 -0
  135. package/lib/monitoring-overview-fixture.ts +51 -0
  136. package/lib/monitoring-overview.ts +145 -0
  137. package/lib/newsletter-api.ts +435 -0
  138. package/lib/newsletter-client.ts +46 -0
  139. package/lib/newsletter-fixture.ts +184 -0
  140. package/lib/newsletter-model.ts +202 -0
  141. package/lib/newsletter-pages.ts +364 -0
  142. package/lib/newsroom-board.ts +27 -2
  143. package/lib/prospectus-session.ts +15 -14
  144. package/lib/prospectus-sign-in-routes.ts +54 -13
  145. package/lib/prospectus-site-identity.ts +24 -1
  146. package/lib/reader-api.ts +145 -0
  147. package/lib/reader-moderation.ts +220 -0
  148. package/lib/reader-retirement-route.ts +89 -0
  149. package/lib/reader-subject.md +29 -0
  150. package/lib/reader-subject.ts +53 -0
  151. package/lib/relevance-status.ts +2 -2
  152. package/lib/site-brand-tenant.ts +11 -6
  153. package/lib/site-brand.ts +6 -3
  154. package/lib/site-origin.ts +67 -0
  155. package/middleware.ts +14 -3
  156. package/package.json +42 -4
  157. package/routes.manifest.json +191 -1
  158. package/amplify/plugins/editorial-checks/function/handler.py +0 -11
  159. package/amplify/plugins/editorial-checks/function/requirements.txt +0 -1
  160. package/amplify/plugins/editorial-checks/papyrus.plugin.js +0 -50
  161. package/amplify/plugins/editorial-checks/papyrus.plugin.ts +0 -63
  162. package/amplify/plugins/editorial-checks/schema.js +0 -94
@@ -1,94 +0,0 @@
1
- import { a } from "@aws-amplify/backend";
2
- import { editorialChecks } from "./function/resource.js";
3
- const editors = ["editor", "admin"];
4
- /**
5
- * Policies, settings and editors' decisions live in Papyrus; Limatus checks
6
- * content against them. Editors read policies and record decisions; admins
7
- * manage policies and settings. Only the function (IAM) calls Limatus.
8
- */
9
- export function editorialChecksSchemaDefinitions() {
10
- return {
11
- EditorialPolicy: a
12
- .model({
13
- id: a.id().required(),
14
- policyKey: a.string().required(),
15
- scope: a.string().required(),
16
- version: a.integer().required(),
17
- title: a.string().required(),
18
- guidance: a.string().required(),
19
- severity: a.string().required(),
20
- enabled: a.boolean().required(),
21
- detectors: a.json().required(),
22
- examples: a.json(),
23
- rewriteGuidance: a.string(),
24
- source: a.string().required(),
25
- })
26
- .disableOperations(["subscriptions"])
27
- .authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
28
- EditorialCheckSettings: a
29
- .model({
30
- id: a.id().required(),
31
- settings: a.json().required(),
32
- })
33
- .disableOperations(["subscriptions"])
34
- .authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
35
- EditorialFeedback: a
36
- .model({
37
- id: a.id().required(),
38
- itemId: a.string().required(),
39
- findingId: a.string().required(),
40
- policyId: a.string().required(),
41
- detectorId: a.string().required(),
42
- lane: a.string().required(),
43
- probability: a.float(),
44
- decision: a.string().required(),
45
- reason: a.string(),
46
- text: a.string(),
47
- })
48
- .disableOperations(["subscriptions"])
49
- .secondaryIndexes((index) => [index("itemId").queryField("listEditorialFeedbackByItem")])
50
- .authorization((allow) => [allow.group("editor").to(["create", "read"]), allow.group("admin")]),
51
- checkEditorial: a
52
- .query()
53
- .arguments({ body: a.string().required(), format: a.string(), section: a.string() })
54
- .returns(a.json())
55
- .authorization((allow) => [allow.groups(editors)])
56
- .handler(a.handler.function(editorialChecks)),
57
- suggestEditorialRewrite: a
58
- .query()
59
- .arguments({
60
- body: a.string().required(),
61
- format: a.string(),
62
- section: a.string(),
63
- finding: a.json(),
64
- selection: a.json(),
65
- note: a.string(),
66
- })
67
- .returns(a.json())
68
- .authorization((allow) => [allow.groups(editors)])
69
- .handler(a.handler.function(editorialChecks)),
70
- draftEditorialQuestions: a
71
- .query()
72
- .arguments({ title: a.string().required(), guidance: a.string().required(), examples: a.json() })
73
- .returns(a.json())
74
- .authorization((allow) => [allow.group("admin")])
75
- .handler(a.handler.function(editorialChecks)),
76
- tryEditorialPolicy: a
77
- .query()
78
- .arguments({ policy: a.json().required(), text: a.string().required(), format: a.string() })
79
- .returns(a.json())
80
- .authorization((allow) => [allow.group("admin")])
81
- .handler(a.handler.function(editorialChecks)),
82
- importEditorialStarterPack: a
83
- .mutation()
84
- .arguments({ name: a.string().required() })
85
- .returns(a.json())
86
- .authorization((allow) => [allow.group("admin")])
87
- .handler(a.handler.function(editorialChecks)),
88
- recalibrateEditorialPolicies: a
89
- .mutation()
90
- .returns(a.json())
91
- .authorization((allow) => [allow.group("admin")])
92
- .handler(a.handler.function(editorialChecks)),
93
- };
94
- }